1 / 6

Some Strategies for Porting Legacy Codes to ESMF

Learn effective strategies for porting legacy codes to ESMF, including gradual adoption and customization of ESMF components and data types. Start by splitting your code and create a fake version of ESMF Mod. Then, transition to ESMF-compliant interfaces and gradually adopt ESMF data types and framework services.

gronald
Download Presentation

Some Strategies for Porting Legacy Codes to ESMF

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. Some Strategies for Porting Legacy Codes to ESMF Arlindo da Silva, NASA/GSFC Data Assimilation Office Data Assimilation Office, NASA/GSFC 2nd ESMF Community Meeting, 15 May 2003

  2. ESMF Components • ESMF Gridded Components need to provide a minimum of 3 subroutines: Module ATM_GridComp Public: ATM_SetServices() Private: ATM_Initialize() ATM_Run() ATM_Finalize() These are saved In function pointer Table by ATM_SetServices() Arlindo da Silva/Shujia Zhou

  3. ESMF Interface Data Types Key high-level ESMF data types: Use ESMF_Mod Type(ESMF_GridComp) :: gcATM Type(ESMF_State):: impATM, expATN Type(ESMF_Clock):: clock call ESMF_Run ( gcATM, impATM, expATM, clock, rc ) Arlindo da Silva/Shujia Zhou

  4. ESMF F90 Application • User code is called via ESMF routines of similar name Type(ESMF_GridComp) :: gcATM gcATM = ESMF_GridCompCreate() Call ESMF_GridCompSetServices(gcATM,…) Call ESMF_GridCompInitialize(gcATM,…) Call ESMF_GridCompRun(gcATM,…) Call ESMF_GridCompFinalize(gcATM,…) • Strategy: gradual adoption Arlindo da Silva/Shujia Zhou

  5. Porting Strategy • Start by splitting your code in 3 main subroutines, using whatever arguments are natural: subroutine ATM_Initialize( arg1, arg2, arg3) subroutine ATM_Run( arg1, array, ier ) subroutine ATM_Finalize() • Create a fake version of ESMF_Mod with the main data types (ESMF_GridComp, ESMF_State) are costumized to represent your data structures, e.g., type ESMF_State integer :: im, jm, km real myArray(im,jm,km), whatever(im,jm) end type ESMF_State Arlindo da Silva/Shujia Zhou

  6. Porting Strategy • Next, use this customized ESMF_Mod write an ESMF compliant interface for your component: subroutine ATM_Run (gcATM, impATM,expATM,clock,rc) • Gradually, adopt the ESMF data types: Use ESMF_Mod, only: clock Use myESMF_Mod, only: ESMF_GridComp, ESMF_State • Adopt ESMF_SetServices, and ESMF framework: ESMF_Initialize, ESMF_Run, ESMF_Finalize • Then, gradually adopt ESMF infrastructure Arlindo da Silva/Shujia Zhou

More Related