From 4070e0a8c1a7b70968b9672ce44b53eea47f982d Mon Sep 17 00:00:00 2001 From: Mariana Vertenstein Date: Sun, 5 May 2024 11:07:31 -0600 Subject: [PATCH] fix for CTSM issue Issue #2518 --- streams/dshr_strdata_mod.F90 | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/streams/dshr_strdata_mod.F90 b/streams/dshr_strdata_mod.F90 index e9159f69b..877b781ff 100644 --- a/streams/dshr_strdata_mod.F90 +++ b/streams/dshr_strdata_mod.F90 @@ -1933,6 +1933,7 @@ subroutine shr_strdata_set_stream_iodesc(sdat, per_stream, fldname, pioid, rc) character(*), parameter :: F00 = "('(shr_strdata_set_stream_iodesc) ',a,i8,2x,i8,2x,a)" character(*), parameter :: F01 = "('(shr_strdata_set_stream_iodesc) ',a,i8,2x,i8,2x,a)" character(*), parameter :: F02 = "('(shr_strdata_set_stream_iodesc) ',a,i8,2x,i8,2x,i8,2x,a)" + character(*), parameter :: F03 = "('(shr_strdata_set_stream_iodesc) ',a,i8,2x,a)" !------------------------------------------------------------------------------- rc = ESMF_SUCCESS @@ -1982,13 +1983,23 @@ subroutine shr_strdata_set_stream_iodesc(sdat, per_stream, fldname, pioid, rc) ! determine io descriptor if (ndims == 2) then - if (sdat%mainproc) then - write(sdat%stream(1)%logunit,F00) 'setting iodesc for : '//trim(fldname)// & - ' with dimlens(1), dimlens2 = ',dimlens(1),dimlens(2),& - ' variable has no time dimension ' + rcode = pio_inq_dimname(pioid, dimids(ndims), dimname) + if (trim(dimname) == 'time' .or. trim(dimname) == 'nt') then + if (sdat%mainproc) then + write(sdat%stream(1)%logunit,F03) 'setting iodesc for : '//trim(fldname)// & + ' with dimlens(1) = ',dimlens(1),' and the variable has a time dimension ' + end if + call pio_initdecomp(sdat%pio_subsystem, pio_iovartype, (/dimlens(1)/), compdof, & + per_stream%stream_pio_iodesc) + else + if (sdat%mainproc) then + write(sdat%stream(1)%logunit,F00) 'setting iodesc for : '//trim(fldname)// & + ' with dimlens(1), dimlens(2) = ',dimlens(1),dimlens(2),& + ' variable has no time dimension ' + end if + call pio_initdecomp(sdat%pio_subsystem, pio_iovartype, (/dimlens(1),dimlens(2)/), compdof, & + per_stream%stream_pio_iodesc) end if - call pio_initdecomp(sdat%pio_subsystem, pio_iovartype, (/dimlens(1),dimlens(2)/), compdof, & - per_stream%stream_pio_iodesc) else if (ndims == 3) then rcode = pio_inq_dimname(pioid, dimids(ndims), dimname)