Changeset 376


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

import of cmip5 standard output for priorities

Location:
CMIP6dreqbuild/trunk/srcMisc
Files:
1 added
2 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() 
  • CMIP6dreqbuild/trunk/srcMisc/sx2.py

    r375 r376  
    480480## need to identify what is meant by group labels in "Request Scoping" -- now in eervg.keys() 
    481481## 
    482 ## 29th July: loosin some links for groups of revised table items .... 
     482## 29th July: loosing some links for groups of revised table items .... 
    483483## 
    484484shb = shelve.open( 'dreq_consol_tables_reviewed_b_v20150708', 'r' ) 
    485485revisedTabKeys = shb.keys() 
     486revisedTabKeys.sort() 
     487revisedTabKeysff = [] 
     488for r in revisedTabKeys: 
     489  if string.find( r, '.' ) != -1: 
     490    mip,tab = string.split(r, '.' ) 
     491    assert sx.cmip5so.so.has_key(tab), 'FATAL.001.0001: revised table not found in original: %s' % tab 
     492    lnf = [] 
     493    lpe = [] 
     494    lmod = [] 
     495    for v in shb[r].keys(): 
     496      v1 = string.strip(v) 
     497      if not sx.cmip5so.so[tab].a.has_key(v1): 
     498        lnf.append(v) 
     499      else: 
     500        if shb[r][v][1] == sx.cmip5so.so[tab].a[v1][0]: 
     501          lpe.append(v) 
     502        else: 
     503          lmod.append(v) 
     504    if len(lnf) > 0: 
     505      print 'ERROR.008.0001: Revised variables not in original: %s %s' % (r,str(lnf) ) 
     506    if len(lmod) == 0: 
     507      print 'INFO.008.0001: No modfications in %s' % r 
     508    else: 
     509      revisedTabKeysff.append( r ) 
     510       
    486511shb.close() 
    487 gpids = gpids + revisedTabKeys 
     512gpids = gpids + revisedTabKeysff 
    488513ks = eervg.keys() 
    489514ks.sort() 
Note: See TracChangeset for help on using the changeset viewer.