Outline of the DATM template

The outline of the DATM template is as follows:


# Check $GRID to set the $DOMAINFILE and $DOMAINPATH

# Check DATM_PRESAERO to set the prescribed aerosol option
# If CLM_USRDAT_NAME is set and $DOMAINFILE is NOT -- set it by CLM_USRDAT_NAME
# Ensure $DOMAINFILE is set or else abort

#==============================================================================
# Create resolved prestage data script
#==============================================================================
cat >! $CASEBUILD/datm.buildnml.csh << EOF1
# NOTE: variables in this section must be escaped
EOF1
# Major if blocks look at DATM_MODE:
# the if blocks setup streams and run Tools/build_streams to create stream files
#----- CLM_QIAN mode ----------------------------------------------------------
else if ($DATM_MODE == "CLM_QIAN" ) then
.
   # Customize CLM_QIAN options here

   # A.) Setup datm_atm_in namelist
cat >! $CASEBUILD/datm.buildnml.csh << EOF
cat >! datm_atm_in << EOF1
# NOTE: variables in this section must be escaped
EOF1
EOF

   # B.) Setup options to build_streams
.
.
.
#----- CLM1PT   mode ----------------------------------------------------------
else if ($DATM_MODE == "CLM1PT" ) then
.
   # Customize CLM1PT options here

   # A.) Setup datm_atm_in namelist
cat >! $CASEBUILD/datm.buildnml.csh << EOF
cat >! datm_atm_in << EOF1
# NOTE: variables in this section must be escaped
EOF1
EOF

   # B.) Setup options to build_streams
.
.
.
.
#----- CPLHIST 3-hourly time-averaging mode
----------------------------------------------------------
else if ($DATM_MODE == "CPLHIST3HrWx" ) then
.
   # Customize CPLHIST3HrWx options here

   # A.) Setup datm_atm_in namelist
cat >! $CASEBUILD/datm.buildnml.csh << EOF
cat >! datm_atm_in << EOF1
# NOTE: variables in this section must be escaped
EOF1
EOF

   # B.) Setup options to build_streams
.
.
.
.

#----- INVALID mode -----------------------------------------------------------else
  echo "ERROR: unrecognized DATM_MODE = \$DATM_MODE "
  exit -1
endif

#==============================================================================
# Create prescribed aero streams if appropriate
#==============================================================================
.
.
.
#==============================================================================
# Create remaining resolved namelist
#==============================================================================

cat >! $CASEBUILD/datm.buildnml.csh << EOF
cat >! datm_in << EOF1
# NOTE: variables in this section must be escaped
.
.
.
EOF1

EOF

#==============================================================================
#  Create script to build executable
#==============================================================================

cat > $CASEBUILD/datm.buildexe.csh <<EOF
#! /bin/csh -f 
# NOTE: variables in this section must be escaped
EOF

#==============================================================================
# end of script
#==============================================================================