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

replace esmf_logmsg_error with calls to shr_abort #532

Merged
merged 8 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/extbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
CPPFLAGS: "-I/usr/include -I/usr/local/include"

# Versions of all dependencies can be updated here
ESMF_VERSION: v8.6.1
PNETCDF_VERSION: checkpoint.1.12.3
ESMF_VERSION: v8.7.0
PNETCDF_VERSION: checkpoint.1.14.0
NETCDF_FORTRAN_VERSION: v4.6.1
PIO_VERSION: pio2_6_3
CDEPS_VERSION: cdeps1.0.59
CDEPS_VERSION: cdeps1.0.62
steps:
- uses: actions/checkout@v4
# Build the ESMF library, if the cache contains a previous build
Expand Down
71 changes: 28 additions & 43 deletions cesm/driver/esm_time_mod.F90
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module esm_time_mod

use shr_kind_mod , only : cx=>shr_kind_cx, cs=>shr_kind_cs, cl=>shr_kind_cl, r8=>shr_kind_r8
use shr_sys_mod , only : shr_sys_abort
use ESMF , only : ESMF_GridComp, ESMF_GridCompGet, ESMF_GridCompSet
use ESMF , only : ESMF_Clock, ESMF_ClockCreate, ESMF_ClockGet, ESMF_ClockSet
use ESMF , only : ESMF_ClockAdvance
Expand All @@ -9,7 +10,7 @@ module esm_time_mod
use ESMF , only : ESMF_CALKIND_NOLEAP, ESMF_CALKIND_GREGORIAN
use ESMF , only : ESMF_Time, ESMF_TimeGet, ESMF_TimeSet
use ESMF , only : ESMF_TimeInterval, ESMF_TimeIntervalSet, ESMF_TimeIntervalGet
use ESMF , only : ESMF_SUCCESS, ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_FAILURE, ESMF_LOGMSG_ERROR
use ESMF , only : ESMF_SUCCESS, ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_FAILURE
use ESMF , only : ESMF_VM, ESMF_VMGet, ESMF_VMBroadcast
use ESMF , only : ESMF_VMAllReduce, ESMF_REDUCE_MAX, ESMF_ClockGetAlarm
use ESMF , only : ESMF_LOGMSG_INFO, ESMF_FAILURE, ESMF_GridCompIsPetLocal
Expand Down Expand Up @@ -140,26 +141,20 @@ subroutine esm_time_clockinit(ensemble_driver, instance_driver, logunit, maintas
write(logunit,*) " read rpointer file = "//trim(restart_pfile)
inquire( file=trim(restart_pfile), exist=exists)
if (.not. exists) then
rc = ESMF_FAILURE
call ESMF_LogWrite(trim(subname)//' ERROR rpointer file '//trim(restart_pfile)//' not found', &
ESMF_LOGMSG_ERROR, line=__LINE__, file=__FILE__)
return
call shr_sys_abort(trim(subname)//' ERROR rpointer file '//trim(restart_pfile)//' not found',&
line=__LINE__, file=__FILE__)
endif
call ESMF_LogWrite(trim(subname)//" read rpointer file = "//trim(restart_pfile), &
ESMF_LOGMSG_INFO)
open(newunit=unitn, file=restart_pfile, form='FORMATTED', status='old',iostat=ierr)
if (ierr < 0) then
rc = ESMF_FAILURE
call ESMF_LogWrite(trim(subname)//' ERROR rpointer file open returns error', &
ESMF_LOGMSG_ERROR, line=__LINE__, file=__FILE__)
return
call shr_sys_abort(trim(subname)//' ERROR rpointer file open returns error', &
line=__LINE__, file=__FILE__)
end if
read(unitn,'(a)', iostat=ierr) restart_file
if (ierr < 0) then
rc = ESMF_FAILURE
call ESMF_LogWrite(trim(subname)//' ERROR rpointer file read returns error', &
ESMF_LOGMSG_INFO, line=__LINE__, file=__FILE__)
return
call shr_sys_abort(trim(subname)//' ERROR rpointer file read returns error', &
line=__LINE__, file=__FILE__)
end if
close(unitn)
if (maintask) then
Expand Down Expand Up @@ -372,68 +367,58 @@ subroutine esm_time_read_restart(restart_file, start_ymd, start_tod, curr_ymd, c
rc = ESMF_SUCCESS
status = nf90_open(restart_file, NF90_NOWRITE, ncid)
if (status /= nf90_NoErr) then
call ESMF_LogWrite(trim(subname)//' ERROR: nf90_open: '//trim(restart_file), ESMF_LOGMSG_ERROR)
rc = ESMF_FAILURE
return
call shr_sys_abort(trim(subname)//' ERROR: nf90_open: '//trim(restart_file),&
file=__FILE__, line=__LINE__)
endif

status = nf90_inq_varid(ncid, 'start_ymd', varid)
if (status /= nf90_NoErr) then
call ESMF_LogWrite(trim(subname)//' ERROR: nf90_inq_varid start_ymd', ESMF_LOGMSG_ERROR)
rc = ESMF_FAILURE
return
call shr_sys_abort(trim(subname)//' ERROR: nf90_inq_varid start_ymd', &
file=__FILE__, line=__LINE__)
end if
status = nf90_get_var(ncid, varid, start_ymd)
if (status /= nf90_NoErr) then
call ESMF_LogWrite(trim(subname)//' ERROR: nf90_get_var start_ymd', ESMF_LOGMSG_ERROR)
rc = ESMF_FAILURE
return
call shr_sys_abort(trim(subname)//' ERROR: nf90_get_var start_ymd', &
file=__FILE__, line=__LINE__)
end if

status = nf90_inq_varid(ncid, 'start_tod', varid)
if (status /= nf90_NoErr) then
call ESMF_LogWrite(trim(subname)//' ERROR: nf90_inq_varid start_tod', ESMF_LOGMSG_ERROR)
rc = ESMF_FAILURE
return
call shr_sys_abort(trim(subname)//' ERROR: nf90_inq_varid start_tod', &
file=__FILE__, line=__LINE__)
end if
status = nf90_get_var(ncid, varid, start_tod)
if (status /= nf90_NoErr) then
call ESMF_LogWrite(trim(subname)//' ERROR: nf90_get_var start_tod', ESMF_LOGMSG_ERROR)
rc = ESMF_FAILURE
return
call shr_sys_abort(trim(subname)//' ERROR: nf90_get_var start_tod', &
file=__FILE__, line=__LINE__)
end if

status = nf90_inq_varid(ncid, 'curr_ymd', varid)
if (status /= nf90_NoErr) then
call ESMF_LogWrite(trim(subname)//' ERROR: nf90_inq_varid curr_ymd', ESMF_LOGMSG_ERROR)
rc = ESMF_FAILURE
return
call shr_sys_abort(trim(subname)//' ERROR: nf90_inq_varid curr_ymd', &
file=__FILE__, line=__LINE__)
end if
status = nf90_get_var(ncid, varid, curr_ymd)
if (status /= nf90_NoErr) then
call ESMF_LogWrite(trim(subname)//' ERROR: nf90_get_var curr_ymd', ESMF_LOGMSG_ERROR)
rc = ESMF_FAILURE
return
call shr_sys_abort(trim(subname)//' ERROR: nf90_get_var curr_ymd', &
file=__FILE__, line=__LINE__)
end if

status = nf90_inq_varid(ncid, 'curr_tod', varid)
if (status /= nf90_NoErr) then
call ESMF_LogWrite(trim(subname)//' ERROR: nf90_inq_varid curr_tod', ESMF_LOGMSG_ERROR)
rc = ESMF_FAILURE
return
call shr_sys_abort(trim(subname)//' ERROR: nf90_inq_varid curr_tod', &
file=__FILE__, line=__LINE__)
end if
status = nf90_get_var(ncid, varid, curr_tod)
if (status /= nf90_NoErr) then
call ESMF_LogWrite(trim(subname)//' ERROR: nf90_get_var curr_tod', ESMF_LOGMSG_ERROR)
rc = ESMF_FAILURE
return
call shr_sys_abort(trim(subname)//' ERROR: nf90_get_var curr_tod', &
file=__FILE__, line=__LINE__)
end if

status = nf90_close(ncid)
if (status /= nf90_NoErr) then
call ESMF_LogWrite(trim(subname)//' ERROR: nf90_close', ESMF_LOGMSG_ERROR)
rc = ESMF_FAILURE
return
call shr_sys_abort(trim(subname)//' ERROR: nf90_close', &
file=__FILE__, line=__LINE__)
end if

write(tmpstr,*) trim(subname)//" read start_ymd = ",start_ymd
Expand Down
86 changes: 43 additions & 43 deletions cime_config/testdefs/testlist_drv.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,44 +42,11 @@
</options>
</test>

<!-- ======================================= -->
ekluzek marked this conversation as resolved.
Show resolved Hide resolved
<!-- X compsets -->
<!-- ======================================= -->

<test compset="X" grid="f19_g17" name="SMS">
<machines>
<machine name="derecho" compiler="gnu" category="aux_cmeps"/>
<machine name="izumi" compiler="intel" category="aux_cmeps"/>
</machines>
<options>
<option name="wallclock"> 00:20:00 </option>
</options>
</test>
<test compset="X" grid="f19_g17" name="ERS_Ln9">
<machines>
<machine name="derecho" compiler="intel" category="aux_cmeps"/>
<machine name="izumi" compiler="intel" category="aux_cmeps"/>
</machines>
<options>
<option name="wallclock"> 00:40:00 </option>
</options>
</test>

<test compset="X" grid="f19_g17" name="ERS_D_Ln9" testmods="drv/aoflux_ogrid">
<machines>
<machine name="derecho" compiler="intel" category="aux_cmeps"/>
</machines>
<options>
<option name="wallclock"> 00:40:00 </option>
<option name="comment">The default aoflux_grid is now xgrid; include a debug test with different atm/ocn grids with aoflux_grid=ogrid to make sure that option continues to work.</option>
</options>
</test>

<!-- ======================================= -->
<!-- B compsets -->
<!-- ======================================= -->

<test compset="B1850MOM" grid="f09_t061" name="ERR_Ld5" testmods="allactive/defaultio">
<test compset="BMT1850" grid="ne30pg3_t232" name="ERR_Ld5" testmods="allactive/defaultio">
<machines>
<machine name="derecho" compiler="intel" category="aux_cmeps"/>
<machine name="izumi" compiler="intel" category="aux_cmeps"/>
Expand All @@ -88,7 +55,7 @@
<option name="wallclock"> 00:40:00 </option>
</options>
</test>
<test compset="BLT1850_v0c" grid="ne30pg3_t232" name="ERS_Ld5" testmods="allactive/defaultio">
ekluzek marked this conversation as resolved.
Show resolved Hide resolved
<test compset="BLT1850" grid="ne30pg3_t232" name="ERS_Ld5" testmods="allactive/defaultio">
<machines>
<machine name="derecho" compiler="intel" category="aux_cmeps"/>
<machine name="izumi" compiler="intel" category="aux_cmeps"/>
Expand All @@ -102,7 +69,7 @@
<!-- C compsets -->
<!-- ======================================= -->

<test compset="CMOM" grid="T62_g17" name="ERS_Ld5">
<test compset="C" grid="T62_t232" name="ERS_Ld5">
<machines>
<machine name="derecho" compiler="gnu" category="aux_cmeps"/>
<machine name="izumi" compiler="intel" category="aux_cmeps"/>
Expand All @@ -111,7 +78,7 @@
<option name="wallclock"> 00:40:00 </option>
</options>
</test>
<test compset="CMOM_JRA" grid="T62_t061" name="SMS_Ld5">
<test compset="C_JRA" grid="T62_t232" name="SMS_Ld5">
<machines>
<machine name="derecho" compiler="intel" category="aux_cmeps"/>
<machine name="izumi" compiler="intel" category="aux_cmeps"/>
Expand All @@ -120,7 +87,7 @@
<option name="wallclock"> 00:40:00 </option>
</options>
</test>
<test compset="CMOM" grid="T62_t061" name="ERS_Ld5">
<test compset="C" grid="T62_t232" name="ERS_Ld5">
<machines>
<machine name="derecho" compiler="intel" category="aux_cmeps"/>
<machine name="izumi" compiler="intel" category="aux_cmeps"/>
Expand All @@ -134,7 +101,7 @@
<!-- G compsets -->
<!-- ======================================= -->

<test compset="GMOM_JRA" grid="T62_g17" name="ERS_Ld5">
<test compset="G_JRA" grid="T62_t232" name="ERS_Ld5">
<machines>
<machine name="derecho" compiler="nvhpc" category="aux_cmeps"/>
<machine name="izumi" compiler="intel" category="aux_cmeps"/>
Expand All @@ -143,7 +110,7 @@
<option name="wallclock"> 00:10:00 </option>
</options>
</test>
<test compset="GMOM" grid="T62_t061" name="SMS_Ld5">
<test compset="G" grid="T62_t232" name="SMS_Ld5">
<machines>
<machine name="derecho" compiler="gnu" category="aux_cmeps"/>
<machine name="izumi" compiler="intel" category="aux_cmeps"/>
Expand All @@ -152,7 +119,7 @@
<option name="wallclock"> 00:10:00 </option>
</options>
</test>
<test compset="GMOM" grid="T62_t061" name="ERS_Ld5">
<test compset="G" grid="T62_t232" name="ERS_Ld5">
<machines>
<machine name="derecho" compiler="intel" category="aux_cmeps"/>
<machine name="izumi" compiler="intel" category="aux_cmeps"/>
Expand Down Expand Up @@ -210,7 +177,7 @@
<!-- I compsets -->
<!-- ======================================= -->

<test compset="I2000Clm51Bgc" grid="f19_g17" name="ERS_Ld5" testmods="clm/default">
<test compset="I2000Clm60Bgc" grid="f19_g17" name="ERS_Ld5" testmods="clm/default">
ekluzek marked this conversation as resolved.
Show resolved Hide resolved
<machines>
<machine name="derecho" compiler="intel" category="aux_cmeps"/>
<machine name="izumi" compiler="intel" category="aux_cmeps"/>
Expand Down Expand Up @@ -247,6 +214,39 @@
</options>
</test>

<!-- ======================================= -->
<!-- X compsets -->
<!-- ======================================= -->

<test compset="X" grid="f19_g17" name="SMS_D">
<machines>
<machine name="derecho" compiler="gnu" category="aux_cmeps"/>
<machine name="izumi" compiler="intel" category="aux_cmeps"/>
</machines>
<options>
<option name="wallclock"> 00:20:00 </option>
</options>
</test>
<test compset="X" grid="f19_g17" name="ERS_Ln9">
<machines>
<machine name="derecho" compiler="intel" category="aux_cmeps"/>
<machine name="izumi" compiler="intel" category="aux_cmeps"/>
</machines>
<options>
<option name="wallclock"> 00:40:00 </option>
</options>
</test>

<test compset="X" grid="f19_g17" name="ERS_D_Ln9" testmods="drv/aoflux_ogrid">
<machines>
<machine name="derecho" compiler="intel" category="aux_cmeps"/>
</machines>
<options>
<option name="wallclock"> 00:40:00 </option>
<option name="comment">The default aoflux_grid is now xgrid; include a debug test with different atm/ocn grids with aoflux_grid=ogrid to make sure that option continues to work.</option>
</options>
</test>

<!-- ======================================= -->
<!-- TG compsets -->
<!-- ======================================= -->
Expand Down Expand Up @@ -292,7 +292,7 @@
</machines>
</test>

<test name="ERS_Ld5" grid="ne30pg3_t061" compset="B1850MOM" testmods="allactive/defaultio--drv/asyncio1node">
<test name="ERS_Ld5" grid="ne30pg3_t232" compset="BLT1850" testmods="allactive/defaultio--drv/asyncio1node">
<machines>
<machine name="derecho" compiler="gnu" category="prealpha">
<options>
Expand Down
Loading