diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000000..10e03f7aa2
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,55 @@
+# Note that submodules should be automatically excluded.
+exclude: bin/git-fleximod, .lib/git_fleximod*, tools/contrib/.*
+
+repos:
+
+ # Various useful checks
+ - repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v5.0.0
+ hooks:
+
+ # Makes sure files end in a newline and only a newline.
+ - id: end-of-file-fixer
+ files: python/ cime_config/SystemTests/ cime_config/buildlib cime_config/buildnml
+
+ - id: check-yaml
+ files: / python/ lilac/ .github/
+
+ - id: check-xml
+
+ # Check for debugger imports and py37+ breakpoint() calls in python source
+ - id: debug-statements
+ files: python/ cime_config/SystemTests/ cime_config/buildlib cime_config/buildnml
+
+ # Checks files for mixed line endings. By default, standardizes to the most common ending.
+ - id: mixed-line-ending
+ files: python/ cime_config/SystemTests/ cime_config/buildlib cime_config/buildnml
+
+ # Prevent giant files from being committed. Default "too large" is 500KB.
+ # git-lfs files will be skipped if it is installed.
+ - id: check-added-large-files
+
+ # These two showed lot's of issues so should be worked on before turning on
+ #- id: check-executables-have-shebangs
+ # exclude: shell_commands
+ #- id: check-shebang-scripts-are-executable
+ # exclude: shell_commands
+
+ # Checks for a common error of placing code before the docstring.
+ - id: check-docstring-first
+ files: python/ cime_config/SystemTests/ cime_config/buildlib cime_config/buildnml
+
+ # Run black formatter
+ - repo: https://github.com/psf/black
+ rev: 25.1.0 # Keep this synced with version in python/conda_env_ctsm_py.yml
+ hooks:
+ - id: black
+ args: [--config, python/pyproject.toml]
+ language_version: python3.13.2
+ files: >-
+ (?x)(
+ python/.*\.py
+ cime_config/SystemTests|
+ cime_config/buildlib|
+ cime_config/buildnml|
+ )
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 70bf041ba7..40b290f311 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -16,7 +16,7 @@ https://groups.google.com/a/ucar.edu/forum/#!forum/ctsm-dev
Use the help from the wiki below to setup a fork and personal branch in GitHub to put your developments
on and keep up to date with the master branch of CTSM. Once the changes are sufficiently advanced you
-can form a Pull Request on GitHub. Either from your fork on GitHub, or from the main ESCOMP GitHub page
+can form a Pull Request (PR) on GitHub. Either from your fork on GitHub, or from the main ESCOMP GitHub page
for CTSM (be sure to hit the "compare across forks" link at the top of the page when you first create
the pull request).
@@ -24,8 +24,40 @@ https://github.com/ESCOMP/ctsm/pulls
This allows you to show your proposed changes and start getting feedback on them (even if they aren't finished).
This also allows your changes to be planned for and slated for a time to come into CTSM master. In most
-cases you won't merge the Pull Request yourself, but a software engineer responsible for CTSM will do
-additional testing and bring the changes to CTSM master.
+cases you won't merge the PR yourself, but a software engineer responsible for CTSM will do
+additional testing and bring the changes to CTSM maste
+
+In summary:
+
+- [ ] Create an issue on what you propose to do
+- [ ] Join ctsm-dev@ucar.edu group
+- [ ] Setup a fork and branch to do your work
+- [ ] Setup pre-commit (see below)
+- [ ] Get help and examine the CTSM resources below
+- [ ] Open a PR when the work is started so that we can give helpful advice on it
+- [ ] Run standard testing for your changes
+- [ ] Have the PR reviewed and priority evaluated
+- [ ] The CTSM SE team will bring it in and merge to main development
+
+## Running pre-commit and python testing
+
+We are using some formatters and code checkers to ensure the code is in reasonable shape when committed. You need to hae the ctsm_pylib to run these. The steps to do that are:
+
+Installing pre-commit:
+
+``` shell
+./py_env_create
+pre-commit install
+```
+
+Running python tests:
+
+``` shell
+./py_en_create
+cd python
+make all
+./run_ctsm_py_tests --sys
+```
### CTSM Developers Guide:
diff --git a/README.md b/README.md
index 5ea26566c9..8ee8e42e6c 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,7 @@
[](https://doi.org/10.5281/zenodo.3739617)
+[](https://github.com/psf/black)
## Overview and resources
The Community Terrestrial Systems Model.
diff --git a/bld/namelist_files/namelist_definition.xsl b/bld/namelist_files/namelist_definition.xsl
index 7917cc262f..99a9d1887a 100644
--- a/bld/namelist_files/namelist_definition.xsl
+++ b/bld/namelist_files/namelist_definition.xsl
@@ -264,7 +264,6 @@
| Name | @@ -323,6 +322,9 @@
|---|