Repository navigation
Ocean/gm ismf fixes - #643
Conversation
visbeck + variable c2 not working for ISMF cases yet
Now passes with Visbeck and spatially variable c2.
|
@mark-petersen this fixes the ISMF failures in my testing. Could you please try these changes yourself? Previous failures happen from E3SM master but with One other note, I've only tested in intel with and without debug. I have not tested gnu. |
|
@maltrud and @milenaveneziani I expect changes to water cycle sims to be minimal with these changes the runs will not be BFB. I will rerun the baseline G-case with no redi for comparison. |
|
@jonbob could you post results of your ISMF PEM test here when it finishes? |
|
With config_use_redi = .false.. PASS PEM_P480_Ld5_D.T62_oEC60to30v3wLI.GMPAS-IAF-ISMF.anvil_intel RUN time=2538 My test ran and passed the comparison as well |
jonbob
left a comment
There was a problem hiding this comment.
Passed my test that was previously failing, looks good from a visual inspection
|
@vanroekel could you write a few sentences about what you changed here? Did the analytic equations change for GM kappa and the phase speed, or just the code method to solve it? Can you say what was causing the problem before? I'll give the code a careful read at the same time. |
|
@mark-petersen sure. Here it is This PR does not change the analytic formulation for calculating c^2 or the Visbeck parameterization of Kappa_gm. Instead if fixes a few things and changes one formulation
where minValue = 0.1. in the latest master, N_ref is taken slightly below the ML, whereas in cryo simulations with maint-1.2 N_ref is the max in the entire column. In this PR we keep the scaling above for redi, but when
Unfortunately it's not clear to me what was causing the issue, my guess is that the offsetting of layer thickness was causing the issue but I think it was (1) + (5) primarily, but I think the layer thickness integral played a role too. Let me know if you'd like more. |
| @@ -274,7 +272,20 @@ subroutine ocn_GM_compute_Bolus_velocity(statePool, diagnosticsPool, & | |||
| if (local_config_GM_kappa_lat_depth_variable) then | |||
| !$omp do schedule(runtime) | |||
There was a problem hiding this comment.
needs private (k, maxN, BruntVaisalaFreqTopEdge)
There was a problem hiding this comment.
thanks I will add this
| @@ -49,7 +49,6 @@ module ocn_gm | |||
| logical :: local_config_GM_compute_visbeck | |||
| logical :: local_config_GM_lat_variable_c2 | |||
There was a problem hiding this comment.
These local config variables don't have any explanation of what they do. Most are clear, but would be good to have a sentence on this one. Does it mean that c2 varies with latitude? You could also put the explanation just before this line:
500 if (local_config_GM_lat_variable_c2) then
There was a problem hiding this comment.
My recollection is you and I decided to put them in so we could just have GM configurations in the namelist and not lots of options. Although that only explains the second, not sure why I put a local_config_GM-compute_visbeck in there though. Let me clean this up
There was a problem hiding this comment.
I think it's fine to have local_config variables if they are not meant to be changed by the user. I was saying that there should be a comment explaining what it is, either here, or where it is used in the code.
There was a problem hiding this comment.
@mark-petersen a question for you. Does it matter performance wise if we do a logical comparison for if statements or a string compare? We could remove these local_configs and just use things like
if (config_gm_closure == 'visbeck')
but not sure which is better practice
There was a problem hiding this comment.
makes sense, I agree on that. Let me know what you think about my question just above and I'll add comments and make the other fixes.
There was a problem hiding this comment.
Logical comparisons always better. So either logical flags or if there are multiple choices, setting up enum-like integer parameters as choices are much preferred. Strings must compare every letter and deal with a variety of conditions, terminations, etc.
There was a problem hiding this comment.
@philipwjones is a string compare actually slow enough to matter if it is outside of a cell or edge loop? If so, we can do the string compare on init and replace it with a local logical or index. Doug used to do that, but it leads to confusing code because you need to always trace through extra variables.
There was a problem hiding this comment.
@mark-petersen I think the code right now does the string compare on init and then sets the logicals right?
| RediGMinitValue = 1.0_RKIND | ||
| if (config_GM_closure == 'constant') then | ||
| local_config_GM_lat_variable_c2 = .false. | ||
| local_config_GM_lat_variable_c2 = .true. |
There was a problem hiding this comment.
For constant GM closure, c2 varies with latitude? @vanroekel I'm fine with what you found works best, but could you explain why?
There was a problem hiding this comment.
this is a holdover from my testing. I will revert. Thanks for the catch!
|
@mark-petersen I've tried to make this much clearer and have addressed your comments. Let me know if you have any other suggestions |
MPAS-Ocean: GM fixes This PR brings in a new mpas-source submodule with changes only to the ocean core. In it, integrals for computing GM kappa and the phase speed have been reworked to mitigate failures in ISMF simulations without redi. With this PR all configurations of GM work and the old 3DGM (N2_dependent) is recoverable to its original configuration. This PR will be non BFB in WC and Cryo configs. See MPAS-Dev/MPAS-Model#643 Fixes #3719 [non-BFB] [NML]
|
compiled with gnu, intel17, intel19. All debug and optimized. Passes all MPAS-O nightly regression suites. |
MPAS-Ocean: GM fixes This PR brings in a new mpas-source submodule with changes only to the ocean core. In it, integrals for computing GM kappa and the phase speed have been reworked to mitigate failures in ISMF simulations without redi. With this PR all configurations of GM work and the old 3DGM (N2_dependent) is recoverable to its original configuration. This PR will be non BFB in WC and Cryo configs. See MPAS-Dev/MPAS-Model#643 Fixes #3719 [non-BFB] [NML]
Integrals for computing GM kappa and the phase speed have been reworked to mitigate failures in ISMF simulations without redi. With this PR all configurations of GM work and the old 3DGM (N2_dependent) is recoverable to its original configuration.
This PR will be non BFB in WC and Cryo configs.