In the subroutine soil_snow_gw in cable_gw_hydro.F90,:
There is a bug which means the model keeps losing water, the fix is:
do k=1,ms
do i=1,mp
ssnow%wbliq(i,k) = ssnow%wb(i,k) - ssnow%wbice(i,k)
Should be:
do k=1,ms
do i=1,mp
ssnow%wbliq(i,k) = ssnow%wb(i,k) - den_rat*ssnow%wbice(i,k)
where den_rat = real(C%density_ice/C%density_liq,r_2).
In mass_balance in cable_checks.F90:
There is a bug so the mass balance does not add up correctly:
REAL(r_2), DIMENSION(:,:,:),POINTER, SAVE :: bwb ! volumetric soil moisture
IF(ktau==1) THEN
ALLOCATE( bwb(mp,ms,2) )
! initial vlaue of soil moisture
bwb(:,:,1)=ssnow%wb
bwb(:,:,2)=ssnow%wb
delwb(:) = 0.
ELSE
! Calculate change in soil moisture b/w timesteps:
IF(MOD(REAL(ktau),2.0)==1.0) THEN ! if odd timestep
bwb(:,:,1)=ssnow%wb
DO k=1,mp ! current smoist - prev tstep smoist
delwb(k) = SUM((bwb(k,:,1) &
(bwb(k,:,2)))soil%zse)1000.0
END DO
ELSE IF(MOD(REAL(ktau),2.0)==0.0) THEN ! if even timestep
bwb(:,:,2)=ssnow%wb
DO k=1,mp ! current smoist - prev tstep smoist
delwb(k) = SUM((bwb(k,:,2) &
(bwb(k,:,1)))soil%zse)1000.0
END DO
END IF
END IF
Should become:
REAL(r_2), DIMENSION(:,:,:),POINTER, SAVE :: bwb ! volumetric soil moisture
REAL(r_2), DIMENSION(:,:),POINTER, SAVE :: bwb_gw ! volumetric gw soil moisture, New addition
IF(ktau==1) THEN
ALLOCATE( bwb(mp,ms,2) )
ALLOCATE( bwb_gw(mp,2) ) ! New addition
! initial vlaue of soil moisture
bwb(:,:,1)=ssnow%wb
bwb(:,:,2)=ssnow%wb
bwb_gw(:,1)=ssnow%GWwb ! New addition
bwb_gw(:,2)=ssnow%GWwb ! New addition
delwb(:) = 0.
ELSE
IF ( cable_user%GW_MODEL) THEN ! New block addition
! Calculate change in soil moisture b/w timesteps:
IF(MOD(REAL(ktau),2.0)==1.0) THEN ! if odd timestep
bwb(:,:,1)=ssnow%wb
DO k=1,mp ! current smoist - prev tstep smoist
delwb(k) = ( SUM( (bwb(k,:,1) - bwb(k,:,2))*soil%zse ) + &
(bwb_gw(k,1) - bwb_gw(k,2))*soil%GWdz(k) ) *1000.0
END DO
ELSE IF(MOD(REAL(ktau),2.0)==0.0) THEN ! if even timestep
bwb(:,:,2)=ssnow%wb
DO k=1,mp ! current smoist - prev tstep smoist
delwb(k) = ( SUM( (bwb(k,:,2) - bwb(k,:,1))*soil%zse ) + &
(bwb_gw(k,2) -bwb_gw(k,1))*soil%GWdz(k) ) *1000.0
END DO
END IF
ELSE
! Calculate change in soil moisture b/w timesteps:
IF(MOD(REAL(ktau),2.0)==1.0) THEN ! if odd timestep
bwb(:,:,1)=ssnow%wb
DO k=1,mp ! current smoist - prev tstep smoist
delwb(k) = SUM((bwb(k,:,1) &
- (bwb(k,:,2)))*soil%zse)*1000.0
END DO
ELSE IF(MOD(REAL(ktau),2.0)==0.0) THEN ! if even timestep
bwb(:,:,2)=ssnow%wb
DO k=1,mp ! current smoist - prev tstep smoist
delwb(k) = SUM((bwb(k,:,2) &
- (bwb(k,:,1)))*soil%zse)*1000.0
END DO
END IF
END IF
END IF
Removing the qrecharge
There is a bug so the mass balance does not add up correctly:
keyword_groundwater_maygit
type_defect
| by mgk576There are three bug fixes for the GW scheme:
There is a bug which means the model keeps losing water, the fix is:
do k=1,ms do i=1,mp ssnow%wbliq(i,k) = ssnow%wb(i,k) - ssnow%wbice(i,k)
Should be:
do k=1,ms do i=1,mp ssnow%wbliq(i,k) = ssnow%wb(i,k) - den_rat*ssnow%wbice(i,k)
where den_rat = real(C%density_ice/C%density_liq,r_2).
There is a bug so the mass balance does not add up correctly:
REAL(r_2), DIMENSION(:,:,:),POINTER, SAVE :: bwb ! volumetric soil moisture
IF(ktau==1) THEN ALLOCATE( bwb(mp,ms,2) ) ! initial vlaue of soil moisture bwb(:,:,1)=ssnow%wb bwb(:,:,2)=ssnow%wb delwb(:) = 0. ELSE ! Calculate change in soil moisture b/w timesteps: IF(MOD(REAL(ktau),2.0)==1.0) THEN ! if odd timestep bwb(:,:,1)=ssnow%wb DO k=1,mp ! current smoist - prev tstep smoist delwb(k) = SUM((bwb(k,:,1) &
Should become:
REAL(r_2), DIMENSION(:,:,:),POINTER, SAVE :: bwb ! volumetric soil moisture REAL(r_2), DIMENSION(:,:),POINTER, SAVE :: bwb_gw ! volumetric gw soil moisture, New addition
IF(ktau==1) THEN ALLOCATE( bwb(mp,ms,2) ) ALLOCATE( bwb_gw(mp,2) ) ! New addition ! initial vlaue of soil moisture bwb(:,:,1)=ssnow%wb bwb(:,:,2)=ssnow%wb bwb_gw(:,1)=ssnow%GWwb ! New addition bwb_gw(:,2)=ssnow%GWwb ! New addition delwb(:) = 0. ELSE
IF ( cable_user%GW_MODEL) THEN ! New block addition
ELSE
END IF END IF
There is a bug so the mass balance does not add up correctly:
bal%wbal = REAL(met%precip - canopy%delwc - ssnow%snowd+ssnow%osnowd &
Should become ...
IF ( cable_user%GW_MODEL) THEN bal%wbal = REAL(met%precip - canopy%delwc - ssnow%snowd+ssnow%osnowd - & ssnow%runoff-(canopy%fevw+canopy%fevc + & canopy%fes/ssnow%cls)dels/air%rlam - delwb) ELSE bal%wbal = REAL(met%precip - canopy%delwc - ssnow%snowd+ssnow%osnowd - & ssnow%runoff-(canopy%fevw+canopy%fevc + & canopy%fes/ssnow%cls)dels/air%rlam - delwb - & ssnow%qrecharge) END IF
Please note, there is an SLI block here and we think the groundwater thing needs to go in there as well.
There are also fixes to the grid info file but we will make a seperate ticket.
Issue migrated from trac:213 at 2023-11-27 11:28:08 +1100