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/cscratch1/sd/mengz/AMIP/cori-knl.E3SM_maint1_0_012022.e3smv1_v2like_freerun_10yrs_CTL.F2010C5-CMIP6-LR.ne30_ne30/run/e3sm_diag_input/"
    #"/global/cscratch1/sd/mengz/E3SMv2_simulation/cori-knl.E3SM_maint2_0_012022.e3smv2_freerun_10yrs_SENS_WBF01.F2010-CICE.ne30_ne30/run/e3sm_diag_input/"
    "/global/cscratch1/sd/mengz/E3SMv2_simulation/cori-knl.E3SMv2_080421.e3smv2_freerun_sens2yrs_deep.F2010.ne30_ne30/run/e3sm_diag_input/"
)
# Name of the ref model data, used to find the climo files.
param.ref_name = "cori-knl.E3SMv2_080421.e3smv2_freerun_sens2yrs_deep.F2010.ne30_ne30"

#"cori-knl.E3SM_maint2_0_012022.e3smv2_freerun_10yrs_SENS_WBF01.F2010-CICE.ne30_ne30"
#"cori-knl.E3SM_maint1_0_012022.e3smv1_v2like_freerun_10yrs_CTL.F2010C5-CMIP6-LR.ne30_ne30"

# An optional, shorter name to be used instead of the ref_name.
param.short_ref_name = "E3SMv2 Deep 1 year"

# Location of the test data.
param.test_data_path = (
    "/global/cscratch1/sd/mengz/E3SMv2_simulation/cori-knl.E3SM_maint2_0_012022.e3smv2_freerun_10yrs_CTL.F2010-CICE.ne30_ne30/run/e3sm_diag_input/"
)
# Name of the test model data, used to find the climo files.
param.test_name = "cori-knl.E3SM_maint2_0_012022.e3smv2_freerun_10yrs_CTL.F2010-CICE.ne30_ne30"
# An optional, shorter name to be used instead of the test_name.
param.short_test_name = "E3SMv2 CTL"

# 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/mengz/doc_examples"
param.results_dir = os.path.join(prefix, "v2_to_v2deep")
# This parameter modifies the software to accommodate model vs model runs.
# The default setting for run_type is 'model_vs_obs'.
param.run_type = "model_vs_model"

# 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 = "E3SMv2 - E3SMv2 Deep"
# For running with multiprocessing.
# multiprocessing = True
# num_workers = 32

runner.sets_to_run = ["lat_lon"]
runner.run_diags([param])
