9A. Sea Ice

Program for Climate Model Diagnosis and Intercomparison  Lawrence Livermore National Laboratory  United States Department of Energy  Earth System Grid Federation 2 - US Consortium

Summary
The PCMDI Metrics Package (PMP) sea ice driver produces metrics that compare modeled and observed sea ice extent focusing on its annual cycle. This notebook demonstrates how to run the PMP sea ice code.
Authors
Ana Ordonez, Jiwoo Lee, Paul Durack, Peter Gleckler (PCMDI, Lawrence Livermore National Laboratory)
Reference
Ivanova, D. P., P. J. Gleckler, K. E. Taylor, P. J. Durack, and K. D. Marvel, 2016: Moving beyond the Total Sea Ice Extent in Gauging Model Biases. J. Climate, 29, Pp 8965–8987, https://doi.org/10.1175/JCLI-D-16-0026.1.
Notes
The installation instructions for the PMP can be found here. The documentation for the sea ice metrics can be found here.

Table of Contents

Note: Links to the sections work best when viewing this notebook via nbviewer. - 1. Demo data * 1.1 Model output * 1.2 Reference dataset - 2. Sectors - 3. Basic Example * 3.1.1 Introducing the PMP parameter file * 3.1.2 Introducing the PMP driver file * 3.1.2 Running the PMP sea ice demo - 4. Working with multiple realizations - 5. Working with multiple models - 6. Further exploration - 7. Debugging the LLNL Nimbus binder environment

1. Demo data

1.1 Model output

This demo uses three CMIP6 models. The Sea-Ice Area Percentage (Ocean Grid; ‘siconc’) and Grid-Cell Area for Ocean Variables (‘areacello’) variables are needed and can be found in the following directories. In addition, six other models are available that can be added to the analyses in this demo:

/p/user_pub/pmp/demo/sea-ice/links_siconc
/p/user_pub/pmp/demo/sea-ice/links_area
[1]:
!ls /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc
siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_185001-185912.nc
siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_186001-186912.nc
siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_187001-187912.nc
siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_188001-188912.nc
siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_189001-189912.nc
siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_190001-190912.nc
siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_191001-191912.nc
siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_192001-192912.nc
siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_193001-193912.nc
siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_194001-194912.nc
siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_195001-195912.nc
siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_196001-196912.nc
siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_197001-197912.nc
siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_198001-198912.nc
siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_199001-199912.nc
siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_200001-200912.nc
siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_201001-201112.nc
[2]:
!ls /p/user_pub/pmp/demo/sea-ice/links_area/E3SM-1-0/
areacello_Ofx_E3SM-1-0_historical_r1i1p1f1_gr.nc

1.2 Reference dataset

The observational dataset provided is the satellite derived sea ice concentration dataset from EUMETSAT OSI-SAF. More data information can be found at the osi-450-a product page. The path to this data is:

/p/user_pub/pmp/demo/sea-ice/EUMETSAT

The original data was post-processed for the PMP and the processed data can be downloaded by running Demo_0_download_data.ipynb

[3]:
!ls /p/user_pub/pmp/demo/sea-ice/EUMETSAT/OSI-SAF-450-a-3-0/v20231201
ice_conc_nh_ease2-250_cdr-v3p0_198801-202012.nc
ice_conc_sh_ease2-250_cdr-v3p0_198801-202012.nc

NOTE Further exploration of the above datasets can be found in our supplemental Jupyter notebook: Demo_9b_seaIce_data_explore.ipynb

2. Sectors

This code block produces maps that show the different regions used in the analysis along with the mean observed (OSI-SAF) sea ice concentration. The code to generate these figures can be found in the script `sea_ice_sector_plots.py <sea_ice_sector_plots.py>`__.

Below process will take about 30 seconds.

Go back to Top

[4]:
%%time
%%bash
python sea_ice_sector_plots.py
Creating Arctic map
Creating Antarctic map
CPU times: user 5.32 ms, sys: 5.06 ms, total: 10.4 ms
Wall time: 24.7 s
[5]:
# To open and display one of the graphics
from IPython.display import display_png, JSON, Image
[6]:
a = Image("Arctic_regions.png")
b = Image("Antarctic_regions.png")
display_png(a,b)
../_images/examples_Demo_9_seaIceExtent_ivanova_12_0.png
../_images/examples_Demo_9_seaIceExtent_ivanova_12_1.png

3. Basic example

This first case will work with sea ice concentration ouput from a single model, E3SM-1-0. Two overview plots are shown below to visualize the Arctic sea ice evolution over time in this model.

For this demo, we start the OSI-SAF satellite data in 1988 as that avoids missing data in earlier parts of the record.

The code to generate these figures can be found in `sea_ice_line_plots.py <sea_ice_line_plots.py>`__.

Below process will take about 15 seconds.

Go back to Top

[7]:
%%time
%%bash
python sea_ice_line_plots.py
CPU times: user 4.56 ms, sys: 1.11 ms, total: 5.67 ms
Wall time: 21.1 s
[8]:
a = Image("Arctic_tseries.png")
b = Image("Arctic_clim.png")
display_png(a,b)
../_images/examples_Demo_9_seaIceExtent_ivanova_17_0.png
../_images/examples_Demo_9_seaIceExtent_ivanova_17_1.png

3.1 Introducing the PCMDI Metrics Package (PMP) parameter file

The PMP drivers can all read user arguments from parameter files. We provide a demo parameter file, which is shown below. Comments (beginning with a ‘#’) explain each of the parameters.

Go back to Top

[9]:
with open("sea_ice_param.py") as f:
    print(f.read())
# Sea ice metrics parameter file

# Settings for models
# --------------------
# List of models to include in analysis
test_data_set = [
    "E3SM-1-0",
]

# realization can be a single realization, a list of realizations, or "*" for all realizations
realization = "r1i2p2f1"

# test_data_path is a template for the model data parent directory
test_data_path = "/p/user_pub/pmp/demo/sea-ice/links_siconc/%(model)/historical/%(realization)/siconc/"

# filename_template is a template for the model data file name
# combine it with test_data_path to get complete data path
filename_template = "siconc_SImon_%(model)_historical_%(realization)_*_*.nc"

# The name of the sea ice variable in the model data
var = "siconc"

# Start and end years for model data
msyear = 1981
meyear = 2010

# Factor for adjusting model data to decimal rather than percent units
ModUnitsAdjust = (True, "multiply", 1e-2)

# Template for the grid area file
area_template = "/p/user_pub/pmp/demo/sea-ice/links_area/%(model)/*.nc"

# Area variable name; likely 'areacello' or 'areacella' for CMIP6
area_var = "areacello"

# Factor to convert area units to km-2
AreaUnitsAdjust = (True, "multiply", 1e-6)

# Directory for writing outputs
case_id = "ex1"
metrics_output_path = "sea_ice_demo/%(case_id)/"

# Settings for the observational data
# ------------------------------------
# Paths to northern and southern hemisphere files
reference_data_path_nh = "/p/user_pub/pmp/demo/sea-ice/EUMETSAT/OSI-SAF-450-a-3-0/v20231201/ice_conc_nh_ease2-250_cdr-v3p0_198801-202012.nc"
reference_data_path_sh = "/p/user_pub/pmp/demo/sea-ice/EUMETSAT/OSI-SAF-450-a-3-0/v20231201/ice_conc_sh_ease2-250_cdr-v3p0_198801-202012.nc"

# Factor for adjusting obs data to decimal rather than percent units
ObsUnitsAdjust = (True, "multiply", 1e-2)

# Name of reference data
reference_data_set = "OSI-SAF"

# Start and end years for obs
osyear = 1988
oeyear = 2020

# Name of sea ice concentration variable
obs_var = "ice_conc"

# Factor to convert area units to km-2
ObsAreaUnitsAdjust = (False, 0, 0)

# In this case there is no obs area file, so these are None
obs_area_template = None
obs_area_var = None

# Because there is no obs area file and this data
# uses an equal-area grid, we provide the
# fixed grid cell area value in km2 units
obs_cell_area = 625  # km 2

To see all of the parameters available for the sea ice metrics, run the –help command as shown here:

3.2 Introducing the PMP driver file

Go back to Top

[10]:
%%bash
sea_ice_driver.py --help
usage: sea_ice_driver.py [-h] [--parameters PARAMETERS]
                         [--diags OTHER_PARAMETERS [OTHER_PARAMETERS ...]]
                         [--case_id CASE_ID] [-v VAR] [--obs_var OBS_VAR]
                         [--area_var AREA_VAR] [--obs_area_var OBS_AREA_VAR]
                         [-r REFERENCE_DATA_SET [REFERENCE_DATA_SET ...]]
                         [--reference_data_path_nh REFERENCE_DATA_PATH_NH]
                         [--reference_data_path_sh REFERENCE_DATA_PATH_SH]
                         [-t TEST_DATA_SET [TEST_DATA_SET ...]]
                         [--test_data_path TEST_DATA_PATH]
                         [--realization REALIZATION]
                         [--filename_template FILENAME_TEMPLATE]
                         [--metrics_output_path METRICS_OUTPUT_PATH]
                         [--filename_output_template FILENAME_OUTPUT_TEMPLATE]
                         [--area_template AREA_TEMPLATE]
                         [--obs_area_template_nh OBS_AREA_TEMPLATE_NH]
                         [--obs_area_template_sh OBS_AREA_TEMPLATE_SH]
                         [--obs_cell_area OBS_CELL_AREA]
                         [--output_json_template OUTPUT_JSON_TEMPLATE]
                         [--debug] [--plots] [--osyear OSYEAR]
                         [--msyear MSYEAR] [--oeyear OEYEAR] [--meyear MEYEAR]
                         [--ObsUnitsAdjust OBSUNITSADJUST]
                         [--ModUnitsAdjust MODUNITSADJUST]
                         [--AreaUnitsAdjust AREAUNITSADJUST]
                         [--ObsAreaUnitsAdjust OBSAREAUNITSADJUST]
                         [--plot PLOT] [--pole POLE] [--netcdf]
                         [--generate_mask] [--no_mask]
                         [--sft_filename_template SFT_FILENAME_TEMPLATE]

options:
  -h, --help            show this help message and exit
  --parameters PARAMETERS, -p PARAMETERS
  --diags OTHER_PARAMETERS [OTHER_PARAMETERS ...], -d OTHER_PARAMETERS [OTHER_PARAMETERS ...]
                        Path to other user-defined parameter file. (default:
                        None)
  --case_id CASE_ID     Defines a subdirectory to the metrics output, so
                        multiplecases can be compared (default: None)
  -v VAR, --var VAR     Name of model sea ice concentration variable (default:
                        None)
  --obs_var OBS_VAR     Name of obs sea ice concentration variable (default:
                        None)
  --area_var AREA_VAR   Name of model area variable (default: None)
  --obs_area_var OBS_AREA_VAR
                        Name of reference data area variable (default: None)
  -r REFERENCE_DATA_SET [REFERENCE_DATA_SET ...], --reference_data_set REFERENCE_DATA_SET [REFERENCE_DATA_SET ...]
                        List of observations or models that are used as a
                        reference against the test_data_set (default: None)
  --reference_data_path_nh REFERENCE_DATA_PATH_NH
                        Path for the reference climatologies for southern
                        hemisphere (default: None)
  --reference_data_path_sh REFERENCE_DATA_PATH_SH
                        Path for the reference climatologies for northern
                        hemisphere (default: None)
  -t TEST_DATA_SET [TEST_DATA_SET ...], --test_data_set TEST_DATA_SET [TEST_DATA_SET ...]
                        List of observations or models to test against the
                        reference_data_set (default: None)
  --test_data_path TEST_DATA_PATH
                        Path for the test climitologies (default: None)
  --realization REALIZATION
                        A simulation parameter (default: None)
  --filename_template FILENAME_TEMPLATE
                        Template for climatology files (default: None)
  --metrics_output_path METRICS_OUTPUT_PATH
                        Directory of where to put the results (default: None)
  --filename_output_template FILENAME_OUTPUT_TEMPLATE
                        Filename for the interpolated test climatologies
                        (default: None)
  --area_template AREA_TEMPLATE
                        Filename template for model grid area (default: None)
  --obs_area_template_nh OBS_AREA_TEMPLATE_NH
                        Filename template for obs grid area in Northern
                        Hemisphere (default: None)
  --obs_area_template_sh OBS_AREA_TEMPLATE_SH
                        Filename template for obs grid area in Southern
                        Hemisphere (default: None)
  --obs_cell_area OBS_CELL_AREA
                        For equal area grids, the cell area in km (default:
                        None)
  --output_json_template OUTPUT_JSON_TEMPLATE
                        Filename template for results json files (default:
                        None)
  --debug               Turn on debugging mode by printing more information to
                        track progress (default: False)
  --plots               Set to True to generate figures. (default: False)
  --osyear OSYEAR       Start year for reference data set (default: None)
  --msyear MSYEAR       Start year for model data set (default: None)
  --oeyear OEYEAR       End year for reference data set (default: None)
  --meyear MEYEAR       End year for model data set (default: None)
  --ObsUnitsAdjust OBSUNITSADJUST
                        Factor to convert obs sea ice concentration to
                        decimal. For example: - (True, 'divide', 100.0) #
                        percentage to decimal - (False, 0, 0) # No adjustment
                        (default) (default: (False, 0, 0))
  --ModUnitsAdjust MODUNITSADJUST
                        Factor to convert model sea ice concentration to
                        decimal. For example: - (True, 'divide', 100.0) #
                        percentage to decimal - (False, 0, 0) # No adjustment
                        (default) (default: (False, 0, 0))
  --AreaUnitsAdjust AREAUNITSADJUST
                        Factor to convert area data to km^2. For example: -
                        (True, 'multiply', 1e-6) # m^2 to km^2 - (False, 0, 0)
                        # No adjustment (default) (default: (False, 0, 0))
  --ObsAreaUnitsAdjust OBSAREAUNITSADJUST
                        Factor to convert area data to km^2. For example: -
                        (True, 'multiply', 1e-6) # m^2 to km^2 - (False, 0, 0)
                        # No adjustment (default) (default: (False, 0, 0))
  --plot PLOT           Option for generate individual plots for models: True
                        (default) / False (default: True)
  --pole POLE           Set to a latitude value to exclude sea ice at North
                        pole. Must be > 80. (default: 90.1)
  --netcdf              Use to save netcdf intermediate results (default:
                        False)
  --generate_mask       Flag to generate land sea mask if not found. (default:
                        False)
  --no_mask             Flag to not generate land sea mask if not found.
                        (default: False)
  --sft_filename_template SFT_FILENAME_TEMPLATE
                        Filename template for landsea masks ("sftlf" or
                        "sftof") (default: None)

3.3 Running the PMP sea ice demo

The PMP drivers are run on the command line. In this Jupyter Notebook, we use the bash cell magic function %%bash to run command line functions from the notebook.

The PMP sea ice metrics driver call follows the basic format: sea_ice_driver.py -p parameter_file.py –additional arguments

The following cell runs the driver with the demo parameter file we saw above.

Below process will take about 3 minutes.

Go back to Top

[11]:
%%time
%%bash
sea_ice_driver.py -p sea_ice_param.py
Model list: ['E3SM-1-0']
Find all realizations: False
OBS: Arctic
Converting units by  multiply 0.01
Writing climatology netcdf
OBS: Antarctic
Converting units by  multiply 0.01
Writing climatology netcdf
Model list: ['E3SM-1-0']
['r1i2p2f1']
/p/user_pub/pmp/demo/sea-ice/links_area/E3SM-1-0/*.nc
Converting units by  multiply 1e-06

-----------------------
model, run, variable: E3SM-1-0 r1i2p2f1 siconc
test_data (model in this case) full_path:
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_185001-185912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_186001-186912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_187001-187912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_188001-188912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_189001-189912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_190001-190912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_191001-191912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_192001-192912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_193001-193912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_194001-194912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_195001-195912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_196001-196912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_197001-197912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_198001-198912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_199001-199912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_200001-200912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_201001-201112.nc
Converting units by  multiply 0.01
No land/sea mask file found for E3SM-1-0 r1i2p2f1
Creating land/sea mask.
Writing climatology netcdf sea_ice_demo/ex1/netcdf/sic_clim_E3SM-1-0_r1i2p2f1_1981_2010.nc
/home/lee1043/.conda/envs/pcmdi_metrics_dev_20241216/lib/python3.10/site-packages/dask/_task_spec.py:740: RuntimeWarning: invalid value encountered in divide
  return self.func(*new_argspec)
Getting regional areas for run

-------------------------------------------
Calculating model regional average metrics
for  E3SM-1-0
--------------------------------------------
arctic
ca
na
np
antarctic
sp
sa
io
INFO::2024-12-16 17:24::pcmdi_metrics:: Results saved to a json file: /home/lee1043/git/pcmdi_metrics_20241112/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex1/sea_ice_metrics.json
2024-12-16 17:24:04,863 [INFO]: base.py(write:422) >> Results saved to a json file: /home/lee1043/git/pcmdi_metrics_20241112/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex1/sea_ice_metrics.json
2024-12-16 17:24:04,863 [INFO]: base.py(write:422) >> Results saved to a json file: /home/lee1043/git/pcmdi_metrics_20241112/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex1/sea_ice_metrics.json
INFO::2024-12-16 17:24::pcmdi_metrics:: Results saved to a json file: /home/lee1043/git/pcmdi_metrics_20241112/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex1/sea_ice_data.json
2024-12-16 17:24:20,986 [INFO]: base.py(write:422) >> Results saved to a json file: /home/lee1043/git/pcmdi_metrics_20241112/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex1/sea_ice_data.json
2024-12-16 17:24:20,986 [INFO]: base.py(write:422) >> Results saved to a json file: /home/lee1043/git/pcmdi_metrics_20241112/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex1/sea_ice_data.json
Creating metrics bar chart.
Creating annual cycle figures.
Creating maps.
Cleaning up.
Deleting netcdf files.
Could not delete netcdf directory  sea_ice_demo/ex1/netcdf
[Errno 39] Directory not empty: 'sea_ice_demo/ex1/netcdf'
Writing metadata file.
CPU times: user 54.9 ms, sys: 13.1 ms, total: 68 ms
Wall time: 6min 24s

One of the primary outputs of the PMP is a JSON file containing the metrics values. In this case, the metrics are the mean square errors of the time mean and monthly mean ice extent. Ice extent is defined as the total area covered by sea ice concentration of >= 15%. The metrics are organized by model, realization, and reference dataset.

The metrics JSON from this run is displayed below.

[12]:
with open("sea_ice_demo/ex1/sea_ice_metrics.json") as f:
    print(f.read())
{
    "DIMENSIONS": {
        "index": {
            "monthly_clim": "Monthly climatology of extent",
            "total_extent": "Sum of ice coverage where concentration > 15%"
        },
        "json_structure": [
            "region",
            "realization",
            "obs",
            "index",
            "statistic"
        ],
        "model": [
            "E3SM-1-0"
        ],
        "region": [
            "arctic",
            "ca",
            "na",
            "np",
            "antarctic",
            "io",
            "sa",
            "sp"
        ],
        "statistic": {
            "mse": "Mean Square Error (10^12 km^4)"
        }
    },
    "RESULTS": {
        "E3SM-1-0": {
            "antarctic": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.3224829985071201"
                        },
                        "total_extent": {
                            "mse": "0.21094145964623673"
                        }
                    }
                },
                "r1i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.3224829985071201"
                        },
                        "total_extent": {
                            "mse": "0.21094145964623673"
                        }
                    }
                }
            },
            "arctic": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "1.2997445969100574"
                        },
                        "total_extent": {
                            "mse": "2.030507158527881"
                        }
                    }
                },
                "r1i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "1.2997445969100572"
                        },
                        "total_extent": {
                            "mse": "2.030507158527881"
                        }
                    }
                }
            },
            "ca": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.05035142426809447"
                        },
                        "total_extent": {
                            "mse": "4.1785016078305246e-05"
                        }
                    }
                },
                "r1i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.05035142426809447"
                        },
                        "total_extent": {
                            "mse": "4.1785016078305246e-05"
                        }
                    }
                }
            },
            "io": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.04058821765045104"
                        },
                        "total_extent": {
                            "mse": "0.01237930945282938"
                        }
                    }
                },
                "r1i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.04058821765045104"
                        },
                        "total_extent": {
                            "mse": "0.01237930945282938"
                        }
                    }
                }
            },
            "na": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.5678330040810852"
                        },
                        "total_extent": {
                            "mse": "0.9514249147235673"
                        }
                    }
                },
                "r1i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.5678330040810853"
                        },
                        "total_extent": {
                            "mse": "0.9514249147235673"
                        }
                    }
                }
            },
            "np": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.2698335380330728"
                        },
                        "total_extent": {
                            "mse": "0.21846457619506263"
                        }
                    }
                },
                "r1i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.26983353803307286"
                        },
                        "total_extent": {
                            "mse": "0.21846457619506263"
                        }
                    }
                }
            },
            "sa": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.0823791567667957"
                        },
                        "total_extent": {
                            "mse": "0.30289427422253834"
                        }
                    }
                },
                "r1i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.0823791567667957"
                        },
                        "total_extent": {
                            "mse": "0.30289427422253834"
                        }
                    }
                }
            },
            "sp": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.5695004447566266"
                        },
                        "total_extent": {
                            "mse": "0.044574352751696585"
                        }
                    }
                },
                "r1i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.5695004447566266"
                        },
                        "total_extent": {
                            "mse": "0.044574352751696585"
                        }
                    }
                }
            }
        }
    },
    "json_structure": [
        "region",
        "realization",
        "obs",
        "index",
        "statistic"
    ],
    "json_version": 3.0,
    "model_year_range": {
        "E3SM-1-0": [
            "1981",
            "2010"
        ]
    },
    "provenance": {
        "commandLine": "/home/lee1043/.conda/envs/pcmdi_metrics_dev_20241216/bin/sea_ice_driver.py -p sea_ice_param.py",
        "conda": {
            "Platform": "linux-64",
            "PythonVersion": "3.10.12.final.0",
            "Version": "23.3.1",
            "buildVersion": "not installed"
        },
        "date": "2024-12-16 17:23:48",
        "openGL": {
            "GLX": {
                "client": {
                    "vendor": "Mesa Project and SGI",
                    "version": "1.4"
                },
                "server": {
                    "vendor": "SGI",
                    "version": "1.4"
                },
                "version": "1.4"
            },
            "renderer": "llvmpipe (LLVM 17.0.6, 256 bits)",
            "shading language version": "4.50",
            "vendor": "Mesa",
            "version": "4.5 (Compatibility Profile) Mesa 23.1.4"
        },
        "osAccess": false,
        "packages": {
            "PMP": "3.8",
            "PMPObs": "See 'References' key below, for detailed obs provenance information.",
            "cdat_info": "8.2.1",
            "cdms": "3.1.5",
            "cdp": "1.7.0",
            "cdtime": "3.1.4",
            "cdutil": "8.2.1",
            "esmf": "0.8.8",
            "esmpy": "8.7.0",
            "matplotlib": "3.10.0",
            "numpy": "2.0.2",
            "python": "3.10.10",
            "scipy": "1.14.1",
            "xarray": "2024.10.0",
            "xcdat": "0.7.3"
        },
        "platform": {
            "Name": "gates.llnl.gov",
            "OS": "Linux",
            "Version": "4.18.0-553.27.1.el8_10.x86_64"
        },
        "userId": "lee1043"
    }
}

This driver also outputs a bar chart that visualizes the mean square error between the model and observations. Since there is only one model and one realization in this instance, the bar chart looks very simple. The red bar indicates the mean square error for the time mean ice extent, and the blue bar indicates the mean square error for the climatological ice extent.

[13]:
!ls {"sea_ice_demo/ex1/plot/MSE_bar_chart.png"}
sea_ice_demo/ex1/plot/MSE_bar_chart.png
[14]:
a = Image("sea_ice_demo/ex1/plot/MSE_bar_chart.png")
display_png(a)
../_images/examples_Demo_9_seaIceExtent_ivanova_33_0.png

4. Working with multiple realizations

The sea ice driver can generate metrics based on an average of all available realizations. To do so, provide an asterisk * as the value to the –realization argument on the command line. Options passed on the command line will supercede arguments in the parameter file.

In addition, we set the –case_id value to ‘ex2’ to save results in a new directory.

Below process will take about 5 minutes.

Go back to Top

[15]:
%%time
%%bash
sea_ice_driver.py -p sea_ice_param.py --realization '*' --case_id "ex2"
Model list: ['E3SM-1-0']
Find all realizations: True
OBS: Arctic
Converting units by  multiply 0.01
Writing climatology netcdf
OBS: Antarctic
Converting units by  multiply 0.01
Writing climatology netcdf
Model list: ['E3SM-1-0']
finding all realizations

=================================
model, runs: E3SM-1-0 ['r1i2p2f1', 'r2i2p2f1', 'r3i2p2f1', 'r4i2p2f1']
['r1i2p2f1', 'r2i2p2f1', 'r3i2p2f1', 'r4i2p2f1']
/p/user_pub/pmp/demo/sea-ice/links_area/E3SM-1-0/*.nc
Converting units by  multiply 1e-06

-----------------------
model, run, variable: E3SM-1-0 r1i2p2f1 siconc
test_data (model in this case) full_path:
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_185001-185912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_186001-186912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_187001-187912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_188001-188912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_189001-189912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_190001-190912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_191001-191912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_192001-192912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_193001-193912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_194001-194912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_195001-195912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_196001-196912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_197001-197912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_198001-198912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_199001-199912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_200001-200912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_201001-201112.nc
Converting units by  multiply 0.01
No land/sea mask file found for E3SM-1-0 r1i2p2f1
Creating land/sea mask.
Writing climatology netcdf sea_ice_demo/ex2/netcdf/sic_clim_E3SM-1-0_r1i2p2f1_1981_2010.nc
/home/lee1043/.conda/envs/pcmdi_metrics_dev_20241216/lib/python3.10/site-packages/dask/_task_spec.py:740: RuntimeWarning: invalid value encountered in divide
  return self.func(*new_argspec)
Getting regional areas for run

-----------------------
model, run, variable: E3SM-1-0 r2i2p2f1 siconc
test_data (model in this case) full_path:
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_185001-185912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_186001-186912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_187001-187912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_188001-188912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_189001-189912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_190001-190912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_191001-191912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_192001-192912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_193001-193912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_194001-194912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_195001-195912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_196001-196912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_197001-197912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_198001-198912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_199001-199912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_200001-200912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_201001-201312.nc
Converting units by  multiply 0.01
No land/sea mask file found for E3SM-1-0 r2i2p2f1
Creating land/sea mask.
Writing climatology netcdf sea_ice_demo/ex2/netcdf/sic_clim_E3SM-1-0_r2i2p2f1_1981_2010.nc
/home/lee1043/.conda/envs/pcmdi_metrics_dev_20241216/lib/python3.10/site-packages/dask/_task_spec.py:740: RuntimeWarning: invalid value encountered in divide
  return self.func(*new_argspec)
Getting regional areas for run

-----------------------
model, run, variable: E3SM-1-0 r3i2p2f1 siconc
test_data (model in this case) full_path:
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_185001-185912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_186001-186912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_187001-187912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_188001-188912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_189001-189912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_190001-190912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_191001-191912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_192001-192912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_193001-193912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_194001-194912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_195001-195912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_196001-196912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_197001-197912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_198001-198912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_199001-199912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_200001-200912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_201001-201412.nc
Converting units by  multiply 0.01
No land/sea mask file found for E3SM-1-0 r3i2p2f1
Creating land/sea mask.
Writing climatology netcdf sea_ice_demo/ex2/netcdf/sic_clim_E3SM-1-0_r3i2p2f1_1981_2010.nc
/home/lee1043/.conda/envs/pcmdi_metrics_dev_20241216/lib/python3.10/site-packages/dask/_task_spec.py:740: RuntimeWarning: invalid value encountered in divide
  return self.func(*new_argspec)
Getting regional areas for run

-----------------------
model, run, variable: E3SM-1-0 r4i2p2f1 siconc
test_data (model in this case) full_path:
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_185001-185912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_186001-186912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_187001-187912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_188001-188912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_189001-189912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_190001-190912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_191001-191912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_192001-192912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_193001-193912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_194001-194912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_195001-195912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_196001-196912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_197001-197912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_198001-198912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_199001-199912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_200001-200912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_201001-201412.nc
Converting units by  multiply 0.01
No land/sea mask file found for E3SM-1-0 r4i2p2f1
Creating land/sea mask.
Writing climatology netcdf sea_ice_demo/ex2/netcdf/sic_clim_E3SM-1-0_r4i2p2f1_1981_2010.nc
/home/lee1043/.conda/envs/pcmdi_metrics_dev_20241216/lib/python3.10/site-packages/dask/_task_spec.py:740: RuntimeWarning: invalid value encountered in divide
  return self.func(*new_argspec)
Getting regional areas for run

-------------------------------------------
Calculating model regional average metrics
for  E3SM-1-0
--------------------------------------------
arctic
ca
na
np
antarctic
sp
sa
io
INFO::2024-12-16 17:35::pcmdi_metrics:: Results saved to a json file: /home/lee1043/git/pcmdi_metrics_20241112/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex2/sea_ice_metrics.json
2024-12-16 17:35:25,296 [INFO]: base.py(write:422) >> Results saved to a json file: /home/lee1043/git/pcmdi_metrics_20241112/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex2/sea_ice_metrics.json
2024-12-16 17:35:25,296 [INFO]: base.py(write:422) >> Results saved to a json file: /home/lee1043/git/pcmdi_metrics_20241112/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex2/sea_ice_metrics.json
INFO::2024-12-16 17:35::pcmdi_metrics:: Results saved to a json file: /home/lee1043/git/pcmdi_metrics_20241112/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex2/sea_ice_data.json
2024-12-16 17:35:41,399 [INFO]: base.py(write:422) >> Results saved to a json file: /home/lee1043/git/pcmdi_metrics_20241112/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex2/sea_ice_data.json
2024-12-16 17:35:41,399 [INFO]: base.py(write:422) >> Results saved to a json file: /home/lee1043/git/pcmdi_metrics_20241112/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex2/sea_ice_data.json
Creating metrics bar chart.
Creating annual cycle figures.
Creating maps.
Cleaning up.
Deleting netcdf files.
Could not delete netcdf directory  sea_ice_demo/ex2/netcdf
[Errno 39] Directory not empty: 'sea_ice_demo/ex2/netcdf'
Writing metadata file.
CPU times: user 118 ms, sys: 18.8 ms, total: 137 ms
Wall time: 16min 26s

Since we have averaged four different realizations (E3SM-1-0: ‘r1i2p2f1’, ‘r2i2p2f1’, ‘r3i2p2f1’, ‘r4i2p2f1’), the resulting statistics are different than seen in example 1. The bar chart now contains markers showing the overall spread among the realizations.

[16]:
a = Image("sea_ice_demo/ex2/plot/MSE_bar_chart.png")
display_png(a)
../_images/examples_Demo_9_seaIceExtent_ivanova_39_0.png

5. Working with multiple models

Along with using multiple realizations, we can include multiple models in a single analysis. The model data must all follow a single filename template. All model inputs must use the same name and units for the sea ice variable.

The example below shows how to use three models in the analysis, with all available realizations. The models are listed as inputs to the –test_data_set flag.

Want to add more models? Six other model sea ice datasets are available in the directories linked in the notebook introduction.

Below process will take about 30 minutes.

Go back to Top

[21]:
%%time
%%bash
sea_ice_driver.py -p sea_ice_param.py \
--test_data_set "E3SM-1-0" "CanESM5" \
--realization '*' \
--case_id "ex3"
Model list: ['E3SM-1-0', 'CanESM5']
Find all realizations: True
OBS: Arctic
Converting units by  multiply 0.01
Writing climatology netcdf
OBS: Antarctic
Converting units by  multiply 0.01
Writing climatology netcdf
Model list: ['CanESM5', 'E3SM-1-0']
finding all realizations

=================================
model, runs: CanESM5 ['r2i1p1f1', 'r1i1p1f1', 'r3i1p1f1']
['r2i1p1f1', 'r1i1p1f1', 'r3i1p1f1']
/p/user_pub/pmp/demo/sea-ice/links_area/CanESM5/*.nc
Converting units by  multiply 1e-06

-----------------------
model, run, variable: CanESM5 r2i1p1f1 siconc
test_data (model in this case) full_path:
   /p/user_pub/pmp/demo/sea-ice/links_siconc/CanESM5/historical/r2i1p1f1/siconc/siconc_SImon_CanESM5_historical_r2i1p1f1_gn_185001-201412.nc
Converting units by  multiply 0.01
No land/sea mask file found for CanESM5 r2i1p1f1
Creating land/sea mask.
Writing climatology netcdf sea_ice_demo/ex3/netcdf/sic_clim_CanESM5_r2i1p1f1_1981_2010.nc
/home/lee1043/.conda/envs/pcmdi_metrics_dev_20241216/lib/python3.10/site-packages/dask/_task_spec.py:740: RuntimeWarning: invalid value encountered in divide
  return self.func(*new_argspec)
Getting regional areas for run

-----------------------
model, run, variable: CanESM5 r1i1p1f1 siconc
test_data (model in this case) full_path:
   /p/user_pub/pmp/demo/sea-ice/links_siconc/CanESM5/historical/r1i1p1f1/siconc/siconc_SImon_CanESM5_historical_r1i1p1f1_gn_185001-201412.nc
Converting units by  multiply 0.01
No land/sea mask file found for CanESM5 r1i1p1f1
Creating land/sea mask.
Writing climatology netcdf sea_ice_demo/ex3/netcdf/sic_clim_CanESM5_r1i1p1f1_1981_2010.nc
/home/lee1043/.conda/envs/pcmdi_metrics_dev_20241216/lib/python3.10/site-packages/dask/_task_spec.py:740: RuntimeWarning: invalid value encountered in divide
  return self.func(*new_argspec)
Getting regional areas for run

-----------------------
model, run, variable: CanESM5 r3i1p1f1 siconc
test_data (model in this case) full_path:
   /p/user_pub/pmp/demo/sea-ice/links_siconc/CanESM5/historical/r3i1p1f1/siconc/siconc_SImon_CanESM5_historical_r3i1p1f1_gn_185001-201412.nc
Converting units by  multiply 0.01
No land/sea mask file found for CanESM5 r3i1p1f1
Creating land/sea mask.
Writing climatology netcdf sea_ice_demo/ex3/netcdf/sic_clim_CanESM5_r3i1p1f1_1981_2010.nc
/home/lee1043/.conda/envs/pcmdi_metrics_dev_20241216/lib/python3.10/site-packages/dask/_task_spec.py:740: RuntimeWarning: invalid value encountered in divide
  return self.func(*new_argspec)
Getting regional areas for run

-------------------------------------------
Calculating model regional average metrics
for  CanESM5
--------------------------------------------
arctic
ca
na
np
antarctic
sp
sa
io
finding all realizations

=================================
model, runs: E3SM-1-0 ['r1i2p2f1', 'r2i2p2f1', 'r3i2p2f1', 'r4i2p2f1']
['r1i2p2f1', 'r2i2p2f1', 'r3i2p2f1', 'r4i2p2f1']
/p/user_pub/pmp/demo/sea-ice/links_area/E3SM-1-0/*.nc
Converting units by  multiply 1e-06

-----------------------
model, run, variable: E3SM-1-0 r1i2p2f1 siconc
test_data (model in this case) full_path:
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_185001-185912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_186001-186912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_187001-187912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_188001-188912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_189001-189912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_190001-190912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_191001-191912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_192001-192912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_193001-193912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_194001-194912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_195001-195912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_196001-196912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_197001-197912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_198001-198912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_199001-199912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_200001-200912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r1i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r1i2p2f1_gr_201001-201112.nc
Converting units by  multiply 0.01
No land/sea mask file found for E3SM-1-0 r1i2p2f1
Creating land/sea mask.
Writing climatology netcdf sea_ice_demo/ex3/netcdf/sic_clim_E3SM-1-0_r1i2p2f1_1981_2010.nc
/home/lee1043/.conda/envs/pcmdi_metrics_dev_20241216/lib/python3.10/site-packages/dask/_task_spec.py:740: RuntimeWarning: invalid value encountered in divide
  return self.func(*new_argspec)
Getting regional areas for run

-----------------------
model, run, variable: E3SM-1-0 r2i2p2f1 siconc
test_data (model in this case) full_path:
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_185001-185912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_186001-186912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_187001-187912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_188001-188912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_189001-189912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_190001-190912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_191001-191912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_192001-192912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_193001-193912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_194001-194912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_195001-195912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_196001-196912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_197001-197912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_198001-198912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_199001-199912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_200001-200912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r2i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r2i2p2f1_gr_201001-201312.nc
Converting units by  multiply 0.01
No land/sea mask file found for E3SM-1-0 r2i2p2f1
Creating land/sea mask.
Writing climatology netcdf sea_ice_demo/ex3/netcdf/sic_clim_E3SM-1-0_r2i2p2f1_1981_2010.nc
/home/lee1043/.conda/envs/pcmdi_metrics_dev_20241216/lib/python3.10/site-packages/dask/_task_spec.py:740: RuntimeWarning: invalid value encountered in divide
  return self.func(*new_argspec)
Getting regional areas for run

-----------------------
model, run, variable: E3SM-1-0 r3i2p2f1 siconc
test_data (model in this case) full_path:
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_185001-185912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_186001-186912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_187001-187912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_188001-188912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_189001-189912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_190001-190912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_191001-191912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_192001-192912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_193001-193912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_194001-194912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_195001-195912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_196001-196912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_197001-197912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_198001-198912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_199001-199912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_200001-200912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r3i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r3i2p2f1_gr_201001-201412.nc
Converting units by  multiply 0.01
No land/sea mask file found for E3SM-1-0 r3i2p2f1
Creating land/sea mask.
Writing climatology netcdf sea_ice_demo/ex3/netcdf/sic_clim_E3SM-1-0_r3i2p2f1_1981_2010.nc
/home/lee1043/.conda/envs/pcmdi_metrics_dev_20241216/lib/python3.10/site-packages/dask/_task_spec.py:740: RuntimeWarning: invalid value encountered in divide
  return self.func(*new_argspec)
Getting regional areas for run

-----------------------
model, run, variable: E3SM-1-0 r4i2p2f1 siconc
test_data (model in this case) full_path:
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_185001-185912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_186001-186912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_187001-187912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_188001-188912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_189001-189912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_190001-190912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_191001-191912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_192001-192912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_193001-193912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_194001-194912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_195001-195912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_196001-196912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_197001-197912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_198001-198912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_199001-199912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_200001-200912.nc
   /p/user_pub/pmp/demo/sea-ice/links_siconc/E3SM-1-0/historical/r4i2p2f1/siconc/siconc_SImon_E3SM-1-0_historical_r4i2p2f1_gr_201001-201412.nc
Converting units by  multiply 0.01
No land/sea mask file found for E3SM-1-0 r4i2p2f1
Creating land/sea mask.
Writing climatology netcdf sea_ice_demo/ex3/netcdf/sic_clim_E3SM-1-0_r4i2p2f1_1981_2010.nc
/home/lee1043/.conda/envs/pcmdi_metrics_dev_20241216/lib/python3.10/site-packages/dask/_task_spec.py:740: RuntimeWarning: invalid value encountered in divide
  return self.func(*new_argspec)
Getting regional areas for run

-------------------------------------------
Calculating model regional average metrics
for  E3SM-1-0
--------------------------------------------
arctic
ca
na
np
antarctic
sp
sa
io
INFO::2024-12-16 22:03::pcmdi_metrics:: Results saved to a json file: /home/lee1043/git/pcmdi_metrics_20241112/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex3/sea_ice_metrics.json
2024-12-16 22:03:04,971 [INFO]: base.py(write:422) >> Results saved to a json file: /home/lee1043/git/pcmdi_metrics_20241112/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex3/sea_ice_metrics.json
2024-12-16 22:03:04,971 [INFO]: base.py(write:422) >> Results saved to a json file: /home/lee1043/git/pcmdi_metrics_20241112/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex3/sea_ice_metrics.json
INFO::2024-12-16 22:03::pcmdi_metrics:: Results saved to a json file: /home/lee1043/git/pcmdi_metrics_20241112/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex3/sea_ice_data.json
2024-12-16 22:03:21,529 [INFO]: base.py(write:422) >> Results saved to a json file: /home/lee1043/git/pcmdi_metrics_20241112/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex3/sea_ice_data.json
2024-12-16 22:03:21,529 [INFO]: base.py(write:422) >> Results saved to a json file: /home/lee1043/git/pcmdi_metrics_20241112/pcmdi_metrics/doc/jupyter/Demo/sea_ice_demo/ex3/sea_ice_data.json
Creating metrics bar chart.
Creating annual cycle figures.
Creating maps.
Cleaning up.
Deleting netcdf files.
Could not delete netcdf directory  sea_ice_demo/ex3/netcdf
[Errno 39] Directory not empty: 'sea_ice_demo/ex3/netcdf'
Writing metadata file.
CPU times: user 196 ms, sys: 30.2 ms, total: 226 ms
Wall time: 27min 46s

The output JSON now includes metrics for all three models.

[22]:
with open("sea_ice_demo/ex3/sea_ice_metrics.json") as f:
    print(f.read())
{
    "DIMENSIONS": {
        "index": {
            "monthly_clim": "Monthly climatology of extent",
            "total_extent": "Sum of ice coverage where concentration > 15%"
        },
        "json_structure": [
            "region",
            "realization",
            "obs",
            "index",
            "statistic"
        ],
        "model": [
            "CanESM5",
            "E3SM-1-0"
        ],
        "region": [
            "arctic",
            "ca",
            "na",
            "np",
            "antarctic",
            "io",
            "sa",
            "sp"
        ],
        "statistic": {
            "mse": "Mean Square Error (10^12 km^4)"
        }
    },
    "RESULTS": {
        "CanESM5": {
            "antarctic": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.2863044719173771"
                        },
                        "total_extent": {
                            "mse": "4.5426586305651595"
                        }
                    }
                },
                "r1i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.2705434742750473"
                        },
                        "total_extent": {
                            "mse": "3.319146030861845"
                        }
                    }
                },
                "r2i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.30728644012985534"
                        },
                        "total_extent": {
                            "mse": "4.817666618178247"
                        }
                    }
                },
                "r3i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.2911363660807351"
                        },
                        "total_extent": {
                            "mse": "5.6514761857693845"
                        }
                    }
                }
            },
            "arctic": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.07411834845041909"
                        },
                        "total_extent": {
                            "mse": "1.5344742725834581"
                        }
                    }
                },
                "r1i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.08979048605173122"
                        },
                        "total_extent": {
                            "mse": "0.9847816473978805"
                        }
                    }
                },
                "r2i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.06845091420565763"
                        },
                        "total_extent": {
                            "mse": "1.6853482992870932"
                        }
                    }
                },
                "r3i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.07207080262300991"
                        },
                        "total_extent": {
                            "mse": "2.032465523684063"
                        }
                    }
                }
            },
            "ca": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.06337143992468101"
                        },
                        "total_extent": {
                            "mse": "0.02640469011536679"
                        }
                    }
                },
                "r1i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.03160969354601583"
                        },
                        "total_extent": {
                            "mse": "0.008373232180792839"
                        }
                    }
                },
                "r2i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.09389608579603158"
                        },
                        "total_extent": {
                            "mse": "0.04769850188410871"
                        }
                    }
                },
                "r3i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.07448799006645515"
                        },
                        "total_extent": {
                            "mse": "0.031534786726365796"
                        }
                    }
                }
            },
            "io": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.045733895043541535"
                        },
                        "total_extent": {
                            "mse": "0.33202135970984636"
                        }
                    }
                },
                "r1i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.04068559943868483"
                        },
                        "total_extent": {
                            "mse": "0.223161551983003"
                        }
                    }
                },
                "r2i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.04402117613288888"
                        },
                        "total_extent": {
                            "mse": "0.33563892555535735"
                        }
                    }
                },
                "r3i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.055475410735309094"
                        },
                        "total_extent": {
                            "mse": "0.458187558303221"
                        }
                    }
                }
            },
            "na": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.1474435884020498"
                        },
                        "total_extent": {
                            "mse": "1.1861799269753535"
                        }
                    }
                },
                "r1i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.16950880113910566"
                        },
                        "total_extent": {
                            "mse": "0.8958350410205203"
                        }
                    }
                },
                "r2i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.13176263096988186"
                        },
                        "total_extent": {
                            "mse": "1.1190421296472655"
                        }
                    }
                },
                "r3i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.1436692989230506"
                        },
                        "total_extent": {
                            "mse": "1.5952274178728996"
                        }
                    }
                }
            },
            "np": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.005505234745028006"
                        },
                        "total_extent": {
                            "mse": "1.3561933179738154e-06"
                        }
                    }
                },
                "r1i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.008419599678435448"
                        },
                        "total_extent": {
                            "mse": "0.0011396633888848223"
                        }
                    }
                },
                "r2i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.005743951140632314"
                        },
                        "total_extent": {
                            "mse": "0.0011312589297581587"
                        }
                    }
                },
                "r3i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.004720183876826419"
                        },
                        "total_extent": {
                            "mse": "1.134991428164361e-05"
                        }
                    }
                }
            },
            "sa": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.2450780999210057"
                        },
                        "total_extent": {
                            "mse": "0.21829594776003455"
                        }
                    }
                },
                "r1i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.20065116730213245"
                        },
                        "total_extent": {
                            "mse": "0.16093691606448515"
                        }
                    }
                },
                "r2i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.3010371681411025"
                        },
                        "total_extent": {
                            "mse": "0.18549791220930334"
                        }
                    }
                },
                "r3i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.2420963282798433"
                        },
                        "total_extent": {
                            "mse": "0.3246725364168564"
                        }
                    }
                }
            },
            "sp": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.015235547619518137"
                        },
                        "total_extent": {
                            "mse": "1.2027638101853915"
                        }
                    }
                },
                "r1i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.015036314044390545"
                        },
                        "total_extent": {
                            "mse": "0.9159856464507651"
                        }
                    }
                },
                "r2i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.018229759530918058"
                        },
                        "total_extent": {
                            "mse": "1.4248466137382687"
                        }
                    }
                },
                "r3i1p1f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.015513614463929789"
                        },
                        "total_extent": {
                            "mse": "1.298179698530641"
                        }
                    }
                }
            }
        },
        "E3SM-1-0": {
            "antarctic": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.2712910250837596"
                        },
                        "total_extent": {
                            "mse": "0.641406992392678"
                        }
                    }
                },
                "r1i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.3224829985071201"
                        },
                        "total_extent": {
                            "mse": "0.21094145964623673"
                        }
                    }
                },
                "r2i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.26877288912334857"
                        },
                        "total_extent": {
                            "mse": "0.6598404486630004"
                        }
                    }
                },
                "r3i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.2435705245925407"
                        },
                        "total_extent": {
                            "mse": "0.8575345935924709"
                        }
                    }
                },
                "r4i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.2759737924697999"
                        },
                        "total_extent": {
                            "mse": "1.011824021687754"
                        }
                    }
                }
            },
            "arctic": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "1.1600970808740905"
                        },
                        "total_extent": {
                            "mse": "2.005831055976063"
                        }
                    }
                },
                "r1i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "1.2997445969100572"
                        },
                        "total_extent": {
                            "mse": "2.030507158527881"
                        }
                    }
                },
                "r2i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "1.197184843341671"
                        },
                        "total_extent": {
                            "mse": "1.6265473421554568"
                        }
                    }
                },
                "r3i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "1.0818924321222867"
                        },
                        "total_extent": {
                            "mse": "2.3876574150640635"
                        }
                    }
                },
                "r4i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "1.0750233178668298"
                        },
                        "total_extent": {
                            "mse": "2.015177995502851"
                        }
                    }
                }
            },
            "ca": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.06556676468015667"
                        },
                        "total_extent": {
                            "mse": "0.0008318821313221659"
                        }
                    }
                },
                "r1i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.05035142426809447"
                        },
                        "total_extent": {
                            "mse": "4.1785016078305246e-05"
                        }
                    }
                },
                "r2i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.05264997712274583"
                        },
                        "total_extent": {
                            "mse": "1.4444811574992051e-05"
                        }
                    }
                },
                "r3i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.08886471001969645"
                        },
                        "total_extent": {
                            "mse": "0.0050768997960854425"
                        }
                    }
                },
                "r4i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.07659164328504993"
                        },
                        "total_extent": {
                            "mse": "0.0029573874530499232"
                        }
                    }
                }
            },
            "io": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.05645457530158846"
                        },
                        "total_extent": {
                            "mse": "0.03782377154869018"
                        }
                    }
                },
                "r1i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.04058821765045104"
                        },
                        "total_extent": {
                            "mse": "0.01237930945282938"
                        }
                    }
                },
                "r2i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.05178485578464389"
                        },
                        "total_extent": {
                            "mse": "0.02373863421036596"
                        }
                    }
                },
                "r3i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.06850728010096704"
                        },
                        "total_extent": {
                            "mse": "0.07066570595587236"
                        }
                    }
                },
                "r4i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.07015095590607602"
                        },
                        "total_extent": {
                            "mse": "0.06089412264247427"
                        }
                    }
                }
            },
            "na": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.5269113737615976"
                        },
                        "total_extent": {
                            "mse": "0.9028520120169525"
                        }
                    }
                },
                "r1i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.5678330040810853"
                        },
                        "total_extent": {
                            "mse": "0.9514249147235673"
                        }
                    }
                },
                "r2i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.5186230160573806"
                        },
                        "total_extent": {
                            "mse": "0.7258633199904024"
                        }
                    }
                },
                "r3i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.5373451503952179"
                        },
                        "total_extent": {
                            "mse": "1.0999193024571021"
                        }
                    }
                },
                "r4i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.48714115101035943"
                        },
                        "total_extent": {
                            "mse": "0.8548562691208009"
                        }
                    }
                }
            },
            "np": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.2582252598388087"
                        },
                        "total_extent": {
                            "mse": "0.20118045523960082"
                        }
                    }
                },
                "r1i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.26983353803307286"
                        },
                        "total_extent": {
                            "mse": "0.21846457619506263"
                        }
                    }
                },
                "r2i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.2572838524749538"
                        },
                        "total_extent": {
                            "mse": "0.19205408318339318"
                        }
                    }
                },
                "r3i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.24350176575462187"
                        },
                        "total_extent": {
                            "mse": "0.19020142229135586"
                        }
                    }
                },
                "r4i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.2635264177480379"
                        },
                        "total_extent": {
                            "mse": "0.20463245826006815"
                        }
                    }
                }
            },
            "sa": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.08526540810855696"
                        },
                        "total_extent": {
                            "mse": "0.4135687698582245"
                        }
                    }
                },
                "r1i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.0823791567667957"
                        },
                        "total_extent": {
                            "mse": "0.30289427422253834"
                        }
                    }
                },
                "r2i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.07452315066382884"
                        },
                        "total_extent": {
                            "mse": "0.3648846350157542"
                        }
                    }
                },
                "r3i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.09076642601966597"
                        },
                        "total_extent": {
                            "mse": "0.46250787386653075"
                        }
                    }
                },
                "r4i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.09823531333025226"
                        },
                        "total_extent": {
                            "mse": "0.5444640379137466"
                        }
                    }
                }
            },
            "sp": {
                "model_mean": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.49019224280507556"
                        },
                        "total_extent": {
                            "mse": "0.002069034460989729"
                        }
                    }
                },
                "r1i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.5695004447566266"
                        },
                        "total_extent": {
                            "mse": "0.044574352751696585"
                        }
                    }
                },
                "r2i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.4294712533526206"
                        },
                        "total_extent": {
                            "mse": "0.002059944324885434"
                        }
                    }
                },
                "r3i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.4965352557784154"
                        },
                        "total_extent": {
                            "mse": "0.0008218479438377459"
                        }
                    }
                },
                "r4i2p2f1": {
                    "OSI-SAF": {
                        "monthly_clim": {
                            "mse": "0.47450029334958926"
                        },
                        "total_extent": {
                            "mse": "0.0001552792507891479"
                        }
                    }
                }
            }
        }
    },
    "json_structure": [
        "region",
        "realization",
        "obs",
        "index",
        "statistic"
    ],
    "json_version": 3.0,
    "model_year_range": {
        "CanESM5": [
            "1981",
            "2010"
        ],
        "E3SM-1-0": [
            "1981",
            "2010"
        ]
    },
    "provenance": {
        "commandLine": "/home/lee1043/.conda/envs/pcmdi_metrics_dev_20241216/bin/sea_ice_driver.py -p sea_ice_param.py --test_data_set E3SM-1-0 CanESM5 --realization * --case_id ex3",
        "conda": {
            "Platform": "linux-64",
            "PythonVersion": "3.10.12.final.0",
            "Version": "23.3.1",
            "buildVersion": "not installed"
        },
        "date": "2024-12-16 22:02:43",
        "openGL": {
            "GLX": {
                "client": {
                    "vendor": "Mesa Project and SGI",
                    "version": "1.4"
                },
                "server": {
                    "vendor": "SGI",
                    "version": "1.4"
                },
                "version": "1.4"
            },
            "renderer": "llvmpipe (LLVM 17.0.6, 256 bits)",
            "shading language version": "4.50",
            "vendor": "Mesa",
            "version": "4.5 (Compatibility Profile) Mesa 23.1.4"
        },
        "osAccess": false,
        "packages": {
            "PMP": "3.8",
            "PMPObs": "See 'References' key below, for detailed obs provenance information.",
            "cdat_info": "8.2.1",
            "cdms": "3.1.5",
            "cdp": "1.7.0",
            "cdtime": "3.1.4",
            "cdutil": "8.2.1",
            "esmf": "0.8.8",
            "esmpy": "8.7.0",
            "matplotlib": "3.10.0",
            "numpy": "2.0.2",
            "python": "3.10.10",
            "scipy": "1.14.1",
            "xarray": "2024.10.0",
            "xcdat": "0.7.3"
        },
        "platform": {
            "Name": "gates.llnl.gov",
            "OS": "Linux",
            "Version": "4.18.0-553.27.1.el8_10.x86_64"
        },
        "userId": "lee1043"
    }
}

Now the resulting bar chart shows three different models with their multiple realization spread.

[23]:
a = Image("sea_ice_demo/ex3/plot/MSE_bar_chart.png")
display_png(a)
../_images/examples_Demo_9_seaIceExtent_ivanova_47_0.png

6. Further exploration

Maybe you want to compare more models, or take a closer look at the model data? Here are links to the data for further exploration.

As a reminder, data for eight CMIP6 models (ACCESS-CM2, ACCESS-ESM1-5, CanESM5, CAS-ESM2-0, E3SM-1-0, E3SM-2-0, GFDL-ESM4, MIROC6, with 30 realizations in total across the model suite) is available here:

/p/user_pub/pmp/demo/sea-ice/links_siconc
/p/user_pub/pmp/demo/sea-ice/links_area

Note, expanding the “Working with multiple models” to include all available models will extend run time to around 15 minutes.

The observational time series can be found at:

/p/user_pub/pmp/demo/sea-ice/EUMETSAT

For some example plotting code using xcdat and matplotlib, see the scripts that were used to generate the introductory figures:

sea_ice_sector_plots.py
sea_ice_line_plots.py

Further exploration of the above datasets can be found in our supplemental Jupyter notebook: Demo_9b_seaIce_data_explore.ipynb

7. Debugging the LLNL Nimbus binder environment

For CAMAS workshop users, if you hit an issue at login

Launching server...
Launch attempt 1 failed, retrying...
Launch attempt 2 failed, retrying...
Launch attempt 3 failed, retrying...
User $id already has a running server.

The fix is to login (using your GitHub credentials) using https://binder-nimbus.llnl.gov/hub/home and select “Stop My Server”.

Once you refresh the start page (https://binder-nimbus.llnl.gov), login and start again, it should work as expected

Go back to Top