Skip to content

Commit

Permalink
Merge pull request #278 from mvertens/feature/fix_mpas_input
Browse files Browse the repository at this point in the history
allow input of stream on unstructured mesh (e.g. mpas)
  • Loading branch information
jedwards4b authored Jun 26, 2024
2 parents 9b73292 + badd638 commit 01f4761
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions streams/dshr_strdata_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,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
Expand Down Expand Up @@ -2003,13 +2004,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)
Expand Down

0 comments on commit 01f4761

Please sign in to comment.