-
Notifications
You must be signed in to change notification settings - Fork 139
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 #633
Conversation
…linear bulk formula
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 see any major problems but have a couple of picky suggestions. Please remove the word "traditional" everywhere and use "linear bulk formula" for the PR title. Also, the heatflux_linear flag does't apply to all heat fluxes, so let's find a more specific name for it. I usually refer to sensible+latent as the turbulent heat fluxes. Could use turbheat_linear or turbheatflux_linear or something like that?
Actually, looking at the Icepack PR, I'm thinking that the namelist flag should instead be an additional option for atmbndy, e.g. instead of 'default' and 'constant, use 'similarity' (referring to Monin-Obukhov similarity theory), 'mixed' and 'constant'. |
If it makes sense to implement the new feature as a new option of an existing namelist and icepack argument, that would be good. |
Good point using an existing namelist argument. I'll look at it using 'atmbndy' namelist parameter instead as suggested by @eclare108213 . Also makes the implementation much more simple. |
Rewritten using 'atmbndy' namelist variable as suggested. |
Update code using 'atmnbdy' which now allows three options: 'similarity' (default), 'constant', or 'mixed' |
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.
This is good. Icepack will need to be updated here after that PR is merged.
I will add one other thing. I think we should continue to support "default", even if it's not documented, for backwards compatibility. On the CICE side, if "default" is set in namelist, on input it should be reset to "similarity" and a brief message written. The same can be done in the Icepack driver. In Icepack, if "default" is passed in, it should treat it the same as "similarity" either by renaming it as it's passed in or by making "default" and "similarity" appear together in all the logic. Actually Icepack probably does this now because.... One other thing that seems to be the case in Icepack, there is no check anywhere that the atmbndy value is reasonable. The only place it's used is in icepack_atmo.F90. The logic there allows any value to be valid. Is that something we can/should improve? That could be either by checking atmbndy value on input to icepack_parameters (which we don't typically do) or by fixing the if/else logic explicitly (in icepack_atmo) adding an abort if the atmbndy is not valid. |
Updated:
|
write(nu_diag,*) subname//' WARNING: atmbndy = default' | ||
write(nu_diag,*) subname//' WARNING: For backward compability, set atmbndy = similarity' |
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.
Small wording suggestion:
write(nu_diag,*) subname//' WARNING: atmbndy = default' | |
write(nu_diag,*) subname//' WARNING: For backward compability, set atmbndy = similarity' | |
write(nu_diag,*) subname//' WARNING: "atmbndy = default" is deprecated, use "atmbndy = similarity"' | |
write(nu_diag,*) subname//' WARNING: setting atmbndy = similarity' |
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.
rewritten
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 have some picky requests re wording in the comments, nothing significant.
if (trim(atmbndy) == 'default') then | ||
tmpstr2 = ' : stability-based boundary layer' | ||
if (trim(atmbndy) == 'constant') then | ||
tmpstr2 = ' : boundary layer uses bulk transfer coefficients' |
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 would change 'bulk' to 'constant' in this line. If I remember correctly, the overall parameterization we use is considered a 'bulk' formulation, and we're just choosing whether the coefficients are constant or not. Anyone please correct me if that's wrong. (And yes I used 'bulk' in the original comment!)
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.
Changed / rewritten
if (trim(atmbndy) == 'similarity') then | ||
tmpstr2 = ' : stability-based boundary layer' | ||
else | ||
tmpstr2 = ' : stability-based boundary layer, but constant for sensible+latent heatfluxes' |
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.
How about
' : stability-based wind stress, constant-coefficient sensible+latent heat fluxes'
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.
Changed / rewritten
"``atmbndy``", "string", "bulk transfer coefficients", "``similarity``" | ||
"", "``similarity``", "stability-based boundary layer", "" | ||
"", "``constant``", "constant-based boundary layer", "" | ||
"", "``mixed``", "stability-based, but constant for sensible+latent heatfluxes", "" |
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.
Likewise,
'stability-based wind stress, constant-coefficient sensible+latent heat fluxes'
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.
Changed / rewritten
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.
Getting close
@@ -1216,8 +1216,8 @@ subroutine input_data | |||
|
|||
if (trim(atmbndy) == 'default') then | |||
if (my_task == master_task) then | |||
write(nu_diag,*) subname//' WARNING: atmbndy = default' | |||
write(nu_diag,*) subname//' WARNING: For backward compability, set atmbndy = similarity' | |||
write(nu_diag,*) subname//' WARNING: "atmbndy = default" is decrecated' |
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.
spelling error: deprecated
Are the double quotes needed in these write statements?
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.
No, double quotes not necessary and removed again. Was introduced as a suggested update, which I may have interpreted incorrectly.
Also update my spelling error.
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.
Thank you!
I've just merged CICE-Consortium/Icepack#371, so now I think you should update Icepack here and then we'll merge this PR. |
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.
Do we need to add a new test case or two? Otherwise, looks good to me.
@apcraig I don't think it is necessary with new testcase, as the default=similarity is exactly the same as previous. |
Can you add those @mhrib? |
@apcraig I am a bit uncertain what to test. All three settings of atmbndy will give different results, but that is on purpose... |
@mhrib, I think you should just add a couple new restart tests with the other atmbndy settings. You should add a set_nml.atmbndyconst and set_nml.atmbndymixed in configuration/scripts/options/. Then you should add two new tests to the base_suite (configurations/scripts/tests/base_suite.ts) that would simply be something like
Then just make sure those tests pass. I think it would be fine to just run each test manually to confirm. The other way to do this is to modify a couple of "alt" tests to add the constant and mixed options to those. That would be more efficient and I would support that assuming it's clear which alt tests would be reasonable to modify. In that case, you'd just modify the set_nml.alt* files and not add the new set_nml files. Either way seems reasonable. Thanks. |
@apcraig Thanks for explanation for creating relevant tests. All test - including the 2 new ones - passes with "SUCCESSFULLY" on the DMI computer (freya), except for three tests. These three unsuccessfully runs all tries to allocate more OpenMP processors than cores/node, which is obviously not valid. Ie. in total 118 good and 3 not started tests from the base_suite tests. So now I think the PR is ready to be merged... |
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 have a slight preference for not having special characters in the set_nml filenames (set_nml.atmbndyconst vs set_nml.atmbndy_const) as I worry about parsing a little and for consistency. But I think this works. Will approve.
@apcraig I have changed to "non-underscore". |
@mhrib Thanks for your patience and diligence, working through all the various requests! This looks good - thanks also for adding this flexibility to the code. |
@eclare108213 I really appreciate the various requests. |
See also:
CICE-Consortium/Icepack#371
PR checklist
For stability boundary layer (atmbndy='default'): Use linear bulk formula for sensible+latent heat fluxes but preserve stress formulation.
@mhrib
@apcraig @eclare108213
19 measured results of 19 total results
19 of 19 tests PASSED
0 of 19 tests PENDING
0 of 19 tests MISSING data
0 of 19 tests FAILED
By introducing the "simpler" linear bulk formula for sensible+latent heat fluxes, but preserve the temperature/humidity formulation for stress, the DMI-HYCOM-CICE (ERA5) code got more stable for long runs (several of years) without significant changes in the overall sea-ice cover/thickness. Without these modifications, the "Flux Error" (ferr) - rarely - became very high in special circumstances with low wind speeds and Tair>Tocn. In these situations the Jordan et al (1999) formulation might have it's limitations. These high Flux Errors seems to dissapear with the simpler formulations for sensible and latent heatfluxes for our setup at least.
The results are not BFB with the new setting turned on. However it is implemented turned off, which results in BFB results compared to the unmodified code.
NOTE: