1 / 14

Creating and Linking Components in ESMF and CCA

Creating and Linking Components in ESMF and CCA. Eric Hutton Cyberinformatics and numerics working group February 2008. CCA. Common Component Architecture. Create component: sedflux. Create component: sedflux. Create an ESMF application. Link components to create an application.

harken
Télécharger la présentation

Creating and Linking Components in ESMF and CCA

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Creating and Linking Components in ESMF and CCA Eric Hutton Cyberinformatics and numerics working group February 2008

  2. CCA Common Component Architecture Create component: sedflux Create component: sedflux Create an ESMF application Link components to create an application My experiences creating and linking components from existing code River Plume Subsidence

  3. A component is an encapsulated “object” defined by its public interfaces Interface Component Interface

  4. sedflux links process models to build stratigraphy on continental margins

  5. sedflux Input files Output files Create a sedflux library that contains a programming interface: anything done before time stepping (allocate resources, open files, etc.) sedflux_init(): sedflux_run(): advance the model one time step sedflux_destroy(): anything done after time stepping To become an ESMF component, the sedflux programming interface was refactored Like many models, sedflux is called from the command line,

  6. Difficulties calling c from FORTRAN (or vice versa) include: Name mangling: Foo() becomes foo_, or FOO, or FOO_, or … Arrays: FORTRAN arrays are not simply pointers Unsupported features: Complex numbers, pointers, structs The first difficulty was that sedflux is written in c and ESMF in FORTRAN Details in communicating between c and FORTRAN can be both platform and compiler specific.

  7. ESMF likes uniform grids of variables. The second difficulty was that sedflux is not grid based in the same way the ESMF is sedflux thinks of the world as cubes of sediment stacked on top of one another to form columns. To get around this, sedflux kept track of its own state through global variables.

  8. Init components sedflux sedflux state struct Run component: sedflux foo Run component: foo Destroy components To get around this, sedflux kept track of its own state through global variables ESMF application For another component to interact with sedflux it needs to know about this state variable. Imposes sedflux’s implementation. Not Good

  9. In CCA, interfaces (or ports) define a component A port is not an implementation only a description. The description is written in either SIDL (Scientific Interface Definition Language) or XML. A subsidence component could have a deflectionPort interface deflectionPort extends gov.cca.Port { // Set constants from a file. int init( in string file ); // Get the deflection (in meters) due to the applied loads. int get_deflection_in_m( inout rarray<double,1> dz(len) , in rarray<double,1> x(len) , in rarray<double,1> load(len) , in int len ); }

  10. Driver uses provides sedflux uses provides River A CCA component can both use and provide data through a port Provides a handle to thesedflux environment Uses river dynamics to driveplume model

  11. get_deflection_in_m() set_params() Subsidence get_deposit_in_m() get_deposit_mass() run_plume() Plume get_deposit_in_m() get_deposit_mass() run_plume() Hyperpycnal Plume Smaller models provide another level of granularity Port Component

  12. sedflux Get a sedflux handle and convert to load grid Change elevations in sedflux uses provides Convert uses Give load grid to subsidence Get back a deflection grid provides Subsidence Adding a subsidence model to sedflux requires a converter component Uses a sedfluxhandle Provides a deflectiongrid

  13. or on the command line: > connect Driver deflectionPort Subside deflectionPort In CCA, components are connected using ccafe ccafe can be run in gui mode (needs some work):

  14. CCA is more flexible Language neutral Does not impose a framework ESMF comes with a large amount of infrastructure Timers States Grid manipulation Decomposition elements In conclusion, CCA offers more flexibility while ESMF more infrastructure But ESMF could be incorporated into CCA as a toolkit Questions?

More Related