source: CMIP6dreqbuild/trunk/src/framework/scripts/slist.py @ 1275

Subversion URL: http://proj.badc.rl.ac.uk/svn/exarch/CMIP6dreqbuild/trunk/src/framework/scripts/slist.py@1291
Revision 1275, 1.4 KB checked in by mjuckes, 15 months ago (diff)

reinstate scripts

Line 
1
2from utils import dreq, collect
3dq = dreq.loadDreq()
4collect.add( dq )
5
6for k in sorted( dq.coll.keys() ):
7  if len( dq.coll[k].items ) > 0:
8    i = dq.coll[k].items[0]
9    print '%s & %s & %s &  \\' % (k,len( dq.coll[k].items ), i._h.title )
10
11
12nn = 0
13for i in dq.coll['requestLink'].items:
14  n1 = len( dq.inx.iref_by_sect[i.refid].a['requestVar'] )
15  n2 = len( i._get__expt() )
16  n3 = len( dq.inx.iref_by_sect[i.uid].a['objectiveLink'] )
17  nn += n1*n2*n3
18
19nnn = 1
20for y in [len(dq.coll[x].items) for x in ['CMORvar','experiment','objective']]:
21  nnn = nnn*y
22
23print 'Virtual requests (var-expt-objective): %s [%s, %4.2f%%]' % (nn, nnn, float(100*nn)/nnn)
24
25nn = 0
26ee = dict()
27for i in dq.coll['experiment'].items:
28  n1 = len( i._get__CMORvar() )
29  ee[i.label] = n1
30  nn += n1
31
32
33ks =  sorted( ee.keys(), key=lambda x: ee[x], reverse=True)
34
35
36nnn = 1
37for y in [len(dq.coll[x].items) for x in ['CMORvar','experiment']]:
38  nnn = nnn*y
39
40print 'Virtual requests (var-expt): %s [%s, %4.2f%%]' % (nn, nnn, float(100*nn)/nnn)
41
42c1 = [x for x in dq.coll['CMORvar'].items  if 'requestVar' not in dq.inx.iref_by_sect[x].a]
43nnn = len( dq.coll['CMORvar'].items )
44print 'CMORVvars: %s [%s]' % (nnn,len(c1))
45for k in ks[:5]:
46  print 'Var count (top): %s [%s, %4.2f%%]' % (k,ee[k], float(100*ee[k])/nnn)
47for k in ks[-5:]:
48  print 'Var count (bottom): %s [%s, %4.2f%%]' % (k,ee[k], float(100*ee[k])/nnn)
49 
Note: See TracBrowser for help on using the repository browser.