Skip to content

Commit 3000f0c

Browse files
committed
Fix bug in four shr_sys_abort calls
1 parent db187f7 commit 3000f0c

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

streams/dshr_methods_mod.F90

+5-8
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module dshr_methods_mod
1414
use ESMF , only : ESMF_TraceRegionEnter, ESMF_TraceRegionExit
1515
use shr_kind_mod , only : r8=>shr_kind_r8, cs=>shr_kind_cs, cl=>shr_kind_cl
1616
use shr_sys_mod , only : shr_sys_abort
17+
use shr_log_mod , only : errMsg => shr_log_errMsg
1718

1819
implicit none
1920
public
@@ -184,16 +185,14 @@ subroutine dshr_fldbun_GetFldPtr(FB, fldname, fldptr1, fldptr2, rank, field, rc)
184185
if (chkerr(rc,__LINE__,u_FILE_u)) return
185186
if (ungriddedUBound(1) > 0) then
186187
if (.not.present(fldptr2)) then
187-
call shr_sys_abort(trim(subname)//": ERROR missing rank=2 array ", &
188-
line=__LINE__, file=u_FILE_u)
188+
call shr_sys_abort(trim(subname)//": ERROR missing rank=2 array "//errMsg(u_FILE_u, __LINE__))
189189
endif
190190
call ESMF_FieldGet(lfield, farrayptr=fldptr2, rc=rc)
191191
if (chkerr(rc,__LINE__,u_FILE_u)) return
192192
lrank = 2
193193
else
194194
if (.not.present(fldptr1)) then
195-
call shr_sys_abort(trim(subname)//": ERROR missing rank=1 array ", &
196-
line=__LINE__, file=u_FILE_u)
195+
call shr_sys_abort(trim(subname)//": ERROR missing rank=1 array "//errMsg(u_FILE_u, __LINE__))
197196
endif
198197
call ESMF_FieldGet(lfield, farrayptr=fldptr1, rc=rc)
199198
if (chkerr(rc,__LINE__,u_FILE_u)) return
@@ -551,8 +550,7 @@ subroutine dshr_field_getfldptr(field, fldptr1, fldptr2, rank, abort, rc)
551550
if (chkerr(rc,__LINE__,u_FILE_u)) return
552551
if (ungriddedUBound(1) > 0) then
553552
if (.not.present(fldptr2)) then
554-
call shr_sys_abort(trim(subname)//": ERROR missing rank=2 array for "//trim(name), &
555-
line=__LINE__, file=u_FILE_u)
553+
call shr_sys_abort(trim(subname)//": ERROR missing rank=2 array for "//trim(name)//errMsg(u_FILE_u, __LINE__))
556554
rc = ESMF_FAILURE
557555
return
558556
endif
@@ -561,8 +559,7 @@ subroutine dshr_field_getfldptr(field, fldptr1, fldptr2, rank, abort, rc)
561559
lrank = 2
562560
else
563561
if (.not.present(fldptr1)) then
564-
call shr_sys_abort(trim(subname)//": ERROR missing rank=1 array for "//trim(name), &
565-
line=__LINE__, file=u_FILE_u)
562+
call shr_sys_abort(trim(subname)//": ERROR missing rank=1 array for "//trim(name)//errMsg(u_FILE_u, __LINE__))
566563
rc = ESMF_FAILURE
567564
return
568565
endif

0 commit comments

Comments
 (0)