management Module

---------------------------------------------------------------------------


---------------------------------------------------------------------------


---------------------------------------------------------------------------

---------------------------------------------------------------------------

---------------------------------------------------------------------------

---------------------------------------------------------------------------

---------------------------------------------------------------------------

---------------------------------------------------------------------------

---------------------------------------------------------------------------

---------------------------------------------------------------------------

---------------------------------------------------------------------------

---------------------------------------------------------------------------


---------------------------------------------------------------------------



Uses

  • module~~management~~UsesGraph module~management management module~utilities utilities module~management->module~utilities

Used by

  • module~~management~~UsedByGraph module~management management proc~vegetation_water_stress vegetation_water_stress proc~vegetation_water_stress->module~management proc~terminate terminate proc~terminate->module~management proc~initialise initialise proc~initialise->module~management proc~runsubbasin runsubbasin proc~runsubbasin->module~management proc~hydrotope_process hydrotope_process proc~hydrotope_process->module~management proc~print_module_parameters print_module_parameters proc~print_module_parameters->module~management proc~time_process_day time_process_day proc~time_process_day->module~management proc~river_route_add river_route_add proc~river_route_add->module~management

Contents


Variables

TypeVisibility AttributesNameInitial
type(TSubbasin), public, dimension(:), allocatable, TARGET:: TSub
type(TWaterUser), public, dimension(:), allocatable, TARGET:: TWU
logical, public, save, dimension(:), allocatable:: bWAMHydrograph
logical, public, save:: bWAM_Module =.false.

WATER TRANSFER VARIABLES

switch module on (TRUE) or off (FALSE). Read in readbas.f90 from *.bsn file logical, save :: wam_bTransfer defined in common.f90

character, public :: management_input_file ='management.csv'
integer, public :: management_input_file_id =0
type(logger), public, save:: management_log
character, public :: management_users_input_dir ='input/water_users'
type(TwamSub), public, dimension(:), allocatable:: wamTSub
character(len=path_max_length), public, save, dimension(:), allocatable:: wam_UName
logical, public, save, dimension(:), allocatable:: wam_bTransReplace
integer, public, save, dimension(:), allocatable:: wam_d

m3 / s

integer, public, save, dimension(:), allocatable:: wam_day_irr_end
integer, public, save, dimension(:), allocatable:: wam_day_irr_start
integer, public, save, dimension(:), allocatable:: wam_destination
real(kind=dp), public, save, dimension(:), allocatable:: wam_eff
real(kind=dp), public, save:: wam_eff_drip =0.9
real(kind=dp), public, save:: wam_eff_sprinkler =0.65

DATE ARRAYS for output only

array of current years and days of year

integer, public, save, dimension(:), allocatable:: wam_firstyr
real(kind=dp), public, save, dimension(:), allocatable:: wam_irr_deficit_fac
integer, public, save, dimension(:), allocatable:: wam_irr_opt
integer, public, save, dimension(:), allocatable:: wam_irr_practice
real(kind=dp), public, save, dimension(:), allocatable:: wam_irrigationDemand_summary
integer, public, save, dimension(:), allocatable:: wam_lastyr
integer, public, save:: wam_nWU =0
integer, public, save:: wam_nsub

IRRIGATION VARIABLES

switch module on (TRUE) or off (FALSE). Read in readbas.f90 from *.bsn file logical, save :: wam_bIrrigation ! defined in common.f90

integer, public, save, dimension(:), allocatable:: wam_opt
real(kind=dp), public, save, dimension(:), allocatable:: wam_plantDemand_summary
integer, public, save, dimension(:), allocatable:: wam_source
real(kind=dp), public, save, dimension(:), allocatable:: wam_supplied_summary

User-defined data types


integer, public, save, dimension(:), allocatable:: wam_ts
integer, public, save, dimension(:), allocatable:: wam_w_source
integer, public, save, dimension(:), allocatable:: wam_y

m3 / s


Derived Types

type, public :: TSubbasin

Components

TypeVisibility AttributesNameInitial
real(kind=dp), public, dimension(:), pointer:: Q_act
real(kind=dp), public, dimension(:), pointer:: Q_min
real(kind=dp), public, dimension(:), pointer:: inflow
real(kind=dp), public, dimension(:), pointer:: irrDemand
integer, public :: nWU
integer, public :: nWUin
integer, public :: nWUout
integer, public, dimension(:), pointer:: pos
integer, public :: pos_irr
integer, public :: subnr
real(kind=dp), public, dimension(:), pointer:: totDemand
real(kind=dp), public, dimension(:), pointer:: tr_losses_in
real(kind=dp), public, dimension(:), pointer:: tr_losses_out
real(kind=dp), public, dimension(:), pointer:: withdrawal

type, public :: TWaterUser

Components

TypeVisibility AttributesNameInitial
real(kind=dp), public :: area
real(kind=dp), public, dimension(:), pointer:: data
integer, public :: day_irr_end
integer, public :: day_irr_start
integer, public :: fyr
real(kind=dp), public :: irr_deficit_fac
integer, public :: irr_eff_fac
integer, public :: irr_opt
integer, public :: irr_practice
real(kind=dp), public, dimension(:), pointer:: irrigationDemand
integer, public :: lyr
character(len=path_max_length), public :: name
real(kind=dp), public, dimension(:), pointer:: plantDemand
integer, public :: subd
integer, public :: subs
real(kind=dp), public, dimension(:), pointer:: supplied
real(kind=dp), public :: tr_eff
real(kind=dp), public, dimension(:), pointer:: tr_losses

Following variables are required for water users of type irrigation only wu_opt = 4

Read more…
integer, public :: ts_
integer, public :: w_source
integer, public :: wu_opt

type, public :: TwamSub

Components

TypeVisibility AttributesNameInitial
type(TSubbasin), public, POINTER:: pSub
integer, public :: subnum

Functions

public function gen_filename(i, ch, ext, n)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: i
character(len=n), intent(in) :: ch
character(len=*), intent(in) :: ext
integer, intent(in) :: n

Return Value character(len=path_max_length)

public function management_is_active_period(year, day, pWU)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: year
integer, intent(in) :: day
type(TWaterUser), POINTER:: pWU

Return Value logical

public function management_is_transfer_subbasin(sub)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: sub

Return Value logical

public function management_subbasin_pointer(sub) result(pS)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: sub

Return Value type(TSubbasin), POINTER

public function management_user_pointer(id) result(pWU)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: id

Return Value type(TWaterUser), POINTER

public function wam_correct_irrigationdemand(pWU, plantDemand)

Arguments

Type IntentOptional AttributesName
type(TWaterUser), POINTER:: pWU
real(kind=dp), intent(in) :: plantDemand

Return Value real(kind=dp)


Subroutines

public subroutine management_allocate_transfer(n)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: n

public subroutine management_convert_to_daily(nval, dailyArray, val, wu_id, iyr, nDaysSim, nbyr)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: nval
real(kind=dp), intent(inout), dimension(nDaysSim + 1):: dailyArray
real(kind=dp), intent(in), dimension(nval):: val
integer, intent(in) :: wu_id
integer, intent(in) :: iyr
integer, intent(in) :: nDaysSim
integer, intent(in) :: nbyr

public subroutine management_deallocate_transfer()

Arguments

None

public subroutine management_distribribute(pS, withdrawal_act, daycounter, ida, iyr)

account for irrigation water users !! pWU%supplied should not be added to %inflow, because the irrigation supply is added in hydrotope !! %inflow is added to sda or varoute in "subbasin" and/or "add"

Read more…

Arguments

Type IntentOptional AttributesName
type(TSubbasin), POINTER:: pS
real(kind=dp), intent(in) :: withdrawal_act
integer, intent(in) :: daycounter
integer, intent(in) :: ida
integer, intent(in) :: iyr

public subroutine management_external_supply(sub, day, ida, iyr)

!! pWU%supplied should not be added to %inflow, because the irrigation supply is added in hydrotope !! %inflow is added to sda or varoute in "subbasin" and/or "add"

Read more…

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: sub
integer, intent(in) :: day
integer, intent(in) :: ida
integer, intent(in) :: iyr

public subroutine management_initialise(config_fid, frar, icodes, inum1s, iyr, mb, mhyd, mstruc, nDaysSim, nbyr, neap, sbar, output_path)

read transfer control file and allocate water transfer arrays, pointers, and user-defined data types

Read more…

Arguments

Type IntentOptional AttributesName
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

public subroutine management_read_ctrl(frar, mb, mstruc, nDaysSim, neap, sbar)

Check, if the irrigated area, summarised for each subbasin from *.str file is

Read more…

Arguments

Type IntentOptional AttributesName
real(kind=dp), intent(in), dimension(:, :):: frar
integer, intent(in) :: mb
integer, intent(in), dimension(:, :, :):: mstruc
integer, intent(in) :: nDaysSim
integer, intent(in), dimension(:):: neap
real(kind=dp), intent(in), dimension(:):: sbar

public subroutine management_read_time_series(nval, fname, n, wu_id, iyr, nDaysSim, nbyr)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: nval
character(len=n) :: fname
integer, intent(in) :: n
integer, intent(in) :: wu_id
integer, intent(in) :: iyr
integer, intent(in) :: nDaysSim
integer, intent(in) :: nbyr

public subroutine management_read_wu_inout(iyr, nDaysSim, nbyr)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: iyr
integer, intent(in) :: nDaysSim
integer, intent(in) :: nbyr

public subroutine management_route_transfer(icodes, inum1s, mhyd)

Arguments

Type IntentOptional AttributesName
integer, intent(in), dimension(:):: icodes
integer, intent(in), dimension(:):: inum1s
integer, intent(in) :: mhyd

public subroutine management_total_demand(sub, day, ida, iyr)

Read more…

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: sub
integer, intent(in) :: day
integer, intent(in) :: ida
integer, intent(in) :: iyr

public subroutine management_transfer_out(sub, surfaceR, subsurfaceR, day, ida, iyr)

!! pWU%supplied should not be added to %inflow, because the irrigation supply is added in hydrotope !! %inflow is added to sda or varoute in "subbasin" and/or "add"

Read more…

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: sub
real(kind=dp), intent(inout) :: surfaceR
real(kind=dp), intent(inout) :: subsurfaceR
integer, intent(in) :: day
integer, intent(in) :: ida
integer, intent(in) :: iyr

public subroutine management_write_user_output(mb, nDaysSim)

Read more…

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: mb
integer, intent(in) :: nDaysSim