Ignore:
Timestamp:
03/09/15 10:18:48 (4 years ago)
Author:
mjuckes
Message:

import of cmip5 standard output for priorities

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CMIP6dreqbuild/trunk/srcMisc/dreqSX.py

    r375 r376  
    22import shelve, string, collections 
    33from utils_wb import workbook, uniCleanFunc 
     4import cmip5so 
     5from sets import Set 
    46 
    57vdate = "20150827" 
     
    110112  ee_byvar[ ee_mip[k][-3] ].append( k ) 
    111113 
     114## check cmip5 vs. standard output 
     115s1 = Set() 
     116for k in ee_miptables_vars_old.keys(): 
     117  if k[:6] == 'CMIP5_': 
     118    s2 = Set( ee_miptables_vars_old[k] ) 
     119    kk = k[6:] 
     120    s1.add( kk ) 
     121    assert cmip5so.so.has_key(kk ), 'Table %s not found in standard output' % kk 
     122    lnf = [] 
     123    for v in ee_miptables_vars_old[k]: 
     124      if not cmip5so.so[kk].a.has_key(v): 
     125         lnf.append(v) 
     126    if len(lnf) > 0: 
     127      print 'ERROR.010.0001: Variables not found in %s:: %s' % (kk,str(lnf)) 
     128 
     129    lnf = [] 
     130    for v in cmip5so.so[kk].a.keys(): 
     131      if not v in s2: 
     132         lnf.append(v) 
     133    if len(lnf) > 0: 
     134      print 'ERROR.010.0002: SO Variables not found in %s:: %s' % (kk,str(lnf)) 
     135 
     136for s in cmip5so.so.keys(): 
     137  if not s in s1: 
     138    print 'ERROR.010.0002: Table %s not in old mip tables' % s 
     139 
    112140for s in shlist: 
    113141  s.close() 
Note: See TracChangeset for help on using the changeset viewer.