Skip to content

Commit

Permalink
Merge pull request #596 from mvertens/feature/noresm2_5_alpha08_v1
Browse files Browse the repository at this point in the history
Creation of noresm2_5_alpha08

A summary for the changes in this PR are here: #580

Usage of new git-fleximod can be found here - https://github.com/ESMCI/git-fleximod
For noresm - the simplest way to create a sandbox is the following:

> git clone https://github.com/NorESMhub/NorESM.git
> cd NorESM
> git checkout noresm2_5_alpha08
> ./bin/git-fleximod update

Testing - ran noresm_prealpha tests on betzy and genererated new baselines (noresm_develop/noresm2_5_alpha08)
  • Loading branch information
gold2718 authored Nov 22, 2024
2 parents c042b20 + 95172d4 commit be12b8b
Show file tree
Hide file tree
Showing 165 changed files with 1,680 additions and 9,904 deletions.
8 changes: 0 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
# managed directories that are checked out by the externals tool
cime/
components/
libraries/
share/
ccs_config/
tools/statistical_ensemble_test/

# generated local files
*.log

Expand Down
151 changes: 151 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# This is a git submodule file with additional support for
# git-fleximod (https://github.com/ESMCI/git-fleximod)
#
# The additional flags supported by git-fleximod are
# fxtag - the tag associated with the submodule, this tag can be tested for
# consistancy with the submodule hash using git-fleximod status
# the hash can be updated to the tag using git-fleximod update
#
# fxrequired - indicates if a given submodule should be checked out on install
# submoudules can be toplevel or internal and required or optional
# toplevel means that the submodule should only be checked out if the
# module is the toplevel of the git repo (is not a submodule itself)
# internal means that the submodule is needed by the component whether
# the component is toplevel or the submodule of another repo
# required means that the submodule should always be checked out
# optional means that the submodule should only be checked out if the
# optional flag is provided to git-fleximod or the submodule name is
# explicitly listed on the git-fleximod command line.
#
# fxsparse - this is a path to a git sparse checkout file indicating that the
# submodule should be checked out in sparse mode
#
# fxDONOTUSEurl - this field is used by git-fleximod test to insure that the url is pointing
# to the official url of the repo and not to an unofficial fork.
# It is intended for use of github workflows to test commits to protected
# repository branches.
#

#-----------------------------
# Libraries
#-----------------------------

[submodule "parallelio"]
path = libraries/parallelio
url = https://github.com/NCAR/ParallelIO
fxtag = pio2_6_2
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/NCAR/ParallelIO

[submodule "mct"]
path = libraries/mct
url = https://github.com/MCSclimate/MCT
fxtag = MCT_2.11.0
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/MCSclimate/MCT

#-----------------------------
# Configuration/CCS
#-----------------------------

[submodule "ccs_config"]
path = ccs_config
url = https://github.com/NorESMhub/ccs_config_noresm.git
fxtag = ccs_config_noresm0.0.38
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/NorESMhub/ccs_config_noresm.git

[submodule "cime"]
path = cime
url = https://github.com/NorESMhub/cime.git
fxtag = cime6.1.28_noresm_v0
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/NorESMhub/cime.git

#-----------------------------
# Share
#-----------------------------

[submodule "share"]
path = share
url = https://github.com/NorESMHub/NorESM_share
fxtag = share1.1.2_noresm_v0
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/NorESMHub/NorESM_share

#-----------------------------
# Components
#-----------------------------

[submodule "blom"]
path = components/blom
url = https://github.com/NorESMhub/BLOM.git
fxtag = dev1.6.1.8
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/NorESMhub/BLOM.git

[submodule "cam"]
path = components/cam
url = https://github.com/NorESMhub/CAM.git
fxtag = noresm2_5_016_cam6_4_041
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/NorESMhub/CAM.git

[submodule "cdeps"]
path = components/cdeps
url = https://github.com/ESCOMP/CDEPS.git
fxtag = cdeps1.0.53
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESCOMP/CDEPS.git

[submodule "cice6"]
path = components/cice
url = https://github.com/NorESMhub/NorESM_CICE
fxtag = cesm_cice6_5_0_20240702_noresm_v2
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/NorESMhub/NorESM_CICE

[submodule "cism"]
path = components/cism
url = https://github.com/ESCOMP/CISM-wrapper
fxtag = cismwrap_2_2_002_noresm_v1
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESCOMP/CISM-wrapper

[submodule "clm"]
path = components/clm
url = https://github.com/NorESMhub/CTSM
fxtag = ctsm5.3.11-noresm_v1
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/NorESMhub/CTSM

[submodule "cmeps"]
path = components/cmeps
url = https://github.com/NorESMhub/CMEPS.git
fxtag = cmeps1.0.20_noresm_v0
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/NorESMhub/CMEPS.git

[submodule "mosart"]
path = components/mosart
url = https://github.com/ESCOMP/MOSART
fxtag = mosart1.1.02
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/ESCOMP/MOSART

[submodule "ww3"]
path = components/ww3
url = https://github.com/NorESMhub/WW3_interface.git
fxtag = ww3_interface_noresm0.0.15
fxrequired = ToplevelRequired
fxDONOTUSEurl = https://github.com/NorESMhub/WW3_interface.git

#-----------------------------
# Tools
#-----------------------------

[submodule "pycect"]
path = tools/statistical_ensemble_test/pyCECT
url = https://github.com/NCAR/PyCECT.git
fxtag = 3.2.2
fxrequired = ToplevelOptional
Empty file.
129 changes: 129 additions & 0 deletions .lib/git-fleximod/git_fleximod/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
from pathlib import Path
import argparse
from git_fleximod import utils

__version__ = "0.9.2"

def find_root_dir(filename=".gitmodules"):
""" finds the highest directory in tree
which contains a file called filename """
d = Path.cwd()
root = Path(d.root)
dirlist = []
dl = d
while dl != root:
dirlist.append(dl)
dl = dl.parent
dirlist.append(root)
dirlist.reverse()

for dl in dirlist:
attempt = dl / filename
if attempt.is_file():
return str(dl)
return None


def get_parser():
description = """
%(prog)s manages checking out groups of gitsubmodules with additional support for Earth System Models
"""
parser = argparse.ArgumentParser(
description=description, formatter_class=argparse.RawDescriptionHelpFormatter
)

#
# user options
#
choices = ["update", "status", "test"]
parser.add_argument(
"action",
choices=choices,
default="update",
help=f"Subcommand of git-fleximod, choices are {choices[:-1]}",
)

parser.add_argument(
"components",
nargs="*",
help="Specific component(s) to checkout. By default, "
"all required submodules are checked out.",
)

parser.add_argument(
"-C",
"--path",
default=find_root_dir(),
help="Toplevel repository directory. Defaults to top git directory relative to current.",
)

parser.add_argument(
"-g",
"--gitmodules",
nargs="?",
default=".gitmodules",
help="The submodule description filename. " "Default: %(default)s.",
)

parser.add_argument(
"-x",
"--exclude",
nargs="*",
help="Component(s) listed in the gitmodules file which should be ignored.",
)
parser.add_argument(
"-f",
"--force",
action="store_true",
default=False,
help="Override cautions and update or checkout over locally modified repository.",
)

parser.add_argument(
"-o",
"--optional",
action="store_true",
default=False,
help="By default only the required submodules "
"are checked out. This flag will also checkout the "
"optional submodules relative to the toplevel directory.",
)

parser.add_argument(
"-v",
"--verbose",
action="count",
default=0,
help="Output additional information to "
"the screen and log file. This flag can be "
"used up to two times, increasing the "
"verbosity level each time.",
)

parser.add_argument(
"-V",
"--version",
action="version",
version=f"%(prog)s {__version__}",
help="Print version and exit.",
)

#
# developer options
#
parser.add_argument(
"--backtrace",
action="store_true",
help="DEVELOPER: show exception backtraces as extra " "debugging output",
)

parser.add_argument(
"-d",
"--debug",
action="store_true",
default=False,
help="DEVELOPER: output additional debugging "
"information to the screen and log file.",
)

return parser
Loading

0 comments on commit be12b8b

Please sign in to comment.