示例#1
0
       if exp == 'GPCC': ext = (openGPCCclim(resolution=resolution,period=prd),); axt = 'GPCC Observations' # ,period=prd
       elif exp == 'CRU': ext = (openCRUclim(period=prd),); axt = 'CRU Observations' 
       elif exp[0:5] == 'PRISM': # all PRISM derivatives
         if exp == 'PRISM': prismfile = 'prism_clim.nc'
         elif exp == 'PRISM-10km': prismfile = 'prism_10km.nc'
         if len(vars) ==1 and vars[0] == 'rain': 
           ext = (openGPCCclim(resolution='0.25'), openPRISMclim(filename=prismfile)); axt = 'PRISM (and GPCC)'
         else: ext = (openCRUclim(period='1979-2009'), openPRISMclim(filename=prismfile)); axt = 'PRISM (and CRU)'
         # ext = (openPRISMclim(),)          
       elif exp == 'CFSR': ext = (openCFSRclim(period=prd),); axt = 'CFSR Reanalysis' 
       elif exp == 'NARR': ext = (openNARRclim(),); axt = 'NARR Reanalysis'
       else: # all other uppercase names are CESM runs  
         ext = (openCESMclim(exp=exp, period=prd),)
         axt = CESMtitle.get(exp,exp)
     else: # WRF runs are all in lower case
       ext = openWRFclim(exp=exp, period=prd, domains=dom)
       axt = WRFtitle.get(exp,exp)
   exps.append(ext); axtitles.append(axt)  
 print exps[-1][-1]
 # count experiment tuples (layers per panel)
 nexps = []; nlen = len(exps)
 for n in xrange(nlen):
   if not isinstance(exps[n],(tuple,list)): # should not be necessary
     exps[n] = (exps[n],)
   nexps.append(len(exps[n])) # layer counter for each panel
 
 # get figure settings
 sf, figformat, folder, margins, caxpos, subplot, figsize, cbo = getFigureSettings(nexp=nlen, cbo=cbo)
 
 # get projections settings
 projection, grid, res = getProjectionSettings(projtype=projtype)
示例#2
0
    #  ensA = openWRFclim(exp='ens-A-ctrl', filetypes=[filename], domains=dom)
    #  ensB = openWRFclim(exp='ens-B-ctrl', filetypes=[filename], domains=dom)
    #  ensC = openWRFclim(exp='ens-C-ctrl', filetypes=[filename], domains=dom)
    ##  ctrl2 = openWRFclim(exp='ctrl-2', filetypes=[filename], domains=dom)
    ##  way2 = openWRFclim(exp='2way-ctrl', filetypes=[filename], domains=dom)
    ##  grell3 = openWRFclim(exp='grell3-ctrl', filetypes=[filename], domains=dom)
    ##  exps = [ctrl1, way2, ctrl2, grell3]; case = 'config_d%02i'%dom[-1]
    ##  axtitles = ['WRF Control-1 (GPC)','WRF 2-way Nesting','WRF Control-2 (TCS)', 'WRF Grell-3']
    #  exps = [ctrl1, ensA, ensB, ensC]; case = 'ensemble_d%02i'%dom[-1]
    #  axtitles = ['WRF Control-1', 'Ensemble-A', 'Ensemble-C', 'Ensemble-C']
    #  print ctrl1[-1]

    ## Projection RCP 8.5
    dom = (1, 2)
    ctrl1 = openWRFclim(exp='ctrl-1',
                        filetypes=['wrfsrfc_d%02i_clim_1979-1985.nc'],
                        domains=dom)
    rcp85 = openWRFclim(exp='ctrl-1-rcp85', domains=dom)
    print rcp85[-1]
    #  CFSR = openCFSRclim(filename='CFSRclimFineRes1979-1986_6.nc'); print CFSR
    #  NARR = openNARRclim(); print NARR
    exps = [ctrl1, rcp85]
    case = '2045_d%02i' % dom[-1]
    axtitles = ['WRF Control', '2045 - 2055, RCP 8.5']

    ## 1979 only
    #  dom = (1,)
    #  fdda = openWRFclim(exp='ctrl-1',filetypes=['wrfsrfc_d%02i_monthly.nc'], domains=dom)
    #  hitop = openWRFclim(exp='hitop-ctrl', domains=dom)
    #  nofdda = openWRFclim(exp='nofdda-ctrl', domains=dom)
    #  nodahi = openWRFclim(exp='nofdda-hitop', domains=dom)
示例#3
0
#  ctrl1 = openWRFclim(exp='ctrl-1', filetypes=[filename], domains=dom)
#  ensA = openWRFclim(exp='ens-A-ctrl', filetypes=[filename], domains=dom)
#  ensB = openWRFclim(exp='ens-B-ctrl', filetypes=[filename], domains=dom)
#  ensC = openWRFclim(exp='ens-C-ctrl', filetypes=[filename], domains=dom)
##  ctrl2 = openWRFclim(exp='ctrl-2', filetypes=[filename], domains=dom)
##  way2 = openWRFclim(exp='2way-ctrl', filetypes=[filename], domains=dom)
##  grell3 = openWRFclim(exp='grell3-ctrl', filetypes=[filename], domains=dom)
##  exps = [ctrl1, way2, ctrl2, grell3]; case = 'config_d%02i'%dom[-1]
##  axtitles = ['WRF Control-1 (GPC)','WRF 2-way Nesting','WRF Control-2 (TCS)', 'WRF Grell-3']
#  exps = [ctrl1, ensA, ensB, ensC]; case = 'ensemble_d%02i'%dom[-1] 
#  axtitles = ['WRF Control-1', 'Ensemble-A', 'Ensemble-C', 'Ensemble-C']
#  print ctrl1[-1]

  ## Projection RCP 8.5
  dom = (1,2)
  ctrl1 = openWRFclim(exp='ctrl-1',filetypes=['wrfsrfc_d%02i_clim_1979-1985.nc'], domains=dom)
  rcp85 = openWRFclim(exp='ctrl-1-rcp85', domains=dom); print(rcp85[-1])
#  CFSR = openCFSRclim(filename='CFSRclimFineRes1979-1986_6.nc'); print CFSR
#  NARR = openNARRclim(); print NARR
  exps = [ctrl1, rcp85]; case = '2045_d%02i'%dom[-1]
  axtitles = ['WRF Control','2045 - 2055, RCP 8.5']     
 
  ## 1979 only
#  dom = (1,)
#  fdda = openWRFclim(exp='ctrl-1',filetypes=['wrfsrfc_d%02i_monthly.nc'], domains=dom)
#  hitop = openWRFclim(exp='hitop-ctrl', domains=dom)
#  nofdda = openWRFclim(exp='nofdda-ctrl', domains=dom)
#  nodahi = openWRFclim(exp='nofdda-hitop', domains=dom)
#  exps = [fdda, hitop, nofdda, nodahi]; case = 'hitop_d%02i'%dom[-1]
#  axtitles = ['WRF Control (1979)','High-top (with Nudging)','No Spectral Nudging', 'High-top, no Nudging']
示例#4
0
                    else:
                        ext = (openCRUclim(period='1979-2009'),
                               openPRISMclim(filename=prismfile))
                        axt = 'PRISM (and CRU)'
                    # ext = (openPRISMclim(),)
                elif exp == 'CFSR':
                    ext = (openCFSRclim(period=prd), )
                    axt = 'CFSR Reanalysis'
                elif exp == 'NARR':
                    ext = (openNARRclim(), )
                    axt = 'NARR Reanalysis'
                else:  # all other uppercase names are CESM runs
                    ext = (openCESMclim(exp=exp, period=prd), )
                    axt = CESMtitle.get(exp, exp)
            else:  # WRF runs are all in lower case
                ext = openWRFclim(exp=exp, period=prd, domains=dom)
                axt = WRFtitle.get(exp, exp)
        exps.append(ext)
        axtitles.append(axt)
    print exps[-1][-1]
    # count experiment tuples (layers per panel)
    nexps = []
    nlen = len(exps)
    for n in xrange(nlen):
        if not isinstance(exps[n], (tuple, list)):  # should not be necessary
            exps[n] = (exps[n], )
        nexps.append(len(exps[n]))  # layer counter for each panel

    # get figure settings
    sf, figformat, folder, margins, caxpos, subplot, figsize, cbo = getFigureSettings(
        nexp=nlen, cbo=cbo)