Changeset 547
- Timestamp:
- 09/01/16 07:55:30 (5 years ago)
- Location:
- CMIP6dreqbuild/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
CMIP6dreqbuild/trunk/docs/vocabFrameworkSchema.xsd
r508 r547 32 32 <xs:attribute name="superclass" type="xs:string"/> 33 33 <xs:attribute name="usage" type="xs:string"/> 34 <xs:attribute name="required" type="xs:string"/> 34 35 </xs:complexType> 35 36 … … 46 47 <xs:attribute name="labUnique" type="st__labUnique_enum"/> 47 48 <xs:attribute name="itemLabelMode" type="st__itemLabelMode_enum"/> 49 <xs:attribute name="required" type="xs:string"/> 48 50 </xs:complexType> 49 51 -
CMIP6dreqbuild/trunk/docs/xlst_xdsSchemaGen.xml
r526 r547 62 62 </xs:simpleType><xsl:text>
</xsl:text> 63 63 64 <xs:simpleType name="st__integerList"> 65 <xs:restriction base="aa:base__integerList"> 66 <xs:minLength value="0"/> 67 </xs:restriction> 68 </xs:simpleType> 69 70 <xs:simpleType name="base__integerList"> 71 <xs:list itemType="xs:integer"/> 72 </xs:simpleType><xsl:text>
</xsl:text> 73 74 <xs:simpleType name="st__integerListMonInc"> 75 <xs:restriction base="aa:st__integerList" /> 76 </xs:simpleType><xsl:text>
</xsl:text> 64 77 65 78 <xs:simpleType name="st__floatList"> … … 71 84 <xs:simpleType name="base__floatList"> 72 85 <xs:list itemType="xs:float"/> 73 </xs:simpleType> 86 </xs:simpleType><xsl:text>
</xsl:text> 74 87 75 88 <xs:complexType name="ct__info" mixed="true"> -
CMIP6dreqbuild/trunk/srcMisc/dreqSX.py
r508 r547 9 9 shvg = shelve.open( 'dreq_consol_tables_shelve_v%s' % vdate, 'r' ) 10 10 shnv = shelve.open( 'dreq_consol_tables_nv_shelve_v%s' % vdate, 'r' ) 11 shnvo = shelve.open( 'dreq_consol_tables_nvom_shelve_v%s' % vdate, 'r' ) 11 12 ## from vlsc5b --- includes new names from OMIP 12 13 shold = shelve.open( 'dreq_consol_tables_old_shelve_v20150713', 'r' ) … … 43 44 ee0 = {} 44 45 eenv = {} 46 eenvo = {} 45 47 ## dictionary to carry short names of old variables. 46 48 eeold = {} … … 49 51 for k in shnv: 50 52 eenv[k] = shnv[k] 53 for k in shnvo: 54 eenvo[k] = shnvo[k] 51 55 ccl = collections.defaultdict( int ) 52 56 for k in shvg: … … 129 133 ## check cmip5 vs. standard output 130 134 s1 = Set() 135 cmip5ByVar = collections.defaultdict( list ) 131 136 for k in ee_miptables_vars_old.keys(): 132 137 if k[:6] == 'CMIP5_': … … 152 157 if not s in s1: 153 158 print 'ERROR.010.0002: Table %s not in old mip tables' % s 159 for v in cmip5so.so[s].a.keys(): 160 cmip5ByVar[v].append(s) 161 154 162 155 163 for s in shlist: -
CMIP6dreqbuild/trunk/srcMisc/dreq_consol_dreq.py
r508 r547 361 361 return k 362 362 363 def addItem( self, mip, tab, nn, nexmax, nenmax, nymax, expt=None, rid=None ):363 def addItem( self, mip, tab, nn, nexmax, nenmax, nymax, expt=None, rid=None, treset=None ): 364 364 if not self.tabindx.has_key( tab ): 365 365 self.tabindx[tab] = len(self.tablist) … … 368 368 self.tablist[ix][mip] = nn 369 369 self.mips[mip] += 1 370 self.records.append( (mip,tab,expt, rid,nn, nexmax, nenmax, nymax ) )370 self.records.append( (mip,tab,expt, rid,nn, nexmax, nenmax, nymax,treset) ) 371 371 372 372 def show(self,oo): … … 514 514 if ok: 515 515 nbl = True 516 for je in r4i.othix: 517 ok = self.readDeckColPair( j, je, 100, expt=string.strip(r4[je+1]), rid=uid,mode=3 ) 516 for jei in range( len(r4i.othix) ): 517 je = r4i.othix[jei] 518 tr = r4i.treset[jei] 519 ok = self.readDeckColPair( j, je, 100, expt=string.strip(r4[je+1]), rid=uid,mode=3,treset=tr ) 518 520 if ok: 519 521 nbl = True … … 524 526 return True 525 527 526 def readDeckColPair( self,j, ix, nydef, expt=None, rid=None, mode=2 ):528 def readDeckColPair( self,j, ix, nydef, expt=None, rid=None, mode=2, treset=None ): 527 529 assert mode in [2,3], 'Only modes 2,3 supported, not mode=%s' % mode 528 530 this = map( lambda x: x.value, self.wk1.currentSi.row(j)[ix:ix+mode] ) … … 634 636 tab = '%s!!%s' % (self.mip,tab) 635 637 636 self.parent.addItem( self.mip, tab, ntot, nexmax, nenmax, nymax, expt=expt, rid=rid )638 self.parent.addItem( self.mip, tab, ntot, nexmax, nenmax, nymax, expt=expt, rid=rid, treset=treset ) 637 639 return True 638 640 except: … … 747 749 sh['__info__'] = { 'label':'requestItems', 'title':'Specification for a single experiment' , \ 748 750 'comment':'Currently only has number of years -- need to include more details' } 749 sh['__cols__'] = [ 'mip', 'tab', 'expt','rlid','ny', 'nexmax', 'nenmax', 'nymax' ]751 sh['__cols__'] = [ 'mip', 'tab', 'expt','rlid','ny', 'nexmax', 'nenmax', 'nymax','treset'] 750 752 ##('AerChemMIP', u'Omon_3d', u'CMIP6 historical', 'ad74be9a-26ef-11e5-8d9b-ac72891c3257', 0.0) 751 753 for i in rqs.records: -
CMIP6dreqbuild/trunk/srcMisc/dreq_utils.py
r508 r547 18 18 comment = '' 19 19 try: 20 tier = int( r[5] ) 20 if type(r[5]) == type(1.): 21 tier = int( r[5] ) 22 else: 23 tier = [int( x) for x in string.split( r[5] )] 21 24 except: 22 25 print 'ERROR.001.0001: tier not integer: %s, %s' % (mip,r[5]) … … 29 32 for j in [6,11,12,13]: 30 33 try: 31 ll.append( int( r[j] ) ) 34 if type(r[j]) == type(1.): 35 v = int( r[j] ) 36 else: 37 v = [int( x) for x in string.split( r[j] )] 38 ll.append( v ) 32 39 except: 33 40 k = {6:'nstart', 11:'years per sim', 12:'ensemble size', 13:'total number of years'}[j] … … 127 134 128 135 def __init__(self,dd=None): 129 self.nt = collections.namedtuple( 'r4info', ['ixcntl','ixh','ix0','ixm','ownix','ownhr','othix','othhr','mode' ] )136 self.nt = collections.namedtuple( 'r4info', ['ixcntl','ixh','ix0','ixm','ownix','ownhr','othix','othhr','mode','treset'] ) 130 137 131 138 if dd != None: … … 188 195 self.ownex = [] 189 196 self.othex = [] 197 self.othetrst = [] 190 198 for j in range(self.ix0,self.ixm,2): 191 199 if string.strip(r4[j]) != '': … … 194 202 if string.strip(r4[j+1]) != '': 195 203 self.othex.append(j) 204 if r4[j+2] != '': 205 self.othetrst.append(int(r4[j+2])) 206 else: 207 self.othetrst.append('') 196 208 197 209 print mip, self.ixh, self.iccntl, self.ix0, self.ixm , self.ownex, self.othex … … 199 211 othhr = map(lambda x: r4[x+1], self.othex) 200 212 print ownhr, othhr 201 self.r4info = self.nt( self.iccntl, self.ixh, self.ix0, self.ixm, self.ownex, ownhr, self.othex, othhr,mode )213 self.r4info = self.nt( self.iccntl, self.ixh, self.ix0, self.ixm, self.ownex, ownhr, self.othex, othhr,mode,self.othetrst ) 202 214 ##( 'r4info', ['ixcntl','ixh','ix0','ixm','ownix','ownhr','othix','othhr','mode'] ) 203 215 … … 206 218 class parseShb(object): 207 219 def __init__(self,vdate,sx,cmip5gplk): 220 """Parse **'dreq_consol_tables_reviewed_b_v%s' % vdate** from dreq_consol_tables.py""" 208 221 shb = shelve.open( 'dreq_consol_tables_reviewed_b_v%s' % vdate, 'r' ) 209 222 revTabIds = Set( shb.keys()[:] ) -
CMIP6dreqbuild/trunk/srcMisc/sx2.py
r508 r547 393 393 sh = shelve.open( '%s/cmipVars' % odir, 'n' ) 394 394 sh['__info__'] = { 'label':'cmipVars', 'title':'CMIP variables', 'prov':'sx.eenv and sx.eeold' } 395 sh['__cols__'] = ['label','title','sn','units','description','procnote','procComment','prov','priority0' ]395 sh['__cols__'] = ['label','title','sn','units','description','procnote','procComment','prov','priority0','realm0'] 396 396 397 397 ee = {} … … 400 400 ##sh[k] = { 'label':this.v, 'title':this.l, 'sn':this.s, 'units':this.u, 'description':this.c, 'procnote':'', 'procComment':'','prov':'CMIP6 endorsement' } 401 401 prov = 'CMIP6 endorsement [%s]' % sx.eenv[k][1] 402 sh[k] = [ this.v, this.l, this.s, this.u, this.c, '', '',prov, sx.eenv[k][0] ]402 sh[k] = [ this.v, this.l, this.s, this.u, this.c, '', '',prov, sx.eenv[k][0], sx.eenv[k][8] ] 403 403 ee[this.u] = k 404 404 if this.u == 'atmos': … … 412 412 this = nt_vrecix._make( map( lambda x: sx.eeold[k][x], vrecix_old ) ) 413 413 ##sh[k] = { 'label':this.v, 'title':this.l, 'sn':this.s, 'units':this.u, 'description':this.c, 'procnote':'', 'procComment':'','prov':sx.eeold[k][6]} 414 sh[k] = [ this.v, this.l, this.s, this.u, this.c, '', '',sx.eeold[k][6], 101 ] 414 if this.v in sx.cmip5ByVar.keys(): 415 s = set() 416 for t in sx.cmip5ByVar[this.v]: 417 s.add( sx.cmip5so.so[t].a[this.v][18] ) 418 s = list(s) 419 rlm0 = string.join( s ) 420 elif this.v in sx.eenvo: 421 rlm0 = sx.eenvo[this.v][0][8] 422 print 'INFO.llll: using eenvo .....',this.v 423 else: 424 rlm0 = '__na__' 425 426 sh[k] = [ this.v, this.l, this.s, this.u, this.c, '', '',sx.eeold[k][6], 101, rlm0 ] 415 427 nk += 1 416 428 … … 1220 1232 1221 1233 1222 wb = utils_wb.workbook( 'CMIP6DataRequest_ConsolidatedExperiments_20151028.xls' ) 1234 ##wb = utils_wb.workbook( 'CMIP6DataRequest_ConsolidatedExperiments_20151028.xls' ) 1235 wb = utils_wb.workbook( 'CMIP6DataRequest_ConsolidatedExperiments_20160110.xls' ) 1223 1236 sht = wb.book.sheet_by_name( 'Experiments' ) 1224 1237 p = dreq_utils.prconsolexpt() … … 1245 1258 eegg[gp] = str( uuid.uuid1() ) 1246 1259 1247 eetm[gp].add( r[5] ) 1260 if type( r[5] ) == type( 1 ): 1261 eetm[gp].add( r[5] ) 1262 else: 1263 eetm[gp].add( r[5][-1] ) 1248 1264 eent[gp] += r[11] 1249 1265 label = labcoerce( r[0] )
Note: See TracChangeset
for help on using the changeset viewer.