From 0336fa35355aa002b13264589908cb5b2a2f2923 Mon Sep 17 00:00:00 2001 From: mahf708 Date: Thu, 14 Nov 2024 14:16:07 -0500 Subject: [PATCH 1/4] fix mkdocs typo for eamxx docs --- .github/workflows/eamxx-gh-pages.yml | 4 ++-- components/eamxx/{mkdocs.yaml => mkdocs.yml} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename components/eamxx/{mkdocs.yaml => mkdocs.yml} (100%) diff --git a/.github/workflows/eamxx-gh-pages.yml b/.github/workflows/eamxx-gh-pages.yml index 2e763c544cdd..488c2b11a020 100644 --- a/.github/workflows/eamxx-gh-pages.yml +++ b/.github/workflows/eamxx-gh-pages.yml @@ -9,7 +9,7 @@ on: branches: [ master ] # Only if docs-related files are touched paths: - - components/eamxx/mkdocs.yaml + - components/eamxx/mkdocs.yml - components/eamxx/docs/** - components/eamxx/cime_config/namelist_defaults_scream.xml # Runs every time a PR is open against master @@ -17,7 +17,7 @@ on: branches: [ master ] # Only if docs-related files are touched paths: - - components/eamxx/mkdocs.yaml + - components/eamxx/mkdocs.yml - components/eamxx/docs/** - components/eamxx/cime_config/namelist_defaults_scream.xml diff --git a/components/eamxx/mkdocs.yaml b/components/eamxx/mkdocs.yml similarity index 100% rename from components/eamxx/mkdocs.yaml rename to components/eamxx/mkdocs.yml From 7030371316c8d39e2ced28a8ee5e104dff36b679 Mon Sep 17 00:00:00 2001 From: mahf708 Date: Thu, 14 Nov 2024 14:16:40 -0500 Subject: [PATCH 2/4] add pyscream docs --- components/eamxx/docs/user/pyscream.md | 73 ++++++++++++++++++++++++++ components/eamxx/mkdocs.yml | 1 + 2 files changed, 74 insertions(+) create mode 100644 components/eamxx/docs/user/pyscream.md diff --git a/components/eamxx/docs/user/pyscream.md b/components/eamxx/docs/user/pyscream.md new file mode 100644 index 000000000000..e49993132ac0 --- /dev/null +++ b/components/eamxx/docs/user/pyscream.md @@ -0,0 +1,73 @@ +# PySCREAM + +PySCREAM is currently under heavy development and may contain some +rough edges. If you encounter any issues, please report them on the +team on +[github discussions](https://github.com/E3SM-Project/E3SM/labels/eamxx). +Likewise, if you have questions or would like to request features, +please post them on the +[github discussions](https://github.com/E3SM-Project/E3SM/labels/eamxx). + +## Quick Start + +For now, the only way to use pyscream is to either build it on your own +or use our prebuilt conda binaries. We prefer for you to use the latter. +In a conda environment, please use the following command to install it: + +```bash +conda install -c mahf708 pyscream=0.0.2 +``` + +It is recommended to use the latest version of pyscream, wich is +currently 0.0.2. As you can see, it is a young package with a lot of +potential. We do not guarantee that the API will remain stable, but we +will try to document any changes as frequently as we could. + +## Examples + +We provide an example to demo calling the radiation process (RRTMGP). +More examples are on the way. If you'd like to add your example, +please feel free to submit a PR. + +### RRTMGP + +```python +from mpi4py import MPI +import pyscream + +pyscream.init() + +dt = 1800 +t0_str = "2020-10-10-00000" + +ic_file = "/lcrc/group/e3sm/public_html/inputdata/atm/scream/init/screami_unit_tests_ne2np4L72_20220822.nc" +ncols = 218 +nlevs = 72 +pyscream.create_grids_manager(ncols,nlevs, ic_file) + +rad_dict = { + "column_chunk_size": 123, + "active_gases": ["h2o", "co2", "o3", "n2o", "co" , "ch4", "o2", "n2"], + "orbital_year": 1990, + "log_level": "info", + "do_aerosol_rad": False, + "rrtmgp_coefficients_file_sw": "/lcrc/group/e3sm/data/inputdata/atm/scream/init/rrtmgp-data-sw-g112-210809.nc", + "rrtmgp_coefficients_file_lw": "/lcrc/group/e3sm/data/inputdata/atm/scream/init/rrtmgp-data-lw-g128-210809.nc", + "rrtmgp_cloud_optics_file_sw": "/lcrc/group/e3sm/data/inputdata/atm/scream/init/rrtmgp-cloud-optics-coeffs-sw.nc", + "rrtmgp_cloud_optics_file_lw": "/lcrc/group/e3sm/data/inputdata/atm/scream/init/rrtmgp-cloud-optics-coeffs-lw.nc", +} + +rad = pyscream.AtmProc(rad_dict, 'RRTMGP') +rad.read_ic(ic_file) +rad.initialize(t0_str) + +t = rad.get_field("T_mid") +tm = t.get() + +print(tm[5,5], flush=True) + +rad.run(dt) +rad.run(dt) + +print(tm[5,5], flush=True) +``` diff --git a/components/eamxx/mkdocs.yml b/components/eamxx/mkdocs.yml index 4c82daab1603..b1f5cace0a5c 100644 --- a/components/eamxx/mkdocs.yml +++ b/components/eamxx/mkdocs.yml @@ -12,6 +12,7 @@ nav: - 'COSP': 'user/cosp.md' - 'Regionally Refined EAMxx': 'user/rrm_eamxx.md' - 'Doubly Periodic EAMxx': 'user/dp_eamxx.md' + - 'PySCREAM': 'user/pyscream.md' - 'Developer Guide': - 'Overview': 'developer/index.md' - 'Installation': 'common/installation.md' From 1521a07cf230cefefb68c3e7ff58c6b082be65a0 Mon Sep 17 00:00:00 2001 From: mahf708 Date: Thu, 14 Nov 2024 14:21:27 -0500 Subject: [PATCH 3/4] fix typo in kokkos ekat docs --- components/eamxx/docs/developer/kokkos_ekat.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/eamxx/docs/developer/kokkos_ekat.md b/components/eamxx/docs/developer/kokkos_ekat.md index 2432290a67a0..6ebf23ba1aac 100644 --- a/components/eamxx/docs/developer/kokkos_ekat.md +++ b/components/eamxx/docs/developer/kokkos_ekat.md @@ -56,8 +56,9 @@ where - `DataType`: scalar type of the view, given as `ScalarType`+`*`(x's number of run-time dimensions). E.g., a 2D view of doubles will have `DataType = double**`. There is also an ability to define compile-time dimensions by - using `[]`, see [Kokkos wiki section on views]( - wiki/API/core/view/view.html). + using `[]`, see + [Kokkos wiki section on views] + ( Date: Thu, 14 Nov 2024 17:31:15 -0600 Subject: [PATCH 4/4] Fix typos and add links Fix some typos. Add links to the otherwise blank user and developer guide main pages. Also change SCREAM to EAMxx in those. --- components/eamxx/docs/developer/index.md | 17 ++++++++++++++++- components/eamxx/docs/developer/processes.md | 2 +- components/eamxx/docs/index.md | 2 +- components/eamxx/docs/user/index.md | 13 ++++++++++++- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/components/eamxx/docs/developer/index.md b/components/eamxx/docs/developer/index.md index 69673b12ebd5..7216d6057cb4 100644 --- a/components/eamxx/docs/developer/index.md +++ b/components/eamxx/docs/developer/index.md @@ -1 +1,16 @@ -# SCREAM Developer Guide +# EAMxx Developer Guide + +### [Installation](../common/installation.md) +### [Style Guide](style_guide.md) +### [Kokkos and EKAT](kokkos_ekat.md) +### [Source Tree](source_tree.md) +### Important Data Structures + * [Fields](field.md) + * [Grids and Remappers](grid.md) + * [Atmosphere Processes](processes.md) + * [Managers](managers.md) +### [I/O](io.md) +### Testing + * [Standalone](standalone_testing.md) + * [Full Model](cime_testing.md) + * [CI and Nightly Testing](ci_nightly.md) diff --git a/components/eamxx/docs/developer/processes.md b/components/eamxx/docs/developer/processes.md index adb90e2dfbcd..a2f2d671e2e6 100644 --- a/components/eamxx/docs/developer/processes.md +++ b/components/eamxx/docs/developer/processes.md @@ -54,7 +54,7 @@ of several steps: - After creating all fields (based on AP's requests), the AD passes a copy of each input and output field to the AP's. These fields will be divided in "required" and "computed", which differ in that the former are only passed - to the AP's as 'read-only' fields (see the [field](field.md#Field) + to the AP's as 'read-only' fields (see the [field](field.md) documentation for more details) - The AP's are queried for how much scratch memory they may need at run time. After all AP's communicate their needs, the AD will provide a pointer to diff --git a/components/eamxx/docs/index.md b/components/eamxx/docs/index.md index d243f3c27560..0f78e45dbd46 100644 --- a/components/eamxx/docs/index.md +++ b/components/eamxx/docs/index.md @@ -1,6 +1,6 @@ # The E3SM Atmosphere Model in C++ (EAMxx) -EAMxx +##EAMxx EAMxx is almost completely different in all ways from the atmosphere model used for E3SM versions 1-3. diff --git a/components/eamxx/docs/user/index.md b/components/eamxx/docs/user/index.md index 2e24e9fa736a..11eb659f3fd4 100644 --- a/components/eamxx/docs/user/index.md +++ b/components/eamxx/docs/user/index.md @@ -1,4 +1,4 @@ -# SCREAM User Guide +# EAMxx User Guide This section contains documentation on how to create, setup, and run CIME cases with EAMxx as the atmosphere component. It is assumed that the reader has a familiarity with [CIME case @@ -8,3 +8,14 @@ that the user knows how to create a case, and what the `case.setup`, `case.build This user guide is still under construction. In the meantime, in case you can't find the information you need, you may visit our public confluence [EAMxx user guide](https://acme-climate.atlassian.net/wiki/spaces/DOC/pages/3858890786/EAMxx+User+s+Guide). + +### [EAMxx case basics](eamxx_cases.md) +### [Model input](model_input.md) +### [Model output](model_output.md) +### [Nudging](nudging.md) +### [Extra radiation calls](clean_clear_sky.md) +### [COSP](cosp.md) +### [Regionally Refined EAMxx](rrm_eamxx.md) +### [Doubly Periodic EAMxx](dp_eamxx.md) +### [PySCREAM](pyscream.md) +