1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
| subroutine CalcAndWithdrawSectorWaterFluxes(bounds, soilhydrology_inst, sectorwater_inst, water_inst, volr, rof_prognostic)
!
! !DESCRIPTION:
! Calculates sector water withdrawal fluxes and withdraws from groundwater
!
! !USES:
! use SoilHydrologyMod , only : WithdrawGroundwaterSectorWater
use clm_time_manager , only : is_beg_curr_day
!
! !ARGUMENTS:
integer :: g ! gridcell index
type(bounds_type) , intent(in) :: bounds
type(soilhydrology_type) , intent(in) :: soilhydrology_inst
type(sectorwater_type) , intent(inout) :: sectorwater_inst
type(water_type) , intent(inout) :: water_inst
! river water volume (m3) (ignored if rof_prognostic is .false.)
real(r8), intent(in) :: volr( bounds%begg: )
! whether we're running with a prognostic ROF component; this is needed to determine
! whether we can limit irrigation based on river volume.
logical, intent(in) :: rof_prognostic
! !LOCAL VARIABLES:
integer :: i ! tracer index
character(len=*), parameter :: subname = 'CalcAndWithdrawSectorWaterFluxes'
!-----------------------------------------------------------------------
! Read withdrawal and consumption data from input surfdata
! Compute the withdrawal, consumption and return flow (expected and actual)
! To limit computation time, call this subroutine only once a day
if (is_beg_curr_day()) then
call sectorwater_inst%CalcSectorWaterNeeded(bounds, volr, rof_prognostic)
endif
! This part is not elegant at all and will be replaced later
do g = bounds%begg, bounds%endg
water_inst%waterlnd2atmbulk_inst%qdom_withd_grc(g) = sectorwater_inst%dom_withd_actual_grc(g)
water_inst%waterlnd2atmbulk_inst%qdom_rf_grc(g) = sectorwater_inst%dom_rf_actual_grc(g)
water_inst%waterlnd2atmbulk_inst%qliv_withd_grc(g) = sectorwater_inst%liv_withd_actual_grc(g)
water_inst%waterlnd2atmbulk_inst%qliv_rf_grc(g) = sectorwater_inst%liv_rf_actual_grc(g)
water_inst%waterlnd2atmbulk_inst%qelec_withd_grc(g) = sectorwater_inst%elec_withd_actual_grc(g)
water_inst%waterlnd2atmbulk_inst%qelec_rf_grc(g) = sectorwater_inst%elec_rf_actual_grc(g)
water_inst%waterlnd2atmbulk_inst%qmfc_withd_grc(g) = sectorwater_inst%mfc_withd_actual_grc(g)
water_inst%waterlnd2atmbulk_inst%qmfc_rf_grc(g) = sectorwater_inst%mfc_rf_actual_grc(g)
water_inst%waterlnd2atmbulk_inst%qmin_withd_grc(g) = sectorwater_inst%min_withd_actual_grc(g)
water_inst%waterlnd2atmbulk_inst%qmin_rf_grc(g) = sectorwater_inst%min_rf_actual_grc(g)
end do
end subroutine CalcAndWithdrawSectorWaterFluxes
|