#!/bin/csh
#
# Data Assimilation Research Testbed -- DART
# Copyright 2004, Data Assimilation Initiative, University Corporation for Atmospheric Research
# Licensed under the GPL -- www.gpl.org/licenses/gpl.html
#
# $Id: BuildWRF,v 1.3 2004/08/31 17:23:24 caya Exp $
#
# script to run an experiment with existing initial conditions
#======================================================================
# Find the project and build it, if need be.
#======================================================================

if ( ${?DART_HOME} ) then
   if ( -d $DART_HOME ) then
      setenv DARTHOME $DART_HOME
   else
      echo "$DART_HOME does not exist on this platform"
      exit
   endif
else
   echo "no DART project"
   exit
endif

echo "DART project directory is $DARTHOME"
sleep 2

set Model = wrf

cd ${DARTHOME}/models/${Model}/work

if !( -e dart_tf_wrf ) then
   csh mkmf_dart_tf_wrf
   make || exit 1
endif
if !( -e update_wrf_bc ) then
   csh mkmf_update_wrf_bc
   make || exit 2
endif
if !( -e create_fixed_network_seq ) then
   csh mkmf_create_fixed_network_seq
   make || exit 5
endif
if !( -e create_obs_sequence ) then
   csh mkmf_create_obs_sequence
   make || exit 6
endif
if !( -e perfect_model_obs ) then
   csh mkmf_perfect_model_obs
   make || exit 7
endif
if !( -e filter ) then
   csh mkmf_filter
   make || exit 8
endif

\rm -f *.o *.d *.mod Makefile

exit
