Esempio n. 1
0
input_prefix = "/global/cfs/cdirs/e3sm/e3sm_diags"
obs_climo = "/global/cfs/cdirs/e3sm/e3sm_diags/obs_for_e3sm_diags/climatology"
obs_ts = "/global/cfs/cdirs/e3sm/e3sm_diags/obs_for_e3sm_diags/time-series"

# Define data paths for test model
test_prefix = "/global/cfs/cdirs/e3sm/zhang40/postprocessing_for_e3sm_diags"
case = "20180215.DECKv1b_H1.ne30_oEC.edison"
casename = case.split(".")[1] + "." + case.split(".")[2]

climo_path = os.path.join(test_prefix, "climo/" + case + "/1980-2014/rgr")
ts_path = os.path.join(test_prefix, "monthly_ts/" + case + "/1980-2014/rgr")
dc_climo_path = os.path.join(test_prefix,
                             "diurnal_climo/" + case + "/1980-2014/rgr")

# Define parameters for core sets: 'lat_lon','zonal_mean_xy', 'zonal_mean_2d', 'polar', 'cosp_histogram', 'meridional_mean_2d'
param = CoreParameter()
param.reference_data_path = obs_climo
param.test_data_path = climo_path
param.test_name = case
param.test_short_name = casename

# Define results path.
prefix = "/global/cfs/cdirs/e3sm/www/zhang40/tutorials/"
param.results_dir = os.path.join(prefix, "run_v230_allsets")

param.multiprocessing = True
param.num_workers = 30
param.seasons = ["ANN", "JJA"]

# Additional parameters:
# Short version of test model name being printed as plot titles
def run_all_sets(html_prefix, d):
    param = CoreParameter()

    param.reference_data_path = d["obs_climo"]
    param.test_data_path = d["test_climo"]
    param.test_name = "20161118.beta0.FC5COSP.ne30_ne30.edison"
    param.seasons = [
        "ANN",
        "JJA",
    ]  # Default setting: seasons = ["ANN", "DJF", "MAM", "JJA", "SON"]

    param.results_dir = os.path.join(html_prefix, "v2_3_0_all_sets")
    param.multiprocessing = True
    param.num_workers = 30

    # Set specific parameters for new sets
    enso_param = EnsoDiagsParameter()
    enso_param.reference_data_path = d["obs_ts"]
    enso_param.test_data_path = d["test_ts"]
    enso_param.test_name = "e3sm_v1"
    enso_param.start_yr = "1990"
    enso_param.end_yr = "1999"

    qbo_param = QboParameter()
    qbo_param.reference_data_path = d["obs_ts"]
    qbo_param.test_data_path = d["test_ts"]
    qbo_param.test_name = "e3sm_v1"
    qbo_param.start_yr = "1990"
    qbo_param.end_yr = "1999"

    ts_param = AreaMeanTimeSeriesParameter()
    ts_param.reference_data_path = d["obs_ts"]
    ts_param.test_data_path = d["test_ts"]
    ts_param.test_name = "e3sm_v1"
    ts_param.start_yr = "1990"
    ts_param.end_yr = "1999"

    dc_param = DiurnalCycleParameter()
    dc_param.reference_data_path = d["dc_obs_climo"]
    dc_param.test_data_path = d["dc_test_climo"]
    dc_param.test_name = "20180215.DECKv1b_H1.ne30_oEC.edison"
    dc_param.short_test_name = "DECKv1b_H1.ne30_oEC"
    # Plotting diurnal cycle amplitude on different scales. Default is True
    dc_param.normalize_test_amp = False

    streamflow_param = StreamflowParameter()
    streamflow_param.reference_data_path = d["streamflow_obs_ts"]
    streamflow_param.test_data_path = d["streamflow_test_ts"]
    streamflow_param.test_name = "20180215.DECKv1b_H1.ne30_oEC.edison"
    streamflow_param.test_start_yr = "1980"
    streamflow_param.test_end_yr = "2014"
    # Streamflow gauge station data range from year 1986 to 1995
    streamflow_param.ref_start_yr = "1986"
    streamflow_param.ref_end_yr = "1995"

    runner.sets_to_run = [
        "lat_lon",
        "zonal_mean_xy",
        "zonal_mean_2d",
        "polar",
        "cosp_histogram",
        "meridional_mean_2d",
        "enso_diags",
        "qbo",
        "area_mean_time_series",
        "diurnal_cycle",
        "streamflow",
    ]
    runner.run_diags(
        [param, enso_param, qbo_param, ts_param, dc_param, streamflow_param]
    )

    return param.results_dir
Esempio n. 3
0
from e3sm_diags.parameter.area_mean_time_series_parameter import (
    AreaMeanTimeSeriesParameter, )
from e3sm_diags.parameter.core_parameter import CoreParameter
from e3sm_diags.parameter.enso_diags_parameter import EnsoDiagsParameter
from e3sm_diags.parameter.qbo_parameter import QboParameter
from e3sm_diags.run import runner

# See https://e3sm-project.github.io/e3sm_diags/docs/html/quickguides/quick-guide-general.html
# Compy
# data_prefix = '/compyfs/e3sm_diags_data'
# html_prefix = '/compyfs/www/<username>'  # Change <username>
# Cori
data_prefix = "/global/cfs/cdirs/e3sm/e3sm_diags"
html_prefix = "/global/cfs/cdirs/e3sm/www/<username>"  # Change <username>

param = CoreParameter()

param.reference_data_path = os.path.join(data_prefix,
                                         "obs_for_e3sm_diags/climatology")
param.test_data_path = os.path.join(
    data_prefix, "test_model_data_for_acme_diags/climatology/")
param.test_name = "20161118.beta0.FC5COSP.ne30_ne30.edison"
param.seasons = [
    "ANN",
    "JJA",
]  # Default setting: seasons = ["ANN", "DJF", "MAM", "JJA", "SON"]

param.results_dir = os.path.join(html_prefix, "tutorial_2020_all_sets")
param.multiprocessing = True
param.num_workers = 30
Esempio n. 4
0
# Running the software with the API:
#    python all_sets.py -d all_sets.py
from e3sm_diags.parameter.area_mean_time_series_parameter import (
    AreaMeanTimeSeriesParameter, )
from e3sm_diags.parameter.core_parameter import CoreParameter
from e3sm_diags.parameter.enso_diags_parameter import EnsoDiagsParameter
from e3sm_diags.parameter.meridional_mean_2d_parameter import MeridionalMean2dParameter
from e3sm_diags.parameter.zonal_mean_2d_parameter import ZonalMean2dParameter
from e3sm_diags.run import Run

run_object = Run()
param = CoreParameter()
ts_param = AreaMeanTimeSeriesParameter()

m2d_param = MeridionalMean2dParameter()
m2d_param.plevs = [
    200.0,
    500.0,
]
z2d_param = ZonalMean2dParameter()
z2d_param.plevs = [
    200.0,
    300.0,
]

enso_param = EnsoDiagsParameter()
enso_param.test_name = "e3sm_v1"

run_object.run_diags([param, ts_param, m2d_param, z2d_param, enso_param])
Esempio n. 5
0
 def setUp(self):
     self.parameter = CoreParameter()
Esempio n. 6
0
import os

from e3sm_diags.parameter.core_parameter import CoreParameter
from e3sm_diags.parameter.zonal_mean_2d_parameter import ZonalMean2dParameter
from e3sm_diags.run import runner

param = CoreParameter()

param.reference_data_path = (
    "/global/cfs/cdirs/e3sm/e3sm_diags/obs_for_e3sm_diags/climatology/"
)
param.test_data_path = (
    "/global/cfs/cdirs/e3sm/e3sm_diags/test_model_data_for_acme_diags/climatology/"
)
param.test_name = "20161118.beta0.FC5COSP.ne30_ne30.edison"
param.seasons = ["ANN"]

# Name of the folder where the results are stored.
# Change `prefix` to use your directory.
prefix = "/global/cfs/cdirs/e3sm/www/<your directory>/examples"
param.results_dir = os.path.join(prefix, "ex6_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]
Esempio n. 7
0
import os

from e3sm_diags.parameter.core_parameter import CoreParameter
from e3sm_diags.run import runner

param = CoreParameter()

# Location of the data.
param.reference_data_path = (
    "/global/cfs/cdirs/e3sm/e3sm_diags/obs_for_e3sm_diags/climatology/")
param.test_data_path = (
    "/global/cfs/cdirs/e3sm/e3sm_diags/test_model_data_for_acme_diags/climatology/"
)
# Name of the test model data, used to find the climo files.
param.test_name = "20161118.beta0.FC5COSP.ne30_ne30.edison"
# An optional, shorter name to be used instead of the test_name.
param.short_test_name = "beta0.FC5COSP.ne30"

# What plotsets to run the diags on.
param.sets = ["lat_lon"]
# Name of the folder where the results are stored.
# Change `prefix` to use your directory.
prefix = "/global/cfs/cdirs/e3sm/www/<your directory>/examples"
param.results_dir = os.path.join(prefix, "ex5_model_to_obs")

# Below are more optional arguments.

# 'mpl' is to create matplotlib plots, 'vcs' is for vcs plots.
param.backend = "mpl"
# Title of the difference plots.
param.diff_title = "Model - Obs."
Esempio n. 8
0
import os

from e3sm_diags.parameter.core_parameter import CoreParameter
from e3sm_diags.run import runner

param = CoreParameter()

# Location of the data.
param.test_data_path = "/global/cfs/cdirs/e3sm/e3sm_diags/test_model_data_for_acme_diags/time-series/CESM1-CAM5_cmip/"
param.reference_data_path = (
    "/global/cfs/cdirs/e3sm/e3sm_diags/obs_for_e3sm_diags/time-series/")

# Set this parameter to True.
# By default, e3sm_diags expects the test data to be climo data.
param.test_timeseries_input = True
# Years to slice the test data, base this off the years in the filenames.
param.test_start_yr = "2003"
param.test_end_yr = "2004"

# Set this parameter to True.
# By default, e3sm_diags expects the ref data to be climo data.
param.ref_timeseries_input = True
# Years to slice the ref data, base this off the years in the filenames.
param.ref_start_yr = "2003"
param.ref_end_yr = "2004"

# When running with time-series data, you don't need to specify the name of the data.
# But you should, otherwise nothing is displayed when the test/ref name is needed.
param.short_test_name = "CESM1-CAM5-historical"
# param.short_ref_name = ''
Esempio n. 9
0
import os

from e3sm_diags.parameter.core_parameter import CoreParameter
from e3sm_diags.run import runner

param = CoreParameter()

# Location of the ref data.
param.reference_data_path = (
    "/global/cfs/cdirs/e3sm/e3sm_diags/obs_for_e3sm_diags/climatology/")
# Name of the ref obs data, used to find the climo files.
param.ref_name = "ceres_ebaf_toa_v2.8"

# Location of the test data.
param.test_data_path = (
    "/global/cfs/cdirs/e3sm/e3sm_diags/obs_for_e3sm_diags/climatology/")
# Name of the test obs data, used to find the climo files.
param.test_name = "ceres_ebaf_toa_v4.0"

# Name of the folder where the results are stored.
# Change `prefix` to use your directory.
prefix = "/global/cfs/cdirs/e3sm/www/<your directory>/examples"
param.results_dir = os.path.join(prefix, "ex7_obs_vs_obs")
# What plotsets to run the diags on.
param.sets = ["lat_lon"]

# Below are more optional arguments.

# What seasons to run the diags on.
# If not defined, diags is ran on ['ANN', 'DJF', 'MAM', 'JJA', 'SON'].
param.seasons = ["ANN"]
Esempio n. 10
0
import os

from e3sm_diags.parameter.core_parameter import CoreParameter
from e3sm_diags.run import runner

param = CoreParameter()

# Location of the ref data.
param.reference_data_path = (
    "/global/cfs/cdirs/e3sm/e3sm_diags/test_model_data_for_acme_diags/climatology/"
)
# Name of the ref model data, used to find the climo files.
param.ref_name = "20161118.beta0.F1850COSP.ne30_ne30.edison"
# An optional, shorter name to be used instead of the ref_name.
param.short_ref_name = "Ref: beta0.F1850COSP_ne30"

# Location of the test data.
param.test_data_path = (
    "/global/cfs/cdirs/e3sm/e3sm_diags/test_model_data_for_acme_diags/climatology"
)
# Name of the test model data, used to find the climo files.
param.test_name = "20161118.beta0.FC5COSP.ne30_ne30.edison"
# An optional, shorter name to be used instead of the test_name.
param.short_test_name = "Test: beta0_FC5COSP_ne30"

# What plotsets to run the diags on.
param.sets = ["lat_lon"]
# Name of the folder where the results are stored.
# Change `prefix` to use your directory.
prefix = "/global/cfs/cdirs/e3sm/www/<your directory>/examples"
param.results_dir = os.path.join(prefix, "ex4_model_to_model")
Esempio n. 11
0
 def __init__(self):
     self.sets_to_run = CoreParameter().sets
     self.parser = CoreParser()
Esempio n. 12
0
import os

from e3sm_diags.parameter.core_parameter import CoreParameter
from e3sm_diags.run import runner

param = CoreParameter()

# Location of the data.
param.test_data_path = "/global/cfs/cdirs/e3sm/e3sm_diags/test_model_data_for_acme_diags/time-series/CESM1-CAM5_cmip/"
param.reference_data_path = "/global/cfs/cdirs/e3sm/e3sm_diags/test_model_data_for_acme_diags/time-series/CESM1-CAM5_cmip"

# Set this parameter to True.
# By default, e3sm_diags expects the test data to be climo data.
param.test_timeseries_input = True
# Years to slice the test data, base this off the years in the filenames.
param.test_start_yr = "2001"
param.test_end_yr = "2003"

# Set this parameter to True.
# By default, e3sm_diags expects the ref data to be climo data.
param.ref_timeseries_input = True
# Years to slice the ref data, base this off the years in the filenames.
param.ref_start_yr = "1850"
param.ref_end_yr = "1852"

# When running with time-series data, you don't need to specify the name of the data.
# But you should, otherwise nothing is displayed when the test/ref name is needed.
param.short_test_name = "CESM1-CAM5-historical"
param.short_ref_name = "CESM1-CAM5-historical"

# This parameter modifies the software to accommodate model vs model runs.