Skip to content

Instantly share code, notes, and snippets.

@zshaheen
Last active August 22, 2018 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zshaheen/0943070103e4ebac5da3c68ba7177ac4 to your computer and use it in GitHub Desktop.
Save zshaheen/0943070103e4ebac5da3c68ba7177ac4 to your computer and use it in GitHub Desktop.
Testing Timeseries Input with E3SM Diagnostics

Testing Timeseries Input with E3SM Diagnostics on ACME1/AIMS4

This is a tentative guide. It will eventually be put on the official documentation site here.

You guys can probably figure out how to run this on Edison. Just use module load, create you env, and adjust the paths in the py accordingly.

Installation

  1. Follow these instructions under Environment for development here, up to and including step 4 only. Don’t do step 5.

  2. Remove cdp, we need the latest from master.

    conda remove cdp --force
    
  3. Install the latest cdp from master.

    git clone https://github.com/CDAT/cdp.git
    cd cdp
    python setup.py install 
    
  4. Go to the climo branch of e3sm_diags and install the latest code there.

    git clone https://github.com/E3SM-Project/acme_diags.git
    cd acme_diags
    git checkout climo
    python setup.py install 
    

Running the diagnostics

  1. Create and run the following py parameters file.

    Remember to change results_dir and num_workers accordingly.

    For the current timeseries files in test_data_path, the timeseries specific variables you should only change are test_start_time_slice and test_end_time_slice.

    reference_data_path = '/p/cscratch/acme/data/obs_for_acme_diags/'
    # The below test_data_path is where the climo model data is stored.
    # test_data_path = '/p/cscratch/acme/data/test_model_data_for_acme_diags/'
    # New path of where the timeseries files are located.
    test_data_path = '/p/user_pub/work/E3SM/1_0/piControl/1deg_atm_60-30km_ocean/atmos/129x256/time-series/mon/ens1/v1/'
    short_test_name = 'some_test'
    
    # New parameters for timeseries input.
    test_timeseries_input = True
    test_start_yr = '0001'
    test_end_yr = '0500'
    # You can change these to get difference slices.
    test_start_time_slice = '0001'
    test_end_time_slice = '0012'
    
    # sets = ['zonal_mean_xy', 'zonal_mean_2d', 'lat_lon', 'polar', 'cosp_histogram']
    sets = ['lat_lon']
    
    seasons = ['ANN']
    backend = 'mpl'
    
    results_dir = '/var/www/acme/acme-diags/zhang40/dataset/lat_lon_timeseries_input_08_21'
    
    multiprocessing = True
    num_workers = 48
  2. Your results should look something like this.

Adjusting the time slicing stuff

In the climo branch, the Dataset class is located here:

acme_diags/acme_diags/driver/utils/dataset.py

The function _get_var_from_timeseries_file() on line 431 is where the time slicing occurs. Feel free to change or don't even use the get_start_end_time_slice() function. This is what gets the start and end slices.

Remember you can always use one of the diagnostics in this or other cfg files to make testing faster.

Email me if you have any issues, need help, or have any feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment