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

Adding Integrated Canopy Effects to CCPP/PBL Scheme #253

Open
wants to merge 55 commits into
base: ufs/dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
67b693e
Testing hedmf change.
drnimbusrain Sep 28, 2022
e2c7f47
Rolled back hedmf test change.
drnimbusrain Sep 29, 2022
1fb9060
Merge branch 'ufs-community:ufs/dev' into feature/aqm_canopy
drnimbusrain Dec 5, 2022
d825523
First draft commit of canopy turbulence effects in hedmf.f
drnimbusrain Dec 5, 2022
574ad4e
Fixed non-ascii character
drnimbusrain Dec 5, 2022
1665715
Changed from canopy in hedmf to satmedmvdifq for GFSv16.
drnimbusrain Dec 6, 2022
1c587a3
Added more arguments for canopy varibles.
drnimbusrain Dec 6, 2022
fe808c6
Fixed non-ascii character.
drnimbusrain Dec 6, 2022
634ebb1
Added canopy height grid cell conidtion.
drnimbusrain Dec 12, 2022
08dd5a6
Updated to modify TKE instead of K for canopy.
drnimbusrain Feb 7, 2023
22d3fd7
Rolled back to modifying K directly for canopy effects.
drnimbusrain Feb 7, 2023
936a28e
Updated Meta data
drnimbusrain Feb 7, 2023
989ed53
Added lai and vegtype to the meta
drnimbusrain Feb 9, 2023
99ba757
Fixed bugs.
drnimbusrain Feb 9, 2023
de1c0b4
Added canopy_utils_mod and noahmp_tables to satmedmfvdifq meta depend…
drnimbusrain Feb 10, 2023
90762fb
Changed some comments.
drnimbusrain Feb 10, 2023
07bafc0
Fixed IF statement bug in canopy conditions.
drnimbusrain Feb 10, 2023
6b686e5
Fixed bug in canopy variable inputs.
drnimbusrain Feb 10, 2023
ea79a91
Merge remote-tracking branch 'origin/develop' into feature/aqm_canopy
drnimbusrain Feb 11, 2023
be76560
Merge branch 'ufs-community:ufs/dev' into feature/aqm_canopy
drnimbusrain Feb 11, 2023
8122173
Updated bugs.
drnimbusrain Feb 12, 2023
f99c2bb
Fixed bugs (again...).
drnimbusrain Feb 12, 2023
e68de59
Merge branch 'ufs-community:ufs/dev' into feature/aqm_canopy
drnimbusrain Mar 3, 2023
92e33b2
Added "do_canopy" flag for eddy effects in TKE-EDMF
drnimbusrain Mar 8, 2023
d9d6465
Fixed bug in syntax
drnimbusrain Mar 8, 2023
da70f9b
Added canopy effects for multiple model layers...if necessary
drnimbusrain Mar 23, 2023
3f5a1d5
Merge branch 'ufs-community:ufs/dev' into feature/aqm_canopy
drnimbusrain Mar 23, 2023
03cbe6f
Updated canopy effect to use interface levels, zi.
drnimbusrain Mar 24, 2023
b8c61a3
Merge branch 'feature/aqm_canopy' of https://github.com/noaa-oar-arl/…
drnimbusrain Mar 24, 2023
b0465a5
Merge branch 'ufs-community:ufs/dev' into feature/aqm_canopy
drnimbusrain Mar 25, 2023
a962bdc
Merge branch 'ufs-community:ufs/dev' into feature/aqm_canopy
drnimbusrain Mar 28, 2023
9490726
Merge branch 'ufs-community:ufs/dev' into feature/aqm_canopy
drnimbusrain May 31, 2023
97d0417
Merge branch 'ufs-community:ufs/dev' into feature/aqm_canopy
drnimbusrain Jun 30, 2023
df68b5c
Merge branch 'ufs-community:ufs/dev' into feature/aqm_canopy
drnimbusrain Jul 17, 2023
29033e2
Merge branch 'ufs-community:ufs/dev' into feature/aqm_canopy
drnimbusrain Nov 16, 2023
911e4f9
Added TODO comments for input canopy variables and draft meta.
drnimbusrain Nov 16, 2023
7aa45c4
Merge branch 'feature/aqm_canopy' of https://github.com/noaa-oar-arl/…
drnimbusrain Nov 16, 2023
3a9338f
Fixed canopy height table and changed ffrac to frt.
drnimbusrain Dec 19, 2023
1e28ccd
Removed noah_mp_table dependency for aqm_canopy
drnimbusrain Dec 19, 2023
b0706c2
Pass via interface 5 AQM canopy inputs and build-in diagnostic arrays…
iri01 Feb 28, 2024
7726000
Corrected canopy arrays meta names and dimensions for consistency wit…
iri01 Feb 28, 2024
4d171ce
Remove unnecessary definitions of canopy arrays
iri01 Feb 28, 2024
caee56d
Merge pull request #1 from noaa-oar-arl/feature/aqm_canopy_new
iri01 Feb 28, 2024
7a0e1e2
Fix to canopy arrays definitions: add intent
iri01 Mar 1, 2024
336447d
Merge pull request #2 from noaa-oar-arl/feature/aqm_canopy_new_fix
iri01 Mar 1, 2024
fc1fb3f
Fixed cfch and cpopu units in the canopy meta variables.
drnimbusrain Mar 3, 2024
cbcb544
Fixed standard_name for naux2d and naux3d in meta file.
drnimbusrain Mar 3, 2024
8b82cf9
Bug fix to remove FCH and divide by ZFL.
drnimbusrain Apr 4, 2024
d3d17e9
Merge branch 'feature/aqm_canopy' into feature/aqm_canopy2
drnimbusrain Feb 6, 2025
eb85a48
Removed Files.
drnimbusrain Feb 6, 2025
4065eb7
Commenting out aux arrays.
drnimbusrain Feb 10, 2025
5016165
Fixed units of cpopu for canopy work.
drnimbusrain Feb 10, 2025
d98a4d7
Removed old lai/vegtype from canopy satmedmfvdifq
drnimbusrain Feb 10, 2025
aedd1c4
Use pi physical constant from ccpp, correct units of cpopu.
iri01 Mar 1, 2025
5abb270
Bug fix on the use of the canopy module
iri01 Mar 2, 2025
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
55 changes: 5 additions & 50 deletions physics/PBL/SATMEDMF/satmedmfvdifq.F
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ module satmedmfvdifq
use mfpbltq_mod
use tridi_mod
use mfscuq_mod
!PCC_CANOPY
use canopy_utils_mod

contains

Expand Down Expand Up @@ -77,7 +75,7 @@ end subroutine satmedmfvdifq_init
!! (mfscuq.f).
!! \section detail_satmedmfvidfq GFS satmedmfvdifq Detailed Algorithm
subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
& ntiw,ntke,grav,rd,cp,rv,hvap,hfus,fv,eps,epsm1, &
& ntiw,ntke,grav,pi,rd,cp,rv,hvap,hfus,fv,eps,epsm1, &
& dv,du,tdt,rtg,u1,v1,t1,q1,usfco,vsfco,icplocn2atm, &
& swh,hlw,xmu,garea,zvfun,sigmaf, &
& psk,rbsoil,zorl,u10m,v10m,fm,fh, &
Expand All @@ -90,8 +88,6 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
& do_canopy, claie, cfch, cfrt, cclu, cpopu, &
!IVAI
!TODO -Canopy Inputs from UFS
! & 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 All @@ -113,7 +109,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
integer, intent(out) :: kpbl(:)
logical, intent(in) :: gen_tend,ldiag3d
!
real(kind=kind_phys), intent(in) :: grav,rd,cp,rv,hvap,hfus,fv, &
real(kind=kind_phys), intent(in) :: grav,pi,rd,cp,rv,hvap,hfus,fv, &
& eps,epsm1
real(kind=kind_phys), intent(in) :: delt, xkzm_m, xkzm_h, xkzm_s
real(kind=kind_phys), intent(in) :: dspfac, bl_upfr, bl_dnfr
Expand All @@ -123,13 +119,6 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
!IVAI: canopy inputs
real(kind=kind_phys), intent(in) :: claie(:), cfch(:), cfrt(:),
& cclu(:), cpopu(:)
!TODO Canopy Inputs
! logical, intent(in) :: rdcanopylai, rdcanopyfch, rdcanopyfrt, &
! rdcanopyclu
! real(kind=kind_phys), intent(in) :: canopylaixy(:), &
! canopyfchxy(:), &
! canopyfrtxy(:), &
! canopycluxy(:)
!----------------------------------------------
real(kind=kind_phys), intent(inout) :: dv(:,:), du(:,:), &
& tdt(:,:), rtg(:,:,:)
Expand Down Expand Up @@ -280,9 +269,6 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
real(kind=kind_phys) ck0, ck1, ch0, ch1, ce0, rchck
!
!PCC_CANOPY------------------------------------
real(kind=kind_phys) PICAN
!----------------------------------------------

real(kind=kind_phys) qlcr, zstblmax, hcrinv
!
real(kind=kind_phys) h1
Expand All @@ -296,9 +282,6 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
& SIGMACAN, RRCAN, BBCAN,
& AACAN, ZCAN, ZFL, BOTCAN,
& EDDYVEST1, EDDYVEST_INT
!TODO Canopy Inputs
! & XCANOPYLAI, XCANOPYFCH,
! & XCANOPYFRT, XCANOPYCLU

! in canopy eddy diffusivity [ m**2/s ]
real(kind=kind_phys), allocatable :: EDDYVESTX ( : )
Expand Down Expand Up @@ -346,10 +329,6 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
parameter(ck1=0.15,ch1=0.15)
parameter(cs0=0.4,csmf=0.5)
parameter(rchck=1.5,ndt=20)
!PCC_CANOPY------------------------------------
parameter (PICAN = 3.1415927)
!----------------------------------------------

!PCC_CANOPY------------------------------------
if (do_canopy) then
if(.not.allocated(EDDYVESTX))
Expand Down Expand Up @@ -1392,30 +1371,6 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
do k = 1, km1-1
do i = 1, im

!TODO: Canopy Inputs
! if(rdcanopylai) then
! XCANOPYLAI = canopylaixy(i)
! else
! XCANOPYLAI = 0.0
! endif
! if(rdcanopyfch) then
! XCANOPYFCH = canopyfchxy(i)
! else
! XCANOPYFCH = 0.0
! endif
! if(rdcanopyfrt) then
! XCANOPYFRT = canopyfrtxy(i)
! else
! XCANOPYFRT = 0.0
! endif
! if(rdcanopyclu) then
! XCANOPYCLU = canopycluxy(i)
! else
! XCANOPYCLU = 0.0
! endif
!
! FCH = XCANOPYFCH !top of canopy from input file

!IVAI: AQM canopy Inputs
! FCH = fch_table(vegtype(i)) !top of canopy from look-up table
FCH = cfch(i) !top of canopy from AQM canopy inputs
Expand Down Expand Up @@ -1492,7 +1447,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
IF ( ZCAN/FCH .GE. 0.175
& .AND. ZCAN/FCH .LE. 1.25 ) THEN
SIGMACAN = ustar(i) * ( 0.75 +
& (0.5 * COS((PICAN/1.06818) *
& (0.5 * COS((PI/1.06818) *
& (1.25 - (ZCAN/FCH)))) )
END IF
IF ( ZCAN/FCH .LT. 0.175 ) THEN
Expand All @@ -1506,7 +1461,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
IF ( ZCAN/FCH .GE. 0.175
& .AND. ZCAN/FCH .LE. 1.25 ) THEN
SIGMACAN = ustar(i) * ( 0.625 +
& (0.375* COS((PICAN/1.06818) *
& (0.375* COS((PI/1.06818) *
& (1.25 - (ZCAN/FCH)))) )
END IF
IF ( ZCAN/FCH .LT. 0.175 ) THEN
Expand All @@ -1523,7 +1478,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, &
AACAN=(0.125*RRCAN) + 0.125
BBCAN=(0.125*RRCAN) - 0.125
SIGMACAN = ustar(i) * ( AACAN +
& (BBCAN * COS((PICAN/1.06818) *
& (BBCAN * COS((PI/1.06818) *
& (1.25 - (ZCAN/FCH)))) )
END IF
IF ( ZCAN/FCH .LT. 0.175 ) THEN
Expand Down
9 changes: 8 additions & 1 deletion physics/PBL/SATMEDMF/satmedmfvdifq.meta
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@
type = real
kind = kind_phys
intent = in
[pi]
standard_name = pi
long_name = ratio of a circle's circumference to its diameter
units = none
dimensions = ()
type = real
kind = kind_phys
[rd]
standard_name = gas_constant_of_dry_air
long_name = ideal gas constant for dry air
Expand Down Expand Up @@ -639,7 +646,7 @@
[cpopu]
standard_name = canopy_population_density
long_name = population density used for canopy correction
units = people km-2
units = km-2
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
Expand Down
25 changes: 0 additions & 25 deletions physics/tools/canopy_utils_mod.f
Original file line number Diff line number Diff line change
Expand Up @@ -24,29 +24,4 @@ function IntegrateTrapezoid(x, y)

! ---------------------------------------------------------------------------

function interp_linear1_internal(x,y,xout) result(yout)
!! Interpolates for the y value at the desired x value,
!! given x and y values around the desired point.

implicit none

real, intent(IN) :: x(2), y(2), xout
real :: yout
real :: alph

if ( xout .lt. x(1) .or. xout .gt. x(2) ) then
write(*,*) "interp1: xout < x0 or xout > x1 !"
write(*,*) "xout = ",xout
write(*,*) "x0 = ",x(1)
write(*,*) "x1 = ",x(2)
stop
end if

alph = (xout - x(1)) / (x(2) - x(1))
yout = y(1) + alph*(y(2) - y(1))

return

end function interp_linear1_internal

end module canopy_utils_mod