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

sensible+latent heatfluxes using linear bulk formula #371

Merged
merged 21 commits into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
cd863c4
'heatflux_linear' flag: sensible+latent heatfluxes using traditional …
mhrib Sep 14, 2021
aa871ef
ERROR correction: heatflux_linear is logical
mhrib Sep 14, 2021
d602c2c
ERROR/syntax correction.
mhrib Sep 14, 2021
2da0b98
Add option atmbndy='mixed' boundary layer condition
mhrib Sep 15, 2021
dd63009
For 'atmbndy': change 'default' (obsolete) to 'similarity'. Same physics
mhrib Sep 15, 2021
bd91a7d
For 'atmbndy': change 'default' (obsolete) to 'similarity'. Same physics
mhrib Sep 15, 2021
b785a57
New options for 'atmbndy'
mhrib Sep 15, 2021
ffb374d
"atmbndy" options: 'similarity', 'constant', 'mixed'
mhrib Sep 16, 2021
4cfa3ab
Abort if "atmbndy" option is unknown + set default=similarity for bac…
mhrib Sep 16, 2021
644d324
Update doc/source/science_guide/sg_boundary_forcing.rst
mhrib Sep 16, 2021
ef391d5
atmbndy option 'ccsm' not an option. Previous given as 'default'
mhrib Sep 16, 2021
2c10349
namelist parameter plus string inside double quotes
mhrib Sep 16, 2021
eb58e3f
Merge branch 'Icepack' of https://github.com/mhrib/Icepack into Icepack
mhrib Sep 16, 2021
a44c806
Re-interduce file, after accidentally git rm command
mhrib Sep 16, 2021
56ccc77
Remove "ccsm" as an option to atmbndy
mhrib Sep 16, 2021
4807cc4
atmbndy: 'constant' or 'mixed'. Anything else end in 'similarity' beh…
mhrib Sep 17, 2021
78660ed
Error correction. Revert atmbndy to constant as before
mhrib Sep 20, 2021
1ec0b3f
Put constants intp icepack_parameters
mhrib Sep 20, 2021
bee1627
Introduce p0012, p0015 from icepack_parameters
mhrib Sep 20, 2021
2640405
Changed p0012/p0015 to specific constants senscoef/latncoef
mhrib Sep 23, 2021
81b80ba
senscoef/latncoef introduced
mhrib Sep 23, 2021
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
14 changes: 11 additions & 3 deletions columnphysics/icepack_atmo.F90
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module icepack_atmo
use icepack_parameters, only: cp_wv, cp_air, iceruf, zref, qqqice, TTTice, qqqocn, TTTocn
use icepack_parameters, only: Lsub, Lvap, vonkar, Tffresh, zvir, gravit
use icepack_parameters, only: pih, dragio, rhoi, rhos, rhow
use icepack_parameters, only: atmbndy, calc_strair, formdrag
use icepack_parameters, only: atmbndy, heatflux_linear, calc_strair, formdrag
use icepack_tracers, only: n_iso
use icepack_tracers, only: tr_iso
use icepack_warnings, only: warnstr, icepack_warnings_add
Expand Down Expand Up @@ -359,8 +359,16 @@ subroutine atmo_boundary_layer (sfctype, &
! as in Jordan et al (JGR, 1999)
!------------------------------------------------------------

shcoef = rhoa * ustar * cp * rh + c1
lhcoef = rhoa * ustar * Lheat * re
if (heatflux_linear) then
!- Use constant coefficients for sensible and latent heat fluxes
! similar to atmo_boundary_const but using (wind-Vice) instead of wind-only
shcoef = (1.20e-3_dbl_kind)*cp_air*rhoa*vmag
lhcoef = (1.50e-3_dbl_kind)*Lheat *rhoa*vmag
Copy link
Contributor

@proteanplanet proteanplanet Sep 17, 2021

Choose a reason for hiding this comment

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

If possible, please remove literal constants from the code (here 1.20e-3_dbl_kind and 1.50e-3_dbl_kind) and place them in the Icepack constants file. I appreciate this is already done in atmo_boundary_const, but if we leave two sets of identical literal constants in the code, the code is susceptible to errors creeping in if further changes are made by another developer to just one set of constants.

Copy link
Contributor Author

@mhrib mhrib Sep 20, 2021

Choose a reason for hiding this comment

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

Good point w.r.t. secure code for future errors by placing the identical parameters in one place.
Will introduce p0012 and p0015.

else
!- Use Jordan et al (JGR, 1999) formulation
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove the ref to Jordan in the comment. That's referring to a small modification of the overall turbulent heat flux calculation, which came from somewhere else (documented in readthedocs, I hope).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done...

shcoef = rhoa * ustar * cp * rh + c1
lhcoef = rhoa * ustar * Lheat * re
endif

!------------------------------------------------------------
! Compute diagnostics: 2m ref T, Q, U
Expand Down
28 changes: 17 additions & 11 deletions columnphysics/icepack_parameters.F90
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,12 @@ module icepack_parameters
TTTocn = 5107.4_dbl_kind ! for qsat over ocn

character (len=char_len), public :: &
atmbndy = 'default' ! atmo boundary method, 'default' ('ccsm3') or 'constant'
atmbndy = 'default' ! atmo boundary method, 'default' ('ccsm3') or 'constant'

logical (kind=log_kind), public :: &
calc_strair = .true. , & ! if true, calculate wind stress
formdrag = .false. , & ! if true, calculate form drag
heatflux_linear = .false. , & ! if true, calculate sensible+latent heatfluxes using traditional linear bulk formula
Copy link
Contributor

Choose a reason for hiding this comment

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

As noted in the CICE PR, maybe there could be a third option for atmbndy instead of the new heatflux_linear flag.

Copy link
Contributor

Choose a reason for hiding this comment

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

If a namelist/argument exists that we can leverage to set this new option, that's preferable to creating a new namelist/argument when it makes sense.

Copy link
Contributor Author

@mhrib mhrib Sep 15, 2021

Choose a reason for hiding this comment

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

Rewritten using 'atmbndy' namelist variable as suggested.

highfreq = .false. ! if true, calculate high frequency coupling

integer (kind=int_kind), public :: &
Expand Down Expand Up @@ -446,7 +447,7 @@ subroutine icepack_init_parameters( &
albicev_in, albicei_in, albsnowv_in, &
ahmax_in, R_ice_in, R_pnd_in, R_snw_in, dT_mlt_in, rsnw_mlt_in, &
kalg_in, kstrength_in, krdg_partic_in, krdg_redist_in, mu_rdg_in, &
atmbndy_in, calc_strair_in, formdrag_in, highfreq_in, natmiter_in, &
atmbndy_in, heatflux_linear_in, calc_strair_in, formdrag_in, highfreq_in, natmiter_in, &
atmiter_conv_in, calc_dragio_in, &
tfrz_option_in, kitd_in, kcatbound_in, hs0_in, frzpnd_in, &
floeshape_in, wave_spec_in, wave_spec_type_in, nfreq_in, &
Expand Down Expand Up @@ -646,12 +647,13 @@ subroutine icepack_init_parameters( &
TTTocn_in ! for qsat over ocn

character (len=*), intent(in), optional :: &
atmbndy_in ! atmo boundary method, 'default' ('ccsm3') or 'constant'
atmbndy_in ! atmo boundary method, 'default' ('ccsm3') or 'constant'
Copy link
Member

Choose a reason for hiding this comment

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

Sorry to be picky, would it be possible to not introduce whitespace changes ? It adds noise to the diff (even though we can hide it in the GitHub UI or with git diff options, it is still an additional step to take).


logical (kind=log_kind), intent(in), optional :: &
calc_strair_in, & ! if true, calculate wind stress components
formdrag_in, & ! if true, calculate form drag
highfreq_in ! if true, use high frequency coupling
calc_strair_in, & ! if true, calculate wind stress components
formdrag_in, & ! if true, calculate form drag
heatflux_linear_in, & ! if true, calculate sensible+latent heatfluxes using traditional linear bulk formula
highfreq_in ! if true, use high frequency coupling

integer (kind=int_kind), intent(in), optional :: &
natmiter_in ! number of iterations for boundary layer calculations
Expand Down Expand Up @@ -902,6 +904,7 @@ subroutine icepack_init_parameters( &
if (present(krdg_redist_in) ) krdg_redist = krdg_redist_in
if (present(mu_rdg_in) ) mu_rdg = mu_rdg_in
if (present(atmbndy_in) ) atmbndy = atmbndy_in
if (present(heatflux_linear_in) ) heatflux_linear = heatflux_linear_in
if (present(calc_strair_in) ) calc_strair = calc_strair_in
if (present(formdrag_in) ) formdrag = formdrag_in
if (present(highfreq_in) ) highfreq = highfreq_in
Expand Down Expand Up @@ -1117,7 +1120,7 @@ subroutine icepack_query_parameters( &
albsnowi_out, ahmax_out, R_ice_out, R_pnd_out, R_snw_out, dT_mlt_out, &
rsnw_mlt_out, dEdd_algae_out, &
kalg_out, kstrength_out, krdg_partic_out, krdg_redist_out, mu_rdg_out, &
atmbndy_out, calc_strair_out, formdrag_out, highfreq_out, natmiter_out, &
atmbndy_out, heatflux_linear_out, calc_strair_out, formdrag_out, highfreq_out, natmiter_out, &
atmiter_conv_out, calc_dragio_out, &
tfrz_option_out, kitd_out, kcatbound_out, hs0_out, frzpnd_out, &
floeshape_out, wave_spec_out, wave_spec_type_out, nfreq_out, &
Expand Down Expand Up @@ -1326,12 +1329,13 @@ subroutine icepack_query_parameters( &
TTTocn_out ! for qsat over ocn

character (len=*), intent(out), optional :: &
atmbndy_out ! atmo boundary method, 'default' ('ccsm3') or 'constant'
atmbndy_out ! atmo boundary method, 'default' ('ccsm3') or 'constant'

logical (kind=log_kind), intent(out), optional :: &
calc_strair_out, & ! if true, calculate wind stress components
formdrag_out, & ! if true, calculate form drag
highfreq_out ! if true, use high frequency coupling
calc_strair_out, & ! if true, calculate wind stress components
formdrag_out, & ! if true, calculate form drag
heatflux_linear_out, & ! if true, calculate sensible+latent heatfluxes using traditional linear bulk formula
highfreq_out ! if true, use high frequency coupling

integer (kind=int_kind), intent(out), optional :: &
natmiter_out ! number of iterations for boundary layer calculations
Expand Down Expand Up @@ -1622,6 +1626,7 @@ subroutine icepack_query_parameters( &
if (present(krdg_redist_out) ) krdg_redist_out = krdg_redist
if (present(mu_rdg_out) ) mu_rdg_out = mu_rdg
if (present(atmbndy_out) ) atmbndy_out = atmbndy
if (present(heatflux_linear_out) ) heatflux_linear = heatflux_linear
if (present(calc_strair_out) ) calc_strair_out = calc_strair
if (present(formdrag_out) ) formdrag_out = formdrag
if (present(highfreq_out) ) highfreq_out = highfreq
Expand Down Expand Up @@ -1826,6 +1831,7 @@ subroutine icepack_write_parameters(iounit)
write(iounit,*) " krdg_redist = ", krdg_redist
write(iounit,*) " mu_rdg = ", mu_rdg
write(iounit,*) " atmbndy = ", atmbndy
write(iounit,*) " heatflux_linear = ", heatflux_linear
write(iounit,*) " calc_strair = ", calc_strair
write(iounit,*) " formdrag = ", formdrag
write(iounit,*) " highfreq = ", highfreq
Expand Down
10 changes: 6 additions & 4 deletions configuration/driver/icedrv_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ subroutine input_data
! Flux convergence tolerance
real (kind=dbl_kind) :: atmiter_conv

logical (kind=log_kind) :: calc_Tsfc, formdrag, highfreq, calc_strair, calc_dragio
logical (kind=log_kind) :: calc_Tsfc, formdrag, highfreq, calc_strair, calc_dragio, &
heatflux_linear
logical (kind=log_kind) :: conserv_check

integer (kind=int_kind) :: ntrcr
Expand Down Expand Up @@ -166,7 +167,7 @@ subroutine input_data
update_ocn_f, l_mpond_fresh, ustar_min, &
fbot_xfer_type, oceanmixed_ice, emissivity, &
formdrag, highfreq, natmiter, &
atmiter_conv, calc_dragio, &
atmiter_conv, calc_dragio, heatflux_linear, &
tfrz_option, default_season, wave_spec_type, &
precip_units, fyear_init, ycycle, &
atm_data_type, ocn_data_type, bgc_data_type, &
Expand Down Expand Up @@ -200,7 +201,7 @@ subroutine input_data
R_snw_out=R_snw, dT_mlt_out=dT_mlt, rsnw_mlt_out=rsnw_mlt, &
kstrength_out=kstrength, krdg_partic_out=krdg_partic, &
krdg_redist_out=krdg_redist, mu_rdg_out=mu_rdg, &
atmbndy_out=atmbndy, calc_strair_out=calc_strair, &
atmbndy_out=atmbndy, heatflux_linear_out=heatflux_linear, calc_strair_out=calc_strair, &
formdrag_out=formdrag, highfreq_out=highfreq, &
emissivity_out=emissivity, &
kitd_out=kitd, kcatbound_out=kcatbound, hs0_out=hs0, &
Expand Down Expand Up @@ -704,6 +705,7 @@ subroutine input_data

write(nu_diag,1030) ' atmbndy = ', &
trim(atmbndy)
write(nu_diag,1010) ' heatflux_linear = ', heatflux_linear
write(nu_diag,1010) ' formdrag = ', formdrag
write(nu_diag,1010) ' highfreq = ', highfreq
write(nu_diag,1020) ' natmiter = ', natmiter
Expand Down Expand Up @@ -911,7 +913,7 @@ subroutine input_data
R_snw_in=R_snw, dT_mlt_in=dT_mlt, rsnw_mlt_in=rsnw_mlt, &
kstrength_in=kstrength, krdg_partic_in=krdg_partic, &
krdg_redist_in=krdg_redist, mu_rdg_in=mu_rdg, &
atmbndy_in=atmbndy, calc_strair_in=calc_strair, &
atmbndy_in=atmbndy, heatflux_linear_in=heatflux_linear, calc_strair_in=calc_strair, &
formdrag_in=formdrag, highfreq_in=highfreq, &
emissivity_in=emissivity, &
kitd_in=kitd, kcatbound_in=kcatbound, hs0_in=hs0, &
Expand Down