#!/usr/bin/env python # Wenchang Yang (wenchang@princeton.edu) # Wed Sep 18 23:01:01 EDT 2019 #import os.path, sys, os import matplotlib.pyplot as plt import xarray as xr, numpy as np, pandas as pd figname = 'fig_ts_tropMean.png' plt.figure(figsize=(8,4)) # ctl label = 'CTL' ifile = 'data/CTL1860_newdiag_tigercpu_intelmpi_18_576PE.t_surf.tropMean.0001-1000.nc' da = xr.open_dataarray(ifile) da.groupby('time.year').mean('time').plot(color='k', label=label) # m6 label = '$-$6% solar' ifile = 'data/m6p0sol_CTL1860_tigercpu_intelmpi_18_576PE.t_surf.tropMean.0101-0597.nc' da = xr.open_dataarray(ifile) da.groupby('time.year').mean('time').plot(label=label) # p6 label = '+6% solar' ifile = 'data/p6p0sol_CTL1860_tigercpu_intelmpi_18_576PE.t_surf.tropMean.0101-0400.nc' da = xr.open_dataarray(ifile) da.groupby('time.year').mean('time').plot(label=label) # m6 recover label = '$-$6% recover' ifile = 'data/m6p0sol_CTL1860_recover0501_tigercpu_intelmpi_18_576PE.t_surf.tropMean.0501-0900.nc' da = xr.open_dataarray(ifile) da.groupby('time.year').mean('time').plot(label=label) plt.legend() plt.ylabel('Tropical Mean Ts [K]') plt.tight_layout() plt.savefig(figname, dpi=128)