Changeset 862


Ignore:
Timestamp:
14/11/16 22:47:44 (3 years ago)
Author:
mjuckes
Message:

fixed ex203.py

Location:
CMIP6dreqbuild/trunk/src/framework/dreqPy
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • CMIP6dreqbuild/trunk/src/framework/dreqPy/dreqCmdl.py

    r743 r862  
    3636      print( "Starting test suite 2" ) 
    3737      if scr: 
    38         import examples.ex203 
     38        import examples.ex203 as ex203 
    3939      else: 
    4040        from .examples import ex203 
     41      ex203.main( scope ) 
    4142      print( "Tests completed" ) 
    4243  else: 
  • CMIP6dreqbuild/trunk/src/framework/dreqPy/examples/ex203.py

    r828 r862  
    1212    print ( 'Specified directory does not exist: %s' % sys.argv[1] ) 
    1313    sys.exit(0) 
    14 else: 
    15   from dreqPy import scope 
    16  
    17 sc = scope.dreqQuery() 
    18 print ('DREQ VERSION: %s' % str(sc.dq.version) ) 
    1914 
    2015## set bytes per floating point number to be 2, assuming 50% compression 
     
    2217 
    2318priorityMax = 3 
    24 def runExample( priorityMax ): 
     19def runExample( sc, priorityMax ): 
    2520    ll = ['C4MIP','CFMIP','LUMIP'] 
    2621    ee = {} 
     
    4338    print ( 'Combined, tier 1+2 only:  %5.1fTb'  % z2 ) 
    4439 
    45 print ( '######### All variables ###########' ) 
    46 priorityMax = 3 
    47 runExample( priorityMax ) 
    48 print ( '######### Top priority variables ###########' ) 
    49 priorityMax = 1 
    50 runExample( priorityMax ) 
     40def main(scope): 
     41 
     42  sc = scope.dreqQuery() 
     43  print ('DREQ VERSION: %s' % str(sc.dq.version) ) 
     44  print ( '######### All variables ###########' ) 
     45  priorityMax = 3 
     46  runExample( sc, priorityMax ) 
     47  print ( '######### Top priority variables ###########' ) 
     48  priorityMax = 1 
     49  runExample( sc, priorityMax ) 
     50 
     51if __name__ == '__main__': 
     52  main( scope ) 
Note: See TracChangeset for help on using the changeset viewer.