Skip to content

cam6_4_098: CAM updates to bring in CCPP-ized RRTMGP longwave modules #1290

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

Open
wants to merge 37 commits into
base: cam_development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
247774e
use ccppized init
peverwhee Feb 10, 2025
dfb5130
merge to 060
peverwhee Feb 10, 2025
f2a263c
Merge remote-tracking branch 'ESCOMP/cam_development' into rrtmgp-lw
peverwhee Feb 10, 2025
5e9bc69
Merge remote-tracking branch 'ESCOMP/cam_development' into rrtmgp-lw
peverwhee Feb 25, 2025
eb8cc7c
rrtmgp_inputs incorporation validated
peverwhee Feb 27, 2025
7a7713c
lw cloud optics mostly done
peverwhee Mar 6, 2025
a17c311
commit everything; will disentangle what goes into ccpp-physics later
peverwhee Mar 6, 2025
9e95339
rrtmgp lw works!
peverwhee Mar 25, 2025
67a5336
add initial attempt at type wrappers; code runs but answers are wrong
peverwhee Mar 27, 2025
3b10681
finish object wrappers; answers now match again
peverwhee Mar 31, 2025
256326f
remove duplicate code; add in fix from cam_development
peverwhee Mar 31, 2025
bc68ed5
merge to head of cam_development
peverwhee Mar 31, 2025
d3ffdbd
code clean-up and adding comments
Apr 2, 2025
727c0f1
move ccppized schemes to atmospheric_physics; fix indexing issues; cl…
peverwhee Apr 3, 2025
75e7838
update atmos_phys hash
peverwhee Apr 4, 2025
217b141
update interface to calculate current calendar day on "host" side
peverwhee Apr 6, 2025
6deb499
remove unused variable
peverwhee Apr 7, 2025
56a02b6
merge to head of cam_development
peverwhee Apr 10, 2025
4961167
subset arrays in call to ccpp layers
peverwhee Apr 10, 2025
0502595
handle conditionally present pbuf fields
peverwhee Apr 10, 2025
42636a1
fix interface bug; remove unnecessary argument from cloud optics scheme
peverwhee Apr 22, 2025
6c6fa44
update atmospheric physics hash
peverwhee Apr 22, 2025
47922f0
update hash; add interstitial q variables
peverwhee May 13, 2025
7ae42ac
merge to head of cam_development
peverwhee May 13, 2025
51e82ec
Merge remote-tracking branch 'ESCOMP/cam_development' into rrtmgp-lw
peverwhee May 20, 2025
78bff29
update hash
peverwhee May 20, 2025
f22d280
Merge remote-tracking branch 'ESCOMP/cam_development' into rrtmgp-lw
Jun 3, 2025
1232b5b
address review comments
Jun 9, 2025
30ac479
subset arguments to ncol
peverwhee Jun 16, 2025
c7f1db2
address review comments
peverwhee Jun 16, 2025
5349cfe
update to latest atmos_phys hash; merge forward
peverwhee Jun 16, 2025
fe44371
take another stab at the open acc directives
peverwhee Jun 17, 2025
13d9de0
fixes to appease the nag compiler; update atmos_phys hash
Jun 17, 2025
dcbbf60
update acc directives; remove redundant lowercasing
peverwhee Jun 18, 2025
669f850
Merge remote-tracking branch 'origin/rrtmgp-lw' into rrtmgp-lw
peverwhee Jun 18, 2025
1b579d0
address reviewer comments
Jun 18, 2025
31f5513
update git-fleximod
Jun 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@

[submodule "atmos_phys"]
path = src/atmos_phys
url = https://github.com/ESCOMP/atmospheric_physics
fxtag = atmos_phys0_13_000
url = https://github.com/peverwhee/atmospheric_physics
fxtag = 2c71e1525c2cca32cc27d4175261daada52059f3
fxrequired = AlwaysRequired
fxDONOTUSEurl = https://github.com/ESCOMP/atmospheric_physics

Expand Down
107 changes: 107 additions & 0 deletions .lib/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Contributor Code of Conduct
_The Contributor Code of Conduct is for participants in our software projects and community._

## Our Pledge
We, as contributors, creators, stewards, and maintainers (participants), of **git-fleximod** pledge to make participation in
our software, system or hardware project and community a safe, productive, welcoming and inclusive experience for everyone.
All participants are required to abide by this Code of Conduct.
This includes respectful treatment of everyone regardless of age, body size, disability, ethnicity, gender identity or expression,
level of experience, nationality, political affiliation, veteran status, pregnancy, genetic information, physical appearance, race,
religion, or sexual orientation, as well as any other characteristic protected under applicable US federal or state law.

## Our Standards
Examples of behaviors that contribute to a positive environment include:

* All participants are treated with respect and consideration, valuing a diversity of views and opinions
* Be considerate, respectful, and collaborative
* Communicate openly with respect for others, critiquing ideas rather than individuals and gracefully accepting criticism
* Acknowledging the contributions of others
* Avoid personal attacks directed toward other participants
* Be mindful of your surroundings and of your fellow participants
* Alert UCAR staff and suppliers/vendors if you notice a dangerous situation or someone in distress
* Respect the rules and policies of the project and venue

Examples of unacceptable behavior include, but are not limited to:

* Harassment, intimidation, or discrimination in any form
* Physical, verbal, or written abuse by anyone to anyone, including repeated use of pronouns other than those requested
* Unwelcome sexual attention or advances
* Personal attacks directed at other guests, members, participants, etc.
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Alarming, intimidating, threatening, or hostile comments or conduct
* Inappropriate use of nudity and/or sexual images
* Threatening or stalking anyone, including a participant
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Scope
This Code of Conduct applies to all spaces managed by the Project whether they be physical, online or face-to-face.
This includes project code, code repository, associated web pages, documentation, mailing lists, project websites and wiki pages,
issue tracker, meetings, telecons, events, project social media accounts, and any other forums created by the project team which the
community uses for communication.
In addition, violations of this Code of Conduct outside these spaces may affect a person's ability to participate within them.
Representation of a project may be further defined and clarified by project maintainers.

## Community Responsibilities
Everyone in the community is empowered to respond to people who are showing unacceptable behavior.
They can talk to them privately or publicly.
Anyone requested to stop unacceptable behavior is expected to comply immediately.
If the behavior continues concerns may be brought to the project administrators or to any other party listed in the
[Reporting](#reporting) section below.

## Project Administrator Responsibilities
Project administrators are responsible for clarifying the standards of acceptable behavior and are encouraged to model appropriate
behavior and provide support when people in the community point out inappropriate behavior.
Project administrator(s) are normally the ones that would be tasked to carry out the actions in the [Consequences](#consequences)
section below.

Project administrators are also expected to keep this Code of Conduct updated with the main one housed at UCAR, as listed below in
the [Attribution](#attribution) section.

## Reporting
Instances of unacceptable behavior can be brought to the attention of the project administrator(s) who may take any action as
outlined in the [Consequences](#consequences) section below.
However, making a report to a project administrator is not considered an 'official report' to UCAR.

Instances of unacceptable behavior may also be reported directly to UCAR pursuant to [UCAR's Harassment Reporting and Complaint
Procedure](https://www2.fin.ucar.edu/procedures/hr/harassment-reporting-and-complaint-procedure), or anonymously through [UCAR's
EthicsPoint Hotline](https://www2.fin.ucar.edu/ethics/anonymous-reporting).

Complaints received by UCAR will be handled pursuant to the procedures outlined in UCAR's Harassment Reporting and Complaint
Procedure.
Complaints to UCAR will be held as confidential as practicable under the circumstances, and retaliation against a person who
initiates a complaint or an inquiry about inappropriate behavior will not be tolerated.

Any Contributor can use these reporting methods even if they are not directly affiliated with UCAR.
The Frequently Asked Questions (FAQ) page for reporting is [here](https://www2.fin.ucar.edu/procedures/hr/reporting-faqs).

## Consequences
Upon receipt of a complaint, the project administrator(s) may take any action deemed necessary and appropriate under the
circumstances.
Such action can include things such as: removing, editing, or rejecting comments, commits, code, wiki edits, email, issues, and
other contributions that are not aligned to this Code of Conduct, or banning temporarily or permanently any contributor for other
behaviors that are deemed inappropriate, threatening, offensive, or harmful.
Project administrators also have the right to report violations to UCAR HR and/or UCAR's Office of Diversity, Equity and Inclusion
(ODEI), as well as a participant's home institution and/or law enforcement.
In the event an incident is reported to UCAR, UCAR will follow its Harassment Reporting and Complaint Procedure.

## Process for Changes
All UCAR managed projects are required to adopt this Contributor Code of Conduct.
Adoption is assumed even if not expressly stated in the repository.
Projects should fill in sections where prompted with project-specific information, including, project name and adoption date.

Projects that adopt this Code of Conduct need to stay up to date with UCAR's Contributor Code of Conduct, linked with a DOI in the
[Attribution](#attribution) section below.
Projects can make limited substantive changes to the Code of Conduct, however, the changes must be limited in scope and may not
contradict the UCAR Contributor Code of Conduct.

## Attribution
This Code of Conduct was originally adapted from the [Contributor Covenant](http://contributor-covenant.org/version/1/4), version
1.4.
We then aligned it with the UCAR Participant Code of Conduct, which also borrows from the American Geophysical Union (AGU) Code of
Conduct.
The UCAR Participant Code of Conduct applies to both UCAR employees as well as participants in activities run by UCAR.
The original version of this for all software projects that have strong management from UCAR or UCAR staff is available on the UCAR
website at https://doi.org/10.5065/6w2c-a132.
The date that it was adopted by this project was **Feb/13/2018**.
When responding to complaints, UCAR HR and ODEI will do so based on the latest published version.
Therefore, any project-specific changes should follow the [Process for Changes](#process-for-changes) section above.
20 changes: 20 additions & 0 deletions .lib/License
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright 2024 NSF National Center for Atmospheric Sciences (NCAR)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
“Software”), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
108 changes: 108 additions & 0 deletions .lib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# git-fleximod

Flexible, Enhanced Submodule Management for Git

## Overview

Git-fleximod is a Python-based tool that extends Git's submodule and sparse checkout capabilities, offering additional features for managing submodules in a more flexible and efficient way.

## Installation

If you choose to locate git-fleximod in your path you can access it via command: git fleximod

## Usage

Basic Usage:
git fleximod <command> [options]
Available Commands:
status: Display the status of submodules.
update: Update submodules to the tag indicated in .gitmodules variable fxtag.
test: Make sure that fxtags and submodule hashes are consistant,
make sure that official urls (as defined by fxDONOTUSEurl) are set
make sure that fxtags are defined for all submodules
Additional Options:
See git fleximod --help for more details.

## Supported .gitmodules Variables

fxtag: Specify a specific tag or branch to checkout for a submodule.
fxrequired: Mark a submodule's checkout behavior, with allowed values:
- ToplevelRequired: Top-level and required (checked out only when this is the Toplevel module).
- ToplevelOptional: Top-level and optional (checked out with --optional flag if this is the Toplevel module).
- AlwaysRequired: Always required (always checked out).
- AlwaysOptional: Always optional (checked out with --optional flag).
fxsparse: Enable sparse checkout for a submodule, pointing to a file containing sparse checkout paths.
fxDONOTUSEurl: This is the url used in the test subcommand to assure that protected branches do not point to forks
**NOTE** the fxDONOTUSEurl variable is only used to identify the official project repository and should not be
changed by users. Use the url variable to change to a fork if desired.

## Sparse Checkouts

To enable sparse checkout for a submodule, set the fxsparse variable
in the .gitmodules file to the path of a file containing the desired
sparse checkout paths. Git-fleximod will automatically configure
sparse checkout based on this file when applicable commands are run.
See [git-sparse-checkout](https://git-scm.com/docs/git-sparse-checkout#_internalsfull_pattern_set)
for details on the format of this file.

## Tests

The git fleximod test action is designed to be used by, for example, github workflows
to assure that protected branches are consistant with respect to submodule hashes and fleximod fxtags

## Examples

Here are some common usage examples:

Update all submodules, including optional ones:
```bash
git fleximod update --optional
```

Updating a specific submodule to the fxtag indicated in .gitmodules:

```bash
git fleximod update submodule-name
```
Example .gitmodules entry:
```ini, toml
[submodule "cosp2"]
path = src/physics/cosp2/src
url = https://github.com/CFMIP/COSPv2.0
fxsparse = ../.cosp_sparse_checkout
fxrequired = AlwaysRequired
fxtag = v2.1.4cesm
```
Explanation:

This entry indicates that the submodule named cosp2 at tag v2.1.4cesm
should be checked out into the directory src/physics/cosp2/src
relative to the .gitmodules directory. It should be checked out from
the URL https://github.com/CFMIP/COSPv2.0 and use sparse checkout as
described in the file ../.cosp_sparse_checkout relative to the path
directory. It should be checked out anytime this .gitmodules entry is
read.

Additional example:
```ini, toml
[submodule "cime"]
path = cime
url = https://github.com/jedwards4b/cime
fxrequired = ToplevelRequired
fxtag = cime6.0.198_rme01
```

Explanation:

This entry indicates that the submodule cime should be checked out
into a directory named cime at tag cime6.0.198_rme01 from the URL
https://github.com/jedwards4b/cime. This should only be done if
the .gitmodules file is at the top level of the repository clone.

## Contributing

We welcome contributions! Please see the CONTRIBUTING.md file for guidelines.

## License

Git-fleximod is released under the MIT License.
20 changes: 20 additions & 0 deletions .lib/doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
26 changes: 26 additions & 0 deletions .lib/doc/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "git-fleximod"
author = "Jim Edwards <[email protected]>"
release = "0.4.0"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = ["sphinx_argparse_cli"]

templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = "alabaster"
html_static_path = ["_static"]
24 changes: 24 additions & 0 deletions .lib/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.. git-fleximod documentation master file, created by
sphinx-quickstart on Sat Feb 3 12:02:22 2024.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.

Welcome to git-fleximod's documentation!
========================================

.. toctree::
:maxdepth: 2
:caption: Contents:
.. module:: sphinxcontrib.autoprogram
.. sphinx_argparse_cli::
:module: git_fleximod.cli
:func: get_parser
:prog: git-fleximod


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
35 changes: 35 additions & 0 deletions .lib/doc/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
25 changes: 25 additions & 0 deletions .lib/escomp_install
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env python
# updates git-fleximod in an ESCOMP model
# this script should be run from the model root directory, it expects
# git-fleximod to already be installed with the script in bin
# and the classes in lib/python/site-packages
import sys
import shutil
import os

from glob import iglob

fleximod_root = sys.argv[1]
fleximod_path = os.path.join(fleximod_root,"src","git-fleximod")
if os.path.isfile(fleximod_path):
with open(fleximod_path,"r") as f:
fleximod = f.readlines()
with open(os.path.join(".","bin","git-fleximod"),"w") as f:
for line in fleximod:
f.write(line)
if "import argparse" in line:
f.write('\nsys.path.append(os.path.join(os.path.dirname(__file__),"..","lib","python","site-packages"))\n\n')

for file in iglob(os.path.join(fleximod_root, "src", "fleximod", "*.py")):
shutil.copy(file,
os.path.join("lib","python","site-packages","fleximod",os.path.basename(file)))
3 changes: 2 additions & 1 deletion .lib/git-fleximod/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "git-fleximod"
version = "0.9.4"
version = "1.0.1"
description = "Extended support for git-submodule and git-sparse-checkout"
authors = ["Jim Edwards <[email protected]>"]
maintainers = ["Jim Edwards <[email protected]>"]
Expand All @@ -11,6 +11,7 @@ keywords = ["git", "submodule", "sparse-checkout"]
packages = [
{ include = "git_fleximod"},
{ include = "doc"},
{ include = "README.md"},
]

[tool.poetry.scripts]
Expand Down
Loading
Loading