-
Notifications
You must be signed in to change notification settings - Fork 0
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
OCN to GLC thermal forcing coupling #94
base: master
Are you sure you want to change the base?
OCN to GLC thermal forcing coupling #94
Conversation
@cbegeman & @jonbob , I tagged you both on this PR, though we may want to bring in some other people to review/contribute, as well. The PR functions so in some sense is complete, but we may want to discuss some of the implementation choices and revise. I opened the PR now so you have some concrete to look at as we discuss. |
components/mpas-ocean/src/shared/mpas_ocn_time_average_coupled.F
Outdated
Show resolved
Hide resolved
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.
The 300m thermal forcing field seems right on the ocean side. Given my limited coupler development experience, I think this looks good. Would it be helpful for me to look over some of the cpl and output files from your recent test? Or run this test on another machine TL319_IcoswISC30E3r5_gis20
?
439ebbd
to
a91868e
Compare
@cbegeman , thank for your initial review. I went ahead and made the depth at which to calculate thermal forcing a namelist option and added information to the option description that a custom mapping file needs to be generated to be consistent with that depth. I also did some additional cleanup to better differentiate the coupling variables for this TF coupling from the existing ice-shelf coupling. If you want to try running this on Perlmutter, that would be good. We are restricted to machines where Albany exists, so Perlmutter (with gnu) would be the best place to try. You will also need the custom mapping file that is currently in my home directory on Chrysalis. Once we are happy with the branch, I'll coordinate with Jon about the best way to name it. |
@jonbob and @xylar , everything is working as I would like and this is ready for review. Once the two of you and Carolyn are happy with it, I can open a formal PR on the main E3SM repo and ask Rob to review it. I'm leaving for two weeks of vacation at the end of next week, so if we're able to get it to that stage before I leave, that would be great, but it's ok if not. It would be good to get #95 merged so we can use it to confirm that this PR doesn't break any of the shelf coupling. (Or I can test that with a temporary merge of the two branches) |
@matthewhoffman Great! I can test it on perlmutter. I'll get in touch with you to get that path when I'm ready to set it up (in the next day or two). |
@cbegeman , sounds good! (That path is buried in my notes above for setting up the case: |
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.
These changes look good to me! I ran the test on perlmutter cpu at /pscratch/sd/c/cbegeman/e3sm_scratch/pm-cpu/20240529.GMPAS-JRA1p5-MALI.TL319_IcoswISC30E3r5_gis20.GIS-ocn-TFcpl-test.pm-cpu
and verified that it ran and produced non-zero faceMeltingThickness
.
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.
A few comments for now.
components/mpas-ocean/src/shared/mpas_ocn_time_average_coupled.F
Outdated
Show resolved
Hide resolved
aa13bbc
to
5c1ac5a
Compare
@matthewhoffman, I think this looks good and is ready to go to E3SM once @jonbob agrees. The one question that came to mind when I looked through the code was whether we want a flag and/or package for these changes. Right now as it's written, we'll be computing the thermal forcing at the given depth in all E3SM simulations with active ocean regardless of whether we're coupling to MALI or not. I think that's okay but wanted to make sure that's the approach we want to take. I don't believe the TF will be written out to any stream by default so the information is just being lost if it doesn't go to MALI. There's some complexity in figuring out if we're coupling to |
@xylar , that's a good point. We could so something analogous to the ice-shelf basal melting in the coupler, which is activated when What do you think? That might be better than leaving it fully exposed as it is now. Looking closer at what I had done, the coupler operations for the TF coupling are only activated when ocean is present and glc is prognostic:
So it would be nice to have the ocean calculations also only occur when these conditions are met. I'm not sure offhand if it's possible for the information to flow that direction. @jonbob might know or I will take a closer look. |
Yes, I think that would be my preference. For now, this would be a stealth feature only activated manually with a user namelist option. |
Ok, yes, let's add that grid. I'm sure it'll be useful in other contexts as we get these features running more regularly so might as well take care of it now. Let me know if I can do anything to help. |
This adds compsets and new output variables to facilitate the E3SM and E3SM-MMF contributions to phase 1 & 2 of the radiative-convective equilibrium model inter-comparison project (RCEMIP). NOTE: in the original RCE compsets there was a slight error in the value of constant_zenith_deg being off by 1/100. This difference is inconsequential, but I wanted to fix it here to ensure consistency with the other RCEMIP models. [non-BFB] - only for RCE cases because of updated constant_zenith_deg value
38733f0
to
8e6e892
Compare
This commits adds a new field to MPAS-Ocean called avgThermalForcing300m. It is calculated as the thermal forcing (difference between ocean temperature local freezing temperature) at 300 m depth. It uses the temperature of the layer shallower than 300 m. This could be replaced with vertical interpolation to get the value exactly at 300 m. The TF at 300 m is time averaged over the ocean coupling interval.
This commit adds the So_tf300 coupler field for passing thermal forcing at 300m through the coupler. It also passes the avgThermalForcing300m added to MPAS-Ocean in the previous commit to this coupler field, and send it to the ismip6_2dThermalForcing field in MALI as the destination. Note that a new list of coupler fields called x2g_tf_states_from_ocn has been added to seq_flds_mod to differentiate this coupling field from the iceshelf OCN/GLC coupling, which is handled differently.
This commit enables facemelting in MALI so that the new TF field will be used to calculate a melt rate. This is safe to enable in general, because for situations where thermal forcing is not calculated or not applicable, it will be zero and facemelting will in turn be zero. This commit also updates the MALI output stream to write out the TF and facemelting fields. Note that this commit also changes the MALI output stream interval to daily. While that might not be the ideal long-term production solution, it is likely the desired frequency for model development for the forseeable future.
This commits defines the mapping for thermal forcing from ocean to glc. It defines a special mapper for thermal forcing state (ocn2glc_tf_smap) in CIME and MCT xml files. It also declares and allocates mapper_So2g_tf in prep_glc_mod but does not initialize or use it yet. The mapping file requires some special treatment: * it needs to use nearest neighbor mapping (which differs from most state remapping) * it needs to include grid_imask in the ocean scrip file to only consider ocean cells valid if they are deeper than 300m
1. Differnetiate new ocn2glc TF coupling from existing ocn2glcshelf coupling Create ocn_c2_glc logical in cime_comp_mod. This controls the new ocn2glc TF (thermal forcing) coupling separately from the existing ocn2glcshelf coupling, which has its own ocn_c2_glcshelf flag already. The new TF coupling will be active whenever ocn is present and glc is prognostic. These flags are used to initialize different mappers independent of each other in prep_glc_init. Those flags are also now passed to prep_glc_calc_o2x_gx to control which mapping actually occurs. 2. Implement prep_glc_mrg_ocn The existing ocn2glcshelf coupling handled a number of operations in unusual ways because the fluxes themselves are calculated in the coupler, so it was missing some of the standard operations for simply passing fields between components. As such, adding the new TF coupling requires creating a prep_glc_mrg_ocn routine, which is responsible for transferring fields from o2x_g to x2g_g arrays. This routine was copied closely from the existing prep_glc_mrg_lnd routine. With this commit, the ocean TF field is successfully passed to MALI.
The entirety of existing ocn->glc coupling was for the ice-shelf coupling. To better differentiate the coupling in this branch based on thermal forcing, this commit ensures there is either a 'shelf' or 'tf' suffix on all ocn-glc coupling variables.
This allows testing with a MALI mesh where fjords are resolved.
The facemelting parameterization requires a subglacial runoff field as an input. Eventually, we may have this calculated prognostically in E3SM from MALI and/or ELM, but that is not planned for the near-term. Until then, a reasonable approximation is to use a constant historical climatological field. This commit updates the mpas.gis1to10kmR2 input file to include a ismip6Runoff field provided by ISMIP6. The field used is a 1995-2014 mean from the MIROC5 model, which was bias-corrected to match MAR over that period. See www.the-cryosphere.net/14/985/2020/ Fig. 2 and related text for details.
This uses the layer that the desired depth is in, rather than the layer above it. Co-authored-by: Xylar Asay-Davis <[email protected]>
This commit adds an MPAS-Ocean namelist option for activating the OCN-GLC TF coupling. This option controls if E3SM should enable the OCN-GLC TF coupling and also makes the associated TF calculations conditional on the option being active. The option defaults to false and there currently are not any compsets that activate it, so it can only be enabled with a namelist usermod at present.
Eventually, when we have compsets that require this mode, it should be controlled analogously to MPASO_ISMF.
8e6e892
to
dccd205
Compare
PR moved to main E3SM repo at: E3SM-Project#6632 |
Four new gridspecs were introduced recently that were brought in to this branch after a rebase and were missed in the original renaming of OCN2GLC_*MAPNAME to OCN2GLC_SHELF_*FMAPNAME. This commit makes the name change for those grids as well.
…k_script Add script for adding map of sufficiently deep ocean bathymetry to a scrip file This PR adds a script for adding a mask to a scrip file needed for ocn-glc fjord coupling. This script defines a mask of ocean cells that are deeper than a threshold. This is to be used for updating a scrip file so that it only remaps from ocean cells deeper than that threshold. The resulting mapping file can be used as an OCN2GLC_TF_SMAPNAME mapping file in E3SM. Note that config_2d_thermal_forcing_depth in the MPAS-Ocean namelist needs to match the depth used here. This PR is needed for generating a mapping file to support E3SM PR: E3SM-Ocean-Discussion/E3SM#94
This pull request introduces coupling from OCN to GLC to pass thermal forcing at a prescribed ocean depth (300 m) from MPAS-Ocean to MALI, where MALI uses it to calculate grounded marine melting through an existing 'facemelting' parameterization. Facemelting as a function of ocean thermal state is a critical OCN/GLC coupling for Greenland, but it is relevant to Antarctica as well. This OCN-GLC thermal forcing coupling is activated whenever OCN is present and GLC is active.
This PR has pieces in MPAS-Ocean, the coupler, and MALI: