Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Radiation analysis fix #5

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
36f686c
Pushing build info
aradhakrishnanGFDL Jul 11, 2018
b99a3d4
Update and rename README.AM4_build to AM4_build.README
aradhakrishnanGFDL Jul 11, 2018
12da051
Rename AM4_build.README to README_AM4_build.md
aradhakrishnanGFDL Jul 11, 2018
c4e3b40
Update README.md
aradhakrishnanGFDL Jul 11, 2018
72d126a
Update README.md
aradhakrishnanGFDL Jul 11, 2018
c30a18a
Correct errors in the compile script
underwoo Jul 11, 2018
b022dfc
Add Makefiles for components
underwoo Jul 11, 2018
16ff65c
adding runscript from T.Robinson
aradhakrishnanGFDL Jul 13, 2018
8ce3a38
Update README.md
aradhakrishnanGFDL Jul 13, 2018
329a855
Update README.md
aradhakrishnanGFDL Jul 13, 2018
1ae9c0a
Updated CPP macros to allow compile to complete
underwoo Jul 17, 2018
a86b84b
Merge branch addBuild from aradhakrishnanGFDL/AM4 into addBuild
underwoo Jul 17, 2018
8b94a16
Update Makefile to not pass OPENMP to ocean
underwoo Jul 24, 2018
f74a81e
Add missing -fp-model source option to make template
underwoo Jul 24, 2018
55879a8
Changed total_npes to match settings in the sample input files
underwoo Jul 24, 2018
c0bd3e2
Update README.md
underwoo Jul 24, 2018
ecc2412
README add links to submodule repositories
underwoo Jul 24, 2018
37843c2
Correct spelling in README.md
underwoo Jul 24, 2018
ff794bd
Remove build directory
underwoo Jul 24, 2018
e05e570
Add git hashes for GFDL internal git repos
underwoo Jul 25, 2018
f74c565
Merge pull request #1 from underwoo/addBuild
aradhakrishnanGFDL Jul 25, 2018
1859a6f
Update README.md
aradhakrishnanGFDL Jul 25, 2018
2c9507f
Update README.md
aradhakrishnanGFDL Jul 25, 2018
64ed75f
Update README.md
aradhakrishnanGFDL Jul 25, 2018
6a7dba8
a set of cells seemed to be missing here. Just putting it back
aradhakrishnanGFDL Jul 26, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
*~
*.o
*.mod
*.DO_NOT_MODIFY.f90
*.x
179 changes: 143 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,122 @@
# AM4 Instructions

To checkout the source code for the AM4 model, use the following git command <br>

```
git clone -r https://github.com/NOAA-GFDL/AM4.git
```

# Source Code
# GFDL AM4 Model

[![DOI](https://zenodo.org/badge/102487636.svg)](https://zenodo.org/badge/latestdoi/102487636)

The source code is located in the src directory. This repository contains the code for the following
folders:
This repository includes the public release of the GFDL AM4 model
code. The AM4 model is described in the
[two](https://doi.org/10.1002/2017MS001208)
[articles](https://doi.org/10.1002/2017MS001209) published in the
[Journal of Advances in Modeling Earth Systems
(JAMES)](https://agupubs.onlinelibrary.wiley.com/journal/19422466).
More information on the model and access to the output is available on
the [AM4 data and code
site](http://data1.gfdl.noaa.gov/nomads/forms/am4.0/) at the
[Geophysical Fluid Dynamics Laboratory
(GFDL)](https://www.gfdl.noaa.gov).

The layout of this package includes the following directories:

* src - The source code for the AM4 model
* exec - The build directory with Makefiles for building the model executable
* run - Sample run script
* analysis - Sample analysis scripts

## Cloning Instructions

This repository uses [git
submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to
point to other repositories. Thus, care should be taken when cloning,
and updating the source to ensure all source. To obtain all source,
use the following git command

* atmos_cubed_sphere
* atmos_drivers
* atmos_param
* atmos_shared
* ice_param
* ice_sis
* land_lad2
```
git clone --recursive https://github.com/NOAA-GFDL/AM4.git
```

The following folders are available on github and are linked as git submodules
The `--recursive` option to `git clone` instructs git to recursively
clone all submodules. In the event the repository was not cloned
using the `--recursive` option, the following step must be taken to
obtain all sources:

* MOM6
* coupler
* shared
```
# From within the AM4 parent directory
git submodule update --init --recursive
```

# Analysis Scripts
Some of the climate analysis scripts run at NOAA GFDL and used in the AM4 documentation papers are located in the analysis directory.
Within each analysis suite, there is a jupyter notebook, both readable and runnable from your local jupyter environment, provided all dependencies are installed.
## Source Code

All model source is contained in the [src](src) directory. GFDL
tracks code using the git version control system. This package
includes a single version of the following GFDL model components. The
git hash listed corresponds to the commit hash in the internal GFDL
git repository.

Component | Commit Hash
--------- | -----------
atmos_cubed_sphere | b8b05bf650c0d3293b538bdaceb894ba0fd6910b
atmos_drivers | 5ee95d6abf0879594551dd7e6635dff4004c4010
atmos_param | 2e94acfd8621e85216bf822c395a8c3f15a511a5
atmos_shared | a557d4d7bab033ef1ad1d400a62fe07a97ccb477
ice_param | 1553c8bc4f9a66791c89367b6f327147523155ed
ice_sis | ccc7328dcd79706dd5c17c8bab660222886fc80b
land_lad2 | a220288ecb289bf9d793d051fc5076072874ce07

The following components are available in the
[NOAA-GFDL](https://github.com/NOAA-GFDL) github organization:

* [MOM6](https://github.com/NOAA-GFDL/MOM6)
* [coupler](https://github.com/NOAA-GFDL/coupler)
* [FMS](https://github.com/NOAA-GFDL/FMS) (as [shared](src/shared))

## Building AM4

The [exec](exec) directory contains Makefiles that can be used to
build the AM4 executable. These Makefiles were generated using the
[Make Makefile (mkmf)](https://github.com/NOAA-GFDL/mkmf) program.
Included in the exec direcgtory is a sample make template file for the
Intel compilers ([intel.mk](exec/templates/intel.mk)). This make
template can be used on any system with a relatively recent version of
the Intel compilers, the netCDF 4 library and the MPICH2 MPI library.
Included in the [intel.mk](exec/templates/intel.mk) file are
additional settings that can be modified during the build.

## Obtaining the input data

The input data required for running the AM4 model can be found on
[GFDL's data
portal](http://data1.gfdl.noaa.gov/nomads/forms/am4.0/) .

The file `AM4.tar.gz` contains a configured run directory to run a
sample experiment of the AM4 model. Included in the tar file is a
README.AM4_run with more instructions on how to configure the AM4 run
directory.

## Running AM4

Included in the run directory is a sample run script for reference.
To run the AM4 sample experiment, first download the data file
mentioned in [Obtaining the Input data](#obtaining-the-input-data)
section. Modify the variables in the configuration section in the
sample run script, and then run the script.

The sample data and run script are configured to run on 216
processors. To run on a different number of processors, or modify the
experiment, refer to the `README.AM4_run` file included in the AM4
data tarball.

Note: The `input.nml` file (found in the AM4 data tarball) contains
Fortran namelists and namelist variables that modify, at run time, the
model. To learn more about the settings in the `input.nml` file,
please refer to source code where the namelist/variable are defined.

## Analysis Scripts

Some of the climate analysis scripts run at NOAA GFDL and used in the
AM4 documentation papers are located in the analysis directory.
Within each analysis suite, is a [jupyter
notebook](https://jupyter-notebook.readthedocs.io/en/stable/), both
readable and runnable from your local jupyter environment, provided
all dependencies are installed.

E.g.

Expand All @@ -38,14 +125,34 @@ E.g.
* [Zonal_mean_zonal_wind_stress](analysis/bw/bw_atmos_zm_atl_pac_a1r/bw_atmos_atl_pac.1980-2014.ipynb)
* [PCMDI Metrics Portrait Plot](analysis/pcmdimetrics/portraitPlot-AM4.AMIP.ipynb)

Please refer https://www.gfdl.noaa.gov/am4.0-model for details about where to find model and OBS data used in the papers.

For all analysis figures and pertaining data, please use the AM4 documentation papers as the original reference.
Please direct your questions and feedback to [email protected]


# Disclaimer

The United States Department of Commerce (DOC) GitHub project code is provided on an 'as is' basis and the user assumes responsibility for its use. DOC has relinquished control of the information and no longer has responsibility to protect the integrity, confidentiality, or availability of the information. Any claims against the Department of Commerce stemming from the use of its GitHub project will be governed by all applicable Federal law. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by the Department of Commerce. The Department of Commerce seal and logo, or the seal and logo of a DOC bureau, shall not be used in any manner to imply endorsement of any commercial product or activity by DOC or the United States Government.

This project code is made available through GitHub but is managed by NOAA-GFDL at https://gitlab.gfdl.noaa.gov.
## Model output and Other References

Please refer to the [AM4 data and code
site](http://data1.gfdl.noaa.gov/nomads/forms/am4.0/) for details
about where to find model and OBS data used in the papers.

For all analysis figures and pertaining data, please use the AM4
documentation papers as the original reference.

Please direct your questions and feedback to
[email protected]

## Disclaimer

The United States Department of Commerce (DOC) GitHub project code is
provided on an 'as is' basis and the user assumes responsibility for
its use. DOC has relinquished control of the information and no
longer has responsibility to protect the integrity, confidentiality,
or availability of the information. Any claims against the Department
of Commerce stemming from the use of its GitHub project will be
governed by all applicable Federal law. Any reference to specific
commercial products, processes, or services by service mark,
trademark, manufacturer, or otherwise, does not constitute or imply
their endorsement, recommendation or favoring by the Department of
Commerce. The Department of Commerce seal and logo, or the seal and
logo of a DOC bureau, shall not be used in any manner to imply
endorsement of any commercial product or activity by DOC or the United
States Government.

This project code is made available through GitHub but is managed by
NOAA-GFDL at https://gitlab.gfdl.noaa.gov.
40 changes: 40 additions & 0 deletions analysis/cjs1/radiation_atmos_av_mon/radiation_atmos_av_mon.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,46 @@
"platform = 'desktop' "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"####### load modules ###########\n",
"TMPDIR = os.environ[\"TMPDIR\"]\n",
"FRE_CODE_BASE = BASEDIR\n",
"PACKAGE_NAME = 'radiation_atmos_av_mon'\n",
"if not os.path.exists(TMPDIR):\n",
" os.makedirs(TMPDIR)\n",
"if not os.path.exists(out_dir):\n",
" os.makedirs(out_dir) \n",
"if ( platform == 'hpcs-csc' ) or ( platform == 'desktop'):\n",
" print(\"Running script on non-GFDL machine and public repo: skip module load\") \n",
"else:\n",
" print \"ERROR: invalid platform: %s\" % platform\n",
" exit(1)\n",
"\n",
"#---- Check if environment loaded correctly ---#\n",
"\n",
"###################\n",
"# run the script\n",
"##################\n",
"\n",
"\n",
"options = \"-i \"+in_data_dir+\" -d \"+descriptor+\" -y \"+yr1+\",\"+yr2+\" -o \"+out_dir\n",
"\n",
"command = FRE_CODE_BASE+\"/\"+PACKAGE_NAME+\"/radiation_atmos_av_mon.csh \"+options+\" \"+in_data_file\n",
"\n",
"print(command)\n",
"\n",
"cmd = subprocess.Popen('tcsh -c \"'+command+'\"',shell=True,stdout=PIPE,stdin=PIPE, stderr=PIPE)\n",
"output, errors = cmd.communicate()\n",
"#print output, errors "
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down
56 changes: 56 additions & 0 deletions exec/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Makefile for Experiment 'cm4p12_warsaw'

BUILDROOT = $(dir $(abspath $(firstword $(MAKEFILE_LIST))))
SRCROOT = $(abspath $(BUILDROOT)../src)/ # Final '/' added to denote directory

MK_TEMPLATE = $(BUILDROOT)templates/intel.mk

# Override default compile options. See templates/intel.mk for more compile options.
# BLD_TYPE configures the type of build, PROD (production), REPRO (regression) or
# DEBUG (debug options)
BLD_TYPE = PROD
OPENMP = t # Build with OpenMP enabled

include $(MK_TEMPLATE)

SUBMAKEFLAGS = BUILDROOT=$(BUILDROOT) SRCROOT=$(SRCROOT) MK_TEMPLATE=$(MK_TEMPLATE) BLD_TYPE=$(BLD_TYPE)

fms_cm4p12_warsaw.x: coupler/libcoupler.a ice_sis/libice_sis.a atmos_dyn/libatmos_dyn.a land_lad2/libland_lad2.a atmos_phys/libatmos_phys.a mom6/libmom6.a fms/libfms.a
$(LD) $^ $(LDFLAGS) -o $@ $(STATIC_LIBS)

fms/libfms.a: FORCE
$(MAKE) $(SUBMAKEFLAGS) OPENMP=$(OPENMP) --directory=$(BUILDROOT)fms $(@F)

atmos_phys/libatmos_phys.a: fms/libfms.a FORCE
$(MAKE) $(SUBMAKEFLAGS) OPENMP=$(OPENMP) --directory=$(BUILDROOT)atmos_phys $(@F)

atmos_dyn/libatmos_dyn.a: atmos_phys/libatmos_phys.a fms/libfms.a FORCE
$(MAKE) $(SUBMAKEFLAGS) OPENMP=$(OPENMP) --directory=$(BUILDROOT)atmos_dyn $(@F)

ice_sis/libice_sis.a: mom6/libmom6.a fms/libfms.a FORCE
$(MAKE) $(SUBMAKEFLAGS) OPENMP=$(OPENMP) --directory=$(BUILDROOT)ice_sis $(@F)

land_lad2/libland_lad2.a: fms/libfms.a FORCE
$(MAKE) $(SUBMAKEFLAGS) OPENMP=$(OPENMP) --directory=$(BUILDROOT)land_lad2 $(@F)

# MOM6 is currently unable to run with OpenMP enabled
mom6/libmom6.a: fms/libfms.a FORCE
$(MAKE) $(SUBMAKEFLAGS) --directory=$(BUILDROOT)mom6 $(@F)

coupler/libcoupler.a: atmos_dyn/libatmos_dyn.a ice_sis/libice_sis.a atmos_phys/libatmos_phys.a mom6/libmom6.a land_lad2/libland_lad2.a fms/libfms.a FORCE
$(MAKE) $(SUBMAKEFLAGS) OPENMP=$(OPENMP) --directory=$(BUILDROOT)coupler $(@F)

FORCE:

clean:
$(MAKE) --directory=$(BUILDROOT)fms clean
$(MAKE) --directory=$(BUILDROOT)atmos_phys clean
$(MAKE) --directory=$(BUILDROOT)atmos_dyn clean
$(MAKE) --directory=$(BUILDROOT)ice_sis clean
$(MAKE) --directory=$(BUILDROOT)land_lad2 clean
$(MAKE) --directory=$(BUILDROOT)mom6 clean
$(MAKE) --directory=$(BUILDROOT)coupler clean

clean_all: clean
$(RM) *.x

Loading