Skip to content

Commit

Permalink
sub-topographic parameterizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Dalei Hao committed Feb 18, 2021
1 parent 42e08b7 commit 5ba3819
Show file tree
Hide file tree
Showing 17 changed files with 1,030 additions and 32 deletions.
12 changes: 12 additions & 0 deletions components/clm/bld/namelist_files/namelist_definition_clm4_5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,18 @@ If TRUE, write diagnostic of global radiative temperature written to CLM log fil
Subgrid fluxes for snow
</entry>

<!-- Added by Dalei Hao for 3D-RT -->
<entry id="rad_3d_topo" type="logical" category="clm_physics"
group="clm_inparm" valid_values="" >
If TRUE, 3D topography parameterization will be activated.
</entry>

<entry id="f3dtopo" type="char*256" category="datasets"
input_pathname="abs" group="clm_inparm" valid_values="" >
Full pathname of 3D topography parameters
</entry>
<!-- End 3D-RT -->

<!-- ======================================================================================== -->
<!-- Former CPP tokens -->
<!-- ======================================================================================== -->
Expand Down
6 changes: 6 additions & 0 deletions components/clm/cime_config/user_nl_clm
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,11 @@
! Set glc_smb with GLC_SMB option
! Set maxpatch_glcmec with GLC_NEC option
! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable
!
!
! To enable the 3-D topography effect on surface solar radiation in CLM,
! the following namelist variables are required:
! rad_3d_topo = .true.
! f3dtopo = '<topographic_factor_path>/topo_3d_{resolution}_c150322.nc'
!----------------------------------------------------------------------------------

14 changes: 13 additions & 1 deletion components/clm/src/biogeophys/EnergyFluxType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,19 @@ subroutine InitHistory(this, bounds)
call hist_addfld1d (fname='BTRAN', units='unitless', &
avgflag='A', long_name='transpiration beta factor', &
ptr_patch=this%btran_patch, set_lake=spval, set_urb=spval)


!!! add output (pft-based SH and LH) by Dalei Hao 12/6/2020
this%eflx_sh_tot_patch(begp:endp) = spval
call hist_addfld1d (fname='SH_pft', units='W/m^2', &
avgflag='A', long_name='patch total sensible heat flux (W/m**2) [+ to atm]', &
ptr_patch=this%eflx_sh_tot_patch, default='inactive')

this%eflx_lh_tot_patch(begp:endp) = spval
call hist_addfld1d (fname='LH_pft', units='W/m^2', &
avgflag='A', long_name='patch total latent heat flux (W/m**2) [+ to atm]', &
ptr_patch=this%eflx_lh_tot_patch, default='inactive')
!!! end

if (use_cn) then
this%rresis_patch(begp:endp,:) = spval
call hist_addfld2d (fname='RRESIS', units='proportion', type2d='levgrnd', &
Expand Down
22 changes: 19 additions & 3 deletions components/clm/src/biogeophys/FrictionVelocityMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,12 @@ subroutine FrictionVelocity(lbn, ubn, fn, filtern, &
u10 => frictionvel_vars%u10_patch , & ! Output: [real(r8) (:) ] 10-m wind (m/s) (for dust model)
u10_clm => frictionvel_vars%u10_clm_patch , & ! Output: [real(r8) (:) ] 10-m wind (m/s)
va => frictionvel_vars%va_patch , & ! Output: [real(r8) (:) ] atmospheric wind speed plus convective velocity (m/s)
fv => frictionvel_vars%fv_patch & ! Output: [real(r8) (:) ] friction velocity (m/s) (for dust model)
)
fv => frictionvel_vars%fv_patch , & ! Output: [real(r8) (:) ] friction velocity (m/s) (for dust model)
!!! add by Dalei Hao
zeta_patch => frictionvel_vars%zeta_patch , & ! Output: [real(r8) (:) ] atmospheric wind speed plus convective velocity (m/s)
ustar_patch => frictionvel_vars%ustar_patch & ! Output: [real(r8) (:) ] friction velocity (m/s) (for dust model)
!!!
)

! Adjustment factors for unstable (moz < 0) or stable (moz > 0) conditions.

Expand Down Expand Up @@ -387,7 +391,19 @@ subroutine FrictionVelocity(lbn, ubn, fn, filtern, &
u10(n) = ur(n) - ustar(n)/vkc * (tmp4 - fm(n) + fm10)
fv(n) = ustar(n)
end if


!!! add by Dalei Hao
if (present(landunit_index)) then
do pp = pfti(n),pftf(n)
zeta_patch(pp) = zeta(n)
ustar_patch(pp) = ustar(n)
end do
else
zeta_patch(n) = zeta(n)
ustar_patch(n) = ustar(n)
end if
!!! end

end do

end associate
Expand Down
29 changes: 28 additions & 1 deletion components/clm/src/biogeophys/FrictionVelocityType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ module FrictionVelocityType
real(r8), pointer :: z0hg_col (:) ! col roughness length over ground, sensible heat [m]
real(r8), pointer :: z0qg_col (:) ! col roughness length over ground, latent heat [m]

!!=== Add by Dalei Hao for output =====
real(r8), pointer :: zeta_patch (:) ! dimensionless height used in Monin-Obukhov theory
real(r8), pointer :: ustar_patch (:) ! friction velocity [m/s]
!!=== End
contains

procedure, public :: Init
Expand Down Expand Up @@ -105,6 +109,12 @@ subroutine InitAllocate(this, bounds)
allocate(this%z0qg_col (begc:endc)) ; this%z0qg_col (:) = nan
allocate(this%z0hg_col (begc:endc)) ; this%z0hg_col (:) = nan


!!! add by Dalei Hao
allocate(this%zeta_patch (begp:endp)) ; this%zeta_patch (:) = nan
allocate(this%ustar_patch (begp:endp)) ; this%ustar_patch (:) = nan
!!!

end subroutine InitAllocate

!-----------------------------------------------------------------------
Expand Down Expand Up @@ -152,7 +162,24 @@ subroutine InitHistory(this, bounds)
call hist_addfld1d (fname='U10', units='m/s', &
avgflag='A', long_name='10-m wind', &
ptr_patch=this%u10_clm_patch)


!!! add by Dalei hao
this%zeta_patch(begp:endp) = spval
call hist_addfld1d (fname='zeta_patch', units='unitless', &
avgflag='A', long_name='dimensionless height used in Monin-Obukhov theory', &
ptr_patch=this%zeta_patch, default='inactive')

this%ustar_patch(begp:endp) = spval
call hist_addfld1d (fname='ustar_patch', units='m/s', &
avgflag='A', long_name='friction velocity [m/s]', &
ptr_patch=this%ustar_patch, default='inactive')

this%fv_patch(begp:endp) = spval
call hist_addfld1d (fname='FV', units='m/s', &
avgflag='A', long_name='friction velocity for dust model', &
ptr_patch=this%fv_patch, default='inactive')
!!! end

if (use_cn) then
this%u10_patch(begp:endp) = spval
call hist_addfld1d (fname='U10_DUST', units='m/s', &
Expand Down
4 changes: 2 additions & 2 deletions components/clm/src/biogeophys/PhotosynthesisType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ subroutine InitHistory(this, bounds)
avgflag='A', long_name='Product-limited photosynthesis', &
ptr_patch=this%fpsn_wp_patch, set_lake=0._r8, set_urb=0._r8)

if (use_cn) then
! if (use_cn) then
this%psnsun_patch(begp:endp) = spval
call hist_addfld1d (fname='PSNSUN', units='umolCO2/m^2/s', &
avgflag='A', long_name='sunlit leaf photosynthesis', &
Expand All @@ -265,7 +265,7 @@ subroutine InitHistory(this, bounds)
call hist_addfld1d (fname='PSNSHA', units='umolCO2/m^2/s', &
avgflag='A', long_name='shaded leaf photosynthesis', &
ptr_patch=this%psnsha_patch)
end if
! end if

if ( use_c13 ) then
this%c13_psnsun_patch(begp:endp) = spval
Expand Down
Loading

0 comments on commit 5ba3819

Please sign in to comment.