[Dart-dev] DART/branches Revision: 11416

dart at ucar.edu dart at ucar.edu
Wed Mar 29 17:03:45 MDT 2017


nancy at ucar.edu
2017-03-29 17:03:45 -0600 (Wed, 29 Mar 2017)
23
updated build script.




Modified: DART/branches/model_mod_changes/models/wrf/work/quickbuild.csh
===================================================================
--- DART/branches/model_mod_changes/models/wrf/work/quickbuild.csh	2017-03-29 23:03:03 UTC (rev 11415)
+++ DART/branches/model_mod_changes/models/wrf/work/quickbuild.csh	2017-03-29 23:03:45 UTC (rev 11416)
@@ -1,4 +1,4 @@
-#!/bin/csh
+#!/bin/csh 
 #
 # DART software - Copyright UCAR. This open source software is provided
 # by UCAR, "as is", without charge, subject to all terms of use at
@@ -5,126 +5,162 @@
 # http://www.image.ucar.edu/DAReS/DART/DART_download
 #
 # DART $Id$
-#
-# This script compiles all executables in this directory.
 
 #----------------------------------------------------------------------
-# 'preprocess' is a program that culls the appropriate sections of the
-# observation module for the observations types in 'input.nml'; the 
-# resulting source file is used by all the remaining programs, 
-# so this MUST be run first.
+# compile all programs in the current directory that have a mkmf_xxx file.
+#
+# usage: [ -mpi | -nompi ]
+#
+#
+# environment variable options:
+#  before running this script, do:
+#   "setenv CODE_DEBUG 1" (csh) or "export CODE_DEBUG=1" (bash)
+#  to keep the .o and .mod files in the current directory instead of 
+#  removing them at the end.  this usually improves runtime error reports 
+#  and these files are required by most debuggers.
 #----------------------------------------------------------------------
 
-\rm -f preprocess *.o *.mod
-\rm -f ../../../obs_def/obs_def_mod.f90
-\rm -f ../../../obs_kind/obs_kind_mod.f90
-
+# this model name:
 set MODEL = "wrf"
 
-@ n = 1
+# programs which have the option of building with MPI:
+set MPI_TARGETS = "filter perfect_model_obs model_mod_check wakeup_filter"
 
-echo
-echo
-echo "---------------------------------------------------------------"
-echo "${MODEL} build number ${n} is preprocess"
+# set default (override with -mpi or -nompi):
+#  0 = build without MPI, 1 = build with MPI
+set with_mpi = 1
 
-csh  mkmf_preprocess
-make || exit $n
 
-./preprocess || exit 99
+# ---------------
+# shouldn't have to modify this script below here.
 
+if ( $#argv >= 1 ) then
+   if ( "$1" == "-mpi" ) then
+      set with_mpi = 1 
+   else if ( "$1" == "-nompi" ) then
+      set with_mpi = 0
+   else
+      echo usage: $0 '[ -mpi | -nompi ]'
+      exit 0
+   endif
+endif
+
+set preprocess_done = 0
+set cdebug = 0
+
+if ( $?CODE_DEBUG ) then
+   set cdebug = $CODE_DEBUG
+endif
+
+
 #----------------------------------------------------------------------
+# Build any NetCDF files from .cdl files
+#----------------------------------------------------------------------
+
+@ n = 0
+
+@ has_cdl = `ls *.cdl | wc -l` >& /dev/null
+
+if ( $has_cdl > 0 ) then
+   foreach DATAFILE ( *.cdl )
+   
+      set OUTNAME = `basename $DATAFILE .cdl`.nc
+   
+      if ( ! -f $OUTNAME ) then
+         @ n = $n + 1
+         echo
+         echo "---------------------------------------------------"
+         echo "constructing $MODEL data file $n named $OUTNAME" 
+      
+         ncgen -o $OUTNAME $DATAFILE  || exit $n
+      endif


More information about the Dart-dev mailing list