read transfer control file and allocate water transfer arrays, pointers, and user-defined data types
input time series will be converted to daily if necessary and stored in TWU%data and wamTSub%pSub%Q_min
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | config_fid | |||
real(kind=dp), | intent(in), | dimension(:, :) | :: | frar | ||
integer, | intent(in), | dimension(:) | :: | icodes | ||
integer, | intent(in), | dimension(:) | :: | inum1s | ||
integer, | intent(in) | :: | iyr | |||
integer, | intent(in) | :: | mb | |||
integer, | intent(in) | :: | mhyd | |||
integer, | intent(in), | dimension(:, :, :) | :: | mstruc | ||
integer, | intent(in) | :: | nDaysSim | |||
integer, | intent(in) | :: | nbyr | |||
integer, | intent(in), | dimension(:) | :: | neap | ||
real(kind=dp), | intent(in), | dimension(:) | :: | sbar | ||
character(len=path_max_length), | intent(in) | :: | output_path |
subroutine management_initialise(config_fid, frar, icodes, inum1s, iyr, mb, mhyd, mstruc, ndayssim, nbyr, neap, sbar, output_path)
use utilities, only: log_create
integer, intent(in) :: config_fid
real(dp), dimension(:, :), intent(in) :: frar
integer, dimension(:), intent(in) :: icodes
integer, dimension(:), intent(in) :: inum1s
integer, intent(in) :: iyr
integer, intent(in) :: mb
integer, intent(in) :: mhyd
integer, dimension(:, :, :), intent(in) :: mstruc
integer, intent(in) :: nDaysSim
integer, intent(in) :: nbyr
integer, dimension(:), intent(in) :: neap
real(dp), dimension(:), intent(in) :: sbar
character(len=path_max_length), intent(in) :: output_path
integer :: i, logicalint
! overwrite parameters with user input
read(config_fid, nml=MANAGEMENT_PARAMETERS)
if (.not. bWAM_Module) return
!-------------------------------------------------------
! initialise some required variables
!-------------------------------------------------------
allocate(wam_y(nDaysSim))
wam_y = 0
allocate(wam_d(nDaysSim))
wam_d = 0
allocate(wam_plantDemand_summary(nDaysSim))
wam_plantDemand_summary = 0.
allocate(wam_irrigationDemand_summary(nDaysSim))
wam_irrigationDemand_summary = 0.
allocate(wam_supplied_summary(nDaysSim))
wam_supplied_summary = 0.
! create water users configuration output file
management_log = log_create(trim(output_path)//'/wam_transfer.log', &
stdout_level='warn', stderr_level='warn', logfile_level='debug')
call log_debug('management_initialise', 'Water Management Module logfile: '// &
management_log%logfile)
!-------------------------------------------------------
! read water transfer control file
!-------------------------------------------------------
! read transfer control file
! and allocate water transfer arrays, pointers, and user-defined data types
call management_read_ctrl(frar, mb, mstruc, nDaysSim, neap, sbar)
!-------------------------------------------------------
! read water transfer time series input files
!-------------------------------------------------------
! input time series will be converted to daily if necessary and
! stored in TWU%data and wamTSub%pSub%Q_min
call management_read_wu_inout(iyr, nDaysSim, nbyr)
! Identify hydrograph storage locations of water transfer points (hydrograph storage locations)
allocate(bWAMHydrograph(mhyd))
bWAMHydrograph = .false.
call management_route_transfer(icodes, inum1s, mhyd)
call log_info("management_initialise", 'Hydrograph storage locations identified', &
log=management_log)
do i = 1, mhyd
if (bWAMHydrograph(i)) then
logicalint = transfer(bWAMHydrograph(i), logicalint)
call log_info('management_initialise', ' (HYDST) bWAMHyd', i1=i, int=logicalint, log=management_log)
end if
end do
end subroutine management_initialise