Changeset 54 for FCC2


Ignore:
Timestamp:
25/07/13 17:42:05 (6 years ago)
Author:
mjuckes
Message:

added cdo_basic.py

Location:
FCC2/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • FCC2/trunk/source/fcc_utils.py

    r53 r54  
    769769         cstr = Constraint__Constant( bits[1] ) 
    770770       elif cid == 'special': 
    771          assert bits[1] in ['mip'], 'Special constraint [%s] not recognised' % bits[1] 
     771         assert bits[1] in ['mip','CordexInterpolatedGrid'], 'Special constraint [%s] not recognised' % bits[1] 
    772772         if bits[1] == 'mip': 
    773773            cstr = self.parent.mipConstraint 
     774         elif bits[1] == 'CordexInterpolatedGrid': 
     775            cstr = Constraint__CordexInterpolatedGrid() 
    774776          
    775777       if gid == None: 
     
    966968    self.segments = tuple( sl ) 
    967969 
     970class Constraint__CordexInterpolatedGrid: 
     971 
     972  def __init__(self): 
     973     self.code = 'CQC.999.999.999' 
     974     self.name = 'CordexInterpolatedGrid' 
     975     self.mode = 'd' 
     976 
     977  def __reset__(self): 
     978    pass 
     979 
     980  def check(self,fns): 
     981    region = fns.get( 'g_CORDEX_domain', 'unset' ) 
     982    assert region != 'unset', 'CORDEX domain not found in %s' % str(fns.keys()) 
     983    if region[-3:] != '44i': 
     984       self.msg = 'Interpolated grid constraint not applicable to region %s' % region 
     985       return ('PASS',self.msg) 
     986    print 'WARNING -- check not implemented' 
     987    self.msg = 'WARNING -- check not implemented' 
     988    return ('PASS',self.msg) 
     989 
    968990class Constraint__IdentityChecker: 
    969991 
  • FCC2/trunk/work/config_cordex_mip.txt

    r42 r54  
    7272identity, VALUE/CORDEX, ATTRIBUTES/Global/project_id 
    7373special, mip, 
     74special, CordexInterpolatedGrid, 
    7475ads:onlyOnce, FILENAMEregex/startyear 
    7576END CONSTRAINTS 
Note: See TracChangeset for help on using the changeset viewer.