Skip to content

Commit

Permalink
Turned debug prints on for i=25 and j=25.
Browse files Browse the repository at this point in the history
  • Loading branch information
drnimbusrain committed Nov 15, 2023
1 parent 912adae commit 5f2402e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 40 deletions.
52 changes: 22 additions & 30 deletions src/canopy_calcs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -145,32 +145,33 @@ SUBROUTINE canopy_calcs(nn)
! ... calculate canopy/foliage distribution shape profile - bottom up total in-canopy and fraction at z
call canopy_foliage(modlays, zhc, zcanmax, sigmau, sigma1, &
fafraczInt)
! if (i .eq. 25 .and. j .eq. 25) then
! print*,'prescribed shape function =', fafraczInt
! print*,'zhc = ', zhc
! end if !test debug
if (i .eq. 25 .and. j .eq. 25) then
print*,'prescribed shape function =', fafraczInt
print*,'zhc = ', zhc
end if !test debug
else
! ... derive canopy/foliage distribution shape profile from interpolated GEDI PAVD profile - bottom up total in-canopy and fraction at z
! if (i .eq. 25 .and. j .eq. 25) then !test debug
! print*, 'Lat = ', variables_2d(i,j)%lat
! print*, 'Lon = ', variables_2d(i,j)%lon
! print*, 'VIIRS PAI = ', lairef+0.5
if (variables_2d(i,j)%lat .gt. (-1.0_rk*pavd_set) .and. &
variables_2d(i,j)%lat .lt. pavd_set) then !use GEDI PAVD
call canopy_pavd2fafrac(modres, hcmref, zhc, &
variables_3d(i,j,:)%pavd, variables_1d%lev, fafraczInt)
! print*, 'fafraczInt(pavd) = ', fafraczInt
! print*,'zhc = ', zhc
!check if there is observed canopy height but no PAVD profile
if (hcmref .gt. 0.0 .and. maxval(fafraczInt) .le. 0.0) then !revert to prescribed shape profile
if (i .eq. 25 .and. j .eq. 25) then !test debug
print*, 'Lat = ', variables_2d(i,j)%lat
print*, 'Lon = ', variables_2d(i,j)%lon
print*, 'VIIRS PAI = ', lairef+0.5
if (variables_2d(i,j)%lat .gt. (-1.0_rk*pavd_set) .and. &
variables_2d(i,j)%lat .lt. pavd_set) then !use GEDI PAVD
call canopy_pavd2fafrac(modres, hcmref, zhc, &
variables_3d(i,j,:)%pavd, variables_1d%lev, fafraczInt)
print*, 'i = ', i, 'j = ', j
print*, 'fafraczInt(pavd) = ', fafraczInt
print*,'zhc = ', zhc
!check if there is observed canopy height but no PAVD profile
if (hcmref .gt. 0.0 .and. maxval(fafraczInt) .le. 0.0) then !revert to prescribed shape profile
call canopy_foliage(modlays, zhc, zcanmax, sigmau, sigma1, &
fafraczInt)
end if
else !revert back to using prescribed shape profile
call canopy_foliage(modlays, zhc, zcanmax, sigmau, sigma1, &
fafraczInt)
end if
else !revert back to using prescribed shape profile
call canopy_foliage(modlays, zhc, zcanmax, sigmau, sigma1, &
fafraczInt)
end if
! end if !test debug
end if !test debug
end if

! ... calculate zero-plane displacement height/hc and surface (soil+veg) roughness lengths/hc
Expand All @@ -193,7 +194,6 @@ SUBROUTINE canopy_calcs(nn)
call canopy_ppfd_exp(zk, hcmref, dswrfref, lairef, fsun, &
ppfd_sun, ppfd_shade, ppfd_ave)

! ... **** User Canopy-App Options ***
! ... user option to calculate in-canopy wind speeds at height z and midflame WAF

if (ifcanwind .or. ifcanwaf) then
Expand All @@ -202,12 +202,6 @@ SUBROUTINE canopy_calcs(nn)
call canopy_wind_most(hcmref, zk(k), fafraczInt(k), ubzref, &
z0ghc, cdrag, pai, hgtref, d_h, zo_h, &
lambdars, canBOT(k), canTOP(k), canWIND_3d(i,j,k))
! if (canWIND_3d(i,j,k) .gt. 10000000.) then !test debug
! print*, 'zhc = ', hcmref, 'zk = ', zk(k)
! print*, 'lat = ',variables_2d(i,j)%lat
! print*, 'fafraczInt = ', fafraczInt(k), 'ws = ', canWIND_3d(i,j,k)
! end if !end test debug

end do
else
write(*,*) 'wrong namelist option = ', rsl_opt, 'only option = 0 right now'
Expand Down Expand Up @@ -553,8 +547,6 @@ SUBROUTINE canopy_calcs(nn)
call canopy_ppfd_exp(zk, hcmref, dswrfref, lairef, fsun, &
ppfd_sun, ppfd_shade, ppfd_ave)

! ... **** User Canopy-App Options ***

! ... user option to calculate in-canopy wind speeds at height z and midflame WAF

if (ifcanwind .or. ifcanwaf) then
Expand Down
20 changes: 10 additions & 10 deletions src/canopy_var3din_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@ SUBROUTINE CANOPY_PAVD2FAFRAC ( MODRES, FCH, ZHC, &
end do

!test debug prints...
! print*, 'FCH = ', FCH
! print*, 'pavd_orig = ', PAVD_IN
! print*, 'pavd_levs = ', PAVD_LEVS
! print*,'PAVD After Interpolation (canopy-app)-----'
! print*,PAVD_INTERP
! print*,'------------------------'
! print*,'canopy-app levels-----'
! print*,ZK
! print*,'------------------------'
! print*, 'PAI (Integrated PAVD) = ', PAI
print*, 'FCH = ', FCH
print*, 'pavd_orig = ', PAVD_IN
print*, 'pavd_levs = ', PAVD_LEVS
print*,'PAVD After Interpolation (canopy-app)-----'
print*,PAVD_INTERP
print*,'------------------------'
print*,'canopy-app levels-----'
print*,ZK
print*,'------------------------'
print*, 'PAI (Integrated PAVD) = ', PAI

END SUBROUTINE CANOPY_PAVD2FAFRAC

Expand Down

0 comments on commit 5f2402e

Please sign in to comment.