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

gcm_setup python conversion #602

Draft
wants to merge 17 commits into
base: develop
Choose a base branch
from
Draft
440 changes: 220 additions & 220 deletions AGCM.rc.tmpl

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions CAP.rc.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ MAPLROOT_COMPNAME: GCM
ROOT_CF: AGCM.rc
HIST_CF: HISTORY.rc

BEG_DATE: @BEG_DATE
END_DATE: @END_DATE
JOB_SGMT: @JOB_SGMT
NUM_SGMT: @NUM_SGMT
HEARTBEAT_DT: @DT
BEG_DATE: {{ BEG_DATE }}
END_DATE: {{ END_DATE }}
JOB_SGMT: {{ JOB_SGMT }}
NUM_SGMT: {{ NUM_SGMT }}
HEARTBEAT_DT: {{ DT }}

USE_SHMEM: @USE_SHMEM
USE_SHMEM: {{ USE_SHMEM }}
USE_EXTDATA2G: .TRUE.

# Parameters for Cycled REPLAY Forecasts
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
add_subdirectory(gcmpy)

ecbuild_add_executable (
TARGET GEOSgcm.x
SOURCES GEOSgcm.F90
Expand Down
166 changes: 83 additions & 83 deletions HISTORY.AGCM.rc.tmpl

Large diffs are not rendered by default.

188 changes: 94 additions & 94 deletions HISTORY.AOGCM-MOM5.rc.tmpl

Large diffs are not rendered by default.

246 changes: 123 additions & 123 deletions HISTORY.AOGCM.rc.tmpl

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions HISTORY.AOGCM_MITgcm.rc.tmpl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VERSION: 1
EXPID: @EXPID
EXPDSC: @EXPDSC
EXPSRC: @EXPSRC
EXPID: {{ EXPID }}
EXPDSC: {{ EXPDSC }}
EXPSRC: {{ EXPSRC }}

CONTACT: 'http://gmao.gsfc.nasa.gov'

Expand Down
136 changes: 68 additions & 68 deletions HISTORY.rc.tmpl

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions fvcore_layout.rc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
&fv_core_nml
@FV_HYDRO
{{ FV_HYDRO }}
range_warn = .T.
fv_debug = .F.
@FV_SCHMIDT
@FV_STRETCH_FAC
@FV_TARGET_LON
@FV_TARGET_LAT
{{ FV_SCHMIDT }}
{{ FV_STRETCH_FAC }}
{{ FV_TARGET_LON }}
{{ FV_TARGET_LAT }}
compute_coords_locally = .false.
/

Expand Down Expand Up @@ -47,8 +47,8 @@
c_pgacs = 0.01
c_paut = 1.0
c_cracw = 1.0
@GFDL_PROG_CCN
@GFDL_USE_CCN
{{ GFDL_PROG_CCN }}
{{ GFDL_USE_CCN }}
ccn_l = 300.
ccn_o = 100.
z_slope_liq = .true.
Expand Down
24 changes: 12 additions & 12 deletions gcm_archive.j
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
# Batch Parameters for Archive Job
#######################################################################

#@BATCH_TIME@ARCHIVE_T
#@ARCHIVE_P
#@BATCH_JOBNAME@ARCHIVE_N
#@ARCHIVE_Q
#@BATCH_GROUP
#@BATCH_OUTPUTNAMEOUTPUT
#{{ BATCH_TIME }}{{ ARCHIVE_T }}
#{{ ARCHIVE_P }}
#{{ BATCH_JOBNAME }}{{ ARCHIVE_N }}
#{{ ARCHIVE_Q }}
#{{ BATCH_GROUP }}
#{{ BATCH_OUTPUTNAME }}OUTPUT

#######################################################################
# System Environment Variables
Expand All @@ -19,23 +19,23 @@ umask 022

limit stacksize unlimited

@SETENVS
{{ SETENVS }}

@MPT_SHEPHERD
{{ MPT_SHEPHERD }}

#######################################################################
# Architecture Specific Environment Variables
#######################################################################

setenv ARCH `uname`

setenv SITE @SITE
setenv GEOSBIN @GEOSBIN
setenv SITE {{ SITE }}
setenv GEOSBIN {{ GEOSBIN }}

source $GEOSBIN/g5_modules
setenv @LD_LIBRARY_PATH_CMD ${LD_LIBRARY_PATH}
setenv {{ LD_LIBRARY_PATH_CMD }} ${LD_LIBRARY_PATH}
if ( $?BASEDIR ) then
setenv @LD_LIBRARY_PATH_CMD ${@LD_LIBRARY_PATH_CMD}:${BASEDIR}/${ARCH}/lib
setenv {{ LD_LIBRARY_PATH_CMD }} ${{'{'}}{{LD_LIBRARY_PATH_CMD}}{{'}'}}:${BASEDIR}/${ARCH}/lib
endif

#######################################################################
Expand Down
2 changes: 1 addition & 1 deletion gcm_emip.setup
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ sed -f sedfile gcm_run.tmp > gcm_run.j$RSTDATE
/bin/rm -f sedfile
/bin/rm -f gcm_run.tmp

echo @BATCH_CMD gcm_run.j$RSTDATE
echo {{ BATCH_CMD }} gcm_run.j$RSTDATE
end

12 changes: 6 additions & 6 deletions gcm_forecast.setup
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
#######################################################################

setenv ARCH `uname`
setenv SITE @SITE
setenv SITE {{ SITE }}

setenv EXPID @EXPID
setenv EXPDIR @EXPDIR
setenv HOMDIR @HOMDIR
setenv GEOSUTIL @GEOSUTIL
setenv EXPID {{ EXPID }}
setenv EXPDIR {{ EXPDIR }}
setenv HOMDIR {{ HOMDIR }}
setenv GEOSUTIL {{ GEOSUTIL }}

#######################################################################
# Parameters for Forecasts
Expand Down Expand Up @@ -107,7 +107,7 @@ s?&FHRS?$FHRS?g
EOF

sed -f sedfile $EXPDIR/forecasts/gcm_forecast.tmp > $EXPDIR/forecasts/gcm_forecast_${FCST_LABL}.j${date}-${nymde}
if( $QSUB != 'FALSE' ) @BATCH_CMD $EXPDIR/forecasts/gcm_forecast_${FCST_LABL}.j${date}-${nymde}
if( $QSUB != 'FALSE' ) {{ BATCH_CMD }} $EXPDIR/forecasts/gcm_forecast_${FCST_LABL}.j${date}-${nymde}

set date = $test
end
Expand Down
102 changes: 51 additions & 51 deletions gcm_forecast.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
# Batch Parameters for Run Job
#######################################################################

#@BATCH_TIME@RUN_FT
#@RUN_FP
#@BATCH_JOBNAME@RUN_FN_&DATE
#@RUN_Q
#@BATCH_GROUP
#@BATCH_OUTPUTNAMEFCSTOUT
#{{ BATCH_TIME }}{{ RUN_FT }}
#{{ RUN_FP }}
#{{ BATCH_JOBNAME }}{{ RUN_FN }}_&DATE
#{{ RUN_Q }}
#{{ BATCH_GROUP }}
#{{ BATCH_OUTPUTNAME }}FCSTOUT

#######################################################################
# System Settings
Expand All @@ -25,19 +25,19 @@ limit stacksize unlimited

setenv ARCH `uname`

setenv SITE @SITE
setenv GEOSDIR @GEOSDIR
setenv GEOSBIN @GEOSBIN
setenv GEOSETC @GEOSETC
setenv GEOSUTIL @GEOSSRC
setenv SITE {{ SITE }}
setenv GEOSDIR {{ GEOSDIR }}
setenv GEOSBIN {{ GEOSBIN }}
setenv GEOSETC {{ GEOSETC }}
setenv GEOSUTIL {{ GEOSSRC }}

source $GEOSBIN/g5_modules
setenv @LD_LIBRARY_PATH_CMD ${LD_LIBRARY_PATH}:${GEOSDIR}/lib
setenv {{ LD_LIBRARY_PATH_CMD }} ${LD_LIBRARY_PATH}:${GEOSDIR}/lib
if ( $?BASEDIR ) then
setenv @LD_LIBRARY_PATH_CMD ${@LD_LIBRARY_PATH_CMD}:${BASEDIR}/${ARCH}/lib
setenv {{ LD_LIBRARY_PATH_CMD }} ${{'{'}}{{LD_LIBRARY_PATH_CMD}}{{'}'}}:${BASEDIR}/${ARCH}/lib
endif

setenv RUN_CMD "@RUN_CMD"
setenv RUN_CMD "{{ RUN_CMD }}"

setenv GCMVER `cat $GEOSETC/.AGCM_VERSION`
echo VERSION: $GCMVER
Expand All @@ -47,9 +47,9 @@ echo VERSION: $GCMVER
#######################################################################


setenv EXPID @EXPID
setenv EXPDIR @EXPDIR
setenv HOMDIR @HOMDIR
setenv EXPID {{ EXPID }}
setenv EXPDIR {{ EXPDIR }}
setenv HOMDIR {{ HOMDIR }}

#######################################################################
# Set Forecast Run Parameters
Expand Down Expand Up @@ -104,14 +104,14 @@ set AGCM_LM = `grep '^\s*AGCM_LM:' $HOMDIR/AGCM.rc | cut -d: -f2`
set OGCM_IM = `grep '^\s*OGCM\.IM_WORLD:' $HOMDIR/AGCM.rc | cut -d: -f2`
set OGCM_JM = `grep '^\s*OGCM\.JM_WORLD:' $HOMDIR/AGCM.rc | cut -d: -f2`

@COUPLED set OGCM_LM = `grep '^\s*OGCM\.LM:' $HOMDIR/AGCM.rc | cut -d: -f2`
@COUPLED set NX = `grep '^\s*OGCM\.NX:' $HOMDIR/AGCM.rc | cut -d: -f2`
@COUPLED set NY = `grep '^\s*OGCM\.NY:' $HOMDIR/AGCM.rc | cut -d: -f2`
{{ COUPLED }} set OGCM_LM = `grep '^\s*OGCM\.LM:' $HOMDIR/AGCM.rc | cut -d: -f2`
{{ COUPLED }} set NX = `grep '^\s*OGCM\.NX:' $HOMDIR/AGCM.rc | cut -d: -f2`
{{ COUPLED }} set NY = `grep '^\s*OGCM\.NY:' $HOMDIR/AGCM.rc | cut -d: -f2`

# Calculate number of cores/nodes for IOSERVER
# --------------------------------------------

set USE_IOSERVER = @USE_IOSERVER
set USE_IOSERVER = {{ USE_IOSERVER }}
set NUM_OSERVER_NODES = `grep '^\s*IOSERVER_NODES:' $HOMDIR/AGCM.rc | cut -d: -f2`
set NUM_BACKEND_PES = `grep '^\s*NUM_BACKEND_PES:' $HOMDIR/AGCM.rc | cut -d: -f2`

Expand All @@ -127,7 +127,7 @@ endif

@ MODEL_NPES = $NX * $NY

set NCPUS_PER_NODE = @NCPUS_PER_NODE
set NCPUS_PER_NODE = {{ NCPUS_PER_NODE }}
set NUM_MODEL_NODES=`echo "scale=6;($MODEL_NPES / $NCPUS_PER_NODE)" | bc | awk 'function ceil(x, y){y=int(x); return(x>y?y+1:y)} {print ceil($1)}'`

if ( $NCPUS != NULL ) then
Expand Down Expand Up @@ -347,22 +347,22 @@ done:
# Link Boundary Datasets
#######################################################################

setenv BCSDIR @BCSDIR
@DATAOCEANsetenv SSTDIR @SSTDIR
setenv BCRSLV @ATMOStag_@OCEANtag
@MOM5setenv SSTDIR @COUPLEDIR/SST/MERRA2/${OGCM_IM}x${OGCM_JM}/v1
@MOM6setenv SSTDIR @COUPLEDIR/SST/MERRA2/${OGCM_IM}x${OGCM_JM}/v1
setenv BCSDIR {{ BCSDIR }}
{{ DATAOCEAN }}setenv SSTDIR {{ SSTDIR }}
setenv BCRSLV {{ ATMOStag }}_{{ OCEANtag }}
{{ MOM5 }}setenv SSTDIR {{ COUPLEDIR }}/SST/MERRA2/${OGCM_IM}x${OGCM_JM}/v1
{{ MOM6 }}setenv SSTDIR {{ COUPLEDIR }}/SST/MERRA2/${OGCM_IM}x${OGCM_JM}/v1

#this is hard-wired for NAS for now - should make it more general
@DATAOCEANsetenv BCTAG `basename $BCSDIR`
@COUPLEDsetenv BCTAG `basename @COUPLEDIR/@OCNMODEL/${OGCM_IM}x${OGCM_JM}`
setenv EMISSIONS @EMISSIONS
{{ DATAOCEAN }}setenv BCTAG `basename $BCSDIR`
{{ COUPLED }}setenv BCTAG `basename {{ COUPLEDIR }}/{{ OCNMODEL }}/${OGCM_IM}x${OGCM_JM}`
setenv EMISSIONS {{ EMISSIONS }}
chmod +x linkbcs

>>>GCMRUN_CATCHCN<<<set LSM_CHOICE = `grep LSM_CHOICE: AGCM.rc | cut -d':' -f2`
>>>GCMRUN_CATCHCN<<<if ($LSM_CHOICE == 2) then
>>>GCMRUN_CATCHCN<<< grep -v "'CNFROOTC'" HISTORY.rc > Hist_tmp.rc && mv Hist_tmp.rc HISTORY.rc
>>>GCMRUN_CATCHCN<<<endif
{{ GCMRUN_CATCHCN }}set LSM_CHOICE = `grep LSM_CHOICE: AGCM.rc | cut -d':' -f2`
{{ GCMRUN_CATCHCN }}if ($LSM_CHOICE == 2) then
{{ GCMRUN_CATCHCN }} grep -v "'CNFROOTC'" HISTORY.rc > Hist_tmp.rc && mv Hist_tmp.rc HISTORY.rc
{{ GCMRUN_CATCHCN }}endif

#######################################################################
# Get Executable and RESTARTS
Expand Down Expand Up @@ -423,7 +423,7 @@ endif
# Get proper ridge scheme GWD internal restart
# --------------------------------------------
/bin/rm gwd_internal_rst
/bin/cp @GWDRSDIR/gwd_internal_c${AGCM_IM} gwd_internal_rst
/bin/cp {{ GWDRSDIR }}/gwd_internal_c${AGCM_IM} gwd_internal_rst

# Re-Create Proper CAP.rc
# -----------------------
Expand Down Expand Up @@ -553,16 +553,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_TURN_OFF_WSUB_EXTDATA# 1MOM and GFDL microphysics do not use WSUB_CLIM
@MP_TURN_OFF_WSUB_EXTDATA# -------------------------------------------------
{{ 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_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
{{ MP_TURN_OFF_WSUB_EXTDATA }}/bin/mv WSUB_ExtData.rc WSUB_ExtData.tmp
{{ MP_TURN_OFF_WSUB_EXTDATA }}cat WSUB_ExtData.tmp | sed -e '/^WSUB_CLIM/ s#ExtData.*#/dev/null#' > WSUB_ExtData.rc
else
@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
{{ MP_TURN_OFF_WSUB_EXTDATA }}/bin/mv WSUB_ExtData.yaml WSUB_ExtData.tmp
{{ MP_TURN_OFF_WSUB_EXTDATA }}cat WSUB_ExtData.tmp | sed -e '/collection:/ s#WSUB_SWclim.*#/dev/null#' > WSUB_ExtData.yaml
endif
@MP_TURN_OFF_WSUB_EXTDATA/bin/rm WSUB_ExtData.tmp
{{ MP_TURN_OFF_WSUB_EXTDATA }}/bin/rm WSUB_ExtData.tmp

# Generate the complete ExtData.rc
# --------------------------------
Expand Down Expand Up @@ -604,7 +604,7 @@ setenv YEAR $yearc

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

# If running in dual ocean mode, link sst and fraci data here
Expand Down Expand Up @@ -634,8 +634,8 @@ else

# Run the script
# --------------
@SINGULARITY_BUILD $RUN_CMD 1 $SINGULARITY_RUN $GEOSBIN/SaltIntSplitter tile.data $SCRDIR/saltwater_internal_rst
@NATIVE_BUILD $RUN_CMD 1 $GEOSBIN/SaltIntSplitter tile.data $SCRDIR/saltwater_internal_rst
{{ SINGULARITY_BUILD }} $RUN_CMD 1 $SINGULARITY_RUN $GEOSBIN/SaltIntSplitter tile.data $SCRDIR/saltwater_internal_rst
{{ NATIVE_BUILD }} $RUN_CMD 1 $GEOSBIN/SaltIntSplitter tile.data $SCRDIR/saltwater_internal_rst

# Move restarts
# -------------
Expand Down Expand Up @@ -673,8 +673,8 @@ endif
if ( -x $GEOSBIN/rs_numtiles.x ) then

set N_OPENW_TILES_EXPECTED = `grep '^\s*0' tile.data | wc -l`
@SINGULARITY_BUILD set N_OPENW_TILES_FOUND = `$RUN_CMD 1 $SINGULARITY_RUN $GEOSBIN/rs_numtiles.x openwater_internal_rst | grep Total | awk '{print $NF}'`
@NATIVE_BUILD set N_OPENW_TILES_FOUND = `$RUN_CMD 1 $GEOSBIN/rs_numtiles.x openwater_internal_rst | grep Total | awk '{print $NF}'`
{{ SINGULARITY_BUILD }} set N_OPENW_TILES_FOUND = `$RUN_CMD 1 $SINGULARITY_RUN $GEOSBIN/rs_numtiles.x openwater_internal_rst | grep Total | awk '{print $NF}'`
{{ NATIVE_BUILD }} set N_OPENW_TILES_FOUND = `$RUN_CMD 1 $GEOSBIN/rs_numtiles.x openwater_internal_rst | grep Total | awk '{print $NF}'`

if ( $N_OPENW_TILES_EXPECTED != $N_OPENW_TILES_FOUND ) then
echo "Error! Found $N_OPENW_TILES_FOUND tiles in openwater. Expect to find $N_OPENW_TILES_EXPECTED tiles."
Expand Down Expand Up @@ -718,9 +718,9 @@ endif
# Environment variables for MPI, etc
# ----------------------------------

@SETENVS
{{ SETENVS }}

@MPT_SHEPHERD
{{ MPT_SHEPHERD }}

# Run bundleParser.py
#---------------------
Expand Down Expand Up @@ -765,8 +765,8 @@ else
set IOSERVER_EXTRA = ""
endif

@SINGULARITY_BUILD @OCEAN_PRELOAD $RUN_CMD $TOTAL_PES $SINGULARITY_RUN $GEOSEXE $IOSERVER_OPTIONS $IOSERVER_EXTRA --logging_config 'logging.yaml'
@NATIVE_BUILD @OCEAN_PRELOAD $RUN_CMD $TOTAL_PES $GEOSEXE $IOSERVER_OPTIONS $IOSERVER_EXTRA --logging_config 'logging.yaml'
{{ SINGULARITY_BUILD }} {{ OCEAN_PRELOAD }} $RUN_CMD $TOTAL_PES $SINGULARITY_RUN $GEOSEXE $IOSERVER_OPTIONS $IOSERVER_EXTRA --logging_config 'logging.yaml'
{{ NATIVE_BUILD }} {{ OCEAN_PRELOAD }} $RUN_CMD $TOTAL_PES $GEOSEXE $IOSERVER_OPTIONS $IOSERVER_EXTRA --logging_config 'logging.yaml'

if( $USE_SHMEM == 1 ) $GEOSBIN/RmShmKeys_sshmpi.csh >& /dev/null

Expand Down
Loading