Skip to content

Commit 8acdeb2

Browse files
authored
Merge pull request #776 from GEOS-ESM/feature/v12-fix-bad-exit
v12: Add better exit control for gcm_run.j
2 parents 56efef2 + f74704f commit 8acdeb2

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

gcm_run.j

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ endif
927927
#ln -sf $SSTDIR/dataoceanfile_MERRA2_SST.${OGCM_IM}x${OGCM_JM}.${yy}.data sst.data
928928
#ln -sf $SSTDIR/dataoceanfile_MERRA2_ICE.${OGCM_IM}x${OGCM_JM}.${yy}.data fraci.data
929929
930-
@CICE6 #detect exisistence of certain fields in CICE6 restart
930+
@CICE6 #detect existence of certain fields in CICE6 restart
931931
@CICE6 ncdump -h INPUT/iced.nc | grep 'apnd' > /dev/null
932932
@CICE6 if( $status == 0 ) then
933933
@CICE6 echo 'pond state in restart, turn on restart flag if not already'
@@ -1171,12 +1171,22 @@ endif
11711171
@SINGULARITY_BUILD @OCEAN_PRELOAD $RUN_CMD $TOTAL_PES $SINGULARITY_RUN $GEOSEXE $IOSERVER_OPTIONS $IOSERVER_EXTRA --logging_config 'logging.yaml'
11721172
@NATIVE_BUILD @OCEAN_PRELOAD @SEVERAL_TRIES $RUN_CMD $TOTAL_PES $GEOSEXE $IOSERVER_OPTIONS $IOSERVER_EXTRA --logging_config 'logging.yaml'
11731173

1174+
# Capture the return code from GEOSgcm.x
1175+
# --------------------------------------
1176+
set run_status = $status
1177+
1178+
if ($run_status != 0) then
1179+
echo "GEOSgcm.x failed with return code $run_status"
1180+
exit $run_status
1181+
endif
1182+
11741183
if( $USE_SHMEM == 1 ) $GEOSBIN/RmShmKeys_sshmpi.csh >& /dev/null
11751184

11761185
if( -e EGRESS ) then
11771186
set rc = 0
11781187
else
1179-
set rc = -1
1188+
echo "EGRESS file not found, GEOSgcm.x likely failed"
1189+
exit 9
11801190
endif
11811191
echo GEOSgcm Run Status: $rc
11821192

0 commit comments

Comments
 (0)