Skip to content

Commit

Permalink
Fixed canopy height table and changed ffrac to frt.
Browse files Browse the repository at this point in the history
  • Loading branch information
drnimbusrain committed Dec 19, 2023
1 parent 7aa45c4 commit 3a9338f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
36 changes: 22 additions & 14 deletions physics/satmedmfvdifq.F
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module satmedmfvdifq
use mfscuq_mod
!PCC_CANOPY
use canopy_utils_mod
use noahmp_tables, only : hvt_table

contains

Expand Down Expand Up @@ -89,8 +88,8 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
& rlmx,elmx,sfc_rlm,tc_pbl, &
& do_canopy, vegtype, lai, &
!TODO -Canopy Inputs
! & rdcanopylai, rdcanopyfch, rdcanopyffrac, rdcanopyclu, &
! & canopylaixy, canopyfchxy, canopyffracxy, canopycluxy, &
! & rdcanopylai, rdcanopyfch, rdcanopyfrt, rdcanopyclu, &
! & canopylaixy, canopyfchxy, canopyfrtxy, canopycluxy, &
& ntqv,dtend,dtidx,index_of_temperature,index_of_x_wind, &
& index_of_y_wind,index_of_process_pbl,gen_tend,ldiag3d, &
& errmsg,errflg)
Expand Down Expand Up @@ -119,11 +118,11 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
integer, intent(in) :: vegtype(:)
real(kind=kind_phys), intent(in) :: lai(:)
!TODO Canopy Inputs
! logical, intent(in) :: rdcanopylai, rdcanopyfch, rdcanopyffrac, &
! logical, intent(in) :: rdcanopylai, rdcanopyfch, rdcanopyfrt, &
! rdcanopyclu
! real(kind=kind_phys), intent(in) :: canopylaixy(:), &
! canopyfchxy(:), &
! canopyffracxy(:), &
! canopyfrtxy(:), &
! canopycluxy(:)
!----------------------------------------------
real(kind=kind_phys), intent(inout) :: dv(:,:), du(:,:), &
Expand Down Expand Up @@ -285,17 +284,26 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
real(kind=kind_phys) FCH, MOL, HOL, TLCAN,
& SIGMACAN, RRCAN, BBCAN,
& AACAN, ZCAN, ZFL, BOTCAN,
& EDDYVEST1, EDDYVEST_INT,
& XCANOPYLAI, XCANOPYFCH,
& XCANOPYFFRAC, XCANOPYCLU
& EDDYVEST1, EDDYVEST_INT
!TODO Canopy Inputs
! & XCANOPYLAI, XCANOPYFCH,
! & XCANOPYFRT, XCANOPYCLU

! in canopy eddy diffusivity [ m**2/s ]
real(kind=kind_phys), allocatable :: EDDYVESTX ( : )
! in canopy layer [m]
real(kind=kind_phys), allocatable :: ZCANX ( : )
! Declare local maximum canopy layers
integer, parameter :: MAXCAN = 1000

integer, parameter :: mvt = 30 ! use 30 instead of 27
!Based on MODIS IGBP 20 Category Dataset
real :: fch_table(mvt) !< top of canopy (m)
data ( fch_table(i),i=1,mvt) /
& 20.0, 20.0, 18.0, 16.0, 16.0, 1.10,
& 1.10, 13.0, 10.0, 1.00, 5.00, 2.00,
& 15.0, 1.50, 0.00, 0.00, 0.00, 4.00,
& 2.00, 0.50, 0.00, 0.00, 0.00, 0.00,
& 0.00, 0.00, 0.00, 0.00, 0.00, 0.00 /
!----------------------------------------------

!!
Expand Down Expand Up @@ -1359,18 +1367,18 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
! else
! XCANOPYFCH = 0.0
! endif
! if(rdcanopyffrac) then
! XCANOPYFFRAC = canopyffracxy(i)
! if(rdcanopyfrt) then
! XCANOPYFRT = canopyfrtxy(i)
! else
! XCANOPYFFRAC = 0.0
! XCANOPYFRT = 0.0
! endif
! if(rdcanopyclu) then
! XCANOPYCLU = canopycluxy(i)
! else
! XCANOPYCLU = 0.0
! endif
! FCH = XCANOPYFCH !top of canopy from input file
FCH = hvt_table(vegtype(i)) !top of canopy from table
FCH = fch_table(vegtype(i)) !top of canopy from table
IF (k .EQ. 1) THEN !use model layer interfaces
KCAN = 1
ELSE
Expand All @@ -1387,7 +1395,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
! IF ( XCANOPYLAI .LT. 0.1 !from canopy inputs
IF ( lai(i) .LT. 0.1 !from LSM
& .OR. FCH .LT. 0.5 ) THEN
! & .OR. MAX(0.0, 1.0 - XCANOPYFFRAC) .GT. 0.5
! & .OR. MAX(0.0, 1.0 - XCANOPYFRT) .GT. 0.5
! & .OR. POPU .GT. 10000.0
! & .OR. EXP(-0.5*XCANOPYLAI*XCANOPYCLU).GT. 0.45
! & .AND. FCH .LT. 18.0 ) THEN
Expand Down
4 changes: 2 additions & 2 deletions physics/satmedmfvdifq.meta_canopy
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@
dimensions = ()
type = logical
intent = in
[rdcanopyffrac]
[rdcanopyfrt]
standard_name = flag_for_reading_canopy_forest_fraction_from_input
long_name = flag for reading canopy forest fraction from initial conditions
units = flag
Expand Down Expand Up @@ -625,7 +625,7 @@
type = real
kind = kind_phys
intent = in
[canopyffracxy]
[canopyfrtxy]
standard_name = canopy_forest_fraction
long_name = canopy forest fraction
units = none
Expand Down

0 comments on commit 3a9338f

Please sign in to comment.