import numpy as np import constants as con import cccmaNC as cnc import cccmautils as cutl import scipy as sp import scipy.signal import matplotlib.pyplot as plt # from scipy import signal """ This class is actually for the CanESM2 LE. Not general runs. CMIP style. """ bp=con.get_basepath(runtype='CMIP') def get_timepers(casename): if casename=='piControl': timepers = ('201501-231012','231101-241012','241101-251012','251101-261012', '261101-271012','271101-281012','281101-291012','291101-301012') elif casename=='gregory_2xco2': timepers = ('245101-255012',) return timepers def build_filenames(fielddict, casename, ftype=None,timesel=None,verb=True,local=False): """ ftype and timesel are not implemented here yet. ftype: type of filename to build. Right now just 'fullts' for full timeseries or 'fullclimo' for '1950-2020_climo' or, given timesel: for styr-enyr_climo. or 'ensmean'
cmax = 8 # annual mean if level==30000: cmin = -15; cmax = 15 #cminsea=-20; cmaxsea = 20 cminm = -20; cmaxm = 20 # for monthly else: #cminsea = -15; cmaxsea = 15 cminm = -15; cmaxm = 15 # for monthly else: print 'No settings for ' + field # # # ########## Read NC data ############### bp=con.get_basepath() basepath=bp['basepath'] + model + '/'; subdir=bp['subdir'] ## plat = platform.system() ## if plat == 'Darwin': # means I'm on my mac ## basepath = '/Volumes/MyPassport1TB/DATA/CanSISE/' + model + '/' ## subdir = '/' ## else: # on linux workstation in Vic ## basepath = '/home/rkm/work/DATA/' + model + '/' ## subdir = '/ts/' # prob don't need this next chunk if looping down below @@@ if field=='turb': print 'not fully implemented! @@, no second set of sims'
import cccmaNC as cnc import cccmautils as cutl import constants as con #basedir='/HOME/rkm/work/DATA/CanESM2/' bp=con.get_basepath(runtype='CMIP',model='CanESM2') basedir = bp['basepath'] fldsfx='' casenames = ('preipreiice', 'prei2xco2iceb','pi2xco2ipulse', '2xco22xco2ice','2xco2preiice') shortnames = {'preipreiice': '1C_1I', 'prei2xco2iceb': '1C_2I', 'pi2xco2ipulse': '1C_2Ipulse', '2xco22xco2ice': '2C_2I', '2xco2preiice': '2C_1I'} def get_timeinfo(last='last100',includeyr1=False): if last=='last100': timeper1="3022-3121"; timeper2='2552-2651'; # end of 200 yr runs timeper3='2652-2751'; timeper4='3122-3221' # end of 300 yr runs timesel1='3022-01-01,3121-12-31'; timesel2='2552-01-01,2651-12-31'; timesel3='2652-01-01,2751-12-31'; timesel4="3122-01-01,3221-12-31"; timepertmp='2921-3021'; timeseltmp='2922-01-01,3021-12-31';