Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | iyr | |||
integer, | intent(in) | :: | nDaysSim | |||
integer, | intent(in) | :: | nbyr |
subroutine management_read_wu_inout(iyr, ndayssim, nbyr)
integer, intent(in) :: iyr
integer, intent(in) :: nDaysSim
integer, intent(in) :: nbyr
integer :: wu_id, ts_type
character(len=path_max_length) :: fname
do wu_id = 1, wam_nWU ! total number of water transfer users
! generate input time series file name
fname = trim(TWU(wu_id)%name)//".csv"
ts_type = TWU(wu_id) % ts_ ! format of input time series (constant monthly / monthly / daily)
select case (ts_type)
case(1) ! read constant monthly (nval = 12) and convert to daily ts
! and store in: TWU(wu_id)%data
call management_read_time_series(12, fname, len_trim(fname), wu_id, iyr, nDaysSim, nbyr)
case(2) ! read monthly time series (nval=years*12) and convert to daily ts
! and store in: TWU(wu_id)%data
call management_read_time_series(12*nbyr, fname, len_trim(fname), wu_id, iyr, nDaysSim, nbyr)
case(3) ! read daily time series (nval = nDaysSim)
! and store in: TWU(wu_id)%data
call management_read_time_series(nDaysSim, fname, len_trim(fname), wu_id, iyr, nDaysSim, nbyr)
end select
end do
end subroutine management_read_wu_inout