Skip to content

Commit

Permalink
Merge pull request #573 from GEOS-ESM/feature/mathomp4/571-update-reg…
Browse files Browse the repository at this point in the history
…ress

Use nccmp, add readers/writers test to regress
  • Loading branch information
sdrabenh authored Feb 21, 2024
2 parents 94e3cbf + db69cd9 commit 1db085a
Showing 1 changed file with 25 additions and 36 deletions.
61 changes: 25 additions & 36 deletions gcm_regress.j
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ if( $RUN_STARTSTOP == TRUE ) then

# Some replay runs also have checkpoints like mkiau_checkpoint.20150509_2200z.nc4
# and we need to move those as well if they exist
set replay_chk_file_names = `ls -1 mkiau_checkpoint.*.nc4`
set replay_chk_file_names = `ls -1 mkiau_checkpoint.*.nc4`
# Need also make another variable storing all the mkiau_checkpoint files
set complete_startstop_replay_chk_file_names = `ls -1 mkiau_checkpoint.*.nc4`
foreach chk ( $replay_chk_file_names )
Expand Down Expand Up @@ -533,7 +533,7 @@ end

# Some replay runs also have checkpoints like mkiau_checkpoint.20150509_2200z.nc4
# and we need to move those as well if they exist
set replay_chk_file_names = `ls -1 mkiau_checkpoint.*.nc4`
set replay_chk_file_names = `ls -1 mkiau_checkpoint.*.nc4`
# Need also make another variable storing all the replay checkpoint files
set complete_layout_replay_chk_file_names = `ls -1 mkiau_checkpoint.*.nc4`
foreach chk ( $replay_chk_file_names )
Expand Down Expand Up @@ -631,7 +631,7 @@ if ($RUN_STARTSTOP == TRUE) then

# Some replay runs also have checkpoints like mkiau_checkpoint.20150509_2200z.nc4
# and we need to move those as well if they exist
set replay_chk_file_names = `ls -1 mkiau_checkpoint.*.nc4`
set replay_chk_file_names = `ls -1 mkiau_checkpoint.*.nc4`
foreach chk ( $replay_chk_file_names )
/bin/mv -v $chk ${chk}.${nymde1}_${nhmse1}.3
end
Expand Down Expand Up @@ -692,6 +692,7 @@ if ( $RUN_LAYOUT == TRUE) then
/bin/mv CAP.rc CAP.tmp
cat CAP.tmp | sed -e "s?$oldstring?$newstring?g" > CAP.rc

# Set the new NX and NY
./strip AGCM.rc
set oldstring = `cat AGCM.rc | grep "^ *NX:"`
set newstring = "NX: ${test_NX}"
Expand All @@ -701,6 +702,17 @@ if ( $RUN_LAYOUT == TRUE) then
set newstring = "NY: ${test_NY}"
/bin/mv AGCM.rc AGCM.tmp
cat AGCM.tmp | sed -e "s?$oldstring?$newstring?g" > AGCM.rc

# Set the new number of writers and readers
set oldstring = `cat AGCM.rc | grep "^ *NUM_WRITERS:"`
set newstring = "NUM_WRITERS: 6"
/bin/mv AGCM.rc AGCM.tmp
cat AGCM.tmp | sed -e "s?$oldstring?$newstring?g" > AGCM.rc
set oldstring = `cat AGCM.rc | grep "^ *NUM_READERS:"`
set newstring = "NUM_READERS: 6"
/bin/mv AGCM.rc AGCM.tmp
cat AGCM.tmp | sed -e "s?$oldstring?$newstring?g" > AGCM.rc

@COUPLED set oldstring = `cat AGCM.rc | grep "^ *OGCM.NX:"`
@COUPLED set newstring = "OGCM.NX: ${test_NY}"
@COUPLED /bin/mv AGCM.rc AGCM.tmp
Expand Down Expand Up @@ -733,7 +745,7 @@ if ( $RUN_LAYOUT == TRUE) then

# Some replay runs also have checkpoints like mkiau_checkpoint.20150509_2200z.nc4
# and we need to move those as well if they exist
set replay_chk_file_names = `ls -1 mkiau_checkpoint.*.nc4`
set replay_chk_file_names = `ls -1 mkiau_checkpoint.*.nc4`
foreach chk ( $replay_chk_file_names )
/bin/mv -v $chk ${chk}.${nymde1}_${nhmse1}.4
end
Expand All @@ -749,6 +761,9 @@ if ( $RUN_LAYOUT == TRUE) then

endif

# Set the comparison command for netCDF-4 files
set NCCMP = `echo ${BASEDIR}/${ARCH}/bin/nccmp -dmfgBq `

#######################################################################
# Compare Restarts
# for start stop regression
Expand All @@ -759,8 +774,6 @@ endif

if ($RUN_STARTSTOP == TRUE) then

set NCCMP = `echo ${BASEDIR}/${ARCH}/bin/nccmp -dmfgBq `

if( -e startstop_regress_test ) /bin/rm startstop_regress_test

echo "=== Comparing restarts from ${NX0}x${NY0} run of duration ${test_duration_step1} with restarts from ${test_duration_step2} + ${test_duration_step3} ${NX0}x${NY0} runs ==="
Expand All @@ -777,8 +790,8 @@ if ($RUN_STARTSTOP == TRUE) then
if( $check == true ) then
echo Comparing ${chk}

# compare binary checkpoint files
cmp $file1 $file2
# compare NetCDF-4 checkpoint files
${NCCMP} $file1 $file2
if( $status == 0 ) then
echo Start-Stop Success!
echo " "
Expand All @@ -788,17 +801,6 @@ if ($RUN_STARTSTOP == TRUE) then
set startstop_pass = false
endif

# compare NetCDF-4 checkpoint files
# ${NCCMP} $file1 $file2
# if( status == 0 ) then
# echo Start-Stop Success!
# echo " "
# else
# echo Start-Stop Failed!
# echo " "
# set startstop_pass = false
# endif

endif
endif
end
Expand Down Expand Up @@ -897,8 +899,6 @@ endif

if ($RUN_LAYOUT == TRUE) then

set NCCMP = `echo ${BASEDIR}/${ARCH}/bin/nccmp -dmfgBq `

if( -e layout_regress_test ) /bin/rm layout_regress_test

echo "=== Comparing restarts from ${NX0}x${NY0} run of duration ${test_duration_step2} with restarts from ${test_NX}x${test_NY} run of duration ${test_duration_step4} ==="
Expand All @@ -915,8 +915,8 @@ if ($RUN_LAYOUT == TRUE) then
if( $check == true ) then
echo Comparing ${chk}

# compare binary checkpoint files
cmp $file1 $file2
# compare NetCDF-4 checkpoint files
${NCCMP} $file1 $file2
if( $status == 0 ) then
echo Layout Success!
echo " "
Expand All @@ -926,17 +926,6 @@ if ($RUN_LAYOUT == TRUE) then
set layout_pass = false
endif

# compare NetCDF-4 checkpoint files
# ${NCCMP} $file1 $file2
# if( status == 0 ) then
# echo Layout Success!
# echo " "
# else
# echo Layout Failed!
# echo " "
# set layout_pass = false
# endif

endif
endif
end
Expand Down Expand Up @@ -971,7 +960,7 @@ if ($RUN_LAYOUT == TRUE) then
if( $check == true ) then
echo Comparing ${chk}

# compare checkpoint files
# compare checkpoint files
${NCCMP} $file1 $file2
if( $status == 0 ) then
echo Layout Success!
Expand All @@ -997,7 +986,7 @@ if ($RUN_LAYOUT == TRUE) then
if( $check == true ) then
echo Comparing ${hist}

# compare history files
# compare history files
${NCCMP} $file1 $file2
if( $status == 0 ) then
echo Layout Success!
Expand Down

0 comments on commit 1db085a

Please sign in to comment.