Add MLD_out to diagnose MLD#832
Conversation
|
This look good. |
Hallberg-NOAA
left a comment
There was a problem hiding this comment.
These changes adding an optional argument to two publicly visible routines look to me like they are reasonable. The only question that I would have is why the new arrays are intent(inout), given that the entire array (including halo regions) are being set in the array-syntax copy?
In diagnoseMLDbyDensityDifference(), MLD is only being set in the range of MLD(is:ie,js:je), so the whole-array copy into MLD_out runs the risk if putting uninitialized values (perphas NaNs) into the halo regions. I would suggest only copying in the valid values to MLD_out and leaving it as intent(inout).
In diagnoseMLDbyEnergy(), MLD is initialized to 0 at about line 335, so the whole array copy should be fine, and MLD_out could be made intent(out). Alternately, MLD_out could be left as intent(inout), but then only the computational domain points (that are actually calculated in this routine) should be copied over.
|
Thanks Bob. I ended up making MLD_out I am not sure why MLD is initialized to zero twice (line 331 and 338) in |
Hallberg-NOAA
left a comment
There was a problem hiding this comment.
I agree that this revised PR will fully work as intended.
Add an optional argument to pass the MLD out of the diagnose MLD routine.
Includes three changes: - Make MLD_out optional - initalize MLD_out to 0. everywhere - copy MLD to MLD_out only in the computational domain.
Remove an extra initalization of MLD in diagnoseMLDbyEnergy
bd6b977 to
9df45e1
Compare
|
This PR has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/26447. |
|
@yichengt900 The final version here is different from the version on our dev/cefi branch, we can update now or the next time we pull in dev/gfdl. |
|
@theresa-cordero , thanks! I have merged this change back to |
* Add MLD_out to diagnose MLD call Add an optional argument to pass the MLD out of the diagnose MLD routine. * Change MLD_out to be only computaional domain Includes three changes: - Make MLD_out optional - initalize MLD_out to 0. everywhere - copy MLD to MLD_out only in the computational domain. * Remove unnedded MLD=0 initalization Remove an extra initalization of MLD in diagnoseMLDbyEnergy --------- Co-authored-by: Theresa Morrison <Theresa.Morrison@gaea68.ncrc.gov> Co-authored-by: Theresa Morrison <Theresa.Morrison@gaea63.ncrc.gov>
For COBALTv3 we want to save the mixed layer depth from
diagnoseMLDbyDensityDifferenceordiagnoseMLDbyEnergy. This PR adds an optional argument to pass the MLD out of these routines.This should have no impact on answers or require changes in other parts of the code.
CC: @yichengt900