[Dart-dev] DART/branches Revision: 13202

dart at ucar.edu dart at ucar.edu
Tue Jul 23 10:14:07 MDT 2019


thoar at ucar.edu
2019-07-23 10:14:07 -0600 (Tue, 23 Jul 2019)
133
Using more robust build logic.

More in line with all the other model builds.
Specifies which targets are mpi via a shell variable.




Modified: DART/branches/rma_wrfHydro/models/noah/work/quickbuild.csh
===================================================================
--- DART/branches/rma_wrfHydro/models/noah/work/quickbuild.csh	2019-07-23 13:32:07 UTC (rev 13201)
+++ DART/branches/rma_wrfHydro/models/noah/work/quickbuild.csh	2019-07-23 16:14:07 UTC (rev 13202)
@@ -10,113 +10,173 @@
 # compile all programs in the current directory with 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.
 #----------------------------------------------------------------------
-# '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.
+
+# this model name:
+set BUILDING = "noah"
+
+# programs which have the option of building with MPI:
+set MPI_TARGETS = "filter perfect_model_obs model_mod_check closest_member_tool"
+
+# set default (override with -mpi or -nompi):
+#  0 = build without MPI, 1 = build with MPI
+set with_mpi = 0
+
+
+# ---------------
+# 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 tdebug = 0
+set cdebug = 0
+
+if ( $?CODE_DEBUG ) then
+   set cdebug = $CODE_DEBUG
+endif
+if ( $?DART_TEST ) then
+   set tdebug = $DART_TEST
+endif
+
+\rm -f *.o *.mod Makefile .cppdefs
+
 #----------------------------------------------------------------------
+# Build any NetCDF files from .cdl files
+#----------------------------------------------------------------------
 
-\rm -f preprocess *.o *.mod Makefile .cppdefs
-\rm -f ../../../obs_def/obs_def_mod.f90
-\rm -f ../../../obs_kind/obs_kind_mod.f90
+@ n = 0
 
-set MODEL = "noah"
+@ has_cdl = `ls *.cdl | wc -l` >& /dev/null
 
-@ n = 1
+if ( $has_cdl > 0 ) then
+   foreach DATAFILE ( *.cdl )
 
-echo
-echo
-echo "---------------------------------------------------------------"
-echo "${MODEL} build number ${n} is preprocess"
+      set OUTNAME = `basename $DATAFILE .cdl`.nc
 
-csh  mkmf_preprocess
-make || exit $n
+      if ( ! -f $OUTNAME ) then
+         @ n = $n + 1
+         echo
+         echo "---------------------------------------------------"
+         echo "constructing $BUILDING data file $n named $OUTNAME"
 
-./preprocess || exit 99
+         ncgen -o $OUTNAME $DATAFILE  || exit $n
+      endif
 
+   end
+endif
+
+
 #----------------------------------------------------------------------
 # Build all the single-threaded targets
 #----------------------------------------------------------------------


More information about the Dart-dev mailing list