Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More cleanup of app scripts, add simtime to logging #508

Merged
merged 3 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ install (
DESTINATION etc
)

if(HYDROSTATIC)
set(CFG_HYDROSTATIC TRUE)
else()
set(CFG_HYDROSTATIC FALSE)
endif()

if(INSTALL_SOURCE_TARFILE)
set(CFG_INSTALL_SOURCE_TARFILE TRUE)
else()
Expand Down
17 changes: 7 additions & 10 deletions gcm_run.j
Original file line number Diff line number Diff line change
Expand Up @@ -841,16 +841,16 @@ if ( $DNA_TRUE == 0 && -e DNA_ExtData.rc ) /bin/mv
set ACHEM_TRUE = `grep -i '^\s*ENABLE_ACHEM:\s*\.TRUE\.' GEOS_ChemGridComp.rc | wc -l`
if ( $ACHEM_TRUE == 0 && -e GEOSachem_ExtData.rc ) /bin/mv GEOSachem_ExtData.rc GEOSachem_ExtData.rc.NOT_USED

@MP_NO_USE_WSUB# 1MOM and GFDL microphysics do not use WSUB_CLIM
@MP_NO_USE_WSUB# -------------------------------------------------
@MP_TURN_OFF_WSUB_EXTDATA# 1MOM and GFDL microphysics do not use WSUB_CLIM
@MP_TURN_OFF_WSUB_EXTDATA# -------------------------------------------------
if ($EXTDATA2G_TRUE == 0 ) then
@MP_NO_USE_WSUB/bin/mv WSUB_ExtData.rc WSUB_ExtData.tmp
@MP_NO_USE_WSUBcat WSUB_ExtData.tmp | sed -e '/^WSUB_CLIM/ s#ExtData.*#/dev/null#' > WSUB_ExtData.rc
@MP_TURN_OFF_WSUB_EXTDATA/bin/mv WSUB_ExtData.rc WSUB_ExtData.tmp
@MP_TURN_OFF_WSUB_EXTDATAcat WSUB_ExtData.tmp | sed -e '/^WSUB_CLIM/ s#ExtData.*#/dev/null#' > WSUB_ExtData.rc
else
@MP_NO_USE_WSUB/bin/mv WSUB_ExtData.yaml WSUB_ExtData.tmp
@MP_NO_USE_WSUBcat WSUB_ExtData.tmp | sed -e '/collection:/ s#WSUB_SWclim.*#/dev/null#' > WSUB_ExtData.yaml
@MP_TURN_OFF_WSUB_EXTDATA/bin/mv WSUB_ExtData.yaml WSUB_ExtData.tmp
@MP_TURN_OFF_WSUB_EXTDATAcat WSUB_ExtData.tmp | sed -e '/collection:/ s#WSUB_SWclim.*#/dev/null#' > WSUB_ExtData.yaml
endif
@MP_NO_USE_WSUB/bin/rm WSUB_ExtData.tmp
@MP_TURN_OFF_WSUB_EXTDATA/bin/rm WSUB_ExtData.tmp

# Generate the complete ExtData.rc
# --------------------------------
Expand Down Expand Up @@ -892,9 +892,6 @@ setenv YEAR $yearc

if (! -e tile.bin) then
$GEOSBIN/binarytile.x tile.data tile.bin
### @MIT $GEOSBIN/binarytile.x tile_hist.data tile_hist.bin
### @MOM5 $GEOSBIN/binarytile.x tile_hist.data tile_hist.bin
### @MOM6 $GEOSBIN/binarytile.x tile_hist.data tile_hist.bin
endif

# If running in dual ocean mode, link sst and fraci data here
Expand Down
35 changes: 5 additions & 30 deletions gcm_setup
Original file line number Diff line number Diff line change
Expand Up @@ -1391,26 +1391,17 @@ set GFDL_USE_CCN = "use_ccn = .true."

# BACM_1M and GFDL do not use WSUB_CLIM, so this eliminates a regrid
if ( "$CLDMICRO" == "BACM_1M" | "$CLDMICRO" == "GFDL_1M" ) then
set MP_NO_USE_WSUB = ""
set MP_TURN_OFF_WSUB_EXTDATA = ""
else
set MP_NO_USE_WSUB = "#DELETE#"
set MP_TURN_OFF_WSUB_EXTDATA = "#DELETE#"
endif

# Settings for fvcore_layout.rc
if ( "$USE_HYDROSTATIC" == "TRUE" ) then
set FV_MAKENH = "Make_NH = .F."
set FV_HYDRO = "hydrostatic = .T."
else
# Logic for NH runs based on build type
if ( "$DEFAULT_HYDROSTATIC" == "TRUE") then
# If you built for hydrostatic, but want an NH run, run make_nh
set FV_MAKENH = "Make_NH = .T."
else
# If you built for non-hydrostatic and want an NH run, do not run
# NOTE: If you run regrid.pl it will make restarts that should trigger
# make_nh automatically in FV3
set FV_MAKENH = "Make_NH = .F."
endif
set FV_MAKENH = "Make_NH = .T."
set FV_HYDRO = "hydrostatic = .F."
if ( "$CLDMICRO" == "GFDL_1M" ) then
set GFDL_HYDRO = ".FALSE."
Expand Down Expand Up @@ -1631,23 +1622,7 @@ while( $check == FALSE )
# Check to see if the HISTORY template exists in the $ETCDIR
if( -f $ETCDIR/$HISTORY_TEMPLATE ) then
set check = TRUE
set TMPHIST1 = `mktemp`
/bin/cp -f $ETCDIR/$HISTORY_TEMPLATE $TMPHIST1

set EXPID_old = `grep "EXPID:" $TMPHIST1 | cut -d: -f2`
set EXPDSC_old = `grep "EXPDSC:" $TMPHIST1 | cut -d: -f2`

set TMPCMD = `mktemp`
set string = "EXPID:"
echo cat $TMPHIST1 \| awk \'\{if \( \$1 \~ \"${string}\" \) \
\{sub \( \"${EXPID_old}\" , \"${EXPID}\" \)\;print\} else print\}\' \> $TMPHIST > $TMPCMD
chmod +x $TMPCMD
$TMPCMD
/bin/rm -f $TMPCMD
/bin/mv -f $TMPHIST $TMPHIST1
cat $TMPHIST1 | sed -e "s|${EXPDSC_old}|${EXPDSC}|g" > $TMPHIST
/bin/rm -f $TMPHIST1

/bin/cp -f $ETCDIR/$HISTORY_TEMPLATE $TMPHIST
# else check if the file exists (assuming they sent in full path)
else if( -e $HISTORY_TEMPLATE ) then
set check = TRUE
Expand Down Expand Up @@ -2430,7 +2405,7 @@ s/@ANALYZE_TS/0/g

s/@LSM_CHOICE/$LSM_CHOICE/g

s/@MP_NO_USE_WSUB/$MP_NO_USE_WSUB/g
s/@MP_TURN_OFF_WSUB_EXTDATA/$MP_TURN_OFF_WSUB_EXTDATA/g

s?@BACM_1M_?$BACM_1M_?g
s?@GFDL_1M_?$GFDL_1M_?g
Expand Down
35 changes: 5 additions & 30 deletions geoschemchem_setup
Original file line number Diff line number Diff line change
Expand Up @@ -1406,26 +1406,17 @@ set GFDL_USE_CCN = "use_ccn = .true."

# BACM_1M and GFDL do not use WSUB_CLIM, so this eliminates a regrid
if ( "$CLDMICRO" == "BACM_1M" | "$CLDMICRO" == "GFDL_1M" ) then
set MP_NO_USE_WSUB = ""
set MP_TURN_OFF_WSUB_EXTDATA = ""
else
set MP_NO_USE_WSUB = "#DELETE#"
set MP_TURN_OFF_WSUB_EXTDATA = "#DELETE#"
endif

# Settings for fvcore_layout.rc
if ( "$USE_HYDROSTATIC" == "TRUE" ) then
set FV_MAKENH = "Make_NH = .F."
set FV_HYDRO = "hydrostatic = .T."
else
# Logic for NH runs based on build type
if ( "$DEFAULT_HYDROSTATIC" == "TRUE") then
# If you built for hydrostatic, but want an NH run, run make_nh
set FV_MAKENH = "Make_NH = .T."
else
# If you built for non-hydrostatic and want an NH run, do not run
# NOTE: If you run regrid.pl it will make restarts that should trigger
# make_nh automatically in FV3
set FV_MAKENH = "Make_NH = .F."
endif
set FV_MAKENH = "Make_NH = .T."
set FV_HYDRO = "hydrostatic = .F."
if ( "$CLDMICRO" == "GFDL_1M" ) then
set GFDL_HYDRO = ".FALSE."
Expand Down Expand Up @@ -1661,23 +1652,7 @@ while( $check == FALSE )
# Check to see if the HISTORY template exists in the $ETCDIR
if( -f $ETCDIR/$HISTORY_TEMPLATE ) then
set check = TRUE
set TMPHIST1 = `mktemp`
/bin/cp -f $ETCDIR/$HISTORY_TEMPLATE $TMPHIST1

set EXPID_old = `grep "EXPID:" $TMPHIST1 | cut -d: -f2`
set EXPDSC_old = `grep "EXPDSC:" $TMPHIST1 | cut -d: -f2`

set TMPCMD = `mktemp`
set string = "EXPID:"
echo cat $TMPHIST1 \| awk \'\{if \( \$1 \~ \"${string}\" \) \
\{sub \( \"${EXPID_old}\" , \"${EXPID}\" \)\;print\} else print\}\' \> $TMPHIST > $TMPCMD
chmod +x $TMPCMD
$TMPCMD
/bin/rm -f $TMPCMD
/bin/mv -f $TMPHIST $TMPHIST1
cat $TMPHIST1 | sed -e "s|${EXPDSC_old}|${EXPDSC}|g" > $TMPHIST
/bin/rm -f $TMPHIST1

/bin/cp -f $ETCDIR/$HISTORY_TEMPLATE $TMPHIST
# else check if the file exists (assuming they sent in full path)
else if( -e $HISTORY_TEMPLATE ) then
set check = TRUE
Expand Down Expand Up @@ -2462,7 +2437,7 @@ s/@ANALYZE_TS/0/g

s/@LSM_CHOICE/$LSM_CHOICE/g

s/@MP_NO_USE_WSUB/$MP_NO_USE_WSUB/g
s/@MP_TURN_OFF_WSUB_EXTDATA/$MP_TURN_OFF_WSUB_EXTDATA/g

s?@BACM_1M_?$BACM_1M_?g
s?@GFDL_1M_?$GFDL_1M_?g
Expand Down
35 changes: 5 additions & 30 deletions gmichem_setup
Original file line number Diff line number Diff line change
Expand Up @@ -1503,26 +1503,17 @@ set GFDL_USE_CCN = "use_ccn = .true."

# BACM_1M and GFDL do not use WSUB_CLIM, so this eliminates a regrid
if ( "$CLDMICRO" == "BACM_1M" | "$CLDMICRO" == "GFDL_1M" ) then
set MP_NO_USE_WSUB = ""
set MP_TURN_OFF_WSUB_EXTDATA = ""
else
set MP_NO_USE_WSUB = "#DELETE#"
set MP_TURN_OFF_WSUB_EXTDATA = "#DELETE#"
endif

# Settings for fvcore_layout.rc
if ( "$USE_HYDROSTATIC" == "TRUE" ) then
set FV_MAKENH = "Make_NH = .F."
set FV_HYDRO = "hydrostatic = .T."
else
# Logic for NH runs based on build type
if ( "$DEFAULT_HYDROSTATIC" == "TRUE") then
# If you built for hydrostatic, but want an NH run, run make_nh
set FV_MAKENH = "Make_NH = .T."
else
# If you built for non-hydrostatic and want an NH run, do not run
# NOTE: If you run regrid.pl it will make restarts that should trigger
# make_nh automatically in FV3
set FV_MAKENH = "Make_NH = .F."
endif
set FV_MAKENH = "Make_NH = .T."
set FV_HYDRO = "hydrostatic = .F."
if ( "$CLDMICRO" == "GFDL_1M" ) then
set GFDL_HYDRO = ".FALSE."
Expand Down Expand Up @@ -1822,23 +1813,7 @@ while( $check == FALSE )
# Check to see if the HISTORY template exists in the $ETCDIR
if( -f $ETCDIR/$HISTORY_TEMPLATE ) then
set check = TRUE
set TMPHIST1 = `mktemp`
/bin/cp -f $ETCDIR/$HISTORY_TEMPLATE $TMPHIST1

set EXPID_old = `grep "EXPID:" $TMPHIST1 | cut -d: -f2`
set EXPDSC_old = `grep "EXPDSC:" $TMPHIST1 | cut -d: -f2`

set TMPCMD = `mktemp`
set string = "EXPID:"
echo cat $TMPHIST1 \| awk \'\{if \( \$1 \~ \"${string}\" \) \
\{sub \( \"${EXPID_old}\" , \"${EXPID}\" \)\;print\} else print\}\' \> $TMPHIST > $TMPCMD
chmod +x $TMPCMD
$TMPCMD
/bin/rm -f $TMPCMD
/bin/mv -f $TMPHIST $TMPHIST1
cat $TMPHIST1 | sed -e "s|${EXPDSC_old}|${EXPDSC}|g" > $TMPHIST
/bin/rm -f $TMPHIST1

/bin/cp -f $ETCDIR/$HISTORY_TEMPLATE $TMPHIST
# else check if the file exists (assuming they sent in full path)
else if( -e $HISTORY_TEMPLATE ) then
set check = TRUE
Expand Down Expand Up @@ -2628,7 +2603,7 @@ s/@ANALYZE_TS/0/g

s/@LSM_CHOICE/$LSM_CHOICE/g

s/@MP_NO_USE_WSUB/$MP_NO_USE_WSUB/g
s/@MP_TURN_OFF_WSUB_EXTDATA/$MP_TURN_OFF_WSUB_EXTDATA/g

s?@BACM_1M_?$BACM_1M_?g
s?@GFDL_1M_?$GFDL_1M_?g
Expand Down
45 changes: 23 additions & 22 deletions logging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,6 @@ schema_version: 1
#
# https://github.com/GEOS-ESM/MAPL/wiki/How-to-use-the-MAPL-logging-library,-aka-%22pFlogger%22
#
# Let us say you want to get all the debugging loggers
# from ExtData in MAPL. To do this you first want to
# set the 'console' handler below to DEBUG level:
#
# handlers:
# console:
# class: streamhandler
# formatter: basic
# unit: OUTPUT_UNIT
# level: DEBUG
#
# Now we need to add a logger for ExtData. We do this
# by adding the following to the loggers section:
#
# loggers:
# CAP.EXTDATA:
# handlers: [console]
# level: WARNING
# root_level: DEBUG

###############################
locks:
Expand All @@ -34,21 +15,28 @@ locks:
formatters:
plain:
class: Formatter
format: '%(message)a'
format: '%(message)a'

basic:
class: Formatter
format: '%(short_name)a15~: %(level_name)a~: %(message)a'
format: '%(short_name)a15~: %(level_name)a~: %(message)a'

mpi:
class: MpiFormatter
format: '%(mpi_rank)i4.4~: %(name)~: %(level_name)a~: %(message)a'
format: '%(mpi_rank)i4.4~: %(name)~: %(level_name)a~: %(message)a'
comm: MPI_COMM_WORLD

column:
class: Formatter
format: '(%(i)i3.3,%(j)i3.3): %(level_name)'

# This makes an output like:
# AGCM Date: 2000/04/14 Time: 21:00:00 GENERIC: DEBUG: Message
simtime:
class: Formatter
format: '%(simtime)a~ %(short_name)a15~: %(level_name)a~: %(message)a'
datefmt: ' AGCM Date: %(Y)i4.4~/%(M)i2.2~/%(D)i2.2 Time: %(HH)i2.2~:%(MM)i2.2~:%(SS)i2.2'

###############################
handlers:

Expand All @@ -64,6 +52,12 @@ handlers:
unit: OUTPUT_UNIT
level: INFO

console_simtime:
class: streamhandler
formatter: simtime
unit: OUTPUT_UNIT
level: DEBUG

warnings:
class: FileHandler
filename: warnings_and_errors.log
Expand Down Expand Up @@ -122,6 +116,13 @@ loggers:
level: WARNING
root_level: INFO

# To enable this logger, set the console handler
# above to DEBUG level
CAP.EXTDATA:
handlers: [console]
level: WARNING
root_level: DEBUG

# Note: When enabling another logger, make sure
# indentation matches that of the above
# loggers!
Expand Down
35 changes: 5 additions & 30 deletions stratchem_setup
Original file line number Diff line number Diff line change
Expand Up @@ -1406,26 +1406,17 @@ set GFDL_USE_CCN = "use_ccn = .true."

# BACM_1M and GFDL do not use WSUB_CLIM, so this eliminates a regrid
if ( "$CLDMICRO" == "BACM_1M" | "$CLDMICRO" == "GFDL_1M" ) then
set MP_NO_USE_WSUB = ""
set MP_TURN_OFF_WSUB_EXTDATA = ""
else
set MP_NO_USE_WSUB = "#DELETE#"
set MP_TURN_OFF_WSUB_EXTDATA = "#DELETE#"
endif

# Settings for fvcore_layout.rc
if ( "$USE_HYDROSTATIC" == "TRUE" ) then
set FV_MAKENH = "Make_NH = .F."
set FV_HYDRO = "hydrostatic = .T."
else
# Logic for NH runs based on build type
if ( "$DEFAULT_HYDROSTATIC" == "TRUE") then
# If you built for hydrostatic, but want an NH run, run make_nh
set FV_MAKENH = "Make_NH = .T."
else
# If you built for non-hydrostatic and want an NH run, do not run
# NOTE: If you run regrid.pl it will make restarts that should trigger
# make_nh automatically in FV3
set FV_MAKENH = "Make_NH = .F."
endif
set FV_MAKENH = "Make_NH = .T."
set FV_HYDRO = "hydrostatic = .F."
if ( "$CLDMICRO" == "GFDL_1M" ) then
set GFDL_HYDRO = ".FALSE."
Expand Down Expand Up @@ -1646,23 +1637,7 @@ while( $check == FALSE )
# Check to see if the HISTORY template exists in the $ETCDIR
if( -f $ETCDIR/$HISTORY_TEMPLATE ) then
set check = TRUE
set TMPHIST1 = `mktemp`
/bin/cp -f $ETCDIR/$HISTORY_TEMPLATE $TMPHIST1

set EXPID_old = `grep "EXPID:" $TMPHIST1 | cut -d: -f2`
set EXPDSC_old = `grep "EXPDSC:" $TMPHIST1 | cut -d: -f2`

set TMPCMD = `mktemp`
set string = "EXPID:"
echo cat $TMPHIST1 \| awk \'\{if \( \$1 \~ \"${string}\" \) \
\{sub \( \"${EXPID_old}\" , \"${EXPID}\" \)\;print\} else print\}\' \> $TMPHIST > $TMPCMD
chmod +x $TMPCMD
$TMPCMD
/bin/rm -f $TMPCMD
/bin/mv -f $TMPHIST $TMPHIST1
cat $TMPHIST1 | sed -e "s|${EXPDSC_old}|${EXPDSC}|g" > $TMPHIST
/bin/rm -f $TMPHIST1

/bin/cp -f $ETCDIR/$HISTORY_TEMPLATE $TMPHIST
# else check if the file exists (assuming they sent in full path)
else if( -e $HISTORY_TEMPLATE ) then
set check = TRUE
Expand Down Expand Up @@ -2446,7 +2421,7 @@ s/@ANALYZE_TS/0/g

s/@LSM_CHOICE/$LSM_CHOICE/g

s/@MP_NO_USE_WSUB/$MP_NO_USE_WSUB/g
s/@MP_TURN_OFF_WSUB_EXTDATA/$MP_TURN_OFF_WSUB_EXTDATA/g

s?@BACM_1M_?$BACM_1M_?g
s?@GFDL_1M_?$GFDL_1M_?g
Expand Down