Skip to content

Commit 75d3436

Browse files
committed
Check for and add missing error code handling for PIO calls
1 parent 394446b commit 75d3436

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/dynamics/se/dyn_comp.F90

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,6 +1995,9 @@ subroutine set_phis(dyn_in)
19951995
call endrun(subname//': dimension ncol not found in bnd_topo file')
19961996
end if
19971997
ierr = pio_inq_dimlen(fh_topo, ncol_did, ncol_size)
1998+
if (ierr /= PIO_NOERR) then
1999+
call endrun(subname//': dimension ncol does not have a value in bnd_topo file')
2000+
end if
19982001
if (ncol_size /= dyn_cols) then
19992002
if (masterproc) then
20002003
write(iulog,*) subname//': ncol_size=', ncol_size, ' : dyn_cols=', dyn_cols

src/utils/cam_pio_utils.F90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,7 @@ subroutine cam_pio_get_var_2d_r8(varname, File, field, start, kount, found)
940940
strt = 1 ! cnt set by cam_pio_var_info
941941
exists = use_scam_limits(File, strt, cnt,filedims)
942942
end if
943+
! Internal PIO error handling is in effect, so need to check return codes
943944
if (ndims == 3) then
944945
ierr = pio_inq_dimname(File, dimids(3), tmpname)
945946
if (trim(tmpname) /= 'time') then

0 commit comments

Comments
 (0)