Add conditional halo pass for frazil inside make_frazil#932
Conversation
|
It looks like |
The code was updated with this in mind, which greatly simplifies the necessary modifications. |
Hallberg-NOAA
left a comment
There was a problem hiding this comment.
I agree that these changes are correct and that they should address our recent experience with some instances where the interaction between the handling of the frazil and the vertex shear code were causing some configurations not to reproduce across processor layout.
Frazil may need an extra halo pass, but only when all of the following are true: (1) frazil is calculated and applied in the halo (e.g., vertex_shear is true) (2) the thermodynamic loop is called more than once before passing frazil to the sea-ice (dt_therm<dt_cpld) (3) reclaim_frazil is true (4) a previous make_frazil was called after the diabatic loop and before T&S were updated in halos. This commit adds the halo pass inside make_frazil since it is where we can know all of these conditions at once. We needed to add a flag to know if frazil was reset (which happens if dt_therm>=dt_cpld), in which case the halo pass would be unnecessary. We needed an optional argument for make_frazil so we could flag to only do this update on the first call to make_frazil (which is needed because the previous call to make_frazil was after the diabatic loop, condition 4)
00d0791 to
82e06f0
Compare
|
This PR has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/28088. |
Frazil may need an extra halo pass, but only when all of the following are true:
(1) frazil is calculated and applied in the halo (e.g., vertex_shear is true)
(2) the thermodynamic loop is called more than once before passing frazil to the sea-ice (dt_therm<dt_cpld)
(3) reclaim_frazil is true
(4) a previous make_frazil was called after the diabatic loop and before T&S were updated in halos.
This commit adds the halo pass inside make_frazil since it is where we can know all of these conditions at once. We needed to add a flag to know if frazil was reset (which happens every timestep if dt_therm>=dt_cpld), in which case the halo pass would be unnecessary. We needed an optional argument for make_frazil so we could flag to only do this update on the first call to make_frazil (which is needed because the previous call to make_frazil was after the diabatic loop, condition 4).
We could have achieved the same result by adding one new halo pass in diabatic_driver right before line 376 (requiring only one line of new code), but it would unnecessarily invoke a halo pass when all the above conditions were not achieved.
Without this new code, the model does not conserve or reproduce across layouts when dt_therm<dt_cpld, vertex_shear is True, and reclaim_frazil is True.