We are running all of these tests on Cori. Here's how you setup the environment.
wget
the environmentyml
file from theaprime_try1
branch.wget https://raw.githubusercontent.com/E3SM-Project/e3sm_diags/aprime_try1/conda/e3sm_diags_env_dev.yml
- Create the environment.
conda env create -f e3sm_diags_env_dev.yml --name e3sm_diags_env_dev_jun12
- Clone the
e3sm_diags
repo and go to theaprime_try1
branch like so.git checkout aprime_try1 git pull origin aprime_try1
- Install the software. Note we are not using
python setup.py install
.pip install .
Also, feel free to play around the with settings, since your testing will help.
Below is the code to run the paramameter file linked here., call it lat_lon_demo.py
Remember to change prefix
accordingly to a directory you can access.
Since we're running the software via Python, we can do Pythonic things, like using os.path.join()
.
import os
from acme_diags.parameter.core_parameter import CoreParameter
from acme_diags.run import runner
param = CoreParameter()
param.reference_data_path = '/global/project/projectdirs/acme/acme_diags/obs_for_e3sm_diags/climatology/'
param.test_data_path = '/global/project/projectdirs/acme/acme_diags/test_model_data_for_acme_diags/climatology/'
param.test_name = '20161118.beta0.FC5COSP.ne30_ne30.edison'
param.seasons = ["ANN"]
prefix = '/global/project/projectdirs/acme/www/shaheen2/runs_with_api'
param.results_dir = os.path.join(prefix, 'lat_lon_demo')
runner.sets_to_run = ['lat_lon']
runner.run_diags([param])
Run it like so with multiprocessing:
python lat_lon_demo.py --multiprocessing --num_workers=32
We could have also set these multiprocessing parameters in the lat_lon_demo.py
as well.
But we're showing that you can still submit parameters via the command line.
Again, this new way of running is basically a replacement for the params.py
in e3sm_diags -p params.py -d diags.cfg
.
The results are here.
When you click on the Provenance folder and click on lat_lon_demo.py
, you can see a copy of the script used.
Again, in that folder, you can view the command used to run the software in cmd_used.txt
.
In this file, you can see that we ran with multiprocessing.
Also, look in the provenance under "Show Output Metadata".
Try modifying these values to change things.
You'll notice that to run the provenance, we have the set name (lat_lon
) after the e3sm_diags
argument.
This is a small change that a user shouldn't notice.
Ex:
e3sm_diags lat_lon --no_viewer --case_id 'CRU_IPCC' ...
In the file e3sm_diags/acme_diags/parameter/zonal_mean_2d_parameter.py,
you can see the default value for plevs
in the zonal_mean_2d
set.
Say we want to change these to [10.0, 20.0, 30.0]
.
Call the file below zonal_mean_2d_plevs.py
.
Notice that we are:
- adding
'zonal_mean_2d'
torunner.sets_to_run
. - adding the new parameter,
zonal_mean_2d_param
, torunner.run_diags()
in addition to the original core parameter.- This is how the new
plevs
are propagated to the diags.
- This is how the new
Also note that we can do more Pythonic things.
If we want to select only T
and PRECT
to run the diags on,
you do what's commented out. It's much easier than
the other way, under "Using the selectors parameter".
import os
from acme_diags.parameter.core_parameter import CoreParameter
from acme_diags.parameter.zonal_mean_2d_parameter import ZonalMean2dParameter
from acme_diags.run import runner
param = CoreParameter()
param.reference_data_path = '/global/project/projectdirs/acme/acme_diags/obs_for_e3sm_diags/climatology/'
param.test_data_path = '/global/project/projectdirs/acme/acme_diags/test_model_data_for_acme_diags/climatology/'
param.test_name = '20161118.beta0.FC5COSP.ne30_ne30.edison'
param.seasons = ["ANN"]
prefix = '/global/project/projectdirs/acme/www/shaheen2/runs_with_api'
param.results_dir = os.path.join(prefix, 'zonal_mean_2d_and_lat_lon_demo')
# Uncomment the two lines below to just
# run the diags with T and PRECT.
# param.selectors += ['variables']
# param.variables = ['T', 'PRECT']
# The new changes are below.
zonal_mean_2d_param = ZonalMean2dParameter()
zonal_mean_2d_param.plevs = [10.0, 20.0, 30.0]
runner.sets_to_run = ['zonal_mean_2d', 'lat_lon']
runner.run_diags([param, zonal_mean_2d_param])
Run the diags:
python zonal_mean_2d_plevs.py --multiprocessing --num_workers=32
Notice that though the plevs
parameter was changed in the zonal_mean_2d
plots,
it's unchanged for lat_lon
.
For lat_lon
, you can see that we still have 200 and 850 as the pressure levels.
Both example runs are good from my side.
The system tests failed when i do e3sm_diags -d all_sets.cfg.