Changeset 155


Ignore:
Timestamp:
14/05/14 22:31:05 (6 years ago)
Author:
mjuckes
Message:

various fixes for aMap feature -- see updates.txt

Location:
CCCC/trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • CCCC/trunk/c4.py

    r150 r155  
    2828pathTmplDict = { '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/',   \ 
    2929                 '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/', \ 
    3031                 '__def__':'%(project)s/%(product)s/%(institute)s/%(model)s/%(experiment)s/%(frequency)s/%(realm)s/%(variable)s/%(ensemble)s/files/%%(version)s/', \ 
    3132               } 
  • CCCC/trunk/config_c4.py

    r152 r155  
    175175 
    176176    self.project = project 
     177    self.gridSpecTol = 0.01 
    177178    if project == 'CORDEX': 
    178179      self.requiredGlobalAttributes = [ 'institute_id', 'contact', 'rcm_version_id', 'product', 'CORDEX_domain', 'creation_date', \ 
     
    217218      self.drsMappings = {'variable':'@var', 'institute':'institute_id', 'product':'product', 'experiment':'experiment_id', \ 
    218219                        'ensemble':'@ensemble', 'model':'model_id', 'realm':'modeling_realm', \ 
    219                         'frequency':'frequency',  \ 
     220                        'frequency':'frequency',  'table':'@mip_id', 
    220221                        'project':'project_id'} 
    221222 
  • CCCC/trunk/file_utils.py

    r154 r155  
    236236                log.info( 'Setting %s to %s' % (targ,m[2][1]) ) 
    237237              ##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 ) 
    239239              self.da[m[1][0][1]][targ] = m[2][1] 
    240240              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  
    324324        x = self.globalAts.get("forecast_reference_time",'yyyy-mm-dd Thh:mm:ssZ' ) 
    325325        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] 
    326328      else: 
    327329        ee[k] = self.globalAts[ self.drsMappings[k] ] 
     
    347349      if not globalAts.has_key(k): 
    348350         m.append(k) 
     351         self.globalAts[k] = '__errorReported__' 
    349352 
    350353    if not self.test( len(m)  == 0, 'Required global attributes missing: %s' % str(m) ): 
     
    489492             thisVal = globalAts[self.globalAttributesInFn[i]] 
    490493 
    491          if thisVal != targVal: 
     494         if thisVal not in [targVal,'__errorReported__']: 
    492495             m.append( (i,self.globalAttributesInFn[i]) ) 
    493496 
     
    667670          if atDict[k][k2] != da[k].get(k2, None ): 
    668671            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 ) 
    669674      self.test( len(mm) == 0, 'Required attributes of grid coordinate arrays not correct: %s' % str(mm) ) 
    670675 
     
    681686      mm = [] 
    682687      for i in range(4): 
    683         if a[i] != b[i]: 
     688        if abs(a[i] - b[i]) > self.pcfg.gridSpecTol: 
    684689          mm.append( (a[i],b[i]) ) 
    685690 
    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 ) 
    687692 
    688693      for k in ['rlat','rlon']: 
     
    708713          if atDict[k][k2] != da[k].get(k2, None ): 
    709714            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 ) 
    710717 
    711718      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.