diff --git a/.github/workflows/extbuild.yml b/.github/workflows/extbuild.yml
index 24b18683d..ca0a694a5 100644
--- a/.github/workflows/extbuild.yml
+++ b/.github/workflows/extbuild.yml
@@ -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
diff --git a/cesm/driver/esm_time_mod.F90 b/cesm/driver/esm_time_mod.F90
index c423b96fc..ada4c24a9 100644
--- a/cesm/driver/esm_time_mod.F90
+++ b/cesm/driver/esm_time_mod.F90
@@ -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
@@ -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
@@ -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
@@ -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
diff --git a/cime_config/testdefs/testlist_drv.xml b/cime_config/testdefs/testlist_drv.xml
index 948bd267b..fd1ad7ac6 100644
--- a/cime_config/testdefs/testlist_drv.xml
+++ b/cime_config/testdefs/testlist_drv.xml
@@ -42,44 +42,11 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -88,7 +55,7 @@
-
+
@@ -102,7 +69,7 @@
-
+
@@ -111,7 +78,7 @@
-
+
@@ -120,7 +87,7 @@
-
+
@@ -134,7 +101,7 @@
-
+
@@ -143,7 +110,7 @@
-
+
@@ -152,7 +119,7 @@
-
+
@@ -210,7 +177,7 @@
-
+
@@ -247,6 +214,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -292,7 +292,7 @@
-
+
diff --git a/mediator/esmFlds.F90 b/mediator/esmFlds.F90
index bcb3d5471..1b29fbe71 100644
--- a/mediator/esmFlds.F90
+++ b/mediator/esmFlds.F90
@@ -1,9 +1,10 @@
module esmflds
- use ESMF, only : ESMF_SUCCESS, ESMF_FAILURE, ESMF_LOGMSG_ERROR, ESMF_LOGWRITE
+ use ESMF, only : ESMF_SUCCESS, ESMF_FAILURE, ESMF_LOGWRITE
use med_kind_mod, only : CX=>SHR_KIND_CX, CS=>SHR_KIND_CS, CL=>SHR_KIND_CL, R8=>SHR_KIND_R8
use med_internalstate_mod, only : compname, compocn, compatm, compice, comprof
use med_internalstate_mod, only : mapfcopy, mapnames, mapunset
use med_utils_mod , only : chkerr => med_utils_ChkErr
+ use shr_sys_mod , only : shr_sys_abort
implicit none
private
@@ -313,9 +314,7 @@ end subroutine med_fldList_AddMrg
!================================================================================
function med_fldList_GetFld(fields, fldname, rc) result(newfld)
- use ESMF, only : ESMF_LogWrite, ESMF_LOGMSG_ERROR, ESMF_LOGMSG_INFO
- use ESMF, only : ESMF_FINALIZE, ESMF_END_ABORT
-
+ use ESMF, only : ESMF_LogWrite, ESMF_LOGMSG_INFO
type(med_fldList_entry_type) , intent(in), target :: fields
character(len=*) , intent(in) :: fldname
@@ -336,8 +335,7 @@ function med_fldList_GetFld(fields, fldname, rc) result(newfld)
write(6,*) trim(subname)//' input flds entry is ',trim(newfld%stdname)
newfld => newfld%next
end do
- call ESMF_LogWrite(subname // 'ERROR: fldname '// trim(fldname) // ' not found in input flds', ESMF_LOGMSG_ERROR)
- call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ call shr_sys_abort(subname // 'ERROR: fldname '// trim(fldname) // ' not found in input flds')
endif
end function med_fldList_GetFld
@@ -385,9 +383,6 @@ end subroutine med_fldList_addmap_ocnalb
!================================================================================
subroutine med_fldList_AddMap(fields, fldname, destcomp, maptype, mapnorm, mapfile)
-
- use ESMF, only : ESMF_LOGMSG_ERROR, ESMF_FAILURE, ESMF_LogWrite, ESMF_LOGMSG_INFO
-
! intput/output variables
type(med_fldList_entry_type) , intent(in), target :: fields
character(len=*) , intent(in) :: fldname
@@ -439,7 +434,7 @@ subroutine med_fldList_Realize(state, fldList, flds_scalar_name, flds_scalar_num
use ESMF , only : ESMF_MeshLoc_Element, ESMF_FieldCreate, ESMF_TYPEKIND_R8
use ESMF , only : ESMF_MAXSTR, ESMF_Field, ESMF_State, ESMF_Grid, ESMF_Mesh
use ESMF , only : ESMF_StateGet, ESMF_LogFoundError
- use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_ERROR, ESMF_FAILURE, ESMF_LOGERR_PASSTHRU
+ use ESMF , only : ESMF_LogWrite, ESMF_FAILURE, ESMF_LOGERR_PASSTHRU
use ESMF , only : ESMF_LOGMSG_INFO, ESMF_StateRemove, ESMF_SUCCESS
use ESMF , only : ESMF_STATEINTENT_IMPORT, ESMF_STATEINTENT_EXPORT, ESMF_StateIntent_Flag
use ESMF , only : ESMF_RC_ARG_BAD, ESMF_LogSetError, operator(==)
@@ -472,10 +467,8 @@ subroutine med_fldList_Realize(state, fldList, flds_scalar_name, flds_scalar_num
rc = ESMF_SUCCESS
if (present(grid) .and. present(mesh)) then
- call ESMF_LogWrite(trim(subname)//trim(tag)//": ERROR both grid and mesh not allowed", &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u, rc=rc)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//trim(tag)//": ERROR both grid and mesh not allowed", &
+ line=__LINE__, file=u_FILE_u, rc=rc)
endif
nullify(StandardNameList)
@@ -575,10 +568,8 @@ subroutine med_fldList_Realize(state, fldList, flds_scalar_name, flds_scalar_num
field = ESMF_FieldCreate(mesh, ESMF_TYPEKIND_R8, name=shortname, meshloc=ESMF_MESHLOC_ELEMENT, rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=u_FILE_u)) return
else
- call ESMF_LogWrite(trim(subname)//trim(tag)//": ERROR grid or mesh expected", &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//trim(tag)//": ERROR grid or mesh expected", &
+ line=__LINE__, file=u_FILE_u)
endif
! NOW call NUOPC_Realize
@@ -676,9 +667,7 @@ subroutine med_fldList_GetFldInfo(fldList, fldindex, compsrc, stdname, shortname
newfld => newfld%next
enddo
if( .not. associated(newfld)) then
- call ESMF_LogWrite(subname//' No field found', ESMF_LOGMSG_ERROR)
- if(present(rc)) rc = ESMF_FAILURE
- return
+ call shr_sys_abort(subname//' No field found')
endif
call med_fld_GetFldInfo(newfld, compsrc, stdname, shortname, mapindex, mapFile, mapnorm, merge_fields, merge_type, merge_fracname, rc)
@@ -719,39 +708,31 @@ subroutine med_fld_GetFldInfo(newfld, compsrc, stdname, shortname, mapindex, map
endif
if(present(mapindex)) then
- if(lcompsrc < 0) call med_fldList_compsrcerror(lrc)
+ if(lcompsrc < 0) call shr_sys_abort("In med_fld_GetFldInfo mapindex requiring compsrc was requested but compsrc was not provided. ")
mapindex = newfld%mapindex(lcompsrc)
endif
if(present(mapfile)) then
- if(lcompsrc < 0) call med_fldList_compsrcerror(lrc)
+ if(lcompsrc < 0) call shr_sys_abort("In med_fld_GetFldInfo mapfile requiring compsrc was requested but compsrc was not provided. ")
mapfile = newfld%mapfile(lcompsrc)
endif
if(present(mapnorm)) then
- if(lcompsrc < 0) call med_fldList_compsrcerror(lrc)
+ if(lcompsrc < 0) call shr_sys_abort("In med_fld_GetFldInfo mapnorm requiring compsrc was requested but compsrc was not provided. ")
mapnorm = newfld%mapnorm(lcompsrc)
endif
if(present(merge_fields)) then
- if(lcompsrc < 0) call med_fldList_compsrcerror(lrc)
+ if(lcompsrc < 0) call shr_sys_abort("In med_fld_GetFldInfo merge_fields requiring compsrc was requested but compsrc was not provided. ")
merge_fields = newfld%merge_fields(lcompsrc)
endif
if(present(merge_type)) then
- if(lcompsrc < 0) call med_fldList_compsrcerror(lrc)
+ if(lcompsrc < 0) call shr_sys_abort("In med_fld_GetFldInfo merge_type requiring compsrc was requested but compsrc was not provided. ")
merge_type = newfld%merge_types(lcompsrc)
endif
if(present(merge_fracname)) then
- if(lcompsrc < 0) call med_fldList_compsrcerror(lrc)
+ if(lcompsrc < 0) call shr_sys_abort("In med_fld_GetFldInfo merge_fracname requiring compsrc was requested but compsrc was not provided. ")
merge_fracname = newfld%merge_fracnames(lcompsrc)
endif
if(present(rc)) rc=lrc
- contains
- subroutine med_fldList_compsrcerror(rc)
- integer, intent(out) :: rc
- call ESMF_LogWrite("In med_fld_GetFldInfo a field requiring compsrc was requested but compsrc was not provided. ", &
- ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- return
- end subroutine med_fldList_compsrcerror
end subroutine med_fld_GetFldInfo
!================================================================================
@@ -778,7 +759,7 @@ end function med_fldList_GetNumFlds
subroutine med_fldList_GetFldNames(fields, fldnames, rc)
- use ESMF, only : ESMF_LOGMSG_ERROR, ESMF_FAILURE, ESMF_SUCCESS, ESMF_LogWrite
+ use ESMF, only : ESMF_SUCCESS
! input/output variables
type(med_fldList_entry_type) , intent(in), target :: fields
@@ -794,9 +775,7 @@ subroutine med_fldList_GetFldNames(fields, fldnames, rc)
if(present(rc)) rc = ESMF_SUCCESS
if (.not. associated(fldnames) .or. .not. allocated(fields%mapindex)) then
write(msg, *) "med_fldList_GetFldNames: ERROR either fields or fldnames have not been allocated. ",associated(fldnames), allocated(fields%mapindex)
- call ESMF_LogWrite(msg, ESMF_LOGMSG_ERROR)
- if(present(rc)) rc = ESMF_FAILURE
- return
+ call shr_sys_abort(msg)
endif
n = 0
newfld => fields
diff --git a/mediator/med_diag_mod.F90 b/mediator/med_diag_mod.F90
index bb0139ccb..8c09b9ccd 100644
--- a/mediator/med_diag_mod.F90
+++ b/mediator/med_diag_mod.F90
@@ -17,8 +17,7 @@ module med_diag_mod
use NUOPC , only : NUOPC_CompAttributeGet, NUOPC_CompAttributeSet, NUOPC_CompAttributeAdd
use NUOPC_Mediator , only : NUOPC_MediatorGet
- use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS
- use ESMF , only : ESMF_FAILURE, ESMF_LOGMSG_ERROR
+ use ESMF , only : ESMF_SUCCESS
use ESMF , only : ESMF_GridComp, ESMF_Clock, ESMF_Time
use ESMF , only : ESMF_VM, ESMF_VMReduce, ESMF_REDUCE_SUM
use ESMF , only : ESMF_GridCompGet, ESMF_ClockGet, ESMF_TimeGet, ESMF_ClockGetNextTime
@@ -33,7 +32,8 @@ module med_diag_mod
use med_methods_mod , only : fldbun_fldChk => med_methods_FB_FldChk
use med_utils_mod , only : chkerr => med_utils_ChkErr
use perf_mod , only : t_startf, t_stopf
-
+ use shr_sys_mod , only : shr_sys_abort
+
implicit none
private
@@ -513,11 +513,9 @@ subroutine med_diag_zero_mode(mode, rc)
budget_counter(:,:,period_inst) = 0.0_r8
budget_counter(:,:,period_inst+1:) = 1.0_r8
else
- call ESMF_LogWrite(trim(subname)//' mode '//trim(mode)//&
+ call shr_sys_abort(trim(subname)//' mode '//trim(mode)//&
' not recognized', &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ line=__LINE__, file=u_FILE_u)
endif
end subroutine med_diag_zero_mode
diff --git a/mediator/med_fraction_mod.F90 b/mediator/med_fraction_mod.F90
index 3755b8f74..7f9cfb8ba 100644
--- a/mediator/med_fraction_mod.F90
+++ b/mediator/med_fraction_mod.F90
@@ -166,9 +166,8 @@ subroutine med_fraction_init(gcomp, rc)
! Initialize FBFrac(:) field bundles
- use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_LOGMSG_ERROR
- use ESMF , only : ESMF_SUCCESS, ESMF_FAILURE
- use ESMF , only : ESMF_LogSetError, ESMF_RC_NOT_VALID
+ use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO
+ use ESMF , only : ESMF_SUCCESS
use ESMF , only : ESMF_GridComp, ESMF_GridCompGet, ESMF_StateIsCreated
use ESMF , only : ESMF_FieldBundle, ESMF_FieldBundleIsCreated, ESMF_FieldBundleDestroy
use ESMF , only : ESMF_FieldBundleGet
diff --git a/mediator/med_io_mod.F90 b/mediator/med_io_mod.F90
index 1b89f4634..d60ce3755 100644
--- a/mediator/med_io_mod.F90
+++ b/mediator/med_io_mod.F90
@@ -7,8 +7,8 @@ module med_io_mod
use med_kind_mod , only : CX=>SHR_KIND_CX, CS=>SHR_KIND_CS, CL=>SHR_KIND_CL, I8=>SHR_KIND_I8, R8=>SHR_KIND_R8
use med_kind_mod , only : R4=>SHR_KIND_R4
use med_constants_mod , only : fillvalue => SHR_CONST_SPVAL
- use ESMF , only : ESMF_VM, ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_LogFoundError, ESMF_LOGMSG_ERROR
- use ESMF , only : ESMF_SUCCESS, ESMF_FAILURE, ESMF_END_ABORT, ESMF_LOGERR_PASSTHRU
+ use ESMF , only : ESMF_VM, ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_LogFoundError
+ use ESMF , only : ESMF_SUCCESS, ESMF_LOGERR_PASSTHRU
use ESMF , only : ESMF_VMGetCurrent, ESMF_VMGet, ESMF_VMBroadCast, ESMF_Finalize
use NUOPC , only : NUOPC_FieldDictionaryGetEntry
use NUOPC , only : NUOPC_FieldDictionaryHasEntry
@@ -19,7 +19,7 @@ module med_io_mod
use med_methods_mod , only : FB_getFldPtr => med_methods_FB_getFldPtr
use med_methods_mod , only : FB_getNameN => med_methods_FB_getNameN
use med_utils_mod , only : chkerr => med_utils_ChkErr
-
+ use shr_sys_mod , only : shr_sys_abort
implicit none
private
@@ -195,9 +195,7 @@ subroutine med_io_init(gcomp, rc)
else if (trim(cvalue) .eq. '64BIT_DATA') then
pio_ioformat = PIO_64BIT_DATA
else
- call ESMF_LogWrite(trim(subname)//': need to provide valid option for pio_ioformat (CLASSIC|64BIT_OFFSET|64BIT_DATA)', ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//': need to provide valid option for pio_ioformat (CLASSIC|64BIT_OFFSET|64BIT_DATA)')
end if
else
cvalue = '64BIT_OFFSET'
@@ -220,9 +218,7 @@ subroutine med_io_init(gcomp, rc)
else if (trim(cvalue) .eq. 'NETCDF4P') then
pio_iotype = PIO_IOTYPE_NETCDF4P
else
- call ESMF_LogWrite(trim(subname)//': need to provide valid option for pio_typename (NETCDF|PNETCDF|NETCDF4C|NETCDF4P)', ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//': need to provide valid option for pio_typename (NETCDF|PNETCDF|NETCDF4C|NETCDF4P)')
end if
else
cvalue = 'NETCDF'
@@ -331,9 +327,7 @@ subroutine med_io_init(gcomp, rc)
else if (trim(cvalue) .eq. 'SUBSET') then
pio_rearranger = PIO_REARR_SUBSET
else
- call ESMF_LogWrite(trim(subname)//': need to provide valid option for pio_rearranger (BOX|SUBSET)', ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//': need to provide valid option for pio_rearranger (BOX|SUBSET)')
end if
else
cvalue = 'SUBSET'
@@ -354,9 +348,7 @@ subroutine med_io_init(gcomp, rc)
if (isPresent .and. isSet) then
read(cvalue,*) pio_debug_level
if (pio_debug_level < 0 .or. pio_debug_level > 6) then
- call ESMF_LogWrite(trim(subname)//': need to provide valid option for pio_debug_level (0-6)', ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//': need to provide valid option for pio_debug_level (0-6)')
end if
else
pio_debug_level = 0
@@ -378,9 +370,7 @@ subroutine med_io_init(gcomp, rc)
else if (trim(cvalue) .eq. 'COLL') then
pio_rearr_comm_type = PIO_REARR_COMM_COLL
else
- call ESMF_LogWrite(trim(subname)//': need to provide valid option for pio_rearr_comm_type (P2P|COLL)', ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//': need to provide valid option for pio_rearr_comm_type (P2P|COLL)')
end if
else
cvalue = 'P2P'
@@ -403,9 +393,7 @@ subroutine med_io_init(gcomp, rc)
else if (trim(cvalue) .eq. '2DDISABLE') then
pio_rearr_comm_fcd = PIO_REARR_COMM_FC_2D_DISABLE
else
- call ESMF_LogWrite(trim(subname)//': need to provide valid option for pio_rearr_comm_fcd (2DENABLE|IO2COMP|COMP2IO|2DDISABLE)', ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//': need to provide valid option for pio_rearr_comm_fcd (2DENABLE|IO2COMP|COMP2IO|2DDISABLE)')
end if
else
cvalue = '2DENABLE'
@@ -662,15 +650,13 @@ character(len=8) function med_io_sec2hms (seconds, rc)
integer :: hours ! hours of hh:mm:ss
integer :: minutes ! minutes of hh:mm:ss
integer :: secs ! seconds of hh:mm:ss
+ character(len=CS) :: msg
!----------------------------------------------------------------------
rc = ESMF_SUCCESS
if (seconds < 0 .or. seconds > 86400) then
- write(logunit,*)'med_io_sec2hms: bad input seconds:', seconds
- call ESMF_LogWrite('med_io_sec2hms: bad input seconds', ESMF_LOGMSG_INFO)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort('med_io_sec2hms: bad input seconds')
end if
hours = seconds / 3600
@@ -678,17 +664,13 @@ character(len=8) function med_io_sec2hms (seconds, rc)
secs = (seconds - hours*3600 - minutes*60)
if (minutes < 0 .or. minutes > 60) then
- write(logunit,*)'med_io_sec2hms: bad minutes = ',minutes
- call ESMF_LogWrite('med_io_sec2hms: bad minutes', ESMF_LOGMSG_INFO)
- rc = ESMF_FAILURE
- return
+ write(msg,*)'med_io_sec2hms: bad minutes = ',minutes
+ call shr_sys_abort(msg)
end if
if (secs < 0 .or. secs > 60) then
- write(logunit,*)'med_io_sec2hms: bad secs = ',secs
- call ESMF_LogWrite('med_io_sec2hms: bad secs', ESMF_LOGMSG_INFO)
- rc = ESMF_FAILURE
- return
+ write(msg,*)'med_io_sec2hms: bad secs = ',secs
+ call shr_sys_abort(msg)
end if
write(med_io_sec2hms,80) hours, minutes, secs
@@ -705,7 +687,7 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, &
!---------------
use ESMF, only : operator(==)
- use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS, ESMF_FAILURE, ESMF_END_ABORT
+ use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS
use ESMF , only : ESMF_FieldBundleIsCreated, ESMF_FieldBundle, ESMF_Mesh, ESMF_DistGrid
use ESMF , only : ESMF_FieldBundleGet, ESMF_FieldGet, ESMF_MeshGet, ESMF_DistGridGet
use ESMF , only : ESMF_Field, ESMF_FieldGet, ESMF_AttributeGet
@@ -880,8 +862,7 @@ subroutine med_io_write_FB(io_file, FB, whead, wdata, nx, ny, nt, &
call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO)
if (lnx*lny*lntile /= ng) then
write(tmpstr,*) subname,' ERROR: grid size not consistent ',ng,lnx,lny,lntile
- call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO)
- call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ call shr_sys_abort(trim(tmpstr))
end if
else
lnx = ng
@@ -1375,7 +1356,6 @@ subroutine med_io_define_time(io_file, time_units, calendar, rc)
use ESMF, only : ESMF_CALKIND_360DAY, ESMF_CALKIND_GREGORIAN
use ESMF, only : ESMF_CALKIND_JULIAN, ESMF_CALKIND_JULIANDAY, ESMF_CALKIND_MODJULIANDAY
use ESMF, only : ESMF_CALKIND_NOCALENDAR, ESMF_CALKIND_NOLEAP
- use ESMF, only : ESMF_LOGMSG_ERROR, ESMF_FAILURE
use pio , only : var_desc_t, PIO_UNLIMITED
use pio , only : pio_double, pio_def_dim, pio_def_var, pio_put_att
use pio , only : pio_inq_varid, pio_put_var
@@ -1398,10 +1378,8 @@ subroutine med_io_define_time(io_file, time_units, calendar, rc)
rc = ESMF_SUCCESS
if (.not. ESMF_CalendarIsCreated(calendar)) then
- call ESMF_LogWrite(trim(subname)//' ERROR: calendar is not created ', &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//' ERROR: calendar is not created ', &
+ line=__LINE__, file=u_FILE_u)
end if
! define time and add calendar attribute
@@ -1480,7 +1458,6 @@ subroutine med_io_read_FB(filename, vm, FB, pre, frame, rc)
use ESMF , only : ESMF_FieldBundle, ESMF_Field, ESMF_Mesh, ESMF_DistGrid
use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS
- use ESMF , only : ESMF_LOGMSG_ERROR, ESMF_FAILURE
use ESMF , only : ESMF_FieldBundleIsCreated, ESMF_FieldBundleGet
use ESMF , only : ESMF_FieldGet, ESMF_MeshGet, ESMF_DistGridGet
use pio , only : file_desc_T, var_desc_t, io_desc_t, pio_nowrite, pio_openfile
@@ -1562,10 +1539,8 @@ subroutine med_io_read_FB(filename, vm, FB, pre, frame, rc)
call ESMF_LogWrite(trim(subname)//' open file '//trim(filename), ESMF_LOGMSG_INFO)
if (chkerr(rc,__LINE__,u_FILE_u)) return
else
- call ESMF_LogWrite(trim(subname)//' ERROR: file invalid '//trim(filename), &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//' ERROR: file invalid '//trim(filename), &
+ line=__LINE__, file=u_FILE_u)
endif
call pio_seterrorhandling(pioid, PIO_BCAST_ERROR)
@@ -1683,7 +1658,7 @@ end subroutine med_io_read_FB
!===============================================================================
subroutine med_io_read_init_iodesc(FB, name1, pioid, iodesc, rc)
- use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS, ESMF_FAILURE
+ use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS
use ESMF , only : ESMF_FieldBundleIsCreated, ESMF_FieldBundle, ESMF_Mesh, ESMF_DistGrid
use ESMF , only : ESMF_FieldBundleGet, ESMF_FieldGet, ESMF_MeshGet, ESMF_DistGridGet
use ESMF , only : ESMF_Field, ESMF_FieldGet, ESMF_AttributeGet
@@ -1758,9 +1733,7 @@ subroutine med_io_read_init_iodesc(FB, name1, pioid, iodesc, rc)
if (ng > maxval(maxIndexPTile)) then
write(tmpstr,*) subname,' WARNING: dimensions do not match', lnx, lny, maxval(maxIndexPTile)
call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_INFO)
- !TODO: this should not be an error for say CTSM which does not send a global grid
- !rc = ESMF_Failure
- !return
+ ! This should not be an error for say CTSM which does not send a global grid
endif
call ESMF_DistGridGet(distgrid, localDE=0, elementCount=ns, rc=rc)
@@ -1776,9 +1749,7 @@ subroutine med_io_read_init_iodesc(FB, name1, pioid, iodesc, rc)
deallocate(minIndexPTile, maxIndexPTile)
else
- if(maintask) write(logunit,'(a)') trim(subname)//' ERROR: '//trim(name1)//' is not present, aborting '
- call ESMF_LogWrite(trim(subname)//' ERROR: '//trim(name1)//' is not present, aborting ', ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
+ call shr_sys_abort(trim(subname)//' ERROR: '//trim(name1)//' is not present, aborting ')
end if ! end if rcode check
end subroutine med_io_read_init_iodesc
@@ -1851,10 +1822,7 @@ subroutine med_io_read_int1d(filename, vm, idata, dname, rc)
rcode = pio_get_att(pioid,pio_global,"file_version",lversion)
call pio_seterrorhandling(pioid,PIO_INTERNAL_ERROR)
else
- if(iam==0) write(logunit,*) subname,' ERROR: file invalid ',trim(filename),' ',trim(dname)
- call ESMF_LogWrite(trim(subname)//'ERROR: file invalid '//trim(filename)//' '//trim(dname), ESMF_LOGMSG_INFO)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//'ERROR: file invalid '//trim(filename)//' '//trim(dname))
endif
if (trim(lversion) == trim(version)) then
@@ -1936,10 +1904,7 @@ subroutine med_io_read_r81d(filename, vm, rdata, dname, rc)
rcode = pio_get_att(pioid,pio_global,"file_version",lversion)
call pio_seterrorhandling(pioid,PIO_INTERNAL_ERROR)
else
- if(iam==0) write(logunit,*) subname,' ERROR: file invalid ',trim(filename),' ',trim(dname)
- call ESMF_LogWrite(trim(subname)//'ERROR: file invalid '//trim(filename)//' '//trim(dname), ESMF_LOGMSG_INFO)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//'ERROR: file invalid '//trim(filename)//' '//trim(dname))
endif
if (trim(lversion) == trim(version)) then
@@ -1996,10 +1961,7 @@ subroutine med_io_read_char(filename, vm, rdata, dname, rc)
rcode = pio_get_att(pioid,pio_global,"file_version",lversion)
call pio_seterrorhandling(pioid,PIO_INTERNAL_ERROR)
else
- if(iam==0) write(logunit,*) subname,' ERROR: file invalid ',trim(filename),' ',trim(dname)
- call ESMF_LogWrite(trim(subname)//'ERROR: file invalid '//trim(filename)//' '//trim(dname), ESMF_LOGMSG_INFO)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//'ERROR: file invalid '//trim(filename)//' '//trim(dname))
endif
if (trim(lversion) == trim(version)) then
diff --git a/mediator/med_map_mod.F90 b/mediator/med_map_mod.F90
index 6282ddc3e..f75792698 100644
--- a/mediator/med_map_mod.F90
+++ b/mediator/med_map_mod.F90
@@ -2,14 +2,15 @@ module med_map_mod
use med_kind_mod , only : CX=>SHR_KIND_CX, CS=>SHR_KIND_CS, CL=>SHR_KIND_CL, R8=>SHR_KIND_R8
use med_kind_mod , only : I4=>SHR_KIND_I4
- use ESMF , only : ESMF_SUCCESS, ESMF_FAILURE
- use ESMF , only : ESMF_LOGMSG_ERROR, ESMF_LOGMSG_INFO, ESMF_LogWrite
+ use ESMF , only : ESMF_SUCCESS
+ use ESMF , only : ESMF_LOGMSG_INFO, ESMF_LogWrite
use ESMF , only : ESMF_Field
use med_internalstate_mod , only : InternalState, logunit, maintask
use med_constants_mod , only : dbug_flag => med_constants_dbug_flag
use med_utils_mod , only : chkerr => med_utils_ChkErr
use perf_mod , only : t_startf, t_stopf
-
+ use shr_sys_mod , only : shr_sys_abort
+
implicit none
private
@@ -144,10 +145,8 @@ subroutine med_map_RouteHandles_initfrom_esmflds(gcomp, flds_scalar_name, llogun
! Check number of fields in source FB on destination mesh and get destination field
if (.not. ESMF_FieldBundleIsCreated(is_local%wrap%FBImp(n1,n2))) then
- call ESMF_LogWrite(trim(subname)//'FBImp('//trim(compname(n1))//','//trim(compname(n2))//')'// &
- ' has not been created', ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//'FBImp('//trim(compname(n1))//','//trim(compname(n2))//')'// &
+ ' has not been created', line=__LINE__, file=u_FILE_u)
end if
call ESMF_FieldBundleGet(is_local%wrap%FBImp(n1,n2), fieldCount=fieldCount, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
@@ -583,13 +582,8 @@ subroutine med_map_routehandles_initfrom_field(n1, n2, fldsrc, flddst, mapindex,
if (chkerr(rc,__LINE__,u_FILE_u)) return
end if
else
- if (maintask) then
- write(logunit,'(A)') trim(subname)//' mapindex '//trim(mapname)//' not supported for '//trim(string)
- end if
- call ESMF_LogWrite(trim(subname)//' mapindex '//trim(mapname)//' not supported ', &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//' mapindex '//trim(mapname)//' not supported for '//trim(string), &
+ line=__LINE__, file=u_FILE_u)
end if
! consd_nstod method requires a second routehandle
@@ -816,8 +810,8 @@ subroutine med_map_packed_field_create(destcomp, flds_scalar_name, &
//', mapnorm '//trim(mapnorm_mapindex) &
//' set; cannot set mapnorm to '//trim(packed_data(mapindex)%mapnorm) &
//' '//trim(fieldnamelist(nf))
- call ESMF_LogWrite(trim(tmpstr), ESMF_LOGMSG_ERROR)
- call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ call shr_sys_abort(trim(tmpstr))
+
end if
end if
end if
@@ -1372,7 +1366,7 @@ subroutine med_map_field(field_src, field_dst, routehandles, maptype, fldname, z
!---------------------------------------------------
use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS
- use ESMF , only : ESMF_LOGMSG_ERROR, ESMF_FAILURE, ESMF_MAXSTR
+ use ESMF , only : ESMF_MAXSTR
use ESMF , only : ESMF_Field, ESMF_FieldRegrid
use ESMF , only : ESMF_TERMORDER_SRCSEQ, ESMF_Region_Flag
use ESMF , only : ESMF_REGION_TOTAL, ESMF_REGION_SELECT
diff --git a/mediator/med_merge_mod.F90 b/mediator/med_merge_mod.F90
index f09c9311d..9bdcb82a4 100644
--- a/mediator/med_merge_mod.F90
+++ b/mediator/med_merge_mod.F90
@@ -16,7 +16,8 @@ module med_merge_mod
use esmFlds , only : med_fldList_entry_type
use esmFlds , only : med_fldList_findName
use perf_mod , only : t_startf, t_stopf
-
+ use shr_sys_mod , only : shr_sys_abort
+
implicit none
private
@@ -45,8 +46,8 @@ subroutine med_merge_auto_multi_fldbuns(coupling_active, FBOut, FBfrac, FBImp, f
use ESMF , only : ESMF_FieldBundle, ESMF_FieldBundleIsCreated, ESMF_FieldBundleGet
use ESMF , only : ESMF_Field, ESMF_FieldGet
- use ESMF , only : ESMF_SUCCESS, ESMF_FAILURE
- use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_LOGMSG_ERROR, ESMF_LogSetError
+ use ESMF , only : ESMF_SUCCESS
+ use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_LogSetError
! ----------------------------------------------
! Auto merge based on fldListTo info
@@ -203,8 +204,8 @@ subroutine med_merge_auto_single_fldbun(compsrc, FBOut, FBfrac, FBIn, fldListTo,
use ESMF , only : ESMF_FieldBundle, ESMF_FieldBundleIsCreated, ESMF_FieldBundleGet
use ESMF , only : ESMF_Field, ESMF_FieldGet
- use ESMF , only : ESMF_SUCCESS, ESMF_FAILURE
- use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_LOGMSG_ERROR
+ use ESMF , only : ESMF_SUCCESS
+ use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO
use ESMF , only : ESMF_LogSetError
! input/output variables
integer , intent(in) :: compsrc
@@ -309,7 +310,7 @@ end subroutine med_merge_auto_single_fldbun
subroutine med_merge_auto_field(merge_type, field_out, ungriddedUBound_out, &
FB, FBfld, FBw, fldw, rc)
- use ESMF , only : ESMF_SUCCESS, ESMF_FAILURE, ESMF_LogMsg_Error
+ use ESMF , only : ESMF_SUCCESS
use ESMF , only : ESMF_FieldBundle, ESMF_FieldBundleGet
use ESMF , only : ESMF_LogWrite, ESMF_LogMsg_Info
use ESMF , only : ESMF_FieldGet, ESMF_Field
@@ -344,16 +345,12 @@ subroutine med_merge_auto_field(merge_type, field_out, ungriddedUBound_out, &
if (merge_type == 'copy_with_weights' .or. merge_type == 'merge') then
if (trim(fldw) == 'unset') then
- call ESMF_LogWrite(trim(subname)//": error required merge_fracname is not set", &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": error required merge_fracname is not set", &
+ line=__LINE__, file=u_FILE_u)
end if
if (.not. FB_FldChk(FBw, trim(fldw), rc=rc)) then
- call ESMF_LogWrite(trim(subname)//": error "//trim(fldw)//"is not in FBw", &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": error "//trim(fldw)//"is not in FBw", &
+ line=__LINE__, file=u_FILE_u)
end if
end if
@@ -418,10 +415,8 @@ subroutine med_merge_auto_field(merge_type, field_out, ungriddedUBound_out, &
dp1(:) = dp1(:) + dpf1(:)
endif
else
- call ESMF_LogWrite(trim(subname)//": merge type "//trim(merge_type)//" not supported", &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": merge type "//trim(merge_type)//" not supported", &
+ line=__LINE__, file=u_FILE_u)
end if
end subroutine med_merge_auto_field
@@ -432,8 +427,8 @@ subroutine med_merge_auto_errcheck(compsrc, fldname_out, field_out, &
use ESMF , only : ESMF_FieldBundle, ESMF_FieldBundleIsCreated, ESMF_FieldBundleGet
use ESMF , only : ESMF_Field, ESMF_FieldGet
- use ESMF , only : ESMF_SUCCESS, ESMF_FAILURE
- use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_LOGMSG_ERROR
+ use ESMF , only : ESMF_SUCCESS
+ use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO
use ESMF , only : ESMF_LogSetError, ESMF_RC_OBJ_NOT_CREATED
! input/output variables
@@ -475,10 +470,8 @@ subroutine med_merge_auto_errcheck(compsrc, fldname_out, field_out, &
call ESMF_FieldBundleGet(FBMed2, trim(merge_fldname), field=field_in, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
else
- call ESMF_LogWrite(trim(subname)//": ERROR merge_fldname = "//trim(merge_fldname)//" not found", &
- ESMF_LOGMSG_ERROR, rc=rc)
- rc = ESMF_FAILURE
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ call shr_sys_abort(trim(subname)//": ERROR merge_fldname = "//trim(merge_fldname)//" not found", &
+ rc=rc)
end if
end if
endif
@@ -492,9 +485,8 @@ subroutine med_merge_auto_errcheck(compsrc, fldname_out, field_out, &
write(errmsg,*) trim(subname),' input field ungriddedUbound ',ungriddedUbound_in(1),&
' for '//trim(merge_fldname), &
' not equal to output field ungriddedUbound ',ungriddedUbound_out,' for '//trim(fldname_out)
- call ESMF_LogWrite(errmsg, ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- return
+
+ call shr_sys_abort(errmsg)
endif
end subroutine med_merge_auto_errcheck
@@ -508,7 +500,7 @@ subroutine med_merge_field_1D(FBout, fnameout, &
FBinE, fnameE, wgtE, rc)
use ESMF , only : ESMF_FieldBundle, ESMF_LogWrite
- use ESMF , only : ESMF_SUCCESS, ESMF_FAILURE, ESMF_LOGMSG_ERROR
+ use ESMF , only : ESMF_SUCCESS
use ESMF , only : ESMF_LOGMSG_WARNING, ESMF_LOGMSG_INFO
! ----------------------------------------------
@@ -555,11 +547,8 @@ subroutine med_merge_field_1D(FBout, fnameout, &
(present(FBinC) .and. .not.present(fnameC)) .or. &
(present(FBinD) .and. .not.present(fnameD)) .or. &
(present(FBinE) .and. .not.present(fnameE))) then
-
- call ESMF_LogWrite(trim(subname)//": ERROR fname not present with FBin", &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u, rc=dbrc)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR fname not present with FBin", &
+ line=__LINE__, file=u_FILE_u, rc=dbrc)
endif
if (.not. FB_FldChk(FBout, trim(fnameout), rc=rc)) then
@@ -647,17 +636,14 @@ subroutine med_merge_field_1D(FBout, fnameout, &
if (FBinfound) then
if (lbound(dataPtr,1) /= lbound(dataOut,1) .or. ubound(dataPtr,1) /= ubound(dataOut,1)) then
- call ESMF_LogWrite(trim(subname)//": ERROR FBin wrong size", &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u, rc=dbrc)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR FBin wrong size", &
+ line=__LINE__, file=u_FILE_u, rc=dbrc)
endif
if (wgtfound) then
if (lbound(dataPtr,1) /= lbound(wgt,1) .or. ubound(dataPtr,1) /= ubound(wgt,1)) then
- call ESMF_LogWrite(trim(subname)//": ERROR wgt wrong size", &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u, rc=dbrc)
- rc = ESMF_FAILURE
- return
+
+ call shr_sys_abort(trim(subname)//": ERROR wgt wrong size", &
+ line=__LINE__, file=u_FILE_u, rc=dbrc)
endif
do i = lb1,ub1
dataOut(i) = dataOut(i) + dataPtr(i) * wgt(i)
@@ -707,7 +693,7 @@ subroutine merge_listGetName(list, k, name, rc)
! Get name of k-th field in colon deliminted list
- use ESMF, only : ESMF_SUCCESS, ESMF_FAILURE, ESMF_LogWrite, ESMF_LOGMSG_INFO
+ use ESMF, only : ESMF_SUCCESS, ESMF_LogWrite, ESMF_LOGMSG_INFO
! input/output variables
character(len=*) ,intent(in) :: list ! list/string
@@ -745,20 +731,13 @@ subroutine merge_listGetName(list, k, name, rc)
return
end if
if (.not. valid_list) then
- write(logunit,*) "ERROR: invalid list = ",trim(list)
- call ESMF_LogWrite("ERROR: invalid list = "//trim(list), ESMF_LOGMSG_INFO)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort("ERROR: invalid list = "//trim(list))
end if
!--- check that this is a valid index ---
kFlds = merge_listGetNum(list)
if (k<1 .or. kFlds fieldCount) then
- call ESMF_LogWrite(trim(subname)//": ERROR fieldnum > fieldCount ", ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR fieldnum > fieldCount ")
endif
allocate(lfieldnamelist(fieldCount))
call ESMF_FieldBundleGet(FB, fieldNameList=lfieldnamelist, rc=rc)
@@ -633,9 +606,7 @@ subroutine med_methods_State_getNameN(State, fieldnum, fieldname, rc)
call ESMF_StateGet(State, itemCount=fieldCount, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (fieldnum > fieldCount) then
- call ESMF_LogWrite(trim(subname)//": ERROR fieldnum > fieldCount ", ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR fieldnum > fieldCount ")
endif
allocate(lfieldnamelist(fieldCount))
call ESMF_StateGet(State, itemNameList=lfieldnamelist, rc=rc)
@@ -750,10 +721,8 @@ subroutine med_methods_FB_reset(FB, value, rc)
elseif (lrank == 2) then
fldptr2 = lvalue
else
- call ESMF_LogWrite(trim(subname)//": ERROR in rank "//trim(lfieldnamelist(n)), &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR in rank "//trim(lfieldnamelist(n)), &
+ line=__LINE__, file=u_FILE_u)
endif
enddo
@@ -822,10 +791,8 @@ subroutine med_methods_State_reset(State, value, rc)
elseif (lrank == 2) then
fldptr2 = lvalue
else
- call ESMF_LogWrite(trim(subname)//": ERROR in rank "//trim(lfieldnamelist(n)), &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR in rank "//trim(lfieldnamelist(n)), &
+ line=__LINE__, file=u_FILE_u)
endif
enddo
deallocate(lfieldnamelist)
@@ -901,9 +868,7 @@ subroutine med_methods_FB_average(FB, count, rc)
enddo
enddo
else
- call ESMF_LogWrite(trim(subname)//": ERROR rank not supported ", ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR rank not supported ")
endif
enddo
deallocate(lfieldnamelist)
@@ -985,9 +950,7 @@ subroutine med_methods_FB_diagnose(FB, string, rc)
endif
else
- call ESMF_LogWrite(trim(subname)//": ERROR rank not supported ", ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR rank not supported ")
endif
call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO)
enddo
@@ -1052,9 +1015,7 @@ subroutine med_methods_FB_write(FB, string, rc)
call ESMF_FieldWriteVTK(lfield, trim(lfieldnamelist(n))//'_'//trim(lstring), rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
else
- call ESMF_LogWrite(trim(subname)//": ERROR rank not supported ", ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR rank not supported ")
endif
end do
@@ -1179,9 +1140,7 @@ subroutine med_methods_State_diagnose(State, string, rc)
" no data"
endif
else
- call ESMF_LogWrite(trim(subname)//": ERROR rank not supported ", ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR rank not supported ")
endif
call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO)
@@ -1320,9 +1279,7 @@ subroutine med_methods_Field_diagnose(field, fieldname, string, rc)
write(msgString,'(A,a)') trim(subname)//' '//trim(lstring)//': '//trim(fieldname)," no data"
endif
else
- call ESMF_LogWrite(trim(subname)//": ERROR rank not supported ", ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR rank not supported ")
endif
call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO)
@@ -1427,9 +1384,7 @@ subroutine med_methods_FB_accum(FBout, FBin, copy, rc)
elseif (lranki == 1 .and. lranko == 1) then
if (.not.med_methods_FieldPtr_Compare(dataPtro1, dataPtri1, subname, rc)) then
- call ESMF_LogWrite(trim(subname)//": ERROR in dataPtr1 size ", ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR in dataPtr1 size ")
endif
if (lcopy) then
@@ -1445,9 +1400,7 @@ subroutine med_methods_FB_accum(FBout, FBin, copy, rc)
elseif (lranki == 2 .and. lranko == 2) then
if (.not.med_methods_FieldPtr_Compare(dataPtro2, dataPtri2, subname, rc)) then
- call ESMF_LogWrite(trim(subname)//": ERROR in dataPtr2 size ", ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR in dataPtr2 size ")
endif
if (lcopy) then
@@ -1465,14 +1418,8 @@ subroutine med_methods_FB_accum(FBout, FBin, copy, rc)
endif
else
-
write(msgString,'(a,2i8)') trim(subname)//": ranki, ranko = ",lranki,lranko
- call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_ERROR)
- call ESMF_LogWrite(trim(subname)//": ERROR ranki ranko not supported "//trim(lfieldnamelist(n)), &
- ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- return
-
+ call shr_sys_abort(trim(subname)//": ERROR ranki ranko not supported "//trim(msgstring)//"\n"//trim(lfieldnamelist(n)))
endif
endif
@@ -1522,9 +1469,7 @@ logical function med_methods_FB_FldChk(FB, fldname, rc)
call ESMF_FieldBundleGet(FB, fieldName=trim(fldname), isPresent=isPresent, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) then
- call ESMF_LogWrite(trim(subname)//" Error checking field: "//trim(fldname), &
- ESMF_LOGMSG_ERROR)
- return
+ call shr_sys_abort(string=trim(subname)//" Error checking field: "//trim(fldname), line=__LINE__,file=u_FILE_u)
endif
if (isPresent) then
med_methods_FB_FldChk = .true.
@@ -1571,10 +1516,8 @@ subroutine med_methods_Field_GetFldPtr(field, fldptr1, fldptr2, rank, abort, rc)
endif
if (.not.present(rc)) then
- call ESMF_LogWrite(trim(subname)//": ERROR rc not present ", &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR rc not present ", &
+ line=__LINE__, file=u_FILE_u)
endif
rc = ESMF_SUCCESS
@@ -1591,9 +1534,7 @@ subroutine med_methods_Field_GetFldPtr(field, fldptr1, fldptr2, rank, abort, rc)
if (status /= ESMF_FIELDSTATUS_COMPLETE) then
lrank = 0
if (labort) then
- call ESMF_LogWrite(trim(subname)//": ERROR data not allocated ", ESMF_LOGMSG_INFO)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR data not allocated ")
else
call ESMF_LogWrite(trim(subname)//": WARNING data not allocated ", ESMF_LOGMSG_INFO)
endif
@@ -1614,9 +1555,7 @@ subroutine med_methods_Field_GetFldPtr(field, fldptr1, fldptr2, rank, abort, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (nnodes == 0 .and. nelements == 0) lrank = 0
else
- call ESMF_LogWrite(trim(subname)//": ERROR geomtype not supported ", ESMF_LOGMSG_INFO)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR geomtype not supported ")
endif ! geomtype
if (lrank == 0) then
@@ -1625,29 +1564,23 @@ subroutine med_methods_Field_GetFldPtr(field, fldptr1, fldptr2, rank, abort, rc)
elseif (lrank == 1) then
if (.not.present(fldptr1)) then
- call ESMF_LogWrite(trim(subname)//": ERROR missing rank=1 array ", &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR missing rank=1 array ", &
+ line=__LINE__, file=u_FILE_u)
endif
call ESMF_FieldGet(field, farrayPtr=fldptr1, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
elseif (lrank == 2) then
if (.not.present(fldptr2)) then
- call ESMF_LogWrite(trim(subname)//": ERROR missing rank=2 array ", &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR missing rank=2 array ", &
+ line=__LINE__, file=u_FILE_u)
endif
call ESMF_FieldGet(field, farrayPtr=fldptr2, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
else
- call ESMF_LogWrite(trim(subname)//": ERROR in rank ", &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR in rank ", &
+ line=__LINE__, file=u_FILE_u)
endif
endif ! status
@@ -1691,19 +1624,16 @@ subroutine med_methods_FB_GetFldPtr(FB, fldname, fldptr1, fldptr2, rank, field,
endif
if (.not.present(rc)) then
- call ESMF_LogWrite(trim(subname)//": ERROR rc not present "//trim(fldname), &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR rc not present "//trim(fldname), &
+ line=__LINE__, file=u_FILE_u)
endif
rc = ESMF_SUCCESS
if (.not. med_methods_FB_FldChk(FB, trim(fldname), rc=rc)) then
- call ESMF_LogWrite(trim(subname)//": ERROR field "//trim(fldname)//" not in FB ", &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+
+ call shr_sys_abort(trim(subname)//": ERROR field "//trim(fldname)//" not in FB ", &
+ line=__LINE__, file=u_FILE_u)
endif
call ESMF_FieldBundleGet(FB, fieldName=trim(fldname), field=lfield, rc=rc)
@@ -1744,12 +1674,9 @@ logical function med_methods_FieldPtr_Compare1(fldptr1, fldptr2, cstring, rc)
med_methods_FieldPtr_Compare1 = .false.
if (lbound(fldptr2,1) /= lbound(fldptr1,1) .or. ubound(fldptr2,1) /= ubound(fldptr1,1)) then
- call ESMF_LogWrite(trim(subname)//": ERROR in data size "//trim(cstring), ESMF_LOGMSG_ERROR, rc=rc)
- if (chkerr(rc,__LINE__,u_FILE_u)) return
- write(msgString,*) trim(subname)//': fldptr1 ',lbound(fldptr1),ubound(fldptr1)
- call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO)
- write(msgString,*) trim(subname)//': fldptr2 ',lbound(fldptr2),ubound(fldptr2)
- call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO)
+ write(msgString,*) trim(subname)//': fldptr1 ',lbound(fldptr1),ubound(fldptr1),"\n",&
+ trim(subname)//': fldptr2 ',lbound(fldptr2),ubound(fldptr2),": ERROR in data size "//trim(cstring)
+ call shr_sys_abort(msgstring,rc=rc)
else
med_methods_FieldPtr_Compare1 = .true.
endif
@@ -1782,12 +1709,9 @@ logical function med_methods_FieldPtr_Compare2(fldptr1, fldptr2, cstring, rc)
med_methods_FieldPtr_Compare2 = .false.
if (lbound(fldptr2,2) /= lbound(fldptr1,2) .or. lbound(fldptr2,1) /= lbound(fldptr1,1) .or. &
ubound(fldptr2,2) /= ubound(fldptr1,2) .or. ubound(fldptr2,1) /= ubound(fldptr1,1)) then
- call ESMF_LogWrite(trim(subname)//": ERROR in data size "//trim(cstring), ESMF_LOGMSG_ERROR, rc=rc)
- if (chkerr(rc,__LINE__,u_FILE_u)) return
- write(msgString,*) trim(subname)//': fldptr2 ',lbound(fldptr2),ubound(fldptr2)
- call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO)
- write(msgString,*) trim(subname)//': fldptr1 ',lbound(fldptr1),ubound(fldptr1)
- call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO)
+ write(msgString,*) trim(subname)//': fldptr2 ',lbound(fldptr2),ubound(fldptr2),': fldptr1 ',lbound(fldptr1),ubound(fldptr1),&
+ ": ERROR in data size "//trim(cstring)
+ call shr_sys_abort(trim(msgString))
else
med_methods_FieldPtr_Compare2 = .true.
endif
@@ -1910,10 +1834,8 @@ subroutine med_methods_Field_GeomPrint(field, string, rc)
call ESMF_FieldGet(field, status=status, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (status == ESMF_FIELDSTATUS_EMPTY) then
- call ESMF_LogWrite(trim(subname)//":"//trim(string)//": ERROR field does not have a geom yet ", &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//":"//trim(string)//": ERROR field does not have a geom yet ", &
+ line=__LINE__, file=u_FILE_u)
endif
call ESMF_FieldGet(field, geomtype=geomtype, rc=rc)
@@ -1948,10 +1870,8 @@ subroutine med_methods_Field_GeomPrint(field, string, rc)
! means data allocation does not exist yet
continue
else
- call ESMF_LogWrite(trim(subname)//": ERROR rank not supported ", &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR rank not supported ", &
+ line=__LINE__, file=u_FILE_u)
endif
if (dbug_flag > 10) then
@@ -2203,8 +2123,7 @@ subroutine med_methods_Grid_Print(grid, string, rc)
staggerloc = ESMF_STAGGERLOC_CORNER
staggerstr = 'ESMF_STAGGERLOC_CORNER'
else
- rc = ESMF_FAILURE
- call ESMF_LogWrite(trim(subname)//":staggerloc failure", ESMF_LOGMSG_INFO)
+ call shr_sys_abort(trim(subname)//":staggerloc failure")
endif
call ESMF_GridGetCoord(grid, staggerloc=staggerloc, isPresent=isPresent, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
@@ -2326,7 +2245,7 @@ subroutine med_methods_State_GetScalar(state, scalar_id, scalar_value, flds_scal
! ----------------------------------------------
use ESMF , only : ESMF_SUCCESS, ESMF_State, ESMF_StateGet, ESMF_Field, ESMF_FieldGet
- use ESMF , only : ESMF_FAILURE, ESMF_LogFoundError, ESMF_LOGERR_PASSTHRU, ESMF_LogWrite
+ use ESMF , only : ESMF_LogFoundError, ESMF_LOGERR_PASSTHRU, ESMF_LogWrite
use ESMF , only : ESMF_LOGMSG_INFO, ESMF_VM, ESMF_VMBroadCast, ESMF_VMGetCurrent
use ESMF , only : ESMF_VMGet
@@ -2367,9 +2286,7 @@ subroutine med_methods_State_GetScalar(state, scalar_id, scalar_value, flds_scal
call ESMF_FieldGet(field, farrayPtr = farrayptr, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (scalar_id < 0 .or. scalar_id > flds_scalar_num) then
- call ESMF_LogWrite(trim(subname)//": ERROR in scalar_id", ESMF_LOGMSG_INFO, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=u_FILE_u)) return
+ call shr_sys_abort(trim(subname)//": ERROR in scalar_id", line=__LINE__, file=u_FILE_u)
endif
tmp(:) = farrayptr(scalar_id,:)
endif
@@ -2425,9 +2342,7 @@ subroutine med_methods_State_SetScalar(scalar_value, scalar_id, State, flds_scal
call ESMF_FieldGet(field, farrayPtr = farrayptr, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (scalar_id < 0 .or. scalar_id > flds_scalar_num) then
- call ESMF_LogWrite(trim(subname)//": ERROR in scalar_id", ESMF_LOGMSG_INFO)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//": ERROR in scalar_id")
endif
farrayptr(scalar_id,1) = scalar_value
endif
@@ -2577,7 +2492,7 @@ end subroutine med_methods_FB_getmesh
!-----------------------------------------------------------------------------
subroutine med_methods_FB_check_for_nans(FB, maintask, logunit, rc)
- use ESMF, only : ESMF_FieldBundle, ESMF_Field, ESMF_FieldBundleGet, ESMF_FieldGet
+ use ESMF, only : ESMF_FieldBundle, ESMF_Field, ESMF_FieldBundleGet, ESMF_FieldGet, ESMF_LOGMSG_ERROR
! input/output variables
type(ESMF_FieldBundle) , intent(in) :: FB
logical , intent(in) :: maintask
@@ -2626,13 +2541,12 @@ subroutine med_methods_FB_check_for_nans(FB, maintask, logunit, rc)
if (nancount > 0) then
write(nancount_char, '(i0)') nancount
msg_error = "ERROR: " // trim(nancount_char) //" nans found in "//trim(fieldname)
- call ESMF_LogWrite(trim(msg_error), ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
nanfound = .true.
+ call ESMF_LogWrite(trim(msg_error), ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
end if
end do
if (nanfound) then
- call ESMF_LogWrite('ABORTING JOB', ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
+ call shr_sys_abort('ABORTING JOB, see PET file for details', line=__LINE__, file=u_FILE_u)
end if
end subroutine med_methods_FB_check_for_nans
diff --git a/mediator/med_phases_aofluxes_mod.F90 b/mediator/med_phases_aofluxes_mod.F90
index 6cf7280e7..80fe1956f 100644
--- a/mediator/med_phases_aofluxes_mod.F90
+++ b/mediator/med_phases_aofluxes_mod.F90
@@ -22,7 +22,7 @@ module med_phases_aofluxes_mod
use ESMF , only : ESMF_TERMORDER_SRCSEQ, ESMF_REGION_TOTAL, ESMF_MESHLOC_ELEMENT, ESMF_MAXSTR
use ESMF , only : ESMF_XGRIDSIDE_B, ESMF_XGRIDSIDE_A, ESMF_END_ABORT, ESMF_LOGERR_PASSTHRU
use ESMF , only : ESMF_Mesh, ESMF_MeshGet, ESMF_XGrid, ESMF_XGridCreate, ESMF_TYPEKIND_R8
- use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS, ESMF_LOGMSG_ERROR, ESMF_FAILURE
+ use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS
use ESMF , only : ESMF_Finalize, ESMF_LogFoundError
use ESMF , only : ESMF_XGridGet, ESMF_MeshCreate, ESMF_MeshWrite, ESMF_KIND_R8
use med_kind_mod , only : CX=>SHR_KIND_CX, CS=>SHR_KIND_CS, CL=>SHR_KIND_CL, R8=>SHR_KIND_R8
@@ -39,7 +39,7 @@ module med_phases_aofluxes_mod
use shr_const_mod , only : rearth => SHR_CONST_REARTH
use shr_const_mod , only : pi => SHR_CONST_PI
#endif
-
+ use shr_sys_mod , only : shr_sys_abort
implicit none
private
@@ -667,11 +667,9 @@ subroutine med_aofluxes_init_agrid(gcomp, aoflux_in, aoflux_out, rc)
else if (med_map_RH_is_created(is_local%wrap%RH(compocn,compatm,:), mapconsd, rc=rc)) then
maptype = mapconsd
else
- call ESMF_LogWrite(trim(subname)//&
+ call shr_sys_abort(trim(subname)//&
": maptype for atm->ocn mapping of So_mask must be either mapfcopy or mapconsd", &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ line=__LINE__, file=u_FILE_u)
end if
! ------------------------
@@ -1226,11 +1224,9 @@ subroutine med_aofluxes_map_ogrid2agrid_input(gcomp, rc)
else if (med_map_RH_is_created(is_local%wrap%RH(compocn,compatm,:), mapconsd, rc=rc)) then
maptype = mapconsd
else
- call ESMF_LogWrite(trim(subname)//&
+ call shr_sys_abort(trim(subname)//&
": maptype for atm->ocn mapping of aofluxes from atm->ocn either mapfcopy or mapconsd", &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ line=__LINE__, file=u_FILE_u)
end if
! Map ocn->atm conservatively without fractions
@@ -1425,11 +1421,9 @@ subroutine med_aofluxes_map_agrid2ogrid_output(gcomp, rc)
else if (med_map_RH_is_created(is_local%wrap%RH(compatm,compocn,:), mapconsf, rc=rc)) then
maptype = mapconsf
else
- call ESMF_LogWrite(trim(subname)//&
+ call shr_sys_abort(trim(subname)//&
": maptype for atm->ocn mapping of aofluxes from atm->ocn either mapfcopy or mapconsf", &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ line=__LINE__, file=u_FILE_u)
end if
call ESMF_FieldRegrid(field_src, field_dst, &
routehandle=is_local%wrap%RH(compatm, compocn, maptype), &
diff --git a/mediator/med_phases_history_mod.F90 b/mediator/med_phases_history_mod.F90
index 6859a6c9a..daeb46458 100644
--- a/mediator/med_phases_history_mod.F90
+++ b/mediator/med_phases_history_mod.F90
@@ -12,9 +12,8 @@ module med_phases_history_mod
use ESMF , only : ESMF_TimeInterval, ESMF_TimeIntervalGet, ESMF_TimeIntervalSet
use ESMF , only : ESMF_Alarm, ESMF_AlarmIsRinging, ESMF_AlarmRingerOff, ESMF_AlarmGet
use ESMF , only : ESMF_FieldBundle, ESMF_FieldBundleGet
- use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_LOGMSG_ERROR, ESMF_LogFoundError
- use ESMF , only : ESMF_SUCCESS, ESMF_FAILURE, ESMF_MAXSTR, ESMF_LOGERR_PASSTHRU, ESMF_END_ABORT
- use ESMF , only : ESMF_Finalize
+ use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO
+ use ESMF , only : ESMF_SUCCESS, ESMF_MAXSTR, ESMF_LOGERR_PASSTHRU, ESMF_END_ABORT
use ESMF , only : operator(-), operator(+)
use NUOPC , only : NUOPC_CompAttributeGet
use NUOPC_Model , only : NUOPC_ModelGet
@@ -24,7 +23,7 @@ module med_phases_history_mod
use med_io_mod , only : med_io_write, med_io_wopen, med_io_enddef, med_io_close
use perf_mod , only : t_startf, t_stopf
use pio , only : file_desc_t
-
+ use shr_sys_mod , only : shr_sys_abort
implicit none
private
@@ -1208,12 +1207,7 @@ subroutine med_phases_history_write_comp_aux(gcomp, compid, auxcomp, rc)
call ESMF_FieldBundleGet(auxcomp%files(nfcnt)%FBAccum, fieldCount=nfld, rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (nfld == 0) then
- call ESMF_LogWrite(subname//'FBAccum is zero for '//trim(auxcomp%files(nfcnt)%auxname), &
- ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=u_FILE_u)) then
- call ESMF_Finalize(endflag=ESMF_END_ABORT)
- end if
+ call shr_sys_abort(subname//'FBAccum is zero for '//trim(auxcomp%files(nfcnt)%auxname))
end if
end if
@@ -1376,10 +1370,7 @@ subroutine get_auxflds(str, flds, rc)
valid = .false.
end if
if (.not. valid) then
- if (maintask) write(logunit,*) "ERROR: invalid list = ",trim(str)
- call ESMF_LogWrite("ERROR: invalid list = "//trim(str), ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort("ERROR: invalid list = "//trim(str))
end if
! get number of fields in a colon delimited string list
nflds = 0
@@ -1462,9 +1453,8 @@ subroutine med_phases_history_fldbun_accum(fldbun, fldbun_accum, count, rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
if (ungriddedUBound(1) /= ungriddedUBound_accum(1)) then
- call ESMF_LogWrite(" upper bounds for field and field_accum do not match", &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
+ call shr_sys_abort(" upper bounds for field and field_accum do not match", &
+ line=__LINE__, file=u_FILE_u)
end if
if (ungriddedUBound(1) > 0) then
diff --git a/mediator/med_phases_ocnalb_mod.F90 b/mediator/med_phases_ocnalb_mod.F90
index 18d709cdd..1d9426c7d 100644
--- a/mediator/med_phases_ocnalb_mod.F90
+++ b/mediator/med_phases_ocnalb_mod.F90
@@ -11,7 +11,7 @@ module med_phases_ocnalb_mod
use shr_orb_mod , only : shr_orb_cosz, shr_orb_decl
use shr_orb_mod , only : shr_orb_params, SHR_ORB_UNDEF_INT, SHR_ORB_UNDEF_REAL
use shr_log_mod , only : shr_log_unit
-
+ use shr_sys_mod , only : shr_sys_abort
implicit none
private
@@ -572,8 +572,7 @@ subroutine med_phases_ocnalb_orbital_init(gcomp, logunit, maintask, rc)
write(logunit,*) trim(subname),' ERROR: invalid settings orb_mode =',trim(orb_mode)
write(logunit,*) trim(subname),' ERROR: fixed_year settings = ',orb_iyear
write (msgstr, *) ' ERROR: invalid settings for orb_mode '//trim(orb_mode)
- call ESMF_LogSetError(ESMF_RC_NOT_VALID, msg=msgstr, line=__LINE__, file=__FILE__, rcToReturn=rc)
- return ! bail out
+ call shr_sys_abort(msgstr, line=__LINE__, file=__FILE__)
endif
elseif (trim(orb_mode) == trim(orb_variable_year)) then
orb_obliq = SHR_ORB_UNDEF_REAL
@@ -583,8 +582,7 @@ subroutine med_phases_ocnalb_orbital_init(gcomp, logunit, maintask, rc)
write(logunit,*) trim(subname),' ERROR: invalid settings orb_mode =',trim(orb_mode)
write(logunit,*) trim(subname),' ERROR: variable_year settings = ',orb_iyear, orb_iyear_align
write (msgstr, *) subname//' ERROR: invalid settings for orb_mode '//trim(orb_mode)
- call ESMF_LogSetError(ESMF_RC_NOT_VALID, msg=msgstr, line=__LINE__, file=__FILE__, rcToReturn=rc)
- return ! bail out
+ call shr_sys_abort(msgstr, line=__LINE__, file=__FILE__, rc=rc)
endif
elseif (trim(orb_mode) == trim(orb_fixed_parameters)) then
!-- force orb_iyear to undef to make sure shr_orb_params works properly
@@ -598,14 +596,11 @@ subroutine med_phases_ocnalb_orbital_init(gcomp, logunit, maintask, rc)
write(logunit,*) trim(subname),' ERROR: orb_obliq = ',orb_obliq
write(logunit,*) trim(subname),' ERROR: orb_mvelp = ',orb_mvelp
write (msgstr, *) subname//' ERROR: invalid settings for orb_mode '//trim(orb_mode)
- call ESMF_LogSetError(ESMF_RC_NOT_VALID, msg=msgstr, line=__LINE__, file=__FILE__, rcToReturn=rc)
- return ! bail out
+ call shr_sys_abort(msgstr, line=__LINE__, file=__FILE__, rc=rc)
endif
else
write (msgstr, *) subname//' ERROR: invalid orb_mode '//trim(orb_mode)
- call ESMF_LogSetError(ESMF_RC_NOT_VALID, msg=msgstr, line=__LINE__, file=__FILE__, rcToReturn=rc)
- rc = ESMF_FAILURE
- return ! bail out
+ call shr_sys_abort(msgstr, line=__LINE__, file=__FILE__, rc=rc)
endif
end subroutine med_phases_ocnalb_orbital_init
@@ -665,8 +660,7 @@ subroutine med_phases_ocnalb_orbital_update(clock, logunit, maintask, eccen, ob
if ( eccen == SHR_ORB_UNDEF_REAL .or. obliqr == SHR_ORB_UNDEF_REAL .or. &
mvelpp == SHR_ORB_UNDEF_REAL .or. lambm0 == SHR_ORB_UNDEF_REAL) then
write (msgstr, *) subname//' ERROR: orb params incorrect'
- call ESMF_LogSetError(ESMF_RC_NOT_VALID, msg=msgstr, line=__LINE__, file=__FILE__, rcToReturn=rc)
- return ! bail out
+ call shr_sys_abort(msgstr, line=__LINE__, file=__FILE__, rc=rc)
endif
end subroutine med_phases_ocnalb_orbital_update
diff --git a/mediator/med_phases_post_glc_mod.F90 b/mediator/med_phases_post_glc_mod.F90
index 959f2873b..15e4577d3 100644
--- a/mediator/med_phases_post_glc_mod.F90
+++ b/mediator/med_phases_post_glc_mod.F90
@@ -7,7 +7,7 @@ module med_phases_post_glc_mod
use med_kind_mod , only : CX=>SHR_KIND_CX, CS=>SHR_KIND_CS, CL=>SHR_KIND_CL, R8=>SHR_KIND_R8
use NUOPC , only : NUOPC_CompAttributeGet
- use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_LOGMSG_ERROR, ESMF_SUCCESS, ESMF_FAILURE
+ use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS
use ESMF , only : ESMF_FieldBundle, ESMF_FieldBundleGet
use ESMF , only : ESMF_GridComp, ESMF_GridCompGet
use ESMF , only : ESMF_StateGet, ESMF_StateItem_Flag
@@ -30,7 +30,7 @@ module med_phases_post_glc_mod
use med_map_mod , only : med_map_field_packed, med_map_field_normalized, med_map_field
use glc_elevclass_mod , only : glc_mean_elevation_virtual, glc_get_fractional_icecov
use perf_mod , only : t_startf, t_stopf
-
+ use shr_sys_mod , only : shr_sys_abort
implicit none
private
@@ -333,10 +333,8 @@ subroutine map_glc2lnd_init(gcomp, rc)
! Currently cannot map hflx in multiple elevation classes from glc to land
if (fldbun_fldchk(is_local%wrap%FBExp(complnd), trim(Flgg_hflx), rc=rc)) then
- call ESMF_LogWrite(trim(subname)//'ERROR: Flgg_hflx to land has not been implemented yet', &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=__FILE__)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//'ERROR: Flgg_hflx to land has not been implemented yet', &
+ line=__LINE__, file=__FILE__)
end if
end subroutine map_glc2lnd_init
diff --git a/mediator/med_phases_post_rof_mod.F90 b/mediator/med_phases_post_rof_mod.F90
index 036eeca30..afcaa27fb 100644
--- a/mediator/med_phases_post_rof_mod.F90
+++ b/mediator/med_phases_post_rof_mod.F90
@@ -5,7 +5,7 @@ module med_phases_post_rof_mod
use NUOPC_Mediator , only : NUOPC_MediatorGet
use NUOPC , only : NUOPC_CompAttributeGet
use ESMF , only : ESMF_Clock, ESMF_ClockIsCreated
- use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_LOGMSG_ERROR, ESMF_SUCCESS, ESMF_FAILURE
+ use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS
use ESMF , only : ESMF_GridComp, ESMF_GridCompGet
use ESMF , only : ESMF_Mesh, ESMF_MESHLOC_ELEMENT, ESMF_TYPEKIND_R8
use ESMF , only : ESMF_Field, ESMF_FieldCreate
diff --git a/mediator/med_phases_prep_glc_mod.F90 b/mediator/med_phases_prep_glc_mod.F90
index 4eff5966f..00a246f1b 100644
--- a/mediator/med_phases_prep_glc_mod.F90
+++ b/mediator/med_phases_prep_glc_mod.F90
@@ -7,7 +7,7 @@ module med_phases_prep_glc_mod
use med_kind_mod , only : CX=>SHR_KIND_CX, CS=>SHR_KIND_CS, CL=>SHR_KIND_CL, R8=>SHR_KIND_R8
use NUOPC , only : NUOPC_CompAttributeGet
use NUOPC_Model , only : NUOPC_ModelGet
- use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_LOGMSG_ERROR, ESMF_SUCCESS, ESMF_FAILURE
+ use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS, ESMF_FAILURE
use ESMF , only : ESMF_VM, ESMF_VMGet, ESMF_VMAllReduce, ESMF_REDUCE_SUM, ESMF_REDUCE_MAX
use ESMF , only : ESMF_Clock, ESMF_ClockCreate, ESMF_ClockIsCreated
use ESMF , only : ESMF_ClockGetAlarm, ESMF_ClockAdvance, ESMF_ClockGet
@@ -44,7 +44,8 @@ module med_phases_prep_glc_mod
use glc_elevclass_mod , only : glc_get_elevation_classes
use glc_elevclass_mod , only : glc_get_fractional_icecov
use perf_mod , only : t_startf, t_stopf
-
+ use shr_sys_mod , only : shr_sys_abort
+
implicit none
private
@@ -222,10 +223,8 @@ subroutine med_phases_prep_glc_init(gcomp, rc)
! create route handle if it has not been created
if (.not. med_map_RH_is_created(is_local%wrap%RH(complnd,compglc(ns),:),mapbilnr,rc=rc)) then
- call ESMF_LogWrite(trim(subname)//" mapbilnr is not created for lnd->glc mapping", &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//" mapbilnr is not created for lnd->glc mapping", &
+ line=__LINE__, file=u_FILE_u)
end if
end do
@@ -239,11 +238,8 @@ subroutine med_phases_prep_glc_init(gcomp, rc)
case ('off')
smb_renormalize = .false.
case default
- write(logunit,*) subname,' ERROR: unknown value for glc_renormalize_smb: ', trim(glc_renormalize_smb)
- call ESMF_LogWrite(trim(subname)//' ERROR: unknown value for glc_renormalize_smb: '// trim(glc_renormalize_smb), &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=__FILE__)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//' ERROR: unknown value for glc_renormalize_smb: '// trim(glc_renormalize_smb), &
+ line=__LINE__, file=__FILE__)
end select
if (maintask) then
write(logunit,'(a,l4)') trim(subname)//' smb_renormalize is ',smb_renormalize
@@ -331,10 +327,8 @@ subroutine med_phases_prep_glc_init(gcomp, rc)
! create route handle if it has not been created
do ns = 1,is_local%wrap%num_icesheets
if (.not. med_map_RH_is_created(is_local%wrap%RH(compocn,compglc(ns),:),mapbilnr,rc=rc)) then
- call ESMF_LogWrite(trim(subname)//" mapbilnr is not created for ocn->glc mapping", &
- ESMF_LOGMSG_ERROR, line=__LINE__, file=u_FILE_u)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//" mapbilnr is not created for ocn->glc mapping", &
+ line=__LINE__, file=u_FILE_u)
end if
end do
diff --git a/mediator/med_phases_prep_ice_mod.F90 b/mediator/med_phases_prep_ice_mod.F90
index 524313622..4aaa8c264 100644
--- a/mediator/med_phases_prep_ice_mod.F90
+++ b/mediator/med_phases_prep_ice_mod.F90
@@ -27,7 +27,6 @@ subroutine med_phases_prep_ice(gcomp, rc)
use ESMF , only : ESMF_GridComp, ESMF_GridCompGet, ESMF_StateGet
use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS
use ESMF , only : ESMF_FieldBundleGet, ESMF_FieldGet, ESMF_Field
- use ESMF , only : ESMF_LOGMSG_ERROR, ESMF_FAILURE
use ESMF , only : ESMF_StateItem_Flag, ESMF_STATEITEM_NOTFOUND
use ESMF , only : ESMF_VMBroadCast
use med_utils_mod , only : chkerr => med_utils_ChkErr
diff --git a/mediator/med_phases_prep_lnd_mod.F90 b/mediator/med_phases_prep_lnd_mod.F90
index 4be8bb402..a8c298042 100644
--- a/mediator/med_phases_prep_lnd_mod.F90
+++ b/mediator/med_phases_prep_lnd_mod.F90
@@ -23,7 +23,7 @@ subroutine med_phases_prep_lnd(gcomp, rc)
use NUOPC , only : NUOPC_CompAttributeGet
use ESMF , only : operator(/=), operator(==)
- use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_LOGMSG_ERROR, ESMF_SUCCESS, ESMF_FAILURE
+ use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS
use ESMF , only : ESMF_FieldBundle, ESMF_FieldBundleGet, ESMF_Field, ESMF_FieldGet
use ESMF , only : ESMF_GridComp, ESMF_GridCompGet
use ESMF , only : ESMF_StateGet, ESMF_StateItem_Flag, ESMF_STATEITEM_NOTFOUND
diff --git a/mediator/med_phases_prep_ocn_mod.F90 b/mediator/med_phases_prep_ocn_mod.F90
index 246ec5866..e30c4ada5 100644
--- a/mediator/med_phases_prep_ocn_mod.F90
+++ b/mediator/med_phases_prep_ocn_mod.F90
@@ -78,7 +78,6 @@ subroutine med_phases_prep_ocn_accum(gcomp, rc)
use ESMF , only : ESMF_GridComp, ESMF_FieldBundleGet
use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS
- use ESMF , only : ESMF_FAILURE, ESMF_LOGMSG_ERROR
use med_constants_mod , only : shr_const_cpsw, shr_const_tkfrz, shr_const_pi
use med_phases_prep_atm_mod , only : med_phases_prep_atm_enthalpy_correction
@@ -354,7 +353,6 @@ subroutine med_phases_prep_ocn_custom(gcomp, rc)
use ESMF , only : ESMF_GridComp, ESMF_StateGet, ESMF_Field, ESMF_FieldGet
use ESMF , only : ESMF_VMBroadCast
use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS
- use ESMF , only : ESMF_FAILURE, ESMF_LOGMSG_ERROR
! input/output variables
type(ESMF_GridComp) :: gcomp
diff --git a/mediator/med_phases_prep_rof_mod.F90 b/mediator/med_phases_prep_rof_mod.F90
index f0ec87c37..591966e4b 100644
--- a/mediator/med_phases_prep_rof_mod.F90
+++ b/mediator/med_phases_prep_rof_mod.F90
@@ -26,7 +26,8 @@ module med_phases_prep_rof_mod
use med_methods_mod , only : fldbun_fldchk => med_methods_FB_fldchk
use med_methods_mod , only : FB_check_for_nans => med_methods_FB_check_for_nans
use perf_mod , only : t_startf, t_stopf
-
+ use shr_sys_mod , only : shr_sys_abort
+
implicit none
private
@@ -471,7 +472,7 @@ subroutine med_phases_prep_rof_irrig(gcomp, rc)
use ESMF , only : ESMF_FieldBundle, ESMF_FieldBundleGet, ESMF_FieldIsCreated
use ESMF , only : ESMF_Mesh, ESMF_TYPEKIND_R8, ESMF_MESHLOC_ELEMENT
use ESMF , only : ESMF_SUCCESS, ESMF_FAILURE
- use ESMF , only : ESMF_LOGMSG_INFO, ESMF_LogWrite, ESMF_LOGMSG_ERROR
+ use ESMF , only : ESMF_LOGMSG_INFO, ESMF_LogWrite
use med_map_mod , only : med_map_rh_is_created, med_map_field, med_map_field_normalized
! input/output variables
@@ -516,11 +517,8 @@ subroutine med_phases_prep_rof_irrig(gcomp, rc)
else if ( med_map_RH_is_created(is_local%wrap%RH(complnd,comprof,:),mapfcopy, rc=rc)) then
maptype_lnd2rof = mapfcopy
else
- call ESMF_LogWrite(trim(subname)//&
- ": ERROR conservative or redist route handles not created for lnd->rof mapping", &
- ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//&
+ ": ERROR conservative or redist route handles not created for lnd->rof mapping")
end if
if (med_map_RH_is_created(is_local%wrap%RH(comprof,complnd,:),mapconsf, rc=rc)) then
@@ -528,11 +526,8 @@ subroutine med_phases_prep_rof_irrig(gcomp, rc)
else if ( med_map_RH_is_created(is_local%wrap%RH(comprof,complnd,:),mapfcopy, rc=rc)) then
maptype_rof2lnd = mapfcopy
else
- call ESMF_LogWrite(trim(subname)//&
- ": ERROR conservative or redist route handles not created for rof->lnd mapping", &
- ESMF_LOGMSG_ERROR)
- rc = ESMF_FAILURE
- return
+ call shr_sys_abort(trim(subname)//&
+ ": ERROR conservative or redist route handles not created for rof->lnd mapping")
end if
! ------------------------------------------------------------------------
diff --git a/mediator/med_phases_prep_wav_mod.F90 b/mediator/med_phases_prep_wav_mod.F90
index 93755d59c..1cfd158be 100644
--- a/mediator/med_phases_prep_wav_mod.F90
+++ b/mediator/med_phases_prep_wav_mod.F90
@@ -74,7 +74,6 @@ subroutine med_phases_prep_wav_accum(gcomp, rc)
use ESMF , only : ESMF_GridComp, ESMF_FieldBundleGet
use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS
- use ESMF , only : ESMF_FAILURE, ESMF_LOGMSG_ERROR
! input/output variables
type(ESMF_GridComp) :: gcomp
diff --git a/mediator/med_phases_restart_mod.F90 b/mediator/med_phases_restart_mod.F90
index 601ee7424..e37c6d4d7 100644
--- a/mediator/med_phases_restart_mod.F90
+++ b/mediator/med_phases_restart_mod.F90
@@ -14,6 +14,7 @@ module med_phases_restart_mod
use med_phases_prep_glc_mod , only : FBocnAccum2glc_o, ocnAccum2glc_cnt
use med_phases_prep_rof_mod , only : FBlndAccum2rof_l, lndAccum2rof_cnt
use pio , only : file_desc_t
+ use shr_sys_mod , only : shr_sys_abort
implicit none
private
@@ -42,8 +43,8 @@ subroutine med_phases_restart_alarm_init(gcomp, rc)
use ESMF , only : ESMF_Clock, ESMF_ClockGet, ESMF_ClockAdvance, ESMF_ClockSet
use ESMF , only : ESMF_Time, ESMF_TimeInterval, ESMF_TimeIntervalGet
use ESMF , only : ESMF_Alarm, ESMF_AlarmSet
- use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_LOGMSG_ERROR
- use ESMF , only : ESMF_SUCCESS, ESMF_FAILURE
+ use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO
+ use ESMF , only : ESMF_SUCCESS
use NUOPC , only : NUOPC_CompAttributeGet
use NUOPC_Model , only : NUOPC_ModelGet
use nuopc_shr_methods, only : AlarmInit
@@ -125,8 +126,8 @@ subroutine med_phases_restart_write(gcomp, rc)
use ESMF , only : ESMF_GridComp, ESMF_VM, ESMF_Clock, ESMF_Time, ESMF_Alarm
use ESMF , only : ESMF_TimeInterval, ESMF_CalKind_Flag, ESMF_MAXSTR
- use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS, ESMF_FAILURE
- use ESMF , only : ESMF_LOGMSG_ERROR, operator(==), operator(-)
+ use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS
+ use ESMF , only : operator(==), operator(-)
use ESMF , only : ESMF_GridCompGet, ESMF_ClockGet, ESMF_ClockGetNextTime
use ESMF , only : ESMF_TimeGet, ESMF_ClockGetAlarm, ESMF_ClockPrint, ESMF_TimeIntervalGet
use ESMF , only : ESMF_AlarmIsRinging, ESMF_AlarmRingerOff, ESMF_FieldBundleIsCreated
@@ -481,8 +482,8 @@ subroutine med_phases_restart_read(gcomp, rc)
! Read mediator restart
use ESMF , only : ESMF_GridComp, ESMF_VM, ESMF_Clock, ESMF_Time, ESMF_MAXSTR
- use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS, ESMF_FAILURE
- use ESMF , only : ESMF_LOGMSG_ERROR, ESMF_VMBroadCast
+ use ESMF , only : ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_SUCCESS
+ use ESMF , only : ESMF_VMBroadCast
use ESMF , only : ESMF_GridCompGet, ESMF_ClockGet, ESMF_ClockPrint
use ESMF , only : ESMF_FieldBundleIsCreated, ESMF_TimeGet
use NUOPC , only : NUOPC_CompAttributeGet
@@ -546,9 +547,7 @@ subroutine med_phases_restart_read(gcomp, rc)
open(newunit=unitn, file=restart_pfile, form='FORMATTED', status='old', iostat=ierr)
read (unitn,'(a)', iostat=ierr) restart_file
if (ierr < 0) then
- call ESMF_LogWrite(trim(subname)//' rpointer file read returns error', ESMF_LOGMSG_INFO)
- rc=ESMF_Failure
- return
+ call shr_sys_abort(trim(subname)//' rpointer file read returns error')
end if
close(unitn)
call ESMF_LogWrite(trim(subname)//' restart file from rpointer = '//trim(restart_file), ESMF_LOGMSG_INFO)