...
| Code Block | ||||
|---|---|---|---|---|
| ||||
apt install -y git && \
apt install -y cmake && \
apt install -y python3 python3-ruamel.yaml python3-yaml python3-venv && \
apt install -y libomp-dev && \
apt install -y libboost-dev libboost-date-time-dev libboost-filesystem-dev libboost-serialization-dev libboost-program-options-dev&& \
apt install -y netcdf-bin libnetcdf-dev libnetcdff-dev && \
apt install -y libatlas-base-dev && \
apt install -y liblapack-dev && \
apt install -y libeigen3-dev && \
apt install -y bison && \
apt install -y flex && \
apt install -y vim && \
apt install -y wget bc
## Install python3-pip and the dependencies to run
## plotscm.py with SCM output
apt install -y python3-pip && \
pip3 install numpy && \
pip3 install netcdf4 && \
pip3 install matplotlib && \
pip3 install pandas && \
pip3 install xarray
## Download and build openmpi
https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.5.tar.gz |
Once these repository packages and the python librarie are installed, open-mpi is downloaded and built, . Then the openifs user is created and the openifs-48r1.1 directory is copied to the image.
...
| Code Block | ||||
|---|---|---|---|---|
| ||||
openifs@d1bd89ccc47f:~/openifs-48r1.1$ ./scripts$OIFS_TEST/openifs-test.sh -cbt -s docker-arch="" |
where :
-c will clean the directory (not necessary for a fresh image or new container) creates source directory in $OIFS_HOME, which is used to bring all the sources, e.g. ifs-source, ifs-test and any packages in the bundle (ecbuild, eccodes etc.), together in preparation for the build
-b builds the source. This step creates the directory build in $OIFS_HOME, which is used to build and store-b will configure the bundle and build OpenIFS, i.e.,
- the OpenIFS double and single precision master executables (ifsMASTER.DP and ifsMASTER.SP, respectively) , which are used to run 3-D OpenIFS. The executables are located in
$OIFS_HOME/build/bin.- The location and name of the executable for OpenIFS is defined in the platform configuration file (oifs-config.edit_me.sh) as
$OIFS_EXEC.
- The location and name of the executable for OpenIFS is defined in the platform configuration file (oifs-config.edit_me.sh) as
- the double and single precision Single Column Model (SCM) executables (MASTER_scm.DP and MASTER_scm.SP, respectively), which are used to run the SCM derived from OpenIFS. The executables are located in
$OIFS_HOME/build/bin.- The location and name of the executable for the SCM is defined in the platform configuration file (oifs-config.edit_me.sh) as
$SCM_EXEC.
- The location and name of the executable for the SCM is defined in the platform configuration file (oifs-config.edit_me.sh) as
-t will run the ifs-test t21 tests, which comprise of
- 21 3-D OpenIFS forecast-only tests with and without chemistry
- 1 SCM test (based on TWP-ICE)
--arch="" means no arch file is required because all the libraries and paths have been set-up locally in the docker container.
For more information on the openifs-test option please refer to Getting started and the linked page Openifs-test - build options.-s docker defines the system as docker, which makes the script use the correct build commands
On a Macbook pro (M1) the build of OpenIFS, takes about 10 minutes, while successful completion of ifstest takes just over 3 minutes.
Running the SCM in the docker container
Once the above has been completed, you are ready to run the SCM. The scm_openifs contains 3 testcases, each representative of different cloudy regimes
- DYCOMS - marine stratocumulus case
- BOMEX - trade-wind cumulus case
- TWPICE - A multi-day deep convective case
The SCM is run using the callscm script, which is a wrapper for the main run.scm. Both scripts can found in $SCM_TEST , which is set in the oifs-config.edit_me.sh file to ${OIFS_HOME}/scripts/scm .
callscm includes default settings, which are the all cases, with a 450 s timestep and an experiment name of ref-oifs-scm . To run with these settings, enter the following
| Code Block | ||||
|---|---|---|---|---|
| ||||
cd $OIFS_HOME
$SCM_TEST/callscm |
callscm (with defaults, i.e. no arguments) will run the DYCOMS case with the SCM and create an output directory in $SCM_RUNDIR/scmout_DYCOMS_ref-oifs-scm_450s , which contains the diagnostic output from the SCM. In addition, the file scm_run_log.txt will be created in $SCM_RUNDIR . This file contains the print output from the SCM, which is useful for checking all the sources and paths for a simulation.
A user can change the defaults by using the available command-line options
| Code Block | ||||
|---|---|---|---|---|
| ||||
callscm -h -c <case_name or list of case_names> -t <timestep or list of timesteps>
-x <expt_name>
where :
-h is help which returns basic usage options and exits
-c case_name or list of case_names (space delimited) of the case study
used for namelist and output directory. Default list is
"DYCOMS BOMEX TWPICE"
-t timestep or list of timesteps in seconds. The default is 450s. An
example of a list is "1800 900 300"
-x expt_name shortname to identify experiment. Default is ref-oifs-scm |
For example, if a user wanted to run the BOMEX case with timesteps of 1800 s and 900 s and an experiment name of "bomex_test", they would enter the following
| Code Block | ||||
|---|---|---|---|---|
| ||||
$SCM_TEST/callscm -c BOMEX -t "1800 900" -x "bomex_test" |
This command results in the following output directories $SCM_RUNDIR/scmout_BOMEX_bomex_test_900s and scmout_BOMEX_bomex_test_1800s.
Example plotting script
Once the SCM has successfully, it will produce output in $SCM_RUNDIR/scmout_<casename>_<expt_name>_<timestep>, which contains some netcdf files.
As part of the scm_openifs download package we provide a python script $SCM_RUNDIR/plotscm.py , which can be used to plot some profiles at a certain time, 2-d time height plots and some scalar timeseries. This script will work without any changes for the DYCOMS case and the default settings of callscm by type the following
| Code Block | ||||
|---|---|---|---|---|
| ||||
cd $SCM_RUNDIR
python3 plotscm.py |
For the defaults, the above will produce plot_DYCOMS directory, which contains png plots
To plot the other cases or experiments with different names and/or timesteps to the defaults, at present, the user will need to edit plotscm.py appropriately.
Basic docker commands and functionality
...