Ignore:
Timestamp:
09/01/16 07:55:20 (5 years ago)
Author:
mjuckes
Message:

updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CMIP6dreqbuild/trunk/src/framework/dreqPy/scope.py

    r536 r546  
    4444  else: 
    4545    return min( [a,b] ) 
     46 
     47def filter2( a, b, tt, tm ): 
     48## largest tier less than or equal to tm 
     49  t1 = [t for t in tt if t <= tm][-1] 
     50  it1 = tt.index(t1) 
     51  aa = a[it1] 
     52  if b < 0: 
     53    return aa 
     54  else: 
     55    return min( [aa,b] ) 
    4656 
    4757npy = {'daily':365, u'Annual':1, u'fx':0.01, u'1hr':24*365, u'3hr':8*365, u'monClim':12, u'Timestep':100, u'6hr':4*365, u'day':365, u'1day':365, u'mon':12, u'yr':1, u'1mon':12, 'month':12, 'year':1, 'monthly':12, 'hr':24*365, 'other':24*365, 'subhr':24*365, 'Day':365, '6h':4*365, 
     
    482492      for i in expts: 
    483493        if self.dq.inx.uid[i]._h.label == 'experiment': 
    484           if self.dq.inx.uid[i].tier <= self.tierMax: 
     494          if self.dq.inx.uid[i].tier[0] <= self.tierMax: 
    485495            expts1.append( i ) 
    486496        elif self.dq.inx.uid[i]._h.label == 'exptgroup': 
     
    525535 
    526536    if self.tierMax > 0: 
    527       expts = [i for i in expts if self.dq.inx.uid[i].tier <= self.tierMax] 
     537      expts = [i for i in expts if self.dq.inx.uid[i].tier[0] <= self.tierMax] 
     538 
     539    self.multiTierOnly = False 
     540    if self.multiTierOnly: 
     541      expts = [i for i in expts if len(self.dq.inx.uid[i].tier) > 1] 
     542      print 'Len expts: ',len(expts) 
    528543 
    529544    if len(expts) > 0: 
     
    532547        if i._h.label != 'experiment': 
    533548          mlg.prnt ( 'ERROR: %s, %s, %s ' % ( u,i._h.label, i.label, i.title ) ) 
    534       dat = [ (i.ntot, i.yps, i.ensz, i.nstart, filter1(i.yps,rqi.nymax), filter1(i.ensz,rqi.nenmax) ) for i in e] 
     549      dat = [ (i.ntot, i.yps, i.ensz, i.tier, i.nstart, filter1(i.yps,rqi.nymax), filter2(i.ensz,rqi.nenmax,i.tier,self.tierMax) ) for i in e] 
    535550      nytot = sum( [x[-2]*x[-1] for x in dat ] ) 
     551      ##print dat, nytot, self.tierMax, rqi.nenmax 
    536552    else: 
    537553      dat = [ (0,0,0,0,0) ] 
Note: See TracChangeset for help on using the changeset viewer.