-
Notifications
You must be signed in to change notification settings - Fork 374
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
Add a new snow thermal conductivity calculation to ELM #6524
Conversation
@trhille please review. |
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 |
There was a problem hiding this comment.
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/ |
There was a problem hiding this comment.
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.
There was a problem hiding this 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)) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
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.
based on Fourteau, et al. (2021) - is now density and temp dependent
c02efdf
to
a4e9c06
Compare
There was a problem hiding this 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.
! 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) |
There was a problem hiding this comment.
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.
There was a problem hiding this 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!
…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]
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]