[Dart-dev] [6061] DART/branches/development/models/CESM/shell_scripts/CESM1_1_1_setup. csh: added a couple lines of error checking before

nancy at ucar.edu nancy at ucar.edu
Wed Apr 17 14:49:59 MDT 2013


Revision: 6061
Author:   nancy
Date:     2013-04-17 14:49:58 -0600 (Wed, 17 Apr 2013)
Log Message:
-----------
added a couple lines of error checking before
starting the cesm build - if some of the dirs
are set wrong for dart, or if you haven't built
all the needed executables, this script would
fail after you've waited to build CESM.

Modified Paths:
--------------
    DART/branches/development/models/CESM/shell_scripts/CESM1_1_1_setup.csh

-------------- next part --------------
Modified: DART/branches/development/models/CESM/shell_scripts/CESM1_1_1_setup.csh
===================================================================
--- DART/branches/development/models/CESM/shell_scripts/CESM1_1_1_setup.csh	2013-04-17 17:47:18 UTC (rev 6060)
+++ DART/branches/development/models/CESM/shell_scripts/CESM1_1_1_setup.csh	2013-04-17 20:49:58 UTC (rev 6061)
@@ -161,6 +161,35 @@
 endsw
 
 # ==============================================================================
+# some simple error checking before diving into the work
+# ==============================================================================
+
+# make sure these directories exist
+set musthavedirs = "cesm_datadir cesmroot DARTroot"
+foreach VAR ( $musthavedirs )
+   # VAR is the shell variable name, DIR is the value
+   set DIR = `eval echo \${$VAR}`
+   if ( ! -d $DIR ) then
+      echo "ERROR: directory '$DIR' not found"
+      echo " In the setup script check the setting of: $VAR "
+      exit -1
+   endif
+end
+
+# make sure there is a filter in these dirs
+set musthavefiles = "cam POP clm"
+foreach MODEL ( $musthavefiles )
+   set target = $DARTroot/models/$MODEL/work/filter
+   if ( ! -x $target ) then
+      echo "ERROR: executable file 'filter' not found"
+      echo " Looking for: $target "
+      echo " Make sure all DART assimilation executables have "
+      echo " been compiled before running this setup script."
+      exit -1
+   endif
+end
+
+# ==============================================================================
 # Create the case.
 #
 # For list of the pre-defined cases: ./create_newcase -list


More information about the Dart-dev mailing list