Skip to content

Commit 728b52a

Browse files
authored
Merge branch 'develop' into feature/v11-convert-to-regrid_method
2 parents d04ca5e + e9beccc commit 728b52a

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

gcm_run.j

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ if ( $NCPUS != NULL ) then
133133
echo "Specified model nodes: $NUM_MODEL_NODES"
134134
echo "Specified oserver nodes: $NUM_OSERVER_NODES"
135135
echo "Specified cores per node: $NCPUS_PER_NODE"
136-
exit
136+
exit 1
137137
endif
138138

139139
else
@@ -151,7 +151,7 @@ if ( $NCPUS != NULL ) then
151151
echo ""
152152
echo "Specified model nodes: $NUM_MODEL_NODES"
153153
echo "Specified cores per node: $NCPUS_PER_NODE"
154-
exit
154+
exit 1
155155
endif
156156

157157
endif
@@ -271,7 +271,7 @@ if (-z input.nml) then
271271
endif
272272
if (-z input.nml) then
273273
echo "input.nml is zero-length"
274-
exit 0
274+
exit 2
275275
endif
276276

277277
@MOM6cp -f $HOMDIR/MOM_input .
@@ -368,7 +368,7 @@ chmod +x linkbcs
368368
@SINGULARITY_BUILD # Error out if SINGULARITY_SANDBOX is not set
369369
@SINGULARITY_BUILD if( $SINGULARITY_SANDBOX == "" ) then
370370
@SINGULARITY_BUILD echo "ERROR: You must set SINGULARITY_SANDBOX to the path to your Singularity sandbox"
371-
@SINGULARITY_BUILD exit 1
371+
@SINGULARITY_BUILD exit 3
372372
@SINGULARITY_BUILD endif
373373
@SINGULARITY_BUILD
374374
@SINGULARITY_BUILD # If SINGULARITY_SANDBOX is non-empty, then run executable in singularity sandbox
@@ -423,7 +423,7 @@ chmod +x linkbcs
423423
@NATIVE_BUILD /bin/cp $EXPDIR/GEOSgcm.x $SCRDIR/GEOSgcm.x
424424
@NATIVE_BUILD else
425425
@NATIVE_BUILD echo "$EXPDIR/GEOSgcm.x not found. Please link or copy the executable to the experiment directory."
426-
@NATIVE_BUILD exit 1
426+
@NATIVE_BUILD exit 4
427427
@NATIVE_BUILD endif
428428
@NATIVE_BUILD setenv GEOSEXE $SCRDIR/GEOSgcm.x
429429

@@ -453,7 +453,7 @@ if( $GCMEMIP == TRUE ) then
453453
foreach rst ( $tile_rsts )
454454
echo ${rst}_internal_rst
455455
end
456-
exit
456+
exit 5
457457
endif
458458
if(-e $EXPDIR/restarts/$RSTDATE/fvcore_internal_face_1_rst) then
459459
set rst_by_face = YES
@@ -465,7 +465,7 @@ else
465465
foreach rst ( $tile_rsts )
466466
echo ${rst}_internal_rst
467467
end
468-
exit
468+
exit 5
469469
endif
470470
if(-e $EXPDIR/fvcore_internal_face_1_rst) then
471471
set rst_by_face = YES
@@ -857,7 +857,7 @@ endif
857857
#ln -sf $SSTDIR/dataoceanfile_MERRA2_SST.${OGCM_IM}x${OGCM_JM}.${yy}.data sst.data
858858
#ln -sf $SSTDIR/dataoceanfile_MERRA2_ICE.${OGCM_IM}x${OGCM_JM}.${yy}.data fraci.data
859859

860-
@CICE6 #detect exisistence of certain fields in CICE6 restart
860+
@CICE6 #detect existence of certain fields in CICE6 restart
861861
@CICE6 ncdump -h INPUT/iced.nc | grep 'apnd' > /dev/null
862862
@CICE6 if( $status == 0 ) then
863863
@CICE6 echo 'pond state in restart, turn on restart flag if not already'
@@ -959,7 +959,7 @@ if ( $PCHEM_CLIM_YEARS == 39 ) then
959959
# String comparison seems to work here...
960960
if ( $YEARMON > $MERRA2OX_END_DATE ) then
961961
echo "You seem to be using MERRA2OX pchem species file, but your simulation date [${YEARMON}] is after 201706. This file is only valid until this time."
962-
exit 2
962+
exit 8
963963
endif
964964
endif
965965

@@ -1062,7 +1062,7 @@ endif
10621062
@MIT echo "If this is a new initialized experiment, delete:"
10631063
@MIT echo "${EXPDIR}/restarts/MITgcm_restart_dates.txt"
10641064
@MIT echo "and restart"
1065-
@MIT exit
1065+
@MIT exit 9
10661066
@MIT else
10671067
@MIT sed -i "s/nIter0.*/ nIter0 = ${nIter0},/" data
10681068
@MIT endif
@@ -1092,12 +1092,22 @@ endif
10921092
@SINGULARITY_BUILD @OCEAN_PRELOAD $RUN_CMD $TOTAL_PES $SINGULARITY_RUN $GEOSEXE $IOSERVER_OPTIONS $IOSERVER_EXTRA --logging_config 'logging.yaml'
10931093
@NATIVE_BUILD @OCEAN_PRELOAD @SEVERAL_TRIES $RUN_CMD $TOTAL_PES $GEOSEXE $IOSERVER_OPTIONS $IOSERVER_EXTRA --logging_config 'logging.yaml'
10941094

1095+
# Capture the return code from GEOSgcm.x
1096+
# --------------------------------------
1097+
set run_status = $status
1098+
1099+
if ($run_status != 0) then
1100+
echo "GEOSgcm.x failed with return code $run_status"
1101+
exit $run_status
1102+
endif
1103+
10951104
if( $USE_SHMEM == 1 ) $GEOSBIN/RmShmKeys_sshmpi.csh >& /dev/null
10961105

10971106
if( -e EGRESS ) then
10981107
set rc = 0
10991108
else
1100-
set rc = -1
1109+
echo "EGRESS file not found, GEOSgcm.x likely failed"
1110+
exit 10
11011111
endif
11021112
echo GEOSgcm Run Status: $rc
11031113

linkbcs.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ setenv BCRSLV @ATMOStag_@OCEANtag
5656
/bin/ln -sf $BCSDIR/land/$BCRSLV/green_clim_@AGCM_IMx@AGCM_JM.data green.data
5757
/bin/ln -sf $BCSDIR/land/$BCRSLV/ndvi_clim_@AGCM_IMx@AGCM_JM.data ndvi.data
5858

59-
@GCMRUN_CATCHCNif ( -f $BCSDIR/$BCRSLV/lnfm_clim_@AGCM_IMx@AGCM_JM.data ) /bin/ln -sf $BCSDIR/$BCRSLV/lnfm_clim_@AGCM_IMx@AGCM_JM.data lnfm.data
59+
@GCMRUN_CATCHCNif ( -f $BCSDIR/land/$BCRSLV/lnfm_clim_@AGCM_IMx@AGCM_JM.data ) /bin/ln -sf $BCSDIR/land/$BCRSLV/lnfm_clim_@AGCM_IMx@AGCM_JM.data lnfm.data
6060
@GCMRUN_CATCHCN/bin/ln -s $BCSDIR/land/shared/CO2_MonthlyMean_DiurnalCycle.nc4
6161

6262

0 commit comments

Comments
 (0)