Skip to content

Commit

Permalink
Merge pull request #609 from sergeynk/ddm3d
Browse files Browse the repository at this point in the history
Gas Phase DDM3D
  • Loading branch information
dkang2 authored Feb 19, 2020
2 parents 21ce562 + 48fca47 commit 2195617
Show file tree
Hide file tree
Showing 60 changed files with 8,908 additions and 131 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,8 @@ UTIL/inline_phot_preproc/bldrun.log
#user specific scripts
/scripts/


#unique to user; below section unlikely to add and commit to repository
bldit_project.csh


69 changes: 41 additions & 28 deletions CCTM/scripts/bldit_cctm.csh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/csh -f

# ======================= CCTMv5.3.1 Build Script =========================
# ======================= CCTMv5.3 Build Script =========================
# Usage: bldit.cctm >&! bldit.cctm.log
# Requirements: I/O API & netCDF libraries, a Fortran compiler,
# and MPI for multiprocessor computing
Expand Down Expand Up @@ -40,7 +40,7 @@
setenv REPOROOT $CCTM_SRC

#> Working directory and Version IDs
set VRSN = v531 #> model configuration ID
set VRSN = v531 #> model configuration ID
set EXEC = CCTM_${VRSN}.exe #> executable name
set CFG = CCTM_${VRSN}.cfg #> configuration file name

Expand All @@ -57,12 +57,13 @@ set ParOpt #> uncomment to build a multiple processo
#> comment out to use standard netCDF I/O
#set Debug_CCTM #> uncomment to compile CCTM with debug option equal to TRUE
#> comment out to use standard, optimized compile process
set make_options = "-j" #> additional options for make command if MakeFileOnly is not set
#> comment out if no additional options are wanted.

#> Integrated Source Apportionment Method (ISAM)
#set ISAM_CCTM #> uncomment to compile CCTM with ISAM activated
#> comment out to use standard process

#set DDM3D_CCTM #> uncomment to compile CCTM with DD3D activated
#> comment out to use standard process
#> Two-way WRF-CMAQ
#set build_twoway #> uncomment to build WRF-CMAQ twoway;
#> comment out for off-line chemistry
Expand Down Expand Up @@ -108,6 +109,7 @@ set make_options = "-j" #> additional options for make command if
set ModPa = procan/pa #> CCTM process analysis
set ModPvO3 = pv_o3 #> potential vorticity from the free troposphere
set ModISAM = isam #> CCTM Integrated Source Apportionment Method
set ModDDM3D = ddm3d #> Decoupled Direct Method in 3D

#============================================================================================
#> Computing System Configuration:
Expand Down Expand Up @@ -224,6 +226,13 @@ set make_options = "-j" #> additional options for make command if
set Str1 =
set Str2 =
endif

#> if DDM-3D is set, add the pre-processor flag for it.
if ( $?DDM3D_CCTM ) then
set SENS = ( -Dsens )
else
set SENS = ""
endif

#> Mechanism location
set ModMech = MECHS/$Mechanism #> chemical mechanism module
Expand Down Expand Up @@ -336,53 +345,49 @@ set Cfile = ${Bld}/${CFG}.bld # Config Filename
set quote = '"'

echo > $Cfile
if ( $?make_options ) then
echo "make_options $quote$make_options$quote;" >> $Cfile
echo >> $Cfile
endif
echo "model $EXEC;" >> $Cfile
echo "model $EXEC;" >> $Cfile
echo >> $Cfile
echo "repo $CCTM_SRC;" >> $Cfile
echo "repo $CCTM_SRC;" >> $Cfile
echo >> $Cfile
echo "mechanism $Mechanism;" >> $Cfile
echo "mechanism $Mechanism;" >> $Cfile
echo >> $Cfile
echo "lib_base $CMAQ_LIB;" >> $Cfile
echo "lib_base $CMAQ_LIB;" >> $Cfile
echo >> $Cfile
echo "lib_1 ioapi/lib;" >> $Cfile
echo "lib_1 ioapi/lib;" >> $Cfile
echo >> $Cfile
echo "lib_2 ioapi/include_files;" >> $Cfile
echo "lib_2 ioapi/include_files;" >> $Cfile
echo >> $Cfile
if ( $?ParOpt ) then
echo "lib_3 ${quote}mpi -I.$quote;" >> $Cfile
echo >> $Cfile
endif
echo >> $Cfile
echo "lib_4 ioapi/lib;" >> $Cfile
echo "lib_4 ioapi/lib;" >> $Cfile
echo >> $Cfile
set text = "$quote$CPP_FLAGS $PAR $PIO $cpp_depmod $POT $STX1 $STX2$quote;"
set text = "$quote$CPP_FLAGS $PAR $SENS $PIO $cpp_depmod $POT $STX1 $STX2$quote;"
echo "cpp_flags $text" >> $Cfile
echo >> $Cfile
echo "f_compiler $FC;" >> $Cfile
echo >> $Cfile
echo "fstd $quote$FSTD$quote;" >> $Cfile
echo "fstd $quote$FSTD$quote;" >> $Cfile
echo >> $Cfile
echo "dbg $quote$DBG$quote;" >> $Cfile
echo "dbg $quote$DBG$quote;" >> $Cfile
echo >> $Cfile
echo "f_flags $quote$F_FLAGS$quote;" >> $Cfile
echo "f_flags $quote$F_FLAGS$quote;" >> $Cfile
echo >> $Cfile
echo "f90_flags $quote$F90_FLAGS$quote;" >> $Cfile
echo "f90_flags $quote$F90_FLAGS$quote;" >> $Cfile
echo >> $Cfile
echo "c_compiler $CC;" >> $Cfile
echo "c_compiler $CC;" >> $Cfile
echo >> $Cfile
echo "c_flags $quote$C_FLAGS$quote;" >> $Cfile
echo "c_flags $quote$C_FLAGS$quote;" >> $Cfile
echo >> $Cfile
echo "link_flags $quote$LINK_FLAGS$quote;" >> $Cfile
echo "link_flags $quote$LINK_FLAGS$quote;" >> $Cfile
echo >> $Cfile
echo "ioapi $quote$LIB2$quote; " >> $Cfile
echo "ioapi $quote$LIB2$quote; " >> $Cfile
echo >> $Cfile
echo "netcdf $quote$netcdf_lib$quote;" >> $Cfile
echo "netcdf $quote$netcdf_lib$quote;" >> $Cfile
echo >> $Cfile
echo "netcdff $quote$netcdff_lib$quote;" >> $Cfile
echo "netcdff $quote$netcdff_lib$quote;" >> $Cfile
echo >> $Cfile
if ( $?ParOpt ) then
echo "mpich $quote$LIB3$quote;" >> $Cfile
Expand Down Expand Up @@ -544,6 +549,13 @@ endif
echo "Module ${ModISAM};" >> $Cfile
echo >> $Cfile

if ( $?DDM3D_CCTM ) then
set text = "// compile for decoupled direct method in 3d"
echo $text >> $Cfile
echo "Module ${ModDDM3D};" >> $Cfile
echo >> $Cfile
endif

set text = "util"
echo "// options are" $text >> $Cfile
echo "Module ${ModUtil};" >> $Cfile
Expand Down Expand Up @@ -609,11 +621,12 @@ endif
if ( $?Debug_CCTM ) then
set bld_flags = "${bld_flags} -debug_cctm"
endif

if ( $?ISAM_CCTM ) then
set bld_flags = "${bld_flags} -isam_cctm"
endif
# Run BLDMAKE with source code in build directory

#> Run BLDMAKE with source code in build directory
$Blder $bld_flags $Cfile

#> Rename Makefile to specify compiler option and link back to Makefile
Expand Down
36 changes: 35 additions & 1 deletion CCTM/scripts/run_cctm_2010_4CALIF1.csh
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ while ($TODAYJ <= $STOP_DAY ) #>Compare dates in terms of YYYYJJJ
endif
endif


#> Sulfur Tracking Model (STM)
setenv STM_SO4TRACK N #> sulfur tracking [ default: N ]
if ( $?STM_SO4TRACK ) then
Expand All @@ -478,6 +477,36 @@ while ($TODAYJ <= $STOP_DAY ) #>Compare dates in terms of YYYYJJJ

endif
endif

#> CMAQ-DDM-3D
setenv CTM_DDM3D N
set NPMAX = 1
setenv SEN_INPUT ${WORKDIR}/sensinput.dat

setenv DDM3D_HIGH N # allow higher-order sensitivity parameters [ T | Y | F | N ] (default is N/F)

if ($NEW_START == true || $NEW_START == TRUE ) then
setenv DDM3D_RST N # begins from sensitivities from a restart file [ T | Y | F | N ] (default is Y/T)
set S_ICpath =
set S_ICfile =
else
setenv DDM3D_RST Y
set S_ICpath = $OUTDIR
set S_ICfile = CCTM_SENGRID_${RUNID}_${YESTERDAY}.nc
endif

setenv DDM3D_BCS F # use sensitivity bc file for nested runs [ T | Y | F | N ] (default is N/F)
set S_BCpath =
set S_BCfile =

setenv CTM_NPMAX $NPMAX
setenv CTM_SENS_1 "$OUTDIR/CCTM_SENGRID_${CTM_APPL}.nc -v"
setenv A_SENS_1 "$OUTDIR/CCTM_ASENS_${CTM_APPL}.nc -v"
setenv CTM_SWETDEP_1 "$OUTDIR/CCTM_SENWDEP_${CTM_APPL}.nc -v"
setenv CTM_SDRYDEP_1 "$OUTDIR/CCTM_SENDDEP_${CTM_APPL}.nc -v"
setenv CTM_NPMAX $NPMAX
setenv INIT_SENS_1 $S_ICpath/$S_ICfile
setenv BNDY_SENS_1 $S_BCpath/$S_BCfile

# =====================================================================
#> Output Files
Expand Down Expand Up @@ -538,6 +567,11 @@ while ($TODAYJ <= $STOP_DAY ) #>Compare dates in terms of YYYYJJJ
${SA_CGRID_1} )
endif
endif
if ( $?CTM_DDM3D ) then
if ( $CTM_DDM3D == 'Y' || $CTM_DDM3D == 'T' ) then
set OUT_FILES = (${OUT_FILES} ${CTM_SENS_1} ${A_SENS_1} ${CTM_SWETDEP_1} ${CTM_SDRYDEP_1} )
endif
endif
set OUT_FILES = `echo $OUT_FILES | sed "s; -v;;g" `
( ls $OUT_FILES > buff.txt ) >& /dev/null
set out_test = `cat buff.txt`; rm -f buff.txt
Expand Down
36 changes: 35 additions & 1 deletion CCTM/scripts/run_cctm_2011_12US1.csh
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,6 @@ while ($TODAYJ <= $STOP_DAY ) #>Compare dates in terms of YYYYJJJ
endif
endif


#> Sulfur Tracking Model (STM)
setenv STM_SO4TRACK N #> sulfur tracking [ default: N ]
if ( $?STM_SO4TRACK ) then
Expand All @@ -470,6 +469,36 @@ while ($TODAYJ <= $STOP_DAY ) #>Compare dates in terms of YYYYJJJ

endif
endif

#> CMAQ-DDM-3D
setenv CTM_DDM3D N
set NPMAX = 1
setenv SEN_INPUT ${WORKDIR}/sensinput.dat

setenv DDM3D_HIGH N # allow higher-order sensitivity parameters [ T | Y | F | N ] (default is N/F)

if ($NEW_START == true || $NEW_START == TRUE ) then
setenv DDM3D_RST N # begins from sensitivities from a restart file [ T | Y | F | N ] (default is Y/T)
set S_ICpath =
set S_ICfile =
else
setenv DDM3D_RST Y
set S_ICpath = $OUTDIR
set S_ICfile = CCTM_SENGRID_${RUNID}_${YESTERDAY}.nc
endif

setenv DDM3D_BCS F # use sensitivity bc file for nested runs [ T | Y | F | N ] (default is N/F)
set S_BCpath =
set S_BCfile =

setenv CTM_NPMAX $NPMAX
setenv CTM_SENS_1 "$OUTDIR/CCTM_SENGRID_${CTM_APPL}.nc -v"
setenv A_SENS_1 "$OUTDIR/CCTM_ASENS_${CTM_APPL}.nc -v"
setenv CTM_SWETDEP_1 "$OUTDIR/CCTM_SENWDEP_${CTM_APPL}.nc -v"
setenv CTM_SDRYDEP_1 "$OUTDIR/CCTM_SENDDEP_${CTM_APPL}.nc -v"
setenv CTM_NPMAX $NPMAX
setenv INIT_SENS_1 $S_ICpath/$S_ICfile
setenv BNDY_SENS_1 $S_BCpath/$S_BCfile

# =====================================================================
#> Output Files
Expand Down Expand Up @@ -530,6 +559,11 @@ while ($TODAYJ <= $STOP_DAY ) #>Compare dates in terms of YYYYJJJ
${SA_CGRID_1} )
endif
endif
if ( $?CTM_DDM3D ) then
if ( $CTM_DDM3D == 'Y' || $CTM_DDM3D == 'T' ) then
set OUT_FILES = (${OUT_FILES} ${CTM_SENS_1} ${A_SENS_1} ${CTM_SWETDEP_1} ${CTM_SDRYDEP_1} )
endif
endif
set OUT_FILES = `echo $OUT_FILES | sed "s; -v;;g" `
( ls $OUT_FILES > buff.txt ) >& /dev/null
set out_test = `cat buff.txt`; rm -f buff.txt
Expand Down
35 changes: 35 additions & 0 deletions CCTM/scripts/run_cctm_2014_12US1.csh
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,36 @@ while ($TODAYJ <= $STOP_DAY ) #>Compare dates in terms of YYYYJJJ

endif
endif

#> CMAQ-DDM-3D
setenv CTM_DDM3D N
set NPMAX = 1
setenv SEN_INPUT ${WORKDIR}/sensinput.dat

setenv DDM3D_HIGH N # allow higher-order sensitivity parameters [ T | Y | F | N ] (default is N/F)

if ($NEW_START == true || $NEW_START == TRUE ) then
setenv DDM3D_RST N # begins from sensitivities from a restart file [ T | Y | F | N ] (default is Y/T)
set S_ICpath =
set S_ICfile =
else
setenv DDM3D_RST Y
set S_ICpath = $OUTDIR
set S_ICfile = CCTM_SENGRID_${RUNID}_${YESTERDAY}.nc
endif

setenv DDM3D_BCS F # use sensitivity bc file for nested runs [ T | Y | F | N ] (default is N/F)
set S_BCpath =
set S_BCfile =

setenv CTM_NPMAX $NPMAX
setenv CTM_SENS_1 "$OUTDIR/CCTM_SENGRID_${CTM_APPL}.nc -v"
setenv A_SENS_1 "$OUTDIR/CCTM_ASENS_${CTM_APPL}.nc -v"
setenv CTM_SWETDEP_1 "$OUTDIR/CCTM_SENWDEP_${CTM_APPL}.nc -v"
setenv CTM_SDRYDEP_1 "$OUTDIR/CCTM_SENDDEP_${CTM_APPL}.nc -v"
setenv CTM_NPMAX $NPMAX
setenv INIT_SENS_1 $S_ICpath/$S_ICfile
setenv BNDY_SENS_1 $S_BCpath/$S_BCfile

# =====================================================================
#> Output Files
Expand Down Expand Up @@ -539,6 +569,11 @@ while ($TODAYJ <= $STOP_DAY ) #>Compare dates in terms of YYYYJJJ
${SA_CGRID_1} )
endif
endif
if ( $?CTM_DDM3D ) then
if ( $CTM_DDM3D == 'Y' || $CTM_DDM3D == 'T' ) then
set OUT_FILES = (${OUT_FILES} ${CTM_SENS_1} ${A_SENS_1} ${CTM_SWETDEP_1} ${CTM_SDRYDEP_1} )
endif
endif
set OUT_FILES = `echo $OUT_FILES | sed "s; -v;;g" `
( ls $OUT_FILES > buff.txt ) >& /dev/null
set out_test = `cat buff.txt`; rm -f buff.txt
Expand Down
35 changes: 35 additions & 0 deletions CCTM/scripts/run_cctm_2015_HEMI.csh
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,36 @@ while ($TODAYJ <= $STOP_DAY ) #>Compare dates in terms of YYYYJJJ

endif
endif

#> CMAQ-DDM-3D
setenv CTM_DDM3D N
set NPMAX = 1
setenv SEN_INPUT ${WORKDIR}/sensinput.dat

setenv DDM3D_HIGH N # allow higher-order sensitivity parameters [ T | Y | F | N ] (default is N/F)

if ($NEW_START == true || $NEW_START == TRUE ) then
setenv DDM3D_RST N # begins from sensitivities from a restart file [ T | Y | F | N ] (default is Y/T)
set S_ICpath =
set S_ICfile =
else
setenv DDM3D_RST Y
set S_ICpath = $OUTDIR
set S_ICfile = CCTM_SENGRID_${RUNID}_${YESTERDAY}.nc
endif

setenv DDM3D_BCS F # use sensitivity bc file for nested runs [ T | Y | F | N ] (default is N/F)
set S_BCpath =
set S_BCfile =

setenv CTM_NPMAX $NPMAX
setenv CTM_SENS_1 "$OUTDIR/CCTM_SENGRID_${CTM_APPL}.nc -v"
setenv A_SENS_1 "$OUTDIR/CCTM_ASENS_${CTM_APPL}.nc -v"
setenv CTM_SWETDEP_1 "$OUTDIR/CCTM_SENWDEP_${CTM_APPL}.nc -v"
setenv CTM_SDRYDEP_1 "$OUTDIR/CCTM_SENDDEP_${CTM_APPL}.nc -v"
setenv CTM_NPMAX $NPMAX
setenv INIT_SENS_1 $S_ICpath/$S_ICfile
setenv BNDY_SENS_1 $S_BCpath/$S_BCfile

# =====================================================================
#> Output Files
Expand Down Expand Up @@ -574,6 +604,11 @@ while ($TODAYJ <= $STOP_DAY ) #>Compare dates in terms of YYYYJJJ
${SA_CGRID_1} )
endif
endif
if ( $?CTM_DDM3D ) then
if ( $CTM_DDM3D == 'Y' || $CTM_DDM3D == 'T' ) then
set OUT_FILES = (${OUT_FILES} ${CTM_SENS_1} ${A_SENS_1} ${CTM_SWETDEP_1} ${CTM_SDRYDEP_1} )
endif
endif
set OUT_FILES = `echo $OUT_FILES | sed "s; -v;;g" `
( ls $OUT_FILES > buff.txt ) >& /dev/null
set out_test = `cat buff.txt`; rm -f buff.txt
Expand Down
Loading

0 comments on commit 2195617

Please # to comment.