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

Drydeposition #88

Draft
wants to merge 12 commits into
base: noresm
Choose a base branch
from
Prev Previous commit
Next Next commit
change the names of drydep variables & season logic in drydepvelocity
  • Loading branch information
rosiealice committed Oct 10, 2024
commit e2f7b37c53e75419df088a7016ab962b4cf4ca5b
35 changes: 19 additions & 16 deletions src/biogeochem/DryDepVelocity.F90
Original file line number Diff line number Diff line change
@@ -361,7 +361,7 @@ subroutine depvel_compute( bounds, &
end if

if(use_fates)then
wesveg = canopystate_inst%wesley_pft_index_patch(pi)
wesveg = canopystate_inst%wesley_veg_index_patch(pi)
endif

! create seasonality index used to index wesely data tables from LAI, Bascially
@@ -409,25 +409,28 @@ subroutine depvel_compute( bounds, &
endif

if(use_fates)then
index_season = canopystate_inst%drydep_season_patch(pi)
endif
write(iulog,*) 'fates season index',pi,canopystate_inst%wesley_season_index_patch(pi)
index_season = canopystate_inst%wesley_season_index_patch(pi)
else

if (index_season<0) then
if (elai(pi) < (minlai+0.05_r8*(maxlai-minlai))) then
index_season = 3
if (index_season<0) then
if (elai(pi) < (minlai+0.05_r8*(maxlai-minlai))) then
index_season = 3
endif
endif
endif

if (index_season<0) then
if (mlaidiff(pi) > 0.0_r8) then
index_season = 2
elseif (mlaidiff(pi) < 0.0_r8) then
index_season = 5
elseif (mlaidiff(pi).eq.0.0_r8) then
index_season = 3
if (index_season<0) then
if (mlaidiff(pi) > 0.0_r8) then
index_season = 2
elseif (mlaidiff(pi) < 0.0_r8) then
index_season = 5
elseif (mlaidiff(pi).eq.0.0_r8) then
index_season = 3
endif
endif
endif


endif ! use_fates

if (index_season<0) then
call endrun('ERROR: not able to determine season'//errmsg(sourcefile, __LINE__))
endif
8 changes: 4 additions & 4 deletions src/biogeophys/CanopyStateType.F90
Original file line number Diff line number Diff line change
@@ -52,8 +52,8 @@ module CanopyStateType

real(r8) , pointer :: dleaf_patch (:) ! patch characteristic leaf width (diameter) [m]
! for non-ED/FATES this is the same as pftcon%dleaf()
integer , pointer :: wesley_pft_index_patch (:) ! Wesley PFT index for FATES drydep calculations
integer , pointer :: drydep_season_patch (:) ! Season for dry deposition calculations
integer , pointer :: wesley_veg_index_patch (:) ! Wesley PFT index for FATES dry deposition calculations
integer , pointer :: wesley_season_index_patch (:) ! Season for dry deposition calculations

real(r8) , pointer :: rscanopy_patch (:) ! patch canopy stomatal resistance (s/m) (ED specific)

@@ -147,8 +147,8 @@ subroutine InitAllocate(this, bounds)
allocate(this%fsun240_patch (begp:endp)) ; this%fsun240_patch (:) = nan

allocate(this%dleaf_patch (begp:endp)) ; this%dleaf_patch (:) = nan
allocate(this%wesley_pft_index_patch (begp:endp)) ; ! is an integer so can't be nan
allocate(this%drydep_season_patch (begp:endp)) ; ! is an integer so can't be nan
allocate(this%wesley_veg_index_patch (begp:endp)) ; ! is an integer so can't be nan
allocate(this%wesley_season_index_patch (begp:endp)) ; ! is an integer so can't be nan
allocate(this%rscanopy_patch (begp:endp)) ; this%rscanopy_patch (:) = nan
! allocate(this%gccanopy_patch (begp:endp)) ; this%gccanopy_patch (:) = 0.0_r8
allocate(this%vegwp_patch (begp:endp,1:nvegwcs)) ; this%vegwp_patch (:,:) = nan