Skip to content

Commit ee1397d

Browse files
authored
Merge pull request #189 from GEOS-ESM/bugfix/mathomp4/#188-fix-salt-split
Fixes #188. Fix saltwater_internal splitting
2 parents 937e509 + 2213089 commit ee1397d

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

gcm_run.j

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,13 @@ endif
669669
if ( (-e $SCRDIR/openwater_internal_rst) && (-e $SCRDIR/seaicethermo_internal_rst)) then
670670
echo "Saltwater internal state is already split, good to go!"
671671
else
672-
if ( ( -e $SCRDIR/saltwater_internal_rst ) && ( $counter == 1 ) ) then
672+
if ( ( ( -e $SCRDIR/saltwater_internal_rst ) || ( -e $EXPDIR/saltwater_internal_rst) ) && ( $counter == 1 ) ) then
673+
674+
echo "Found Saltwater internal state. Splitting..."
675+
676+
# If saltwater_internal_rst is in EXPDIR move to SCRDIR
677+
# -----------------------------------------------------
678+
if ( -e $EXPDIR/saltwater_internal_rst ) /bin/mv $EXPDIR/saltwater_internal_rst $SCRDIR
673679

674680
# The splitter script requires an OutData directory
675681
# -------------------------------------------------
@@ -709,16 +715,16 @@ else
709715
endif
710716
endif
711717

712-
# Test Saltwater Restart for Number of tiles correctness
718+
# Test Openwater Restart for Number of tiles correctness
713719
# ------------------------------------------------------
714720

715721
if ( -x $GEOSBIN/rs_numtiles.x ) then
716722

717-
set N_SALT_TILES_EXPECTED = `grep '^ *0' tile.data | wc -l`
718-
set N_SALT_TILES_FOUND = `$RUN_CMD 1 $GEOSBIN/rs_numtiles.x openwater_internal_rst | grep Total | awk '{print $NF}'`
723+
set N_OPENW_TILES_EXPECTED = `grep '^ *0' tile.data | wc -l`
724+
set N_OPENW_TILES_FOUND = `$RUN_CMD 1 $GEOSBIN/rs_numtiles.x openwater_internal_rst | grep Total | awk '{print $NF}'`
719725

720-
if ( $N_SALT_TILES_EXPECTED != $N_SALT_TILES_FOUND ) then
721-
echo "Error! Found $N_SALT_TILES_FOUND tiles in openwater. Expect to find $N_SALT_TILES_EXPECTED tiles."
726+
if ( $N_OPENW_TILES_EXPECTED != $N_OPENW_TILES_FOUND ) then
727+
echo "Error! Found $N_OPENW_TILES_FOUND tiles in openwater. Expect to find $N_OPENW_TILES_EXPECTED tiles."
722728
echo "Your restarts are probably for a different ocean."
723729
exit 7
724730
endif

0 commit comments

Comments
 (0)