Skip to content

Conversation

@sinakhani
Copy link

  • This PR adds updates for files in makebcs directory to include MOM6/v2 ocean bathymetry.
  • This is non-zero diff for MOM6 in coupled mode, but zero-diff otherwise (AMIP).

@sinakhani sinakhani requested a review from a team as a code owner August 28, 2025 23:13
@sinakhani sinakhani added the 0-diff AMIP 0-diff for uncoupled AMIP runs label Aug 28, 2025
@biljanaorescanin biljanaorescanin marked this pull request as draft August 28, 2025 23:53
Copy link
Contributor

@gmao-rreichle gmao-rreichle left a comment

Choose a reason for hiding this comment

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

see comments below

@sinakhani
Copy link
Author

I have make changes based on the given comments. Please let me know what you think about this version. Thank you @gmao-rreichle @mathomp4 @biljanaorescanin

Copy link
Contributor

@gmao-rreichle gmao-rreichle left a comment

Choose a reason for hiding this comment

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

Thanks, @sinakhani. See more comments below

"v11 : NL3 + JPL veg height + PEATMAP + MODIS snow alb v2", \
"v12 : NL3 + JPL veg height + PEATMAP + MODIS snow alb v2 + Argentina peatland fix", \
"v13 : NL3 + JPL veg height + PEATMAP + MODIS snow alb v2 + Argentina peatland fix + mean land elevation fix", \
"v14 : NL3 + JPL veg height + PEATMAP + MODIS snow alb v2 + Argentina peatland fix + mean land elevation fix + v2 (OM4) ocean-seaice bathymetry", \
Copy link
Contributor

Choose a reason for hiding this comment

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

The "v2 bathymetry" language needs to include "MOM6" because the v2 bathymetry appears to be specific to MOM6. Maybe I'm missing something.

Copy link
Author

Choose a reason for hiding this comment

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

The suggested change has been made.

Comment on lines 245 to 259
case ("v14")

! "v14", "v13", and "v12" are identical except for:
! - topography used for the atm (processed outside of make_bcs)
! - v14 is used for coupled atm-ocean-seaice with v2 (OM4) ocean bathymetry

LAIBCS = 'MODGEO'
SOILBCS = 'HWSD_b'
MODALB = 'MODIS2'
SNOWALB = 'MODC061v2'
OUTLETV = "v2"
GNU = 1.0
use_PEATMAP = .true.
jpl_height = .true.

Copy link
Contributor

Choose a reason for hiding this comment

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

This block should be merged into "case ("v12","v13"). The variables within the case statements for v12,v13 and v14 are identical. The documentation in the comments within the case statements needs to be updated accordingly. @biljanaorescanin: More info is needed somewhere about how the top files change between v12, v13, and v14.

Generally, the problem here is that some of the bcs version config variables are in F90 (i.e., in the block right here), while others are purely in the py portion (e.g, "v1"/"v2" MOM6 bathymetry). I don't know how this can be resolved more cleanly. Maybe we need an nml or rc file that py manages and that Fortran can read. But this type of change is probably more than we want to tackle as part of the present PR

Copy link
Author

@sinakhani sinakhani Aug 29, 2025

Choose a reason for hiding this comment

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

I have not made changes here. I will wait until @biljanaorescanin makes comments. It might need some thoughts/decisions on how we want to label "v12", "v13", and "v14" considering their differences and similarities.

Copy link
Contributor

Choose a reason for hiding this comment

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

I merged the "case" statements for clarity. @biljanaorescanin: The comments still need to be merged and edited

Copy link
Contributor

Choose a reason for hiding this comment

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

I just cleaned up the text for merged cases "v12", "v13", and "v14". Please feel free to make further changes. Thank you.

Thanks, Sina. @biljanaorescanin: What I'm looking for here is a more detailed set of comments that specify what exactly is in each version for each of the bullet points (and possibly additional bullet points with differences that aren't mentioned yet -- I forget if there are more differences). E.g., the catchment.def topo fix is not in v12 but is in v13 and v14.

@sinakhani
Copy link
Author

I just cleaned up the text for merged cases "v12", "v13", and "v14". Please feel free to make further changes. Thank you.

@mathomp4 mathomp4 added the 0 diff The changes in this pull request have verified to be zero-diff with the target branch. label Aug 29, 2025
@biljanaorescanin
Copy link
Contributor

This PR was tested for BCS creation for both old v12 set and new v14 .
Zero diff to v12 with addition to TOPO linking. New version v14 is sourcing right files.
BCS run's for resolutions we do not have new bathymetry file will use v1 so we can create full set of BCS.

@biljanaorescanin biljanaorescanin marked this pull request as ready for review September 11, 2025 16:59
Copy link
Contributor

@gmao-rreichle gmao-rreichle left a comment

Choose a reason for hiding this comment

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

see comments below


def _resolve_versions(bcs_version: str):
"""
Returns (mom6_bathy_version, topo_version) as 'v1' or 'v2'
Copy link
Contributor

Choose a reason for hiding this comment

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

The fact that bcs "v14" happen to use "v2" for both TOPO and MOM6_BATHY_VERSION is pure coincidence. If in the next bcs version we update TOPO but not MOM6_BATHY_VERSION (or vice versa), this code won't work anymore. It may be clearer to use a look-up table approach as in

. I assume python has something like the "select case" construct. Do we have anything other sub-versions that are controlled in the python portion of the code (besides TOPO and MOM6_BATHY_VERSION)?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point, I missed that one... I will decouple them with a small, explicit lookup table.

Copy link
Contributor

Choose a reason for hiding this comment

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

Done in this commit: c16644c

Comment on lines 25 to 42
Build csh lines to symlink MOM6 datasets.
Prefer `preferred_version` (v1 or v2) per size; if missing, fall back to the other version.
Emits an echo note on fallback; warns if a size is missing in both.
"""
sizes = ["72x36", "540x458", "1440x1080"]
other = "v1" if preferred_version == "v2" else "v2"

lines = ['if ( ! -d data/MOM6 ) mkdir -p data/MOM6']
for size in sizes:
src_pref = os.path.join(inputdir, "ocean", "MOM6", preferred_version, size)
src_other = os.path.join(inputdir, "ocean", "MOM6", other, size)

if os.path.isdir(src_pref):
src = src_pref
note = ""
elif os.path.isdir(src_other):
src = src_other
note = f'echo "NOTE: MOM6 {preferred_version}/{size} not found; using {other}/{size}"'
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you linking v1 MOM6_BATHY_VERSION into v14 because we don't have v2 data? That will create all sorts of confusion. Why can't we generate v2 bathymetry for all resolutions? Rather than linking the "wrong" version, I think we should omit the link if the v2 bathymetry isn't available for a given resolution.

Copy link
Contributor

Choose a reason for hiding this comment

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

That would mean we can't run GCM v12 model version at c90 or c12 resolutions. Not even for nightly testing we have to do for GCM. Since I won't be able to create bcs files for them. So that is not an option to my understanding. Why there is no version 2 of files for those resolutions maybe @sinakhani can chime in. In general, as soon as he ads them code will always grab v2.

Copy link
Contributor

Choose a reason for hiding this comment

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

For now, I assume nightly tests don't run with v14 bcs. The AGCM can run just fine at all resolutions with v14 bcs, independent of the presence of bathymetry files. If v14 bcs aren't ready for the coupled model, then they're not ready. It is not ok to mix and match bathymetry versions within a single bcs version.

Copy link
Contributor

Choose a reason for hiding this comment

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

@mathomp4 can you chime in and and let us know is there plan to run coupled runs (testing like nightly or any runs at all really) with new bcs (v14) GCMv12 will use at c12 or c90 res? @gmao-rreichle proposed edit will create for v14 bcs only one resolution for coupled runs and that is CF0180x6C_M6TP1440x1080 if that is what group wants I can edit code.

To me easiest resolution so everyone is happy is for @sinakhani to create other resolutions (c90 and c12) . But I don't know how fast he can do that or can he do that.

Copy link
Author

Choose a reason for hiding this comment

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

The new ocean bathymetry (MOM6/v2) is at 1/4 deg for now (this is an adoption from GFDL-OM4_025). My plan is to have it at 1 deg as well (this has been in my to-do list for some time!). And probably at 1/8 deg at some point. I am not sure if we need c12 with the new bathymetry (it is rather too coarse for ocean test exp).

Copy link
Contributor

Choose a reason for hiding this comment

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

@sinakhani : Keep in mind that the c12 tests are not for science testing, they're for 0-diff testing. I'll defer to @mathomp4 about what makes sense here, but I would strongly advise against mixing bathymetry versions within a single bcs version. If the easiest way to create "v2" bathymetry for c12 is to copy the "v1" file, so be it. But for any resolution that may be useful for science, it's a hard no from my end.

Copy link
Contributor

@biljanaorescanin biljanaorescanin Sep 18, 2025

Choose a reason for hiding this comment

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

I've adopted suggested change in last commit (c16644c), now code will abort if that res is not present. Once Sina adds it, code will work with no additional changes.
Grid_type: Cubed-Sphere
orslv: T3MOM6
resolution: c90
ABORT: Missing MOM6 bathymetry: /discover/nobackup/projects/gmao/bcs_shared/make_bcs_inputs/ocean/MOM6/v2/540x458 (LBCSV=v14 MOM6=v2)

@biljanaorescanin biljanaorescanin marked this pull request as draft September 12, 2025 14:03
@gmao-rreichle gmao-rreichle changed the title Boundary conditions v14 based on MOM6/v2 ocean bathymetry (OM4) Boundary conditions v14 based on MOM6/v2 ocean bathymetry (OM4) and "v2" topography for atmosphere Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0-diff AMIP 0-diff for uncoupled AMIP runs 0 diff The changes in this pull request have verified to be zero-diff with the target branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants