-
Notifications
You must be signed in to change notification settings - Fork 10
Boundary conditions - v13 based on MOM6/v2 ocean bathymetry (OM4) #1149
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
Draft
sinakhani
wants to merge
50
commits into
develop
Choose a base branch
from
skhani/develop
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
8b01927
New ocean bathymetry v2 (OM4) is added
sinakhani 6cc2ea7
New ocean bathymetry v2 (OM4) is added
sinakhani 392194c
New ocean bathymetry v2 (OM4) is added
sinakhani 43dc33d
A typo on text is fixed
sinakhani 87de898
MOM6 bathymetry version is added
sinakhani 950b8e6
Updates on v14 bcs
sinakhani e796d0a
Typo on text is fixed
sinakhani 922e735
Typo on text is fixed
sinakhani 2ed8999
Typo on text is fixed
sinakhani fb7adc0
More clean-up for mom6 v2 bathymetry
sinakhani 6d6f4bd
More clean-up for mom6 v2 bathymetry
sinakhani 02fe5c7
Merging v12, v13, and v14 bcs cases
sinakhani d157723
add options so code is more flexiable
biljanaorescanin 185f585
Merge branch 'develop' into skhani/develop
biljanaorescanin c16644c
refine options
biljanaorescanin 2a6c530
Merge branch 'develop' into skhani/develop
biljanaorescanin adc768d
cleanup
biljanaorescanin 2dd6fe2
Merge branch 'develop' into skhani/develop
biljanaorescanin ce3a46b
Merge branch 'develop' into skhani/develop
biljanaorescanin 086cb4e
New ocean grids 720x576 and 2880x2240 for mom6/v2 are added
sinakhani c7f47fd
New ocean grids 720x576 and 2880x2240 for mom6/v2 are added
sinakhani b2ca659
Merge branch 'develop' into skhani/develop
sinakhani f8a3597
New ocean grids 720x576 and 2880x2240 for mom6/v2 are added
sinakhani 92a9f91
New ocean grids 720x576 and 2880x2240 for mom6/v2 are added
sinakhani 6bf328f
disable RUNOFF in DataAtm; let DISCHARGE and CALVING propagate to be …
zhaobin74 d75ffa3
add remapped friver and licalvf collections and provide DISCHARGE and…
zhaobin74 d615259
fixed a typo
zhaobin74 e5a729c
claving causes huge frazil generation at isolated locations near ices…
zhaobin74 656728a
Fix for gfortran
mathomp4 cb905bc
Topo docs & cleanup: add README_topo.md; move generate_topo.sh to pre…
biljanaorescanin 7e6fae6
remove example to make it simetric to other file
biljanaorescanin 4fafcfb
fix example
biljanaorescanin bbbd66e
moved to obsolete
biljanaorescanin b832814
add more text to readme
biljanaorescanin 4894b0d
update readme
biljanaorescanin 52d257f
update readme again
biljanaorescanin e03cbec
add to readme and move
biljanaorescanin 9afd2a6
move utils_topo dir to new location
biljanaorescanin 9c3d8b8
add cmake file
biljanaorescanin 6963c04
add dir to build
biljanaorescanin d5467db
we don't need all this
biljanaorescanin dcad50c
Fixes #1069. Clean up WW3 Cmake
mathomp4 74b9a9d
New ocean grids added to mom6/v2
sinakhani cf890bb
using v13 for this coupled grids bathymetry update
biljanaorescanin 442009d
fix for easy
biljanaorescanin 14adaca
right topo version
biljanaorescanin f448587
better info message
biljanaorescanin 1fd603e
smarter cleanup
biljanaorescanin 297db4b
code simplification / cleanup
biljanaorescanin a264bbe
minor updates to comments and white space (make_bcs_questionary.py, m…
gmao-rreichle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,53 @@ | |
|
|
||
| import os | ||
| import glob | ||
| import re | ||
|
|
||
| # --- BEGIN VERSION MATRIX --- | ||
|
|
||
| # Independent version mapping per questionnaire 'lbcsv' | ||
| # | ||
| # TOPO_VERSION refers to topography inputs for atm model | ||
|
|
||
| _VERSION_MATRIX = { | ||
| "NL3": {"TOPO_VERSION": "v1", "MOM6_BATHY_VERSION": "v1"}, | ||
| "NL4": {"TOPO_VERSION": "v1", "MOM6_BATHY_VERSION": "v1"}, | ||
| "NL5": {"TOPO_VERSION": "v1", "MOM6_BATHY_VERSION": "v1"}, | ||
| "ICA": {"TOPO_VERSION": "v1", "MOM6_BATHY_VERSION": "v1"}, | ||
| "GM4": {"TOPO_VERSION": "v1", "MOM6_BATHY_VERSION": "v1"}, | ||
| "F25": {"TOPO_VERSION": "v1", "MOM6_BATHY_VERSION": "v1"}, | ||
| "v06": {"TOPO_VERSION": "v1", "MOM6_BATHY_VERSION": "v1"}, | ||
| "v07": {"TOPO_VERSION": "v1", "MOM6_BATHY_VERSION": "v1"}, | ||
| "v08": {"TOPO_VERSION": "v1", "MOM6_BATHY_VERSION": "v1"}, | ||
| "v09": {"TOPO_VERSION": "v1", "MOM6_BATHY_VERSION": "v1"}, | ||
| "v10": {"TOPO_VERSION": "v1", "MOM6_BATHY_VERSION": "v1"}, | ||
| "v11": {"TOPO_VERSION": "v1", "MOM6_BATHY_VERSION": "v1"}, | ||
| "v12": {"TOPO_VERSION": "v1", "MOM6_BATHY_VERSION": "v1"}, | ||
| "v13": {"TOPO_VERSION": "v1", "MOM6_BATHY_VERSION": "v2"}, | ||
| } | ||
|
|
||
| _DEFAULTS = {"TOPO_VERSION": "v1", "MOM6_BATHY_VERSION": "v1"} | ||
|
|
||
| def _normalize_lbcsv(label: str) -> str: | ||
| v = (label or "").strip() | ||
| m = re.match(r'[vV]?\d+|[A-Za-z0-9]+', v) # accepts v13 / 13 / NL3 / etc. | ||
| if not m: | ||
| return v | ||
| key = m.group(0) | ||
| # normalize numeric like '13' -> 'v13' | ||
| if key.isdigit(): | ||
| key = 'v' + key | ||
| return key | ||
|
Comment on lines
+34
to
+43
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need this "normalize" function? Don't we always have a 3-char alphanumeric string for "bcs_version"? When would we have "bcs_version=13" (without the leading "v")? |
||
|
|
||
| def resolve_bcs_matrix(bcs_version: str): | ||
| key = _normalize_lbcsv(bcs_version) | ||
| return {**_DEFAULTS, **_VERSION_MATRIX.get(key, {})} | ||
|
|
||
| def topo_version_for_bcs(bcs_version: str) -> str: | ||
| return resolve_bcs_matrix(bcs_version)["TOPO_VERSION"] | ||
|
|
||
| def mom6_bathy_version_for_bcs(bcs_version: str) -> str: | ||
| return resolve_bcs_matrix(bcs_version)["MOM6_BATHY_VERSION"] | ||
|
|
||
| def get_script_head() : | ||
|
|
||
|
|
@@ -172,12 +219,36 @@ def get_script_mv(grid_type): | |
| echo "Successfully copied CO2_MonthlyMean_DiurnalCycle.nc4 to bcs dir." | ||
| endif | ||
|
|
||
| # adjust permissions | ||
| """ | ||
|
|
||
| if grid_type in ("Cubed-Sphere", "Stretched_CS"): | ||
| mv_template = mv_template + """ | ||
|
|
||
| chmod +rX -R geometry land logs | ||
| # Link (atm) TOPO into this BCS directory based on bcs_version (only needed if grid_type is [stretched] cube-sphere) | ||
| set topo_version = {TOPO_VERSION} | ||
|
|
||
| if ( ! -d TOPO ) mkdir -p TOPO | ||
| set topo_dir = CF{NC}x6C{SGNAME} # e.g., CF0024x6C or CF0540x6C-SG001 | ||
| set topo_root = {MAKE_BCS_INPUT_DIR}/atmosphere/TOPO | ||
| set topo_src = $topo_root/$topo_version/$topo_dir | ||
|
|
||
| if ( -e TOPO/$topo_dir ) then | ||
| echo "TOPO/$topo_dir already exists; not relinking." | ||
| else if ( -d $topo_src ) then | ||
| /bin/ln -s $topo_src TOPO/$topo_dir | ||
| echo "Linked TOPO/$topo_dir -> $topo_src" | ||
| else | ||
| echo "WARNING: TOPO source not found: $topo_src" | ||
| endif | ||
|
|
||
| """ | ||
|
|
||
| mv_template = mv_template + """ | ||
|
|
||
| # adjust permissions (for all grid types) | ||
| chmod +rX -R geometry land logs | ||
|
|
||
| """ | ||
| return mv_template | ||
|
|
||
| def check_script(expdir, script): | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
Don't we need to end these lines with "\"?