Changeset 144


Ignore:
Timestamp:
01/04/14 13:16:01 (6 years ago)
Author:
astephen
Message:

updated for March 17 version of SPECS requirements

Location:
CCCC/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CCCC/trunk/config_c4.py

    r141 r144  
    112112  "Returns a dictionary of vocabulary details for the project provided." 
    113113  if pcfg.project == 'SPECS': 
     114               ##'experiment_id':utils.patternControl( 'experiment_id', "(?P<val>.*)[0-9]{4}", list=validSpecsExptFamilies ), \ 
    114115    vocabs = { 'variable':utils.mipVocab(pcfg), \ 
    115116               'Conventions':utils.listControl( 'Conventions', ['CF-1.6'] ), \ 
    116117               'frequency':utils.listControl( 'frequency', validSpecsFrequecies ), \ 
    117                'experiment_id':utils.patternControl( 'experiment_id', "(?P<val>.*)[0-9]{4}", list=validSpecsExptFamilies ), \ 
     118               'experiment_id':utils.listControl( 'experiment_id', validSpecsExptFamilies ), \ 
    118119               'initialization_method':utils.patternControl( 'initialization_method', "[0-9]+" ), \ 
    119120               'physics_version':utils.patternControl( 'physics_version', "[0-9]+" ), \ 
     
    178179      self.controlledGlobalAttributes = [ 'project_id','experiment_id', 'series','frequency','Conventions','modeling_realm', \ 
    179180                       'initialization_method','physics_version','realization'] 
    180       self.globalAttributesInFn = [None,'@mip_id','model_id','@experiment_family','@forecast_reference_time','series','@ensemble'] 
     181      self.globalAttributesInFn = [None,'@mip_id','model_id','experiment_id','series','@forecast_reference_time','@ensemble'] 
    181182#sic_Oimon_EC-Earth2_seaIceBestInit_S19910501_series1_r1i1p1_199501-199502.nc  
    182183## mip_id derived from global attribute Table_id (CMOR convention); experiment family derived from experiment_id, ensemble derived from rip attributes. 
  • CCCC/trunk/utils_c4.py

    r143 r144  
    394394      targ = varAts[varName].get( k, 'Attribute not present' ) 
    395395      val = vocabs['variable'].getAttr( varName, varGroup, k ) 
     396 
    396397      if k == "cell_methods": 
    397398        if val != None: 
     399          parenthesies1 = [] 
     400          targ0 = targ[:] 
     401          while string.find( targ, '(' ) != -1: 
     402            i0 = targ.index( '(' ) 
     403            i1 = targ.index( ')' ) 
     404            parenthesies1.append( targ[i0:i1+1] ) 
     405            targ = targ[:i0-1] + targ[i1+1:] 
     406          parenthesies2 = [] 
     407          val0 = val[:] 
     408          while string.find( val, '(' ) != -1: 
     409            i0 = val.index( '(' ) 
     410            i1 = val.index( ')' ) 
     411            parenthesies2.append( val[i0:i1+1] ) 
     412            val = val[:i0-1] + val[i1+1:] 
     413          for p in parenthesies2: 
     414            if p not in parenthesies1: 
     415              mm.append( (k,parenthesies1,p) ) 
    398416          if string.find( targ, val): 
    399417             mm.append( (k,targ,val) ) 
     
    445463           elif self.globalAttributesInFn[i][1:] == "forecast_reference_time": 
    446464               x = self.globalAts.get("forecast_reference_time",'yyyy-mm-dd Thh:mm:ssZ' ) 
    447                thisVal = "%s%s%s" % (x[:4],x[5:7],x[8:10]) 
     465               thisVal = "S%s%s%s" % (x[:4],x[5:7],x[8:10]) 
    448466           elif self.globalAttributesInFn[i][1:] == "series": 
    449467               thisVal = 'series%s' % globalAts["series"] 
Note: See TracChangeset for help on using the changeset viewer.