Skip to content

Commit

Permalink
Merge branch 'b4b-dev' into gitfleximodupdatev0.8.2
Browse files Browse the repository at this point in the history
Make sure git-fleximod is pointing to 0.8.2
 Conflicts:
	.lib/git-fleximod/git_fleximod/cli.py
	.lib/git-fleximod/git_fleximod/git_fleximod.py
	.lib/git-fleximod/pyproject.toml
	.lib/git-fleximod/tbump.toml
  • Loading branch information
ekluzek committed Jul 15, 2024
2 parents 7b10e61 + 3de6f95 commit 1ebb862
Show file tree
Hide file tree
Showing 37 changed files with 1,288 additions and 184 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# ignore svn directories
**/.svn/**
.svn/

# netcdf files
*.nc
# but don't ignore netcdf files here:
Expand Down
40 changes: 40 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,90 +1,130 @@
# 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.
#
[submodule "fates"]
path = src/fates
url = https://github.com/NGEET/fates
fxtag = sci.1.73.0_api.35.0.0
fxrequired = AlwaysRequired
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/NCAR/fates-release

[submodule "cism"]
path = components/cism
url = https://github.com/ESCOMP/CISM-wrapper
fxtag = cismwrap_2_2_001
fxrequired = ToplevelRequired
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/ESCOMP/CISM-wrapper

[submodule "rtm"]
path = components/rtm
url = https://github.com/ESCOMP/RTM
fxtag = rtm1_0_79
fxrequired = ToplevelRequired
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/ESCOMP/RTM

[submodule "mosart"]
path = components/mosart
url = https://github.com/ESCOMP/MOSART
fxtag = mosart1_0_49
fxrequired = ToplevelRequired
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/ESCOMP/MOSART

[submodule "mizuRoute"]
path = components/mizuRoute
url = https://github.com/ESCOMP/mizuRoute
fxtag = cesm-coupling.n02_v2.1.2
fxrequired = ToplevelRequired
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/ESCOMP/mizuRoute

[submodule "ccs_config"]
path = ccs_config
url = https://github.com/ESMCI/ccs_config_cesm.git
fxtag = ccs_config_cesm0.0.106
fxrequired = ToplevelRequired
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/ESMCI/ccs_config_cesm.git

[submodule "cime"]
path = cime
url = https://github.com/ESMCI/cime
fxtag = cime6.0.246
fxrequired = ToplevelRequired
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/ESMCI/cime

[submodule "cmeps"]
path = components/cmeps
url = https://github.com/ESCOMP/CMEPS.git
fxtag = cmeps0.14.63
fxrequired = ToplevelRequired
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git

[submodule "cdeps"]
path = components/cdeps
url = https://github.com/ESCOMP/CDEPS.git
fxtag = cdeps1.0.34
fxrequired = ToplevelRequired
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/ESCOMP/CDEPS.git

[submodule "share"]
path = share
url = https://github.com/ESCOMP/CESM_share
fxtag = share1.0.19
fxrequired = ToplevelRequired
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/ESCOMP/CESM_share

[submodule "mct"]
path = libraries/mct
url = https://github.com/MCSclimate/MCT
fxtag = MCT_2.11.0
fxrequired = ToplevelRequired
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/MCSclimate/MCT

[submodule "parallelio"]
path = libraries/parallelio
url = https://github.com/NCAR/ParallelIO
fxtag = pio2_6_2
fxrequired = ToplevelRequired
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/NCAR/ParallelIO

[submodule "doc-builder"]
path = doc/doc-builder
url = https://github.com/ESMCI/doc-builder
fxtag = v1.0.8
fxrequired = ToplevelOptional
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/ESMCI/doc-builder
2 changes: 2 additions & 0 deletions .lib/git-fleximod/git_fleximod/git_fleximod.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ def submodules_update(gitmodules, root_dir, requiredlist, force):

submodules_update(gitsubmodules, repodir, newrequiredlist, force=force)



def local_mods_output():
text = """\
The submodules labeled with 'M' above are not in a clean state.
Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ src --------------- CTSM Source code.
lilac ------------- Lightweight Infrastructure for Land-Atmosphere Coupling (for coupling to a host atmosphere model)
tools ------------- CTSM Offline tools to prepare input datasets and process output.
cime_config ------- Configuration files of cime for compsets and CTSM settings
bin/git-fleximod -- Script to manage the external source directories
bin/git-fleximod -- Script to manage the needed sub-component source directories (handled with git submodule)
py_env_create ----- Script to setup the python environment for CTSM python tools using conda
python ------------ Python modules used in tools and testing and automated checking of ALL CTSM python scirpts

Expand Down
31 changes: 17 additions & 14 deletions README_GITFLEXIMOD.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ To obtain the CTSM code you need to do the following:

#. Clone the repository. ::

git clone https://github.com/escomp/ctsm.git my_ctsm_sandbox
git clone https://github.com/ESCOMP/CTSM.git my_ctsm_sandbox

This will create a directory ``my_ctsm_sandbox/`` in your current working directory.

Expand All @@ -25,6 +25,10 @@ To obtain the CTSM code you need to do the following:
Additional documentation for git-fleximod appears here:
https://github.com/ESMCI/git-fleximod?tab=readme-ov-file#git-fleximod

"components" here refers to seperate git repositories for seperable parts of
the code (such as the MOSART or mizuRoute river models). Because they are
managed with "submodule" in git hereafter we will refer to them as "submodule(s)".

At this point you have a working version of CTSM.

To see full details of how to set up a case, compile and run, see the CIME documentation at http://esmci.github.io/cime/ .
Expand All @@ -33,19 +37,19 @@ More details on git-fleximod
----------------------------

The file **.gitmodules** in your top-level CTSM directory tells
**git-fleximod** which tag/branch of each component should be
brought in to generate your sandbox.
**git-fleximod** which tag/branch of each submodule
should be brought in to generate your sandbox.

NOTE: If you manually modify an external without updating .gitmodules,
NOTE: If you manually modify a submodule without updating .gitmodules,
e.g. switch to a different tag, then rerunning git-fleximod will warn you of
local changes you need to resolve.
git-fleximod will not change a modified external back to what is specified in
git-fleximod will not change a modified submodule back to what is specified in
.gitmodules without the --force option.
See below documentation `Customizing your CTSM sandbox`_ for more details.

**You need to rerun git-fleximod whenever .gitmodules has
changed** (unless you have already manually updated the relevant
external(s) to have the correct branch/tag checked out). Common times
submodule(s) to have the correct branch/tag checked out). Common times
when this is needed are:

* After checking out a new CTSM branch/tag
Expand Down Expand Up @@ -74,7 +78,7 @@ changes, or if you have any ongoing CTSM cases that were created from
this sandbox. In these cases, it is often easiest to do a second **git
clone**.

Pointing to a different version of a component
Pointing to a different version of a submodule
----------------------------------------------

Each entry in **.gitmodules** has the following form (we use CIME as an
Expand All @@ -92,11 +96,11 @@ Each entry specifies either a tag or a hash. To point to a new tag or hash:
#. Modify the relevant entry/entries in **.gitmodules** (e.g., changing
``cime6.0.246`` to ``cime6.0.247`` above)

#. Checkout the new component(s)::
#. Checkout the new submodule(s)::

./bin/git-fleximod update <component>
./bin/git-fleximod update <submodule>

Keep in mind that changing individual components from a tag may result
Keep in mind that changing individual submodule from a tag may result
in an invalid model (won't compile, won't run, not scientifically
meaningful) and is unsupported.

Expand All @@ -105,11 +109,10 @@ Committing your change to .gitmodules

After making this change, it's a good idea to commit the change in your
local CTSM git repository. First create a branch in your local
repository, then commit it. (Unlike with subversion, branches are stored
locally unless you explicitly push them up to GitHub. Feel free to
create whatever local branches you'd like.) For example::
repository, then commit it. Feel free to create whatever local branches
you'd like in git. For example::

git checkout -b my_ctsm_branch
git add .gitmodules
git commit -m "Update CIME to cime5.4.0-alpha.20"
git commit -m "Update CIME to cime6.0.247"

6 changes: 4 additions & 2 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2248,6 +2248,7 @@ sub setup_logic_urban {

add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'building_temp_method');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'urban_hac');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'urban_explicit_ac');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'urban_traffic');
}

Expand Down Expand Up @@ -3524,6 +3525,7 @@ sub setup_logic_hillslope {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'hillslope_pft_distribution_method' );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'hillslope_soil_profile_method' );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_hillslope_routing', 'use_hillslope'=>$nl_flags->{'use_hillslope'} );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'hillslope_fsat_equals_zero', 'use_hillslope'=>$nl_flags->{'use_hillslope'} );
my $use_hillslope = $nl->get_value('use_hillslope');
my $use_hillslope_routing = $nl->get_value('use_hillslope_routing');
if ( (! &value_is_true($use_hillslope)) && &value_is_true($use_hillslope_routing) ) {
Expand Down Expand Up @@ -3868,7 +3870,7 @@ sub setup_logic_urbantv_streams {
'sim_year_range'=>$nl_flags->{'sim_year_range'});
}
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_urbantv', 'phys'=>$nl_flags->{'phys'},
'hgrid'=>"0.9x1.25" );
'hgrid'=>"0.9x1.25", 'urban_explicit_ac'=>$nl->get_value('urban_explicit_ac') );
if ($opts->{'driver'} eq "nuopc" ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_urbantv', 'phys'=>$nl_flags->{'phys'},
'hgrid'=>"0.9x1.25" );
Expand Down Expand Up @@ -3981,7 +3983,7 @@ sub setup_logic_dust_emis {
foreach my $option ( @zender_files_in_lnd_opts ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $option,
'dust_emis_method'=>$dust_emis_method, 'zender_soil_erod_source'=>$zender_source,
'hgrid'=>$nl_flags->{'res'}, 'lnd_tuning_mod'=>$nl_flags->{'lnd_tuning_mode'} );
'hgrid'=>$nl_flags->{'res'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'} );
}
} else {
foreach my $option ( @zender_files_in_lnd_opts ) {
Expand Down
Loading

0 comments on commit 1ebb862

Please sign in to comment.