#!/bin/csh
#
# Data Assimilation Research Testbed -- DART
# Copyright 2004, 2005, Data Assimilation Initiative, University Corporation for Atmospheric Research
# Licensed under the GPL -- www.gpl.org/licenses/gpl.html
#
# <next three lines automatically updated by CVS, do not edit>
# $Id: BuildWRF,v 1.4 2005/02/26 06:14:27 thoar Exp $
# $Source: /home/thoar/CVS.REPOS/DART/shell_scripts/BuildWRF,v $
# $Name: pre_iceland $
#
# 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
