Python Interface to MAPL: Difference between revisions

No edit summary
Line 7: Line 7:
== GEOS-5 Application with Fortran Root Component ==
== GEOS-5 Application with Fortran Root Component ==


In this example, the very top root component is implemented entirely in a shared library.
In this example of a GEOS-5 application written in Python, the very top root component is implemented entirely in a shared library.
 
""""
The GEOSgcm application written in python, starting from a
Root Component implemented in Fortran.
"""


  import MAPL
  import MAPL


  if __name == "__main__":
  if __name == "__main__":
 
  #  Instantiate the root component
  #  Instantiate the root component
  #  ------------------------------
  #  ------------------------------
     gcs = MAPL.GridComp(lib='/some/path/libGEOSana.so')
     gcs = MAPL.GridComp(lib='/some/path/libGEOSana.so')
 
  #  Instantiate MAPL
  #  Instantiate MAPL
  #  ----------------
  #  ----------------
     mapl = MAPL(root=gcs)
     mapl = MAPL(root=gcs)
 
  #  Run the cap
  #  Run the cap
  #  -----------
  #  -----------
Line 32: Line 27:
== GEOS-5 Application with Python Root Component ==
== GEOS-5 Application with Python Root Component ==


In this example, the very top root component is implemented in Python.
In this example, the very top root component is now implemented in Python.
 
""""
The GEOSgcm application written in python, starting from a
Root Component implemented in Fortran.
"""


  import MAPL
  import MAPL
  import GEOSgcs  # the GEOSgcs component is implemented here
  import GEOSgcs  # the GEOSgcs component is implemented here
 
  if __name == "__main__":
  if __name == "__main__":