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

Add a new snow thermal conductivity calculation to ELM #6524

Conversation

chloewhicker
Copy link
Contributor

implemented the new snow thermal conductivity calculation method introduced in Fourteau, et al. (2021) in ELM. This improves the current method, introduced in Jordan (1991) which only depends on the snow density.

More information can be found here: https://acme-climate.atlassian.net/wiki/spaces/FAN/pages/4391501825/Snow+Temperature+and+Density+Dependent+Thermal+Conductivity

relevant nl changes
use_T_rho_dependent_snowthk = .true.
[ELM]
[BFB]
[NML]

@rljacob
Copy link
Member

rljacob commented Aug 15, 2024

@trhille please review.

Comment on lines 958 to 966
k_snw_vals(i) = 2.564 * (bw(c,j)/ rho_ice)**2 - 0.059 * (bw(c,j)/ rho_ice) + 0.0205
else if (i == 2) then
k_snw_vals(i) = 2.172 * (bw(c,j)/ rho_ice)**2 + 0.015 * (bw(c,j)/ rho_ice) + 0.0252
else if (i == 3) then
k_snw_vals(i) = 1.985 * (bw(c,j)/ rho_ice)**2 + 0.073 * (bw(c,j)/ rho_ice) + 0.0336
else if (i == 4) then
k_snw_vals(i) = 1.883 * (bw(c,j)/ rho_ice)**2 + 0.107 * (bw(c,j)/ rho_ice) + 0.0386
else if (i == 5) then
k_snw_vals(i) = 1.776 * (bw(c,j)/ rho_ice)**2 + 0.147 * (bw(c,j)/ rho_ice) + 0.0455
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add _r8 to constants e.g. 2.564_r8 * (bw(c,j)/ rho_ice)**2 - 0.059_r8 * (bw(c,j)/ rho_ice) + 0.0205_r8?

real(r8), parameter :: rho_ice = 917._r8
real(r8) :: k_snw_vals(5)
real(r8) :: k_snw_tmps(5)
data k_snw_tmps(:) /223.0, 248.0, 263.0, 268.0, 273.0/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also add _r8 here.

Copy link
Contributor

@trhille trhille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just have a few stylistic comments.

end if
do i = 1, size(k_snw_tmps) - 1
if (k_snw_tmps(i) <= t_soisno(c,j) .and. t_soisno(c,j) <= k_snw_tmps(i + 1)) then
thk(c,j) = k_snw_vals(i) + (t_soisno(c,j) - k_snw_tmps(i))*(k_snw_vals(i + 1)-k_snw_vals(i))/(k_snw_tmps(i + 1)-k_snw_tmps(i))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if there are ELM conventions that I'm unaware of, but in general it's much easier to read code with consistent use of spaces (or no spaces) around operators.

! Only examine levels from snl(c)+1 -> 0 where snl(c) < 1
if (snl(c)+1 < 1 .AND. (j >= snl(c)+1) .AND. (j <= 0)) then
bw(c,j) = (h2osoi_ice(c,j)+h2osoi_liq(c,j))/(frac_sno(c)*dz(c,j))
thk(c,j) = tkair + (7.75e-5_r8 *bw(c,j) + 1.105e-6_r8*bw(c,j)*bw(c,j))*(tkice-tkair)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above regarding consistent use of spaces.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please space consistently here too.

@@ -943,14 +948,49 @@ subroutine SoilThermProp (bounds, num_nolakec, filter_nolakec, &
endif
endif
endif

if (use_T_rho_dependent_snowthk) then ! chose which snow thermal conductivity to use
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (use_T_rho_dependent_snowthk) then ! chose which snow thermal conductivity to use
if (use_T_rho_dependent_snowthk) then ! choose which snow thermal conductivity to use

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feedback, I made the changes and rebased with master.

@chloewhicker chloewhicker force-pushed the cwhicker/elm/use_use_T_rho_dependent_snowthk_20240719 branch from c02efdf to a4e9c06 Compare August 20, 2024 13:50
Copy link
Contributor

@trhille trhille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chloewhicker, thanks for addressing those. Two more tiny changes and then I'm happy to approve.

components/elm/src/biogeophys/SoilTemperatureMod.F90 Outdated Show resolved Hide resolved
! Only examine levels from snl(c)+1 -> 0 where snl(c) < 1
if (snl(c)+1 < 1 .AND. (j >= snl(c)+1) .AND. (j <= 0)) then
bw(c,j) = (h2osoi_ice(c,j)+h2osoi_liq(c,j))/(frac_sno(c)*dz(c,j))
thk(c,j) = tkair + (7.75e-5_r8 *bw(c,j) + 1.105e-6_r8*bw(c,j)*bw(c,j))*(tkice-tkair)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please space consistently here too.

Copy link
Contributor

@trhille trhille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks, @chloewhicker!

@bishtgautam bishtgautam added the BFB PR leaves answers BFB label Aug 20, 2024
bishtgautam added a commit that referenced this pull request Aug 20, 2024
…into next (PR #6524)

Implemented the new snow thermal conductivity calculation method introduced in
[Fourteau, et al. (2021)](https://tc.copernicus.org/articles/15/2739/2021/) in ELM.
This improves the current method, introduced in [Jordan (1991)](https://erdc-library.erdc.dren.mil/jspui/handle/11681/11677)
which only depends on the snow density.

relevant nl changes
`use_T_rho_dependent_snowthk = .true. `
[ELM]
[BFB]
[NML]
@bishtgautam bishtgautam merged commit 9d6f1e4 into E3SM-Project:master Aug 21, 2024
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BFB PR leaves answers BFB Land
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants