Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow input of stream on unstructured mesh (e.g. mpas) #278

Merged
merged 3 commits into from
Jun 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading