source: CCCC/trunk/ceda_cc/c4.py @ 210

Subversion URL: http://proj.badc.rl.ac.uk/svn/exarch/CCCC/trunk/ceda_cc/c4.py@210
Revision 210, 21.2 KB checked in by mjuckes, 6 years ago (diff)

added archived CMIP5 file to unitTestsS2

Line 
1
2import sys
3
4## callout to summary.py: if this option is selected, imports of libraries are not needed.
5if __name__ == '__main__' and sys.argv[1] == '--sum':
6      import summary
7      summary.main()
8      raise SystemExit(0)
9
10# Standard library imports
11import os, string, time, logging, sys, glob, pkgutil
12import shutil
13## pkgutil is used in file_utils
14# Third party imports
15
16## Local imports with 3rd party dependencies
17#### netcdf --- currently only support for cmds2 -- re-arranged to facilitate support for alternative modules
18
19import file_utils
20
21from file_utils import fileMetadata, ncLib
22
23# Local imports
24import utils_c4 as utils
25import config_c4 as config
26
27reload( utils )
28
29from xceptions import baseException
30
31from fcc_utils2 import tupsort
32
33
34#driving_model_ensemble_member = <CMIP5Ensemble_member>
35#rcm_version_id = <RCMVersionID>                     
36
37class dummy(object):
38   pass
39
40pathTmplDict = { 'CORDEX':'%(project)s/%(product)s/%(domain)s/%(institute)s/%(driving_model)s/%(experiment)s/%(ensemble)s/%(model)s/%(model_version)s/%(frequency)s/%(variable)s/files/%%(version)s/',   \
41                 'SPECS':'%(project)s/%(product)s/%(institute)s/%(model)s/%(experiment)s/%(start_date)s/%(frequency)s/%(realm)s/%(table)s/%(variable)s/%(ensemble)s/files/%%(version)s/', \
42                 'CMIP5':'%(project)s/%(product)s/%(institute)s/%(model)s/%(experiment)s/%(frequency)s/%(realm)s/%(table)s/%(ensemble)s/files/%%(version)s/%(variable)s/', \
43                 '__def__':'%(project)s/%(product)s/%(institute)s/%(model)s/%(experiment)s/%(frequency)s/%(realm)s/%(variable)s/%(ensemble)s/files/%%(version)s/', \
44               }
45
46## Core DRS: list of vocab names
47## Path template: -- current version puts upper case in "project"
48## Dataset template: 
49
50class recorder(object):
51
52  def __init__(self,project,fileName,type='map',dummy=False):
53    self.dummy = dummy
54    self.file = fileName
55    self.type = type
56    self.pathTmpl = '%(project)s/%(product)s/%(domain)s/%(institute)s/%(driving_model)s/%(experiment)s/%(ensemble)s/%(model)s/%(model_version)s/%(frequency)s/%(variable)s/files/%%(version)s/'
57    self.pathTmpl = pathTmplDict.get(project,pathTmplDict['__def__'])
58    self.records = {}
59    self.tidtupl = []
60
61  def open(self):
62    if self.type == 'map':
63      self.fh = open( self.file, 'a' )
64    else:
65      self.sh = shelve.open( self.file )
66
67  def close(self):
68    if self.type == 'map':
69      self.fh.close()
70    else:
71      self.sh.close()
72
73  def add(self,fpath,drs,safe=True):
74    assert self.type == 'map','Can only do map files at present'
75    assert type(drs) == type( {} ), '2nd user argument to method add should be a dictionary [%s]' % type(drs)
76    tpath = self.pathTmpl % drs
77    if not self.dummy:
78      assert os.path.isfile( fpath ), 'File %s not found' % fpath
79      fdate = time.ctime(os.path.getmtime(fpath))
80      sz = os.stat(fpath).st_size
81    else:
82      fdate = "na"
83      sz = 0
84    record = '%s | OK | %s | modTime = %s | target = %s ' % (fpath,sz,fdate,tpath)
85    fn = string.split( fpath, '/' )[-1]
86    for k in ['creation_date','tracking_id']:
87      if k in drs.keys():
88        record += ' | %s = %s' % (k,drs[k])
89        if k == 'tracking_id':
90          self.tidtupl.append( (fn,drs[k]) )
91
92    self.records[fn] = record
93 
94  def modify(self,fn,msg):
95    assert fn in self.records.keys(),'Attempt to modify non-existent record %s, %s' % [fn,str(self.records.keys()[0:10])]
96    if string.find( self.records[fn], '| OK |') == -1:
97      ##print 'File %s already flagged with errors' % fn
98      return
99    s = string.replace( self.records[fn], '| OK |', '| %s |' % msg )
100    ##print '--> ',s
101    self.records[fn] = s
102
103  def checktids(self):
104## sort by tracking id
105    if len( self.tidtupl ) == 1:
106      return
107    self.tidtupl.sort( cmp=tupsort(k=1).cmp )
108    nd = 0
109    fnl = []
110    for k in range(len(self.tidtupl)-1):
111      if self.tidtupl[k][1] == self.tidtupl[k+1][1]:
112        print 'Duplicate tracking_id: %s, %s:: %s' % (self.tidtupl[k][0],self.tidtupl[k+1][0],self.tidtupl[k][1])
113        nd += 1
114        if len(fnl) == 0 or fnl[-1] != self.tidtupl[k][0]:
115          fnl.append( self.tidtupl[k][0])
116        fnl.append( self.tidtupl[k+1][0])
117    if nd == 0:
118      print 'No duplicate tracking ids found in %s files' % len(self.tidtupl)
119    else:
120      print '%s duplicate tracking ids' % nd
121      for f in fnl:
122        self.modify( f, 'ERROR: duplicate tid' )
123
124  def dumpAll(self,safe=True):
125    keys = self.records.keys()
126    keys.sort()
127    for k in keys:
128      self.dump( self.records[k], safe=safe )
129
130  def dump( self, record, safe=True ):
131    if safe:
132      self.open()
133    self.fh.write( record + '\n' )
134    if safe:
135      self.close()
136
137  def addErr(self,fpath,reason,safe=True):
138    record = '%s | %s' % (fpath, reason)
139    fn = string.split( fpath, '/' )[-1]
140    self.records[fn] = record
141
142class checker(object):
143  def __init__(self, pcfg, cls,reader,abortMessageCount=-1):
144    self.info = dummy()
145    self.info.pcfg = pcfg
146    self.info.abortMessageCount = abortMessageCount
147    self.calendar = 'None'
148    self.ncReader = reader
149    self.cfn = utils.checkFileName( parent=self.info,cls=cls)
150    self.cga = utils.checkGlobalAttributes( parent=self.info,cls=cls)
151    self.cgd = utils.checkStandardDims( parent=self.info,cls=cls)
152    self.cgg = utils.checkGrids( parent=self.info,cls=cls)
153    self.cls = cls
154
155    # Define vocabs based on project
156    ##self.vocabs = getVocabs(pcgf)
157    self.vocabs = pcfg.vocabs
158
159  def checkFile(self,fpath,log=None,attributeMappings=[]):
160    self.calendar = 'None'
161    self.info.log = log
162
163    fn = string.split( fpath, '/' )[-1]
164
165    if attributeMappings != []:
166      self.ncReader.loadNc( fpath )
167      self.ncReader.applyMap( attributeMappings, self.cfn.globalAttributesInFn, log=log )
168      ncRed = True
169      thisFn = self.ncReader.fn
170    else:
171      ncRed = False
172      thisFn = fn
173
174    self.cfn.check( thisFn )
175    if not self.cfn.completed:
176      self.completed = False
177      return
178    if not self.info.pcfg.project[:2] == '__':
179      if not os.path.isfile( fpath ):
180        print 'File %s not found [2]' % fpath
181        self.completed = False
182        return
183
184    if not ncRed:
185      ##print fpath
186      self.ncReader.loadNc( fpath )
187    self.ga = self.ncReader.ga
188    self.va = self.ncReader.va
189    self.da = self.ncReader.da
190
191    if self.cfn.freq != None:
192      vGroup = self.cfn.freq
193    else:
194      vGroup = self.info.pcfg.mipVocabVgmap.get(self.cfn.group,self.cfn.group)
195    self.cga.check( self.ga, self.va, self.cfn.var, vGroup, self.vocabs, self.cfn.fnParts )
196    if not self.cga.completed:
197      self.completed = False
198      return
199
200    ##self.cgd.plevRequired = config.plevRequired
201    ##self.cgd.plevValues = config.plevValues
202    ##self.cgd.heightRequired = config.heightRequired
203    ##self.cgd.heightValues = config.heightValues
204    ##self.cgd.heightRange = config.heightRange
205    self.cgd.check( self.cfn.var, self.cfn.freq, self.da, self.va, self.cga.isInstantaneous )
206    self.calendar = self.cgd.calendar
207    if not self.cgd.completed:
208      self.completed = False
209      return
210
211    if self.info.pcfg.doCheckGrids:
212      ##self.cgg.rotatedPoleGrids = config.rotatedPoleGrids
213      ##self.cgg.interpolatedGrids = config.interpolatedGrids
214      self.cgg.check( self.cfn.var, self.cfn.domain, self.da, self.va )
215   
216      if not self.cgg.completed:
217        self.completed = False
218        return
219    self.completed = True
220    self.drs = self.cga.getDrs()
221    self.drs['project'] = self.info.pcfg.project
222    self.errorCount = self.cfn.errorCount + self.cga.errorCount + self.cgd.errorCount + self.cgg.errorCount
223
224class c4_init(object):
225
226  def __init__(self,args=None):
227    self.logByFile = True
228    self.policyFileLogfileMode = 'w'
229    self.policyBatchLogfileMode = 'np'
230    if args==None:
231       args = sys.argv[1:]
232    nn = 0
233
234    self.attributeMappingFile = None
235    self.recordFile = 'Rec.txt'
236    self.logDir = 'logs_02'
237    self.errs = []
238   
239    # Set default project to "CORDEX"
240    self.project = "CORDEX"
241    self.holdExceptions = False
242    forceLogOrg = None
243    argsIn = args[:]
244
245    # The --copy-config option must be the first argument if it is present.
246    if args[0] == '--copy-config':
247       if len(args) < 2:
248         self.commandHints( argsIn )
249       args.pop(0)
250       dest_dir = args.pop(0)
251       config.copy_config(dest_dir)
252       print 'Configuration directory copied to %s.  Set CC_CONFIG_DIR to use this configuration.' % dest_dir
253       print
254       raise SystemExit(0)
255    elif args[0] == '-h':
256       print 'Help command not implemented yet'
257       raise SystemExit(0)
258
259    self.summarymode = args[0] == '--sum'
260    if self.summarymode:
261      return
262
263    self.forceNetcdfLib = None
264    fltype = None
265    argu = []
266    while len(args) > 0:
267      next = args.pop(0)
268      if next == '-f':
269        flist = [args.pop(0),]
270        self.logByFile = False
271        fltype = '-f'
272      elif next == '--log':
273        x = args.pop(0)
274        assert x in ['single','multi','s','m'], 'unrecognised logging option (--log): %s' % (x)
275        if x in ['multi','m']:
276           forceLogOrg = 'multi'
277        elif x in ['single','s']:
278           forceLogOrg = 'single'
279      elif next == '--force-ncq':
280        self.forceNetcdfLib = 'ncq3'
281      elif next == '--force-cdms2':
282        self.forceNetcdfLib = 'cdms2'
283      elif next == '--force-pync4':
284        self.forceNetcdfLib = 'netCDF4'
285      elif next == '--force-scientific':
286        self.forceNetcdfLib = 'Scientific'
287      elif next == '--flfmode':
288        lfmk = args.pop(0)
289        assert lfmk in ['a','n','np','w','wo'], 'Unrecognised file logfile mode (--flfmode): %s' % lfmk
290        self.policyFileLogfileMode = lfmk
291      elif next == '--blfmode':
292        lfmk = args.pop(0)
293        assert lfmk in ['a','n','np','w','wo'], 'Unrecognised batch logfile mode (--blfmode): %s' % lfmk
294        self.policyBatchLogfileMode = lfmk
295      elif next == '-d':
296        fdir = args.pop(0)
297        flist = glob.glob( '%s/*.nc' % fdir  )
298      elif next == '-D':
299        flist  = []
300        fdir = args.pop(0)
301        for root, dirs, files in os.walk( fdir, followlinks=True ):
302          for f in files:
303            fpath = '%s/%s' % (root,f)
304            if (os.path.isfile( fpath ) or os.path.islink( fpath )) and f[-3:] == '.nc':
305              flist.append( fpath )
306      elif next == '-R':
307        self.recordFile = args.pop(0)
308      elif next == '--ld':
309        self.logDir = args.pop(0)
310      elif next in ['--catchAllExceptions','--cae']:
311        self.holdExceptions = True
312      elif next == '--aMap':
313        self.attributeMappingFile = args.pop(0)
314        assert os.path.isfile( self.attributeMappingFile ), 'The token "--aMap" should be followed by the path or name of a file'
315      elif next == "-p":
316        self.project = args.pop(0)
317      else:
318       print 'Unused argument: %s' % next
319       argu.append( next )
320       nn+=1
321    if nn != 0:
322      print 'Unused arguments: ', argu
323      self.commandHints( argsIn )
324
325    if self.project == 'CMIP5' and fltype != '-f':
326      fl0 = []
327      for f in flist:
328        if string.find( f, '/latest/' ) != -1:
329          fl0.append(f)
330      flist = fl0
331
332    if forceLogOrg != None:
333      if forceLogOrg == 'single':
334        self.logByFile = False
335      else:
336        self.logByFile = True
337
338    if self.project[:2] == '__':
339       flist = []
340       ss = 'abcdefgijk'
341       ss = 'abcdefgijklmnopqrstuvwxyz'
342       ss = 'abc'
343       for i in range(10):
344         v = 'v%s' % i
345         for a in ss:
346           for b in ss:
347             flist.append( '%s_day_%s_%s_1900-1909.nc' % (v,a,b) )
348    flist.sort()
349    fnl = []
350    for f in flist:
351      fn = string.split(f, '/')[-1]
352      fnl.append(fn)
353    nd = 0
354    dupl = []
355    for k in range(len(fnl)-1):
356      if fnl[k] == fnl[k-1]:
357        nd += 1
358        dupl.append( fnl[k] )
359    self.dupDict = {}
360    for f in dupl:
361      self.dupDict[f] = 0
362    if nd != 0:
363      self.errs.append( 'Duplicate file names encountered: %s' % nd )
364      self.errs.append( dupl )
365    self.flist = flist
366    self.fnl = fnl
367    if not os.path.isdir(   self.logDir ):
368       os.mkdir(   self.logDir )
369
370    tstring1 = '%4.4i%2.2i%2.2i_%2.2i%2.2i%2.2i' % time.gmtime()[0:6]
371    self.batchLogfile = '%s/qcBatchLog_%s.txt' % (  self.logDir,tstring1)
372## default appending to myapp.log; mode='w' forces a new file (deleting old contents).
373    self.logger = logging.getLogger('c4logger')
374    if self.policyBatchLogfileMode in ['n','np']:
375        assert not os.path.isfile( self.batchLogfile ), '%s exists and policy set to new file' % self.batchLogfile
376    m = self.policyBatchLogfileMode[0]
377    if m == 'n':
378      m = 'w'
379    if m == 'a':
380      self.hdlr = logging.FileHandler(self.batchLogfile)
381    else:
382      self.hdlr = logging.FileHandler(self.batchLogfile,mode=m)
383    formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
384    self.hdlr.setFormatter(formatter)
385    self.logger.setLevel(logging.INFO)
386    self.logger.addHandler(self.hdlr)
387
388    self.attributeMappings = []
389    self.attributeMappingsLog = None
390    if self.attributeMappingFile != None:
391      for l in open( self.attributeMappingFile ).readlines():
392        if l[0] != '#':
393          bb = string.split( string.strip(l), '|' ) 
394          assert len(bb) ==2, "Error in experimental module attributeMapping -- configuration line not scanned [%s]" % str(l)
395          bits = string.split( bb[0], ';' )
396          cl = []
397          for b in bits:
398            cl.append( string.split(b, '=' ) )
399          self.attributeMappings.append( ('am001',cl, string.split(bb[1],'=') ) )
400      self.attributeMappingsLog = open( 'attributeMappingsLog.txt', 'w' )
401
402  def commandHints(self, args):
403    if args[0] in ['-h','--sum']:
404      print 'Arguments look OK'
405    elif args[0] == '--copy-config':
406      print 'Usage [configuration copy]: ceda_cc --copy-config <target directory path>'
407    else:
408      if not( '-f' in args or '-d' in args or '-D' in args):
409        print 'No file or target directory specified'
410        print """USAGE:
411ceda_cc -p <project> [-f <NetCDF file>|-d <directory containing files>|-D <root of directory tree>] [other options]
412
413With the "-D" option, all files in the directory tree beneath the given diretory will be checked. With the "-d" option, only files in the given directory will be checked.
414"""
415    raise SystemExit(0)
416   
417
418  def getFileLog( self, fn, flf=None ):
419    if flf == None:
420      tstring2 = '%4.4i%2.2i%2.2i' % time.gmtime()[0:3]
421      if fn in self.dupDict.keys():
422        tag = '__%2.2i' % self.dupDict[fn]
423        self.dupDict[fn] += 1
424      else:
425        tag = ''
426      self.fileLogfile = '%s/%s%s__qclog_%s.txt' % (self.logDir,fn[:-3],tag,tstring2)
427      if self.policyFileLogfileMode in ['n','np']:
428        assert not os.path.isfile( self.fileLogfile ), '%s exists and policy set to new file' % self.fileLogfile
429      m = self.policyFileLogfileMode[0]
430      if m == 'n':
431        m = 'w'
432    else:
433      m = 'a'
434      self.fileLogfile = flf
435
436    self.fLogger = logging.getLogger('fileLog_%s_%s' % (fn,m))
437    if m == 'a':
438      self.fHdlr = logging.FileHandler(self.fileLogfile)
439    else:
440      self.fHdlr = logging.FileHandler(self.fileLogfile,mode=m)
441    fileFormatter = logging.Formatter('%(message)s')
442    self.fHdlr.setFormatter(fileFormatter)
443    self.fLogger.addHandler(self.fHdlr)
444    self.fLogger.setLevel(logging.INFO)
445    return self.fLogger
446
447  def closeFileLog(self):
448    self.fLogger.removeHandler(self.fHdlr)
449    self.fHdlr.close()
450    if self.policyFileLogfileMode in ['wo','np']:
451      os.popen( 'chmod %s %s;' % (444, self.fileLogfile) )
452
453  def closeBatchLog(self):
454    self.logger.removeHandler(self.hdlr)
455    self.hdlr.close()
456    if self.policyBatchLogfileMode in ['wo','np']:
457      os.popen( 'chmod %s %s;' % (444, self.batchLogfile) )
458
459
460class main(object):
461
462  def __init__(self,args=None,abortMessageCount=-1,printInfo=False,monitorFileHandles = False):
463    logDict = {}
464    ecount = 0
465    c4i = c4_init(args=args)
466     
467    isDummy  = c4i.project[:2] == '__'
468    if (ncLib == None) and (not isDummy):
469       raise baseException( 'Cannot proceed with non-dummy [%s] project without a netcdf API' % (c4i.project) )
470    pcfg = config.projectConfig( c4i.project )
471    ncReader = fileMetadata(dummy=isDummy, attributeMappingsLog=c4i.attributeMappingsLog,forceLib=c4i.forceNetcdfLib)
472    self.cc = checker(pcfg, c4i.project, ncReader,abortMessageCount=abortMessageCount)
473    rec = recorder( c4i.project, c4i.recordFile, dummy=isDummy )
474    if monitorFileHandles:
475      self.monitor = utils.sysMonitor()
476    else:
477      self.monitor = None
478
479    cal = None
480    c4i.logger.info( 'Starting batch -- number of file: %s' % (len(c4i.flist)) )
481    if len( c4i.errs ) > 0:
482      for i in range(0,len( c4i.errs ), 2 ):
483        c4i.logger.info( c4i.errs[i] )
484 
485    self.cc.info.amapListDraft = []
486    cbv = utils.checkByVar( parent=self.cc.info,cls=c4i.project,monitor=self.monitor)
487    cbv.impt( c4i.flist )
488    if printInfo:
489      print cbv.info
490
491    fileLogOpen = False
492    self.resList =  []
493    stdoutsum = 2000
494    npass = 0
495    kf = 0
496    for f in c4i.flist:
497      kf += 1
498      rv = False
499      ec = None
500      if monitorFileHandles:
501        nofhStart = self.monitor.get_open_fds()
502      fn = string.split(f,'/')[-1]
503      c4i.logger.info( 'Starting: %s' % fn )
504      try:
505  ### need to have a unique name, otherwise get mixing of logs despite close statement below.
506  ### if duplicate file names are present, this will be recorded in the main log, tag appended to file level log name (not yet tested).
507        if c4i.logByFile:
508          fLogger = c4i.getFileLog( fn )
509          logDict[fn] = c4i.fileLogfile
510          c4i.logger.info( 'Log file: %s' % c4i.fileLogfile )
511          fileLogOpen = True
512        else:
513          fLogger = c4i.logger
514 
515        fLogger.info( 'Starting file %s' % fn )
516## default appending to myapp.log; mode='w' forces a new file (deleting old contents).
517        self.cc.checkFile( f, log=fLogger,attributeMappings=c4i.attributeMappings )
518
519        if self.cc.completed:
520          if cal not in (None, 'None') and self.cc.cgd.varGroup != "fx":
521            if cal != self.cc.calendar:
522              cal_change_err_msg = 'Error: change in calendar attribute %s --> %s' % (cal, self.cc.calendar)
523              c4i.logger.info(cal_change_err_msg)
524              fLogger.info(cal_change_err_msg)
525              self.cc.errorCount += 1
526
527          cal = self.cc.calendar
528          ec = self.cc.errorCount
529        rv =  ec == 0
530        if rv:
531          npass += 1
532        self.resList.append( (rv,ec) )
533
534        if c4i.logByFile:
535          if self.cc.completed:
536            fLogger.info( 'Done -- error count %s' % self.cc.errorCount )
537          else:
538            fLogger.info( 'Done -- checks not completed' )
539          c4i.closeFileLog( )
540          fileLogOpen = False
541
542        if self.cc.completed:
543          c4i.logger.info( 'Done -- error count %s' % self.cc.errorCount ) 
544          ecount += self.cc.errorCount
545          if self.cc.errorCount == 0:
546            rec.add( f, self.cc.drs )
547          else:
548            rec.addErr( f, 'ERRORS FOUND | errorCount = %s' % self.cc.errorCount )
549        else:
550          ecount += 20
551          c4i.logger.info( 'Done -- testing aborted because of severity of errors' )
552          rec.addErr( f, 'ERRORS FOUND AND CHECKS ABORTED' )
553      except:
554        c4i.logger.error("Exception has occured" ,exc_info=1)
555        if fileLogOpen:
556          fLogger.error("C4.100.001: [exception]: FAILED:: Exception has occured" ,exc_info=1)
557          c4i.closeFileLog( )
558          fileLogOpen = False
559        rec.addErr( f, 'ERROR: Exception' )
560        if not c4i.holdExceptions:
561          raise
562      if stdoutsum > 0 and kf%stdoutsum == 0:
563         print '%s files checked; %s passed this round' % (kf,npass)
564      if monitorFileHandles:
565        nofhEnd = self.monitor.get_open_fds()
566        if nofhEnd > nofhStart:
567           print 'Open file handles: %s --- %s' % (nofhStart, nofhEnd)
568 
569    self.cc.info.log = c4i.logger
570   
571    if c4i.project not in ['SPECS','CCMI','CMIP5']:
572       cbv.c4i = c4i
573       cbv.setLogDict( logDict )
574       cbv.check( recorder=rec, calendar=self.cc.calendar)
575       try:
576         ecount += cbv.errorCount
577       except:
578         ecount = None
579    ncReader.close()
580    if type( self.cc.info.amapListDraft ) == type( [] ) and len(  self.cc.info.amapListDraft ) > 0:
581      ll =  self.cc.info.amapListDraft
582      ll.sort()
583      oo = open( 'amapDraft.txt', 'w' )
584      oo.write( ll[0] + '\n' )
585      for i in range( 1,len(ll) ):
586        if ll[i] != ll[i-1]:
587          oo.write( ll[i] + '\n' )
588      oo.close()
589    if c4i.project in ['SPECS','CCMI','CMIP5']:
590      rec.checktids()
591    rec.dumpAll()
592    if printInfo:
593      print 'Error count %s' % ecount
594    ##c4i.hdlr.close()
595    c4i.closeBatchLog()
596    self.ok = all( map( lambda x: x[0], self.resList ) )
597
598
599   
600
601
602def main_entry():
603   """
604   Wrapper around main() for use with setuptools.
605
606   """
607   main(printInfo=True)
608
609if __name__ == '__main__':
610  if sys.argv[1] == '--sum':
611      import summary
612      summary.main()
613      raise SystemExit(0)
614  main_entry()
615
616
617##else:
618  ##f1 = '/data/u10/cordex/AFR-44/SMHI/ECMWF-ERAINT/evaluation/SMHI-RCA4/v1/day/clh/clh_AFR-44_ECMWF-ERAINT_evaluation_r1i1p1_SMHI-RCA4_v1_day_19810101-19851231.nc'
619  ##f2 = '/data/u10/cordex/AFR-44/SMHI/ECMWF-ERAINT/evaluation/SMHI-RCA4/v1/sem/tas/tas_AFR-44_ECMWF-ERAINT_evaluation_r1i1p1_SMHI-RCA4_v1_sem_200012-201011.nc'
620  ##f3 = '/data/u10/cordex/AFR-44i/SMHI/ECMWF-ERAINT/evaluation/SMHI-RCA4/v1/mon/tas/tas_AFR-44i_ECMWF-ERAINT_evaluation_r1i1p1_SMHI-RCA4_v1_mon_199101-200012.nc'
621  ##cc.checkFile( f3 )
Note: See TracBrowser for help on using the repository browser.