-
Notifications
You must be signed in to change notification settings - Fork 133
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
Changes from 9 commits
cd863c4
aa871ef
d602c2c
2da0b98
dd63009
bd91a7d
b785a57
ffb374d
4cfa3ab
644d324
ef391d5
2c10349
eb58e3f
a44c806
56ccc77
4807cc4
78660ed
1ec0b3f
bee1627
2640405
81b80ba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 (trim(atmbndy) == 'mixed') then | ||
!- Use constant coefficients for sensible and latent heat fluxes | ||
! similar to atmo_boundary_const but using vmag instead of wind | ||
shcoef = (1.20e-3_dbl_kind)*cp_air*rhoa*vmag | ||
lhcoef = (1.50e-3_dbl_kind)*Lheat *rhoa*vmag | ||
else ! 'similarity' | ||
!- Monin-Obukhov similarity theory for boundary layer | ||
shcoef = rhoa * ustar * cp * rh + c1 | ||
lhcoef = rhoa * ustar * Lheat * re | ||
endif | ||
|
||
!------------------------------------------------------------ | ||
! Compute diagnostics: 2m ref T, Q, U | ||
|
@@ -942,6 +950,10 @@ subroutine icepack_atm_boundary(sfctype, & | |
|
||
Cdn_atm_ratio_n = c1 | ||
|
||
if (trim(atmbndy) == 'default') then | ||
atmbndy = 'similarity' ! For backward compability only ... | ||
endif | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a good idea to keep backwards compatibility. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI. It is also done in CICE. So running CICE, you'll never ends up here - unless it is later changed in CICE. |
||
if (trim(atmbndy) == 'constant') then | ||
call atmo_boundary_const (sfctype, calc_strair, & | ||
uatm, vatm, & | ||
|
@@ -952,7 +964,8 @@ subroutine icepack_atm_boundary(sfctype, & | |
delt, delq, & | ||
lhcoef, shcoef ) | ||
if (icepack_warnings_aborted(subname)) return | ||
else ! default | ||
elseif (trim(atmbndy) == 'similarity' .or. & | ||
trim(atmbndy) == 'mixed') then | ||
call atmo_boundary_layer (sfctype, & | ||
calc_strair, formdrag, & | ||
Tsf, potT, & | ||
|
@@ -971,6 +984,10 @@ subroutine icepack_atm_boundary(sfctype, & | |
uvel=l_uvel, vvel=l_vvel, & | ||
Uref=l_Uref, zlvs=zlvs) | ||
if (icepack_warnings_aborted(subname)) return | ||
else | ||
call icepack_warnings_add( & | ||
subname//' atmbndy = '//trim(atmbndy)//' : unknown value') | ||
call icepack_warnings_setabort(.true.,__FILE__,__LINE__) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... and the same thing here, maybe checking for unknown values should also be in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I raised this issue too. We don't generally check "valid values" in Icepack. There is quite a bit of that in CICE and the icepack driver. However, users that incorporate Icepack in their own driver (like E3SM) will have to implement their own checking and won't be able to rely on Icepack to let them know if something is "off". We might want to think about implementing explicit checks for Icepack arguments where it makes sense and is easy. The would be a significant change but probably wouldn't change the model cost if done well (like checking values only when they are initialized/set or adding appropriate aborts in existing if logic). But I think that is something we should discuss more broadly, create an issue if needed, and agree on general strategy before moving forward. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, no need to do this check here, or even in this PR. In my opinion it would be better to keep the original behavior (just the 'else' without values) so that 'similarity' or 'mixed' (or 'default' / anything else) would all work. Long ago, I treated default conditions in the code as exactly that -- it didn't matter what the flag was set to -- as long as it wasn't something specific (like 'constant') then the code would execute the default behavior. Setting the flag to 'default' in the namelist file only made that explicit. We seem to be moving to a more rigorous implementation, which is fine. I prefer to do namelist value checking upon initialization, for better efficiency during the timestepping. As @apcraig says, it's better for now to plan to address this value-checking issue more generally and not worry about it here. The easiest thing to do now is keep the original behavior. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated without checking |
||
endif ! atmbndy | ||
|
||
if (present(Uref)) then | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -250,7 +250,7 @@ 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 = 'similarity' ! atmo boundary method, 'similarity' ('ccsm3'), 'constant' or 'mixed' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we should use this opportunity ("while we're here" kind of thing) to remove the In fact it dates back to this commit: CICE-Consortium/CICE-svn-trunk@dfa799d and so it was never an acceptable value at all! |
||
|
||
logical (kind=log_kind), public :: & | ||
calc_strair = .true. , & ! if true, calculate wind stress | ||
|
@@ -646,12 +646,12 @@ 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' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
||
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 | ||
highfreq_in ! if true, use high frequency coupling | ||
|
||
integer (kind=int_kind), intent(in), optional :: & | ||
natmiter_in ! number of iterations for boundary layer calculations | ||
|
@@ -1326,12 +1326,12 @@ 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 | ||
highfreq_out ! if true, use high frequency coupling | ||
|
||
integer (kind=int_kind), intent(out), optional :: & | ||
natmiter_out ! number of iterations for boundary layer calculations | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ kstrength = 0 | |
krdg_partic = 0 | ||
krdg_redist = 0 | ||
formdrag = .false. | ||
atmbndy = 'constant' | ||
atmbndy = 'similarity' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This changes the behavior of at least one test in the test suites. Is that intended? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was an error from my site. Will revert atmbndy to constant |
||
highfreq = .false. |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -314,8 +314,10 @@ forcing_nml | |||||
:widths: 15, 15, 30, 15 | ||||||
|
||||||
"", "", "", "" | ||||||
"``atmbndy``", "``constant``", "bulk transfer coefficients", "``default``" | ||||||
"", "``default``", "stability-based boundary layer", "" | ||||||
"``atmbndy``", "string", "bulk transfer coefficients", "``similarity``" | ||||||
"", "``similarity``", "stability-based boundary layer", "" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe here we could add something like
Suggested change
to help users that could be confused by their existing namelist having a now undocumented There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From CICE this is automatically changed from 'default' to 'similarity' together with a WARNING message printed to the log/stdout. |
||||||
"", "``constant``", "constant-based boundary layer", "" | ||||||
"", "``mixed``", "stability-based, but constant for sensible+latent heatfluxes", "" | ||||||
"``atmiter_conv``", "real", "convergence criteria for ustar", "0.0" | ||||||
"``atm_data_file``", "string", "file containing atmospheric data", "' '" | ||||||
"``atm_data_format``", "``bin``", "read direct access binary forcing files", "``bin``" | ||||||
|
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 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.
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.
Good point w.r.t. secure code for future errors by placing the identical parameters in one place.
Will introduce p0012 and p0015.