Skip to content

Commit afab99d

Browse files
committed
Fixes for regional run; build strict
1 parent 3348acd commit afab99d

File tree

6 files changed

+86
-30
lines changed

6 files changed

+86
-30
lines changed

.github/workflows/deploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,17 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@v5
2525

26-
- name: Setup Pages
26+
- name: Set up Pages
2727
uses: actions/configure-pages@v5
2828

29-
- name: Setup Python
29+
- name: Set up Python
3030
uses: mamba-org/setup-micromamba@v2
3131
with:
3232
environment-file: environment.yml
3333
cache-environment: true
3434

35-
- name: Build HTML Assets
36-
run: jupyter-book build --html --execute --ci
35+
- name: Build HTML
36+
run: jupyter-book build --html --execute --strict --ci
3737
shell: micromamba-shell {0}
3838

3939
- name: Upload artifact

01-compile.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Build
33
subtitle: Building MPAS on NSF NCAR Derecho
4-
label: build
4+
label: page:build
55
---
66

77
First we need to clone the model repository.
@@ -15,6 +15,8 @@ cd $_
1515
git switch isolevels-v8
1616
```
1717

18+
(p:interactive-job)=
19+
1820
It's good practice to compile the model in an interactive job,
1921
to avoid stressing the login nodes, which are a shared resource,
2022
_and_ to ensure that the CPU resources detected at build time are the same as those used at run time[^derecho-nodes].
@@ -115,4 +117,10 @@ we can build the main program.
115117
make -j4 intel CORE=atmosphere
116118
```
117119

118-
If this completes successfully, we should have an `atmosphere_model` executable.
120+
If this completes successfully, we should have an `atmosphere_model` executable
121+
(and `build_tables`)
122+
and we can leave our interactive job.
123+
124+
```bash
125+
exit
126+
```

02-run.md

Lines changed: 58 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Run
33
subtitle: Running MPAS on NSF NCAR Derecho
4-
label: run
4+
label: page:run
55
---
66

77
# Global
@@ -267,6 +267,8 @@ A successful run will produce various model output files:
267267
- `history.*.nc` (2- and 3-d prognostic and diagnostic fields; specified in `stream_list.atmosphere.output`)
268268
- `restart.*.nc` (checkpoints of the model state that we can use for a warm start)
269269

270+
(sec:run-regional)=
271+
270272
# Regional
271273

272274
We will use the limited-area domain as in:
@@ -280,11 +282,31 @@ created by rotating, moving, and cropping the `x5.8060930` global 15–3-km elli
280282

281283
```{figure} africa-domain.png
282284
283-
Made with [GeoVista](viz#geovista).
285+
Made with {ref}`GeoVista <sec:geovista>`.
284286
```
285287

286288
## Run directory
287289

290+
First we need to generate the tables for the Thompson microphysics scheme.
291+
As when we {ref}`built <p:interactive-job>` the model, we can use an interactive job.
292+
293+
```bash
294+
qsub -I -l walltime=3600 -l select=1:ncpus=2:mem=16gb -A UTAM0025 -q develop
295+
```
296+
297+
```bash
298+
source ~/mpas-modules-intel.sh
299+
300+
cd ~/MPAS-Model_v8.3
301+
302+
./build_tables
303+
304+
mv MP_THOMPSON_* src/core_atmosphere/physics/physics_wrf/files/
305+
ln -s src/core_atmosphere/physics/physics_wrf/files/MP_THOMPSON_* .
306+
307+
exit
308+
```
309+
288310
As before, we first build out our run directory.
289311
We use the same MPAS-Model directory, but copy a different mesh.
290312

@@ -334,6 +356,7 @@ Update `namelist.init_atmosphere` with these settings:
334356
| `nhyd_model.config_init_case` | `7` |
335357
| `nhyd_model.config_start_time` | `'2017-09-12_00:00:00'` |
336358
| `data_sources.config_met_prefix` | `'FILE'` |
359+
| `data_sources.config_noahmp_static` | `false` [^noahmp] |
337360
| `preproc_stages.config_static_interp` | `false` |
338361
| `preproc_stages.config_native_gwd_static` | `false` |
339362
| `preproc_stages.config_native_gwd_gsl_static` | `false` |
@@ -345,6 +368,13 @@ Update `namelist.init_atmosphere` with these settings:
345368

346369
:::
347370

371+
[^noahmp]:
372+
Our static file was created with v8.0, before the Noah-MP land model was added to MPAS-A (v8.2),
373+
so we [have to](https://forum.mmm.ucar.edu/threads/3-km-static-file-created-by-create_region-doesnt-have-nsoilcomps-as-a-dimension-and-results-in-error-when-creating-initial-conditions.21865/post-54423)
374+
disable collecting input fields for Noah-MP.
375+
376+
This is a hidden option; add it to the end of its section (`data_sources`).
377+
348378
Then, in `streams.init_atmosphere`, set the input file name template to `Africa.static.nc`
349379
and the output file name template to `Africa.init.nc`.
350380

@@ -378,15 +408,16 @@ qsub init.pbs
378408

379409
Update `namelist.init_atmosphere` with these settings:
380410

381-
:::{table} `namelist.init_atmosphere` settings for BC generation for the regional example
411+
:::{table} `namelist.init_atmosphere` settings for LBC generation for the regional example
382412
:label: africa-namelist-bc
383413

384414
| parameter | value |
385415
| ----------------------------------------------- | --------------------------- |
386416
| `nhyd_model.config_init_case` | `9` |
387417
| `nhyd_model.config_start_time` | `'2017-09-12_00:00:00'` |
388-
| `nhyd_model.config_stop_time` | `'2017-09-13_11:00:00'` |
418+
| `nhyd_model.config_stop_time` | `'2017-09-13_12:00:00'` |
389419
| `data_sources.config_met_prefix` | `'FILE'` |
420+
| `data_sources.config_fg_interval` | `3600` (seconds) |
390421
| `preproc_stages.config_static_interp` | `false` |
391422
| `preproc_stages.config_native_gwd_static` | `false` |
392423
| `preproc_stages.config_native_gwd_gsl_static` | `false` |
@@ -398,11 +429,12 @@ Update `namelist.init_atmosphere` with these settings:
398429

399430
:::
400431

401-
👆 The differences are that now we are using init case 9,
432+
👆 Compared to {ref}`africa-namelist-ic`, the differences are that now we are using init case 9,
402433
and we need to set a stop time.
403434

404-
Then, in `streams.init_atmosphere`, set the input file name template to `Africa.init.nc`
405-
and the LBC output interval to `1:00:00` (hourly).
435+
Then, in `streams.init_atmosphere`, set the input file name template to `Africa.init.nc`,
436+
the output file name template to `foo.nc` (unused, but it can't be the same as others),
437+
and the LBC output interval to `1:00:00` (hourly; consistent with our `config_fg_interval`).
406438

407439
Submit the job (same one we used to create the initial conditions):
408440

@@ -419,19 +451,28 @@ Update `namelist.atmosphere` with these settings:
419451
:::{table} `namelist.atmosphere` settings for the regional example
420452
:label: africa-namelist-run
421453

422-
| parameter | value |
423-
| ----------------------------------------------- | --------------------------- |
424-
| `nhyd_model.config_dt` | `13.0` |
425-
| `nhyd_model.config_start_time` | `'2017-09-12_00:00:00'` |
426-
| `nhyd_model.config_run_duration` | `'1_12:00:00'` |
427-
| `nhyd_model.config_radtlw_interval` | `'00:30:00'` |
428-
| `nhyd_model.config_radtsw_interval` | `'00:30:00'` |
429-
| `physics.config_physics_suite` | `'convection_permitting'` |
430-
| `decomposition.config_block_decomp_file_prefix` | `'Africa.graph.info.part.'` |
454+
| parameter | value |
455+
| ----------------------------------------------- | ----------------------------- |
456+
| `nhyd_model.config_dt` | `13.0` |
457+
| `nhyd_model.config_start_time` | `'2017-09-12_00:00:00'` |
458+
| `nhyd_model.config_run_duration` | `'1_12:00:00'` |
459+
| `nhyd_model.config_len_disp` | `3000.0` (meters) [^len-disp] |
460+
| `limited_area.config_apply_lbcs` | `true` |
461+
| `physics.config_radtlw_interval` | `'00:30:00'` |
462+
| `physics.config_radtsw_interval` | `'00:30:00'` |
463+
| `physics.config_physics_suite` | `'convection_permitting'` |
464+
| `decomposition.config_block_decomp_file_prefix` | `'Africa.graph.info.part.'` |
431465

432466
:::
433467

434-
👆 Note that we have set a much smaller time step than in the coarse global example,
468+
[^len-disp]:
469+
Horizontal length scale for Smagorinsky diffusion (meters).
470+
We have to set it because `nominalMinDc` is 0 in our static file.
471+
472+
This is a hidden option; add it to the end of its section (`nhyd_model`).
473+
474+
👆 Note that we have set a much smaller time step than in the {ref}`coarse global example <global-namelist-run>`,
475+
we turn on application of LBCs,
435476
we use the default RT interval,
436477
and we have selected the convection-permitting physics suite.
437478

03-viz.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"---\n",
1515
"title: Viz\n",
1616
"subtitle: Visualizing native-grid output in Python\n",
17-
"label: viz\n",
17+
"label: page:viz\n",
1818
"---"
1919
]
2020
},
@@ -29,7 +29,7 @@
2929
"tags": []
3030
},
3131
"source": [
32-
"With unstructured-grid data, the grid/coordinate information is usually stored in a separate file from the model output fields. Considerably more information is needed to reconstruct the grid than in the case of a rectangular lat/lon grid, for example, which can be expressed with 1-D coordinate variables.\n",
32+
"With unstructured-grid data, the grid/coordinate information is usually stored in a separate file from the model output fields. Considerably more information is needed to reconstruct the grid than in the case of a rectangular lat/lon grid, for example, which can be expressed with 1-D coordinate variables (e.g. ERA5).\n",
3333
"\n",
3434
"With MPAS-A, the necessary grid variables are available in multiple files:\n",
3535
"\n",
@@ -632,6 +632,8 @@
632632
"id": "270910cf-d6df-4846-b644-39def35d008a",
633633
"metadata": {},
634634
"source": [
635+
"(sec:geovista)=\n",
636+
"\n",
635637
"# GeoVista\n",
636638
"\n",
637639
"Built on PyVista/VTK, [GeoVista](https://geovista.readthedocs.io/) provides GPU-accelerated interactive visualization of geospatial data and has [builtin support](https://geovista.readthedocs.io/en/v0.5.3/reference/generated/api/geovista/bridge/#geovista.bridge.Transform.from_unstructured) for unstructured meshes.\n",

04-regrid.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Regrid
33
subtitle: Tools for regridding MPAS-A output to regular lat-lon grids
4-
label: regrid
4+
label: page:regrid
55
---
66

77
# Options
@@ -18,7 +18,7 @@ and works with global and limited-area meshes.
1818

1919
pyremap [is available](https://mpas-dev.github.io/pyremap/2.1.0/quick_start.html#installation) on conda-forge.
2020

21-
In the below example, we use the data we downloaded in {ref}`viz`.
21+
In the below example, we use the data we downloaded in {ref}`page:viz`.
2222

2323
```{include} pyremap-example.py
2424
:lang: python
@@ -65,7 +65,7 @@ On Casper/Derecho:
6565
module load nco
6666
```
6767

68-
Let's use the grid data we downloaded in {ref}`viz`.
68+
Let's use the grid data we downloaded in {ref}`page:viz`.
6969

7070
```bash
7171
ln -s x1.2562.grid.nc grid.nc
@@ -167,7 +167,7 @@ module load cdo
167167
```
168168
169169
Global regridding with CDO is straightforward.
170-
As in the [NCO example](#nco-examples), we can use the data from {ref}`viz`,
170+
As in the [NCO example](#nco-examples), we can use the data from {ref}`page:viz`,
171171
aliased to `grid.nc` and `static.nc`.
172172
173173
```bash
@@ -208,7 +208,7 @@ Now we can use the `convert_mpas` command[^rc].
208208

209209
### Examples
210210

211-
Here we use the data from our global run in {ref}`run`.
211+
Here we use the data from our global run in {ref}`page:run`.
212212

213213
```bash
214214
# Default 0.5-degree global, one file

myst.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ project:
1717
1818
url: https://zmoon.info
1919
github: https://github.com/NunezOcasioLab/mpas-tutorial
20+
error_rules:
21+
- rule: link-resolves
22+
severity: ignore
23+
keys:
24+
- https://sigma.mcs.anl.gov/category/moab/ # 403
2025
site:
2126
template: book-theme
2227
options:

0 commit comments

Comments
 (0)