Changeset 155
- Timestamp:
- 14/05/14 22:31:05 (7 years ago)
- Location:
- CCCC/trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
CCCC/trunk/c4.py
r150 r155 28 28 pathTmplDict = { 'CORDEX':'%(project)s/%(product)s/%(domain)s/%(institute)s/%(driving_model)s/%(experiment)s/%(ensemble)s/%(model)s/%(model_version)s/%(frequency)s/%(variable)s/files/%%(version)s/', \ 29 29 'SPECS':'%(project)s/%(product)s/%(institute)s/%(model)s/%(experiment)s_%(series)s/%(start_date)s/%(frequency)s/%(realm)s/%(variable)s/%(ensemble)s/files/%%(version)s/', \ 30 'CMIP5':'%(project)s/%(product)s/%(institute)s/%(model)s/%(experiment)s/%(frequency)s/%(realm)s/%(table)s/%(ensemble)s/files/%%(version)s/%(variable)s/', \ 30 31 '__def__':'%(project)s/%(product)s/%(institute)s/%(model)s/%(experiment)s/%(frequency)s/%(realm)s/%(variable)s/%(ensemble)s/files/%%(version)s/', \ 31 32 } -
CCCC/trunk/config_c4.py
r152 r155 175 175 176 176 self.project = project 177 self.gridSpecTol = 0.01 177 178 if project == 'CORDEX': 178 179 self.requiredGlobalAttributes = [ 'institute_id', 'contact', 'rcm_version_id', 'product', 'CORDEX_domain', 'creation_date', \ … … 217 218 self.drsMappings = {'variable':'@var', 'institute':'institute_id', 'product':'product', 'experiment':'experiment_id', \ 218 219 'ensemble':'@ensemble', 'model':'model_id', 'realm':'modeling_realm', \ 219 'frequency':'frequency', \220 'frequency':'frequency', 'table':'@mip_id', 220 221 'project':'project_id'} 221 222 -
CCCC/trunk/file_utils.py
r154 r155 236 236 log.info( 'Setting %s to %s' % (targ,m[2][1]) ) 237 237 ##print 'Setting %s:%s to %s' % (m[1][0][1],targ,m[2][1]) 238 thisval = self. va[m[1][0][1]].get( targ, None )238 thisval = self.da[m[1][0][1]].get( targ, None ) 239 239 self.da[m[1][0][1]][targ] = m[2][1] 240 240 self.atMapLog.write( '@ax:"%s","%s","%s","%s","%s"\n' % (self.fpath, m[1][0][1], targ, thisval, m[2][1]) ) -
CCCC/trunk/utils_c4.py
r152 r155 324 324 x = self.globalAts.get("forecast_reference_time",'yyyy-mm-dd Thh:mm:ssZ' ) 325 325 ee[k] = "%s%s%s" % (x[:4],x[5:7],x[8:10]) 326 elif self.drsMappings[k] == '@mip_id': 327 ee[k] = string.split( self.globalAts["table_id"] )[1] 326 328 else: 327 329 ee[k] = self.globalAts[ self.drsMappings[k] ] … … 347 349 if not globalAts.has_key(k): 348 350 m.append(k) 351 self.globalAts[k] = '__errorReported__' 349 352 350 353 if not self.test( len(m) == 0, 'Required global attributes missing: %s' % str(m) ): … … 489 492 thisVal = globalAts[self.globalAttributesInFn[i]] 490 493 491 if thisVal != targVal:494 if thisVal not in [targVal,'__errorReported__']: 492 495 m.append( (i,self.globalAttributesInFn[i]) ) 493 496 … … 667 670 if atDict[k][k2] != da[k].get(k2, None ): 668 671 mm.append( (k,k2) ) 672 record = '#@ax=%s;%s=%s|%s=%s <uncomment if correct>' % (k,k2,da[k].get(k2, '__missing__'),k2,atDict[k][k2] ) 673 self.parent.amapListDraft.append( record ) 669 674 self.test( len(mm) == 0, 'Required attributes of grid coordinate arrays not correct: %s' % str(mm) ) 670 675 … … 681 686 mm = [] 682 687 for i in range(4): 683 if a [i] != b[i]:688 if abs(a[i] - b[i]) > self.pcfg.gridSpecTol: 684 689 mm.append( (a[i],b[i]) ) 685 690 686 ok &= self.test( len(mm) == 0, 'Domain boundaries for rotated pole grid do not match %s ' % str(mm), part=True )691 ok &= self.test( len(mm) == 0, 'Domain boundaries for rotated pole grid do not match %s within tolerance (%s)' % (str(mm),self.pcfg.gridSpecTol), part=True ) 687 692 688 693 for k in ['rlat','rlon']: … … 708 713 if atDict[k][k2] != da[k].get(k2, None ): 709 714 mm.append( (k,k2) ) 715 record = '#@ax=%s;%s=%s|%s=%s <uncomment if correct>' % (k,k2,da[k].get(k2, '__missing__'),k2,atDict[k][k2] ) 716 self.parent.amapListDraft.append( record ) 710 717 711 718 self.test( len(mm) == 0, 'Required attributes of grid coordinate arrays not correct: %s' % str(mm), part=True )
Note: See TracChangeset
for help on using the changeset viewer.