Skip to content

Commit 64b5694

Browse files
authored
Merge pull request #3870 from CliMA/j/monthly_diurnal
Adds Diurnal ERA5 Driven SCM that repeats monthly forcing files
2 parents 143f9ea + 8c47ae1 commit 64b5694

File tree

12 files changed

+347
-120
lines changed

12 files changed

+347
-120
lines changed

.buildkite/pipeline.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,15 @@ steps:
901901
agents:
902902
slurm_mem: 12GB
903903

904+
- label: ":thunder_cloud_and_rain: Prognostic EDMFX ERA5 monthly averaged diurnal driven in a column"
905+
command: >
906+
julia --color=yes --project=.buildkite .buildkite/ci_driver.jl
907+
--config_file $CONFIG_PATH/prognostic_edmfx_diurnal_scm_imp.yml
908+
--job_id prognostic_edmfx_diurnal_scm_imp
909+
artifact_paths: "prognostic_edmfx_diurnal_scm_imp/output_active/*"
910+
agents:
911+
slurm_mem: 12GB
912+
904913
- label: ":genie: Prognostic EDMFX Bomex in a box"
905914
command: >
906915
julia --color=yes --project=.buildkite .buildkite/ci_driver.jl

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ ClimaAtmos.jl Release Notes
44
main
55
-------
66

7+
PR [#3870](https://github.com/CliMA/ClimaAtmos.jl/pull/3870) adds externally driven SCM models forced by monthly-averaged ERA5
8+
reanalysis which are less data intensive and more stable. The simulation also employs the new implicit solver yielding a several
9+
factor speedup. The associated documentation section, "Single Column Model", was also improved.
10+
11+
v0.30.4
12+
-------
13+
714
PR [#3856](https://github.com/CliMA/ClimaAtmos.jl/pull/3856) adds number adjustment tendencies to the two-moment microphysics scheme.
815

916
v0.30.3

config/default_configs/default_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ ls_adv:
248248
help: "Large-scale advection [`nothing` (default), `Bomex`, `LifeCycleTan2018`, `Rico`, `ARM_SGP`, `GATE_III`]"
249249
value: ~
250250
external_forcing:
251-
help: "External forcing for single column experiments [`nothing` (default), `GCM`, `Reanalysis`, `ReanalysisTimeVarying`]"
251+
help: "External forcing for single column experiments [`nothing` (default), `GCM`, `Reanalysis`, `ReanalysisTimeVarying`, `ReanalysisMonthlyAveragedDiurnal`]"
252252
value: ~
253253
external_forcing_file:
254254
help: "External forcing file containing large-scale forcings, initial conditions, and boundary conditions. Used for GCM-driven SCM and ISDAC setup [`nothing` (default), `path/to/file`]"
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# drive all conditions with ERA5
2+
initial_condition: "ReanalysisTimeVarying"
3+
external_forcing: "ReanalysisMonthlyAveragedDiurnal"
4+
surface_setup: "ReanalysisTimeVarying"
5+
surface_temperature: "ReanalysisTimeVarying"
6+
start_date: "20070701"
7+
site_latitude: 17.0
8+
site_longitude: -149.0
9+
turbconv: "prognostic_edmfx"
10+
11+
# solve implicitly
12+
implicit_diffusion: true
13+
implicit_sgs_advection: true
14+
implicit_sgs_mass_flux: true
15+
implicit_sgs_entr_detr: true
16+
implicit_sgs_nh_pressure: true
17+
18+
approximate_linear_solve_iters: 2
19+
edmfx_upwinding: first_order
20+
edmfx_sgsflux_upwinding: first_order
21+
tracer_upwinding: vanleer_limiter
22+
energy_upwinding: vanleer_limiter
23+
rayleigh_sponge: true
24+
edmfx_entr_model: "PiGroups"
25+
edmfx_detr_model: "PiGroups"
26+
edmfx_sgs_mass_flux: true
27+
edmfx_sgs_diffusive_flux: true
28+
edmfx_nh_pressure: true
29+
edmfx_filter: true
30+
prognostic_tke: true
31+
precip_model: "0M"
32+
prescribe_ozone: false
33+
moist: "equil"
34+
config: "column"
35+
z_max: 60e3
36+
z_elem: 63
37+
z_stretch: true
38+
dz_bottom: 30
39+
perturb_initstate: false
40+
dt: "50secs"
41+
dt_rad: "10mins"
42+
t_end: "30hours"
43+
cloud_model: "quadrature_sgs"
44+
call_cloud_diagnostics_per_stage: true
45+
toml: [toml/prognostic_edmfx_calibrated.toml]
46+
netcdf_output_at_levels: true
47+
netcdf_interpolation_num_points: [2, 2, 60]
48+
output_default_diagnostics: false
49+
rad: allskywithclear
50+
insolation: "externaldriventv"
51+
diagnostics:
52+
- short_name: [ts, ta, thetaa, ha, pfull, rhoa, ua, va, wa, hur, hus, cl, clw, cli, hussfc, evspsbl, pr]
53+
period: 10mins
54+
- short_name: [arup, waup, taup, thetaaup, haup, husup, hurup, clwup, cliup, waen, taen, thetaaen, haen, husen, huren, clwen, clien, tke]
55+
period: 10mins
56+
- short_name: [entr, detr, lmix, bgrad, strain, edt, evu]
57+
period: 10mins
58+
- short_name: [rlut, rlutcs, rsut, rsutcs, clwvi, lwp, clivi, dsevi, clvi, prw, hurvi, husv]
59+
period: 10mins
60+
- reduction_time: max
61+
short_name: tke
62+
period: 10mins

docs/src/single_column_prospect.md

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
# Single Column Models
2-
`ClimaAtmos.jl` supports several canonical test cases that are run in a single column model designed to verify how PROSPECT (EDMF) performs against other test cases. These cases include variants of `bomex`, `dycoms`, `rico`, `soares`, and `trmm` and can be found in the `config/model_configs` directory. To run, for example, the BOMEX test case execute the following:
2+
`ClimaAtmos.jl` supports several canonical test cases that are run in a single column model designed to verify how well PROSPCT (EDMF) is able to reproduce each of the convective schemes. These cases include variants of `bomex`, `dycoms`, `rico`, `soares`, `gabls`, `gate`,and `trmm` and can be found in the `config/model_configs` directory. The purpose of each simulation is summarized in the following table:
3+
4+
| Abbreviation | Long Name | Cloud Regime | Reference |
5+
|--------------|-----------|--------------|-----------|
6+
| BOMEX | Barbados Oceanographic and Meteorological Experiment | Marine Cumulus | [Siebesma et al. (2003)](https://doi.org/10.1175/1520-0469(2003)60<1201:ALESIS>2.0.CO;2) |
7+
| DYCOMS | Dynamics and Chemistry of Marine Stratocumulus | Marine Stratocumulus | [Stevens et al. (2005)](https://doi.org/10.1175/MWR2930.1), [Ackerman et al. (2009)](https://doi.org/10.1175/2008MWR2582.1) |
8+
| RICO | Rain in Cumulus over the Ocean | Rainy Cumulus | [Rauber et al. (2007)](https://doi.org/10.1175/BAMS-88-12-1912) |
9+
| SOARES | Shallow Cumulus Convection | Shallow Cumulus | [Soares et al. (2004)](https://doi.org/10.1256/qj.03.223) |
10+
| GABLS | GEWEX Atmospheric Boundary Layer Study | Dry Convective Boundary Layer | [Kosović & Curry (2000)](https://doi.org/10.1175/1520-0469(2000)057<1052:ALESSO>2.0.CO;2) |
11+
| TRMM | Tropical Rainfall Measuring Mission | Deep Convection | [Grabowski et al. (2006)](https://doi.org/10.1256/qj.04.147) |
12+
| ARM_SGP | Atmospheric Radiation Measurement Southern Great Plains | Continental Shallow Cumulus | [Brown et al. (2002)](https://doi.org/10.1256/qj.01.202) |
13+
| LifeCycle | Life Cycle of Shallow Cumulus | Shallow Cumulus Life Cycle | [Tan et al. (2018)](https://doi.org/10.1002/2017MS001162) |
14+
| GATE_III | GARP Atlantic Tropical Experiment | Tropical Deep Convection | [Khairoutdinov et al. (2009)](https://doi.org/10.3894/JAMES.2009.1.15) |
15+
16+
For example, to run the BOMEX test case execute the following:
317
```bash
418
julia --project=examples examples/hybrid/driver.jl --config_file config/model_configs/prognostic_edmfx_bomex_column.yml --job_id bomex
519
```
620
It may also be helpful to run in interactive mode to be able to examine the simulation object, debug, and develop the code further. To enter debug mode run `julia --project=examples` and then in the REPL run:
721
```julia
8-
using Revise
22+
using Revise # if you are developing ClimaAtmos
923
import ClimaAtmos as CA
1024

1125
# get the configuration arguments
@@ -14,7 +28,7 @@ sol_res = CA.solve_atmos!(simulation) # run the simulation
1428
```
1529

1630
## Externally-Driven Single Column Models
17-
Currently two versions of the externally driven single column model, `GCM` driven and `ReanalysisTimeVarying` are supported in `ClimaAtmos.jl`. They have been developed specifically for the purpose of realistic simulation and model calibration. Externally-driven means that the model is initialized and forced with data coming from a different simulation. This differs from setups like, for example, BOMEX or SOARES which have steady forcing or functional forcing, respectively.
31+
Currently three versions of the externally driven single column model, `GCM` driven, `ReanalysisTimeVarying` driven, and `ReanalysisMonthlyAveragedDiurnal` driven are supported in `ClimaAtmos.jl`. Externally-driven means that the model is initialized and forced with data coming from a different simulation. This differs from setups like, for example, BOMEX or SOARES which have steady forcing and low domain tops (~4km) or functional forcing, respectively. They have been developed specifically for the purpose of model calibration by recreating statistics that are close to either LES, for the `GCM` driven case only, or to observations.
1832

1933
### GCM-Driven Case
2034
For the `GCM` driven case we can run the experiment using the config file `config/model_configs/prognostic_edmfx_gcmdriven_column.yml` by running:
@@ -32,7 +46,8 @@ surface_setup: "GCM"
3246
Here we must set all of `initial_condition`, `external_forcing` and `surface_setup` to be `GCM` as each component requires information from the external file. The `external_forcing_file` and `cfsite_number` together determine the temperature, specific humidity, and wind as well as horizontal and vertical advection profiles that drive the simulation, and can be set to a local file path as opposed to using the artifact. Radiation and surface temperature are also specified. Here the forcing file, an example of which is stored in the artifact, contains groups for each `cfsite` to drive the simulation. See [Shen et al. 2022](https://agupubs.onlinelibrary.wiley.com/doi/full/10.1029/2021MS002631) for more information.
3347

3448
### Reanalysis-Driven Case
35-
The `ReanalysisTimeVarying` case extends the `GCM` driven case by providing support for single-column simulations which resolve the diurnal cycle, can be run at any site globally, and use reanalysis to drive the simulation, allowing for calibration of EDMF to earth-system observations in the single-column setting. This feature was found to be needed to address biases in calibration arising from correlation between time-of-day and cloud liquid water path over the tropical Pacific. For this simulation we again highlight similar arguments in the config file:
49+
#### Matched ERA5 Trajectory
50+
The `ReanalysisTimeVarying` case extends the `GCM` driven case by providing support for single-column simulations which resolve the diurnal cycle, can be run at any site globally, and uses reanalysis to drive the simulation, allowing for calibration of EDMF to earth-system observations in the single-column setting. This feature was found to be needed to address biases in calibration arising from correlation between time-of-day and cloud liquid water path over the tropical Pacific. For this simulation we again highlight similar arguments in the config file:
3651
```YAML
3752
initial_condition: "ReanalysisTimeVarying"
3853
external_forcing: "ReanalysisTimeVarying"
@@ -47,18 +62,37 @@ By this point, the first 4 entries are intuitive. We need to dispatch over each
4762
!!! note
4863
Depending on the amount of smoothing and data resolution, points near the boundaries will throw index errors. With default settings, users should stay at least 5 points away from the poles (1° for ERA5 data) for smoothing (4 points) and gradients (one extra point).
4964

50-
The data is generated by downloading from ECMWF and further documentation for ERA5 data download can be found either directly on the ECMWF page and `ClimaArtifacts.jl`. Note that the profiles, surface temperature, and surface fluxes cannot be obtained from a single request and so together we need 3 files for all the data. We include a script at `src/utils/era5_observations_to_forcing_file.jl` which extracts the profiles and computes the tendencies needed for the simulation from the raw ERA5 reanalysis files. We store the observations directly into an artifact `era5_hourly_atmos_processed` to eliminate the need to reprocess specific sites and locations. This setup means that users are free to choose sites globally at any time at which ERA5 data is available. Unfortunately, global hourly renanalysis is too large to store in an artifact and so we have currently only provided support for the first 5 days of July 2007 in the tropical Pacific, stored in `era5_hourly_atmos_raw`, only available on the `clima` and Caltech `HPC` servers.
51-
#### Running the Reanalysis-driven case at different times and locations
65+
The data is generated by downloading from ECMWF and further documentation for ERA5 data download can be found either directly on the ECMWF page and `ClimaArtifacts.jl`. Note that the profiles, surface temperature, and surface fluxes cannot be obtained from a single request and so together we need 3 files for all the data. We include a script at `src/utils/era5_observations_to_forcing_file.jl` which extracts the profiles and computes the tendencies needed for the simulation from the raw ERA5 reanalysis files. We store the observations directly into an artifact `era5_hourly_atmos_processed` to eliminate the need to reprocess specific sites and locations. This setup means that users are free to choose sites globally at any time at which ERA5 data is available. Unfortunately, global hourly renanalysis is too large to store in an artifact and so we have currently only provided support for the first 5 days of July 2007 in the tropical Pacific, stored in `era5_hourly_atmos_raw`, only available on the `clima` and Caltech `HPC` servers. The test case can be run using:
66+
```bash
67+
julia --project=examples examples/hybrid/driver.jl --config_file config/model_configs/prognostic_edmfx_tv_era5driven_column.yml --job_id era5driven
68+
```
69+
70+
#### Monthly Averaged Forcing
71+
As the matched ERA5 trajectory is data intensive, requiring downloads for each day, we have also implemented an external forcing dispatch to repeat a specific day of data indefinitely. This setup is ideal for use with monthly averaged ERA5 data by hour of day and can be used to calibrate to monthly statistics. The setup is similar, except we change the flag for `external_forcing` to indicate that we want to repeat data:
72+
```YAML
73+
initial_condition: "ReanalysisTimeVarying"
74+
external_forcing: "ReanalysisMonthlyAveragedDiurnal"
75+
surface_setup: "ReanalysisTimeVarying"
76+
surface_temperature: "ReanalysisTimeVarying"
77+
start_date: "20070701"
78+
site_latitude: 17.0
79+
site_longitude: -149.0
80+
```
81+
```bash
82+
julia --project=examples examples/hybrid/driver.jl --config_file config/model_configs/prognostic_edmfx_diurnal_scm_imp.yml --job_id bomex
83+
```
84+
85+
#### Running the Reanalysis-driven cases at different times and locations
5286
You need 3 separate files with specific variables and naming convention for the data processing script to work.
53-
1. Hourly profiles with variables, following ERA5 naming convention, including `t`, `q`, `u`, `v`, `w`, `z`, `clwc`, `ciwc`. This file should be stored in the appropriate artifacts directory with the following naming scheme `"forcing_and_cloud_hourly_profiles_$(start_date).nc"` where `start_date` should specify the date data starts on formatted YYYYMMDD. We require `clwc` and `ciwc` profiles because these are typical targets for calibration but are not needed to run the simulation directly.
54-
2. Instantaneous variables, including surface temperature `ts` which should be stored in `"hourly_inst_$(start_date).nc"`
55-
3. Accumulated variables, including surface sensible and latent heat fluxes, `hfls` and `hfss`, which should be stored in `"hourly_accum_$(start_date).nc"`. These need to be divided by the appropriate time resolution, which for hourly data is 3600 and for daily and monthly data is 86400 (not a typo see [here](https://confluence.ecmwf.int/display/CKB/ERA5%3A+data+documentation#ERA5:datadocumentation-Monthlymeans)).
87+
1. Hourly profiles with variables, following ERA5 naming convention, including `t`, `q`, `u`, `v`, `w`, `z`, `clwc`, `ciwc`. This file should be stored in the appropriate artifacts directory, named `"forcing_and_cloud_hourly_profiles_$(start_date).nc"` for `ReanalysisTimeVarying` and `monthly_diurnal_profiles_$start_date).nc` for `ReanalysisMonthlyAveragedDiurnal` where `start_date` should specify the date data starts on formatted YYYYMMDD. We require `clwc` and `ciwc` profiles because these are typical targets for calibration but are not needed to run the simulation directly.
88+
2. Instantaneous variables, including surface temperature `ts` which should be stored in `"hourly_inst_$(start_date).nc"` for `ReanalysisTimeVarying` and `monthly_diurnal_inst` for `ReanalysisMonthlyAveragedDiurnal`.
89+
3. Accumulated variables, including surface sensible and latent heat fluxes, `hfls` and `hfss`, which should be stored in `"hourly_accum_$(start_date).nc"` for `ReanalysisTimeVarying` and `monthly_diurnal_accum` for `ReanalysisMonthlyAveragedDiurnal`. These need to be divided by the appropriate time resolution, which for hourly data is 3600 and for daily and monthly data is 86400 (not a typo see [here](https://confluence.ecmwf.int/display/CKB/ERA5%3A+data+documentation#ERA5:datadocumentation-Monthlymeans)).
5690

5791
##### On HPC/Clima
5892
To run locations already in the artifact, e.g., sites in the tropical Pacific in the first 5 days of July 2007 the config file will work out of the box. To run other locations or times please follow the steps for local.
5993

6094
##### On local
61-
To run the simulation on a local machine you will need to first download the reanalysis data from ECMWF, ensuring that you have all the required variables. This will be stored in 3 separate files which should be all placed in the same directory. The user must use their `Overrides.toml` in their `.julia/artifacts` path to make the `era5_hourly_atmos_raw` artifact point to the folder where the data is stored. For the raw data and location for processed files you'll need to specify the path where the data is stored and where to store the files as follows:
95+
To run the simulation on a local machine you will need to first download the reanalysis data from ECMWF, ensuring that you have all the required variables. This will be stored in 3 separate files which should be all placed in the same directory. The user edit `.julia/artifacts/Overrides.toml` to point the `era5_hourly_atmos_raw` artifact point to the folder where the data is stored. For the raw data and location for processed files you'll need to specify the path where the data is stored and where to store the files as follows:
6296
```bash
6397
8234def2ead82e385a330a48ed2f0c030e434065 = "/some/random/path/raw_data_dir" # for raw data
6498
a1a465e8d237d78bef1e6d346054da395787a9f9 = "/some/random/path/processed_files" # for storing

src/callbacks/get_callbacks.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@ function get_callbacks(config, sim_info, atmos, params, Y, p)
327327
)
328328
end
329329

330-
if parsed_args["external_forcing"] == "ReanalysisTimeVarying" &&
330+
if parsed_args["external_forcing"] in
331+
["ReanalysisTimeVarying", "ReanalysisMonthlyAveragedDiurnal"] &&
331332
parsed_args["config"] == "column"
332333
callbacks = (
333334
callbacks...,

src/prognostic_equations/forcing/external_forcing.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,10 @@ function external_forcing_cache(
475475
column_target_space;
476476
reference_date = start_date,
477477
regridder_kwargs = (; extrapolation_bc),
478+
# useful for monthly averaged diurnal data - does not affect hourly era5 case because of time bounds flag
479+
method = TimeVaryingInputs.LinearInterpolation(
480+
TimeVaryingInputs.PeriodicCalendar(),
481+
),
478482
) for name in column_tendencies
479483
]
480484

@@ -485,6 +489,9 @@ function external_forcing_cache(
485489
surface_target_space;
486490
reference_date = start_date,
487491
regridder_kwargs = (; extrapolation_bc),
492+
method = TimeVaryingInputs.LinearInterpolation(
493+
TimeVaryingInputs.PeriodicCalendar(),
494+
),
488495
) for name in surface_tendencies
489496
]
490497

@@ -543,18 +550,17 @@ function external_forcing_cache(
543550
FT,
544551
),
545552
)
546-
547553
return (; era5_tv_column_cache..., era5_tv_surface_cache..., era5_cache...)
548554
end
549555

550556
"""
551-
external_forcing_cache(Y, external_forcing::ISDACForcing, params)
557+
external_forcing_cache(Y, external_forcing::ISDACForcing, params, _)
552558
553559
Returns an empty cache for ISDAC (Indirect and Semi-Direct Aerosol Campaign)
554560
forcing. ISDAC forcing profiles are analytical functions of height, not requiring
555561
pre-loading from files into cached fields.
556562
"""
557-
external_forcing_cache(Y, external_forcing::ISDACForcing, params) = (;) # Don't need to cache anything
563+
external_forcing_cache(Y, external_forcing::ISDACForcing, params, _) = (;) # Don't need to cache anything
558564

559565
"""
560566
external_forcing_tendency!(Yₜ, Y, p, t, ::ISDACForcing)

0 commit comments

Comments
 (0)