diff --git a/.github/actions/macos-setup/action.yml b/.github/actions/macos-setup/action.yml
index caa6f193bb..0c1116f25b 100644
--- a/.github/actions/macos-setup/action.yml
+++ b/.github/actions/macos-setup/action.yml
@@ -1,3 +1,7 @@
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
+
name: 'install-macos-prerequisites'
description: 'Install prerequisites for Mac OS compilation'
diff --git a/.github/actions/ubuntu-setup/action.yml b/.github/actions/ubuntu-setup/action.yml
index 0f53a68c70..22d8ae897a 100644
--- a/.github/actions/ubuntu-setup/action.yml
+++ b/.github/actions/ubuntu-setup/action.yml
@@ -1,3 +1,7 @@
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
+
name: 'install-ubuntu-prerequisites'
description: 'Install prerequisites for Ubuntu Linux compilation'
diff --git a/.github/workflows/verify-linux.yml b/.github/workflows/verify-linux.yml
index 4c2817f4ee..2bc7a66255 100644
--- a/.github/workflows/verify-linux.yml
+++ b/.github/workflows/verify-linux.yml
@@ -1,3 +1,7 @@
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
+
name: Linux verification
on: [push, pull_request]
diff --git a/.github/workflows/verify-macos.yml b/.github/workflows/verify-macos.yml
index d058336053..5ba0669b7a 100644
--- a/.github/workflows/verify-macos.yml
+++ b/.github/workflows/verify-macos.yml
@@ -1,3 +1,7 @@
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
+
name: MacOS verification
on: [push, pull_request]
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5aa48ae919..b1f7f4bf4d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,3 +1,7 @@
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
+
stages:
- setup
- builds
diff --git a/.gitlab/mom6-ci-run-gnu-restarts-script.sh b/.gitlab/mom6-ci-run-gnu-restarts-script.sh
index 02af3460b4..104dc40567 100644
--- a/.gitlab/mom6-ci-run-gnu-restarts-script.sh
+++ b/.gitlab/mom6-ci-run-gnu-restarts-script.sh
@@ -1,4 +1,7 @@
#!/bin/bash
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
sect=none
clean_stats () { # fn to clean up stats files
diff --git a/.gitlab/mom6-ci-run-gnu-script.sh b/.gitlab/mom6-ci-run-gnu-script.sh
index 8577eff6d2..13dfe00111 100644
--- a/.gitlab/mom6-ci-run-gnu-script.sh
+++ b/.gitlab/mom6-ci-run-gnu-script.sh
@@ -1,4 +1,7 @@
#!/bin/bash
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
sect=none
clean_stats () { # fn to clean up stats files
diff --git a/.gitlab/mom6-ci-run-intel-script.sh b/.gitlab/mom6-ci-run-intel-script.sh
index 875d60c191..01a2888e80 100644
--- a/.gitlab/mom6-ci-run-intel-script.sh
+++ b/.gitlab/mom6-ci-run-intel-script.sh
@@ -1,4 +1,7 @@
#!/bin/bash
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
sect=none
clean_stats () { # fn to clean up stats files
diff --git a/.gitlab/mom6-ci-run-pgi-script.sh b/.gitlab/mom6-ci-run-pgi-script.sh
index 27216e4a9f..4e55b5ced8 100644
--- a/.gitlab/mom6-ci-run-pgi-script.sh
+++ b/.gitlab/mom6-ci-run-pgi-script.sh
@@ -1,4 +1,7 @@
#!/bin/bash
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
sect=none
clean_stats () { # fn to clean up stats files
diff --git a/.gitlab/pipeline-ci-tool.sh b/.gitlab/pipeline-ci-tool.sh
index d948b72008..a6948c765e 100755
--- a/.gitlab/pipeline-ci-tool.sh
+++ b/.gitlab/pipeline-ci-tool.sh
@@ -1,4 +1,7 @@
#!/bin/bash
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
# Environment variables set by gitlab (the CI environment)
if [ -z $JOB_DIR ]; then
diff --git a/.testing/Makefile b/.testing/Makefile
index 71d5b464f0..4e6827da2f 100644
--- a/.testing/Makefile
+++ b/.testing/Makefile
@@ -1,3 +1,7 @@
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
+
# MOM6 Test suite Makefile
#
# Usage:
diff --git a/.testing/tc4/Makefile.in b/.testing/tc4/Makefile.in
index 714a8f19f1..4d2e40a1bb 100644
--- a/.testing/tc4/Makefile.in
+++ b/.testing/tc4/Makefile.in
@@ -1,3 +1,7 @@
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
+
FC = @FC@
LD = @LD@
FCFLAGS = @FCFLAGS@
diff --git a/.testing/tc4/configure.ac b/.testing/tc4/configure.ac
index c431ad65ef..d5dc142e85 100644
--- a/.testing/tc4/configure.ac
+++ b/.testing/tc4/configure.ac
@@ -1,3 +1,7 @@
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
+
# tc4 preprocessor configuration
AC_PREREQ([2.63])
AC_INIT([], [])
diff --git a/.testing/tc4/gen_data.F90 b/.testing/tc4/gen_data.F90
index 8f44aa1465..406d44e54a 100644
--- a/.testing/tc4/gen_data.F90
+++ b/.testing/tc4/gen_data.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
use netcdf
implicit none
diff --git a/.testing/tc4/gen_grid.F90 b/.testing/tc4/gen_grid.F90
index e76a681924..4ddabb7846 100644
--- a/.testing/tc4/gen_grid.F90
+++ b/.testing/tc4/gen_grid.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
use netcdf
implicit none
diff --git a/.testing/tools/cmp_diag.sh b/.testing/tools/cmp_diag.sh
index 03f29a5fd2..8bf0fd806f 100755
--- a/.testing/tools/cmp_diag.sh
+++ b/.testing/tools/cmp_diag.sh
@@ -1,4 +1,7 @@
#!/bin/bash
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
for chk in $1 $2; do
awk '{print $(NF-2) " " $(NF-1) " " $(NF),$0}' ${chk} | sort > ${chk}.sorted
diff --git a/.testing/tools/compare_clocks.py b/.testing/tools/compare_clocks.py
index 77198fda6a..09e6fe2439 100755
--- a/.testing/tools/compare_clocks.py
+++ b/.testing/tools/compare_clocks.py
@@ -1,4 +1,8 @@
#!/usr/bin/env python
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
+
import argparse
import json
diff --git a/.testing/tools/compare_perf.py b/.testing/tools/compare_perf.py
index 7b1f3fda8d..65afc58c01 100755
--- a/.testing/tools/compare_perf.py
+++ b/.testing/tools/compare_perf.py
@@ -1,4 +1,8 @@
#!/usr/bin/env python
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
+
import argparse
import json
diff --git a/.testing/tools/diff_diag.sh b/.testing/tools/diff_diag.sh
index de9745df6a..edbd0c934f 100755
--- a/.testing/tools/diff_diag.sh
+++ b/.testing/tools/diff_diag.sh
@@ -1,4 +1,7 @@
#!/bin/bash
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
for chk in $1 $2; do
awk '{print $(NF-2) " " $(NF-1) " " $(NF),$0}' ${chk} | sort > ${chk}.sorted
diff --git a/.testing/tools/disp_timing.py b/.testing/tools/disp_timing.py
index 0b3163625a..55637abbef 100755
--- a/.testing/tools/disp_timing.py
+++ b/.testing/tools/disp_timing.py
@@ -1,4 +1,7 @@
#!/usr/bin/env python3
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
from __future__ import print_function
diff --git a/.testing/tools/parse_fms_clocks.py b/.testing/tools/parse_fms_clocks.py
index fd3e7179d7..4125f09475 100755
--- a/.testing/tools/parse_fms_clocks.py
+++ b/.testing/tools/parse_fms_clocks.py
@@ -1,4 +1,8 @@
#!/usr/bin/env python
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
+
import argparse
import collections
import json
diff --git a/.testing/tools/parse_perf.py b/.testing/tools/parse_perf.py
index efcfa13b4f..4673022756 100755
--- a/.testing/tools/parse_perf.py
+++ b/.testing/tools/parse_perf.py
@@ -1,4 +1,8 @@
#!/usr/bin/env python
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
+
import argparse
import collections
import json
diff --git a/.testing/tools/report_test_results.sh b/.testing/tools/report_test_results.sh
index 24bab45507..bc5376a837 100755
--- a/.testing/tools/report_test_results.sh
+++ b/.testing/tools/report_test_results.sh
@@ -1,4 +1,8 @@
#!/bin/sh
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
+
RESULTS=${1:-${PWD}/results}
GREEN="\033[0;32m"
diff --git a/.testing/trailer.py b/.testing/trailer.py
index 64f016275f..495f1cc6e3 100755
--- a/.testing/trailer.py
+++ b/.testing/trailer.py
@@ -1,4 +1,8 @@
#!/usr/bin/env python
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
+
"""Subroutines for Validating the whitespace of the source code."""
import argparse
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000000..f433b1a53f
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,177 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
diff --git a/LICENSE.md b/LICENSE.md
deleted file mode 100644
index 5528208587..0000000000
--- a/LICENSE.md
+++ /dev/null
@@ -1,173 +0,0 @@
-This file is part of the Modular Ocean Model, referred to as MOM, which is made
-available under version 3 of the Gnu Lesser General Public License, which is
-provided below.
-
-The intent of this license is to ensure free and unrestricted access to the MOM
-software, and to pass on those rights to modified versions this software.
-
-
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
- This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
- 0. Additional Definitions.
-
- As used herein, "this License" refers to version 3 of the GNU Lesser
-General Public License, and the "GNU GPL" refers to version 3 of the GNU
-General Public License.
-
- "The Library" refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
- An "Application" is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
- A "Combined Work" is a work produced by combining or linking an
-Application with the Library. The particular version of the Library
-with which the Combined Work was made is also called the "Linked
-Version".
-
- The "Minimal Corresponding Source" for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
- The "Corresponding Application Code" for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
- 1. Exception to Section 3 of the GNU GPL.
-
- You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
- 2. Conveying Modified Versions.
-
- If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
- a) under this License, provided that you make a good faith effort to
- ensure that, in the event an Application does not supply the
- function or data, the facility still operates, and performs
- whatever part of its purpose remains meaningful, or
-
- b) under the GNU GPL, with none of the additional permissions of
- this License applicable to that copy.
-
- 3. Object Code Incorporating Material from Library Header Files.
-
- The object code form of an Application may incorporate material from
-a header file that is part of the Library. You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
- a) Give prominent notice with each copy of the object code that the
- Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the object code with a copy of the GNU GPL and this license
- document.
-
- 4. Combined Works.
-
- You may convey a Combined Work under terms of your choice that,
-taken together, effectively do not restrict modification of the
-portions of the Library contained in the Combined Work and reverse
-engineering for debugging such modifications, if you also do each of
-the following:
-
- a) Give prominent notice with each copy of the Combined Work that
- the Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the Combined Work with a copy of the GNU GPL and this license
- document.
-
- c) For a Combined Work that displays copyright notices during
- execution, include the copyright notice for the Library among
- these notices, as well as a reference directing the user to the
- copies of the GNU GPL and this license document.
-
- d) Do one of the following:
-
- 0) Convey the Minimal Corresponding Source under the terms of this
- License, and the Corresponding Application Code in a form
- suitable for, and under terms that permit, the user to
- recombine or relink the Application with a modified version of
- the Linked Version to produce a modified Combined Work, in the
- manner specified by section 6 of the GNU GPL for conveying
- Corresponding Source.
-
- 1) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (a) uses at run time
- a copy of the Library already present on the user's computer
- system, and (b) will operate properly with a modified version
- of the Library that is interface-compatible with the Linked
- Version.
-
- e) Provide Installation Information, but only if you would otherwise
- be required to provide such information under section 6 of the
- GNU GPL, and only to the extent that such information is
- necessary to install and execute a modified version of the
- Combined Work produced by recombining or relinking the
- Application with a modified version of the Linked Version. (If
- you use option 4d0, the Installation Information must accompany
- the Minimal Corresponding Source and Corresponding Application
- Code. If you use option 4d1, you must provide the Installation
- Information in the manner specified by section 6 of the GNU GPL
- for conveying Corresponding Source.)
-
- 5. Combined Libraries.
-
- You may place library facilities that are a work based on the
-Library side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
- a) Accompany the combined library with a copy of the same work based
- on the Library, uncombined with any other library facilities,
- conveyed under the terms of this License.
-
- b) Give prominent notice with the combined library that part of it
- is a work based on the Library, and explaining where to find the
- accompanying uncombined form of the same work.
-
- 6. Revised Versions of the GNU Lesser General Public License.
-
- The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Library as you received it specifies that a certain numbered version
-of the GNU Lesser General Public License "or any later version"
-applies to it, you have the option of following the terms and
-conditions either of that published version or of any later version
-published by the Free Software Foundation. If the Library as you
-received it does not specify a version number of the GNU Lesser
-General Public License, you may choose any version of the GNU Lesser
-General Public License ever published by the Free Software Foundation.
-
- If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the
-Library.
diff --git a/ac/Makefile.in b/ac/Makefile.in
index c4d23efdfb..da321067b2 100644
--- a/ac/Makefile.in
+++ b/ac/Makefile.in
@@ -1,3 +1,7 @@
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
+
# Makefile template for MOM6
#
# Compiler flags are configured by autoconf's configure script.
diff --git a/ac/configure.ac b/ac/configure.ac
index 071f43f5a9..201bb262c4 100644
--- a/ac/configure.ac
+++ b/ac/configure.ac
@@ -1,3 +1,7 @@
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
+
# Autoconf configuration
# NOTE:
diff --git a/ac/deps/Makefile b/ac/deps/Makefile
index 01431cef8c..00aeedd238 100644
--- a/ac/deps/Makefile
+++ b/ac/deps/Makefile
@@ -1,3 +1,7 @@
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
+
SHELL = bash
# Disable implicit rules
diff --git a/ac/deps/Makefile.fms.in b/ac/deps/Makefile.fms.in
index e4617f1428..05680c5af1 100644
--- a/ac/deps/Makefile.fms.in
+++ b/ac/deps/Makefile.fms.in
@@ -1,3 +1,7 @@
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
+
# Makefile template for FMS
#
# Compiler flags are configured by autoconf's configure script.
diff --git a/ac/deps/configure.fms.ac b/ac/deps/configure.fms.ac
index 7d68daa3c7..8aef4eaccf 100644
--- a/ac/deps/configure.fms.ac
+++ b/ac/deps/configure.fms.ac
@@ -1,3 +1,7 @@
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
+
# Autoconf configuration
AC_PREREQ([2.63])
diff --git a/ac/deps/m4/ax_fc_allow_arg_mismatch.m4 b/ac/deps/m4/ax_fc_allow_arg_mismatch.m4
index cffa302c66..a525e4f28a 100644
--- a/ac/deps/m4/ax_fc_allow_arg_mismatch.m4
+++ b/ac/deps/m4/ax_fc_allow_arg_mismatch.m4
@@ -1,3 +1,7 @@
+dnl This file is part of MOM6, the Modular Ocean Model version 6.
+dnl See the LICENSE file for licensing information.
+dnl SPDX-License-Identifier: Apache-2.0
+dnl
dnl Test if mismatched function arguments are permitted.
dnl
dnl This macro tests if a flag is required to enable mismatched functions in
diff --git a/ac/deps/m4/ax_fc_allow_invalid_boz.m4 b/ac/deps/m4/ax_fc_allow_invalid_boz.m4
index 5d4521b5fb..ef2b20342f 100644
--- a/ac/deps/m4/ax_fc_allow_invalid_boz.m4
+++ b/ac/deps/m4/ax_fc_allow_invalid_boz.m4
@@ -1,3 +1,7 @@
+dnl This file is part of MOM6, the Modular Ocean Model version 6.
+dnl See the LICENSE file for licensing information.
+dnl SPDX-License-Identifier: Apache-2.0
+dnl
dnl Test if BOZ literal assignment is supported.
dnl
dnl This macro tests if a flag is required to enable BOZ literal assignments
diff --git a/ac/deps/m4/ax_fc_check_c_lib.m4 b/ac/deps/m4/ax_fc_check_c_lib.m4
index af5765282a..692fe722df 100644
--- a/ac/deps/m4/ax_fc_check_c_lib.m4
+++ b/ac/deps/m4/ax_fc_check_c_lib.m4
@@ -1,3 +1,7 @@
+dnl This file is part of MOM6, the Modular Ocean Model version 6.
+dnl See the LICENSE file for licensing information.
+dnl SPDX-License-Identifier: Apache-2.0
+dnl
dnl AX_FC_CHECK_C_LIB(LIBRARY, FUNCTION,
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
dnl [OTHER-LDFLAGS], [OTHER-LIBS])
diff --git a/ac/deps/m4/ax_fc_check_lib.m4 b/ac/deps/m4/ax_fc_check_lib.m4
index a7f848cd60..4074b52e46 100644
--- a/ac/deps/m4/ax_fc_check_lib.m4
+++ b/ac/deps/m4/ax_fc_check_lib.m4
@@ -1,3 +1,7 @@
+dnl This file is part of MOM6, the Modular Ocean Model version 6.
+dnl See the LICENSE file for licensing information.
+dnl SPDX-License-Identifier: Apache-2.0
+dnl
dnl AX_FC_CHECK_LIB(LIBRARY, FUNCTION,
dnl [MODULE], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
dnl [OTHER-LDFLAGS], [OTHER-LIBS])
diff --git a/ac/deps/m4/ax_fc_check_module.m4 b/ac/deps/m4/ax_fc_check_module.m4
index 1cfd0c5a5d..e902882524 100644
--- a/ac/deps/m4/ax_fc_check_module.m4
+++ b/ac/deps/m4/ax_fc_check_module.m4
@@ -1,3 +1,7 @@
+dnl This file is part of MOM6, the Modular Ocean Model version 6.
+dnl See the LICENSE file for licensing information.
+dnl SPDX-License-Identifier: Apache-2.0
+dnl
dnl AX_FC_CHECK_MODULE(MODULE,
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
dnl [OTHER-FCFLAGS])
diff --git a/ac/deps/m4/ax_fc_cray_pointer.m4 b/ac/deps/m4/ax_fc_cray_pointer.m4
index 57ed186afa..aef870c75d 100644
--- a/ac/deps/m4/ax_fc_cray_pointer.m4
+++ b/ac/deps/m4/ax_fc_cray_pointer.m4
@@ -1,3 +1,7 @@
+dnl This file is part of MOM6, the Modular Ocean Model version 6.
+dnl See the LICENSE file for licensing information.
+dnl SPDX-License-Identifier: Apache-2.0
+dnl
dnl AX_FC_CRAY_POINTER([ACTION-IF-SUCCESS], [ACTION-IF-FAILURE])
dnl
dnl This macro tests if any flags are required to enable Cray pointers.
diff --git a/ac/deps/m4/ax_fc_line_length.m4 b/ac/deps/m4/ax_fc_line_length.m4
index 97271da1f6..90770469da 100644
--- a/ac/deps/m4/ax_fc_line_length.m4
+++ b/ac/deps/m4/ax_fc_line_length.m4
@@ -1,3 +1,7 @@
+dnl This file is part of MOM6, the Modular Ocean Model version 6.
+dnl See the LICENSE file for licensing information.
+dnl SPDX-License-Identifier: Apache-2.0
+dnl
# AX_FC_LINE_LENGTH([LENGTH], [ACTION-IF-SUCCESS],
# [ACTION-IF-FAILURE = FAILURE])
# ------------------------------------------------
diff --git a/ac/deps/m4/ax_fc_real8.m4 b/ac/deps/m4/ax_fc_real8.m4
index 565018a984..15f0acda22 100644
--- a/ac/deps/m4/ax_fc_real8.m4
+++ b/ac/deps/m4/ax_fc_real8.m4
@@ -1,3 +1,7 @@
+dnl This file is part of MOM6, the Modular Ocean Model version 6.
+dnl See the LICENSE file for licensing information.
+dnl SPDX-License-Identifier: Apache-2.0
+dnl
dnl Determine the flag required to force 64-bit reals.
dnl
dnl Many applications do not specify the kind of its real variables, even
diff --git a/ac/m4/ax_fc_check_bind_c.m4 b/ac/m4/ax_fc_check_bind_c.m4
index 9b9f821d4c..e2a42f1bfb 100644
--- a/ac/m4/ax_fc_check_bind_c.m4
+++ b/ac/m4/ax_fc_check_bind_c.m4
@@ -1,3 +1,7 @@
+dnl This file is part of MOM6, the Modular Ocean Model version 6.
+dnl See the LICENSE file for licensing information.
+dnl SPDX-License-Identifier: Apache-2.0
+dnl
dnl AX_FC_CHECK_C_LIB(FUNCTION,
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
dnl [OTHER-LDFLAGS], [OTHER-LIBS])
diff --git a/ac/m4/ax_fc_check_c_lib.m4 b/ac/m4/ax_fc_check_c_lib.m4
index af5765282a..692fe722df 100644
--- a/ac/m4/ax_fc_check_c_lib.m4
+++ b/ac/m4/ax_fc_check_c_lib.m4
@@ -1,3 +1,7 @@
+dnl This file is part of MOM6, the Modular Ocean Model version 6.
+dnl See the LICENSE file for licensing information.
+dnl SPDX-License-Identifier: Apache-2.0
+dnl
dnl AX_FC_CHECK_C_LIB(LIBRARY, FUNCTION,
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
dnl [OTHER-LDFLAGS], [OTHER-LIBS])
diff --git a/ac/m4/ax_fc_check_lib.m4 b/ac/m4/ax_fc_check_lib.m4
index a7f848cd60..4074b52e46 100644
--- a/ac/m4/ax_fc_check_lib.m4
+++ b/ac/m4/ax_fc_check_lib.m4
@@ -1,3 +1,7 @@
+dnl This file is part of MOM6, the Modular Ocean Model version 6.
+dnl See the LICENSE file for licensing information.
+dnl SPDX-License-Identifier: Apache-2.0
+dnl
dnl AX_FC_CHECK_LIB(LIBRARY, FUNCTION,
dnl [MODULE], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
dnl [OTHER-LDFLAGS], [OTHER-LIBS])
diff --git a/ac/m4/ax_fc_check_module.m4 b/ac/m4/ax_fc_check_module.m4
index 1cfd0c5a5d..e902882524 100644
--- a/ac/m4/ax_fc_check_module.m4
+++ b/ac/m4/ax_fc_check_module.m4
@@ -1,3 +1,7 @@
+dnl This file is part of MOM6, the Modular Ocean Model version 6.
+dnl See the LICENSE file for licensing information.
+dnl SPDX-License-Identifier: Apache-2.0
+dnl
dnl AX_FC_CHECK_MODULE(MODULE,
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
dnl [OTHER-FCFLAGS])
diff --git a/ac/m4/ax_fc_real8.m4 b/ac/m4/ax_fc_real8.m4
index 565018a984..15f0acda22 100644
--- a/ac/m4/ax_fc_real8.m4
+++ b/ac/m4/ax_fc_real8.m4
@@ -1,3 +1,7 @@
+dnl This file is part of MOM6, the Modular Ocean Model version 6.
+dnl See the LICENSE file for licensing information.
+dnl SPDX-License-Identifier: Apache-2.0
+dnl
dnl Determine the flag required to force 64-bit reals.
dnl
dnl Many applications do not specify the kind of its real variables, even
diff --git a/config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90 b/config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90
index 07bff26395..1a4981ccee 100644
--- a/config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90
+++ b/config_src/drivers/FMS_cap/MOM_surface_forcing_gfdl.F90
@@ -1,6 +1,8 @@
-module MOM_surface_forcing_gfdl
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
-! This file is part of MOM6. See LICENSE.md for the license.
+module MOM_surface_forcing_gfdl
!#CTRL# use MOM_controlled_forcing, only : apply_ctrl_forcing, register_ctrl_forcing_restarts
!#CTRL# use MOM_controlled_forcing, only : controlled_forcing_init, controlled_forcing_end
diff --git a/config_src/drivers/FMS_cap/ocean_model_MOM.F90 b/config_src/drivers/FMS_cap/ocean_model_MOM.F90
index e3b7b0cec7..110415c6e0 100644
--- a/config_src/drivers/FMS_cap/ocean_model_MOM.F90
+++ b/config_src/drivers/FMS_cap/ocean_model_MOM.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Top-level module for the MOM6 ocean model in coupled mode.
module ocean_model_mod
-! This file is part of MOM6. See LICENSE.md for the license.
-
! This is the top level module for the MOM6 ocean model. It contains routines
! for initialization, termination and update of ocean model state. This
! particular version wraps all of the calls for MOM6 in the calls that had
diff --git a/config_src/drivers/STALE_mct_cap/mom_ocean_model_mct.F90 b/config_src/drivers/STALE_mct_cap/mom_ocean_model_mct.F90
index d1c46f4254..6e1545efe1 100644
--- a/config_src/drivers/STALE_mct_cap/mom_ocean_model_mct.F90
+++ b/config_src/drivers/STALE_mct_cap/mom_ocean_model_mct.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Top-level module for the MOM6 ocean model in coupled mode.
module MOM_ocean_model_mct
-! This file is part of MOM6. See LICENSE.md for the license.
-
! This is the top level module for the MOM6 ocean model. It contains routines
! for initialization, termination and update of ocean model state. This
! particular version wraps all of the calls for MOM6 in the calls that had
diff --git a/config_src/drivers/STALE_mct_cap/mom_surface_forcing_mct.F90 b/config_src/drivers/STALE_mct_cap/mom_surface_forcing_mct.F90
index e5c5943d4f..5df0d2a3f6 100644
--- a/config_src/drivers/STALE_mct_cap/mom_surface_forcing_mct.F90
+++ b/config_src/drivers/STALE_mct_cap/mom_surface_forcing_mct.F90
@@ -1,6 +1,8 @@
-module MOM_surface_forcing_mct
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
-! This file is part of MOM6. See LICENSE.md for the license.
+module MOM_surface_forcing_mct
use MOM_coms, only : reproducing_sum, field_chksum
use MOM_constants, only : hlv, hlf
diff --git a/config_src/drivers/STALE_mct_cap/ocn_cap_methods.F90 b/config_src/drivers/STALE_mct_cap/ocn_cap_methods.F90
index 0b7a331458..a2d6ad29c8 100644
--- a/config_src/drivers/STALE_mct_cap/ocn_cap_methods.F90
+++ b/config_src/drivers/STALE_mct_cap/ocn_cap_methods.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
module ocn_cap_methods
use ESMF, only: ESMF_clock, ESMF_time, ESMF_ClockGet, ESMF_TimeGet
diff --git a/config_src/drivers/STALE_mct_cap/ocn_comp_mct.F90 b/config_src/drivers/STALE_mct_cap/ocn_comp_mct.F90
index 85b7350b77..c7d758c8de 100644
--- a/config_src/drivers/STALE_mct_cap/ocn_comp_mct.F90
+++ b/config_src/drivers/STALE_mct_cap/ocn_comp_mct.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This is the main driver for MOM6 in CIME
module ocn_comp_mct
-! This file is part of MOM6. See LICENSE.md for the license.
-
! mct modules
use ESMF, only: ESMF_clock, ESMF_time, ESMF_timeInterval
use ESMF, only: ESMF_ClockGet, ESMF_TimeGet, ESMF_TimeIntervalGet
diff --git a/config_src/drivers/STALE_mct_cap/ocn_cpl_indices.F90 b/config_src/drivers/STALE_mct_cap/ocn_cpl_indices.F90
index 3f47c01903..68b6537662 100644
--- a/config_src/drivers/STALE_mct_cap/ocn_cpl_indices.F90
+++ b/config_src/drivers/STALE_mct_cap/ocn_cpl_indices.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
module ocn_cpl_indices
use mct_mod, only: mct_avect_init, mct_avect_indexra, mct_aVect_clean, mct_aVect
diff --git a/config_src/drivers/ice_solo_driver/atmos_ocean_fluxes.F90 b/config_src/drivers/ice_solo_driver/atmos_ocean_fluxes.F90
index fb9fbe3e22..a8e11fbe34 100644
--- a/config_src/drivers/ice_solo_driver/atmos_ocean_fluxes.F90
+++ b/config_src/drivers/ice_solo_driver/atmos_ocean_fluxes.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A dummy version of atmos_ocean_fluxes_mod module for
!! use when the vastly larger FMS package is not needed.
module atmos_ocean_fluxes_mod
-! This file is part of MOM6. See LICENSE.md for the license.
-
implicit none ; private
public :: aof_set_coupler_flux
diff --git a/config_src/drivers/ice_solo_driver/ice_shelf_driver.F90 b/config_src/drivers/ice_solo_driver/ice_shelf_driver.F90
index bc95633af8..b12b1abd1a 100644
--- a/config_src/drivers/ice_solo_driver/ice_shelf_driver.F90
+++ b/config_src/drivers/ice_solo_driver/ice_shelf_driver.F90
@@ -1,6 +1,8 @@
-program Shelf_main
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
-! This file is part of MOM6. See LICENSE.md for the license.
+program Shelf_main
!********+*********+*********+*********+*********+*********+*********+**
!* *
diff --git a/config_src/drivers/nuopc_cap/mom_cap.F90 b/config_src/drivers/nuopc_cap/mom_cap.F90
index ad8cbf3dce..a22fb3534b 100644
--- a/config_src/drivers/nuopc_cap/mom_cap.F90
+++ b/config_src/drivers/nuopc_cap/mom_cap.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module contains a set of subroutines that are required by NUOPC.
module MOM_cap_mod
@@ -97,7 +101,7 @@ module MOM_cap_mod
#ifndef CESMCOUPLED
use shr_is_restart_fh_mod, only : init_is_restart_fh, is_restart_fh, is_restart_fh_type
#endif
-use mom_ufs_trace_wrapper_mod, only: ufs_trace_init_wrapper, ufs_trace_wrapper
+use mom_cap_profiling, only: cap_profiling_init, cap_profiling
implicit none; private
@@ -166,7 +170,7 @@ module MOM_cap_mod
character(len=16) :: inst_suffix = ''
logical :: pointer_date = .true. ! append date to rpointer
real(8) :: timere
-integer :: mype = -1
+integer :: localPet = -1
contains
@@ -190,11 +194,11 @@ subroutine SetServices(gcomp, rc)
call ESMF_GridCompGet(gcomp, vm=vm, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- call ESMF_VMGet(vm, localpet=mype, rc=rc)
+ call ESMF_VMGet(vm, localpet=localPet, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- if (mype == 0) call ufs_trace_init_wrapper()
- if (mype == 0) call ufs_trace_wrapper("mom", "SetServices", "B")
+ if (localPet == 0) call cap_profiling_init()
+ if (localPet == 0) call cap_profiling("mom", "SetServices", "B")
! the NUOPC model component will register the generic methods
call NUOPC_CompDerive(gcomp, model_routine_SS, rc=rc)
@@ -235,7 +239,7 @@ subroutine SetServices(gcomp, rc)
specRoutine=ocean_model_finalize, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- if (mype == 0) call ufs_trace_wrapper("mom", "SetServices", "E")
+ if (localPet == 0) call cap_profiling("mom", "SetServices", "E")
end subroutine SetServices
@@ -266,7 +270,7 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc)
rc = ESMF_SUCCESS
- if (mype == 0) call ufs_trace_wrapper("mom", "InitializeP0", "B")
+ if (localPet == 0) call cap_profiling("mom", "InitializeP0", "B")
! Switch to IPDv03 by filtering all other phaseMap entries
call NUOPC_CompFilterPhaseMap(gcomp, ESMF_METHOD_INITIALIZE, &
@@ -414,7 +418,6 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc)
geomtype = ESMF_GEOMTYPE_GRID
endif
- use_cdeps_inline = .false.
call NUOPC_CompAttributeGet(gcomp, name="use_cdeps_inline", value=value, &
isPresent=isPresent, isSet=isSet, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
@@ -430,7 +433,7 @@ subroutine InitializeP0(gcomp, importState, exportState, clock, rc)
if (trim(value) .eq. '.true.') restart_eor = .true.
end if
- if (mype == 0) call ufs_trace_wrapper("mom", "InitializeP0", "E")
+ if (localPet == 0) call cap_profiling("mom", "InitializeP0", "E")
end subroutine
@@ -483,7 +486,6 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
character(len=40) :: wave_method ! Wave coupling method.
logical :: use_MARBL ! If true, MARBL tracers are being used.
integer :: userRc
- integer :: localPet
integer :: localPeCount
integer :: iostat
integer :: readunit
@@ -502,7 +504,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
rc = ESMF_SUCCESS
- if (mype == 0) call ufs_trace_wrapper("mom", "InitializeAdvertise", "B")
+ if (localPet == 0) call cap_profiling("mom", "InitializeAdvertise", "B")
if(write_runtimelog) timeiads = MPI_Wtime()
@@ -519,7 +521,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
call ESMF_VMGetCurrent(vm, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- call ESMF_VMGet(VM, mpiCommunicator=mpi_comm_mom, localPet=localPet, rc=rc)
+ call ESMF_VMGet(VM, mpiCommunicator=mpi_comm_mom, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call ESMF_ClockGet(CLOCK, currTIME=MyTime, TimeStep=TINT, RC=rc)
@@ -709,8 +711,6 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
call ESMF_LogWrite('MOM_cap: restart requested, using '//trim(rpointer_filename), ESMF_LOGMSG_WARNING)
call ESMF_GridCompGet(gcomp, vm=vm, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- call ESMF_VMGet(vm, localPet=localPet, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
if (localPet == 0) then
open(newunit=readunit, file=rpointer_filename, form='formatted', status='old', iostat=iostat)
@@ -947,7 +947,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
enddo
if(write_runtimelog .and. is_root_pe()) write(stdout,*) 'In ',trim(subname),' time ', MPI_Wtime()-timeiads
- if (mype == 0) call ufs_trace_wrapper("mom", "InitializeAdvertise", "E")
+ if (localPet == 0) call cap_profiling("mom", "InitializeAdvertise", "E")
end subroutine InitializeAdvertise
@@ -1003,7 +1003,6 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
real(ESMF_KIND_R8), pointer :: dataPtr_xcor(:,:)
real(ESMF_KIND_R8), pointer :: dataPtr_ycor(:,:)
integer :: mpicom
- integer :: localPet
integer :: localPeCount
integer :: lsize
integer :: ig,jg, ni,nj,k
@@ -1043,7 +1042,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
rc = ESMF_SUCCESS
- if (mype == 0) call ufs_trace_wrapper("mom", "InitializeRealize", "B")
+ if (localPet == 0) call cap_profiling("mom", "InitializeRealize", "B")
if(write_runtimelog) timeirls = MPI_Wtime()
@@ -1067,7 +1066,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
call ESMF_VMGetCurrent(vm, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- call ESMF_VMGet(vm, petCount=npet, mpiCommunicator=mpicom, localPet=localPet, rc=rc)
+ call ESMF_VMGet(vm, petCount=npet, mpiCommunicator=mpicom, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
!---------------------------------
@@ -1635,7 +1634,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc)
timere = 0.
if(write_runtimelog .and. is_root_pe()) write(stdout,*) 'In ',trim(subname),' time ', MPI_Wtime()-timeirls
- if (mype == 0) call ufs_trace_wrapper("mom", "InitializeRealize", "E")
+ if (localPet == 0) call cap_profiling("mom", "InitializeRealize", "E")
end subroutine InitializeRealize
@@ -1668,7 +1667,7 @@ subroutine DataInitialize(gcomp, rc)
real(8) :: MPI_Wtime, timedis
!--------------------------------
- if (mype == 0) call ufs_trace_wrapper("mom", "DataInitialize", "B")
+ if (localPet == 0) call cap_profiling("mom", "DataInitialize", "B")
if(write_runtimelog) timedis = MPI_Wtime()
@@ -1734,7 +1733,7 @@ subroutine DataInitialize(gcomp, rc)
if(write_runtimelog .and. is_root_pe()) write(stdout,*) 'In ',trim(subname),' time ', MPI_Wtime()-timedis
- if (mype == 0) call ufs_trace_wrapper("mom", "DataInitialize", "E")
+ if (localPet == 0) call cap_profiling("mom", "DataInitialize", "E")
end subroutine DataInitialize
@@ -1777,7 +1776,6 @@ subroutine ModelAdvance(gcomp, rc)
character(ESMF_MAXSTR) :: casename
integer :: iostat
integer :: writeunit
- integer :: localPet
type(ESMF_VM) :: vm
integer :: n, i
character(240) :: import_timestr, export_timestr
@@ -1793,7 +1791,7 @@ subroutine ModelAdvance(gcomp, rc)
rc = ESMF_SUCCESS
- if (mype == 0) call ufs_trace_wrapper("mom", "ModelAdvance", "B")
+ if (localPet == 0) call cap_profiling("mom", "ModelAdvance", "B")
if(profile_memory) call ESMF_VMLogMemInfo("Entering MOM Model_ADVANCE: ")
if(write_runtimelog) then
@@ -1988,8 +1986,6 @@ subroutine ModelAdvance(gcomp, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call ESMF_GridCompGet(gcomp, vm=vm, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- call ESMF_VMGet(vm, localPet=localPet, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
write(timestamp,'(".",i4.4,"-",i2.2,"-",i2.2,"-",i5.5)')year,month,day,hour*3600+minute*60+seconds
@@ -2082,7 +2078,7 @@ subroutine ModelAdvance(gcomp, rc)
if(profile_memory) call ESMF_VMLogMemInfo("Leaving MOM Model_ADVANCE: ")
- if (mype == 0) call ufs_trace_wrapper("mom", "ModelAdvance", "E")
+ if (localPet == 0) call cap_profiling("mom", "ModelAdvance", "E")
end subroutine ModelAdvance
@@ -2112,7 +2108,7 @@ subroutine ModelSetRunClock(gcomp, rc)
rc = ESMF_SUCCESS
- if (mype == 0) call ufs_trace_wrapper("mom", "ModelSetRunClock", "B")
+ if (localPet == 0) call cap_profiling("mom", "ModelSetRunClock", "B")
! query the Component for its clock, importState and exportState
call NUOPC_ModelGet(gcomp, driverClock=dclock, modelClock=mclock, rc=rc)
@@ -2269,7 +2265,7 @@ subroutine ModelSetRunClock(gcomp, rc)
call ESMF_ClockSet(mclock, currTime=dcurrtime, timeStep=dtimestep, stopTime=mstoptime, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- if (mype == 0) call ufs_trace_wrapper("mom", "ModelSetRunClock", "E")
+ if (localPet == 0) call cap_profiling("mom", "ModelSetRunClock", "E")
end subroutine ModelSetRunClock
@@ -2297,7 +2293,7 @@ subroutine ocean_model_finalize(gcomp, rc)
character(len=*),parameter :: subname='(MOM_cap:ocean_model_finalize)'
real(8) :: MPI_Wtime, timefs
- if (mype == 0) call ufs_trace_wrapper("mom", "ocean_model_finalize", "B")
+ if (localPet == 0) call cap_profiling("mom", "ocean_model_finalize", "B")
if (is_root_pe()) then
write(stdout,*) 'MOM: --- finalize called ---'
@@ -2340,7 +2336,7 @@ subroutine ocean_model_finalize(gcomp, rc)
if(write_runtimelog .and. is_root_pe()) write(stdout,*) 'In ',trim(subname),' time ', MPI_Wtime()-timefs
- if(mype == 0) call ufs_trace_wrapper("mom", "ocean_model_finalize", "E")
+ if (localPet == 0) call cap_profiling("mom", "ocean_model_finalize", "E")
end subroutine ocean_model_finalize
diff --git a/config_src/drivers/nuopc_cap/mom_cap_methods.F90 b/config_src/drivers/nuopc_cap/mom_cap_methods.F90
index 8a7a1b3942..2b686fcd52 100644
--- a/config_src/drivers/nuopc_cap/mom_cap_methods.F90
+++ b/config_src/drivers/nuopc_cap/mom_cap_methods.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Contains import/export methods for CMEPS.
module MOM_cap_methods
diff --git a/config_src/drivers/nuopc_cap/mom_cap_outputlog.F90 b/config_src/drivers/nuopc_cap/mom_cap_outputlog.F90
index 7c197eb537..ef62ac0cda 100644
--- a/config_src/drivers/nuopc_cap/mom_cap_outputlog.F90
+++ b/config_src/drivers/nuopc_cap/mom_cap_outputlog.F90
@@ -6,625 +6,618 @@
module MOM_cap_outputlog
#ifdef CESMCOUPLED
- use ESMF , only : ESMF_GridComp, ESMF_Clock, ESMF_SUCCESS
- implicit none; private
+use ESMF , only : ESMF_GridComp, ESMF_Clock, ESMF_SUCCESS
+implicit none; private
- public :: outputlog_init, outputlog_run, outputlog_restart
+public :: outputlog_init, outputlog_run, outputlog_restart
contains
- subroutine outputlog_init(gcomp, mclock, rc)
- type(ESMF_GridComp) :: gcomp !< an ESMF_GridComp object
- type(ESMF_Clock) :: mclock !< the ESMF_clock for the model
- integer, intent(out) :: rc !< return code
- rc = ESMF_SUCCESS
- end subroutine outputlog_init
- subroutine outputlog_run(mclock, atStopTime, rc)
- type(ESMF_Clock) :: mclock !< the ESMF_clock for the model
- logical, intent(in), optional :: atStopTime !< if true, checks for final output file
- integer, intent(out) :: rc !< return code
- rc = ESMF_SUCCESS
- end subroutine outputlog_run
- subroutine outputlog_restart(mclock, num_rest_files, rc)
- type(ESMF_Clock) :: mclock !< the ESMF_clock for the model
- integer, intent(in) :: num_rest_files !< the number of restart files
- integer, intent(out) :: rc !< return code
- rc = ESMF_SUCCESS
- end subroutine outputlog_restart
+subroutine outputlog_init(gcomp, mclock, rc)
+ type(ESMF_GridComp) :: gcomp !< an ESMF_GridComp object
+ type(ESMF_Clock) :: mclock !< the ESMF_clock for the model
+ integer, intent(out) :: rc !< return code
+ rc = ESMF_SUCCESS
+end subroutine outputlog_init
+subroutine outputlog_run(mclock, atStopTime, rc)
+ type(ESMF_Clock) :: mclock !< the ESMF_clock for the model
+ logical, intent(in), optional :: atStopTime !< if true, checks for final output file
+ integer, intent(out) :: rc !< return code
+ rc = ESMF_SUCCESS
+end subroutine outputlog_run
+subroutine outputlog_restart(mclock, num_rest_files, rc)
+ type(ESMF_Clock) :: mclock !< the ESMF_clock for the model
+ integer, intent(in) :: num_rest_files !< the number of restart files
+ integer, intent(out) :: rc !< return code
+ rc = ESMF_SUCCESS
+end subroutine outputlog_restart
#else
- use MOM_error_handler , only : is_root_pe, MOM_error, FATAL
- use NUOPC , only : NUOPC_CompAttributeGet
- use ESMF , only : ESMF_GridComp, ESMF_GridCompGet, ESMF_VM, ESMF_VMGet
- use ESMF , only : ESMF_Time, ESMF_Clock, ESMF_ClockGet, ESMF_Alarm, ESMF_AlarmSet
- use ESMF , only : ESMF_ClockGetAlarm, ESMF_AlarmIsRinging, ESMF_AlarmRingerOff
- use ESMF , only : ESMF_ClockGetNextTime, ESMF_TimeGet, ESMF_TimeInterval
- use ESMF , only : ESMF_AlarmGet, ESMF_TimeIntervalSet, ESMF_TimeIntervalPrint
- use ESMF , only : ESMF_SUCCESS, ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_VMBroadCast
- use ESMF , only : ESMF_LogSetError, ESMF_LogFoundError, ESMF_LOGERR_PASSTHRU
- use ESMF , only : operator(*), operator(+), operator(-), operator(>), operator(==)
- use MOM_cap_methods , only : ChkErr
- use MOM_cap_time , only : AlarmInit
- use shr_is_restart_fh_mod , only : log_restart_fh
- use netcdf
-
- implicit none; private
-
- public :: outputlog_init, outputlog_run, outputlog_restart
-
- ! the allowable output frequency for MOM6 history, in hours only
- integer, parameter :: n_freq = 3
- integer, parameter, dimension(n_freq) :: freq = (/3, 6, 24/)
- ! TODO: for multiple output freq in same run, a different known filename
- ! root for different freqs needs to be read in, consistent with the diag table
-
- ! the tincrement interval (defined in minutes) is used to construct the output filename
- ! the file name must be set as the mid-point of the averaging period via the diagtable
- ! and the output filename timestrings are given by
- ! T - (interval * 60 * increment + interval/2 * 60 * increment )
- ! where T is the time when the file is closed
- !
- ! 00 . 03 . 06 . 09
- ! 1:30 = 6 - (3 + 1:30)
- ! 4:30 = 9 - (3 + 1:30)
- !
- ! 00 . 06 . 12 . 18
- ! 03 = 12 - (6 + 3)
- ! 09 = 18 - (6 + 3)
- !
- ! 00 . 24 . 48 . 72
- ! 12 = 48 - (24 + 12)
- ! 36 = 72 - (24 + 12)
- !
- ! when the model reaches the stop time, any 'pending' output file is closed, and the final
- ! interval output is also closed
- !
- ! stop
- ! 18 . 24 . 30
- ! 21 = 30 - (12 + 3)
- ! 03 = 30 - (3)
- !
- ! since both the final interval and the next-to-final interval can be closed at the stop time,
- ! a different log file name is required for the final log file, otherwise the next-to-final
- ! log is overwritten
- !
- ! Depending on configuration, the output file can have an unlimited dimension >0 at creation time.
- ! This necessitates checking for an additional criteria using the filesize at creation. An output file
- ! is declared complete either when the unlimited dimension in the file is >0 or when the unlimited
- ! dimension is >0 and the filesize is larger than the initial size.
-
- ! When a file is determined to be complete, a log file is recorded containing the forecast hour, the valid
- ! time, the name of the output file and the last completed restart file.
-
- type(ESMF_VM) :: vm
- type(ESMF_TimeInterval) :: tincrement
- type(ESMF_Time) :: lastrestart
-
- type :: outputlog_type
- character(len=14) :: alarm_name
- integer :: opt_n
- logical :: chkfile_nextAdvance
- logical :: use_filesize
- character(len=256) :: filename
- integer :: createsize
- type(ESMF_Alarm) :: alarm
- type(ESMF_TimeInterval) :: fhoffset
- type(ESMF_TimeInterval) :: filename_fhoffset
- type(ESMF_Time) :: time_lastrestart
- end type outputlog_type
-
- type(outputlog_type) :: olog(n_freq)
-
- integer :: toffset
- logical :: debug
- logical :: existflag
- character(len=256) :: restartdir
- character(len=256) :: outputdir
- character(len=2) :: output_fh
- character(len=*), parameter :: u_FILE_u = &
- __FILE__
+use MOM_error_handler , only : is_root_pe, MOM_error, FATAL
+use NUOPC , only : NUOPC_CompAttributeGet
+use ESMF , only : ESMF_GridComp, ESMF_GridCompGet, ESMF_VM, ESMF_VMGet
+use ESMF , only : ESMF_Time, ESMF_Clock, ESMF_ClockGet, ESMF_Alarm, ESMF_AlarmSet
+use ESMF , only : ESMF_ClockGetAlarm, ESMF_AlarmIsRinging, ESMF_AlarmRingerOff
+use ESMF , only : ESMF_ClockGetNextTime, ESMF_TimeGet, ESMF_TimeInterval
+use ESMF , only : ESMF_AlarmGet, ESMF_TimeIntervalSet, ESMF_TimeIntervalPrint
+use ESMF , only : ESMF_SUCCESS, ESMF_LogWrite, ESMF_LOGMSG_INFO, ESMF_VMBroadCast
+use ESMF , only : ESMF_LogSetError, ESMF_LogFoundError, ESMF_LOGERR_PASSTHRU
+use ESMF , only : operator(*), operator(+), operator(-), operator(>), operator(==)
+use MOM_cap_methods , only : ChkErr
+use MOM_cap_time , only : AlarmInit
+use shr_is_restart_fh_mod , only : log_restart_fh
+use netcdf
+
+implicit none; private
+
+public :: outputlog_init, outputlog_run, outputlog_restart
+
+! the allowable output frequency for MOM6 history, in hours only
+integer, parameter :: n_freq = 3
+integer, parameter, dimension(n_freq) :: freq = (/3, 6, 24/)
+! TODO: for multiple output freq in same run, a different known filename
+! root for different freqs needs to be read in, consistent with the diag table
+
+! the tincrement interval (defined in minutes) is used to construct the output filename
+! the file name must be set as the mid-point of the averaging period via the diagtable
+! and the output filename timestrings are given by
+! T - (interval * 60 * increment + interval/2 * 60 * increment )
+! where T is the time when the file is closed
+!
+! 00 . 03 . 06 . 09
+! 1:30 = 6 - (3 + 1:30)
+! 4:30 = 9 - (3 + 1:30)
+!
+! 00 . 06 . 12 . 18
+! 03 = 12 - (6 + 3)
+! 09 = 18 - (6 + 3)
+!
+! 00 . 24 . 48 . 72
+! 12 = 48 - (24 + 12)
+! 36 = 72 - (24 + 12)
+!
+! when the model reaches the stop time, any 'pending' output file is closed, and the final
+! interval output is also closed
+!
+! stop
+! 18 . 24 . 30
+! 21 = 30 - (12 + 3)
+! 03 = 30 - (3)
+!
+! since both the final interval and the next-to-final interval can be closed at the stop time,
+! a different log file name is required for the final log file, otherwise the next-to-final
+! log is overwritten
+!
+! Depending on configuration, the output file can have an unlimited dimension >0 at creation time.
+! This necessitates checking for an additional criteria using the filesize at creation. An output file
+! is declared complete either when the unlimited dimension in the file is >0 or when the unlimited
+! dimension is >0 and the filesize is larger than the initial size.
+
+! When a file is determined to be complete, a log file is recorded containing the forecast hour, the valid
+! time, the name of the output file and the last completed restart file.
+
+type(ESMF_VM) :: vm
+type(ESMF_TimeInterval) :: tincrement
+type(ESMF_Time) :: lastrestart
+
+type :: outputlog_type
+ character(len=14) :: alarm_name
+ integer :: opt_n
+ logical :: chkfile_nextAdvance
+ logical :: use_filesize
+ character(len=256) :: filename
+ integer :: createsize
+ type(ESMF_Alarm) :: alarm
+ type(ESMF_TimeInterval) :: fhoffset
+ type(ESMF_TimeInterval) :: filename_fhoffset
+ type(ESMF_Time) :: time_lastrestart
+end type outputlog_type
+
+type(outputlog_type) :: olog(n_freq)
+
+integer :: toffset
+logical :: debug
+logical :: existflag
+character(len=256) :: restartdir
+character(len=256) :: outputdir
+character(len=2) :: output_fh
+character(len=*), parameter :: u_FILE_u = &
+ __FILE__
contains
- !> Initialize a set of Alarms at the allowed output frequencies
- !!
- !! @param gcomp an ESMF_GridComp object
- !! @param clock an ESMF_Clock object
- !! @param rc return code
- subroutine outputlog_init(gcomp, mclock, rc)
-
- type(ESMF_GridComp) :: gcomp
- type(ESMF_Clock) :: mclock
- integer, intent(out) :: rc
-
- ! local variables
- type(ESMF_Time) :: mcurrTime
- type(ESMF_TimeInterval) :: alarmoffset
- logical :: isPresent, isSet
- integer :: n
- integer :: year, month, day, hour
- character(len=3) :: chour
- character(len=256) :: msgString
- character(len=256) :: value
- character(len=256) :: subname='MOM_cap:(outputlog_init)'
- !----------------------------------------------------------------------------
-
- rc = ESMF_SUCCESS
- call ESMF_GridCompGet(gcomp, vm=vm, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
-
- call NUOPC_CompAttributeGet(gcomp, name="mom6_restart_dir", value=value, &
- isPresent=isPresent, isSet=isSet, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
- if (isPresent .and. isSet) then
- restartdir = trim(value)
- else
- restartdir = './'
- end if
- if (restartdir(len_trim(restartdir):len_trim(restartdir)) /= '/') then
- restartdir = trim(restartdir)//'/'
- end if
- write(msgString,'(A)')'MOM_cap:MOM6 restart directory = '//trim(restartdir)
- call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO)
-
- call NUOPC_CompAttributeGet(gcomp, name="mom6_output_dir", value=value, &
- isPresent=isPresent, isSet=isSet, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
- if (isPresent .and. isSet) then
- outputdir = trim(value)
+!> Initialize a set of Alarms at the allowed output frequencies
+!!
+!! @param gcomp an ESMF_GridComp object
+!! @param clock an ESMF_Clock object
+!! @param rc return code
+subroutine outputlog_init(gcomp, mclock, rc)
+ type(ESMF_GridComp) :: gcomp
+ type(ESMF_Clock) :: mclock
+ integer, intent(out) :: rc
+
+ ! local variables
+ type(ESMF_Time) :: mcurrTime
+ type(ESMF_TimeInterval) :: alarmoffset
+ logical :: isPresent, isSet
+ integer :: n
+ integer :: year, month, day, hour
+ character(len=3) :: chour
+ character(len=256) :: msgString
+ character(len=256) :: value
+ character(len=256) :: subname='MOM_cap:(outputlog_init)'
+ !----------------------------------------------------------------------------
+
+ rc = ESMF_SUCCESS
+ call ESMF_GridCompGet(gcomp, vm=vm, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+
+ call NUOPC_CompAttributeGet(gcomp, name="mom6_restart_dir", value=value, &
+ isPresent=isPresent, isSet=isSet, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ if (isPresent .and. isSet) then
+ restartdir = trim(value)
+ else
+ restartdir = './'
+ endif
+ if (restartdir(len_trim(restartdir):len_trim(restartdir)) /= '/') then
+ restartdir = trim(restartdir)//'/'
+ endif
+ write(msgString,'(A)')'MOM_cap:MOM6 restart directory = '//trim(restartdir)
+ call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO)
+
+ call NUOPC_CompAttributeGet(gcomp, name="mom6_output_dir", value=value, &
+ isPresent=isPresent, isSet=isSet, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ if (isPresent .and. isSet) then
+ outputdir = trim(value)
+ else
+ outputdir = './'
+ endif
+ if (outputdir(len_trim(outputdir):len_trim(outputdir)) /= '/') then
+ outputdir = trim(outputdir)//'/'
+ endif
+ write(msgString,'(A)')'MOM_cap:MOM6 output directory = '//trim(outputdir)
+ call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO)
+
+ call NUOPC_CompAttributeGet(gcomp, name="mom6_output_fh", value=value, &
+ isPresent=isPresent, isSet=isSet, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ if (isPresent .and. isSet) then
+ if (len_trim(value) == 1) then
+ output_fh = '0'//trim(value)
else
- outputdir = './'
- end if
- if (outputdir(len_trim(outputdir):len_trim(outputdir)) /= '/') then
- outputdir = trim(outputdir)//'/'
- end if
- write(msgString,'(A)')'MOM_cap:MOM6 output directory = '//trim(outputdir)
- call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO)
-
- call NUOPC_CompAttributeGet(gcomp, name="mom6_output_fh", value=value, &
- isPresent=isPresent, isSet=isSet, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
- if (isPresent .and. isSet) then
- if (len_trim(value) == 1) then
- output_fh = '0'//trim(value)
- else
- output_fh = trim(value)
- end if
+ output_fh = trim(value)
+ endif
+ else
+ output_fh = '06'
+ endif
+ write(msgString,'(A)')'MOM_cap:MOM6 output frequency = '//trim(output_fh)
+ call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO)
+
+ debug = .false.
+ call NUOPC_CompAttributeGet(gcomp, name="debug_outputlog", value=value, &
+ isPresent=isPresent, isSet=isSet, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ if (isPresent .and. isSet) debug=(trim(value)=="true")
+ if (debug) call ESMF_LogWrite('MOM_cap:MOM6 output debug ON', ESMF_LOGMSG_INFO)
+
+ call ESMF_ClockGet(mclock, currTime=mcurrTime, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ call ESMF_TimeIntervalSet(tincrement, m=1, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+
+ ! get start hour time offset (ie, fhrot)
+ call ESMF_TimeGet(mcurrTime, yy=year, mm=month, dd=day, h=hour, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ if (mod(hour,6) /= 0) then
+ toffset = hour - 6
+ else
+ toffset = 0
+ endif
+ if (debug .and. is_root_pe()) then
+ print '(A,i8)',trim(subname)//' toffset = ',toffset
+ endif
+ ! initialize
+ lastrestart = mcurrTime
+
+ do n = 1,n_freq
+ write(chour,'(I2.2,A)')freq(n),'h'
+ olog(n)%alarm_name = 'output_alarm'//trim(chour)
+ olog(n)%opt_n = freq(n)
+ olog(n)%chkfile_nextAdvance = .false.
+ olog(n)%use_filesize = .false.
+ olog(n)%filename = ''
+ olog(n)%createsize = 0
+ olog(n)%time_lastrestart = lastrestart
+ olog(n)%fhoffset = 60*freq(n)*tincrement
+ olog(n)%filename_fhoffset = 90*freq(n)*tincrement
+
+ ! the time offset in hours required to ensure the alarm rings at multiples of 6
+ if (freq(n) >= 6) then
+ alarmoffset = toffset*60*tincrement
else
- output_fh = '06'
- end if
- write(msgString,'(A)')'MOM_cap:MOM6 output frequency = '//trim(output_fh)
- call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO)
-
- debug = .false.
- call NUOPC_CompAttributeGet(gcomp, name="debug_outputlog", value=value, &
- isPresent=isPresent, isSet=isSet, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
- if (isPresent .and. isSet) debug=(trim(value)=="true")
- if (debug) call ESMF_LogWrite('MOM_cap:MOM6 output debug ON', ESMF_LOGMSG_INFO)
-
- call ESMF_ClockGet(mclock, currTime=mcurrTime, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
- call ESMF_TimeIntervalSet(tincrement, m=1, rc=rc)
+ alarmoffset = 0*tincrement
+ endif
+
+ call AlarmInit(mclock, &
+ alarm = olog(n)%alarm, &
+ option = 'nhours', &
+ opt_n = olog(n)%opt_n, &
+ opt_ymd = -999, &
+ RefTime = mcurrTime+alarmoffset, &
+ alarmname = olog(n)%alarm_name, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- ! get start hour time offset (ie, fhrot)
- call ESMF_TimeGet(mcurrTime, yy=year, mm=month, dd=day, h=hour, rc=rc)
+ call ESMF_AlarmSet(olog(n)%alarm, clock=mclock, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- if (mod(hour,6) /= 0) then
- toffset = hour - 6
- else
- toffset = 0
- end if
+ write(msgString,'(A)')trim(subname)//' Output alarm '//trim(olog(n)%alarm_name)//' Created & Set'
+ call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO)
if (debug .and. is_root_pe()) then
- print '(A,i8)',trim(subname)//' toffset = ',toffset
- end if
- ! initialize
- lastrestart = mcurrTime
-
- do n = 1,n_freq
- write(chour,'(I2.2,A)')freq(n),'h'
- olog(n)%alarm_name = 'output_alarm'//trim(chour)
- olog(n)%opt_n = freq(n)
- olog(n)%chkfile_nextAdvance = .false.
- olog(n)%use_filesize = .false.
- olog(n)%filename = ''
- olog(n)%createsize = 0
- olog(n)%time_lastrestart = lastrestart
- olog(n)%fhoffset = 60*freq(n)*tincrement
- olog(n)%filename_fhoffset = 90*freq(n)*tincrement
-
- ! the time offset in hours required to ensure the alarm rings at multiples of 6
- if (freq(n) >= 6) then
- alarmoffset = toffset*60*tincrement
- else
- alarmoffset = 0*tincrement
- end if
-
- call AlarmInit(mclock, &
- alarm = olog(n)%alarm, &
- option = 'nhours', &
- opt_n = olog(n)%opt_n, &
- opt_ymd = -999, &
- RefTime = mcurrTime+alarmoffset, &
- alarmname = olog(n)%alarm_name, rc=rc)
+ call ESMF_TimeIntervalPrint(olog(n)%filename_fhoffset, options="string", rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
-
- call ESMF_AlarmSet(olog(n)%alarm, clock=mclock, rc=rc)
+ endif
+ enddo
+end subroutine outputlog_init
+
+!> Write a log file denoting that an output file is complete
+!!
+!! @param clock an ESMF_Clock object
+!! @param atStopTime when present, checks for final output file
+!! @param rc return code
+subroutine outputlog_run(mclock, atStopTime, rc)
+ type(ESMF_Clock) :: mclock
+ logical, intent(in), optional :: atStopTime
+ integer, intent(out) :: rc
+
+ ! local variables
+ type(ESMF_Time) :: nextTime, currTime, startTime, prevRing
+ logical :: lstop
+ logical :: filecomplete
+ integer :: n, nlen(1), fsize(1)
+ character(len=3) :: chour
+ character(len=40) :: importexport
+ character(len=16) :: timestr
+ character(len=256) :: fname
+ character(len=256) :: subname='MOM_cap:(outputlog_run)'
+ !----------------------------------------------------------------------------
+
+ rc = ESMF_SUCCESS
+
+ call ESMF_ClockGet(mclock, startTime=startTime, currTime=currTime, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ call ESMF_ClockGetNextTime(mclock, nextTime, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ importexport = get_importexport(currTime, nextTime, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+
+ lstop = .false.
+ if (present(atStopTime)) then
+ lstop = atStopTime
+ endif
+
+ filecomplete = .false.
+ fsize(1) = nf90_fill_int
+ nlen(1) = nf90_fill_int
+
+ do n = 1,n_freq
+ write(chour,'(I2.2,A)')freq(n),'h'
+ if (chour(1:2) == output_fh(1:2)) then
+ call ESMF_ClockGetAlarm(mclock, alarmname=trim(olog(n)%alarm_name), alarm=olog(n)%alarm, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- write(msgString,'(A)')trim(subname)//' Output alarm '//trim(olog(n)%alarm_name)//' Created & Set'
- call ESMF_LogWrite(trim(msgString), ESMF_LOGMSG_INFO)
- if (debug .and. is_root_pe()) then
- call ESMF_TimeIntervalPrint(olog(n)%filename_fhoffset, options="string", rc=rc)
+ ! when the alarm rings, set file check on next advance and construct the filename
+ if (ESMF_AlarmIsRinging(olog(n)%alarm, rc=rc)) then
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- end if
- end do
- end subroutine outputlog_init
-
- !> Write a log file denoting that an output file is complete
- !!
- !! @param clock an ESMF_Clock object
- !! @param atStopTime when present, checks for final output file
- !! @param rc return code
- subroutine outputlog_run(mclock, atStopTime, rc)
-
- type(ESMF_Clock) :: mclock
- logical, intent(in), optional :: atStopTime
- integer, intent(out) :: rc
-
- ! local variables
- type(ESMF_Time) :: nextTime, currTime, startTime, prevRing
- logical :: lstop
- logical :: filecomplete
- integer :: n, nlen(1), fsize(1)
- character(len=3) :: chour
- character(len=40) :: importexport
- character(len=16) :: timestr
- character(len=256) :: fname
- character(len=256) :: subname='MOM_cap:(outputlog_run)'
- !----------------------------------------------------------------------------
-
- rc = ESMF_SUCCESS
-
- call ESMF_ClockGet(mclock, startTime=startTime, currTime=currTime, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
- call ESMF_ClockGetNextTime(mclock, nextTime, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
- importexport = get_importexport(currTime, nextTime, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
-
- lstop = .false.
- if (present(atStopTime)) then
- lstop = atStopTime
- end if
-
- filecomplete = .false.
- fsize(1) = nf90_fill_int
- nlen(1) = nf90_fill_int
-
- do n = 1,n_freq
- write(chour,'(I2.2,A)')freq(n),'h'
- if (chour(1:2) == output_fh(1:2)) then
- call ESMF_ClockGetAlarm(mclock, alarmname=trim(olog(n)%alarm_name), alarm=olog(n)%alarm, rc=rc)
+ call ESMF_AlarmRingerOff(olog(n)%alarm, rc=rc )
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- ! when the alarm rings, set file check on next advance and construct the filename
- if (ESMF_AlarmIsRinging(olog(n)%alarm, rc=rc)) then
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
- call ESMF_AlarmRingerOff(olog(n)%alarm, rc=rc )
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
- olog(n)%chkfile_nextAdvance = .true.
+ olog(n)%chkfile_nextAdvance = .true.
- timestr = get_timestr(nextTime-olog(n)%filename_fhoffset, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
- write(olog(n)%filename,'(A)')trim(outputdir)//'ocn_'//trim(timestr)//'.nc'
-
- fname = trim(olog(n)%filename)
- inquire(file=fname, exist=existflag)
- if (existflag) then
- if (is_root_pe()) then
- nlen(1) = get_unlimited_len(trim(fname))
- inquire(file=fname, size=fsize(1))
- end if
- call ESMF_VMBroadCast(vm, nlen, 1, 0, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
- call ESMF_VMBroadCast(vm, fsize, 1, 0, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
- olog(n)%createsize = fsize(1)
-
- if (nlen(1) == 0) then
- olog(n)%use_filesize = .false.
- else
- olog(n)%use_filesize = .true.
- end if
- end if
- if (debug .and. is_root_pe()) then
- print '(A,2(A,L),A,2i16)',trim(subname)//' fname '//trim(olog(n)%filename)//' '//trim(importexport), &
- ' checkflag ',olog(n)%chkfile_nextAdvance,' use_filesize ',olog(n)%use_filesize, &
- ' ',olog(n)%createsize,nlen(1)
- end if
- end if
-
- if (olog(n)%chkfile_nextAdvance) then
- fname = trim(olog(n)%filename)
- filecomplete = file_is_complete(fname, olog(n)%use_filesize, olog(n)%createsize, rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
-
- if (filecomplete) then
- olog(n)%chkfile_nextAdvance = .false.
- olog(n)%time_lastrestart = lastrestart
- if (is_root_pe()) then
- call log_restart_fh(currTime-olog(n)%fhoffset, startTime, 'mom6.'//chour, prefixtime=.true., &
- lastrestart=olog(n)%time_lastrestart, lastoutput=olog(n)%filename, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
- endif
- end if
- end if
- if (debug .and. is_root_pe()) call debug_info(trim(subname)//' ',trim(olog(n)%filename), &
- olog(n)%chkfile_nextAdvance, olog(n)%createsize, importexport)
-
- if (lstop) then
- ! use prevRing in place of currTime to allow for stopping between averaging intervals
- ! prevring == currTime if stopping on intervals
- call ESMF_AlarmGet(olog(n)%alarm, prevRingTime=prevring, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
-
- timestr = get_timestr(prevring-30*freq(n)*tincrement, rc=rc)
+ timestr = get_timestr(nextTime-olog(n)%filename_fhoffset, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ write(olog(n)%filename,'(A)')trim(outputdir)//'ocn_'//trim(timestr)//'.nc'
+
+ fname = trim(olog(n)%filename)
+ inquire(file=fname, exist=existflag)
+ if (existflag) then
+ if (is_root_pe()) then
+ nlen(1) = get_unlimited_len(trim(fname))
+ inquire(file=fname, size=fsize(1))
+ endif
+ call ESMF_VMBroadCast(vm, nlen, 1, 0, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- write(olog(n)%filename,'(A)')trim(outputdir)//'ocn_'//trim(timestr)//'.nc'
-
- fname = trim(olog(n)%filename)
- filecomplete = file_is_complete(fname, olog(n)%use_filesize, olog(n)%createsize, rc)
+ call ESMF_VMBroadCast(vm, fsize, 1, 0, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ olog(n)%createsize = fsize(1)
- if (filecomplete) then
- olog(n)%chkfile_nextAdvance = .false.
- olog(n)%time_lastrestart = lastrestart
- if (is_root_pe()) then
- call log_restart_fh(prevring, startTime, 'mom6.lstop.'//chour, prefixtime=.true., &
- lastrestart=olog(n)%time_lastrestart, lastoutput=olog(n)%filename, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
- end if
- end if
- if (debug .and. is_root_pe()) call debug_info(trim(subname)//' lstop ',trim(olog(n)%filename), &
- olog(n)%chkfile_nextAdvance, olog(n)%createsize, importexport)
-
- end if ! lstop
- end if ! chour = output_fh
- end do
- end subroutine outputlog_run
-
- !> Check all restart files to determine if output has been completed
- !!
- !! @param[in] clock an ESMF_Clock object
- !! @param[in] num_rest_files the number of restart files
- !! @param[out] rc return code
- subroutine outputlog_restart(mclock, num_rest_files, rc)
- type(ESMF_Clock) :: mclock
- integer, intent(in) :: num_rest_files
- integer, intent(out) :: rc
-
- ! local variables
- type(ESMF_Time) :: startTime, currTime, nextTime
- integer :: n, nlen(1)
- integer :: year, month, day, hour, minute, seconds
- character(len=256) :: fname
- character(len=15) :: timestr
- character(len=40) :: importexport
- logical, allocatable :: allDone(:)
- character(len=8) :: suffix
- character(len=256) :: subname='MOM_cap:(outputlog_restart)'
- !----------------------------------------------------------------------------
-
- rc = ESMF_SUCCESS
-
- call ESMF_ClockGet(mclock, startTime=startTime, currTime=currTime, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
- call ESMF_ClockGetNextTime(mclock, nextTime, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
- importexport = get_importexport(currTime, nextTime, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
-
- call ESMF_TimeGet(nextTime, yy=year, mm=month, dd=day, h=hour, m=minute, s=seconds, rc=rc )
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
- write(timestr,'(I4.4,2(I2.2),A,3(I2.2))') year, month, day,".", hour, minute, seconds
-
- allocate(allDone(1:num_rest_files))
- allDone = .false.
-
- do n = 1,num_rest_files
- if (n == 1) then
- suffix = ''
- else if (n-1 < 10) then
- write(suffix,'("_",I1)') n-1
- else
- write(suffix,'("_",I2)') n-1
- endif
- if (len_trim(suffix) == 0) then
- fname = trim(restartdir)//trim(timestr)//'.MOM.res.nc'
- else
- fname = trim(restartdir)//trim(timestr)//'.MOM.res'//trim(suffix)//'.nc'
+ if (nlen(1) == 0) then
+ olog(n)%use_filesize = .false.
+ else
+ olog(n)%use_filesize = .true.
+ endif
+ endif
+ if (debug .and. is_root_pe()) then
+ print '(A,2(A,L),A,2i16)',trim(subname)//' fname '//trim(olog(n)%filename)//' '//trim(importexport), &
+ ' checkflag ',olog(n)%chkfile_nextAdvance,' use_filesize ',olog(n)%use_filesize, &
+ ' ',olog(n)%createsize,nlen(1)
+ endif
endif
- ! check if file is written
- inquire(file=trim(fname), exist=existflag)
- if (existflag) then
- if (is_root_pe())then
- nlen(1) = get_unlimited_len(trim(fname))
- end if
- call ESMF_VMBroadCast(vm, nlen, 1, 0, rc=rc)
+ if (olog(n)%chkfile_nextAdvance) then
+ fname = trim(olog(n)%filename)
+ filecomplete = file_is_complete(fname, olog(n)%use_filesize, olog(n)%createsize, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- if (nlen(1) > 0) allDone(n) = .true.
- if (debug .and. is_root_pe()) then
- if (nlen(1) > 0) then
- print '(A)',trim(subname)//' restart '//trim(fname)//' '//trim(importexport)//' complete'
- else
- print '(A)',trim(subname)//' restart '//trim(fname)//' '//trim(importexport)//' still 0'
- end if
- end if
- end if
- end do ! num_rest_files
-
- if (all(allDone) .eqv. .true.) then
- lastrestart = nextTime
- if (is_root_pe()) then
- call log_restart_fh(nextTime, startTime, 'mom6.res', prefixtime=.true., rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ if (filecomplete) then
+ olog(n)%chkfile_nextAdvance = .false.
+ olog(n)%time_lastrestart = lastrestart
+ if (is_root_pe()) then
+ call log_restart_fh(currTime-olog(n)%fhoffset, startTime, 'mom6.'//chour, prefixtime=.true., &
+ lastrestart=olog(n)%time_lastrestart, lastoutput=olog(n)%filename, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ endif
+ endif
endif
- end if
- end subroutine outputlog_restart
+ if (debug .and. is_root_pe()) call debug_info(trim(subname)//' ',trim(olog(n)%filename), &
+ olog(n)%chkfile_nextAdvance, olog(n)%createsize, importexport)
- !> Determine if the netcdf output file is complete
- !!
- !! @param[in] fname the file name
- !! @param[in] chk4size logical flag for check method in use
- !! @param[in] createsize the filesize at creation
- !! @param[out] rc return code
- !! @return logical flag, true if the file is complete
- logical function file_is_complete(fname, chk4size, createsize, rc) result(filecomplete)
+ if (lstop) then
+ ! use prevRing in place of currTime to allow for stopping between averaging intervals
+ ! prevring == currTime if stopping on intervals
+ call ESMF_AlarmGet(olog(n)%alarm, prevRingTime=prevring, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
- character(len=*), intent(in) :: fname
- logical, intent(in) :: chk4size
- integer, intent(in) :: createsize
- integer, intent(out) :: rc
+ timestr = get_timestr(prevring-30*freq(n)*tincrement, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ write(olog(n)%filename,'(A)')trim(outputdir)//'ocn_'//trim(timestr)//'.nc'
- integer :: nlen(1), fsize(1)
- !----------------------------------------------------------------------------
+ fname = trim(olog(n)%filename)
+ filecomplete = file_is_complete(fname, olog(n)%use_filesize, olog(n)%createsize, rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
- rc = ESMF_SUCCESS
+ if (filecomplete) then
+ olog(n)%chkfile_nextAdvance = .false.
+ olog(n)%time_lastrestart = lastrestart
+ if (is_root_pe()) then
+ call log_restart_fh(prevring, startTime, 'mom6.lstop.'//chour, prefixtime=.true., &
+ lastrestart=olog(n)%time_lastrestart, lastoutput=olog(n)%filename, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ endif
+ endif
+ if (debug .and. is_root_pe()) call debug_info(trim(subname)//' lstop ',trim(olog(n)%filename), &
+ olog(n)%chkfile_nextAdvance, olog(n)%createsize, importexport)
- filecomplete = .false.
- nlen(1) = nf90_fill_int
- fsize(1) = nf90_fill_int
+ endif ! lstop
+ endif ! chour = output_fh
+ enddo
+end subroutine outputlog_run
+
+!> Check all restart files to determine if output has been completed
+!!
+!! @param[in] clock an ESMF_Clock object
+!! @param[in] num_rest_files the number of restart files
+!! @param[out] rc return code
+subroutine outputlog_restart(mclock, num_rest_files, rc)
+ type(ESMF_Clock) :: mclock
+ integer, intent(in) :: num_rest_files
+ integer, intent(out) :: rc
+
+ ! local variables
+ type(ESMF_Time) :: startTime, currTime, nextTime
+ integer :: n, nlen(1)
+ integer :: year, month, day, hour, minute, seconds
+ character(len=256) :: fname
+ character(len=15) :: timestr
+ character(len=40) :: importexport
+ logical, allocatable :: allDone(:)
+ character(len=8) :: suffix
+ character(len=256) :: subname='MOM_cap:(outputlog_restart)'
+ !----------------------------------------------------------------------------
+
+ rc = ESMF_SUCCESS
+
+ call ESMF_ClockGet(mclock, startTime=startTime, currTime=currTime, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ call ESMF_ClockGetNextTime(mclock, nextTime, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ importexport = get_importexport(currTime, nextTime, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+
+ call ESMF_TimeGet(nextTime, yy=year, mm=month, dd=day, h=hour, m=minute, s=seconds, rc=rc )
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ write(timestr,'(I4.4,2(I2.2),A,3(I2.2))') year, month, day,".", hour, minute, seconds
+
+ allocate(allDone(1:num_rest_files))
+ allDone = .false.
+
+ do n = 1,num_rest_files
+ if (n == 1) then
+ suffix = ''
+ else if (n-1 < 10) then
+ write(suffix,'("_",I1)') n-1
+ else
+ write(suffix,'("_",I2)') n-1
+ endif
+ if (len_trim(suffix) == 0) then
+ fname = trim(restartdir)//trim(timestr)//'.MOM.res.nc'
+ else
+ fname = trim(restartdir)//trim(timestr)//'.MOM.res'//trim(suffix)//'.nc'
+ endif
- inquire(file=fname, exist=existflag)
+ ! check if file is written
+ inquire(file=trim(fname), exist=existflag)
if (existflag) then
- if (is_root_pe()) then
- nlen(1) = get_unlimited_len(fname)
- inquire(file=fname, size=fsize(1))
- end if
+ if (is_root_pe())then
+ nlen(1) = get_unlimited_len(trim(fname))
+ endif
call ESMF_VMBroadCast(vm, nlen, 1, 0, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- call ESMF_VMBroadCast(vm, fsize, 1, 0, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
- end if
- if (chk4size) then
- filecomplete = (nlen(1) > 0 .and. fsize(1) > createsize)
- else
- filecomplete = (nlen(1) > 0)
- end if
- end function file_is_complete
-
- !> Return the length of the unlimited dimension
- !!
- !! @param[in] fname the file name
- !! @return unlimited dimension length
- integer function get_unlimited_len(fname) result(unlen)
-
- character(len=*), intent(in) :: fname
-
- integer :: ncid, dimid
- !----------------------------------------------------------------------------
-
- unlen = 0
- call nf90_err(nf90_open(trim(fname), nf90_nowrite, ncid), 'nf90_open: '//trim(fname))
- call nf90_err(nf90_inquire(ncid, unlimiteddimid=dimid), 'inquire unlimiteddimid')
- call nf90_err(nf90_inquire_dimension(ncid, dimid, len=unlen), 'inquire unlimited dimension')
- call nf90_err(nf90_close(ncid), 'close: '//trim(fname))
- end function get_unlimited_len
-
- !> Convenience function to return a 16-character time string
- !!
- !! @param[in] MyTime an ESMF_Time object
- !! @param[out] rc return code
- !! @return 16-character formatted time string (YYYY_MM_DD_HH_MM)
- character(len=16) function get_timestr(MyTime, rc) result(timestr)
-
- type(ESMF_Time), intent(in) :: MyTime
- integer, intent(out) :: rc
-
- integer :: year, month, day, hour, minute
- !----------------------------------------------------------------------------
-
- rc = ESMF_SUCCESS
-
- call ESMF_TimeGet(MyTime, yy=year, mm=month, dd=day, h=hour, m=minute, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
- write(timestr,'(I4.4,4(A,I2.2))')year,'_',month,'_',day,'_',hour,'_',minute
- end function get_timestr
-
- !> Convenience function to return import/export timestring
- !!
- !! @param[in] currTime an ESMF_Time object
- !! @param[in] nextTime an ESMF_Time object
- !! @param[out] rc return code
- !! @return 40-character string
- character(len=40) function get_importexport(currTime, nextTime, rc) result(importexport)
-
- type(ESMF_Time), intent(in) :: currTime, nextTime
- integer, intent(out) :: rc
-
- character(len=19) :: import_timestr, export_timestr
- !----------------------------------------------------------------------------
-
- rc = ESMF_SUCCESS
+ if (nlen(1) > 0) allDone(n) = .true.
+ if (debug .and. is_root_pe()) then
+ if (nlen(1) > 0) then
+ print '(A)',trim(subname)//' restart '//trim(fname)//' '//trim(importexport)//' complete'
+ else
+ print '(A)',trim(subname)//' restart '//trim(fname)//' '//trim(importexport)//' still 0'
+ endif
+ endif
+ endif
+ enddo ! num_rest_files
- call ESMF_TimeGet(currTime, timestring=import_timestr, rc=rc)
+ if (all(allDone) .eqv. .true.) then
+ lastrestart = nextTime
+ if (is_root_pe()) then
+ call log_restart_fh(nextTime, startTime, 'mom6.res', prefixtime=.true., rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ endif
+ endif
+end subroutine outputlog_restart
+
+!> Determine if the netcdf output file is complete
+!!
+!! @param[in] fname the file name
+!! @param[in] chk4size logical flag for check method in use
+!! @param[in] createsize the filesize at creation
+!! @param[out] rc return code
+!! @return logical flag, true if the file is complete
+logical function file_is_complete(fname, chk4size, createsize, rc) result(filecomplete)
+ character(len=*), intent(in) :: fname
+ logical, intent(in) :: chk4size
+ integer, intent(in) :: createsize
+ integer, intent(out) :: rc
+
+ integer :: nlen(1), fsize(1)
+ !----------------------------------------------------------------------------
+
+ rc = ESMF_SUCCESS
+
+ filecomplete = .false.
+ nlen(1) = nf90_fill_int
+ fsize(1) = nf90_fill_int
+
+ inquire(file=fname, exist=existflag)
+ if (existflag) then
+ if (is_root_pe()) then
+ nlen(1) = get_unlimited_len(fname)
+ inquire(file=fname, size=fsize(1))
+ endif
+ call ESMF_VMBroadCast(vm, nlen, 1, 0, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- call ESMF_TimeGet(nextTime, timestring=export_timestr, rc=rc)
+ call ESMF_VMBroadCast(vm, fsize, 1, 0, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
- importexport = trim(import_timestr)//' '//trim(export_timestr)
- end function get_importexport
-
- !> Write debug info to stdout, only called on root pe
- !!
- !! @param[in] tag an information tag
- !! @param[in] fname the filename to check
- !! @param[in] filesize the filesize at creation time
- !! @param[in] chkflag logical flag for checking next Advance
- !! @param[in] timestring a timestring
- subroutine debug_info(tag,fname,chkflag,filesize,timestring)
-
- character(len=*), intent(in) :: tag
- character(len=*), intent(in) :: fname
- integer, intent(in) :: filesize
- logical, intent(in) :: chkflag
- character(len=*), intent(in) :: timestring
-
- integer :: fsize
- character(len=256) :: msgString
- !----------------------------------------------------------------------------
-
- inquire(file=fname, exist=existflag)
- if (existflag) then
- inquire(file=fname, size=fsize)
- write(msgString,'(A)')tag//' '//fname//' exists '//timestring
- if (chkflag) then
- print '(A,L,2i16)',trim(msgString)//' not complete, chkflag ',chkflag,filesize,fsize
- else
- print '(A,L,2i16)',trim(msgString)//' complete, chkflag ',chkflag,filesize,fsize
- end if
+ endif
+
+ if (chk4size) then
+ filecomplete = (nlen(1) > 0 .and. fsize(1) > createsize)
+ else
+ filecomplete = (nlen(1) > 0)
+ endif
+end function file_is_complete
+
+!> Return the length of the unlimited dimension
+!!
+!! @param[in] fname the file name
+!! @return unlimited dimension length
+integer function get_unlimited_len(fname) result(unlen)
+ character(len=*), intent(in) :: fname
+
+ integer :: ncid, dimid
+ !----------------------------------------------------------------------------
+
+ unlen = 0
+ call nf90_err(nf90_open(trim(fname), nf90_nowrite, ncid), 'nf90_open: '//trim(fname))
+ call nf90_err(nf90_inquire(ncid, unlimiteddimid=dimid), 'inquire unlimiteddimid')
+ call nf90_err(nf90_inquire_dimension(ncid, dimid, len=unlen), 'inquire unlimited dimension')
+ call nf90_err(nf90_close(ncid), 'close: '//trim(fname))
+end function get_unlimited_len
+
+!> Convenience function to return a 16-character time string
+!!
+!! @param[in] MyTime an ESMF_Time object
+!! @param[out] rc return code
+!! @return 16-character formatted time string (YYYY_MM_DD_HH_MM)
+character(len=16) function get_timestr(MyTime, rc) result(timestr)
+ type(ESMF_Time), intent(in) :: MyTime
+ integer, intent(out) :: rc
+
+ integer :: year, month, day, hour, minute
+ !----------------------------------------------------------------------------
+
+ rc = ESMF_SUCCESS
+
+ call ESMF_TimeGet(MyTime, yy=year, mm=month, dd=day, h=hour, m=minute, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ write(timestr,'(I4.4,4(A,I2.2))')year,'_',month,'_',day,'_',hour,'_',minute
+end function get_timestr
+
+!> Convenience function to return import/export timestring
+!!
+!! @param[in] currTime an ESMF_Time object
+!! @param[in] nextTime an ESMF_Time object
+!! @param[out] rc return code
+!! @return 40-character string
+character(len=40) function get_importexport(currTime, nextTime, rc) result(importexport)
+
+ type(ESMF_Time), intent(in) :: currTime, nextTime
+ integer, intent(out) :: rc
+
+ character(len=19) :: import_timestr, export_timestr
+ !----------------------------------------------------------------------------
+
+ rc = ESMF_SUCCESS
+
+ call ESMF_TimeGet(currTime, timestring=import_timestr, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ call ESMF_TimeGet(nextTime, timestring=export_timestr, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ importexport = trim(import_timestr)//' '//trim(export_timestr)
+end function get_importexport
+
+!> Write debug info to stdout, only called on root pe
+!!
+!! @param[in] tag an information tag
+!! @param[in] fname the filename to check
+!! @param[in] filesize the filesize at creation time
+!! @param[in] chkflag logical flag for checking next Advance
+!! @param[in] timestring a timestring
+subroutine debug_info(tag,fname,chkflag,filesize,timestring)
+ character(len=*), intent(in) :: tag
+ character(len=*), intent(in) :: fname
+ integer, intent(in) :: filesize
+ logical, intent(in) :: chkflag
+ character(len=*), intent(in) :: timestring
+
+ integer :: fsize
+ character(len=256) :: msgString
+ !----------------------------------------------------------------------------
+
+ inquire(file=fname, exist=existflag)
+ if (existflag) then
+ inquire(file=fname, size=fsize)
+ write(msgString,'(A)')tag//' '//fname//' exists '//timestring
+ if (chkflag) then
+ print '(A,L,2i16)',trim(msgString)//' not complete, chkflag ',chkflag,filesize,fsize
else
- write(msgString,'(A)')tag//' '//fname//' does not exist '//timestring
- print '(A)',trim(msgString)
- end if
- end subroutine debug_info
-
- !> Handle netcdf errors
- !!
- !! @param[in] ierr the error code
- !! @param[in] string the error message
- subroutine nf90_err(ierr, string)
-
- integer, intent(in) :: ierr
- character(len=*), intent(in) :: string
- !----------------------------------------------------------------------------
-
- if (ierr /= nf90_noerr) then
- write(0, '(A)') 'FATAL ERROR: ' // trim(string)// ' : ' // trim(nf90_strerror(ierr))
- ! This fails on WCOSS2 with Intel 19 compiler. See https://community.intel.com/
- ! Search term "STOP and ERROR STOP with variable stop codes"
- ! When WCOSS2 moves to Intel 2020+, uncomment the next line and remove stop 99
- !stop ierr
- stop 99
- end if
- end subroutine nf90_err
+ print '(A,L,2i16)',trim(msgString)//' complete, chkflag ',chkflag,filesize,fsize
+ endif
+ else
+ write(msgString,'(A)')tag//' '//fname//' does not exist '//timestring
+ print '(A)',trim(msgString)
+ endif
+end subroutine debug_info
+
+!> Handle netcdf errors
+!!
+!! @param[in] ierr the error code
+!! @param[in] string the error message
+subroutine nf90_err(ierr, string)
+ integer, intent(in) :: ierr
+ character(len=*), intent(in) :: string
+ !----------------------------------------------------------------------------
+
+ if (ierr /= nf90_noerr) then
+ write(0, '(A)') 'FATAL ERROR: ' // trim(string)// ' : ' // trim(nf90_strerror(ierr))
+ ! This fails on WCOSS2 with Intel 19 compiler. See https://community.intel.com/
+ ! Search term "STOP and ERROR STOP with variable stop codes"
+ ! When WCOSS2 moves to Intel 2020+, uncomment the next line and remove stop 99
+ !stop ierr
+ stop 99
+ endif
+end subroutine nf90_err
#endif
end module MOM_cap_outputlog
diff --git a/config_src/drivers/nuopc_cap/mom_cap_profiling.F90 b/config_src/drivers/nuopc_cap/mom_cap_profiling.F90
new file mode 100644
index 0000000000..4e3e387e2d
--- /dev/null
+++ b/config_src/drivers/nuopc_cap/mom_cap_profiling.F90
@@ -0,0 +1,45 @@
+!> Contains wrapper routines that call the ufs tracing routines
+module mom_cap_profiling
+
+#ifdef UFS_TRACING
+ use ufs_trace_mod, only: ufs_trace_init, ufs_trace, ufs_trace_finalize
+#endif
+
+ implicit none
+
+ private
+
+ public cap_profiling_init
+ public cap_profiling
+ public cap_profiling_finalize
+
+contains
+
+!> Wrapper routine that calls ufs_trace_init
+ subroutine cap_profiling_init()
+#ifdef UFS_TRACING
+ call ufs_trace_init()
+#endif
+ return
+ end subroutine cap_profiling_init
+
+!> Wrapper routine that calls ufs_trace
+ subroutine cap_profiling(component, routine, ph)
+ character(len=*), intent(in) :: component !< Name of the component, 'mom'
+ character(len=*), intent(in) :: routine !< Name of the profiled subroutine
+ character(len=*), intent(in) :: ph !< Duration event phase type. 'B' or 'E' for begin/end
+#ifdef UFS_TRACING
+ call ufs_trace(component, routine, ph)
+#endif
+ return
+ end subroutine cap_profiling
+
+!> Wrapper routine that calls ufs_trace_finalize
+ subroutine cap_profiling_finalize()
+#ifdef UFS_TRACING
+ call ufs_trace_finalize()
+#endif
+ return
+ end subroutine cap_profiling_finalize
+
+end module mom_cap_profiling
diff --git a/config_src/drivers/nuopc_cap/mom_cap_time.F90 b/config_src/drivers/nuopc_cap/mom_cap_time.F90
index d8ae6892a9..f49ea133ff 100644
--- a/config_src/drivers/nuopc_cap/mom_cap_time.F90
+++ b/config_src/drivers/nuopc_cap/mom_cap_time.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This was originally share code in CIME, but required CIME as a
!! dependency to build the MOM cap. The options here for setting
!! a restart alarm are useful for all caps, so a second step is to
diff --git a/config_src/drivers/nuopc_cap/mom_inline_mod.F90 b/config_src/drivers/nuopc_cap/mom_inline_mod.F90
index f279614e7b..8b8b544f2f 100644
--- a/config_src/drivers/nuopc_cap/mom_inline_mod.F90
+++ b/config_src/drivers/nuopc_cap/mom_inline_mod.F90
@@ -1,221 +1,218 @@
+!> This module contains a set of subroutines that enables inline CDEPS capability
+
module mom_inline_mod
- use NUOPC , only: NUOPC_CompAttributeGet
- use ESMF , only: ESMF_GridComp, ESMF_Mesh
- use ESMF , only: ESMF_Clock, ESMF_Time, ESMF_TimeGet, ESMF_ClockGet
- use ESMF , only: ESMF_KIND_R8, ESMF_SUCCESS, ESMF_LogFoundError
- use ESMF , only: ESMF_LOGERR_PASSTHRU, ESMF_LOGMSG_INFO, ESMF_LOGWRITE
- use ESMF , only: ESMF_END_ABORT, ESMF_Finalize, ESMF_MAXSTR
- use dshr_mod , only: dshr_pio_init
- use dshr_strdata_mod , only: shr_strdata_type, shr_strdata_print
- use dshr_strdata_mod , only: shr_strdata_init_from_inline
- use dshr_strdata_mod , only: shr_strdata_advance
- use dshr_methods_mod , only: dshr_fldbun_getfldptr, dshr_fldbun_Field_diagnose
- use dshr_stream_mod , only: shr_stream_init_from_esmfconfig
- use MOM_cap_methods , only: ChkErr
+use NUOPC , only: NUOPC_CompAttributeGet
+use ESMF , only: ESMF_GridComp, ESMF_Mesh
+use ESMF , only: ESMF_Clock, ESMF_Time, ESMF_TimeGet, ESMF_ClockGet
+use ESMF , only: ESMF_KIND_R8, ESMF_SUCCESS, ESMF_LogFoundError
+use ESMF , only: ESMF_LOGERR_PASSTHRU, ESMF_LOGMSG_INFO, ESMF_LOGWRITE
+use ESMF , only: ESMF_END_ABORT, ESMF_Finalize, ESMF_MAXSTR
+use dshr_mod , only: dshr_pio_init
+use dshr_strdata_mod , only: shr_strdata_type, shr_strdata_print
+use dshr_strdata_mod , only: shr_strdata_init_from_inline
+use dshr_strdata_mod , only: shr_strdata_advance
+use dshr_methods_mod , only: dshr_fldbun_getfldptr, dshr_fldbun_Field_diagnose
+use dshr_stream_mod , only: shr_stream_init_from_esmfconfig
+use MOM_cap_methods , only: ChkErr
- implicit none
- private
+implicit none
+private
- public mom_inline_init
- public mom_inline_run
+public mom_inline_init
+public mom_inline_run
- type(shr_strdata_type), allocatable :: sdat(:)
+type(shr_strdata_type), allocatable :: sdat(:)
- integer :: logunit ! the logunit on the root task
- character(len=ESMF_MAXSTR) :: stream_name ! generic identifier
+integer :: logunit ! the logunit on the root task
+character(len=ESMF_MAXSTR) :: stream_name ! generic identifier
- character(len=*), parameter :: u_FILE_u = __FILE__
+character(len=*), parameter :: u_FILE_u = __FILE__
contains
- !===============================================================================
- subroutine mom_inline_init(gcomp, model_clock, model_mesh, mytask, rc)
-
- ! input/output parameters
- type(ESMF_GridComp) , intent(in) :: gcomp !< ESMF_GridComp object
- type(ESMF_Clock) , intent(in) :: model_clock !< ESMF_Clock object
- type(ESMF_Mesh) , intent(in) :: model_mesh !< ESMF mesh
- integer , intent(in) :: mytask !< the current task
- integer , intent(out) :: rc !< Return code
-
- ! stream data from config (xml or esmf), one or more streams
- type(shr_strdata_type) :: sdatconfig
-
- ! local variables
- logical :: isPresent, isSet
- integer :: ns, l
- integer :: nstreams, nvars
-
- character(len=ESMF_MAXSTR) :: value, streamfilename
- character(len=ESMF_MAXSTR), allocatable :: filelist(:)
- character(len=ESMF_MAXSTR), allocatable :: filevars(:,:)
-
- character(len=*), parameter :: subname='(mom_inline_init)'
- !----------------------------------------------------------------------
-
- rc = ESMF_SUCCESS
-
- call NUOPC_CompAttributeGet(gcomp, name="streamfilename", value=value, isPresent=isPresent, isSet=isSet, rc=rc)
- if (ChkErr(rc,__LINE__,u_FILE_u)) return
- if (isPresent .and. isSet) then
- streamfilename = value
- else
- call ESMF_LogWrite(trim(subname)//': streamfilename must be provided', ESMF_LOGMSG_INFO)
- call ESMF_Finalize(endflag=ESMF_END_ABORT)
- return
- end if
-#ifndef CESMCOUPLED
- if (mytask == 0) then
- open (newunit=logunit, file='log.mom6.cdeps')
- else
- logunit = 6
- end if
-
- ! CMEPS Init PIO
- call dshr_pio_init(gcomp, sdatconfig, logunit, rc=rc)
- if (chkerr(rc,__LINE__,u_FILE_u)) return
+!===============================================================================
+subroutine mom_inline_init(gcomp, model_clock, model_mesh, mytask, rc)
+ type(ESMF_GridComp) , intent(in) :: gcomp !< ESMF_GridComp object
+ type(ESMF_Clock) , intent(in) :: model_clock !< ESMF_Clock object
+ type(ESMF_Mesh) , intent(in) :: model_mesh !< ESMF mesh
+ integer , intent(in) :: mytask !< the current task
+ integer , intent(out) :: rc !< Return code
+
+ ! local variables
+ logical :: isPresent, isSet
+ integer :: ns, l
+ integer :: nstreams, nvars
+ type(shr_strdata_type) :: sdatconfig !< stream data from config (xml or esmf), one or more streams
+
+ character(len=ESMF_MAXSTR) :: value, streamfilename
+ character(len=ESMF_MAXSTR), allocatable :: filelist(:)
+ character(len=ESMF_MAXSTR), allocatable :: filevars(:,:)
+
+ character(len=*), parameter :: subname='(mom_inline_init)'
+ !----------------------------------------------------------------------
+
+ rc = ESMF_SUCCESS
+
+ call NUOPC_CompAttributeGet(gcomp, name="streamfilename", value=value, isPresent=isPresent, isSet=isSet, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ if (isPresent .and. isSet) then
+ streamfilename = value
+ else
+ call ESMF_LogWrite(trim(subname)//': streamfilename must be provided', ESMF_LOGMSG_INFO)
+ call ESMF_Finalize(endflag=ESMF_END_ABORT)
+ return
+ endif
- ! read the available stream definitions, each data stream is one or more data_files
- ! which have the same spatial and temporal coordinates
- call shr_stream_init_from_esmfconfig(trim(streamfilename), sdatconfig%stream, logunit, &
- sdatconfig%pio_subsystem, sdatconfig%io_type, sdatconfig%io_format, rc=rc)
- if (chkerr(rc,__LINE__,u_FILE_u)) return
+#ifndef CESMCOUPLED
+ if (mytask == 0) then
+ open (newunit=logunit, file='log.mom6.cdeps')
+ else
+ logunit = 6
+ endif
+
+ ! CMEPS Init PIO
+ call dshr_pio_init(gcomp, sdatconfig, logunit, rc=rc)
+ if (chkerr(rc,__LINE__,u_FILE_u)) return
+
+ ! read the available stream definitions, each data stream is one or more data_files
+ ! which have the same spatial and temporal coordinates
+ call shr_stream_init_from_esmfconfig(trim(streamfilename), sdatconfig%stream, logunit, &
+ sdatconfig%pio_subsystem, sdatconfig%io_type, sdatconfig%io_format, rc=rc)
+ if (chkerr(rc,__LINE__,u_FILE_u)) return
#else
- !TODO: CESM logunit, configuration via xml etc
- !call shr_stream_init_from_xml(trim(streamfilename) ....
+ !TODO: CESM logunit, configuration via xml etc
+ !call shr_stream_init_from_xml(trim(streamfilename) ....
#endif
- nstreams = size(sdatconfig%stream)
- ! allocate stream data type
- if (.not. allocated(sdat)) allocate(sdat(nstreams))
-
- ! set the model clock and mesh
- sdat(:)%model_clock = model_clock
- sdat(:)%model_mesh = model_mesh
-
- ! loop over streams and initialize
- do ns = 1, nstreams
- sdat(ns)%pio_subsystem => sdatconfig%pio_subsystem
- sdat(ns)%io_type = sdatconfig%io_type
- sdat(ns)%io_format = sdatconfig%io_format
-
- allocate(filelist(sdatconfig%stream(ns)%nfiles))
- allocate(filevars(sdatconfig%stream(ns)%nvars,2))
-
- ! fill stream info
- do l = 1, sdatconfig%stream(ns)%nfiles
- filelist(l) = trim(sdatconfig%stream(ns)%file(l)%name)
- end do
- do l = 1, sdatconfig%stream(ns)%nvars
- filevars(l,1) = trim(sdatconfig%stream(ns)%varlist(l)%nameinfile)
- filevars(l,2) = trim(sdatconfig%stream(ns)%varlist(l)%nameinmodel)
- end do
-
- write(stream_name,fmt='(a,i2.2)') 'stream_', ns
- call shr_strdata_init_from_inline(sdat(ns), &
- my_task = mytask, &
- logunit = logunit, &
- compname = 'OCN', &
- model_clock = sdat(ns)%model_clock, &
- model_mesh = sdat(ns)%model_mesh, &
- stream_name = trim(stream_name), &
- stream_meshfile = trim(sdatconfig%stream(ns)%meshfile), &
- stream_filenames = filelist, &
- stream_yearFirst = sdatconfig%stream(ns)%yearFirst, &
- stream_yearLast = sdatconfig%stream(ns)%yearLast, &
- stream_yearAlign = sdatconfig%stream(ns)%yearAlign, &
- stream_fldlistFile = filevars(:,1), &
- stream_fldListModel = filevars(:,2), &
- stream_lev_dimname = trim(sdatconfig%stream(ns)%lev_dimname), &
- stream_mapalgo = trim(sdatconfig%stream(ns)%mapalgo), &
- stream_offset = sdatconfig%stream(ns)%offset, &
- stream_taxmode = trim(sdatconfig%stream(ns)%taxmode), &
- stream_dtlimit = sdatconfig%stream(ns)%dtlimit, &
- stream_tintalgo = trim(sdatconfig%stream(ns)%tInterpAlgo), &
- stream_src_mask = sdatconfig%stream(ns)%src_mask_val, &
- stream_dst_mask = sdatconfig%stream(ns)%dst_mask_val, &
- rc = rc)
- if (chkerr(rc,__LINE__,u_FILE_u)) return
-
- deallocate(filelist)
- deallocate(filevars)
- end do
-
- end subroutine mom_inline_init
- !===============================================================================
- subroutine mom_inline_run(clock, ocean_public, ocean_grid, ice_ocean_boundary, dbug, rc)
-
- use MOM_ocean_model_nuopc, only: ocean_public_type
- use MOM_surface_forcing_nuopc, only: ice_ocean_boundary_type
- use MOM_grid, only: ocean_grid_type
- use mpp_domains_mod, only: mpp_get_compute_domain
-
- ! input/output variables
- type(ESMF_Clock) , intent(in) :: clock !< ESMF_Clock object
- type(ocean_public_type) , intent(in) :: ocean_public !< Ocean surface state
- type(ocean_grid_type) , intent(in) :: ocean_grid !< Ocean model grid
- type(ice_ocean_boundary_type) , intent(inout) :: ice_ocean_boundary !< Ocean boundary forcing
- integer , intent(in) :: dbug !< Integer debug flag
- integer , intent(out) :: rc !< Return code
-
- ! local variables
- type(ESMF_Time) :: date
- integer :: nstreams, nflds
- integer :: ns,nf,n,i,j
- integer :: isc, iec, jsc, jec
- integer :: year ! year (0, ...) for nstep+1
- integer :: mon ! month (1, ..., 12) for nstep+1
- integer :: day ! day of month (1, ..., 31) for nstep+1
- integer :: sec ! seconds into current date for nstep+1
- integer :: mcdate ! Current model date (yyyymmdd)
- character(len=ESMF_MAXSTR) :: fldname
- real(ESMF_KIND_R8), pointer :: dataPtr1d(:)
- character(len=*), parameter :: subname='(mom_inline_run)'
- !-----------------------------------------------------------------------
-
- rc = ESMF_SUCCESS
-
- ! The following are global indices without halos
- call mpp_get_compute_domain(ocean_public%domain, isc, iec, jsc, jec)
-
- ! Current model date
- call ESMF_ClockGet( clock, currTime=date, rc=rc )
+ nstreams = size(sdatconfig%stream)
+ ! allocate stream data type
+ if (.not. allocated(sdat)) allocate(sdat(nstreams))
+
+ ! set the model clock and mesh
+ sdat(:)%model_clock = model_clock
+ sdat(:)%model_mesh = model_mesh
+
+ ! loop over streams and initialize
+ do ns = 1, nstreams
+ sdat(ns)%pio_subsystem => sdatconfig%pio_subsystem
+ sdat(ns)%io_type = sdatconfig%io_type
+ sdat(ns)%io_format = sdatconfig%io_format
+
+ allocate(filelist(sdatconfig%stream(ns)%nfiles))
+ allocate(filevars(sdatconfig%stream(ns)%nvars,2))
+
+ ! fill stream info
+ do l = 1, sdatconfig%stream(ns)%nfiles
+ filelist(l) = trim(sdatconfig%stream(ns)%file(l)%name)
+ enddo
+ do l = 1, sdatconfig%stream(ns)%nvars
+ filevars(l,1) = trim(sdatconfig%stream(ns)%varlist(l)%nameinfile)
+ filevars(l,2) = trim(sdatconfig%stream(ns)%varlist(l)%nameinmodel)
+ enddo
+
+ write(stream_name,fmt='(a,i2.2)') 'stream_', ns
+ call shr_strdata_init_from_inline(sdat(ns), &
+ my_task = mytask, &
+ logunit = logunit, &
+ compname = 'OCN', &
+ model_clock = sdat(ns)%model_clock, &
+ model_mesh = sdat(ns)%model_mesh, &
+ stream_name = trim(stream_name), &
+ stream_meshfile = trim(sdatconfig%stream(ns)%meshfile), &
+ stream_filenames = filelist, &
+ stream_yearFirst = sdatconfig%stream(ns)%yearFirst, &
+ stream_yearLast = sdatconfig%stream(ns)%yearLast, &
+ stream_yearAlign = sdatconfig%stream(ns)%yearAlign, &
+ stream_fldlistFile = filevars(:,1), &
+ stream_fldListModel = filevars(:,2), &
+ stream_lev_dimname = trim(sdatconfig%stream(ns)%lev_dimname), &
+ stream_mapalgo = trim(sdatconfig%stream(ns)%mapalgo), &
+ stream_offset = sdatconfig%stream(ns)%offset, &
+ stream_taxmode = trim(sdatconfig%stream(ns)%taxmode), &
+ stream_dtlimit = sdatconfig%stream(ns)%dtlimit, &
+ stream_tintalgo = trim(sdatconfig%stream(ns)%tInterpAlgo), &
+ stream_src_mask = sdatconfig%stream(ns)%src_mask_val, &
+ stream_dst_mask = sdatconfig%stream(ns)%dst_mask_val, &
+ rc = rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
- call ESMF_TimeGet(date, yy=year, mm=mon, dd=day, s=sec, rc=rc)
+
+ deallocate(filelist)
+ deallocate(filevars)
+ enddo
+
+end subroutine mom_inline_init
+!===============================================================================
+subroutine mom_inline_run(clock, ocean_public, ocean_grid, ice_ocean_boundary, dbug, rc)
+ use MOM_ocean_model_nuopc, only: ocean_public_type
+ use MOM_surface_forcing_nuopc, only: ice_ocean_boundary_type
+ use MOM_grid, only: ocean_grid_type
+ use mpp_domains_mod, only: mpp_get_compute_domain
+
+ type(ESMF_Clock) , intent(in) :: clock !< ESMF_Clock object
+ type(ocean_public_type) , intent(in) :: ocean_public !< Ocean surface state
+ type(ocean_grid_type) , intent(in) :: ocean_grid !< Ocean model grid
+ type(ice_ocean_boundary_type) , intent(inout) :: ice_ocean_boundary !< Ocean boundary forcing
+ integer , intent(in) :: dbug !< Integer debug flag
+ integer , intent(out) :: rc !< Return code
+
+ ! local variables
+ type(ESMF_Time) :: date
+ integer :: nstreams, nflds
+ integer :: ns,nf,n,i,j
+ integer :: isc, iec, jsc, jec
+ integer :: year ! year (0, ...) for nstep+1
+ integer :: mon ! month (1, ..., 12) for nstep+1
+ integer :: day ! day of month (1, ..., 31) for nstep+1
+ integer :: sec ! seconds into current date for nstep+1
+ integer :: mcdate ! Current model date (yyyymmdd)
+ character(len=ESMF_MAXSTR) :: fldname
+ real(ESMF_KIND_R8), pointer :: dataPtr1d(:)
+ character(len=*), parameter :: subname='(mom_inline_run)'
+ !-----------------------------------------------------------------------
+
+ rc = ESMF_SUCCESS
+
+ ! The following are global indices without halos
+ call mpp_get_compute_domain(ocean_public%domain, isc, iec, jsc, jec)
+
+ ! Current model date
+ call ESMF_ClockGet( clock, currTime=date, rc=rc )
+ if (chkerr(rc,__LINE__,u_FILE_u)) return
+ call ESMF_TimeGet(date, yy=year, mm=mon, dd=day, s=sec, rc=rc)
+ if (chkerr(rc,__LINE__,u_FILE_u)) return
+ mcdate = year*10000 + mon*100 + day
+
+ nstreams = size(sdat)
+ ! Advance the streams
+ do ns = 1,nstreams
+ write(stream_name,fmt='(a,i2.2)') 'stream_', ns
+ call shr_strdata_advance(sdat(ns), ymd=mcdate, tod=sec, logunit=logunit, istr=trim(stream_name),rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
- mcdate = year*10000 + mon*100 + day
-
- nstreams = size(sdat)
- ! Advance the streams
- do ns = 1,nstreams
- write(stream_name,fmt='(a,i2.2)') 'stream_', ns
- call shr_strdata_advance(sdat(ns), ymd=mcdate, tod=sec, logunit=logunit, istr=trim(stream_name),rc=rc)
- if (chkerr(rc,__LINE__,u_FILE_u)) return
-
- nflds = size(sdat(ns)%pstrm(1)%fldlist_model)
- do nf = 1,nflds
- fldname = trim(sdat(ns)%pstrm(1)%fldlist_model(nf))
-
- if (fldname == 'lrunoff') then
- ! Get pointer for stream data that is time and spatially interpolated to model time and grid
- call dshr_fldbun_getFldPtr(sdat(ns)%pstrm(1)%fldbun_model, trim(fldname), dataPtr1d, rc=rc)
- if (chkerr(rc,__LINE__,u_FILE_u)) return
-
- n = 0
- do j = jsc,jec
- do i = isc,iec
- n = n + 1
- ice_ocean_boundary%lrunoff(i,j) = dataPtr1d(n)
- end do
- end do
- end if
-
- if (dbug > 1) then
- call dshr_fldbun_Field_diagnose(sdat(ns)%pstrm(1)%fldbun_model, trim(fldname), 'inline_run ', rc=rc)
- if (chkerr(rc,__LINE__,u_FILE_u)) return
- end if
- end do !nf
- end do !ns
-
- end subroutine mom_inline_run
+
+ nflds = size(sdat(ns)%pstrm(1)%fldlist_model)
+ do nf = 1,nflds
+ fldname = trim(sdat(ns)%pstrm(1)%fldlist_model(nf))
+
+ if (fldname == 'lrunoff') then
+ ! Get pointer for stream data that is time and spatially interpolated to model time and grid
+ call dshr_fldbun_getFldPtr(sdat(ns)%pstrm(1)%fldbun_model, trim(fldname), dataPtr1d, rc=rc)
+ if (chkerr(rc,__LINE__,u_FILE_u)) return
+
+ n = 0
+ do j = jsc,jec
+ do i = isc,iec
+ n = n + 1
+ ice_ocean_boundary%lrunoff(i,j) = dataPtr1d(n)
+ enddo
+ enddo
+ endif
+
+ if (dbug > 1) then
+ call dshr_fldbun_Field_diagnose(sdat(ns)%pstrm(1)%fldbun_model, trim(fldname), 'inline_run ', rc=rc)
+ if (chkerr(rc,__LINE__,u_FILE_u)) return
+ endif
+ enddo !nf
+ enddo !ns
+
+end subroutine mom_inline_run
end module mom_inline_mod
diff --git a/config_src/drivers/nuopc_cap/mom_ocean_model_nuopc.F90 b/config_src/drivers/nuopc_cap/mom_ocean_model_nuopc.F90
index a83576028a..96a49348cc 100644
--- a/config_src/drivers/nuopc_cap/mom_ocean_model_nuopc.F90
+++ b/config_src/drivers/nuopc_cap/mom_ocean_model_nuopc.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Top-level module for the MOM6 ocean model in coupled mode.
module MOM_ocean_model_nuopc
-! This file is part of MOM6. See LICENSE.md for the license.
-
! This is the top level module for the MOM6 ocean model. It contains routines
! for initialization, termination and update of ocean model state. This
! particular version wraps all of the calls for MOM6 in the calls that had
diff --git a/config_src/drivers/nuopc_cap/mom_surface_forcing_nuopc.F90 b/config_src/drivers/nuopc_cap/mom_surface_forcing_nuopc.F90
index 11f12a0038..b82cb00f01 100644
--- a/config_src/drivers/nuopc_cap/mom_surface_forcing_nuopc.F90
+++ b/config_src/drivers/nuopc_cap/mom_surface_forcing_nuopc.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Converts the input ESMF data (import data) to a MOM-specific data type (surface_forcing_CS).
module MOM_surface_forcing_nuopc
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms, only : reproducing_sum, field_chksum
use MOM_constants, only : hlv, hlf
use MOM_coupler_types, only : coupler_2d_bc_type, coupler_type_write_chksums
diff --git a/config_src/drivers/nuopc_cap/mom_ufs_trace_wrapper.F90 b/config_src/drivers/nuopc_cap/mom_ufs_trace_wrapper.F90
deleted file mode 100644
index 494c0ea466..0000000000
--- a/config_src/drivers/nuopc_cap/mom_ufs_trace_wrapper.F90
+++ /dev/null
@@ -1,39 +0,0 @@
-module mom_ufs_trace_wrapper_mod
-
-#ifdef UFS_TRACING
- use ufs_trace_mod, only: ufs_trace_init, ufs_trace, ufs_trace_finalize
-#endif
-
- implicit none
-
- private
-
- public ufs_trace_init_wrapper
- public ufs_trace_wrapper
- public ufs_trace_finalize_wrapper
-
-contains
-
- subroutine ufs_trace_init_wrapper()
-#ifdef UFS_TRACING
- call ufs_trace_init
-#endif
- return
- end subroutine ufs_trace_init_wrapper
-
- subroutine ufs_trace_wrapper(component, routine, ph)
- character(len=*), intent(in) :: component, routine, ph
-#ifdef UFS_TRACING
- call ufs_trace(component, routine, ph)
-#endif
- return
- end subroutine ufs_trace_wrapper
-
- subroutine ufs_trace_finalize_wrapper()
-#ifdef UFS_TRACING
- call ufs_trace_finalize
-#endif
- return
- end subroutine ufs_trace_finalize_wrapper
-
-end module mom_ufs_trace_wrapper_mod
diff --git a/config_src/drivers/nuopc_cap/ocn_comp_NUOPC.F90 b/config_src/drivers/nuopc_cap/ocn_comp_NUOPC.F90
index 6d25b9a1ae..bb41084b65 100644
--- a/config_src/drivers/nuopc_cap/ocn_comp_NUOPC.F90
+++ b/config_src/drivers/nuopc_cap/ocn_comp_NUOPC.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
module ocn_comp_NUOPC
use MOM_cap_mod
end module ocn_comp_NUOPC
diff --git a/config_src/drivers/nuopc_cap/time_utils.F90 b/config_src/drivers/nuopc_cap/time_utils.F90
index 46f922d5bf..e2912206d1 100644
--- a/config_src/drivers/nuopc_cap/time_utils.F90
+++ b/config_src/drivers/nuopc_cap/time_utils.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Set of time utilities for converting between FMS and ESMF time type.
module time_utils_mod
diff --git a/config_src/drivers/solo_driver/MESO_surface_forcing.F90 b/config_src/drivers/solo_driver/MESO_surface_forcing.F90
index f1f3daa52e..7fee056ec6 100644
--- a/config_src/drivers/solo_driver/MESO_surface_forcing.F90
+++ b/config_src/drivers/solo_driver/MESO_surface_forcing.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Sets forcing for the MESO configuration
module MESO_surface_forcing
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_diag_mediator, only : post_data, query_averaging_enabled
use MOM_diag_mediator, only : register_diag_field, diag_ctrl, safe_alloc_ptr
use MOM_domains, only : pass_var, pass_vector, AGRID
diff --git a/config_src/drivers/solo_driver/MOM_driver.F90 b/config_src/drivers/solo_driver/MOM_driver.F90
index 9b85fafb8d..b1d1487bb1 100644
--- a/config_src/drivers/solo_driver/MOM_driver.F90
+++ b/config_src/drivers/solo_driver/MOM_driver.F90
@@ -1,6 +1,8 @@
-program MOM6
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
-! This file is part of MOM6. See LICENSE.md for the license.
+program MOM6
!********+*********+*********+*********+*********+*********+*********+**
!* *
diff --git a/config_src/drivers/solo_driver/MOM_surface_forcing.F90 b/config_src/drivers/solo_driver/MOM_surface_forcing.F90
index faa94c3bdd..50f70c3978 100644
--- a/config_src/drivers/solo_driver/MOM_surface_forcing.F90
+++ b/config_src/drivers/solo_driver/MOM_surface_forcing.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Functions that calculate the surface wind stresses and fluxes of buoyancy
!! or temperature/salinity and fresh water, in ocean-only (solo) mode.
!!
@@ -7,8 +11,6 @@
!! fields is controlled by surface_forcing_init, located in this file.
module MOM_surface_forcing
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_constants, only : hlv, hlf
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
use MOM_cpu_clock, only : CLOCK_MODULE
diff --git a/config_src/drivers/solo_driver/atmos_ocean_fluxes.F90 b/config_src/drivers/solo_driver/atmos_ocean_fluxes.F90
index fb9fbe3e22..a8e11fbe34 100644
--- a/config_src/drivers/solo_driver/atmos_ocean_fluxes.F90
+++ b/config_src/drivers/solo_driver/atmos_ocean_fluxes.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A dummy version of atmos_ocean_fluxes_mod module for
!! use when the vastly larger FMS package is not needed.
module atmos_ocean_fluxes_mod
-! This file is part of MOM6. See LICENSE.md for the license.
-
implicit none ; private
public :: aof_set_coupler_flux
diff --git a/config_src/drivers/solo_driver/user_surface_forcing.F90 b/config_src/drivers/solo_driver/user_surface_forcing.F90
index 55b1be1172..109e0364ce 100644
--- a/config_src/drivers/solo_driver/user_surface_forcing.F90
+++ b/config_src/drivers/solo_driver/user_surface_forcing.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Template for user to code up surface forcing.
module user_surface_forcing
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_diag_mediator, only : post_data, query_averaging_enabled
use MOM_diag_mediator, only : register_diag_field, diag_ctrl, safe_alloc_ptr
use MOM_domains, only : pass_var, pass_vector, AGRID
diff --git a/config_src/drivers/timing_tests/time_MOM_ANN.F90 b/config_src/drivers/timing_tests/time_MOM_ANN.F90
index a399835d89..dc079d4cff 100644
--- a/config_src/drivers/timing_tests/time_MOM_ANN.F90
+++ b/config_src/drivers/timing_tests/time_MOM_ANN.F90
@@ -1,6 +1,8 @@
-program time_MOM_ANN
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
-! This file is part of MOM6. See LICENSE.md for the license.
+program time_MOM_ANN
use MOM_ANN, only : ANN_CS
use MOM_ANN, only : ANN_allocate, ANN_apply, ANN_end
diff --git a/config_src/drivers/timing_tests/time_MOM_EOS.F90 b/config_src/drivers/timing_tests/time_MOM_EOS.F90
index 94e3282511..b8a3f5d27d 100644
--- a/config_src/drivers/timing_tests/time_MOM_EOS.F90
+++ b/config_src/drivers/timing_tests/time_MOM_EOS.F90
@@ -1,6 +1,8 @@
-program time_MOM_EOS
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
-! This file is part of MOM6. See LICENSE.md for the license.
+program time_MOM_EOS
use MOM_EOS, only : EOS_type
use MOM_EOS, only : EOS_manual_init
diff --git a/config_src/drivers/timing_tests/time_MOM_remapping.F90 b/config_src/drivers/timing_tests/time_MOM_remapping.F90
index e752686040..684abe2e2c 100644
--- a/config_src/drivers/timing_tests/time_MOM_remapping.F90
+++ b/config_src/drivers/timing_tests/time_MOM_remapping.F90
@@ -1,6 +1,8 @@
-program time_MOM_remapping
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
-! This file is part of MOM6. See LICENSE.md for the license.
+program time_MOM_remapping
use MOM_remapping, only : remapping_CS
use MOM_remapping, only : initialize_remapping
diff --git a/config_src/drivers/timing_tests/time_reproducing_sum.F90 b/config_src/drivers/timing_tests/time_reproducing_sum.F90
index de9a3ef63f..2851550d21 100644
--- a/config_src/drivers/timing_tests/time_reproducing_sum.F90
+++ b/config_src/drivers/timing_tests/time_reproducing_sum.F90
@@ -1,6 +1,8 @@
-program time_reproducing_sum
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
-! This file is part of MOM6. See LICENSE.md for the license.
+program time_reproducing_sum
use MOM_coms, only : PE_here, root_PE, num_PEs, reproducing_sum
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
diff --git a/config_src/drivers/unit_tests/test_MOM_ANN.F90 b/config_src/drivers/unit_tests/test_MOM_ANN.F90
index 2bdf7c14fe..345b6ee6e9 100644
--- a/config_src/drivers/unit_tests/test_MOM_ANN.F90
+++ b/config_src/drivers/unit_tests/test_MOM_ANN.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
program test_MOM_ANN
use MOM_ANN, only : ANN_unit_tests
diff --git a/config_src/drivers/unit_tests/test_MOM_EOS.F90 b/config_src/drivers/unit_tests/test_MOM_EOS.F90
index 070bec04f6..90fe5b95e0 100644
--- a/config_src/drivers/unit_tests/test_MOM_EOS.F90
+++ b/config_src/drivers/unit_tests/test_MOM_EOS.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
program test_MOM_EOS
use MOM_EOS, only : EOS_unit_tests
diff --git a/config_src/drivers/unit_tests/test_MOM_file_parser.F90 b/config_src/drivers/unit_tests/test_MOM_file_parser.F90
index 55f57d5fc2..1b3e52259c 100644
--- a/config_src/drivers/unit_tests/test_MOM_file_parser.F90
+++ b/config_src/drivers/unit_tests/test_MOM_file_parser.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
program test_MOM_file_parser
use MPI
diff --git a/config_src/drivers/unit_tests/test_MOM_mixedlayer_restrat.F90 b/config_src/drivers/unit_tests/test_MOM_mixedlayer_restrat.F90
index 3e5eec64fc..60c6e72de4 100644
--- a/config_src/drivers/unit_tests/test_MOM_mixedlayer_restrat.F90
+++ b/config_src/drivers/unit_tests/test_MOM_mixedlayer_restrat.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
program test_MOM_mixedlayer_restrat
use MOM_mixed_layer_restrat, only : mixedlayer_restrat_unit_tests
diff --git a/config_src/drivers/unit_tests/test_MOM_remapping.F90 b/config_src/drivers/unit_tests/test_MOM_remapping.F90
index 4c6fe4f750..4869e57965 100644
--- a/config_src/drivers/unit_tests/test_MOM_remapping.F90
+++ b/config_src/drivers/unit_tests/test_MOM_remapping.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
program test_MOM_remapping
use MOM_remapping, only : remapping_unit_tests
diff --git a/config_src/drivers/unit_tests/test_MOM_string_functions.F90 b/config_src/drivers/unit_tests/test_MOM_string_functions.F90
index 2376afbbae..47da9d0411 100644
--- a/config_src/drivers/unit_tests/test_MOM_string_functions.F90
+++ b/config_src/drivers/unit_tests/test_MOM_string_functions.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
program test_MOM_string_functions
use MOM_string_functions, only : string_functions_unit_tests
diff --git a/config_src/drivers/unit_tests/test_numerical_testing_type.F90 b/config_src/drivers/unit_tests/test_numerical_testing_type.F90
index 77216219fa..532d7ca960 100644
--- a/config_src/drivers/unit_tests/test_numerical_testing_type.F90
+++ b/config_src/drivers/unit_tests/test_numerical_testing_type.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
program test_numerical_testing_type
use numerical_testing_type, only : numerical_testing_type_unit_tests
diff --git a/config_src/drivers/unit_tests/test_reproducing_sum.F90 b/config_src/drivers/unit_tests/test_reproducing_sum.F90
index 0afd138138..2a9af42538 100644
--- a/config_src/drivers/unit_tests/test_reproducing_sum.F90
+++ b/config_src/drivers/unit_tests/test_reproducing_sum.F90
@@ -1,6 +1,8 @@
-program test_reproducing_sum
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
-! This file is part of MOM6. See LICENSE.md for the license.
+program test_reproducing_sum
use MOM_coms, only : PE_here, root_PE, num_PEs, reproducing_sum
use MOM_coms, only : sum_across_PEs, max_across_PEs, max_count_prec
diff --git a/config_src/external/GFDL_ocean_BGC/MOM_generic_tracer.F90 b/config_src/external/GFDL_ocean_BGC/MOM_generic_tracer.F90
index 808cace1e2..4111bf020f 100644
--- a/config_src/external/GFDL_ocean_BGC/MOM_generic_tracer.F90
+++ b/config_src/external/GFDL_ocean_BGC/MOM_generic_tracer.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Drives the generic version of tracers TOPAZ and CFC and other GFDL BGC components
module MOM_generic_tracer
-! This file is part of MOM6. See LICENSE.md for the license.
-
#include
! The following macro is usually defined in but since MOM6 should not directly
diff --git a/config_src/external/MARBL/marbl_constants_mod.F90 b/config_src/external/MARBL/marbl_constants_mod.F90
index 7a1d44ba97..1181a50e31 100644
--- a/config_src/external/MARBL/marbl_constants_mod.F90
+++ b/config_src/external/MARBL/marbl_constants_mod.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A non-functioning template of the MARBL constants module
module marbl_constants_mod
diff --git a/config_src/external/MARBL/marbl_interface.F90 b/config_src/external/MARBL/marbl_interface.F90
index 40ddf17c73..4b57472798 100644
--- a/config_src/external/MARBL/marbl_interface.F90
+++ b/config_src/external/MARBL/marbl_interface.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A non-functioning template of the MARBL interface
module marbl_interface
diff --git a/config_src/external/MARBL/marbl_interface_public_types.F90 b/config_src/external/MARBL/marbl_interface_public_types.F90
index 3955faf73a..98f83b529b 100644
--- a/config_src/external/MARBL/marbl_interface_public_types.F90
+++ b/config_src/external/MARBL/marbl_interface_public_types.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A non-functioning template of the public structures provided through MARBL interface
module marbl_interface_public_types
@@ -87,4 +91,4 @@ module marbl_interface_public_types
type(marbl_single_output_type), dimension(:), pointer :: outputs_for_GCM => NULL() !< dummy outputs_for_GCM
end type marbl_output_for_GCM_type
-end module marbl_interface_public_types
\ No newline at end of file
+end module marbl_interface_public_types
diff --git a/config_src/external/MARBL/marbl_logging.F90 b/config_src/external/MARBL/marbl_logging.F90
index 906d881f0e..8310d3746b 100644
--- a/config_src/external/MARBL/marbl_logging.F90
+++ b/config_src/external/MARBL/marbl_logging.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A non-functioning template of the MARBL logging module
module marbl_logging
@@ -35,4 +39,4 @@ subroutine erase(self)
class(marbl_log_type), intent(inout) :: self
end subroutine erase
-end module marbl_logging
\ No newline at end of file
+end module marbl_logging
diff --git a/config_src/external/ODA_hooks/kdtree.f90 b/config_src/external/ODA_hooks/kdtree.f90
index a27716dde1..75558c94fa 100644
--- a/config_src/external/ODA_hooks/kdtree.f90
+++ b/config_src/external/ODA_hooks/kdtree.f90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A null version of K-d tree from geoKdTree
module kdtree
implicit none
diff --git a/config_src/external/ODA_hooks/ocean_da_core.F90 b/config_src/external/ODA_hooks/ocean_da_core.F90
index 769e44b2aa..a2fba2b7b0 100644
--- a/config_src/external/ODA_hooks/ocean_da_core.F90
+++ b/config_src/external/ODA_hooks/ocean_da_core.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A set of dummy interfaces for compiling the MOM6 DA driver code.
module ocean_da_core_mod
! MOM modules
diff --git a/config_src/external/ODA_hooks/ocean_da_types.F90 b/config_src/external/ODA_hooks/ocean_da_types.F90
index a99f1ae669..82e1a28e6e 100644
--- a/config_src/external/ODA_hooks/ocean_da_types.F90
+++ b/config_src/external/ODA_hooks/ocean_da_types.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Dummy aata structures and methods for ocean data assimilation.
module ocean_da_types_mod
diff --git a/config_src/external/ODA_hooks/write_ocean_obs.F90 b/config_src/external/ODA_hooks/write_ocean_obs.F90
index 51b5d2a1d7..6766a391ca 100644
--- a/config_src/external/ODA_hooks/write_ocean_obs.F90
+++ b/config_src/external/ODA_hooks/write_ocean_obs.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Dummy interfaces for writing ODA data
module write_ocean_obs_mod
diff --git a/config_src/external/database_comms/MOM_database_comms.F90 b/config_src/external/database_comms/MOM_database_comms.F90
index 4c3eb38b5c..90f866186a 100644
--- a/config_src/external/database_comms/MOM_database_comms.F90
+++ b/config_src/external/database_comms/MOM_database_comms.F90
@@ -1,6 +1,9 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Contains routines necessary to initialize communication with a database
module MOM_database_comms
-! This file is part of MOM6. See LICENSE.md for the license.
use MOM_file_parser, only : param_file_type
use MOM_error_handler, only : MOM_error, WARNING
use database_client_interface, only : dbclient_type
diff --git a/config_src/external/database_comms/database_client_interface.F90 b/config_src/external/database_comms/database_client_interface.F90
index 8b05b83daf..3997fe8baf 100644
--- a/config_src/external/database_comms/database_client_interface.F90
+++ b/config_src/external/database_comms/database_client_interface.F90
@@ -1,6 +1,9 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
module database_client_interface
-! This file is part of MOM6. See LICENSE.md for the license.
use iso_fortran_env, only : int8, int16, int32, int64, real32, real64
implicit none; private
diff --git a/config_src/external/drifters/MOM_particles.F90 b/config_src/external/drifters/MOM_particles.F90
index 1c41170582..543efeaf1d 100644
--- a/config_src/external/drifters/MOM_particles.F90
+++ b/config_src/external/drifters/MOM_particles.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A set of dummy interfaces for compiling the MOM6 drifters code
module MOM_particles_mod
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_grid, only : ocean_grid_type
use MOM_time_manager, only : time_type, get_date, operator(-)
use MOM_variables, only : thermo_var_ptrs
diff --git a/config_src/external/drifters/MOM_particles_types.F90 b/config_src/external/drifters/MOM_particles_types.F90
index 30fecad7a2..ffa9158e69 100644
--- a/config_src/external/drifters/MOM_particles_types.F90
+++ b/config_src/external/drifters/MOM_particles_types.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Dummy data structures and methods for drifters package
module particles_types_mod
-! This file is part of MOM6. See LICENSE.md for the license.
-
use, intrinsic :: iso_fortran_env, only : int64
use MOM_grid, only : ocean_grid_type
use MOM_domains, only: domain2D
diff --git a/config_src/external/stochastic_physics/get_stochy_pattern.F90 b/config_src/external/stochastic_physics/get_stochy_pattern.F90
index c3e23cd1a4..4d4c5c9bec 100644
--- a/config_src/external/stochastic_physics/get_stochy_pattern.F90
+++ b/config_src/external/stochastic_physics/get_stochy_pattern.F90
@@ -1,10 +1,12 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
! The are stubs for ocean stochastic physics
! the fully functional code is available at
! http://github.com/noaa-psd/stochastic_physics
module get_stochy_pattern_mod
-! This file is part of MOM6. See LICENSE.md for the license.
-
implicit none ; private
public :: write_stoch_restart_ocn
diff --git a/config_src/external/stochastic_physics/stochastic_physics.F90 b/config_src/external/stochastic_physics/stochastic_physics.F90
index 97bcff70d4..40f9cf9fa8 100644
--- a/config_src/external/stochastic_physics/stochastic_physics.F90
+++ b/config_src/external/stochastic_physics/stochastic_physics.F90
@@ -1,10 +1,12 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
! The are stubs for ocean stochastic physics
! the fully functional code is available at
! http://github.com/noaa-psd/stochastic_physics
module stochastic_physics
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_error, WARNING
implicit none ; private
diff --git a/config_src/infra/FMS1/MOM_coms_infra.F90 b/config_src/infra/FMS1/MOM_coms_infra.F90
index 13f8006184..a9395440bd 100644
--- a/config_src/infra/FMS1/MOM_coms_infra.F90
+++ b/config_src/infra/FMS1/MOM_coms_infra.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Thin interfaces to non-domain-oriented mpp communication subroutines
module MOM_coms_infra
-! This file is part of MOM6. See LICENSE.md for the license.
-
use iso_fortran_env, only : int32, int64
use mpp_mod, only : mpp_pe, mpp_root_pe, mpp_npes, mpp_set_root_pe
diff --git a/config_src/infra/FMS1/MOM_constants.F90 b/config_src/infra/FMS1/MOM_constants.F90
index a632267a7f..ad44ba4f85 100644
--- a/config_src/infra/FMS1/MOM_constants.F90
+++ b/config_src/infra/FMS1/MOM_constants.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides a few physical constants
module MOM_constants
-! This file is part of MOM6. See LICENSE.md for the license.
-
use constants_mod, only : FMS_HLV => HLV
use constants_mod, only : FMS_HLF => HLF
diff --git a/config_src/infra/FMS1/MOM_couplertype_infra.F90 b/config_src/infra/FMS1/MOM_couplertype_infra.F90
index 637f2b5ebf..e196b7e147 100644
--- a/config_src/infra/FMS1/MOM_couplertype_infra.F90
+++ b/config_src/infra/FMS1/MOM_couplertype_infra.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module wraps the FMS coupler types module
module MOM_couplertype_infra
-! This file is part of MOM6. See LICENSE.md for the license.
-
use coupler_types_mod, only : coupler_type_spawn, coupler_type_initialized, coupler_type_destructor
use coupler_types_mod, only : coupler_type_set_diags, coupler_type_send_data, coupler_type_copy_data
use coupler_types_mod, only : coupler_type_write_chksums, coupler_type_redistribute_data
diff --git a/config_src/infra/FMS1/MOM_cpu_clock_infra.F90 b/config_src/infra/FMS1/MOM_cpu_clock_infra.F90
index 0c42c577b4..aeca65b863 100644
--- a/config_src/infra/FMS1/MOM_cpu_clock_infra.F90
+++ b/config_src/infra/FMS1/MOM_cpu_clock_infra.F90
@@ -1,10 +1,12 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Wraps the MPP cpu clock functions
!!
!! The functions and constants should be accessed via mom_cpu_clock
module MOM_cpu_clock_infra
-! This file is part of MOM6. See LICENSE.md for the license.
-
! These interfaces and constants from MPP/FMS will not be directly exposed outside of this module
use fms_mod, only : clock_flag_default
use mpp_mod, only : mpp_clock_begin
diff --git a/config_src/infra/FMS1/MOM_data_override_infra.F90 b/config_src/infra/FMS1/MOM_data_override_infra.F90
index 1484f0c128..57311710c8 100644
--- a/config_src/infra/FMS1/MOM_data_override_infra.F90
+++ b/config_src/infra/FMS1/MOM_data_override_infra.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> These interfaces allow for ocean or sea-ice variables to be replaced with data.
module MOM_data_override_infra
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_domain_infra, only : MOM_domain_type, domain2d
use MOM_domain_infra, only : get_simple_array_i_ind, get_simple_array_j_ind
use MOM_time_manager, only : time_type
diff --git a/config_src/infra/FMS1/MOM_diag_manager_infra.F90 b/config_src/infra/FMS1/MOM_diag_manager_infra.F90
index d9be18d33f..2031487389 100644
--- a/config_src/infra/FMS1/MOM_diag_manager_infra.F90
+++ b/config_src/infra/FMS1/MOM_diag_manager_infra.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A wrapper for the FMS diag_manager routines. This module should be the
!! only MOM6 module which imports the FMS shared infrastructure for
!! diagnostics. Pass through interfaces are being documented
@@ -6,8 +10,6 @@
!! those APIs would be applied here).
module MOM_diag_manager_infra
-! This file is part of MOM6. See LICENSE.md for the license.
-
use, intrinsic :: iso_fortran_env, only : real64
use diag_axis_mod, only : fms_axis_init=>diag_axis_init
use diag_axis_mod, only : fms_get_diag_axis_name => get_diag_axis_name
diff --git a/config_src/infra/FMS1/MOM_domain_infra.F90 b/config_src/infra/FMS1/MOM_domain_infra.F90
index fdffef9d60..1031f07d56 100644
--- a/config_src/infra/FMS1/MOM_domain_infra.F90
+++ b/config_src/infra/FMS1/MOM_domain_infra.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Describes the decomposed MOM domain and has routines for communications across PEs
module MOM_domain_infra
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms_infra, only : PE_here, root_PE, num_PEs
use MOM_cpu_clock_infra, only : cpu_clock_begin, cpu_clock_end
use MOM_error_infra, only : MOM_error=>MOM_err, NOTE, WARNING, FATAL
diff --git a/config_src/infra/FMS1/MOM_ensemble_manager_infra.F90 b/config_src/infra/FMS1/MOM_ensemble_manager_infra.F90
index 3ab9d591da..436cf28654 100644
--- a/config_src/infra/FMS1/MOM_ensemble_manager_infra.F90
+++ b/config_src/infra/FMS1/MOM_ensemble_manager_infra.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A simple (very thin) wrapper for managing ensemble member layout information
module MOM_ensemble_manager_infra
-! This file is part of MOM6. See LICENSE.md for the license.
-
use ensemble_manager_mod, only : FMS_ensemble_manager_init => ensemble_manager_init
use ensemble_manager_mod, only : FMS_ensemble_pelist_setup => ensemble_pelist_setup
use ensemble_manager_mod, only : FMS_get_ensemble_id => get_ensemble_id
diff --git a/config_src/infra/FMS1/MOM_error_infra.F90 b/config_src/infra/FMS1/MOM_error_infra.F90
index e5a8b8dc68..7db14bc127 100644
--- a/config_src/infra/FMS1/MOM_error_infra.F90
+++ b/config_src/infra/FMS1/MOM_error_infra.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Routines for error handling and I/O management
module MOM_error_infra
-! This file is part of MOM6. See LICENSE.md for the license.
-
use mpp_mod, only : mpp_error, mpp_pe, mpp_root_pe, mpp_stdlog=>stdlog, mpp_stdout=>stdout
use mpp_mod, only : NOTE, WARNING, FATAL
diff --git a/config_src/infra/FMS1/MOM_interp_infra.F90 b/config_src/infra/FMS1/MOM_interp_infra.F90
index 70bc99827e..3069f1c644 100644
--- a/config_src/infra/FMS1/MOM_interp_infra.F90
+++ b/config_src/infra/FMS1/MOM_interp_infra.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module wraps the FMS temporal and spatial interpolation routines
module MOM_interp_infra
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_domain_infra, only : MOM_domain_type, domain2d
use MOM_io, only : axis_info
use MOM_io, only : set_axis_info
diff --git a/config_src/infra/FMS1/MOM_io_infra.F90 b/config_src/infra/FMS1/MOM_io_infra.F90
index e37e5db3cb..9bff64363a 100644
--- a/config_src/infra/FMS1/MOM_io_infra.F90
+++ b/config_src/infra/FMS1/MOM_io_infra.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module contains a thin inteface to mpp and fms I/O code
module MOM_io_infra
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_domain_infra, only : MOM_domain_type, rescale_comp_data, AGRID, BGRID_NE, CGRID_NE
use MOM_domain_infra, only : domain2d, domain1d, CENTER, CORNER, NORTH_FACE, EAST_FACE
use MOM_error_infra, only : MOM_error=>MOM_err, NOTE, FATAL, WARNING
diff --git a/config_src/infra/FMS1/MOM_time_manager.F90 b/config_src/infra/FMS1/MOM_time_manager.F90
index 5f3279b713..7ec71cc37c 100644
--- a/config_src/infra/FMS1/MOM_time_manager.F90
+++ b/config_src/infra/FMS1/MOM_time_manager.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Wraps the FMS time manager functions
module MOM_time_manager
-! This file is part of MOM6. See LICENSE.md for the license.
-
use time_manager_mod, only : time_type, get_time, set_time
use time_manager_mod, only : time_type_to_real, real_to_time_type
use time_manager_mod, only : operator(+), operator(-), operator(*), operator(/)
diff --git a/config_src/infra/FMS2/MOM_coms_infra.F90 b/config_src/infra/FMS2/MOM_coms_infra.F90
index 06a9b9f343..1112f932d2 100644
--- a/config_src/infra/FMS2/MOM_coms_infra.F90
+++ b/config_src/infra/FMS2/MOM_coms_infra.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Thin interfaces to non-domain-oriented mpp communication subroutines
module MOM_coms_infra
-! This file is part of MOM6. See LICENSE.md for the license.
-
use iso_fortran_env, only : int32, int64
use mpp_mod, only : mpp_pe, mpp_root_pe, mpp_npes, mpp_set_root_pe
diff --git a/config_src/infra/FMS2/MOM_constants.F90 b/config_src/infra/FMS2/MOM_constants.F90
index a632267a7f..ad44ba4f85 100644
--- a/config_src/infra/FMS2/MOM_constants.F90
+++ b/config_src/infra/FMS2/MOM_constants.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides a few physical constants
module MOM_constants
-! This file is part of MOM6. See LICENSE.md for the license.
-
use constants_mod, only : FMS_HLV => HLV
use constants_mod, only : FMS_HLF => HLF
diff --git a/config_src/infra/FMS2/MOM_couplertype_infra.F90 b/config_src/infra/FMS2/MOM_couplertype_infra.F90
index 3bcccc1dc7..b8dbc1be82 100644
--- a/config_src/infra/FMS2/MOM_couplertype_infra.F90
+++ b/config_src/infra/FMS2/MOM_couplertype_infra.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module wraps the FMS coupler types module
module MOM_couplertype_infra
-! This file is part of MOM6. See LICENSE.md for the license.
-
use coupler_types_mod, only : coupler_type_spawn, coupler_type_initialized, coupler_type_destructor
use coupler_types_mod, only : coupler_type_set_diags, coupler_type_send_data, coupler_type_copy_data
use coupler_types_mod, only : coupler_type_write_chksums, coupler_type_redistribute_data
diff --git a/config_src/infra/FMS2/MOM_cpu_clock_infra.F90 b/config_src/infra/FMS2/MOM_cpu_clock_infra.F90
index 0c42c577b4..aeca65b863 100644
--- a/config_src/infra/FMS2/MOM_cpu_clock_infra.F90
+++ b/config_src/infra/FMS2/MOM_cpu_clock_infra.F90
@@ -1,10 +1,12 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Wraps the MPP cpu clock functions
!!
!! The functions and constants should be accessed via mom_cpu_clock
module MOM_cpu_clock_infra
-! This file is part of MOM6. See LICENSE.md for the license.
-
! These interfaces and constants from MPP/FMS will not be directly exposed outside of this module
use fms_mod, only : clock_flag_default
use mpp_mod, only : mpp_clock_begin
diff --git a/config_src/infra/FMS2/MOM_data_override_infra.F90 b/config_src/infra/FMS2/MOM_data_override_infra.F90
index 1484f0c128..57311710c8 100644
--- a/config_src/infra/FMS2/MOM_data_override_infra.F90
+++ b/config_src/infra/FMS2/MOM_data_override_infra.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> These interfaces allow for ocean or sea-ice variables to be replaced with data.
module MOM_data_override_infra
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_domain_infra, only : MOM_domain_type, domain2d
use MOM_domain_infra, only : get_simple_array_i_ind, get_simple_array_j_ind
use MOM_time_manager, only : time_type
diff --git a/config_src/infra/FMS2/MOM_diag_manager_infra.F90 b/config_src/infra/FMS2/MOM_diag_manager_infra.F90
index 57f92c2046..2648900493 100644
--- a/config_src/infra/FMS2/MOM_diag_manager_infra.F90
+++ b/config_src/infra/FMS2/MOM_diag_manager_infra.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A wrapper for the FMS diag_manager routines. This module should be the
!! only MOM6 module which imports the FMS shared infrastructure for
!! diagnostics. Pass through interfaces are being documented
@@ -6,8 +10,6 @@
!! those APIs would be applied here).
module MOM_diag_manager_infra
-! This file is part of MOM6. See LICENSE.md for the license.
-
use, intrinsic :: iso_fortran_env, only : real64
use diag_axis_mod, only : fms_axis_init=>diag_axis_init
use diag_axis_mod, only : fms_get_diag_axis_name => get_diag_axis_name
diff --git a/config_src/infra/FMS2/MOM_domain_infra.F90 b/config_src/infra/FMS2/MOM_domain_infra.F90
index 91c62f7d08..4065628635 100644
--- a/config_src/infra/FMS2/MOM_domain_infra.F90
+++ b/config_src/infra/FMS2/MOM_domain_infra.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Describes the decomposed MOM domain and has routines for communications across PEs
module MOM_domain_infra
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms_infra, only : PE_here, root_PE, num_PEs
use MOM_cpu_clock_infra, only : cpu_clock_begin, cpu_clock_end
use MOM_error_infra, only : MOM_error=>MOM_err, NOTE, WARNING, FATAL
diff --git a/config_src/infra/FMS2/MOM_ensemble_manager_infra.F90 b/config_src/infra/FMS2/MOM_ensemble_manager_infra.F90
index f4028f7af7..8285eefd57 100644
--- a/config_src/infra/FMS2/MOM_ensemble_manager_infra.F90
+++ b/config_src/infra/FMS2/MOM_ensemble_manager_infra.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A simple (very thin) wrapper for managing ensemble member layout information
module MOM_ensemble_manager_infra
-! This file is part of MOM6. See LICENSE.md for the license.
-
use ensemble_manager_mod, only : FMS_ensemble_manager_init => ensemble_manager_init
use ensemble_manager_mod, only : FMS_ensemble_pelist_setup => ensemble_pelist_setup
use ensemble_manager_mod, only : FMS_get_ensemble_id => get_ensemble_id
diff --git a/config_src/infra/FMS2/MOM_error_infra.F90 b/config_src/infra/FMS2/MOM_error_infra.F90
index e5a8b8dc68..7db14bc127 100644
--- a/config_src/infra/FMS2/MOM_error_infra.F90
+++ b/config_src/infra/FMS2/MOM_error_infra.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Routines for error handling and I/O management
module MOM_error_infra
-! This file is part of MOM6. See LICENSE.md for the license.
-
use mpp_mod, only : mpp_error, mpp_pe, mpp_root_pe, mpp_stdlog=>stdlog, mpp_stdout=>stdout
use mpp_mod, only : NOTE, WARNING, FATAL
diff --git a/config_src/infra/FMS2/MOM_interp_infra.F90 b/config_src/infra/FMS2/MOM_interp_infra.F90
index 0b45b752ae..9b745ad001 100644
--- a/config_src/infra/FMS2/MOM_interp_infra.F90
+++ b/config_src/infra/FMS2/MOM_interp_infra.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module wraps the FMS temporal and spatial interpolation routines
module MOM_interp_infra
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_domain_infra, only : MOM_domain_type, domain2d
use MOM_io, only : axis_info
use MOM_io, only : get_var_axes_info
diff --git a/config_src/infra/FMS2/MOM_io_infra.F90 b/config_src/infra/FMS2/MOM_io_infra.F90
index a43b4e9344..3e69d110ff 100644
--- a/config_src/infra/FMS2/MOM_io_infra.F90
+++ b/config_src/infra/FMS2/MOM_io_infra.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module contains a thin inteface to mpp and fms I/O code
module MOM_io_infra
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_domain_infra, only : MOM_domain_type, rescale_comp_data, AGRID, BGRID_NE, CGRID_NE
use MOM_domain_infra, only : domain2d, domain1d, CENTER, CORNER, NORTH_FACE, EAST_FACE
use MOM_error_infra, only : MOM_error=>MOM_err, NOTE, FATAL, WARNING, is_root_PE
diff --git a/config_src/infra/FMS2/MOM_time_manager.F90 b/config_src/infra/FMS2/MOM_time_manager.F90
index 5f3279b713..7ec71cc37c 100644
--- a/config_src/infra/FMS2/MOM_time_manager.F90
+++ b/config_src/infra/FMS2/MOM_time_manager.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Wraps the FMS time manager functions
module MOM_time_manager
-! This file is part of MOM6. See LICENSE.md for the license.
-
use time_manager_mod, only : time_type, get_time, set_time
use time_manager_mod, only : time_type_to_real, real_to_time_type
use time_manager_mod, only : operator(+), operator(-), operator(*), operator(/)
diff --git a/config_src/memory/dynamic_nonsymmetric/MOM_memory.h b/config_src/memory/dynamic_nonsymmetric/MOM_memory.h
index c3385b8b9a..0d5f44d6be 100644
--- a/config_src/memory/dynamic_nonsymmetric/MOM_memory.h
+++ b/config_src/memory/dynamic_nonsymmetric/MOM_memory.h
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!/// \brief Compile-time memory settings
!/// \details This include file determines the compile-time memory settings.
!/// There are several variants of this file and only one should be in the search path for compilation.
diff --git a/config_src/memory/dynamic_symmetric/MOM_memory.h b/config_src/memory/dynamic_symmetric/MOM_memory.h
index 4188663a2c..e1557b6ac7 100644
--- a/config_src/memory/dynamic_symmetric/MOM_memory.h
+++ b/config_src/memory/dynamic_symmetric/MOM_memory.h
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!/// \brief Compile-time memory settings
!/// \details This include file determines the compile-time memory settings.
!/// There are several variants of this file and only one should be in the search path for compilation.
diff --git a/docs/postProcessEquations.py b/docs/postProcessEquations.py
index 396c41b507..59bceb15d0 100644
--- a/docs/postProcessEquations.py
+++ b/docs/postProcessEquations.py
@@ -1,3 +1,7 @@
+# This file is part of MOM6, the Modular Ocean Model version 6.
+# See the LICENSE file for licensing information.
+# SPDX-License-Identifier: Apache-2.0
+
import os, sys, pathlib, re
import itertools
from lxml import html
diff --git a/pkg/CVMix-src b/pkg/CVMix-src
index 65ef5c73bc..c38ddb7ebd 160000
--- a/pkg/CVMix-src
+++ b/pkg/CVMix-src
@@ -1 +1 @@
-Subproject commit 65ef5c73bc7f5663d5688f75c3855d431da4baea
+Subproject commit c38ddb7ebdd2d58c517b63a99bbdc8e348732db2
diff --git a/src/ALE/MOM_ALE.F90 b/src/ALE/MOM_ALE.F90
index ab9b7405ee..e319b71ddc 100644
--- a/src/ALE/MOM_ALE.F90
+++ b/src/ALE/MOM_ALE.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module contains the main regridding routines.
!!
!! Regridding comprises two steps:
@@ -8,8 +12,6 @@
!! Original module written by Laurent White, 2008.06.09
module MOM_ALE
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_debugging, only : check_column_integrals
use MOM_diag_mediator, only : register_diag_field, post_data, diag_ctrl
use MOM_diag_mediator, only : time_type, diag_update_remap_grids, query_averaging_enabled
diff --git a/src/ALE/MOM_hybgen_regrid.F90 b/src/ALE/MOM_hybgen_regrid.F90
index 396fa65ed2..d3a889ed99 100644
--- a/src/ALE/MOM_hybgen_regrid.F90
+++ b/src/ALE/MOM_hybgen_regrid.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module contains the hybgen regridding routines from HYCOM, with minor
!! modifications to follow the MOM6 coding conventions
module MOM_hybgen_regrid
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_EOS, only : EOS_type, calculate_density
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, WARNING, assert
use MOM_file_parser, only : get_param, param_file_type, log_param
diff --git a/src/ALE/MOM_hybgen_remap.F90 b/src/ALE/MOM_hybgen_remap.F90
index f97b0e9c62..68a193cebe 100644
--- a/src/ALE/MOM_hybgen_remap.F90
+++ b/src/ALE/MOM_hybgen_remap.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module contains the hybgen remapping routines from HYCOM, with minor
!! modifications to follow the MOM6 coding conventions
module MOM_hybgen_remap
-! This file is part of MOM6. See LICENSE.md for the license.
-
implicit none ; private
public hybgen_plm_coefs, hybgen_ppm_coefs, hybgen_weno_coefs
diff --git a/src/ALE/MOM_hybgen_unmix.F90 b/src/ALE/MOM_hybgen_unmix.F90
index bb6f64c4d7..1dfae7a167 100644
--- a/src/ALE/MOM_hybgen_unmix.F90
+++ b/src/ALE/MOM_hybgen_unmix.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module contains the hybgen unmixing routines from HYCOM, with
!! modifications to follow the MOM6 coding conventions and several bugs fixed
module MOM_hybgen_unmix
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_EOS, only : EOS_type, calculate_density, calculate_density_derivs
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, WARNING
use MOM_file_parser, only : get_param, param_file_type, log_param
diff --git a/src/ALE/MOM_regridding.F90 b/src/ALE/MOM_regridding.F90
index 9f36ae9d89..7e24d80a21 100644
--- a/src/ALE/MOM_regridding.F90
+++ b/src/ALE/MOM_regridding.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Generates vertical grids as part of the ALE algorithm
module MOM_regridding
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_error, FATAL, WARNING, NOTE, assert
use MOM_file_parser, only : param_file_type, get_param, log_param
use MOM_io, only : file_exists, field_exists, field_size, MOM_read_data
diff --git a/src/ALE/MOM_remapping.F90 b/src/ALE/MOM_remapping.F90
index c47ab73b77..acb483c64d 100644
--- a/src/ALE/MOM_remapping.F90
+++ b/src/ALE/MOM_remapping.F90
@@ -1,7 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides column-wise vertical remapping functions
module MOM_remapping
-! This file is part of MOM6. See LICENSE.md for the license.
! Original module written by Laurent White, 2008.06.09
use MOM_error_handler, only : MOM_error, FATAL
diff --git a/src/ALE/P1M_functions.F90 b/src/ALE/P1M_functions.F90
index d2051cc702..510ebde12c 100644
--- a/src/ALE/P1M_functions.F90
+++ b/src/ALE/P1M_functions.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Linear interpolation functions
module P1M_functions
-! This file is part of MOM6. See LICENSE.md for the license.
-
use regrid_edge_values, only : bound_edge_values, average_discontinuous_edge_values
implicit none ; private
diff --git a/src/ALE/P3M_functions.F90 b/src/ALE/P3M_functions.F90
index e9c234db32..e07cd9640f 100644
--- a/src/ALE/P3M_functions.F90
+++ b/src/ALE/P3M_functions.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Cubic interpolation functions
module P3M_functions
-! This file is part of MOM6. See LICENSE.md for the license.
-
use regrid_edge_values, only : bound_edge_values, average_discontinuous_edge_values
implicit none ; private
diff --git a/src/ALE/PCM_functions.F90 b/src/ALE/PCM_functions.F90
index f5899339e4..dff25e5fc6 100644
--- a/src/ALE/PCM_functions.F90
+++ b/src/ALE/PCM_functions.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Piecewise constant reconstruction functions
module PCM_functions
-! This file is part of MOM6. See LICENSE.md for the license.
-
implicit none ; private
public PCM_reconstruction
diff --git a/src/ALE/PLM_functions.F90 b/src/ALE/PLM_functions.F90
index 6d6afd3885..ab70541747 100644
--- a/src/ALE/PLM_functions.F90
+++ b/src/ALE/PLM_functions.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Piecewise linear reconstruction functions
module PLM_functions
-! This file is part of MOM6. See LICENSE.md for the license.
-
implicit none ; private
public PLM_boundary_extrapolation
diff --git a/src/ALE/PPM_functions.F90 b/src/ALE/PPM_functions.F90
index c11ec6e741..ad8fe2adb6 100644
--- a/src/ALE/PPM_functions.F90
+++ b/src/ALE/PPM_functions.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides functions used with the Piecewise-Parabolic-Method in the vertical ALE algorithm.
module PPM_functions
-! This file is part of MOM6. See LICENSE.md for the license.
-
! First version was created by Laurent White, June 2008.
! Substantially re-factored January 2016.
diff --git a/src/ALE/PQM_functions.F90 b/src/ALE/PQM_functions.F90
index 418a4b47a2..d0bd58a9fe 100644
--- a/src/ALE/PQM_functions.F90
+++ b/src/ALE/PQM_functions.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Piecewise quartic reconstruction functions
module PQM_functions
-! This file is part of MOM6. See LICENSE.md for the license.
-
use regrid_edge_values, only : bound_edge_values, check_discontinuous_edge_values
implicit none ; private
diff --git a/src/ALE/Recon1d_EMPLM_CWK.F90 b/src/ALE/Recon1d_EMPLM_CWK.F90
index 01d97058a9..bcd06c3f6f 100644
--- a/src/ALE/Recon1d_EMPLM_CWK.F90
+++ b/src/ALE/Recon1d_EMPLM_CWK.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Piecewise Linear Method 1D reconstruction in index space and boundary extrapolation
!!
!! This implementation of PLM follows Colella and Woodward, 1984 \cite colella1984, except for assuming
@@ -7,8 +11,6 @@
!! cell (i.e. extrapolates from the interior).
module Recon1d_EMPLM_CWK
-! This file is part of MOM6. See LICENSE.md for the license.
-
use Recon1d_type, only : testing
use Recon1d_MPLM_CWK, only : MPLM_CWK
diff --git a/src/ALE/Recon1d_EMPLM_WA.F90 b/src/ALE/Recon1d_EMPLM_WA.F90
index fc46cf74f6..b72203e0f0 100644
--- a/src/ALE/Recon1d_EMPLM_WA.F90
+++ b/src/ALE/Recon1d_EMPLM_WA.F90
@@ -1,11 +1,13 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Extrapolated-Monotonized Piecewise Linear Method 1D reconstruction
!!
!! This extends MPLM_WA, following White and Adcroft, 2008 \cite white2008, by extrapolating for the slopes of the
!! first and last cells. This extrapolation is used by White et al., 2009, during grid-generation.
module Recon1d_EMPLM_WA
-! This file is part of MOM6. See LICENSE.md for the license.
-
use Recon1d_MPLM_WA, only : MPLM_WA, testing
implicit none ; private
diff --git a/src/ALE/Recon1d_EMPLM_WA_poly.F90 b/src/ALE/Recon1d_EMPLM_WA_poly.F90
index bcfc398cf9..8aa06a883a 100644
--- a/src/ALE/Recon1d_EMPLM_WA_poly.F90
+++ b/src/ALE/Recon1d_EMPLM_WA_poly.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Extrapolated-Monotonized Piecewise Linear Method 1D reconstruction
!!
!! This extends MPLM_poly, following White and Adcroft, 2008 \cite white2008, by extraplating for the slopes of the
@@ -7,8 +11,6 @@
!! but was the form used in OM4.
module Recon1d_EMPLM_WA_poly
-! This file is part of MOM6. See LICENSE.md for the license.
-
use Recon1d_MPLM_WA_poly, only : MPLM_WA_poly, testing
implicit none ; private
diff --git a/src/ALE/Recon1d_EPPM_CWK.F90 b/src/ALE/Recon1d_EPPM_CWK.F90
index 2b9ed9853d..e39bf557e0 100644
--- a/src/ALE/Recon1d_EPPM_CWK.F90
+++ b/src/ALE/Recon1d_EPPM_CWK.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Piecewise Parabolic Method 1D reconstruction in model index space with linear
!! extrapolation for first and last cells
!!
@@ -6,8 +10,6 @@
!! representation with slope set by matching the edge of the first interior cell.
module Recon1d_EPPM_CWK
-! This file is part of MOM6. See LICENSE.md for the license.
-
use Recon1d_type, only : Recon1d, testing
use Recon1d_PPM_CWK, only : PPM_CWK
diff --git a/src/ALE/Recon1d_MPLM_CWK.F90 b/src/ALE/Recon1d_MPLM_CWK.F90
index dc401a8440..87d623cf53 100644
--- a/src/ALE/Recon1d_MPLM_CWK.F90
+++ b/src/ALE/Recon1d_MPLM_CWK.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Piecewise Linear Method 1D reconstruction in index space
!!
!! This implementation of PLM follows Colella and Woodward, 1984 \cite colella1984, except for assuming
@@ -6,8 +10,6 @@
!! The first and last cells are always limited to PCM.
module Recon1d_MPLM_CWK
-! This file is part of MOM6. See LICENSE.md for the license.
-
use Recon1d_type, only : testing
use Recon1d_PLM_CWK, only : PLM_CWK
diff --git a/src/ALE/Recon1d_MPLM_WA.F90 b/src/ALE/Recon1d_MPLM_WA.F90
index b9fa635063..29b54ccdeb 100644
--- a/src/ALE/Recon1d_MPLM_WA.F90
+++ b/src/ALE/Recon1d_MPLM_WA.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Monotonized Piecewise Linear Method 1D reconstruction
!!
!! This implementation of PLM follows White and Adcroft, 2008 \cite white2008.
@@ -9,8 +13,6 @@
!! are referred to.
module Recon1d_MPLM_WA
-! This file is part of MOM6. See LICENSE.md for the license.
-
use Recon1d_PLM_CW, only : PLM_CW, testing
implicit none ; private
diff --git a/src/ALE/Recon1d_MPLM_WA_poly.F90 b/src/ALE/Recon1d_MPLM_WA_poly.F90
index 4a4bdc95bb..333377f726 100644
--- a/src/ALE/Recon1d_MPLM_WA_poly.F90
+++ b/src/ALE/Recon1d_MPLM_WA_poly.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Monotonized Piecewise Linear Method 1D reconstruction using polynomial representation
!!
!! This implementation of PLM follows White and Adcroft, 2008 \cite white2008.
@@ -9,8 +13,6 @@
!! not preferred but was the form used in OM4.
module Recon1d_MPLM_WA_poly
-! This file is part of MOM6. See LICENSE.md for the license.
-
use Recon1d_MPLM_WA, only : MPLM_WA, testing
implicit none ; private
diff --git a/src/ALE/Recon1d_PCM.F90 b/src/ALE/Recon1d_PCM.F90
index 3b64844983..3225e25985 100644
--- a/src/ALE/Recon1d_PCM.F90
+++ b/src/ALE/Recon1d_PCM.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> 1D reconstructions using the Piecewise Constant Method (PCM)
module Recon1d_PCM
-! This file is part of MOM6. See LICENSE.md for the license.
-
use Recon1d_type, only : Recon1d, testing
implicit none ; private
diff --git a/src/ALE/Recon1d_PLM_CW.F90 b/src/ALE/Recon1d_PLM_CW.F90
index 0c53246286..0e966d2e48 100644
--- a/src/ALE/Recon1d_PLM_CW.F90
+++ b/src/ALE/Recon1d_PLM_CW.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Piecewise Linear Method 1D reconstruction
!!
!! This implementation of PLM follows Colella and Woodward, 1984 \cite colella1984, with cells
@@ -7,8 +11,6 @@
!! This does not yield monotonic profiles for the general remapping problem.
module Recon1d_PLM_CW
-! This file is part of MOM6. See LICENSE.md for the license.
-
use Recon1d_type, only : Recon1d, testing
implicit none ; private
diff --git a/src/ALE/Recon1d_PLM_CWK.F90 b/src/ALE/Recon1d_PLM_CWK.F90
index b30af80aa1..b5a6266f0e 100644
--- a/src/ALE/Recon1d_PLM_CWK.F90
+++ b/src/ALE/Recon1d_PLM_CWK.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Piecewise Linear Method 1D reconstruction
!!
!! This implementation of PLM follows Colella and Woodward, 1984, except for assuming
@@ -10,8 +14,6 @@
!! resulting calculations are properly bounded.
module Recon1d_PLM_CWK
-! This file is part of MOM6. See LICENSE.md for the license.
-
use Recon1d_type, only : testing
use Recon1d_PLM_CW, only : PLM_CW
diff --git a/src/ALE/Recon1d_PLM_hybgen.F90 b/src/ALE/Recon1d_PLM_hybgen.F90
index 0cf2e8e001..aa33ce7443 100644
--- a/src/ALE/Recon1d_PLM_hybgen.F90
+++ b/src/ALE/Recon1d_PLM_hybgen.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Piecewise Linear Method 1D reconstruction ported from "hybgen" module in Hycom.
!!
!! This implementation of PLM follows Colella and Woodward, 1984, with cells resorting to PCM for
@@ -11,8 +15,6 @@
!! equiavalent to the recon1d_plm_hybgen module (this implementation).
module Recon1d_PLM_hybgen
-! This file is part of MOM6. See LICENSE.md for the license.
-
use Recon1d_type, only : Recon1d, testing
implicit none ; private
diff --git a/src/ALE/Recon1d_PPM_CW.F90 b/src/ALE/Recon1d_PPM_CW.F90
index 9523ad46ea..27be489b7f 100644
--- a/src/ALE/Recon1d_PPM_CW.F90
+++ b/src/ALE/Recon1d_PPM_CW.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Piecewise Parabolic Method 1D reconstruction following Colella and Woodward, 1984
!!
!! This is a near faithful implementation of PPM following Colella and Woodward, 1984, with
@@ -9,8 +13,6 @@
!! set to PCM. The reconstructions are grid-spacing dependent, and so quasi-forth order in h.
module Recon1d_PPM_CW
-! This file is part of MOM6. See LICENSE.md for the license.
-
use Recon1d_type, only : Recon1d, testing
use Recon1d_PLM_CW, only : PLM_CW
diff --git a/src/ALE/Recon1d_PPM_CWK.F90 b/src/ALE/Recon1d_PPM_CWK.F90
index a0cbce5877..07256b4372 100644
--- a/src/ALE/Recon1d_PPM_CWK.F90
+++ b/src/ALE/Recon1d_PPM_CWK.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Piecewise Parabolic Method 1D reconstruction in model index space
!!
!! This implementation of PPM follows Colella and Woodward, 1984, using uniform thickness
@@ -10,8 +14,6 @@
!! when the grid spacing is variable.
module Recon1d_PPM_CWK
-! This file is part of MOM6. See LICENSE.md for the license.
-
use Recon1d_type, only : Recon1d, testing
use Recon1d_PLM_CWK, only : PLM_CWK
diff --git a/src/ALE/Recon1d_PPM_H4_2018.F90 b/src/ALE/Recon1d_PPM_H4_2018.F90
index d668b70ace..401c95e504 100644
--- a/src/ALE/Recon1d_PPM_H4_2018.F90
+++ b/src/ALE/Recon1d_PPM_H4_2018.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Piecewise Parabolic Method 1D reconstruction with h4 interpolation for edges (2018 version)
!!
!! This implementation of PPM follows White and Adcroft 2008 \cite white2008, with cells
@@ -8,8 +12,6 @@
!! The first and last cells are always limited to PCM.
module Recon1d_PPM_H4_2018
-! This file is part of MOM6. See LICENSE.md for the license.
-
use Recon1d_PPM_H4_2019, only : PPM_H4_2019, testing
use regrid_edge_values, only : bound_edge_values, check_discontinuous_edge_values
use regrid_solvers, only : solve_linear_system
diff --git a/src/ALE/Recon1d_PPM_H4_2019.F90 b/src/ALE/Recon1d_PPM_H4_2019.F90
index d01ff3fb2b..26985be644 100644
--- a/src/ALE/Recon1d_PPM_H4_2019.F90
+++ b/src/ALE/Recon1d_PPM_H4_2019.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Piecewise Parabolic Method 1D reconstruction with h4 interpolation for edges
!!
!! This implementation of PPM follows White and Adcroft 2008 \cite white2008, with cells
@@ -8,8 +12,6 @@
!! The first and last cells are always limited to PCM.
module Recon1d_PPM_H4_2019
-! This file is part of MOM6. See LICENSE.md for the license.
-
use Recon1d_type, only : Recon1d, testing
implicit none ; private
diff --git a/src/ALE/Recon1d_PPM_hybgen.F90 b/src/ALE/Recon1d_PPM_hybgen.F90
index 2978dd9269..72fc374be4 100644
--- a/src/ALE/Recon1d_PPM_hybgen.F90
+++ b/src/ALE/Recon1d_PPM_hybgen.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Piecewise Parabolic Method 1D reconstruction following Colella and Woodward, 1984
!!
!! This implementation of PPM follows Colella and Woodward, 1984 \cite colella1984, with
@@ -10,8 +14,6 @@
!! (reached with "PPM_CW"), are equivalent. Similarly recon1d_ppm_hybgen (this implementation) is equivalent also.
module Recon1d_PPM_hybgen
-! This file is part of MOM6. See LICENSE.md for the license.
-
use Recon1d_type, only : testing
use Recon1d_PPM_CW, only : PPM_CW
diff --git a/src/ALE/Recon1d_type.F90 b/src/ALE/Recon1d_type.F90
index 4411e1288e..a98eb80434 100644
--- a/src/ALE/Recon1d_type.F90
+++ b/src/ALE/Recon1d_type.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A generic type for vertical 1D reconstructions
module Recon1d_type
-! This file is part of MOM6. See LICENSE.md for the license.
-
use numerical_testing_type, only : testing
implicit none ; private
diff --git a/src/ALE/coord_adapt.F90 b/src/ALE/coord_adapt.F90
index 0e28ae0395..3b6a068f66 100644
--- a/src/ALE/coord_adapt.F90
+++ b/src/ALE/coord_adapt.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Regrid columns for the adaptive coordinate
module coord_adapt
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_EOS, only : calculate_density_derivs
use MOM_error_handler, only : MOM_error, FATAL
use MOM_unit_scaling, only : unit_scale_type
diff --git a/src/ALE/coord_hycom.F90 b/src/ALE/coord_hycom.F90
index f5062d6f68..2036e61c1e 100644
--- a/src/ALE/coord_hycom.F90
+++ b/src/ALE/coord_hycom.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Regrid columns for the HyCOM coordinate
module coord_hycom
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_error, is_root_pe, FATAL, NOTE
use MOM_variables, only : ocean_grid_type, thermo_var_ptrs
use MOM_EOS, only : EOS_type, calculate_density
diff --git a/src/ALE/coord_rho.F90 b/src/ALE/coord_rho.F90
index c967687dc8..904517ef15 100644
--- a/src/ALE/coord_rho.F90
+++ b/src/ALE/coord_rho.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Regrid columns for the continuous isopycnal (rho) coordinate
module coord_rho
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_error, FATAL
use MOM_remapping, only : remapping_CS, remapping_core_h
use MOM_EOS, only : EOS_type, calculate_density
diff --git a/src/ALE/coord_sigma.F90 b/src/ALE/coord_sigma.F90
index a2a5820487..60e05654d9 100644
--- a/src/ALE/coord_sigma.F90
+++ b/src/ALE/coord_sigma.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Regrid columns for the sigma coordinate
module coord_sigma
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_error, FATAL
implicit none ; private
diff --git a/src/ALE/coord_zlike.F90 b/src/ALE/coord_zlike.F90
index 7f284217b2..ad7772d7ae 100644
--- a/src/ALE/coord_zlike.F90
+++ b/src/ALE/coord_zlike.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Regrid columns for a z-like coordinate (z-star, z-level)
module coord_zlike
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_error, FATAL
implicit none ; private
diff --git a/src/ALE/polynomial_functions.F90 b/src/ALE/polynomial_functions.F90
index b01e097b83..0b232dc359 100644
--- a/src/ALE/polynomial_functions.F90
+++ b/src/ALE/polynomial_functions.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Polynomial functions
module polynomial_functions
-! This file is part of MOM6. See LICENSE.md for the license.
-
implicit none ; private
public :: evaluation_polynomial, integration_polynomial, first_derivative_polynomial
diff --git a/src/ALE/regrid_consts.F90 b/src/ALE/regrid_consts.F90
index 0c5ccf268f..b3ca485f0a 100644
--- a/src/ALE/regrid_consts.F90
+++ b/src/ALE/regrid_consts.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Contains constants for interpreting input parameters that control regridding.
module regrid_consts
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_error, FATAL
use MOM_string_functions, only : uppercase
diff --git a/src/ALE/regrid_edge_values.F90 b/src/ALE/regrid_edge_values.F90
index 54cec45cba..f9a0bacd25 100644
--- a/src/ALE/regrid_edge_values.F90
+++ b/src/ALE/regrid_edge_values.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Edge value estimation for high-order reconstruction
module regrid_edge_values
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_error, FATAL
use regrid_solvers, only : solve_linear_system, linear_solver
use regrid_solvers, only : solve_tridiagonal_system, solve_diag_dominant_tridiag
diff --git a/src/ALE/regrid_interp.F90 b/src/ALE/regrid_interp.F90
index 6e0be9ebba..84b94684ea 100644
--- a/src/ALE/regrid_interp.F90
+++ b/src/ALE/regrid_interp.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Vertical interpolation for regridding
module regrid_interp
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_error, FATAL
use MOM_string_functions, only : uppercase
diff --git a/src/ALE/regrid_solvers.F90 b/src/ALE/regrid_solvers.F90
index 6e5b3a0cb0..2ac2230ec4 100644
--- a/src/ALE/regrid_solvers.F90
+++ b/src/ALE/regrid_solvers.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Solvers of linear systems.
module regrid_solvers
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_error, FATAL
implicit none ; private
diff --git a/src/core/MOM.F90 b/src/core/MOM.F90
index 71832ba76c..4b55700217 100644
--- a/src/core/MOM.F90
+++ b/src/core/MOM.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> The central module of the MOM6 ocean model
module MOM
-! This file is part of MOM6. See LICENSE.md for the license.
-
! Infrastructure modules
use MOM_array_transform, only : rotate_array, rotate_vector
use MOM_debugging, only : MOM_debugging_init, hchksum, uvchksum, totalTandS
diff --git a/src/core/MOM_CoriolisAdv.F90 b/src/core/MOM_CoriolisAdv.F90
index 5495164782..af85ae3889 100644
--- a/src/core/MOM_CoriolisAdv.F90
+++ b/src/core/MOM_CoriolisAdv.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Accelerations due to the Coriolis force and momentum advection
module MOM_CoriolisAdv
-! This file is part of MOM6. See LICENSE.md for the license.
-
!> \author Robert Hallberg, April 1994 - June 2002
use MOM_diag_mediator, only : post_data, query_averaging_enabled, diag_ctrl
diff --git a/src/core/MOM_PressureForce.F90 b/src/core/MOM_PressureForce.F90
index 191ee439c9..133de90434 100644
--- a/src/core/MOM_PressureForce.F90
+++ b/src/core/MOM_PressureForce.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A thin wrapper for Boussinesq/non-Boussinesq forms of the pressure force calculation.
module MOM_PressureForce
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_diag_mediator, only : diag_ctrl, time_type
use MOM_error_handler, only : MOM_error, MOM_mesg, FATAL, WARNING, is_root_pe
use MOM_file_parser, only : get_param, log_version, param_file_type
diff --git a/src/core/MOM_PressureForce_FV.F90 b/src/core/MOM_PressureForce_FV.F90
index b727c30595..c118d17f21 100644
--- a/src/core/MOM_PressureForce_FV.F90
+++ b/src/core/MOM_PressureForce_FV.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Finite volume pressure gradient (integrated by quadrature or analytically)
module MOM_PressureForce_FV
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_debugging, only : hchksum, uvchksum
use MOM_diag_mediator, only : post_data, register_diag_field
use MOM_diag_mediator, only : safe_alloc_ptr, diag_ctrl, time_type
diff --git a/src/core/MOM_PressureForce_Montgomery.F90 b/src/core/MOM_PressureForce_Montgomery.F90
index 1529af9d83..19aa7b2aaa 100644
--- a/src/core/MOM_PressureForce_Montgomery.F90
+++ b/src/core/MOM_PressureForce_Montgomery.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides the Montgomery potential form of pressure gradient
module MOM_PressureForce_Mont
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_density_integrals, only : int_specific_vol_dp
use MOM_diag_mediator, only : post_data, register_diag_field
use MOM_diag_mediator, only : safe_alloc_ptr, diag_ctrl, time_type
diff --git a/src/core/MOM_barotropic.F90 b/src/core/MOM_barotropic.F90
index ac2e668f8e..3cc0dd560b 100644
--- a/src/core/MOM_barotropic.F90
+++ b/src/core/MOM_barotropic.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Barotropic solver
module MOM_barotropic
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_checksums, only : chksum0
use MOM_coms, only : any_across_PEs
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end, CLOCK_ROUTINE
diff --git a/src/core/MOM_boundary_update.F90 b/src/core/MOM_boundary_update.F90
index 8d8c4e1f5f..9caf549de7 100644
--- a/src/core/MOM_boundary_update.F90
+++ b/src/core/MOM_boundary_update.F90
@@ -1,9 +1,10 @@
-! This file is part of MOM6. See LICENSE.md for the license.
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Controls where open boundary conditions are applied
module MOM_boundary_update
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end, CLOCK_ROUTINE
use MOM_diag_mediator, only : time_type
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, WARNING
diff --git a/src/core/MOM_check_scaling.F90 b/src/core/MOM_check_scaling.F90
index 2841514924..d04a6b3934 100644
--- a/src/core/MOM_check_scaling.F90
+++ b/src/core/MOM_check_scaling.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module is used to check the dimensional scaling factors used by the MOM6 ocean model
module MOM_check_scaling
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_error, MOM_mesg, FATAL, WARNING, assert, MOM_get_verbosity
use MOM_unique_scales, only : check_scaling_uniqueness, scales_to_powers
use MOM_unit_scaling, only : unit_scale_type
diff --git a/src/core/MOM_checksum_packages.F90 b/src/core/MOM_checksum_packages.F90
index c226f5309d..ecb8f7edb3 100644
--- a/src/core/MOM_checksum_packages.F90
+++ b/src/core/MOM_checksum_packages.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides routines that do checksums of groups of MOM variables
module MOM_checksum_packages
-! This file is part of MOM6. See LICENSE.md for the license.
-
! This module provides several routines that do check-sums of groups
! of variables in the various dynamic solver routines.
diff --git a/src/core/MOM_continuity.F90 b/src/core/MOM_continuity.F90
index 14582d1eb5..27d69fc3d8 100644
--- a/src/core/MOM_continuity.F90
+++ b/src/core/MOM_continuity.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Solve the layer continuity equation.
module MOM_continuity
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_continuity_PPM, only : continuity=>continuity_PPM
use MOM_continuity_PPM, only : continuity_stencil=>continuity_PPM_stencil
use MOM_continuity_PPM, only : continuity_init=>continuity_PPM_init
diff --git a/src/core/MOM_continuity_PPM.F90 b/src/core/MOM_continuity_PPM.F90
index d5e380391c..bbfe1cc75d 100644
--- a/src/core/MOM_continuity_PPM.F90
+++ b/src/core/MOM_continuity_PPM.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Solve the layer continuity equation using the PPM method for layer fluxes.
module MOM_continuity_PPM
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end, CLOCK_ROUTINE
use MOM_diag_mediator, only : time_type, diag_ctrl
use MOM_error_handler, only : MOM_error, FATAL, WARNING, is_root_pe
diff --git a/src/core/MOM_density_integrals.F90 b/src/core/MOM_density_integrals.F90
index 2638718594..19cad281e8 100644
--- a/src/core/MOM_density_integrals.F90
+++ b/src/core/MOM_density_integrals.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides integrals of density
module MOM_density_integrals
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_EOS, only : EOS_type
use MOM_EOS, only : EOS_quadrature, EOS_domain
use MOM_EOS, only : analytic_int_density_dz
diff --git a/src/core/MOM_dynamics_split_RK2.F90 b/src/core/MOM_dynamics_split_RK2.F90
index 2f345ff9e9..8588a0c41e 100644
--- a/src/core/MOM_dynamics_split_RK2.F90
+++ b/src/core/MOM_dynamics_split_RK2.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Time step the adiabatic dynamic core of MOM using RK2 method.
module MOM_dynamics_split_RK2
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_variables, only : vertvisc_type, thermo_var_ptrs, porous_barrier_type
use MOM_variables, only : BT_cont_type, alloc_bt_cont_type, dealloc_bt_cont_type
use MOM_variables, only : accel_diag_ptrs, ocean_internal_state, cont_diag_ptrs
diff --git a/src/core/MOM_dynamics_split_RK2b.F90 b/src/core/MOM_dynamics_split_RK2b.F90
index 9835c0c02e..dcdfd9b834 100644
--- a/src/core/MOM_dynamics_split_RK2b.F90
+++ b/src/core/MOM_dynamics_split_RK2b.F90
@@ -1,10 +1,12 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Time step the adiabatic dynamic core of MOM using RK2 method with greater use of the
!! time-filtered velocities and less inheritance of tedencies from the previous step in the
!! predictor step than in the original MOM_dyanmics_split_RK2.
module MOM_dynamics_split_RK2b
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_variables, only : vertvisc_type, thermo_var_ptrs, porous_barrier_type
use MOM_variables, only : BT_cont_type, alloc_bt_cont_type, dealloc_bt_cont_type
use MOM_variables, only : accel_diag_ptrs, ocean_internal_state, cont_diag_ptrs
diff --git a/src/core/MOM_dynamics_unsplit.F90 b/src/core/MOM_dynamics_unsplit.F90
index 71ffac8fec..c560ba07a8 100644
--- a/src/core/MOM_dynamics_unsplit.F90
+++ b/src/core/MOM_dynamics_unsplit.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Time steps the ocean dynamics with an unsplit quasi 3rd order scheme
module MOM_dynamics_unsplit
-! This file is part of MOM6. See LICENSE.md for the license.
-
!********+*********+*********+*********+*********+*********+*********+**
!* *
!* By Robert Hallberg, 1993-2012 *
diff --git a/src/core/MOM_dynamics_unsplit_RK2.F90 b/src/core/MOM_dynamics_unsplit_RK2.F90
index 66c58439b3..0f2274c445 100644
--- a/src/core/MOM_dynamics_unsplit_RK2.F90
+++ b/src/core/MOM_dynamics_unsplit_RK2.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Time steps the ocean dynamics with an unsplit quasi 2nd order Runge-Kutta scheme
module MOM_dynamics_unsplit_RK2
-! This file is part of MOM6. See LICENSE.md for the license.
-
!********+*********+*********+*********+*********+*********+*********+**
!* *
!* By Alistair Adcroft and Robert Hallberg, 2010-2012 *
diff --git a/src/core/MOM_forcing_type.F90 b/src/core/MOM_forcing_type.F90
index f51ec928b6..8ebf5f7180 100644
--- a/src/core/MOM_forcing_type.F90
+++ b/src/core/MOM_forcing_type.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module implements boundary forcing for MOM6.
module MOM_forcing_type
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_array_transform, only : rotate_array, rotate_vector, rotate_array_pair
use MOM_coupler_types, only : coupler_2d_bc_type, coupler_type_destructor
use MOM_coupler_types, only : coupler_type_increment_data, coupler_type_initialized
diff --git a/src/core/MOM_grid.F90 b/src/core/MOM_grid.F90
index 94583673c2..eb6e0eeeee 100644
--- a/src/core/MOM_grid.F90
+++ b/src/core/MOM_grid.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides the ocean grid type
module MOM_grid
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_hor_index, only : hor_index_type, hor_index_init
use MOM_domains, only : MOM_domain_type, get_domain_extent, compute_block_extent
use MOM_domains, only : get_global_shape, deallocate_MOM_domain
diff --git a/src/core/MOM_interface_heights.F90 b/src/core/MOM_interface_heights.F90
index c9e4bc015e..6da95df2c9 100644
--- a/src/core/MOM_interface_heights.F90
+++ b/src/core/MOM_interface_heights.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Functions for calculating interface heights, including free surface height.
module MOM_interface_heights
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_density_integrals, only : int_specific_vol_dp, avg_specific_vol, int_density_dz
use MOM_debugging, only : hchksum
use MOM_error_handler, only : MOM_error, FATAL
diff --git a/src/core/MOM_isopycnal_slopes.F90 b/src/core/MOM_isopycnal_slopes.F90
index 372ed8701d..1dd1d92bf2 100644
--- a/src/core/MOM_isopycnal_slopes.F90
+++ b/src/core/MOM_isopycnal_slopes.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Calculations of isoneutral slopes and stratification.
module MOM_isopycnal_slopes
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_debugging, only : hchksum, uvchksum
use MOM_error_handler, only : MOM_error, FATAL
use MOM_grid, only : ocean_grid_type
diff --git a/src/core/MOM_open_boundary.F90 b/src/core/MOM_open_boundary.F90
index 2ebbce6475..aa309fd56a 100644
--- a/src/core/MOM_open_boundary.F90
+++ b/src/core/MOM_open_boundary.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Controls where open boundary conditions are applied
module MOM_open_boundary
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_array_transform, only : rotate_array, rotate_array_pair
use MOM_coms, only : sum_across_PEs, Set_PElist, Get_PElist, PE_here, num_PEs
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end, CLOCK_ROUTINE
diff --git a/src/core/MOM_porous_barriers.F90 b/src/core/MOM_porous_barriers.F90
index e24d4954cb..53f8ea406b 100644
--- a/src/core/MOM_porous_barriers.F90
+++ b/src/core/MOM_porous_barriers.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Module for calculating curve fit for porous topography.
!written by sjd
module MOM_porous_barriers
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end, CLOCK_MODULE
use MOM_error_handler, only : MOM_error, FATAL
use MOM_grid, only : ocean_grid_type
diff --git a/src/core/MOM_stoch_eos.F90 b/src/core/MOM_stoch_eos.F90
index 909c2e9a6a..f10a06fb51 100644
--- a/src/core/MOM_stoch_eos.F90
+++ b/src/core/MOM_stoch_eos.F90
@@ -1,7 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides the ocean stochastic equation of state
module MOM_stoch_eos
-! This file is part of MOM6. See LICENSE.md for the license.
use MOM_diag_mediator, only : register_diag_field, post_data, diag_ctrl
use MOM_error_handler, only : MOM_error, FATAL
use MOM_file_parser, only : get_param, param_file_type
diff --git a/src/core/MOM_transcribe_grid.F90 b/src/core/MOM_transcribe_grid.F90
index d9ca19985f..f227cfc5a5 100644
--- a/src/core/MOM_transcribe_grid.F90
+++ b/src/core/MOM_transcribe_grid.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Module with routines for copying information from a shared dynamic horizontal
!! grid to an ocean-specific horizontal grid and the reverse.
module MOM_transcribe_grid
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_array_transform, only : rotate_array, rotate_array_pair
use MOM_domains, only : pass_var, pass_vector
use MOM_domains, only : To_All, SCALAR_PAIR, CGRID_NE, AGRID, BGRID_NE, CORNER
diff --git a/src/core/MOM_unit_tests.F90 b/src/core/MOM_unit_tests.F90
index bd449d0b39..e47242711a 100644
--- a/src/core/MOM_unit_tests.F90
+++ b/src/core/MOM_unit_tests.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Invokes unit tests in all modules that have them
module MOM_unit_tests
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_error, FATAL, is_root_pe
use MOM_hor_bnd_diffusion, only : near_boundary_unit_tests
use MOM_intrinsic_functions, only : intrinsic_functions_unit_tests
diff --git a/src/core/MOM_variables.F90 b/src/core/MOM_variables.F90
index c6483f8cef..875cbb4693 100644
--- a/src/core/MOM_variables.F90
+++ b/src/core/MOM_variables.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides transparent structures with groups of MOM6 variables and supporting routines
module MOM_variables
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_array_transform, only : rotate_array, rotate_vector
use MOM_coupler_types, only : coupler_1d_bc_type, coupler_2d_bc_type
use MOM_coupler_types, only : coupler_type_spawn, coupler_type_destructor, coupler_type_initialized
diff --git a/src/core/MOM_verticalGrid.F90 b/src/core/MOM_verticalGrid.F90
index 4713fb6797..a4b3dbbffb 100644
--- a/src/core/MOM_verticalGrid.F90
+++ b/src/core/MOM_verticalGrid.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides a transparent vertical ocean grid type and supporting routines
module MOM_verticalGrid
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_error, MOM_mesg, FATAL
use MOM_file_parser, only : get_param, log_param, log_version, param_file_type
use MOM_unit_scaling, only : unit_scale_type
diff --git a/src/diagnostics/MOM_PointAccel.F90 b/src/diagnostics/MOM_PointAccel.F90
index 9b09e3d6af..b1db788b90 100644
--- a/src/diagnostics/MOM_PointAccel.F90
+++ b/src/diagnostics/MOM_PointAccel.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Debug accelerations at a given point
!!
!! The two subroutines in this file write out all of the terms
@@ -7,8 +11,6 @@
!! often this is done for debugging purposes.
module MOM_PointAccel
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_diag_mediator, only : diag_ctrl
use MOM_domains, only : pe_here
use MOM_error_handler, only : MOM_error, NOTE
diff --git a/src/diagnostics/MOM_debugging.F90 b/src/diagnostics/MOM_debugging.F90
index 5e3ee191d5..a8ded110f0 100644
--- a/src/diagnostics/MOM_debugging.F90
+++ b/src/diagnostics/MOM_debugging.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides checksumming functions for debugging
!!
!! This module contains subroutines that perform various error checking and
@@ -6,8 +10,6 @@
!! separate we retain the ability to set up MOM6 and SIS2 debugging separately.
module MOM_debugging
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_checksums, only : hchksum, Bchksum, qchksum, uvchksum, hchksum_pair
use MOM_checksums, only : is_NaN, chksum, MOM_checksums_init
use MOM_coms, only : PE_here, root_PE, num_PEs
diff --git a/src/diagnostics/MOM_diagnose_KdWork.F90 b/src/diagnostics/MOM_diagnose_KdWork.F90
index 8b89933169..999002b5d1 100644
--- a/src/diagnostics/MOM_diagnose_KdWork.F90
+++ b/src/diagnostics/MOM_diagnose_KdWork.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides diagnostics of work due to a given diffusivity
module MOM_diagnose_kdwork
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_diag_mediator, only : diag_ctrl, time_type, post_data, register_diag_field
use MOM_diag_mediator, only : register_scalar_field
use MOM_error_handler, only : MOM_error, FATAL, WARNING
diff --git a/src/diagnostics/MOM_diagnose_MLD.F90 b/src/diagnostics/MOM_diagnose_MLD.F90
index bd1bcc8ab8..b2b231cb37 100644
--- a/src/diagnostics/MOM_diagnose_MLD.F90
+++ b/src/diagnostics/MOM_diagnose_MLD.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides functions for some diabatic processes such as fraxil, brine rejection,
!! tendency due to surface flux divergence.
module MOM_diagnose_mld
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_diag_mediator, only : post_data
use MOM_diag_mediator, only : diag_ctrl
use MOM_EOS, only : calculate_density, calculate_TFreeze, EOS_domain
diff --git a/src/diagnostics/MOM_diagnostics.F90 b/src/diagnostics/MOM_diagnostics.F90
index 6c220c79cf..8bb85762bb 100644
--- a/src/diagnostics/MOM_diagnostics.F90
+++ b/src/diagnostics/MOM_diagnostics.F90
@@ -1,10 +1,12 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Calculates any requested diagnostic quantities
!! that are not calculated in the various subroutines.
!! Diagnostic quantities are requested by allocating them memory.
module MOM_diagnostics
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms, only : reproducing_sum
use MOM_coupler_types, only : coupler_type_send_data
use MOM_density_integrals, only : int_density_dz
diff --git a/src/diagnostics/MOM_harmonic_analysis.F90 b/src/diagnostics/MOM_harmonic_analysis.F90
index 9a15867631..1ff0b4bacc 100644
--- a/src/diagnostics/MOM_harmonic_analysis.F90
+++ b/src/diagnostics/MOM_harmonic_analysis.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Inline harmonic analysis (conventional)
module MOM_harmonic_analysis
diff --git a/src/diagnostics/MOM_obsolete_diagnostics.F90 b/src/diagnostics/MOM_obsolete_diagnostics.F90
index ddfe0452a0..642f10f74e 100644
--- a/src/diagnostics/MOM_obsolete_diagnostics.F90
+++ b/src/diagnostics/MOM_obsolete_diagnostics.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides a mechanism for recording diagnostic variables that are no longer
!! valid, along with their replacement name if appropriate.
module MOM_obsolete_diagnostics
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_diag_mediator, only : diag_ctrl, found_in_diagtable
use MOM_error_handler, only : MOM_error, FATAL, WARNING, is_root_pe
use MOM_file_parser, only : param_file_type, log_version, get_param
diff --git a/src/diagnostics/MOM_obsolete_params.F90 b/src/diagnostics/MOM_obsolete_params.F90
index bfb621c95c..012fcff931 100644
--- a/src/diagnostics/MOM_obsolete_params.F90
+++ b/src/diagnostics/MOM_obsolete_params.F90
@@ -1,7 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Methods for testing for, and list of, obsolete run-time parameters.
module MOM_obsolete_params
-! This file is part of MOM6. See LICENSE.md for the license.
! This module was first conceived and written by Robert Hallberg, July 2010.
use MOM_error_handler, only : MOM_error, FATAL, WARNING, is_root_pe
diff --git a/src/diagnostics/MOM_spatial_means.F90 b/src/diagnostics/MOM_spatial_means.F90
index bc0b05b477..1d63334a23 100644
--- a/src/diagnostics/MOM_spatial_means.F90
+++ b/src/diagnostics/MOM_spatial_means.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Functions and routines to take area, volume, mass-weighted, layerwise, zonal or meridional means
module MOM_spatial_means
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms, only : EFP_type, operator(+), operator(-), assignment(=)
use MOM_coms, only : EFP_to_real, real_to_EFP, EFP_sum_across_PEs
use MOM_coms, only : reproducing_sum, reproducing_sum_EFP, EFP_to_real
diff --git a/src/diagnostics/MOM_sum_output.F90 b/src/diagnostics/MOM_sum_output.F90
index a9a4daecc3..fba33fe0ee 100644
--- a/src/diagnostics/MOM_sum_output.F90
+++ b/src/diagnostics/MOM_sum_output.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Reports integrated quantities for monitoring the model state
module MOM_sum_output
-! This file is part of MOM6. See LICENSE.md for the license.
-
use iso_fortran_env, only : int64
use MOM_checksums, only : is_NaN, field_checksum
use MOM_coms, only : sum_across_PEs, PE_here, root_PE, num_PEs, max_across_PEs
diff --git a/src/diagnostics/MOM_wave_speed.F90 b/src/diagnostics/MOM_wave_speed.F90
index 7abdab0a90..f6a884004f 100644
--- a/src/diagnostics/MOM_wave_speed.F90
+++ b/src/diagnostics/MOM_wave_speed.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Routines for calculating baroclinic wave speeds
module MOM_wave_speed
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_diag_mediator, only : post_data, query_averaging_enabled, diag_ctrl
use MOM_error_handler, only : MOM_error, FATAL, WARNING
use MOM_file_parser, only : log_version
diff --git a/src/equation_of_state/MOM_EOS.F90 b/src/equation_of_state/MOM_EOS.F90
index ee49bd282d..e716d9221f 100644
--- a/src/equation_of_state/MOM_EOS.F90
+++ b/src/equation_of_state/MOM_EOS.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides subroutines for quantities specific to the equation of state
module MOM_EOS
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_EOS_base_type, only : EOS_base
use MOM_EOS_linear, only : linear_EOS, avg_spec_vol_linear
use MOM_EOS_linear, only : int_density_dz_linear, int_spec_vol_dp_linear
diff --git a/src/equation_of_state/MOM_EOS_Jackett06.F90 b/src/equation_of_state/MOM_EOS_Jackett06.F90
index 1ef7456e96..4c0705f717 100644
--- a/src/equation_of_state/MOM_EOS_Jackett06.F90
+++ b/src/equation_of_state/MOM_EOS_Jackett06.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> The equation of state using the Jackett et al 2006 expressions that are often used in Hycom
module MOM_EOS_Jackett06
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_EOS_base_type, only : EOS_base
implicit none ; private
diff --git a/src/equation_of_state/MOM_EOS_Roquet_SpV.F90 b/src/equation_of_state/MOM_EOS_Roquet_SpV.F90
index 205b6e2b55..852f62fb73 100644
--- a/src/equation_of_state/MOM_EOS_Roquet_SpV.F90
+++ b/src/equation_of_state/MOM_EOS_Roquet_SpV.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> The equation of state for specific volume (SpV) using the expressions of Roquet et al. 2015
module MOM_EOS_Roquet_Spv
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_EOS_base_type, only : EOS_base
implicit none ; private
diff --git a/src/equation_of_state/MOM_EOS_Roquet_rho.F90 b/src/equation_of_state/MOM_EOS_Roquet_rho.F90
index 1a5cc7b49c..1e80c63c5a 100644
--- a/src/equation_of_state/MOM_EOS_Roquet_rho.F90
+++ b/src/equation_of_state/MOM_EOS_Roquet_rho.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> The equation of state using the expressions of Roquet et al. (2015) that are used in NEMO
module MOM_EOS_Roquet_rho
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_EOS_base_type, only : EOS_base
implicit none ; private
diff --git a/src/equation_of_state/MOM_EOS_TEOS10.F90 b/src/equation_of_state/MOM_EOS_TEOS10.F90
index b65e887694..9f63dd9b3b 100644
--- a/src/equation_of_state/MOM_EOS_TEOS10.F90
+++ b/src/equation_of_state/MOM_EOS_TEOS10.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> The equation of state using the TEOS10 expressions
module MOM_EOS_TEOS10
-! This file is part of MOM6. See LICENSE.md for the license.
-
use gsw_mod_toolbox, only : gsw_sp_from_sr, gsw_pt_from_ct, gsw_sr_from_sp, gsw_ct_from_pt
use gsw_mod_toolbox, only : gsw_rho, gsw_specvol
use gsw_mod_toolbox, only : gsw_rho_first_derivatives, gsw_specvol_first_derivatives
diff --git a/src/equation_of_state/MOM_EOS_UNESCO.F90 b/src/equation_of_state/MOM_EOS_UNESCO.F90
index 6051c0fb0a..93ac54d0ac 100644
--- a/src/equation_of_state/MOM_EOS_UNESCO.F90
+++ b/src/equation_of_state/MOM_EOS_UNESCO.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> The equation of state using the Jackett and McDougall fits to the UNESCO EOS
module MOM_EOS_UNESCO
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_EOS_base_type, only : EOS_base
implicit none ; private
diff --git a/src/equation_of_state/MOM_EOS_Wright.F90 b/src/equation_of_state/MOM_EOS_Wright.F90
index 874d3e784e..89dbe9630b 100644
--- a/src/equation_of_state/MOM_EOS_Wright.F90
+++ b/src/equation_of_state/MOM_EOS_Wright.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> The equation of state using a poor implementation (missing parenthesis and bugs) of the
!! reduced range Wright 1997 expressions
module MOM_EOS_Wright
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_EOS_base_type, only : EOS_base
use MOM_hor_index, only : hor_index_type
diff --git a/src/equation_of_state/MOM_EOS_Wright_full.F90 b/src/equation_of_state/MOM_EOS_Wright_full.F90
index 4be5f2940e..ec910e8233 100644
--- a/src/equation_of_state/MOM_EOS_Wright_full.F90
+++ b/src/equation_of_state/MOM_EOS_Wright_full.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> The equation of state using the Wright 1997 expressions with full range of data.
module MOM_EOS_Wright_full
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_EOS_base_type, only : EOS_base
use MOM_hor_index, only : hor_index_type
diff --git a/src/equation_of_state/MOM_EOS_Wright_red.F90 b/src/equation_of_state/MOM_EOS_Wright_red.F90
index 1635f9e809..5a2898ae49 100644
--- a/src/equation_of_state/MOM_EOS_Wright_red.F90
+++ b/src/equation_of_state/MOM_EOS_Wright_red.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> The equation of state using the Wright 1997 expressions with reduced range of data.
module MOM_EOS_Wright_red
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_EOS_base_type, only : EOS_base
use MOM_hor_index, only : hor_index_type
diff --git a/src/equation_of_state/MOM_EOS_base_type.F90 b/src/equation_of_state/MOM_EOS_base_type.F90
index a6e5a21309..5728dfa2f2 100644
--- a/src/equation_of_state/MOM_EOS_base_type.F90
+++ b/src/equation_of_state/MOM_EOS_base_type.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A generic type for equations of state
module MOM_EOS_base_type
-! This file is part of MOM6. See LICENSE.md for the license.
-
implicit none ; private
public EOS_base
diff --git a/src/equation_of_state/MOM_EOS_linear.F90 b/src/equation_of_state/MOM_EOS_linear.F90
index 7737004ea7..28d3ba68a0 100644
--- a/src/equation_of_state/MOM_EOS_linear.F90
+++ b/src/equation_of_state/MOM_EOS_linear.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A simple linear equation of state for sea water with constant coefficients
module MOM_EOS_linear
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_EOS_base_type, only : EOS_base
use MOM_hor_index, only : hor_index_type
diff --git a/src/equation_of_state/MOM_TFreeze.F90 b/src/equation_of_state/MOM_TFreeze.F90
index faa103d094..d55fd0a2b0 100644
--- a/src/equation_of_state/MOM_TFreeze.F90
+++ b/src/equation_of_state/MOM_TFreeze.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Freezing point expressions
module MOM_TFreeze
-! This file is part of MOM6. See LICENSE.md for the license.
-
!********+*********+*********+*********+*********+*********+*********+**
!* The subroutines in this file determine the potential temperature *
!* or conservative temperature at which sea-water freezes. *
diff --git a/src/equation_of_state/MOM_temperature_convert.F90 b/src/equation_of_state/MOM_temperature_convert.F90
index ee4bc21e62..e1cc3b899d 100644
--- a/src/equation_of_state/MOM_temperature_convert.F90
+++ b/src/equation_of_state/MOM_temperature_convert.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Functions to convert between conservative and potential temperature
module MOM_temperature_convert
-! This file is part of MOM6. See LICENSE.md for the license.
-
implicit none ; private
public poTemp_to_consTemp, consTemp_to_poTemp
diff --git a/src/framework/MOM_ANN.F90 b/src/framework/MOM_ANN.F90
index 4e921ccd48..e14ca23747 100644
--- a/src/framework/MOM_ANN.F90
+++ b/src/framework/MOM_ANN.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Implements the general purpose Artificial Neural Network (ANN).
module MOM_ANN
diff --git a/src/framework/MOM_array_transform.F90 b/src/framework/MOM_array_transform.F90
index 66c9925f11..30aeadcdf1 100644
--- a/src/framework/MOM_array_transform.F90
+++ b/src/framework/MOM_array_transform.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Module for supporting the rotation of a field's index map.
!! The implementation of each angle is described below.
!!
diff --git a/src/framework/MOM_checksums.F90 b/src/framework/MOM_checksums.F90
index 9177eb8965..4683dabfac 100644
--- a/src/framework/MOM_checksums.F90
+++ b/src/framework/MOM_checksums.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Routines to calculate checksums of various array and vector types
module MOM_checksums
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_array_transform, only : rotate_array, rotate_array_pair, rotate_vector
use MOM_array_transform, only : allocate_rotated_array
use MOM_coms, only : PE_here, root_PE, num_PEs, sum_across_PEs
diff --git a/src/framework/MOM_coms.F90 b/src/framework/MOM_coms.F90
index be9c9d9586..97b93d8bfe 100644
--- a/src/framework/MOM_coms.F90
+++ b/src/framework/MOM_coms.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Interfaces to non-domain-oriented communication subroutines, including the
!! MOM6 reproducing sums facility
module MOM_coms
-! This file is part of MOM6. See LICENSE.md for the license.
-
use, intrinsic :: iso_fortran_env, only : int64
use MOM_coms_infra, only : PE_here, root_PE, num_PEs, set_rootPE, Set_PElist, Get_PElist
use MOM_coms_infra, only : broadcast, field_chksum, MOM_infra_init, MOM_infra_end
diff --git a/src/framework/MOM_coupler_types.F90 b/src/framework/MOM_coupler_types.F90
index 25a2937aaa..cc8b2427da 100644
--- a/src/framework/MOM_coupler_types.F90
+++ b/src/framework/MOM_coupler_types.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module provides coupler type interfaces for use by MOM6
module MOM_coupler_types
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_array_transform, only : allocate_rotated_array, rotate_array
use MOM_couplertype_infra, only : CT_spawn, CT_initialized, CT_destructor, atmos_ocn_coupler_flux
use MOM_couplertype_infra, only : CT_set_diags, CT_send_data, CT_write_chksums, CT_data_override
diff --git a/src/framework/MOM_cpu_clock.F90 b/src/framework/MOM_cpu_clock.F90
index f4e605a06c..91d1c2085a 100644
--- a/src/framework/MOM_cpu_clock.F90
+++ b/src/framework/MOM_cpu_clock.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides cpu clock functions
module MOM_cpu_clock
-! This file is part of MOM6. See LICENSE.md for the license.
-
! These interfaces and constants from MPP/FMS will not be directly exposed outside of this module
use MOM_cpu_clock_infra, only : cpu_clock_begin
use MOM_cpu_clock_infra, only : cpu_clock_end
diff --git a/src/framework/MOM_data_override.F90 b/src/framework/MOM_data_override.F90
index 39841913e1..1ff145c0d7 100644
--- a/src/framework/MOM_data_override.F90
+++ b/src/framework/MOM_data_override.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> These interfaces allow for ocean or sea-ice variables to be replaced with data.
module MOM_data_override
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_data_override_infra, only : data_override_init => impose_data_init
use MOM_data_override_infra, only : data_override => impose_data
use MOM_data_override_infra, only : data_override_unset_domains => impose_data_unset_domains
diff --git a/src/framework/MOM_diag_mediator.F90 b/src/framework/MOM_diag_mediator.F90
index 58b7d39a4c..a464137aa1 100644
--- a/src/framework/MOM_diag_mediator.F90
+++ b/src/framework/MOM_diag_mediator.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> The subroutines here provide convenient wrappers to the fms diag_manager
!! interfaces with additional diagnostic capabilies.
module MOM_diag_mediator
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_checksums, only : chksum0, zchksum
use MOM_checksums, only : hchksum, uchksum, vchksum, Bchksum
use MOM_coms, only : PE_here
diff --git a/src/framework/MOM_diag_remap.F90 b/src/framework/MOM_diag_remap.F90
index 8fa523924c..c63e50ef9b 100644
--- a/src/framework/MOM_diag_remap.F90
+++ b/src/framework/MOM_diag_remap.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> provides runtime remapping of diagnostics to z star, sigma and
!! rho vertical coordinates.
!!
@@ -27,8 +31,6 @@
module MOM_diag_remap
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms, only : reproducing_sum_EFP, EFP_to_real
use MOM_coms, only : EFP_type, assignment(=), EFP_sum_across_PEs
use MOM_error_handler, only : MOM_error, FATAL, assert, WARNING
diff --git a/src/framework/MOM_document.F90 b/src/framework/MOM_document.F90
index d999e1e680..ef7d22596a 100644
--- a/src/framework/MOM_document.F90
+++ b/src/framework/MOM_document.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> The subroutines here provide hooks for document generation functions at
!! various levels of granularity.
module MOM_document
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_time_manager, only : time_type, operator(==), get_time, get_ticks_per_second
use MOM_error_handler, only : MOM_error, FATAL, WARNING, is_root_pe
diff --git a/src/framework/MOM_domains.F90 b/src/framework/MOM_domains.F90
index 7422b15223..d8a528f5bf 100644
--- a/src/framework/MOM_domains.F90
+++ b/src/framework/MOM_domains.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Describes the decomposed MOM domain and has routines for communications across PEs
module MOM_domains
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms_infra, only : MOM_infra_init, MOM_infra_end
use MOM_coms_infra, only : PE_here, root_PE, num_PEs, broadcast
use MOM_coms_infra, only : sum_across_PEs, min_across_PEs, max_across_PEs
diff --git a/src/framework/MOM_dyn_horgrid.F90 b/src/framework/MOM_dyn_horgrid.F90
index 2e183cdbef..edbf022fe7 100644
--- a/src/framework/MOM_dyn_horgrid.F90
+++ b/src/framework/MOM_dyn_horgrid.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Contains a shareable dynamic type for describing horizontal grids and metric data
!! and utilty routines that work on this type.
module MOM_dyn_horgrid
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_array_transform, only : rotate_array, rotate_array_pair
use MOM_domains, only : MOM_domain_type, deallocate_MOM_domain
use MOM_error_handler, only : MOM_error, MOM_mesg, FATAL, WARNING
diff --git a/src/framework/MOM_ensemble_manager.F90 b/src/framework/MOM_ensemble_manager.F90
index e431212524..62fb32a9dd 100644
--- a/src/framework/MOM_ensemble_manager.F90
+++ b/src/framework/MOM_ensemble_manager.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Manages ensemble member layout information
module MOM_ensemble_manager
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_ensemble_manager_infra, only : ensemble_manager_init
use MOM_ensemble_manager_infra, only : ensemble_pelist_setup
use MOM_ensemble_manager_infra, only : get_ensemble_id
diff --git a/src/framework/MOM_error_handler.F90 b/src/framework/MOM_error_handler.F90
index b113050572..eb097b32f0 100644
--- a/src/framework/MOM_error_handler.F90
+++ b/src/framework/MOM_error_handler.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Routines for error handling and I/O management
module MOM_error_handler
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms_infra, only : num_PEs
use MOM_error_infra, only : MOM_err, is_root_pe, stdlog, stdout, NOTE, WARNING, FATAL
use posix, only : getpid, getppid, handler_interface
diff --git a/src/framework/MOM_file_parser.F90 b/src/framework/MOM_file_parser.F90
index 291d44492d..1504fc67d5 100644
--- a/src/framework/MOM_file_parser.F90
+++ b/src/framework/MOM_file_parser.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> The MOM6 facility to parse input files for runtime parameters
module MOM_file_parser
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms, only : root_PE, broadcast
use MOM_coms, only : any_across_PEs
use MOM_error_handler, only : MOM_error, FATAL, WARNING, MOM_mesg, assert
diff --git a/src/framework/MOM_get_input.F90 b/src/framework/MOM_get_input.F90
index 6ecc3ef3f9..8000558b06 100644
--- a/src/framework/MOM_get_input.F90
+++ b/src/framework/MOM_get_input.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> \brief Reads the only Fortran name list needed to boot-strap the model.
!!
!! The name list parameters indicate which directories to use for
@@ -5,8 +9,6 @@
!! the full parsable input parameter file(s).
module MOM_get_input
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, WARNING, is_root_pe
use MOM_file_parser, only : open_param_file, param_file_type
use MOM_io, only : file_exists, close_file, slasher, ensembler
diff --git a/src/framework/MOM_hor_index.F90 b/src/framework/MOM_hor_index.F90
index 2ce2808692..efd8731d0d 100644
--- a/src/framework/MOM_hor_index.F90
+++ b/src/framework/MOM_hor_index.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Defines the horizontal index type (hor_index_type) used for providing index ranges
module MOM_hor_index
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_domains, only : MOM_domain_type, get_domain_extent, get_global_shape
use MOM_error_handler, only : MOM_error, MOM_mesg, FATAL
use MOM_file_parser, only : get_param, log_param, log_version, param_file_type
diff --git a/src/framework/MOM_horizontal_regridding.F90 b/src/framework/MOM_horizontal_regridding.F90
index 3b296e8b65..4af288ae1d 100644
--- a/src/framework/MOM_horizontal_regridding.F90
+++ b/src/framework/MOM_horizontal_regridding.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Horizontal interpolation
module MOM_horizontal_regridding
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_debugging, only : hchksum
use MOM_coms, only : max_across_PEs, min_across_PEs, sum_across_PEs, broadcast
use MOM_coms, only : reproducing_sum
diff --git a/src/framework/MOM_interpolate.F90 b/src/framework/MOM_interpolate.F90
index 5a830fb028..074b00c3a8 100644
--- a/src/framework/MOM_interpolate.F90
+++ b/src/framework/MOM_interpolate.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module provides added functionality to the FMS temporal and spatial interpolation routines
module MOM_interpolate
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_array_transform, only : allocate_rotated_array, rotate_array
use MOM_error_handler, only : MOM_error, FATAL
use MOM_interp_infra, only : time_interp_extern, init_external_field=>init_extern_field
diff --git a/src/framework/MOM_intrinsic_functions.F90 b/src/framework/MOM_intrinsic_functions.F90
index fdafa8503d..a66e007a7b 100644
--- a/src/framework/MOM_intrinsic_functions.F90
+++ b/src/framework/MOM_intrinsic_functions.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A module with intrinsic functions that are used by MOM but are not supported
!! by some compilers.
module MOM_intrinsic_functions
-! This file is part of MOM6. See LICENSE.md for the license.
-
use iso_fortran_env, only : stdout => output_unit, stderr => error_unit
use iso_fortran_env, only : int64, real64
diff --git a/src/framework/MOM_io.F90 b/src/framework/MOM_io.F90
index a74a9316c5..66d50b9ca0 100644
--- a/src/framework/MOM_io.F90
+++ b/src/framework/MOM_io.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module contains I/O framework code
module MOM_io
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_array_transform, only : allocate_rotated_array, rotate_array
use MOM_array_transform, only : rotate_array_pair, rotate_vector
use MOM_domains, only : MOM_domain_type, domain1D, broadcast, get_domain_components
diff --git a/src/framework/MOM_io_file.F90 b/src/framework/MOM_io_file.F90
index 682f967099..9da83fd338 100644
--- a/src/framework/MOM_io_file.F90
+++ b/src/framework/MOM_io_file.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module contains the MOM file handler types
module MOM_io_file
-! This file is part of MOM6. See LICENSE.md for the license.
-
use, intrinsic :: iso_fortran_env, only : int64
use MOM_domains, only : MOM_domain_type, domain1D
diff --git a/src/framework/MOM_memory_macros.h b/src/framework/MOM_memory_macros.h
index 6ac3e7566b..4919fe4123 100644
--- a/src/framework/MOM_memory_macros.h
+++ b/src/framework/MOM_memory_macros.h
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!//! \brief Memory macros
!//! \details This is a header file to define macros for static and dynamic memory allocation.
!//! Define STATIC_MEMORY_ in MOM_memory.h for static memory allocation.
diff --git a/src/framework/MOM_murmur_hash.F90 b/src/framework/MOM_murmur_hash.F90
index 16283f61e3..1016fa0ee4 100644
--- a/src/framework/MOM_murmur_hash.F90
+++ b/src/framework/MOM_murmur_hash.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> MurmurHash is a non-cryptographic hash function developed by Austin Appleby.
!!
!! This module provides an implementation of the 32-bit MurmurHash3 algorithm.
diff --git a/src/framework/MOM_netcdf.F90 b/src/framework/MOM_netcdf.F90
index 4a7a61ec1c..66ec1e194c 100644
--- a/src/framework/MOM_netcdf.F90
+++ b/src/framework/MOM_netcdf.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> MOM6 interface to netCDF operations
module MOM_netcdf
-! This file is part of MOM6. See LICENSE.md for the license.
-
use, intrinsic :: iso_fortran_env, only : real32, real64
use netcdf, only : nf90_create, nf90_open, nf90_close
diff --git a/src/framework/MOM_random.F90 b/src/framework/MOM_random.F90
index 6fcc6903c9..e21bbcae61 100644
--- a/src/framework/MOM_random.F90
+++ b/src/framework/MOM_random.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides gridded random number capability
module MOM_random
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_hor_index, only : hor_index_type
use MOM_time_manager, only : time_type, set_date, get_date
diff --git a/src/framework/MOM_restart.F90 b/src/framework/MOM_restart.F90
index ca5b59bc6f..ef4adb193a 100644
--- a/src/framework/MOM_restart.F90
+++ b/src/framework/MOM_restart.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> The MOM6 facility for reading and writing restart files, and querying what has been read.
module MOM_restart
-! This file is part of MOM6. See LICENSE.md for the license.
-
use, intrinsic :: iso_fortran_env, only : int64
use MOM_array_transform, only : rotate_array, rotate_vector, rotate_array_pair
use MOM_checksums, only : chksum => field_checksum
diff --git a/src/framework/MOM_safe_alloc.F90 b/src/framework/MOM_safe_alloc.F90
index 8960e8e358..3b5b2b397e 100644
--- a/src/framework/MOM_safe_alloc.F90
+++ b/src/framework/MOM_safe_alloc.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Convenience functions for safely allocating memory without
!! accidentally reallocating pointer and causing memory leaks.
module MOM_safe_alloc
-! This file is part of MOM6. See LICENSE.md for the license.
-
implicit none ; private
public safe_alloc_ptr, safe_alloc_alloc
diff --git a/src/framework/MOM_string_functions.F90 b/src/framework/MOM_string_functions.F90
index cabe0f6e40..10671c135d 100644
--- a/src/framework/MOM_string_functions.F90
+++ b/src/framework/MOM_string_functions.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Handy functions for manipulating strings
module MOM_string_functions
-! This file is part of MOM6. See LICENSE.md for the license.
-
use iso_fortran_env, only : stdout=>output_unit, stderr=>error_unit
implicit none ; private
diff --git a/src/framework/MOM_unique_scales.F90 b/src/framework/MOM_unique_scales.F90
index afc7b6b0ed..e61a339c8b 100644
--- a/src/framework/MOM_unique_scales.F90
+++ b/src/framework/MOM_unique_scales.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module provides tools that can be used to check the uniqueness of the dimensional
!! scaling factors used by the MOM6 ocean model or other models
module MOM_unique_scales
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_error, MOM_mesg, FATAL, WARNING, assert, MOM_get_verbosity
implicit none ; private
diff --git a/src/framework/MOM_unit_scaling.F90 b/src/framework/MOM_unit_scaling.F90
index 8b4f9266a8..96814d3220 100644
--- a/src/framework/MOM_unit_scaling.F90
+++ b/src/framework/MOM_unit_scaling.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides a transparent unit rescaling type to facilitate dimensional consistency testing
module MOM_unit_scaling
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_error, MOM_mesg, FATAL
use MOM_file_parser, only : get_param, log_param, log_version, param_file_type
diff --git a/src/framework/MOM_unit_testing.F90 b/src/framework/MOM_unit_testing.F90
index 312914933c..aeef8aa882 100644
--- a/src/framework/MOM_unit_testing.F90
+++ b/src/framework/MOM_unit_testing.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
module MOM_unit_testing
use posix, only : chmod
diff --git a/src/framework/MOM_write_cputime.F90 b/src/framework/MOM_write_cputime.F90
index 025dcad2ac..52cc924574 100644
--- a/src/framework/MOM_write_cputime.F90
+++ b/src/framework/MOM_write_cputime.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A module to monitor the overall CPU time used by MOM6 and project when to stop the model
module MOM_write_cputime
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms, only : sum_across_PEs, num_pes
use MOM_error_handler, only : MOM_error, MOM_mesg, FATAL, is_root_pe
use MOM_io, only : open_ASCII_file, close_file, APPEND_FILE, WRITEONLY_FILE
diff --git a/src/framework/numerical_testing_type.F90 b/src/framework/numerical_testing_type.F90
index 22b069491c..23ed4630f0 100644
--- a/src/framework/numerical_testing_type.F90
+++ b/src/framework/numerical_testing_type.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A simple type for keeping track of numerical tests
module numerical_testing_type
-! This file is part of MOM6. See LICENSE.md for the license.
-
implicit none ; private
public testing
diff --git a/src/framework/posix.F90 b/src/framework/posix.F90
index a9829c510e..4eb5969b3a 100644
--- a/src/framework/posix.F90
+++ b/src/framework/posix.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Interface to the libc POSIX API
#include "posix.h"
diff --git a/src/framework/posix.h b/src/framework/posix.h
index c4b09e1285..2ccdfde126 100644
--- a/src/framework/posix.h
+++ b/src/framework/posix.h
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
#ifndef MOM6_POSIX_H_
#define MOM6_POSIX_H_
diff --git a/src/framework/testing/MOM_file_parser_tests.F90 b/src/framework/testing/MOM_file_parser_tests.F90
index c0a31c39c4..586037f5d9 100644
--- a/src/framework/testing/MOM_file_parser_tests.F90
+++ b/src/framework/testing/MOM_file_parser_tests.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
module MOM_file_parser_tests
use posix, only : chmod
diff --git a/src/framework/version_variable.h b/src/framework/version_variable.h
index 7cccf999fe..f60afdfc69 100644
--- a/src/framework/version_variable.h
+++ b/src/framework/version_variable.h
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
#ifdef _FILE_VERSION
character(len=*), parameter :: version = _FILE_VERSION
#else
diff --git a/src/ice_shelf/MOM_ice_shelf.F90 b/src/ice_shelf/MOM_ice_shelf.F90
index 2def8097ea..bdde9ba6e4 100644
--- a/src/ice_shelf/MOM_ice_shelf.F90
+++ b/src/ice_shelf/MOM_ice_shelf.F90
@@ -1,9 +1,12 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Implements the thermodynamic aspects of ocean / ice-shelf interactions,
!! along with a crude placeholder for a later implementation of full
!! ice shelf dynamics, all using the MOM framework and coding style.
module MOM_ice_shelf
-! This file is part of MOM6. See LICENSE.md for the license.
use MOM_array_transform, only : rotate_array
use MOM_constants, only : hlf
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
diff --git a/src/ice_shelf/MOM_ice_shelf_diag_mediator.F90 b/src/ice_shelf/MOM_ice_shelf_diag_mediator.F90
index fe54dd6533..fc728e5d14 100644
--- a/src/ice_shelf/MOM_ice_shelf_diag_mediator.F90
+++ b/src/ice_shelf/MOM_ice_shelf_diag_mediator.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Convenient wrappers to the FMS diag_manager interfaces with additional diagnostic capabilies.
module MOM_IS_diag_mediator
diff --git a/src/ice_shelf/MOM_ice_shelf_dynamics.F90 b/src/ice_shelf/MOM_ice_shelf_dynamics.F90
index 5c9b0b306d..9ad992bb97 100644
--- a/src/ice_shelf/MOM_ice_shelf_dynamics.F90
+++ b/src/ice_shelf/MOM_ice_shelf_dynamics.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Implements a crude placeholder for a later implementation of full
!! ice shelf dynamics.
module MOM_ice_shelf_dynamics
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
use MOM_cpu_clock, only : CLOCK_COMPONENT, CLOCK_ROUTINE
use MOM_IS_diag_mediator, only : post_data=>post_IS_data
diff --git a/src/ice_shelf/MOM_ice_shelf_initialize.F90 b/src/ice_shelf/MOM_ice_shelf_initialize.F90
index ec24aef2d0..ee089706b7 100644
--- a/src/ice_shelf/MOM_ice_shelf_initialize.F90
+++ b/src/ice_shelf/MOM_ice_shelf_initialize.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Initialize ice shelf variables
module MOM_ice_shelf_initialize
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_grid, only : ocean_grid_type
use MOM_array_transform, only : rotate_array
use MOM_hor_index, only : hor_index_type
diff --git a/src/ice_shelf/MOM_ice_shelf_state.F90 b/src/ice_shelf/MOM_ice_shelf_state.F90
index d789c08bd4..bcab79fe95 100644
--- a/src/ice_shelf/MOM_ice_shelf_state.F90
+++ b/src/ice_shelf/MOM_ice_shelf_state.F90
@@ -1,10 +1,12 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Implements the thermodynamic aspects of ocean / ice-shelf interactions,
!! along with a crude placeholder for a later implementation of full
!! ice shelf dynamics, all using the MOM framework and coding style.
module MOM_ice_shelf_state
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
use MOM_cpu_clock, only : CLOCK_COMPONENT, CLOCK_ROUTINE
use MOM_dyn_horgrid, only : dyn_horgrid_type, create_dyn_horgrid, destroy_dyn_horgrid
diff --git a/src/ice_shelf/MOM_marine_ice.F90 b/src/ice_shelf/MOM_marine_ice.F90
index 3fec94e499..3f949f8b06 100644
--- a/src/ice_shelf/MOM_marine_ice.F90
+++ b/src/ice_shelf/MOM_marine_ice.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Routines incorporating the effects of marine ice (sea-ice and icebergs) into
!! the ocean model dynamics and thermodynamics.
module MOM_marine_ice
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_constants, only : hlf
use MOM_diag_mediator, only : post_data, query_averaging_enabled, diag_ctrl
use MOM_domains, only : pass_var, pass_vector, AGRID, BGRID_NE, CGRID_NE
diff --git a/src/ice_shelf/user_shelf_init.F90 b/src/ice_shelf/user_shelf_init.F90
index 4d1f263ca8..e3c7e2b49a 100644
--- a/src/ice_shelf/user_shelf_init.F90
+++ b/src/ice_shelf/user_shelf_init.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module specifies the initial values and evolving properties of the
!! MOM6 ice shelf, using user-provided code.
module user_shelf_init
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, is_root_pe
use MOM_file_parser, only : get_param, log_version, param_file_type
use MOM_grid, only : ocean_grid_type
diff --git a/src/initialization/MOM_coord_initialization.F90 b/src/initialization/MOM_coord_initialization.F90
index 9acf693f5f..571a365937 100644
--- a/src/initialization/MOM_coord_initialization.F90
+++ b/src/initialization/MOM_coord_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Initializes fixed aspects of the related to its vertical coordinate.
module MOM_coord_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_debugging, only : chksum
use MOM_EOS, only : calculate_density, EOS_type
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, WARNING, is_root_pe
diff --git a/src/initialization/MOM_fixed_initialization.F90 b/src/initialization/MOM_fixed_initialization.F90
index 78559c72f2..eb405f2e6e 100644
--- a/src/initialization/MOM_fixed_initialization.F90
+++ b/src/initialization/MOM_fixed_initialization.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Initializes fixed aspects of the model, such as horizontal grid metrics,
!! topography and Coriolis.
module MOM_fixed_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_debugging, only : hchksum, qchksum, uvchksum
use MOM_domains, only : pass_var
use MOM_dyn_horgrid, only : dyn_horgrid_type
diff --git a/src/initialization/MOM_grid_initialize.F90 b/src/initialization/MOM_grid_initialize.F90
index 21b8a735d3..78160866d5 100644
--- a/src/initialization/MOM_grid_initialize.F90
+++ b/src/initialization/MOM_grid_initialize.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Initializes horizontal grid
module MOM_grid_initialize
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_checksums, only : hchksum, Bchksum, uvchksum, hchksum_pair, Bchksum_pair
use MOM_domains, only : pass_var, pass_vector, pe_here, root_PE, broadcast
use MOM_domains, only : AGRID, BGRID_NE, CGRID_NE, To_All, Scalar_Pair
diff --git a/src/initialization/MOM_shared_initialization.F90 b/src/initialization/MOM_shared_initialization.F90
index 9a4be62fc2..5ecee4620e 100644
--- a/src/initialization/MOM_shared_initialization.F90
+++ b/src/initialization/MOM_shared_initialization.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Code that initializes fixed aspects of the model grid, such as horizontal
!! grid metrics, topography and Coriolis, and can be shared between components.
module MOM_shared_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms, only : max_across_PEs, reproducing_sum
use MOM_domains, only : pass_var, pass_vector, sum_across_PEs, broadcast
use MOM_domains, only : root_PE, To_All, SCALAR_PAIR, CGRID_NE, AGRID
diff --git a/src/initialization/MOM_state_initialization.F90 b/src/initialization/MOM_state_initialization.F90
index 1ea49671a6..a1a512ac92 100644
--- a/src/initialization/MOM_state_initialization.F90
+++ b/src/initialization/MOM_state_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Initialization functions for state variables, u, v, h, T and S.
module MOM_state_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_debugging, only : hchksum, qchksum, uvchksum
use MOM_density_integrals, only : int_specific_vol_dp
use MOM_density_integrals, only : find_depth_of_pressure_in_cell
diff --git a/src/initialization/MOM_tracer_initialization_from_Z.F90 b/src/initialization/MOM_tracer_initialization_from_Z.F90
index b100e0bf1c..d444fafdd9 100644
--- a/src/initialization/MOM_tracer_initialization_from_Z.F90
+++ b/src/initialization/MOM_tracer_initialization_from_Z.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Initializes hydrography from z-coordinate climatology files
module MOM_tracer_initialization_from_Z
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_debugging, only : hchksum
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
use MOM_cpu_clock, only : CLOCK_ROUTINE, CLOCK_LOOP
diff --git a/src/ocean_data_assim/MOM_oda_driver.F90 b/src/ocean_data_assim/MOM_oda_driver.F90
index 3b277578a3..4c665fd9e1 100644
--- a/src/ocean_data_assim/MOM_oda_driver.F90
+++ b/src/ocean_data_assim/MOM_oda_driver.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Interfaces for MOM6 ensembles and data assimilation.
module MOM_oda_driver_mod
diff --git a/src/ocean_data_assim/MOM_oda_incupd.F90 b/src/ocean_data_assim/MOM_oda_incupd.F90
index 5c2a55b078..d55d030d44 100644
--- a/src/ocean_data_assim/MOM_oda_incupd.F90
+++ b/src/ocean_data_assim/MOM_oda_incupd.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module contains the routines used to apply incremental updates
!! from data assimilation.
!
@@ -13,7 +17,6 @@
module MOM_oda_incupd
-! This file is part of MOM6. See LICENSE.md for the license.
use MOM_array_transform, only : rotate_array
use MOM_coms, only : sum_across_PEs
use MOM_diag_mediator, only : post_data, query_averaging_enabled, register_diag_field
diff --git a/src/parameterizations/lateral/MOM_MEKE.F90 b/src/parameterizations/lateral/MOM_MEKE.F90
index 41c98884ba..3f96e689c7 100644
--- a/src/parameterizations/lateral/MOM_MEKE.F90
+++ b/src/parameterizations/lateral/MOM_MEKE.F90
@@ -1,9 +1,12 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Implements the Mesoscale Eddy Kinetic Energy framework
!! with topographic beta effect included in computing beta in Rhines scale
module MOM_MEKE
-! This file is part of MOM6. See LICENSE.md for the license.
use iso_fortran_env, only : real32
use MOM_coms, only : PE_here
diff --git a/src/parameterizations/lateral/MOM_MEKE_types.F90 b/src/parameterizations/lateral/MOM_MEKE_types.F90
index e277036716..26bc168730 100644
--- a/src/parameterizations/lateral/MOM_MEKE_types.F90
+++ b/src/parameterizations/lateral/MOM_MEKE_types.F90
@@ -1,6 +1,8 @@
-module MOM_MEKE_types
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
-! This file is part of MOM6. See LICENSE.md for the license.
+module MOM_MEKE_types
implicit none ; private
diff --git a/src/parameterizations/lateral/MOM_Zanna_Bolton.F90 b/src/parameterizations/lateral/MOM_Zanna_Bolton.F90
index 075ec9049c..8b4a8856b7 100644
--- a/src/parameterizations/lateral/MOM_Zanna_Bolton.F90
+++ b/src/parameterizations/lateral/MOM_Zanna_Bolton.F90
@@ -1,8 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Calculates Zanna and Bolton 2020 parameterization
!! Implemented by Perezhogin P.A. Contact: pperezhogin@gmail.com
module MOM_Zanna_Bolton
-! This file is part of MOM6. See LICENSE.md for the license.
use MOM_grid, only : ocean_grid_type
use MOM_verticalGrid, only : verticalGrid_type
use MOM_diag_mediator, only : diag_ctrl, time_type
diff --git a/src/parameterizations/lateral/MOM_hor_visc.F90 b/src/parameterizations/lateral/MOM_hor_visc.F90
index 59c4659570..672de2532c 100644
--- a/src/parameterizations/lateral/MOM_hor_visc.F90
+++ b/src/parameterizations/lateral/MOM_hor_visc.F90
@@ -1,7 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Calculates horizontal viscosity and viscous stresses
module MOM_hor_visc
-! This file is part of MOM6. See LICENSE.md for the license.
use MOM_checksums, only : hchksum, Bchksum, uvchksum
use MOM_coms, only : min_across_PEs
use MOM_diag_mediator, only : post_data, register_diag_field, safe_alloc_ptr
@@ -3816,4 +3819,4 @@ end subroutine hor_visc_end
!! Smith, R.D., and McWilliams, J.C., 2003: Anisotropic horizontal viscosity for
!! ocean models. Ocean Modelling, 5(2), 129-156.
!! https://doi.org/10.1016/S1463-5003(02)00016-1
-end module MOM_hor_visc
\ No newline at end of file
+end module MOM_hor_visc
diff --git a/src/parameterizations/lateral/MOM_interface_filter.F90 b/src/parameterizations/lateral/MOM_interface_filter.F90
index 12bda8c020..652da865ee 100644
--- a/src/parameterizations/lateral/MOM_interface_filter.F90
+++ b/src/parameterizations/lateral/MOM_interface_filter.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Interface height filtering module
module MOM_interface_filter
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_debugging, only : hchksum, uvchksum
use MOM_diag_mediator, only : post_data, query_averaging_enabled, diag_ctrl
use MOM_diag_mediator, only : register_diag_field, safe_alloc_ptr, time_type
diff --git a/src/parameterizations/lateral/MOM_internal_tides.F90 b/src/parameterizations/lateral/MOM_internal_tides.F90
index 1f51cc99a9..73740e5412 100644
--- a/src/parameterizations/lateral/MOM_internal_tides.F90
+++ b/src/parameterizations/lateral/MOM_internal_tides.F90
@@ -1,10 +1,12 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Subroutines that use the ray-tracing equations to propagate the internal tide energy density.
!!
!! \author Benjamin Mater & Robert Hallberg, 2015
module MOM_internal_tides
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_checksums, only : hchksum
use MOM_debugging, only : is_NaN
use MOM_diag_mediator, only : post_data, query_averaging_enabled, diag_axis_init
diff --git a/src/parameterizations/lateral/MOM_lateral_mixing_coeffs.F90 b/src/parameterizations/lateral/MOM_lateral_mixing_coeffs.F90
index 5c9130b6f7..2aa7f041d4 100644
--- a/src/parameterizations/lateral/MOM_lateral_mixing_coeffs.F90
+++ b/src/parameterizations/lateral/MOM_lateral_mixing_coeffs.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Variable mixing coefficients
module MOM_lateral_mixing_coeffs
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_debugging, only : hchksum, uvchksum
use MOM_error_handler, only : MOM_error, FATAL, WARNING, MOM_mesg
use MOM_diag_mediator, only : register_diag_field, safe_alloc_ptr, post_data
diff --git a/src/parameterizations/lateral/MOM_load_love_numbers.F90 b/src/parameterizations/lateral/MOM_load_love_numbers.F90
index 8faf3aafab..8ca2951cc4 100644
--- a/src/parameterizations/lateral/MOM_load_love_numbers.F90
+++ b/src/parameterizations/lateral/MOM_load_love_numbers.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Load Love Numbers for degree range [0, 1440]
module MOM_load_love_numbers
diff --git a/src/parameterizations/lateral/MOM_mixed_layer_restrat.F90 b/src/parameterizations/lateral/MOM_mixed_layer_restrat.F90
index 2cff7cf7c8..6e558bc0c7 100644
--- a/src/parameterizations/lateral/MOM_mixed_layer_restrat.F90
+++ b/src/parameterizations/lateral/MOM_mixed_layer_restrat.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> \brief Parameterization of mixed layer restratification by unresolved mixed-layer eddies.
module MOM_mixed_layer_restrat
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_debugging, only : hchksum
use MOM_diag_mediator, only : post_data, query_averaging_enabled, diag_ctrl
use MOM_diag_mediator, only : register_diag_field, safe_alloc_ptr, time_type
diff --git a/src/parameterizations/lateral/MOM_self_attr_load.F90 b/src/parameterizations/lateral/MOM_self_attr_load.F90
index 045027f05c..ae1e0fec7c 100644
--- a/src/parameterizations/lateral/MOM_self_attr_load.F90
+++ b/src/parameterizations/lateral/MOM_self_attr_load.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
module MOM_self_attr_load
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end, CLOCK_MODULE
diff --git a/src/parameterizations/lateral/MOM_spherical_harmonics.F90 b/src/parameterizations/lateral/MOM_spherical_harmonics.F90
index 7606ac3ce1..44bdce9b71 100644
--- a/src/parameterizations/lateral/MOM_spherical_harmonics.F90
+++ b/src/parameterizations/lateral/MOM_spherical_harmonics.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Laplace's spherical harmonic transforms (SHT)
module MOM_spherical_harmonics
use MOM_coms_infra, only : sum_across_PEs
diff --git a/src/parameterizations/lateral/MOM_streaming_filter.F90 b/src/parameterizations/lateral/MOM_streaming_filter.F90
index 7a8bc1b774..618ae12786 100644
--- a/src/parameterizations/lateral/MOM_streaming_filter.F90
+++ b/src/parameterizations/lateral/MOM_streaming_filter.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Streaming band-pass filter for detecting the instantaneous tidal signals in the simulation
module MOM_streaming_filter
diff --git a/src/parameterizations/lateral/MOM_thickness_diffuse.F90 b/src/parameterizations/lateral/MOM_thickness_diffuse.F90
index 1bfa3d340b..fc61bd0788 100644
--- a/src/parameterizations/lateral/MOM_thickness_diffuse.F90
+++ b/src/parameterizations/lateral/MOM_thickness_diffuse.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Isopycnal height diffusion (or Gent McWilliams diffusion)
module MOM_thickness_diffuse
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_debugging, only : hchksum, uvchksum
use MOM_diag_mediator, only : post_data, query_averaging_enabled, diag_ctrl
use MOM_diag_mediator, only : register_diag_field, safe_alloc_ptr, time_type
diff --git a/src/parameterizations/lateral/MOM_tidal_forcing.F90 b/src/parameterizations/lateral/MOM_tidal_forcing.F90
index 55daa49a3b..47e01fd50d 100644
--- a/src/parameterizations/lateral/MOM_tidal_forcing.F90
+++ b/src/parameterizations/lateral/MOM_tidal_forcing.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Tidal contributions to geopotential
module MOM_tidal_forcing
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end, &
CLOCK_MODULE, CLOCK_ROUTINE
use MOM_domains, only : pass_var
diff --git a/src/parameterizations/lateral/MOM_wave_drag.F90 b/src/parameterizations/lateral/MOM_wave_drag.F90
index a507c762c1..aef40d86b1 100644
--- a/src/parameterizations/lateral/MOM_wave_drag.F90
+++ b/src/parameterizations/lateral/MOM_wave_drag.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Frequency-dependent linear wave drag
module MOM_wave_drag
diff --git a/src/parameterizations/stochastic/MOM_stochastics.F90 b/src/parameterizations/stochastic/MOM_stochastics.F90
index 66f9dec0ea..8e56ec3ef2 100644
--- a/src/parameterizations/stochastic/MOM_stochastics.F90
+++ b/src/parameterizations/stochastic/MOM_stochastics.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Top-level module for the MOM6 ocean model in coupled mode.
module MOM_stochastics
-! This file is part of MOM6. See LICENSE.md for the license.
-
! This is the top level module for the MOM6 ocean model. It contains routines
! for initialization, update, and writing restart of stochastic physics. This
! particular version wraps all of the calls for MOM6 in the calls that had
diff --git a/src/parameterizations/vertical/MOM_ALE_sponge.F90 b/src/parameterizations/vertical/MOM_ALE_sponge.F90
index ebbba53b37..c0cfb3b45c 100644
--- a/src/parameterizations/vertical/MOM_ALE_sponge.F90
+++ b/src/parameterizations/vertical/MOM_ALE_sponge.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module contains the routines used to apply sponge layers when using
!! the ALE mode.
!!
@@ -11,7 +15,6 @@
module MOM_ALE_sponge
-! This file is part of MOM6. See LICENSE.md for the license.
use MOM_array_transform, only: rotate_array
use MOM_coms, only : sum_across_PEs
use MOM_diag_mediator, only : post_data, query_averaging_enabled, register_diag_field
diff --git a/src/parameterizations/vertical/MOM_CVMix_KPP.F90 b/src/parameterizations/vertical/MOM_CVMix_KPP.F90
index bf8de60a27..6bbe582ce3 100644
--- a/src/parameterizations/vertical/MOM_CVMix_KPP.F90
+++ b/src/parameterizations/vertical/MOM_CVMix_KPP.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides the K-Profile Parameterization (KPP) of Large et al., 1994, via CVMix.
module MOM_CVMix_KPP
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms, only : max_across_PEs
use MOM_debugging, only : hchksum, is_NaN
use MOM_diag_mediator, only : time_type, diag_ctrl, safe_alloc_ptr, post_data
diff --git a/src/parameterizations/vertical/MOM_CVMix_conv.F90 b/src/parameterizations/vertical/MOM_CVMix_conv.F90
index 74a0305ce1..3589c184df 100644
--- a/src/parameterizations/vertical/MOM_CVMix_conv.F90
+++ b/src/parameterizations/vertical/MOM_CVMix_conv.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Interface to CVMix convection scheme.
module MOM_CVMix_conv
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_debugging, only : hchksum
use MOM_diag_mediator, only : diag_ctrl, time_type, register_diag_field
use MOM_diag_mediator, only : post_data
diff --git a/src/parameterizations/vertical/MOM_CVMix_ddiff.F90 b/src/parameterizations/vertical/MOM_CVMix_ddiff.F90
index 173ab7a36d..c46efb8a45 100644
--- a/src/parameterizations/vertical/MOM_CVMix_ddiff.F90
+++ b/src/parameterizations/vertical/MOM_CVMix_ddiff.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Interface to CVMix double diffusion scheme.
module MOM_CVMix_ddiff
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_diag_mediator, only : diag_ctrl, time_type, register_diag_field
use MOM_diag_mediator, only : post_data
use MOM_EOS, only : calculate_density_derivs
diff --git a/src/parameterizations/vertical/MOM_CVMix_shear.F90 b/src/parameterizations/vertical/MOM_CVMix_shear.F90
index a4a336d867..1d43b95447 100644
--- a/src/parameterizations/vertical/MOM_CVMix_shear.F90
+++ b/src/parameterizations/vertical/MOM_CVMix_shear.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Interface to CVMix interior shear schemes
module MOM_CVMix_shear
-! This file is part of MOM6. See LICENSE.md for the license.
-
!> \author Brandon Reichl
use MOM_diag_mediator, only : post_data, register_diag_field, safe_alloc_ptr
diff --git a/src/parameterizations/vertical/MOM_bkgnd_mixing.F90 b/src/parameterizations/vertical/MOM_bkgnd_mixing.F90
index d6c51201a6..d9fcbe081a 100644
--- a/src/parameterizations/vertical/MOM_bkgnd_mixing.F90
+++ b/src/parameterizations/vertical/MOM_bkgnd_mixing.F90
@@ -1,10 +1,12 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Interface to background mixing schemes, including the Bryan and Lewis (1979)
!! which is applied via CVMix.
module MOM_bkgnd_mixing
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_debugging, only : hchksum
use MOM_diag_mediator, only : diag_ctrl, time_type, register_diag_field
use MOM_diag_mediator, only : post_data
diff --git a/src/parameterizations/vertical/MOM_bulk_mixed_layer.F90 b/src/parameterizations/vertical/MOM_bulk_mixed_layer.F90
index 690688dc1e..b9fc8eb70a 100644
--- a/src/parameterizations/vertical/MOM_bulk_mixed_layer.F90
+++ b/src/parameterizations/vertical/MOM_bulk_mixed_layer.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Build mixed layer parameterization
module MOM_bulk_mixed_layer
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end, CLOCK_ROUTINE
use MOM_diag_mediator, only : post_data, register_diag_field, safe_alloc_alloc
use MOM_diag_mediator, only : time_type, diag_ctrl, diag_update_remap_grids
diff --git a/src/parameterizations/vertical/MOM_diabatic_aux.F90 b/src/parameterizations/vertical/MOM_diabatic_aux.F90
index 9fffc1a6c4..bcde4feb34 100644
--- a/src/parameterizations/vertical/MOM_diabatic_aux.F90
+++ b/src/parameterizations/vertical/MOM_diabatic_aux.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides functions for some diabatic processes such as frazil, brine rejection,
!! tendency due to surface flux divergence.
module MOM_diabatic_aux
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
use MOM_cpu_clock, only : CLOCK_MODULE_DRIVER, CLOCK_MODULE, CLOCK_ROUTINE
use MOM_diag_mediator, only : post_data, register_diag_field, safe_alloc_ptr
diff --git a/src/parameterizations/vertical/MOM_diabatic_driver.F90 b/src/parameterizations/vertical/MOM_diabatic_driver.F90
index 63470312f3..5389de3e1d 100644
--- a/src/parameterizations/vertical/MOM_diabatic_driver.F90
+++ b/src/parameterizations/vertical/MOM_diabatic_driver.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This routine drives the diabatic/dianeutral physics for MOM
module MOM_diabatic_driver
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_bulk_mixed_layer, only : bulkmixedlayer, bulkmixedlayer_init, bulkmixedlayer_CS
use MOM_debugging, only : hchksum
use MOM_checksum_packages, only : MOM_state_chksum, MOM_state_stats
diff --git a/src/parameterizations/vertical/MOM_diapyc_energy_req.F90 b/src/parameterizations/vertical/MOM_diapyc_energy_req.F90
index d197a7a8f1..a7d4bd71d8 100644
--- a/src/parameterizations/vertical/MOM_diapyc_energy_req.F90
+++ b/src/parameterizations/vertical/MOM_diapyc_energy_req.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Calculates the energy requirements of mixing.
module MOM_diapyc_energy_req
-! This file is part of MOM6. See LICENSE.md for the license.
-
!! \author By Robert Hallberg, May 2015
use MOM_diag_mediator, only : diag_ctrl, Time_type, post_data, register_diag_field
diff --git a/src/parameterizations/vertical/MOM_energetic_PBL.F90 b/src/parameterizations/vertical/MOM_energetic_PBL.F90
index 7a67cbb5a5..b7f3a3462b 100644
--- a/src/parameterizations/vertical/MOM_energetic_PBL.F90
+++ b/src/parameterizations/vertical/MOM_energetic_PBL.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Energetically consistent planetary boundary layer parameterization
module MOM_energetic_PBL
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end, CLOCK_ROUTINE
use MOM_coms, only : EFP_type, real_to_EFP, EFP_to_real, operator(+), assignment(=), EFP_sum_across_PEs
use MOM_debugging, only : hchksum
diff --git a/src/parameterizations/vertical/MOM_entrain_diffusive.F90 b/src/parameterizations/vertical/MOM_entrain_diffusive.F90
index 5141176d08..4f5ae31f0c 100644
--- a/src/parameterizations/vertical/MOM_entrain_diffusive.F90
+++ b/src/parameterizations/vertical/MOM_entrain_diffusive.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Diapycnal mixing and advection in isopycnal mode
module MOM_entrain_diffusive
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_diag_mediator, only : post_data, register_diag_field, safe_alloc_ptr
use MOM_diag_mediator, only : diag_ctrl, time_type
use MOM_EOS, only : calculate_density, calculate_density_derivs
diff --git a/src/parameterizations/vertical/MOM_full_convection.F90 b/src/parameterizations/vertical/MOM_full_convection.F90
index a5fba3adc6..bcf715a204 100644
--- a/src/parameterizations/vertical/MOM_full_convection.F90
+++ b/src/parameterizations/vertical/MOM_full_convection.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Does full convective adjustment of unstable regions via a strong diffusivity.
module MOM_full_convection
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_grid, only : ocean_grid_type
use MOM_interface_heights, only : thickness_to_dz
use MOM_unit_scaling, only : unit_scale_type
diff --git a/src/parameterizations/vertical/MOM_geothermal.F90 b/src/parameterizations/vertical/MOM_geothermal.F90
index ac12bcdb1b..7746ed84dc 100644
--- a/src/parameterizations/vertical/MOM_geothermal.F90
+++ b/src/parameterizations/vertical/MOM_geothermal.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Implemented geothermal heating at the ocean bottom.
module MOM_geothermal
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_diag_mediator, only : post_data, register_diag_field, safe_alloc_alloc
use MOM_diag_mediator, only : register_static_field, time_type, diag_ctrl
use MOM_domains, only : pass_var
diff --git a/src/parameterizations/vertical/MOM_internal_tide_input.F90 b/src/parameterizations/vertical/MOM_internal_tide_input.F90
index 2384844f6e..a03dca73a8 100644
--- a/src/parameterizations/vertical/MOM_internal_tide_input.F90
+++ b/src/parameterizations/vertical/MOM_internal_tide_input.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Calculates energy input to the internal tides
module MOM_int_tide_input
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
use MOM_cpu_clock, only : CLOCK_MODULE_DRIVER, CLOCK_MODULE, CLOCK_ROUTINE
use MOM_diag_mediator, only : diag_ctrl, query_averaging_enabled
diff --git a/src/parameterizations/vertical/MOM_kappa_shear.F90 b/src/parameterizations/vertical/MOM_kappa_shear.F90
index da2c261ad9..b2e112cb36 100644
--- a/src/parameterizations/vertical/MOM_kappa_shear.F90
+++ b/src/parameterizations/vertical/MOM_kappa_shear.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Shear-dependent mixing following Jackson et al. 2008.
module MOM_kappa_shear
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
use MOM_cpu_clock, only : CLOCK_MODULE_DRIVER, CLOCK_MODULE, CLOCK_ROUTINE
use MOM_diag_mediator, only : post_data, register_diag_field, safe_alloc_ptr
diff --git a/src/parameterizations/vertical/MOM_opacity.F90 b/src/parameterizations/vertical/MOM_opacity.F90
index 8289144ec3..6728bf820c 100644
--- a/src/parameterizations/vertical/MOM_opacity.F90
+++ b/src/parameterizations/vertical/MOM_opacity.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Routines used to calculate the opacity of the ocean.
module MOM_opacity
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_diag_mediator, only : time_type, diag_ctrl, safe_alloc_ptr, post_data
use MOM_diag_mediator, only : query_averaging_enabled, register_diag_field
use MOM_error_handler, only : MOM_error, MOM_mesg, FATAL, WARNING
diff --git a/src/parameterizations/vertical/MOM_regularize_layers.F90 b/src/parameterizations/vertical/MOM_regularize_layers.F90
index b00238f60c..da1667a77b 100644
--- a/src/parameterizations/vertical/MOM_regularize_layers.F90
+++ b/src/parameterizations/vertical/MOM_regularize_layers.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides regularization of layers in isopycnal mode
module MOM_regularize_layers
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end, CLOCK_ROUTINE
use MOM_diag_mediator, only : post_data, register_diag_field, safe_alloc_ptr
use MOM_diag_mediator, only : time_type, diag_ctrl
diff --git a/src/parameterizations/vertical/MOM_set_diffusivity.F90 b/src/parameterizations/vertical/MOM_set_diffusivity.F90
index caf0555d28..c6124e0c9a 100644
--- a/src/parameterizations/vertical/MOM_set_diffusivity.F90
+++ b/src/parameterizations/vertical/MOM_set_diffusivity.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Calculate vertical diffusivity from all mixing processes
module MOM_set_diffusivity
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_bkgnd_mixing, only : calculate_bkgnd_mixing, bkgnd_mixing_init, bkgnd_mixing_cs
use MOM_bkgnd_mixing, only : bkgnd_mixing_end
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
diff --git a/src/parameterizations/vertical/MOM_set_viscosity.F90 b/src/parameterizations/vertical/MOM_set_viscosity.F90
index 6466b71dd5..0c72f83b0c 100644
--- a/src/parameterizations/vertical/MOM_set_viscosity.F90
+++ b/src/parameterizations/vertical/MOM_set_viscosity.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Calculates various values related to the bottom boundary layer, such as the viscosity and
!! thickness of the BBL (set_viscous_BBL).
module MOM_set_visc
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_ALE, only : ALE_CS, ALE_remap_velocities, ALE_remap_interface_vals, ALE_remap_vertex_vals
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end, CLOCK_ROUTINE
use MOM_cvmix_conv, only : cvmix_conv_is_used
diff --git a/src/parameterizations/vertical/MOM_sponge.F90 b/src/parameterizations/vertical/MOM_sponge.F90
index c919e57d94..aa8361e2c7 100644
--- a/src/parameterizations/vertical/MOM_sponge.F90
+++ b/src/parameterizations/vertical/MOM_sponge.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Implements sponge regions in isopycnal mode
module MOM_sponge
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms, only : sum_across_PEs
use MOM_diag_mediator, only : post_data, query_averaging_enabled, register_diag_field
use MOM_diag_mediator, only : diag_ctrl
diff --git a/src/parameterizations/vertical/MOM_tidal_mixing.F90 b/src/parameterizations/vertical/MOM_tidal_mixing.F90
index 9a972e6e06..e596a9af2f 100644
--- a/src/parameterizations/vertical/MOM_tidal_mixing.F90
+++ b/src/parameterizations/vertical/MOM_tidal_mixing.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Interface to vertical tidal mixing schemes including CVMix tidal mixing.
module MOM_tidal_mixing
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_diag_mediator, only : diag_ctrl, time_type, register_diag_field
use MOM_diag_mediator, only : safe_alloc_ptr, post_data
use MOM_diagnose_Kdwork, only : vbf_CS
diff --git a/src/parameterizations/vertical/MOM_vert_friction.F90 b/src/parameterizations/vertical/MOM_vert_friction.F90
index b4e75c56d2..3c324c4147 100644
--- a/src/parameterizations/vertical/MOM_vert_friction.F90
+++ b/src/parameterizations/vertical/MOM_vert_friction.F90
@@ -1,7 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Implements vertical viscosity (vertvisc)
module MOM_vert_friction
-! This file is part of MOM6. See LICENSE.md for the license.
use MOM_domains, only : pass_var, To_All, Omit_corners
use MOM_domains, only : pass_vector, Scalar_Pair
use MOM_diag_mediator, only : post_data, register_diag_field, safe_alloc_ptr
diff --git a/src/tracer/DOME_tracer.F90 b/src/tracer/DOME_tracer.F90
index 839e923844..7ef2dee58c 100644
--- a/src/tracer/DOME_tracer.F90
+++ b/src/tracer/DOME_tracer.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A tracer package that is used as a diagnostic in the DOME experiments
module DOME_tracer
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coupler_types, only : set_coupler_type_data, atmos_ocn_coupler_flux
use MOM_diag_mediator, only : diag_ctrl
use MOM_error_handler, only : MOM_error, FATAL, WARNING
diff --git a/src/tracer/ISOMIP_tracer.F90 b/src/tracer/ISOMIP_tracer.F90
index 7361b893ec..f1a158fb90 100644
--- a/src/tracer/ISOMIP_tracer.F90
+++ b/src/tracer/ISOMIP_tracer.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Routines used to set up and use a set of (one for now)
!! dynamically passive tracers in the ISOMIP configuration.
!!
@@ -5,8 +9,6 @@
!! the sponge layer.
module ISOMIP_tracer
-! This file is part of MOM6. See LICENSE.md for the license.
-
! Original sample tracer package by Robert Hallberg, 2002
! Adapted to the ISOMIP test case by Gustavo Marques, May 2016
diff --git a/src/tracer/MARBL_forcing_mod.F90 b/src/tracer/MARBL_forcing_mod.F90
index 2705bc1d66..4713f91d44 100644
--- a/src/tracer/MARBL_forcing_mod.F90
+++ b/src/tracer/MARBL_forcing_mod.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module provides a common datatype to provide forcing for MARBL tracers
!! regardless of driver
module MARBL_forcing_mod
diff --git a/src/tracer/MARBL_tracers.F90 b/src/tracer/MARBL_tracers.F90
index 847a174d36..20a600d171 100644
--- a/src/tracer/MARBL_tracers.F90
+++ b/src/tracer/MARBL_tracers.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A tracer package for tracers computed in the MARBL library
!!
!! Currently configured for use with marbl0.36.0
@@ -5,8 +9,6 @@
!! (clone entire repo into pkg/MARBL)
module MARBL_tracers
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms, only : EFP_type, root_PE, broadcast
use MOM_debugging, only : hchksum
use MOM_diag_mediator, only : diag_ctrl
diff --git a/src/tracer/MOM_CFC_cap.F90 b/src/tracer/MOM_CFC_cap.F90
index f9aa421f86..f8420b47a0 100644
--- a/src/tracer/MOM_CFC_cap.F90
+++ b/src/tracer/MOM_CFC_cap.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Simulates CFCs using atmospheric pressure, wind speed and sea ice cover
!! provided via cap (only NUOPC cap is implemented so far).
module MOM_CFC_cap
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms, only : EFP_type
use MOM_debugging, only : hchksum
use MOM_diag_mediator, only : diag_ctrl, register_diag_field, post_data
diff --git a/src/tracer/MOM_OCMIP2_CFC.F90 b/src/tracer/MOM_OCMIP2_CFC.F90
index 0a80cfaf2f..ee6609903f 100644
--- a/src/tracer/MOM_OCMIP2_CFC.F90
+++ b/src/tracer/MOM_OCMIP2_CFC.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Simulates CFCs using the OCMIP2 protocols
module MOM_OCMIP2_CFC
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms, only : EFP_type
use MOM_coupler_types, only : extract_coupler_type_data, set_coupler_type_data
use MOM_coupler_types, only : atmos_ocn_coupler_flux
diff --git a/src/tracer/MOM_hor_bnd_diffusion.F90 b/src/tracer/MOM_hor_bnd_diffusion.F90
index afb4732cb5..96cddfa4d1 100644
--- a/src/tracer/MOM_hor_bnd_diffusion.F90
+++ b/src/tracer/MOM_hor_bnd_diffusion.F90
@@ -1,10 +1,12 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Calculates and applies diffusive fluxes as a parameterization of horizontal mixing (non-neutral) by
!! mesoscale eddies near the top and bottom (to be implemented) boundary layers of the ocean.
module MOM_hor_bnd_diffusion
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
use MOM_cpu_clock, only : CLOCK_MODULE
use MOM_checksums, only : hchksum
diff --git a/src/tracer/MOM_neutral_diffusion.F90 b/src/tracer/MOM_neutral_diffusion.F90
index 0d039dd090..bf28f2dbfc 100644
--- a/src/tracer/MOM_neutral_diffusion.F90
+++ b/src/tracer/MOM_neutral_diffusion.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A column-wise toolbox for implementing neutral diffusion
module MOM_neutral_diffusion
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
use MOM_cpu_clock, only : CLOCK_MODULE, CLOCK_ROUTINE
use MOM_domains, only : pass_var
diff --git a/src/tracer/MOM_offline_aux.F90 b/src/tracer/MOM_offline_aux.F90
index 4adf8de293..4ea3ee70cc 100644
--- a/src/tracer/MOM_offline_aux.F90
+++ b/src/tracer/MOM_offline_aux.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Contains routines related to offline transport of tracers. These routines are likely to be called from
!> the MOM_offline_main module
module MOM_offline_aux
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_debugging, only : check_column_integrals
use MOM_domains, only : pass_var, pass_vector, To_All
use MOM_diag_mediator, only : post_data
diff --git a/src/tracer/MOM_offline_main.F90 b/src/tracer/MOM_offline_main.F90
index b0537955ef..e97eb61373 100644
--- a/src/tracer/MOM_offline_main.F90
+++ b/src/tracer/MOM_offline_main.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> The routines here implement the offline tracer algorithm used in MOM6. These are called from step_offline
!! Some routines called here can be found in the MOM_offline_aux module.
module MOM_offline_main
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_ALE, only : ALE_CS, ALE_regrid, ALE_offline_inputs
use MOM_ALE, only : pre_ALE_adjustments, ALE_update_regrid_weights
use MOM_ALE, only : ALE_remap_tracers
diff --git a/src/tracer/MOM_tracer_Z_init.F90 b/src/tracer/MOM_tracer_Z_init.F90
index 8b2c12fd9b..63b5107d19 100644
--- a/src/tracer/MOM_tracer_Z_init.F90
+++ b/src/tracer/MOM_tracer_Z_init.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Used to initialize tracers from a depth- (or z*-) space file.
module MOM_tracer_Z_init
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_error, FATAL, WARNING, MOM_mesg, is_root_pe
use MOM_file_parser, only : get_param, log_version, param_file_type
use MOM_grid, only : ocean_grid_type
diff --git a/src/tracer/MOM_tracer_advect.F90 b/src/tracer/MOM_tracer_advect.F90
index 6ca6614791..a2d43e80a9 100644
--- a/src/tracer/MOM_tracer_advect.F90
+++ b/src/tracer/MOM_tracer_advect.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module contains the subroutines that advect tracers along coordinate surfaces.
module MOM_tracer_advect
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
use MOM_cpu_clock, only : CLOCK_MODULE, CLOCK_ROUTINE
use MOM_diag_mediator, only : post_data, query_averaging_enabled, diag_ctrl
diff --git a/src/tracer/MOM_tracer_advect_schemes.F90 b/src/tracer/MOM_tracer_advect_schemes.F90
index 630f451cfa..2afe72ec46 100644
--- a/src/tracer/MOM_tracer_advect_schemes.F90
+++ b/src/tracer/MOM_tracer_advect_schemes.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module contains constants for the tracer advection schemes.
module MOM_tracer_advect_schemes
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_error, FATAL
implicit none ; public
diff --git a/src/tracer/MOM_tracer_diabatic.F90 b/src/tracer/MOM_tracer_diabatic.F90
index 417cf7c151..ae6d98e3a7 100644
--- a/src/tracer/MOM_tracer_diabatic.F90
+++ b/src/tracer/MOM_tracer_diabatic.F90
@@ -1,10 +1,12 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module contains routines that implement physical fluxes of tracers (e.g. due
!! to surface fluxes or mixing). These are intended to be called from call_tracer_column_fns
!! in the MOM_tracer_flow_control module.
module MOM_tracer_diabatic
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_grid, only : ocean_grid_type
use MOM_verticalGrid, only : verticalGrid_type
use MOM_forcing_type, only : forcing
diff --git a/src/tracer/MOM_tracer_flow_control.F90 b/src/tracer/MOM_tracer_flow_control.F90
index 2fce6325ad..dc8f3a37fb 100644
--- a/src/tracer/MOM_tracer_flow_control.F90
+++ b/src/tracer/MOM_tracer_flow_control.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Orchestrates the registration and calling of tracer packages
module MOM_tracer_flow_control
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms, only : EFP_type, assignment(=), EFP_to_real, real_to_EFP, EFP_sum_across_PEs
use MOM_diag_mediator, only : time_type, diag_ctrl
use MOM_error_handler, only : MOM_error, FATAL, WARNING
diff --git a/src/tracer/MOM_tracer_hor_diff.F90 b/src/tracer/MOM_tracer_hor_diff.F90
index 9a10826627..3e8429f884 100644
--- a/src/tracer/MOM_tracer_hor_diff.F90
+++ b/src/tracer/MOM_tracer_hor_diff.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Main routine for lateral (along surface or neutral) diffusion of tracers
module MOM_tracer_hor_diff
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_cpu_clock, only : cpu_clock_id, cpu_clock_begin, cpu_clock_end
use MOM_cpu_clock, only : CLOCK_MODULE, CLOCK_ROUTINE
use MOM_diag_mediator, only : post_data, diag_ctrl
diff --git a/src/tracer/MOM_tracer_registry.F90 b/src/tracer/MOM_tracer_registry.F90
index c7a672c402..50220be343 100644
--- a/src/tracer/MOM_tracer_registry.F90
+++ b/src/tracer/MOM_tracer_registry.F90
@@ -1,11 +1,13 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module contains subroutines that handle registration of tracers
!! and related subroutines. The primary subroutine, register_tracer, is
!! called to indicate the tracers advected and diffused.
!! It also makes public the types defined in MOM_tracer_types.
module MOM_tracer_registry
-! This file is part of MOM6. See LICENSE.md for the license.
-
! use MOM_diag_mediator, only : diag_ctrl
use MOM_coms, only : reproducing_sum
use MOM_debugging, only : hchksum
diff --git a/src/tracer/MOM_tracer_types.F90 b/src/tracer/MOM_tracer_types.F90
index 5bc7c7eda3..730a453695 100644
--- a/src/tracer/MOM_tracer_types.F90
+++ b/src/tracer/MOM_tracer_types.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module contains the tracer_type and tracer_registry_type
module MOM_tracer_types
diff --git a/src/tracer/RGC_tracer.F90 b/src/tracer/RGC_tracer.F90
index b276b94fec..7f15d0ba1b 100644
--- a/src/tracer/RGC_tracer.F90
+++ b/src/tracer/RGC_tracer.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This module contains the routines used to set up a
!! dynamically passive tracer.
!! Set up and use passive tracers requires the following:
@@ -11,8 +15,6 @@
module RGC_tracer
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_diag_mediator, only : diag_ctrl
use MOM_error_handler, only : MOM_error, FATAL, WARNING
use MOM_file_parser, only : get_param, log_param, log_version, param_file_type
diff --git a/src/tracer/advection_test_tracer.F90 b/src/tracer/advection_test_tracer.F90
index 90a377de79..7a20967777 100644
--- a/src/tracer/advection_test_tracer.F90
+++ b/src/tracer/advection_test_tracer.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This tracer package is used to test advection schemes
module advection_test_tracer
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms, only : EFP_type
use MOM_coupler_types, only : set_coupler_type_data, atmos_ocn_coupler_flux
use MOM_diag_mediator, only : diag_ctrl
diff --git a/src/tracer/boundary_impulse_tracer.F90 b/src/tracer/boundary_impulse_tracer.F90
index 0698d7f9cc..6dd5127d94 100644
--- a/src/tracer/boundary_impulse_tracer.F90
+++ b/src/tracer/boundary_impulse_tracer.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Implements a boundary impulse response tracer to calculate Green's functions
module boundary_impulse_tracer
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms, only : EFP_type
use MOM_coupler_types, only : set_coupler_type_data, atmos_ocn_coupler_flux
use MOM_diag_mediator, only : diag_ctrl
diff --git a/src/tracer/dye_example.F90 b/src/tracer/dye_example.F90
index c1146e19f9..dbff568937 100644
--- a/src/tracer/dye_example.F90
+++ b/src/tracer/dye_example.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A tracer package for using dyes to diagnose regional flows.
module regional_dyes
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms, only : EFP_type
use MOM_coupler_types, only : set_coupler_type_data, atmos_ocn_coupler_flux
use MOM_diag_mediator, only : diag_ctrl
diff --git a/src/tracer/dyed_obc_tracer.F90 b/src/tracer/dyed_obc_tracer.F90
index 1e113f0fc5..1e1b391964 100644
--- a/src/tracer/dyed_obc_tracer.F90
+++ b/src/tracer/dyed_obc_tracer.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> This tracer package dyes flow through open boundaries
module dyed_obc_tracer
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coupler_types, only : atmos_ocn_coupler_flux
use MOM_diag_mediator, only : diag_ctrl
use MOM_error_handler, only : MOM_error, FATAL, WARNING
diff --git a/src/tracer/ideal_age_example.F90 b/src/tracer/ideal_age_example.F90
index 147c48eebd..dca68c724d 100644
--- a/src/tracer/ideal_age_example.F90
+++ b/src/tracer/ideal_age_example.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A tracer package of ideal age tracers
module ideal_age_example
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms, only : EFP_type
use MOM_coupler_types, only : set_coupler_type_data, atmos_ocn_coupler_flux
use MOM_diag_mediator, only : diag_ctrl
diff --git a/src/tracer/nw2_tracers.F90 b/src/tracer/nw2_tracers.F90
index f93c6d4c69..b8dcb61326 100644
--- a/src/tracer/nw2_tracers.F90
+++ b/src/tracer/nw2_tracers.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Ideal tracers designed to help diagnose a tracer diffusivity tensor in NeverWorld2
module nw2_tracers
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_diag_mediator, only : diag_ctrl
use MOM_error_handler, only : MOM_error, FATAL, WARNING
use MOM_file_parser, only : get_param, log_param, log_version, param_file_type
diff --git a/src/tracer/oil_tracer.F90 b/src/tracer/oil_tracer.F90
index 7a119d308c..9f6e263974 100644
--- a/src/tracer/oil_tracer.F90
+++ b/src/tracer/oil_tracer.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A tracer package to mimic dissolved oil.
module oil_tracer
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms, only : EFP_type
use MOM_coupler_types, only : set_coupler_type_data, atmos_ocn_coupler_flux
use MOM_diag_mediator, only : diag_ctrl
diff --git a/src/tracer/pseudo_salt_tracer.F90 b/src/tracer/pseudo_salt_tracer.F90
index b737dba5b7..4be887940a 100644
--- a/src/tracer/pseudo_salt_tracer.F90
+++ b/src/tracer/pseudo_salt_tracer.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A tracer package that mimics salinity
module pseudo_salt_tracer
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms, only : EFP_type
use MOM_debugging, only : hchksum
use MOM_diag_mediator, only : post_data, register_diag_field, safe_alloc_ptr
diff --git a/src/tracer/tracer_example.F90 b/src/tracer/tracer_example.F90
index 7026670245..14011d16b9 100644
--- a/src/tracer/tracer_example.F90
+++ b/src/tracer/tracer_example.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A sample tracer package that has striped initial conditions
module USER_tracer_example
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms, only : EFP_type
use MOM_coupler_types, only : set_coupler_type_data, atmos_ocn_coupler_flux
use MOM_diag_mediator, only : diag_ctrl
diff --git a/src/user/BFB_initialization.F90 b/src/user/BFB_initialization.F90
index 67381bfdc5..34b128522e 100644
--- a/src/user/BFB_initialization.F90
+++ b/src/user/BFB_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Initialization of the boundary-forced-basing configuration
module BFB_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, is_root_pe
use MOM_file_parser, only : get_param, log_version, param_file_type
use MOM_get_input, only : directories
diff --git a/src/user/BFB_surface_forcing.F90 b/src/user/BFB_surface_forcing.F90
index fcbd66e1d8..fb4e87f51d 100644
--- a/src/user/BFB_surface_forcing.F90
+++ b/src/user/BFB_surface_forcing.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Surface forcing for the boundary-forced-basin (BFB) configuration
module BFB_surface_forcing
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_diag_mediator, only : post_data, query_averaging_enabled
use MOM_diag_mediator, only : register_diag_field, diag_ctrl
use MOM_domains, only : pass_var, pass_vector, AGRID
diff --git a/src/user/DOME2d_initialization.F90 b/src/user/DOME2d_initialization.F90
index 3903290212..96cb779eb5 100644
--- a/src/user/DOME2d_initialization.F90
+++ b/src/user/DOME2d_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Initialization of the 2D DOME experiment with density water initialized on a coastal shelf.
module DOME2d_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_ALE_sponge, only : ALE_sponge_CS, set_up_ALE_sponge_field, initialize_ALE_sponge
use MOM_dyn_horgrid, only : dyn_horgrid_type
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL
diff --git a/src/user/DOME_initialization.F90 b/src/user/DOME_initialization.F90
index 229ab2785d..d7e6c1cd6a 100644
--- a/src/user/DOME_initialization.F90
+++ b/src/user/DOME_initialization.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Configures the model for the "DOME" experiment.
!! DOME = Dynamics of Overflows and Mixing Experiment
module DOME_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_sponge, only : sponge_CS, set_up_sponge_field, initialize_sponge
use MOM_dyn_horgrid, only : dyn_horgrid_type
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, WARNING, is_root_pe
diff --git a/src/user/ISOMIP_initialization.F90 b/src/user/ISOMIP_initialization.F90
index 4bf7931856..e93d0604f0 100644
--- a/src/user/ISOMIP_initialization.F90
+++ b/src/user/ISOMIP_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Configures the ISOMIP test case.
module ISOMIP_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_ALE_sponge, only : ALE_sponge_CS, set_up_ALE_sponge_field, initialize_ALE_sponge
use MOM_sponge, only : sponge_CS, set_up_sponge_field, initialize_sponge
use MOM_dyn_horgrid, only : dyn_horgrid_type
diff --git a/src/user/Idealized_Hurricane.F90 b/src/user/Idealized_Hurricane.F90
index 635f94d940..fe37fd4e67 100644
--- a/src/user/Idealized_Hurricane.F90
+++ b/src/user/Idealized_Hurricane.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Forcing for the idealized hurricane and SCM_idealized_hurricane examples.
module Idealized_hurricane
-! This file is part of MOM6. See LICENSE.md for the license.
-
! History
!--------
! November 2014: Origination.
diff --git a/src/user/Kelvin_initialization.F90 b/src/user/Kelvin_initialization.F90
index d8dbab62af..bbd6ffa4a5 100644
--- a/src/user/Kelvin_initialization.F90
+++ b/src/user/Kelvin_initialization.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Configures the model for the Kelvin wave experiment.
!!
!! Kelvin = coastally-trapped Kelvin waves from the ROMS examples.
@@ -5,8 +9,6 @@
!! radiate out at the east.
module Kelvin_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_dyn_horgrid, only : dyn_horgrid_type
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, WARNING, is_root_pe
use MOM_file_parser, only : get_param, log_version, param_file_type
diff --git a/src/user/MOM_controlled_forcing.F90 b/src/user/MOM_controlled_forcing.F90
index cd7389b961..68e2eb4265 100644
--- a/src/user/MOM_controlled_forcing.F90
+++ b/src/user/MOM_controlled_forcing.F90
@@ -1,3 +1,7 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Use control-theory to adjust the surface heat flux and precipitation.
!!
!! Adjustments are based on the time-mean or periodically (seasonally) varying
@@ -6,8 +10,6 @@
!! The techniques behind this are described in Hallberg and Adcroft (2018, in prep.).
module MOM_controlled_forcing
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_diag_mediator, only : post_data, query_averaging_enabled, enable_averages, disable_averaging
use MOM_diag_mediator, only : register_diag_field, diag_ctrl, safe_alloc_ptr
use MOM_domains, only : pass_var, pass_vector, AGRID, To_South, To_West, To_All
diff --git a/src/user/MOM_wave_interface.F90 b/src/user/MOM_wave_interface.F90
index bbb3b6ce83..d7ce6cb95e 100644
--- a/src/user/MOM_wave_interface.F90
+++ b/src/user/MOM_wave_interface.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Interface for surface waves
module MOM_wave_interface
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_data_override, only : data_override_init, data_override
use MOM_diag_mediator, only : post_data, register_diag_field, safe_alloc_alloc
use MOM_diag_mediator, only : diag_ctrl
diff --git a/src/user/Neverworld_initialization.F90 b/src/user/Neverworld_initialization.F90
index ba8263ca1c..c67237a048 100644
--- a/src/user/Neverworld_initialization.F90
+++ b/src/user/Neverworld_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Initialization for the "Neverworld" configuration
module Neverworld_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_sponge, only : sponge_CS, set_up_sponge_field, initialize_sponge
use MOM_dyn_horgrid, only : dyn_horgrid_type
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, is_root_pe
diff --git a/src/user/Phillips_initialization.F90 b/src/user/Phillips_initialization.F90
index 4a115031e1..3b20be4f34 100644
--- a/src/user/Phillips_initialization.F90
+++ b/src/user/Phillips_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Initialization for the "Phillips" channel configuration
module Phillips_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, is_root_pe
use MOM_dyn_horgrid, only : dyn_horgrid_type
use MOM_file_parser, only : get_param, log_version, param_file_type
diff --git a/src/user/RGC_initialization.F90 b/src/user/RGC_initialization.F90
index 95fe3bf35f..418f739242 100644
--- a/src/user/RGC_initialization.F90
+++ b/src/user/RGC_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Configures the models sponges for the Rotating Gravity Current (RGC) experiment.
module RGC_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
!***********************************************************************
!* By Elizabeth Yankovsky, May 2018 *
!***********************************************************************
diff --git a/src/user/Rossby_front_2d_initialization.F90 b/src/user/Rossby_front_2d_initialization.F90
index 05a223cfb9..ffc7610391 100644
--- a/src/user/Rossby_front_2d_initialization.F90
+++ b/src/user/Rossby_front_2d_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Initial conditions for the 2D Rossby front test
module Rossby_front_2d_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, is_root_pe
use MOM_file_parser, only : get_param, log_version, param_file_type
use MOM_get_input, only : directories
diff --git a/src/user/SCM_CVMix_tests.F90 b/src/user/SCM_CVMix_tests.F90
index def4c59568..dc026b5a38 100644
--- a/src/user/SCM_CVMix_tests.F90
+++ b/src/user/SCM_CVMix_tests.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Initial conditions and forcing for the single column model (SCM) CVMix test set.
module SCM_CVMix_tests
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_domains, only : pass_var, pass_vector, TO_ALL
use MOM_error_handler, only : MOM_error, FATAL
use MOM_file_parser, only : get_param, log_version, param_file_type
diff --git a/src/user/adjustment_initialization.F90 b/src/user/adjustment_initialization.F90
index 4a1d6c3d9f..5e60f33057 100644
--- a/src/user/adjustment_initialization.F90
+++ b/src/user/adjustment_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Configures the model for the geostrophic adjustment test case.
module adjustment_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, is_root_pe
use MOM_file_parser, only : get_param, log_param, log_version, param_file_type
use MOM_get_input, only : directories
diff --git a/src/user/baroclinic_zone_initialization.F90 b/src/user/baroclinic_zone_initialization.F90
index e2c6182231..f50c103583 100644
--- a/src/user/baroclinic_zone_initialization.F90
+++ b/src/user/baroclinic_zone_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Initial conditions for an idealized baroclinic zone
module baroclinic_zone_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_file_parser, only : get_param, log_version, param_file_type
use MOM_file_parser, only : openParameterBlock, closeParameterBlock
use MOM_grid, only : ocean_grid_type
diff --git a/src/user/basin_builder.F90 b/src/user/basin_builder.F90
index 721b0b33cc..67afd0e6ba 100644
--- a/src/user/basin_builder.F90
+++ b/src/user/basin_builder.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> An idealized topography building system
module basin_builder
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_dyn_horgrid, only : dyn_horgrid_type
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, is_root_pe
use MOM_file_parser, only : get_param, log_version, param_file_type
diff --git a/src/user/benchmark_initialization.F90 b/src/user/benchmark_initialization.F90
index 333f53895e..6685c75305 100644
--- a/src/user/benchmark_initialization.F90
+++ b/src/user/benchmark_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Initialization for the "bench mark" configuration
module benchmark_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_sponge, only : sponge_CS, set_up_sponge_field, initialize_sponge
use MOM_dyn_horgrid, only : dyn_horgrid_type
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, is_root_pe
diff --git a/src/user/circle_obcs_initialization.F90 b/src/user/circle_obcs_initialization.F90
index 98b5bd4705..26e26d0a44 100644
--- a/src/user/circle_obcs_initialization.F90
+++ b/src/user/circle_obcs_initialization.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Configures the model for the "circle_obcs" experiment which tests
!! Open Boundary Conditions radiating an SSH anomaly.
module circle_obcs_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_sponge, only : sponge_CS, set_up_sponge_field, initialize_sponge
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, is_root_pe
use MOM_file_parser, only : get_param, log_version, param_file_type
diff --git a/src/user/dense_water_initialization.F90 b/src/user/dense_water_initialization.F90
index fbff153e23..c8ee29f8f4 100644
--- a/src/user/dense_water_initialization.F90
+++ b/src/user/dense_water_initialization.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Initialization routines for the dense water formation
!! and overflow experiment.
module dense_water_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_ALE_sponge, only : ALE_sponge_CS, set_up_ALE_sponge_field, initialize_ALE_sponge
use MOM_dyn_horgrid, only : dyn_horgrid_type
use MOM_EOS, only : EOS_type
diff --git a/src/user/dumbbell_initialization.F90 b/src/user/dumbbell_initialization.F90
index 04af1d2d5b..df286716f0 100644
--- a/src/user/dumbbell_initialization.F90
+++ b/src/user/dumbbell_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Configures the model for the idealized dumbbell test case.
module dumbbell_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_domains, only : sum_across_PEs
use MOM_dyn_horgrid, only : dyn_horgrid_type
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, is_root_pe
diff --git a/src/user/dumbbell_surface_forcing.F90 b/src/user/dumbbell_surface_forcing.F90
index 288ccd89fa..2b09631151 100644
--- a/src/user/dumbbell_surface_forcing.F90
+++ b/src/user/dumbbell_surface_forcing.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Surface forcing for the dumbbell test case
module dumbbell_surface_forcing
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_diag_mediator, only : post_data, query_averaging_enabled
use MOM_diag_mediator, only : register_diag_field, diag_ctrl
use MOM_domains, only : pass_var, pass_vector, AGRID
diff --git a/src/user/dyed_channel_initialization.F90 b/src/user/dyed_channel_initialization.F90
index c4cf25281f..b61b9242b6 100644
--- a/src/user/dyed_channel_initialization.F90
+++ b/src/user/dyed_channel_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Initialization for the dyed_channel configuration
module dyed_channel_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_dyn_horgrid, only : dyn_horgrid_type
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, WARNING, is_root_pe
use MOM_file_parser, only : get_param, log_version, param_file_type
diff --git a/src/user/dyed_obcs_initialization.F90 b/src/user/dyed_obcs_initialization.F90
index ffa217e0b5..f298c6eefb 100644
--- a/src/user/dyed_obcs_initialization.F90
+++ b/src/user/dyed_obcs_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Dyed open boundary conditions; OBC_USER_CONFIG="dyed_obcs"
module dyed_obcs_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_dyn_horgrid, only : dyn_horgrid_type
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, WARNING, is_root_pe
use MOM_file_parser, only : get_param, log_version, param_file_type
diff --git a/src/user/external_gwave_initialization.F90 b/src/user/external_gwave_initialization.F90
index 437edc49b2..552abe2f66 100644
--- a/src/user/external_gwave_initialization.F90
+++ b/src/user/external_gwave_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Initialization for the "external gravity wave wave" configuration
module external_gwave_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, is_root_pe
use MOM_file_parser, only : get_param, log_version, param_file_type
use MOM_get_input, only : directories
diff --git a/src/user/lock_exchange_initialization.F90 b/src/user/lock_exchange_initialization.F90
index ab08d4068d..8f2297c730 100644
--- a/src/user/lock_exchange_initialization.F90
+++ b/src/user/lock_exchange_initialization.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Initialization of the "lock exchange" experiment.
!! lock_exchange = A 2-d density driven hydraulic exchange flow.
module lock_exchange_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, is_root_pe
use MOM_file_parser, only : get_param, log_version, param_file_type
use MOM_get_input, only : directories
diff --git a/src/user/seamount_initialization.F90 b/src/user/seamount_initialization.F90
index 59709ecde7..77556f123a 100644
--- a/src/user/seamount_initialization.F90
+++ b/src/user/seamount_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Configures the model for the idealized seamount test case.
module seamount_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_domains, only : sum_across_PEs
use MOM_dyn_horgrid, only : dyn_horgrid_type
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, is_root_pe
diff --git a/src/user/shelfwave_initialization.F90 b/src/user/shelfwave_initialization.F90
index 93ed4b2c87..3360b29a1d 100644
--- a/src/user/shelfwave_initialization.F90
+++ b/src/user/shelfwave_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Configures the model for the idealized shelfwave test case.
module shelfwave_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_domains, only : sum_across_PEs
use MOM_dyn_horgrid, only : dyn_horgrid_type
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, WARNING, is_root_pe
diff --git a/src/user/sloshing_initialization.F90 b/src/user/sloshing_initialization.F90
index 4381d42038..3fef6fd4e4 100644
--- a/src/user/sloshing_initialization.F90
+++ b/src/user/sloshing_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Initialization for the "sloshing" internal waves configuration.
module sloshing_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_domains, only : sum_across_PEs
use MOM_dyn_horgrid, only : dyn_horgrid_type
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, is_root_pe
diff --git a/src/user/soliton_initialization.F90 b/src/user/soliton_initialization.F90
index a734574995..569d6904aa 100644
--- a/src/user/soliton_initialization.F90
+++ b/src/user/soliton_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Initial conditions for the Equatorial Rossby soliton test (Boyd).
module soliton_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, is_root_pe
use MOM_file_parser, only : get_param, log_version, param_file_type
use MOM_get_input, only : directories
diff --git a/src/user/supercritical_initialization.F90 b/src/user/supercritical_initialization.F90
index 4d4bd68f84..526e3a8a10 100644
--- a/src/user/supercritical_initialization.F90
+++ b/src/user/supercritical_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> The "super critical" configuration
module supercritical_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_dyn_horgrid, only : dyn_horgrid_type
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, is_root_pe
use MOM_file_parser, only : get_param, log_version, param_file_type
diff --git a/src/user/tidal_bay_initialization.F90 b/src/user/tidal_bay_initialization.F90
index 24aefe2bb1..abd60c53ff 100644
--- a/src/user/tidal_bay_initialization.F90
+++ b/src/user/tidal_bay_initialization.F90
@@ -1,9 +1,11 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Configures the model for the "tidal_bay" experiment.
!! tidal_bay = Tidally resonant bay from Zygmunt Kowalik's class on tides.
module tidal_bay_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_coms, only : reproducing_sum
use MOM_dyn_horgrid, only : dyn_horgrid_type
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, WARNING, is_root_pe
diff --git a/src/user/user_change_diffusivity.F90 b/src/user/user_change_diffusivity.F90
index 1a1881a42b..fcd94442a3 100644
--- a/src/user/user_change_diffusivity.F90
+++ b/src/user/user_change_diffusivity.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Increments the diapycnal diffusivity in a specified band of latitudes and densities.
module user_change_diffusivity
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_diag_mediator, only : diag_ctrl, time_type
use MOM_error_handler, only : MOM_error, is_root_pe, FATAL, WARNING, NOTE
use MOM_file_parser, only : get_param, log_version, param_file_type
diff --git a/src/user/user_initialization.F90 b/src/user/user_initialization.F90
index 207f009c9c..390b42bd84 100644
--- a/src/user/user_initialization.F90
+++ b/src/user/user_initialization.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> A template of a user to code up customized initial conditions.
module user_initialization
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_error_handler, only : MOM_mesg, MOM_error, FATAL, is_root_pe
use MOM_dyn_horgrid, only : dyn_horgrid_type
use MOM_file_parser, only : get_param, log_version, param_file_type
diff --git a/src/user/user_revise_forcing.F90 b/src/user/user_revise_forcing.F90
index ce767d7479..db0df72f19 100644
--- a/src/user/user_revise_forcing.F90
+++ b/src/user/user_revise_forcing.F90
@@ -1,8 +1,10 @@
+! This file is part of MOM6, the Modular Ocean Model version 6.
+! See the LICENSE file for licensing information.
+! SPDX-License-Identifier: Apache-2.0
+
!> Provides a template for users to code updating the forcing fluxes.
module user_revise_forcing
-! This file is part of MOM6. See LICENSE.md for the license.
-
use MOM_domains, only : pass_var, pass_vector, AGRID
use MOM_error_handler, only : MOM_error, FATAL, WARNING, is_root_pe
use MOM_file_parser, only : get_param, log_version, param_file_type