Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call GWspatialParameters to set parameters #478

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/offline/cable_input.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2661,6 +2661,11 @@ SUBROUTINE load_parameters(met,air,ssnow,veg,climate,bgc,soil,canopy,rough,rad,
sum_flux,veg,mp)
WRITE(logn,*) ' CABLE variables allocated with ', mp, ' patch(es).'

! call below inserted by rk4417 - phase2
!CALL for gw_model false and true sets constants when false
CALL GWspatialParameters(logn,soil,ssnow) ! MMY gw_model = True read var from gridinfo
! MMY gw_model = False use default values

IF (icycle > 0 .OR. CABLE_USER%CASA_DUMP_WRITE ) &
CALL alloc_casavariable(casabiome,casapool,casaflux, &
casamet,casabal,mp)
Expand Down
144 changes: 72 additions & 72 deletions src/offline/cable_parameters.F90
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ MODULE cable_param_module
PRIVATE
PUBLIC get_default_params, write_default_params, derived_parameters, &
check_parameter_values, report_parameters, parID_type, &
write_cnp_params, consistency_ice_veg_soil
write_cnp_params, consistency_ice_veg_soil, GWspatialParameters
INTEGER :: patches_in_parfile=4 ! # patches in default global parameter
! file

Expand Down Expand Up @@ -1214,7 +1214,7 @@ SUBROUTINE write_default_params(met, air, ssnow, veg, bgc, &
canopy%fe = 0.0 ! sensible heat flux
!mrd
ssnow%qrecharge = 0.0
ssnow%GWwb = -1.0
! ssnow%GWwb = -1.0
ssnow%wtd = 1.0
canopy%sublayer_dz = 0.001 !could go into restart to ensure starting/stopping runs gives identical results
!however the impact is negligible
Expand Down Expand Up @@ -1357,90 +1357,90 @@ SUBROUTINE write_default_params(met, air, ssnow, veg, bgc, &
inLAI(landpt(e)%ilon,landpt(e)%ilat,is)
END DO

! Set IGBP soil texture values, Q.Zhang @ 12/20/2010.
IF (soilparmnew) THEN

soil%swilt(landpt(e)%cstart:landpt(e)%cend) = &
inswilt(landpt(e)%ilon, landpt(e)%ilat)
soil%sfc(landpt(e)%cstart:landpt(e)%cend) = &
insfc(landpt(e)%ilon, landpt(e)%ilat)
soil%ssat(landpt(e)%cstart:landpt(e)%cend) = &
inssat(landpt(e)%ilon, landpt(e)%ilat)
soil%bch(landpt(e)%cstart:landpt(e)%cend) = &
inbch(landpt(e)%ilon, landpt(e)%ilat)
soil%hyds(landpt(e)%cstart:landpt(e)%cend) = &
inhyds(landpt(e)%ilon, landpt(e)%ilat)
soil%sucs(landpt(e)%cstart:landpt(e)%cend) = &
-1.* ABS(insucs(landpt(e)%ilon, landpt(e)%ilat)) !ensure negative
soil%rhosoil(landpt(e)%cstart:landpt(e)%cend) = &
inrhosoil(landpt(e)%ilon, landpt(e)%ilat)
soil%css(landpt(e)%cstart:landpt(e)%cend) = &
incss(landpt(e)%ilon, landpt(e)%ilat)
soil%cnsd(landpt(e)%cstart:landpt(e)%cend) = &
incnsd(landpt(e)%ilon, landpt(e)%ilat)

!possibly heterogeneous soil properties
DO klev=1,ms

soil%clay_vec(landpt(e)%cstart:landpt(e)%cend,klev) = &
REAL(inclay(landpt(e)%ilon, landpt(e)%ilat),r_2)

soil%sand_vec(landpt(e)%cstart:landpt(e)%cend,klev) = &
REAL(insand(landpt(e)%ilon, landpt(e)%ilat),r_2)

soil%silt_vec(landpt(e)%cstart:landpt(e)%cend,klev) = &
REAL(insilt(landpt(e)%ilon, landpt(e)%ilat),r_2)

soil%rhosoil_vec(landpt(e)%cstart:landpt(e)%cend,klev) = &
REAL(inrhosoil(landpt(e)%ilon, landpt(e)%ilat),r_2)

soil%org_vec(landpt(e)%cstart:landpt(e)%cend,klev) = &
REAL(inORG(landpt(e)%ilon, landpt(e)%ilat),r_2)

soil%watr(landpt(e)%cstart:landpt(e)%cend,klev) = &
REAL(inWatr(landpt(e)%ilon, landpt(e)%ilat),r_2)
! ! Set IGBP soil texture values, Q.Zhang @ 12/20/2010.
! IF (soilparmnew) THEN

END DO
! soil%swilt(landpt(e)%cstart:landpt(e)%cend) = &
! inswilt(landpt(e)%ilon, landpt(e)%ilat)
! soil%sfc(landpt(e)%cstart:landpt(e)%cend) = &
! insfc(landpt(e)%ilon, landpt(e)%ilat)
! soil%ssat(landpt(e)%cstart:landpt(e)%cend) = &
! inssat(landpt(e)%ilon, landpt(e)%ilat)
! soil%bch(landpt(e)%cstart:landpt(e)%cend) = &
! inbch(landpt(e)%ilon, landpt(e)%ilat)
! soil%hyds(landpt(e)%cstart:landpt(e)%cend) = &
! inhyds(landpt(e)%ilon, landpt(e)%ilat)
! soil%sucs(landpt(e)%cstart:landpt(e)%cend) = &
! -1.* ABS(insucs(landpt(e)%ilon, landpt(e)%ilat)) !ensure negative
! soil%rhosoil(landpt(e)%cstart:landpt(e)%cend) = &
! inrhosoil(landpt(e)%ilon, landpt(e)%ilat)
! soil%css(landpt(e)%cstart:landpt(e)%cend) = &
! incss(landpt(e)%ilon, landpt(e)%ilat)
! soil%cnsd(landpt(e)%cstart:landpt(e)%cend) = &
! incnsd(landpt(e)%ilon, landpt(e)%ilat)

!Aquifer properties same as bottom soil layer for now
soil%GWsucs_vec(landpt(e)%cstart:landpt(e)%cend) = &
REAL(inGWsucs(landpt(e)%ilon, landpt(e)%ilat),r_2)
! !possibly heterogeneous soil properties
! DO klev=1,ms

soil%GWhyds_vec(landpt(e)%cstart:landpt(e)%cend) = &
REAL(inGWhyds(landpt(e)%ilon, landpt(e)%ilat),r_2)
! soil%clay_vec(landpt(e)%cstart:landpt(e)%cend,klev) = &
! REAL(inclay(landpt(e)%ilon, landpt(e)%ilat),r_2)

soil%GWbch_vec(landpt(e)%cstart:landpt(e)%cend) = &
REAL(inGWbch(landpt(e)%ilon, landpt(e)%ilat),r_2)
! soil%sand_vec(landpt(e)%cstart:landpt(e)%cend,klev) = &
! REAL(insand(landpt(e)%ilon, landpt(e)%ilat),r_2)

soil%GWrhosoil_vec(landpt(e)%cstart:landpt(e)%cend) = &
REAL(inGWrhosoil(landpt(e)%ilon, landpt(e)%ilat),r_2)
! soil%silt_vec(landpt(e)%cstart:landpt(e)%cend,klev) = &
! REAL(insilt(landpt(e)%ilon, landpt(e)%ilat),r_2)

soil%GWssat_vec(landpt(e)%cstart:landpt(e)%cend) = &
REAL(inGWssat(landpt(e)%ilon, landpt(e)%ilat),r_2)
! soil%rhosoil_vec(landpt(e)%cstart:landpt(e)%cend,klev) = &
! REAL(inrhosoil(landpt(e)%ilon, landpt(e)%ilat),r_2)

soil%GWwatr(landpt(e)%cstart:landpt(e)%cend) = &
soil%watr(landpt(e)%cstart:landpt(e)%cend,ms)
! soil%org_vec(landpt(e)%cstart:landpt(e)%cend,klev) = &
! REAL(inORG(landpt(e)%ilon, landpt(e)%ilat),r_2)

soil%slope(landpt(e)%cstart:landpt(e)%cend) = &
MIN(MAX(inSlope(landpt(e)%ilon,landpt(e)%ilat),1e-8),0.95)
! soil%watr(landpt(e)%cstart:landpt(e)%cend,klev) = &
! REAL(inWatr(landpt(e)%ilon, landpt(e)%ilat),r_2)

soil%slope_std(landpt(e)%cstart:landpt(e)%cend) = &
MIN(MAX(inSlopeSTD(landpt(e)%ilon,landpt(e)%ilat),1e-8),0.95)
! END DO

soil%GWdz(landpt(e)%cstart:landpt(e)%cend) = &
inGWdz(landpt(e)%ilon,landpt(e)%ilat)
! !Aquifer properties same as bottom soil layer for now
! soil%GWsucs_vec(landpt(e)%cstart:landpt(e)%cend) = &
! REAL(inGWsucs(landpt(e)%ilon, landpt(e)%ilat),r_2)

! vh !
soil%silt(landpt(e)%cstart:landpt(e)%cend) = &
insilt(landpt(e)%ilon, landpt(e)%ilat)
! soil%GWhyds_vec(landpt(e)%cstart:landpt(e)%cend) = &
! REAL(inGWhyds(landpt(e)%ilon, landpt(e)%ilat),r_2)

soil%sand(landpt(e)%cstart:landpt(e)%cend) = &
insand(landpt(e)%ilon, landpt(e)%ilat)
! soil%GWbch_vec(landpt(e)%cstart:landpt(e)%cend) = &
! REAL(inGWbch(landpt(e)%ilon, landpt(e)%ilat),r_2)

soil%clay(landpt(e)%cstart:landpt(e)%cend) = &
inclay(landpt(e)%ilon, landpt(e)%ilat)
! soil%GWrhosoil_vec(landpt(e)%cstart:landpt(e)%cend) = &
! REAL(inGWrhosoil(landpt(e)%ilon, landpt(e)%ilat),r_2)

ENDIF
! soil%GWssat_vec(landpt(e)%cstart:landpt(e)%cend) = &
! REAL(inGWssat(landpt(e)%ilon, landpt(e)%ilat),r_2)

! soil%GWwatr(landpt(e)%cstart:landpt(e)%cend) = &
! soil%watr(landpt(e)%cstart:landpt(e)%cend,ms)

! soil%slope(landpt(e)%cstart:landpt(e)%cend) = &
! MIN(MAX(inSlope(landpt(e)%ilon,landpt(e)%ilat),1e-8),0.95)

! soil%slope_std(landpt(e)%cstart:landpt(e)%cend) = &
! MIN(MAX(inSlopeSTD(landpt(e)%ilon,landpt(e)%ilat),1e-8),0.95)

! soil%GWdz(landpt(e)%cstart:landpt(e)%cend) = &
! inGWdz(landpt(e)%ilon,landpt(e)%ilat)

! ! vh !
! soil%silt(landpt(e)%cstart:landpt(e)%cend) = &
! insilt(landpt(e)%ilon, landpt(e)%ilat)

! soil%sand(landpt(e)%cstart:landpt(e)%cend) = &
! insand(landpt(e)%ilon, landpt(e)%ilat)

! soil%clay(landpt(e)%cstart:landpt(e)%cend) = &
! inclay(landpt(e)%ilon, landpt(e)%ilat)

! ENDIF

! vars intro for Ticket #27
IF (calcsoilalbedo) THEN
Expand Down
Loading