Skip to content

Commit

Permalink
Reinstate dry and cold stress (#275)
Browse files Browse the repository at this point in the history
Remove double summation of btran (#279)
Require both changes.
  • Loading branch information
rml599gh committed Aug 15, 2024
1 parent c2a54da commit fdcb99f
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/science/casa-cnp/casa_cnp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -764,8 +764,13 @@ SUBROUTINE casa_coeffplant(xkleafcold,xkleafdry,xkleaf,veg,casabiome,casapool, &
casaflux%fromPtoL(:,str,froot) = 1.0 - casaflux%fromPtoL(:,metb,froot)
casaflux%fromPtoL(:,cwd,wood) = 1.0

! calc. of casaflux%kplant drops scaling - see #242
casaflux%kplant(:,leaf) = casabiome%plantrate(veg%iveg(:),leaf)
! calc. of casaflux%kplant had dropped scaling for cold and drought stress
! as noted in trac ticket #243
! R. Law 23/7/2024 reinstate terms to account for cold and drought stress (#275)
! which are calculated in casa_xrateplant
! Needs 'btran' bug fix (#279) implemented with this.
casaflux%kplant(:,leaf) = casabiome%plantrate(veg%iveg(:),leaf)*xkleaf(:) &
+ xkleafcold(:) + xkleafdry(:)

casaflux%kplant(:,wood) = casabiome%plantrate(veg%iveg(:),wood)
casaflux%kplant(:,froot) = casabiome%plantrate(veg%iveg(:),froot)
Expand Down Expand Up @@ -1498,12 +1503,11 @@ SUBROUTINE avgsoil(veg,soil,casamet)
* casamet%tsoil(nland,ns)
casamet%moistavg(nland) = casamet%moistavg(nland)+ veg%froot(nland,ns) &
* MIN(soil%sfc(nland),casamet%moist(nland,ns))
casamet%btran(nland) = casamet%btran(nland)+ veg%froot(nland,ns) &
* (MIN(soil%sfc(nland),casamet%moist(nland,ns))-soil%swilt(nland)) &
/(soil%sfc(nland)-soil%swilt(nland))

! Ticket#121


!R. Law 23/7/2024 Issue #279
!both the alternate (ticket 121) btran calculation and the original btran
!calculation were in the code meaning the summation was done twice. Removed
!original version and kept ticket 121 version
casamet%btran(nland) = casamet%btran(nland)+ veg%froot(nland,ns) &
* (MAX(MIN(soil%sfc(nland),casamet%moist(nland,ns))-soil%swilt(nland),0.0)) &
/(soil%sfc(nland)-soil%swilt(nland))
Expand Down

0 comments on commit fdcb99f

Please sign in to comment.