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

added new stream name to inline initialization #100

Merged
merged 3 commits into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion .github/workflows/extbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ jobs:
path: ~/ESMF
key: ${{ runner.os }}-${{ env.ESMF_VERSION }}-ESMF
- id: load-env
run: sudo apt-get install gfortran wget openmpi-bin netcdf-bin libopenmpi-dev libnetcdf-dev
run: |
sudo apt-get update
sudo apt-get install gfortran wget openmpi-bin netcdf-bin libopenmpi-dev libnetcdf-dev
- id: build-ESMF
if: steps.cache-esmf.outputs.cache-hit != 'true'
run: |
Expand Down
16 changes: 11 additions & 5 deletions streams/dshr_strdata_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ subroutine shr_strdata_init_from_config(sdat, streamfilename, model_mesh, clock,
if (ChkErr(rc,__LINE__,u_FILE_u)) return

! Now finish initializing sdat
call shr_strdata_init(sdat, clock, rc)
call shr_strdata_init(sdat, clock, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

end subroutine shr_strdata_init_from_config
Expand All @@ -244,7 +244,7 @@ subroutine shr_strdata_init_from_inline(sdat, my_task, logunit, compname, &
stream_meshfile, stream_lev_dimname, stream_mapalgo, &
stream_filenames, stream_fldlistFile, stream_fldListModel, &
stream_yearFirst, stream_yearLast, stream_yearAlign, &
stream_offset, stream_taxmode, stream_dtlimit, stream_tintalgo, rc)
stream_offset, stream_taxmode, stream_dtlimit, stream_tintalgo, stream_name, rc)

! input/output variables
type(shr_strdata_type) , intent(inout) :: sdat ! stream data type
Expand All @@ -266,6 +266,7 @@ subroutine shr_strdata_init_from_inline(sdat, my_task, logunit, compname, &
character(*) , intent(in) :: stream_taxMode ! time axis mode
real(r8) , intent(in) :: stream_dtlimit ! ratio of max/min stream delta times
character(*) , intent(in) :: stream_tintalgo ! time interpolation algorithm
character(*), optional , intent(in) :: stream_name ! name of stream
integer , intent(out) :: rc ! error code
! ----------------------------------------------

Expand Down Expand Up @@ -300,7 +301,7 @@ subroutine shr_strdata_init_from_inline(sdat, my_task, logunit, compname, &
logunit, trim(compname))

! Now finish initializing sdat
call shr_strdata_init(sdat, model_clock, rc)
call shr_strdata_init(sdat, model_clock, stream_name, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

end subroutine shr_strdata_init_from_inline
Expand Down Expand Up @@ -369,11 +370,12 @@ subroutine shr_strdata_init_model_domain( sdat, rc)
end subroutine shr_strdata_init_model_domain

!===============================================================================
subroutine shr_strdata_init(sdat, model_clock, rc)
subroutine shr_strdata_init(sdat, model_clock, stream_name, rc)

! input/output variables
type(shr_strdata_type) , intent(inout), target :: sdat
type(ESMF_Clock) , intent(in) :: model_clock
character(*), optional , intent(in) :: stream_name
integer , intent(out) :: rc

! local variables
Expand Down Expand Up @@ -608,7 +610,11 @@ subroutine shr_strdata_init(sdat, model_clock, rc)

! print sdat output
if (masterproc) then
call shr_strdata_print(sdat,'sdat data ')
if (present(stream_name)) then
call shr_strdata_print(sdat, trim(stream_name))
else
call shr_strdata_print(sdat, 'stream_data')
end if
write(sdat%logunit,*) ' successfully initialized sdat'
endif
end subroutine shr_strdata_init
Expand Down
8 changes: 4 additions & 4 deletions streams/dshr_stream_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ subroutine shr_stream_readTCoord(strm, k, isroot_task, rc)
integer :: old_handle ! previous setting of pio error handling
real(R8) :: nsec ! elapsed secs on calendar date
real(R8),allocatable :: tvar(:)
character(*),parameter :: subname = ' (shr_stream_readTCoord) '
character(*),parameter :: subname = '(shr_stream_readTCoord) '
!-------------------------------------------------------------------------------

lrc = 0
Expand All @@ -1159,7 +1159,7 @@ subroutine shr_stream_readTCoord(strm, k, isroot_task, rc)

! open file if needed
if (.not. pio_file_is_open(strm%file(k)%fileid)) then
if (isroot_task) then
if (debug > 0 .and. isroot_task) then
write(strm%logunit, '(a)') trim(subname)//' opening stream filename = '//trim(filename)
end if
rcode = pio_openfile(strm%pio_subsystem, strm%file(k)%fileid, strm%pio_iotype, filename, pio_nowrite)
Expand Down Expand Up @@ -1220,7 +1220,7 @@ subroutine shr_stream_readTCoord(strm, k, isroot_task, rc)
deallocate(tvar)

! close file
if (isroot_task) then
if (debug > 0 .and. isroot_task) then
write(strm%logunit, '(a)') trim(subname)//' closing stream filename = '//trim(filename)
end if
call pio_closefile(strm%file(k)%fileid)
Expand Down Expand Up @@ -1424,7 +1424,7 @@ subroutine shr_stream_getCalendar(strm, k, calendar)
character(CL) :: fileName,lcal
integer :: old_handle
integer :: rCode
character(*),parameter :: subName = ' (shr_stream_getCalendar) '
character(*),parameter :: subName = '(shr_stream_getCalendar) '
!-------------------------------------------------------------------------------

lcal = ' '
Expand Down