Description
The phyex1D python module runs 1D atmospheric simulations using ideal cases described in a "common format" file. The physics is provided by the PHYEX package, also used by the Meso-NH and AROME models.
Online documentation is here.
Usage
Installation
The installation procedure is as follows:
# phyex1d and DEPHY-SCM installation
pip install phyex1d
git clone https://github.com/GdR-DEPHY/DEPHY-SCM.git
# PHYEX compilation
git clone https://github.com/UMR-CNRM/PHYEX.git
. PHYEX/tools/env.sh
cd PHYEX/build/with_ecbuild
./make_ecbuild.sh
cd ../../..
An easy install procedure also exists:
wget https://github.com/SebastienRietteMTO/phyex1d/raw/refs/heads/main/easy_install.sh
chmod +x easy_install.sh
./easy_install.sh INSTALL_DIR MODE
Experiment
The ARMCU case can be run with the following command:
. PHYEX/tools/env.sh
phyex1d ./DEPHY-SCM/ARMCU/REF/ARMCU_REF_SCM_driver.nc --exp dt=60 --plot rc.png rc y_var=P
And a rc plot is available in the rc.png file.
Main references
- PHYEX:
- MesoNH:
- AROME:
- Common format:
Command line arguments
Help message obtained by phyex1d -h
usage: phyex1d [-h] [--exp [EXPERIMENTS ...]] [-o OUTPUT_DIR]
[--plot [PLOTS ...]] [--force] [--name NAME]
INPUT_FILE
1D model using PHYEX
positional arguments:
INPUT_FILE Netcdf input file describing the case
options:
-h, --help show this help message and exit
--exp [EXPERIMENTS ...]
List of key=value strings defining an experiment. The
list of keys is provided at the end of the help
message.
-o OUTPUT_DIR Output directory
--plot [PLOTS ...] plot file name followed by options and then the list
of variables to plot (one plot by --plot usage).
example: --plot theta.png y_var=P Theta
--force Force run to be executed even if output already exists
--name NAME Name of the comparison
Each --exp option is followed by a list of key=value strings.
The allowed keys are:
- grid: Grid name or file name containing a grid description
(with '.grid' extension).
- dt: Timestep (s)
- dx, dy: mesh size (for scale aware parametrizations)
- name: experiment name
- class: name of the class that implements a timestep among:
- PhysicsAromeTQ, PhysicsAromeThetaR
- PhysicsForcingTQ, PhysicsForcingThetaR
- pyphyex: path to the pyphyex.py file to use (this file is automatically generated
during the PHYEX compilation). If not provided, the file must be found
in the PYTHONPATH.
- pyecrad: path to the pyecrad/__init__.py file to use. If not provided, the package must be found
in the PYTHONPATH in order to use ecrad.
- namel: namelist name or file name (with a .namel extension)
- attr: override an attribute definig the case, eg.: attr=radiation:on
(only some of the attributes are implemented)
Description of the format for the .grid files
Docstring of the Grid class:
The Grid class handles vertical grids
The definition of the vertical grids are stored in files with the '.grid' extension.
Theses files contains a dictionary as a json string with the folowing content:
- kind: 'hybridP' for an hybrid-pressure coordinate (pressure on level i is P(i)=a(i)+b(i)*Ps)
'hybridH' for an hybrid-height coordinate (altitude on level i is Z(i)=a(i)+b(i)*Zs)
'P' for a pressure coordinate
'H' for a height (above sea level) coordinate
- position: 'FLUX' if the grid refers to flux levels
'MASS' otherwise
- mean: 'linear' or 'quadratic'
way to compute flux levels from mass levels if grid is defined on mass levels
or the reverse if grid is defined on flux levels
- description: a single list of values if kind is 'P' or 'H'
a list containing a list for the a(i) coefficients and a list for the b(i)
coefficients if kind is 'hybridP' or 'hybridH'.