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 #633

Merged
merged 13 commits into from
Sep 27, 2021

Conversation

mhrib
Copy link
Contributor

@mhrib mhrib commented Sep 14, 2021

See also:
CICE-Consortium/Icepack#371

PR checklist

  • Short (1 sentence) summary of your PR:
    For stability boundary layer (atmbndy='default'): Use linear bulk formula for sensible+latent heat fluxes but preserve stress formulation.
  • Developer(s):
    @mhrib
  • Suggest PR reviewers from list in the column to the right.
    @apcraig @eclare108213
  • Please copy the PR test results link or provide a summary of testing completed below.
    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
  • How much do the PR code changes differ from the unmodified code?
    • bit for bit (for default settings)
    • different at roundoff level
    • more substantial
  • Does this PR create or have dependencies on CICE or any other models?
    • Yes
    • No
  • Does this PR add any new test cases?
    • Yes
    • No
  • Is the documentation being updated? ("Documentation" includes information on the wiki or in the .rst files from doc/source/, which are used to create the online technical docs at https://readthedocs.org/projects/cice-consortium-cice/.)
    • Yes
    • No, does the documentation need to be updated at a later time?
      • Yes
      • No
  • Please provide any additional information or relevant details below:

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:

Copy link
Contributor

@eclare108213 eclare108213 left a 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?

@eclare108213
Copy link
Contributor

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'.

@apcraig
Copy link
Contributor

apcraig commented Sep 15, 2021

If it makes sense to implement the new feature as a new option of an existing namelist and icepack argument, that would be good.

@mhrib
Copy link
Contributor Author

mhrib commented Sep 15, 2021

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.

@mhrib
Copy link
Contributor Author

mhrib commented Sep 15, 2021

Rewritten using 'atmbndy' namelist variable as suggested.
Note, that 'ice_in' file has changed default setting atmbndy='similarity' (identical to 'default' in previous version)

@mhrib mhrib changed the title sensible+latent heatfluxes using traditional bulk formula sensible+latent heatfluxes using linear bulk formula Sep 15, 2021
@mhrib
Copy link
Contributor Author

mhrib commented Sep 15, 2021

Update code using 'atmnbdy' which now allows three options: 'similarity' (default), 'constant', or 'mixed'
Also update documentation section 3.4.3.10.forcing_nml and section 5 (index of variables) with the above info

Copy link
Contributor

@eclare108213 eclare108213 left a 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.

@apcraig
Copy link
Contributor

apcraig commented Sep 16, 2021

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.

@mhrib
Copy link
Contributor Author

mhrib commented Sep 16, 2021

Updated:

  1. Update “Atmosphere” section 2.1.1 with almost the suggested text. (in icepack, not here)
  2. Abort if 'atmbndy' setting is unknown (done via. abort in icepack)
  3. For backward compability: 'atmbndy'=default is renamed to similarity. And a WARNING message is given in that case to the log.

Comment on lines 1219 to 1220
write(nu_diag,*) subname//' WARNING: atmbndy = default'
write(nu_diag,*) subname//' WARNING: For backward compability, set atmbndy = similarity'
Copy link
Member

Choose a reason for hiding this comment

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

Small wording suggestion:

Suggested change
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'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

rewritten

Copy link
Contributor

@eclare108213 eclare108213 left a 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'
Copy link
Contributor

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!)

Copy link
Contributor Author

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'
Copy link
Contributor

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'

Copy link
Contributor Author

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", ""
Copy link
Contributor

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'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed / rewritten

Copy link
Contributor

@eclare108213 eclare108213 left a 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'
Copy link
Contributor

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?

Copy link
Contributor Author

@mhrib mhrib Sep 23, 2021

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you!

@eclare108213
Copy link
Contributor

I've just merged CICE-Consortium/Icepack#371, so now I think you should update Icepack here and then we'll merge this PR.

Copy link
Contributor

@apcraig apcraig left a 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.

@mhrib
Copy link
Contributor Author

mhrib commented Sep 24, 2021

@apcraig I don't think it is necessary with new testcase, as the default=similarity is exactly the same as previous.
However if necessary, I think there should be a new testcase for both atmbndy = constant (same as before) AND atmbndy = mixed (new).

@apcraig
Copy link
Contributor

apcraig commented Sep 24, 2021

Can you add those @mhrib?

@mhrib
Copy link
Contributor Author

mhrib commented Sep 25, 2021

@apcraig I am a bit uncertain what to test. All three settings of atmbndy will give different results, but that is on purpose...

@apcraig
Copy link
Contributor

apcraig commented Sep 25, 2021

@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

restart        gx3     12x2        atmbndyconst
restart        gx3      8x2        atmbndymixed

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.

@mhrib
Copy link
Contributor Author

mhrib commented Sep 27, 2021

@apcraig Thanks for explanation for creating relevant tests.
Now adding test-cases following your first approach adding 2x restart tests using atmbndy={constant,mixed} to the base_suite.

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...

Copy link
Contributor

@apcraig apcraig left a 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.

@mhrib
Copy link
Contributor Author

mhrib commented Sep 27, 2021

@apcraig I have changed to "non-underscore".
Not sure I fully understand the problem wrt. underscore "_" in text unless we're talking LaTeX interpretter, text writing in plotting routines etc.. Nevertheless, the functionality remains unchanged.

@eclare108213
Copy link
Contributor

@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 eclare108213 merged commit 6c4160e into CICE-Consortium:master Sep 27, 2021
@mhrib
Copy link
Contributor Author

mhrib commented Sep 28, 2021

@eclare108213 I really appreciate the various requests.
It has ended up in a much simpler solution without introducing an extra namelist parameter as original purposed. Thereby much easier to understand especially in combination with the requested documentation. We at DMI appreciate the inclusion of this new feature, which makes future updates of CICE easier for us. So a win-win for all :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants