Skip to content

Commit

Permalink
Replace cable_gw_hydro.F90 with its new version (#231)
Browse files Browse the repository at this point in the history
# CABLE ground water hydrology work of Mengyuan Mu

This pull request is part of integrating the ground water hydrology work
of Mengyuan Mu into CABLE, which will take place in a sequence of pull
requests. The actual integration project itself was completed back in
September 2023. The current work involves just a gradual merge into the
main branch.

Fixes #230

## Description

1. cable_gw_hydro.F90 is replaced by its new version (drop-in
replacement)
2. Dependencies are introduced in **src/offline/cable_parameters.F90**,
**src/offline/cable_define_types.F90**,
**src/science/soilsnow/cbl_thermal.F90**, and
**src/util/cable_common.F90** in order for the code to compile
successfully (confirmed)
3. *PLEASE* do not delete any of my in-code comments (tagged rk4417) for
now. Once the integration of the ground water hydrology work is complete
and its functionality is confirmed to reproduce the results obtained
already outside of the repo, I will clean-up all of my comments in a
single pull request. Deleting any of my comments now will just make it
much more difficult for me to track down and fix any issues that might
arise during this process.


<!-- readthedocs-preview cable start -->
----
📚 Documentation preview 📚:
https://cable--231.org.readthedocs.build/en/231/

<!-- readthedocs-preview cable end -->
  • Loading branch information
rkutteh authored Sep 1, 2024
2 parents d45a62c + 1dd3724 commit 95b9b5e
Show file tree
Hide file tree
Showing 5 changed files with 1,978 additions and 991 deletions.
18 changes: 16 additions & 2 deletions src/offline/cable_define_types.F90
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ MODULE cable_def_types_mod
rhosoil_vec,& !soil density [kg/m3]
ssat_vec, & !volumetric water content at saturation [mm3/mm3]
watr, & !residual water content of the soil [mm3/mm3]
smpc_vec, & ! Hutson Cass SWC potential cutoff ! 2 lines inserted by rk4417 - phase2
wbc_vec, & ! Hutson Cass SWC volumetric water cutoff
sfc_vec, & !field capcacity (hk = 1 mm/day)
swilt_vec ! wilting point (hk = 0.02 mm/day)

Expand All @@ -187,6 +189,8 @@ MODULE cable_def_types_mod
GWssat_vec, & !saturated water content of the aquifer [mm3/mm3]
GWwatr, & !residual water content of the aquifer [mm3/mm3]
GWz, & !node depth of the aquifer [m]
smpc_GW, & ! Hutson Cass SWC potential cutoff ! 2 lines inserted by rk4417 - phase2
wbc_GW, & ! Hutson Cass SWC volumetric water cutoff
GWdz, & !thickness of the aquifer [m]
GWrhosoil_vec !density of the aquifer substrate [kg/m3]

Expand Down Expand Up @@ -240,7 +244,7 @@ MODULE cable_def_types_mod
owetfac, & ! surface wetness fact. at previous time step
t_snwlr, & ! top snow layer depth in 3 layer snowpack
tggav, & ! mean soil temperature in K
otgg, & ! soil temperature in K
! otgg, & ! soil temperature in K ! moved below by rk4417 - phase2
otss, & ! surface temperature (weighted soil, snow)
otss_0, & ! surface temperature (weighted soil, snow)
tprecip, &
Expand All @@ -267,6 +271,7 @@ MODULE cable_def_types_mod
sdepth, & ! snow depth
smass, & ! snow mass
ssdn, & ! snow densities
otgg, & ! soil temperature in K ! moved here from above by rk4417 - phase2
tgg, & ! soil temperature in K
tggsn, & ! snow temperature in K
dtmlt, & ! water flux to the soil
Expand Down Expand Up @@ -880,6 +885,10 @@ SUBROUTINE alloc_soil_parameter_type(var, mp)
ALLOCATE( var%ssat_vec(mp,ms) )
ALLOCATE( var%watr(mp,ms) )
var%watr(:,:) = 0.05
ALLOCATE( var%wbc_GW(mp) ) ! block inserted by rk4417 - phase2
ALLOCATE( var%smpc_GW(mp) )
ALLOCATE( var%wbc_vec(mp,ms) )
ALLOCATE( var%smpc_vec(mp,ms) ) ! end - rk4417 - phase
ALLOCATE( var%sfc_vec(mp,ms) )
ALLOCATE( var%swilt_vec(mp,ms) )
ALLOCATE( var%sand_vec(mp,ms) )
Expand Down Expand Up @@ -977,7 +986,8 @@ SUBROUTINE alloc_soil_snow_type(var, mp)
ALLOCATE( var%t_snwlr(mp) )
ALLOCATE( var%wbfice(mp,ms) )
ALLOCATE( var%tggav(mp) )
ALLOCATE( var%otgg(mp) )
! ALLOCATE( var%otgg(mp) ) ! replaced by below - rk4417 - phase2
ALLOCATE( var%otgg(mp,ms) )
ALLOCATE( var%otss(mp) )
ALLOCATE( var%otss_0(mp) )
ALLOCATE( var%tprecip(mp) )
Expand Down Expand Up @@ -1520,6 +1530,10 @@ SUBROUTINE dealloc_soil_parameter_type(var)
DEALLOCATE( var% cnsd_vec )
DEALLOCATE( var%hyds_vec )
DEALLOCATE( var%sucs_vec )
DEALLOCATE( var%wbc_GW ) ! block inserted by rk4417 - phase2
DEALLOCATE( var%smpc_GW )
DEALLOCATE( var%wbc_vec )
DEALLOCATE( var%smpc_vec ) ! end - rk4417 - phase
DEALLOCATE( var%bch_vec )
DEALLOCATE( var%ssat_vec )
DEALLOCATE( var%watr )
Expand Down
Loading

0 comments on commit 95b9b5e

Please sign in to comment.