@@ -54,6 +54,57 @@ module WaterstateType
5454 real (r8 ), pointer :: ice1_grc (:) ! grc initial gridcell total h2o ice content
5555 real (r8 ), pointer :: ice2_grc (:) ! grc post land cover change total ice content
5656 real (r8 ), pointer :: tws_grc (:) ! grc total water storage (mm H2O)
57+ #ifdef USE_PDAF
58+ ! Yorck additions, variables for getting monthly means which can be compared to a GRACE measurements, other variables will just
59+ ! provide instantaneous values
60+
61+ real (r8 ), pointer :: h2osno_col_mean (:) ! col snow water (mm H2O)
62+ real (r8 ), pointer :: h2osoi_liq_col_mean (:,:) ! col liquid water (kg/m2) (new) (-nlevsno+1:nlevgrnd)
63+ real (r8 ), pointer :: h2osoi_ice_col_mean (:,:) ! col ice lens (kg/m2) (new) (-nlevsno+1:nlevgrnd)
64+ real (r8 ), pointer :: h2ocan_patch_mean (:) ! patch canopy water (mm H2O)
65+ real (r8 ), pointer :: snocan_patch_mean (:) ! patch canopy water (mm H2O)
66+ real (r8 ), pointer :: h2osfc_col_mean (:) ! col surface water (mm H2O)
67+ real (r8 ), pointer :: total_plant_stored_h2o_col_mean(:) ! col water that is bound in plants, including roots, sapwood, leaves, etc
68+ ! in most cases, the vegetation scheme does not have a dynamic
69+ ! water storage in plants, and thus 0.0 is a suitable for the trivial case.
70+ ! When FATES is coupled in with plant hydraulics turned on, this storage
71+ ! term is set to non-zero. (kg/m2 H2O)
72+
73+
74+ real (r8 ), pointer :: tws_hactive (:) ! TWS for hydrological active columns
75+ real (r8 ), pointer :: tws_hactive_mean (:) ! TWS for hydrological active columns
76+
77+
78+ ! also increments for all variables are added
79+ real (r8 ), pointer :: h2osno_col_inc (:) ! col snow water (mm H2O)
80+ real (r8 ), pointer :: h2osoi_liq_col_inc (:,:) ! col liquid water (kg/m2) (new) (-nlevsno+1:nlevgrnd)
81+ real (r8 ), pointer :: h2osoi_ice_col_inc (:,:) ! col ice lens (kg/m2) (new) (-nlevsno+1:nlevgrnd)
82+ real (r8 ), pointer :: h2ocan_patch_inc (:) ! patch canopy water (mm H2O)
83+ real (r8 ), pointer :: h2osfc_col_inc (:) ! col surface water (mm H2O)
84+ real (r8 ), pointer :: total_plant_stored_h2o_col_inc (:) ! col water that is bound in plants, including roots, sapwood, leaves, etc
85+ ! in most cases, the vegetation scheme does not have a dynamic
86+ ! water storage in plants, and thus 0.0 is a suitable for the trivial case.
87+ ! When FATES is coupled in with plant hydraulics turned on, this storage
88+ ! term is set to non-zero. (kg/m2 H2O)
89+ real (r8 ), pointer :: tws_grc_inc (:) ! grc total water storage (mm H2O)
90+
91+ ! for analysis of the statevector, also variables for putting the state inside are initialized
92+ real (r8 ), pointer :: tws_state_before (:) ! TWS state
93+ real (r8 ), pointer :: h2osoi_liq_state_before (:,:) ! soil liq state
94+ real (r8 ), pointer :: h2osoi_ice_state_before (:,:) ! soil ice state
95+ real (r8 ), pointer :: h2osfc_state_before (:) ! surface water state
96+ real (r8 ), pointer :: h2osno_state_before (:) ! snow state
97+ real (r8 ), pointer :: h2ocan_state_before (:) ! canopy state
98+
99+ real (r8 ), pointer :: tws_state_after (:) ! TWS state
100+ real (r8 ), pointer :: h2osoi_liq_state_after (:,:) ! soil liq state
101+ real (r8 ), pointer :: h2osoi_ice_state_after (:,:) ! soil ice state
102+ real (r8 ), pointer :: h2osfc_state_after (:) ! surface water state
103+ real (r8 ), pointer :: h2osno_state_after (:) ! snow state
104+ real (r8 ), pointer :: h2ocan_state_after (:) ! canopy state
105+
106+ ! END Yorck
107+ #endif
57108#ifdef COUP_OAS_PFL
58109 real (r8 ), pointer :: pfl_psi_col (:,:) ! ParFlow pressure head COUP_OAS_PFL
59110 real (r8 ), pointer :: pfl_h2osoi_liq_col (:,:) ! ParFlow soil liquid COUP_OAS_PFL
@@ -211,6 +262,42 @@ subroutine InitAllocate(this, bounds)
211262 allocate (this% ice2_grc (begg:endg)) ; this% ice2_grc (:) = nan
212263 allocate (this% tws_grc (begg:endg)) ; this% tws_grc (:) = nan
213264
265+ #ifdef USE_PDAF
266+ ! Yorck additions (see above)
267+ allocate (this% h2osoi_ice_col_mean (begc:endc,- nlevsno+1 :nlevgrnd)) ; this% h2osoi_ice_col_mean (:,:) = nan
268+ allocate (this% h2osoi_liq_col_mean (begc:endc,- nlevsno+1 :nlevgrnd)) ; this% h2osoi_liq_col_mean (:,:) = nan
269+ allocate (this% h2osno_col_mean (begc:endc)) ; this% h2osno_col_mean (:) = nan
270+ allocate (this% h2ocan_patch_mean (begp:endp)) ; this% h2ocan_patch_mean (:) = nan
271+ allocate (this% snocan_patch_mean (begp:endp)) ; this% snocan_patch_mean (:) = nan
272+ allocate (this% h2osfc_col_mean (begc:endc)) ; this% h2osfc_col_mean (:) = nan
273+ allocate (this% total_plant_stored_h2o_col_mean(begc:endc)) ; this% total_plant_stored_h2o_col_mean(:) = nan
274+
275+ allocate (this% tws_hactive (begg:endg)) ; this% tws_hactive (:) = nan
276+ allocate (this% tws_hactive_mean (begg:endg)) ; this% tws_hactive_mean (:) = nan
277+
278+ allocate (this% h2osoi_ice_col_inc (begc:endc,1 :nlevsoi)) ; this% h2osoi_ice_col_inc (:,:) = nan
279+ allocate (this% h2osoi_liq_col_inc (begc:endc,1 :nlevsoi)) ; this% h2osoi_liq_col_inc (:,:) = nan
280+ allocate (this% h2osno_col_inc (begc:endc)) ; this% h2osno_col_inc (:) = nan
281+ allocate (this% h2ocan_patch_inc (begp:endp)) ; this% h2ocan_patch_inc (:) = nan
282+ allocate (this% h2osfc_col_inc (begc:endc)) ; this% h2osfc_col_inc (:) = nan
283+ allocate (this% total_plant_stored_h2o_col_inc (begc:endc)) ; this% total_plant_stored_h2o_col_inc (:) = nan
284+ allocate (this% tws_grc_inc (begg:endg)) ; this% tws_grc_inc (:) = nan
285+
286+ allocate (this% tws_state_before (begg:endg)) ; this% tws_state_before (:) = nan
287+ allocate (this% h2osoi_liq_state_before(begg:endg,1 :nlevsoi)) ; this% h2osoi_liq_state_before(:,:) = nan
288+ allocate (this% h2osoi_ice_state_before(begg:endg,1 :nlevsoi)) ; this% h2osoi_ice_state_before(:,:) = nan
289+ allocate (this% h2osno_state_before (begg:endg)) ; this% h2osno_state_before (:) = nan
290+ allocate (this% h2osfc_state_before (begg:endg)) ; this% h2osfc_state_before (:) = nan
291+ allocate (this% h2ocan_state_before (begg:endg)) ; this% h2ocan_state_before (:) = nan
292+
293+ allocate (this% tws_state_after (begg:endg)) ; this% tws_state_after (:) = nan
294+ allocate (this% h2osoi_liq_state_after (begg:endg,1 :nlevsoi)) ; this% h2osoi_liq_state_after (:,:) = nan
295+ allocate (this% h2osoi_ice_state_after (begg:endg,1 :nlevsoi)) ; this% h2osoi_ice_state_after (:,:) = nan
296+ allocate (this% h2osno_state_after (begg:endg)) ; this% h2osno_state_after (:) = nan
297+ allocate (this% h2osfc_state_after (begg:endg)) ; this% h2osfc_state_after (:) = nan
298+ allocate (this% h2ocan_state_after (begg:endg)) ; this% h2ocan_state_after (:) = nan
299+ ! END Yorck
300+ #endif
214301 allocate (this% total_plant_stored_h2o_col(begc:endc)) ; this% total_plant_stored_h2o_col(:) = nan
215302
216303 allocate (this% snw_rds_col (begc:endc,- nlevsno+1 :0 )) ; this% snw_rds_col (:,:) = nan
@@ -402,6 +489,13 @@ subroutine InitHistory(this, bounds)
402489 avgflag= ' A' , long_name= ' total water storage' , &
403490 ptr_lnd= this% tws_grc)
404491
492+ #ifdef USE_PDAF
493+ ! Yorck: add also TWS_hactive in history outputs
494+ this% tws_hactive(begg:endg) = spval
495+ call hist_addfld1d (fname= ' TWS_hactive' , units= ' mm' , &
496+ avgflag= ' A' , long_name= ' total water storage of hydrological active cells' , &
497+ ptr_lnd= this% tws_hactive)
498+ #endif
405499 ! (rgk 02-02-2017) There is intentionally no entry here for stored plant water
406500 ! I think that since the value is zero in all cases except
407501 ! for FATES plant hydraulics, it will be confusing for users
0 commit comments