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

Surface roughness modifications #1596

Closed
wants to merge 52 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
7e5d438
Adapted model to machine and added soil column separation and local t…
Mar 25, 2021
db0b16f
Saving current state
Apr 27, 2021
492c158
Saving state
May 7, 2021
def8ee3
Saving state
May 17, 2021
4018d56
Saving state
May 26, 2021
4a52aa7
Saving state
Jun 14, 2021
e78b02f
Saving state
Jun 16, 2021
37d7d0c
Saving state
Jun 24, 2021
d218ff5
Saving state
Jul 28, 2021
fc20d00
State at first submission
Aug 25, 2021
2e7b2c3
For PR
Jan 6, 2022
864f336
Removing statements of sensitivity experiments. Add more comments fol…
Jan 12, 2022
8318cad
Small correction to proposed statement in CanopyFluxes
Jan 12, 2022
c611d6e
Add user-mod directories for the surface roughness changes from Ronny…
ekluzek Jan 13, 2022
9ae6e30
Remove use_z0v_forest because it's not connected to anything in the F…
ekluzek Jan 13, 2022
0ee8c69
Handle very small values of htop and snowmelt_accum with new Meier202…
ekluzek Jan 13, 2022
02be2d8
Don't set z0mg and displa on first step of run for RonnyMeier2022 rou…
ekluzek Jan 14, 2022
0b7fd39
Skip first few steps as htop isn't set until after first do_alb step
ekluzek Feb 19, 2022
0e71cb2
Correct subscript
ekluzek Feb 20, 2022
84396e6
Add write of rh if negative or over 100 when DEBUG on
ekluzek Feb 22, 2022
23601a7
Write out warning if ustar*thvstar is positive to prevent a cube root…
ekluzek Feb 22, 2022
4eabfbb
Set human stress indices to calculate NONE when Meier surface roughne…
ekluzek Feb 22, 2022
f644624
Fix subscript
ekluzek Feb 22, 2022
32dbda8
Rename test mods to highlight these are non-crop cases
ekluzek Feb 22, 2022
b9d402a
Add tests with Meier surface roughness
ekluzek Feb 23, 2022
8789ca2
Add a bit to not die if htop is zero and it's crop and beginning of t…
ekluzek Feb 23, 2022
821df3c
Correct new testname, and add two tests to the expected fails
ekluzek Feb 23, 2022
d3dee39
Change MeierXXXX namelist to Meier2022
ekluzek Feb 23, 2022
95fb900
Remove commented out line
ekluzek Feb 23, 2022
b0f2856
Remove local time history changes as they are treated seperately in #…
ekluzek Feb 23, 2022
c7ade8d
Remove soil columns on a seperate soil column as handled in #1249
ekluzek Feb 23, 2022
684d61b
Merge tag 'ctsm5.1.dev077'
ekluzek Feb 23, 2022
7916475
Add more compilers for the surf roughness changes
ekluzek Feb 23, 2022
b531f92
Changes to get the updated code to compile on cheyenne_gnu
ekluzek Feb 24, 2022
6e31171
Changes needed to work with nag compiler on izumi, negative sign need…
ekluzek Feb 25, 2022
f0fe877
Update paramsfile for Meier surface roughness changes to latest version
ekluzek Mar 4, 2022
cf0934b
Some updates from @olyson that get more tests to work
ekluzek Mar 8, 2022
7570395
Merge branch 'main' of github.com:RonnyMeier/CTSM into main
ekluzek Mar 8, 2022
1f1cce9
Update forcing height variables and rename/move snomelt_accum to Wate…
olyson Mar 14, 2022
546f615
Merge branch 'main' of https://www.github.com/RonnyMeier/ctsm
olyson Mar 14, 2022
382441c
Add forcing height change back into CanopyFluxesMod after rebase.
olyson Mar 14, 2022
e7579c9
Encapsulated forcing height update in Meier2022 to maintain bfb with …
olyson Mar 15, 2022
902f1cb
Update forcing heights and restrict zeta to less than 20 for now
olyson Mar 21, 2022
46e2dad
Revert restriction on zeta in FrictionVelocityMod
olyson May 17, 2022
189f9f9
Remove restriction on calc_human_stress_indices
olyson Jun 10, 2022
c08d09d
Change zetamaxstable for z0param_method == 'Meier2022' to 2.0
olyson Jun 10, 2022
6be9820
Make zeta a global variable and fix zetamaxstable namelist
olyson Jun 13, 2022
ed9610b
Remove use_z0mg_2d code to read in roughness from surface dataset tha…
ekluzek Oct 18, 2022
0badb30
Remove more use_z0mg_2d
ekluzek Oct 18, 2022
357fea5
Correct so will compile
ekluzek Oct 19, 2022
a924de8
Merge branch 'main' of github.com:RonnyMeier/CTSM into main
ekluzek Oct 19, 2022
e5cd7b0
Use parenthesis to clarify statement as required by the nag compiler …
ekluzek Oct 19, 2022
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
18 changes: 18 additions & 0 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1503,6 +1503,7 @@ sub process_namelist_inline_logic {
setup_logic_supplemental_nitrogen($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_snowpack($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_fates($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_z0param($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_misc($opts, $nl_flags, $definition, $defaults, $nl);

#########################################
Expand Down Expand Up @@ -3892,6 +3893,23 @@ sub setup_logic_fates {

#-------------------------------------------------------------------------------

sub setup_logic_z0param {
#
# Set default z0 paramterization
#
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;

add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'z0param_method');

my $z0param_method = remove_leading_and_trailing_quotes($nl->get_value('z0param_method' ));
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_z0m_snowmelt',
'z0param_method'=>$z0param_method );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_z0mg_2d',
'z0param_method'=>$z0param_method );
}

#-------------------------------------------------------------------------------

sub setup_logic_misc {
#
# Set some misc options
Expand Down
20 changes: 20 additions & 0 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<use_bedrock phys="clm5_0" vichydro ="1" >.false.</use_bedrock>
<use_bedrock phys="clm5_0" >.true.</use_bedrock>
<use_bedrock phys="clm4_5" >.false.</use_bedrock>
<use_individual_pft_soil_column>.false.</use_individual_pft_soil_column>

<!-- Rooting profile namelist defaults -->
<rooting_profile_method_water phys="clm5_1" >1</rooting_profile_method_water>
Expand Down Expand Up @@ -318,6 +319,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<itmax_canopy_fluxes structure="standard">40</itmax_canopy_fluxes>
<itmax_canopy_fluxes structure="fast" >3</itmax_canopy_fluxes>


<!-- Canopy hydrology namelist defaults -->
<use_clm5_fpi phys="clm5_1" >.true.</use_clm5_fpi>
<interception_fraction phys="clm5_1" >1.0</interception_fraction>
Expand Down Expand Up @@ -483,6 +485,22 @@ attributes from the config_cache.xml file (with keys converted to upper-case).

<fates_paramfile>lnd/clm2/paramdata/fates_params_api.14.0.0_12pft_c200921.nc</fates_paramfile>

<!-- ================================================================== -->
<!-- Default surface roughness parameterization -->
<!-- ================================================================== -->

<z0param_method>ZengWang2007</z0param_method>

<use_z0m_snowmelt z0param_method="MeierXXXX" >.true.</use_z0m_snowmelt>
<use_z0m_snowmelt z0param_method="ZengWang2007" >.false.</use_z0m_snowmelt>
<use_z0m_snowmelt >.false.</use_z0m_snowmelt>

<use_z0mg_2d z0param_method="MeierXXXX" >.true.</use_z0mg_2d>
<use_z0mg_2d z0param_method="ZengWang2007" >.false.</use_z0mg_2d>
<use_z0mg_2d >.true.</use_z0mg_2d>



<!-- ======================================================================================== -->
<!-- clm 5.0 BGC nitrogen model -->
<!-- ======================================================================================== -->
Expand Down Expand Up @@ -1075,6 +1093,8 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_C24_hist_78pfts_CMIP6_simyr2000
lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.9x1.25_hist_78pfts_CMIP6_simyr2000_c190214.nc</fsurdat>
<fsurdat hgrid="1.9x2.5" sim_year="2000" use_crop=".true." >
lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_1.9x2.5_hist_78pfts_CMIP6_simyr2000_c190304.nc</fsurdat>
<fsurdat hgrid="hcru_hcru" sim_year="2000">
lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_360x720cru_78pfts_CMIP6_simyr2000_c170824.nc</fsurdat>
<fsurdat hgrid="0.125x0.125" sim_year="2000" use_crop=".true." >
lnd/clm2/surfdata_map/release-clm5.0.24/surfdata_0.125x0.125_hist_78pfts_CMIP6_simyr2005_c190624.nc</fsurdat>
<fsurdat hgrid="10x15" sim_year="2000" use_crop=".true." >
Expand Down
37 changes: 35 additions & 2 deletions bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ User-defined number of soil layers required to be set in the namelist when the u
<default>Default: iundef</default>
</entry>

<entry id="use_individual_pft_soil_column" type="logical" category="clm_physics"
group="clm_inparm" valid_values="" >
If TRUE, each pft exists on a separate soil column.
</entry>

<entry id="use_bedrock" type="logical" category="clm_physics"
group="clm_inparm" valid_values="" >
If TRUE, use variable soil depth.
Expand Down Expand Up @@ -335,6 +340,10 @@ If TRUE use the undercanopy stability term used with CLM4.5 (Sakaguchi&amp;Zeng,
group="canopyfluxes_inparm" valid_values="" >
If TRUE, include biomass heat storage in canopy energy balance.

<entry id="use_z0v_forest" type="logical" category="clm_physics"
group="canopyfluxes_inparm" valid_values="" >
If TRUE, use new parameterization of vegetation surface roughness for forests.

<entry id="itmax_canopy_fluxes" type="integer" category="clm_physics"
group="canopyfluxes_inparm">
Max number of iterations used in subr. CanopyFluxes. For many years, 40 was the hardwired default value.
Expand Down Expand Up @@ -763,8 +772,8 @@ SNICAR (SNow, ICe, and Aerosol Radiative model) snow aging data file name
If TRUE, write master field list to separate file for documentation purposes
</entry>

<entry id="hist_avgflag_pertape" type="char*1(10)" category="history"
group="clm_inparm" valid_values="A,I,X,M" >
<entry id="hist_avgflag_pertape" type="char*10(10)" category="history"
group="clm_inparm" valid_values="" >
Per file averaging flag.
'A' (average over history period)
'I' (instantaneous)
Expand Down Expand Up @@ -2713,6 +2722,30 @@ the related bulk quantities.
If .true., run with water isotopes
</entry>

<!-- ======================================================================================== -->
<!-- Namelist options related to surface roughness -->
<!-- ======================================================================================== -->

<entry id="z0param_method" type="char*64" category="clm_physics"
group="clm_inparm" valid_values="ZengWang2007,MeierXXXX" >
Parameterization/parameters to use for surface roughness
ZengWang2007: Zeng and Wang 2007
MeierXXXX: Meier et al. in prep.
</entry>

<entry id="use_z0m_snowmelt" type="logical" category="clm_physics"
group="clm_inparm" valid_values="" >
If FALSE use constant snow z0m
If TRUE use parameterization of snow z0m as a function of accumulated
snow melt of Brock et al. (2006)
</entry>

<entry id="use_z0mg_2d" type="logical" category="clm_physics"
group="clm_inparm" valid_values="" >
If FALSE use constant ground z0m
If TRUE use spatially explicit ground z0m from Prigent et al. (2005)
</entry>

<!-- ======================================================================================== -->
<!-- Namelist options related to initInterp -->
<!-- ======================================================================================== -->
Expand Down
44 changes: 37 additions & 7 deletions src/biogeophys/BareGroundFluxesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ subroutine BareGroundFluxes(bounds, num_noexposedvegp, filter_noexposedvegp, &
atm2lnd_inst, soilstate_inst, &
frictionvel_inst, ch4_inst, energyflux_inst, temperature_inst, &
waterfluxbulk_inst, waterstatebulk_inst, waterdiagnosticbulk_inst, &
wateratm2lndbulk_inst, photosyns_inst, humanindex_inst)
wateratm2lndbulk_inst, photosyns_inst, humanindex_inst, canopystate_inst)
!
! !DESCRIPTION:
! Compute sensible and latent fluxes and their derivatives with respect
Expand All @@ -81,14 +81,16 @@ subroutine BareGroundFluxes(bounds, num_noexposedvegp, filter_noexposedvegp, &
use shr_const_mod , only : SHR_CONST_RGAS
use clm_varpar , only : nlevgrnd
use clm_varcon , only : cpair, vkc, grav, denice, denh2o
use clm_varctl , only : use_lch4
use clm_varctl , only : use_lch4, z0param_method
use landunit_varcon , only : istsoil, istcrop
use QSatMod , only : QSat
use SurfaceResistanceMod , only : do_soilevap_beta,do_soil_resistance_sl14
use HumanIndexMod , only : all_human_stress_indices, fast_human_stress_indices, &
Wet_Bulb, Wet_BulbS, HeatIndex, AppTemp, &
swbgt, hmdex, dis_coi, dis_coiS, THIndex, &
SwampCoolEff, KtoC, VaporPres
use CanopyStateType , only : canopystate_type

!
! !ARGUMENTS:
type(bounds_type) , intent(in) :: bounds
Expand All @@ -107,13 +109,14 @@ subroutine BareGroundFluxes(bounds, num_noexposedvegp, filter_noexposedvegp, &
type(wateratm2lndbulk_type) , intent(inout) :: wateratm2lndbulk_inst
type(photosyns_type) , intent(inout) :: photosyns_inst
type(humanindex_type) , intent(inout) :: humanindex_inst
type(canopystate_type) , intent(inout) :: canopystate_inst

!
! !LOCAL VARIABLES:
integer, parameter :: niters = 3 ! maximum number of iterations for surface temperature
integer :: p,c,g,f,j,l ! indices
integer :: iter ! iteration index
real(r8) :: zldis(bounds%begp:bounds%endp) ! reference height "minus" zero displacement height [m]
real(r8) :: displa(bounds%begp:bounds%endp) ! displacement height [m]
real(r8) :: zeta ! dimensionless height used in Monin-Obukhov theory
real(r8) :: wc ! convective velocity [m/s]
real(r8) :: dth(bounds%begp:bounds%endp) ! diff of virtual temp. between ref. height and surface
Expand All @@ -137,9 +140,6 @@ subroutine BareGroundFluxes(bounds, num_noexposedvegp, filter_noexposedvegp, &
real(r8) :: raih ! temporary variable [kg/m2/s]
real(r8) :: raiw ! temporary variable [kg/m2/s]
real(r8) :: fm(bounds%begp:bounds%endp) ! needed for BGC only to diagnose 10m wind speed
real(r8) :: z0mg_patch(bounds%begp:bounds%endp)
real(r8) :: z0hg_patch(bounds%begp:bounds%endp)
real(r8) :: z0qg_patch(bounds%begp:bounds%endp)
real(r8) :: e_ref2m ! 2 m height surface saturated vapor pressure [Pa]
real(r8) :: qsat_ref2m ! 2 m height surface saturated specific humidity [kg/kg]
real(r8) :: www ! surface soil wetness [-]
Expand Down Expand Up @@ -240,6 +240,13 @@ subroutine BareGroundFluxes(bounds, num_noexposedvegp, filter_noexposedvegp, &
z0mg_col => frictionvel_inst%z0mg_col , & ! Output: [real(r8) (:) ] roughness length, momentum [m]
z0hg_col => frictionvel_inst%z0hg_col , & ! Output: [real(r8) (:) ] roughness length, sensible heat [m]
z0qg_col => frictionvel_inst%z0qg_col , & ! Output: [real(r8) (:) ] roughness length, latent heat [m]
z0mg_patch => frictionvel_inst%z0mg_patch , & ! Output: [real(r8) (:) ] patch roughness length, momentum [m]
z0hg_patch => frictionvel_inst%z0hg_patch , & ! Output: [real(r8) (:) ] patch roughness length, sensible heat [m]
z0qg_patch => frictionvel_inst%z0qg_patch , & ! Output: [real(r8) (:) ] patch roughness length, latent heat [m]
z0mv => frictionvel_inst%z0mv_patch , & ! Output: [real(r8) (:) ] roughness length over vegetation, momentum [m]
z0hv => frictionvel_inst%z0hv_patch , & ! Output: [real(r8) (:) ] roughness length over vegetation, sensible heat [m]
z0qv => frictionvel_inst%z0qv_patch , & ! Output: [real(r8) (:) ] roughness length over vegetation, latent heat [m]
kbm1 => frictionvel_inst%kbm1_patch , & ! Output: [real(r8) (:) ] natural logarithm of z0mg_p/z0hg_p [-]
ram1 => frictionvel_inst%ram1_patch , & ! Output: [real(r8) (:) ] aerodynamical resistance (s/m)
num_iter => frictionvel_inst%num_iter_patch , & ! Output: [real(r8) (:) ] number of iterations
htvp => energyflux_inst%htvp_col , & ! Input: [real(r8) (:) ] latent heat of evaporation (/sublimation) [J/kg]
Expand All @@ -254,6 +261,8 @@ subroutine BareGroundFluxes(bounds, num_noexposedvegp, filter_noexposedvegp, &
rssun => photosyns_inst%rssun_patch , & ! Output: [real(r8) (:) ] leaf sunlit stomatal resistance (s/m) (output from Photosynthesis)
rssha => photosyns_inst%rssha_patch , & ! Output: [real(r8) (:) ] leaf shaded stomatal resistance (s/m) (output from Photosynthesis)

displa => canopystate_inst%displa_patch , & ! Output: [real(r8) (:) ] displacement height (m)

begp => bounds%begp , &
endp => bounds%endp &
)
Expand Down Expand Up @@ -290,6 +299,10 @@ subroutine BareGroundFluxes(bounds, num_noexposedvegp, filter_noexposedvegp, &
ulrad(p) = 0._r8
dhsdt_canopy(p) = 0._r8
eflx_sh_stem(p) = 0._r8
z0mv(p) = 0._r8
z0hv(p) = 0._r8
z0qv(p) = 0._r8


ur(p) = max(params_inst%wind_min,sqrt(forc_u(g)*forc_u(g)+forc_v(g)*forc_v(g)))
dth(p) = thm(p)-t_grnd(c)
Expand Down Expand Up @@ -329,7 +342,22 @@ subroutine BareGroundFluxes(bounds, num_noexposedvegp, filter_noexposedvegp, &

tstar = temp1(p)*dth(p)
qstar = temp2(p)*dqh(p)
z0hg_patch(p) = z0mg_patch(p) / exp(params_inst%a_coef * (ustar(p) * z0mg_patch(p) / 1.5e-5_r8)**params_inst%a_exp)

select case (z0param_method)
case ('ZengWang2007')
z0hg_patch(p) = z0mg_patch(p) / exp(params_inst%a_coef * (ustar(p) * z0mg_patch(p) / 1.5e-5_r8)**params_inst%a_exp)
case ('MeierXXXX')
! After Yang et al. (2007)
z0hg_patch(p) = 70._r8 * 1.5e-5_r8 / ustar(p) * exp( -7.2_r8 * ustar(p)**(0.5_r8) * (abs(tstar))**(0.25_r8))

! After Owen and Thomson (1963)
ekluzek marked this conversation as resolved.
Show resolved Hide resolved
!z0hg_patch(p) = z0mg_patch(p) / exp(0.52_r8 * 0.4_r8 * (8._r8 * ustar(p) * z0mg_patch(p) / 1.5e-5_r8)**params_inst%a_exp * 0.71_r8**0.8_r8)

! Zeng and Wang (2007) --> Use this for CLM-VEG and CLM-Z0M
!z0hg_patch(p) = z0mg_patch(p) / exp(params_inst%a_coef * (ustar(p) * z0mg_patch(p) / 1.5e-5_r8)**params_inst%a_exp)

end select

z0qg_patch(p) = z0hg_patch(p)
thvstar = tstar*(1._r8+0.61_r8*forc_q(c)) + 0.61_r8*forc_th(c)*qstar
zeta = zldis(p)*vkc*grav*thvstar/(ustar(p)**2*thv(c))
Expand Down Expand Up @@ -433,6 +461,8 @@ subroutine BareGroundFluxes(bounds, num_noexposedvegp, filter_noexposedvegp, &
t_ref2m_r(p) = t_ref2m(p)
end if

kbm1(p) = log(z0mg_patch(p) / z0hg_patch(p))

! Human Heat Stress
if ( all_human_stress_indices .or. fast_human_stress_indices ) then
call KtoC(t_ref2m(p), tc_ref2m(p))
Expand Down
Loading