Python Interface to MAPL: Difference between revisions

No edit summary
 
(One intermediate revision by the same user not shown)
Line 15: Line 15:
  #  Instantiate the root component
  #  Instantiate the root component
  #  ------------------------------
  #  ------------------------------
     gcs = MAPL.GridComp(lib='/some/path/libGEOSana.so')
     gcs = MAPL.GridComp(lib='/some/path/libGEOSgcs.so')
    
    
  #  Instantiate MAPL
  #  Instantiate MAPL
Line 125: Line 125:
In this case we implement the standard '''Run()''' method, but inherit '''Initialize()''' and '''Finalize()''' from the base class '''MAPL.GridComp'''
In this case we implement the standard '''Run()''' method, but inherit '''Initialize()''' and '''Finalize()''' from the base class '''MAPL.GridComp'''


     def Run(self):
     def Run(self,clock):
         """
         """
         Implementation of a simple run method.
         Implementation of a simple run method.
Line 132: Line 132:
  #      Run the base class method
  #      Run the base class method
  #      -------------------------
  #      -------------------------
         MAPL.GridComp.__Run__(self)
         MAPL.GridComp.__Run__(self,clock)
   
   
  #      Retrieve some data from a state
  #      Retrieve some data from a state
  #      -------------------------------
  #      -------------------------------
         uwnd, vwnd, = self.Export.GetPointer(['UWND', 'VWND'])
         uwnd, vwnd, = self.Export.GetPointer(['UWND', 'VWND'])
#      Print states
#      ------------
        self.Internal.print()
        self.Import.print()
        sllf.Export.print()
   
   
  #      Just print it
  #      Just print it