Skip to content

Commit

Permalink
Commented out debug prints and updated README.
Browse files Browse the repository at this point in the history
  • Loading branch information
drnimbusrain committed Nov 15, 2023
1 parent 5f2402e commit 65397fe
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 37 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ You can also [generate global inputs using Python (see python/global_data_proces
| Namelist Option | Namelist Description and Units |
| --------------- | ---------------------------------------------------------------------------------- |
| | **Input model format options** |
| `infmt_opt` | integer for choosing 1D text (= `1`) or 2D NetCDF input file format (= `0`, default) |
| `infmt_opt` | integer for choosing 1D or 2D text (= `1`) or 2D NetCDF input file format (= `0`, default) |
| | **Input model grid sizes** |
| `nlat` | number of latitude cells (must match # of LAT in `file_vars` above) |
| `nlon` | number of longitude cells (must match # of LON in `file_vars` above) |
Expand All @@ -198,10 +198,10 @@ You can also [generate global inputs using Python (see python/global_data_proces
| `time_end` | End time stamp in YYYY-MM-DD-HH:MM:SS.SSSS for simulation/observation inputs |
| `ntime` | Number of time steps for simulation/observation inputs |
| `time_intvl` | Integer time interval for simulation/observation input time steps in seconds (e.g. 3600 for hourly time stpes and 24*3600 for daily time steps) |
| | **Input model 3d variable/PAVD options** |
| `var3d_opt` | integer for selecting to use 3D variable inputs (= `0`, default, off) or (= `1`, on) with the number of levels defined by `var3d_set` below |
| `var3d_set` | integer for selecting number of 3D input levels, only used when setting `var3d_set= `1`, default = 14 |
| `pavd_opt` | integer for choosing to use GEDI 3D input PAVD profiles instead of prescribed plant distribution functions (= `0`, default, off) or (= `1`, on); Note: To use this option, must set `var3d_set= `1`, and the 3D pavd variable must be available in the input NetCDF file (i.e., `file_vars`) and `infmt_opt = `0` |
| | **Input model 3d variable/PAVD options (only used for 2D NetCDF)** |
| `var3d_opt` | integer for selecting to use 3D NetCDF variable inputs (= `0`, default, off) or (= `1`, on) with the number of levels defined by `var3d_set` below |
| `var3d_set` | integer for selecting number of 3D NetCDF input levels, only used when setting `var3d_set= `1`, default = 14 |
| `pavd_opt` | integer for choosing to use GEDI 3D input PAVD profiles instead of prescribed plant distribution functions (= `0`, default, off) or (= `1`, on); Note: To use this option, must set `var3d_set= `1`, and the 3D pavd variable must be available in the input NetCDF file (i.e., `file_vars`) and `infmt_opt = `0` for NetCDF |
| `pavd_set` | real value for +/- latitude threshold within to use observed GEDI 3D PAVD profiles instead of prescribed plant distribution functions. Used only if `pavd_opt=1`. Default = 52.0 degrees latitude. |
| | **Canopy model vertical layers** |
| `modlays` | number of model (below and above canopy) layers |
Expand Down
44 changes: 22 additions & 22 deletions src/canopy_calcs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -145,33 +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. 26 .and. j .eq. 26) 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*, '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
! if (i .eq. 26 .and. j .eq. 26) 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
end if !test debug
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

! ... calculate zero-plane displacement height/hc and surface (soil+veg) roughness lengths/hc
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 65397fe

Please sign in to comment.