ESMF-based applications with the National Unified Operational Prediction Capability Tim Campbell Naval Research Laboratory Outline Describe how NUOPC Layer is implemented in Navy ESM systems (focus on regional ESM). Hopefully, illuminate how NUOPC improves interoperability. Describe some areas that still need work. • Overview of COAMPS • Specialization of NUOPC Generic Components • Initialization Sequencing • Field Brokering • Further Developments in NUOPC 2/20/13 2 Coupled Ocean-Atmosphere Mesoscale Prediction System Regional coupled atmosphere/ocean/wave prediction system with data-assimilation. 2/20/13 3 Current Design with ESMF COAMPS_Driver ESMF_GridComp (Initialize, Run, Finalize) OCN ATM (internal surface layer) Model connections controlled by COAMPS_Driver WAV • No brokering of inter-model connections (set by input list of coupling fields) • COAMPS specific field names hardwired into models • Difficult to add new models and new coupling fields 2/20/13 4 Current Design with NUOPC-ESMF COAMPS_Driver (derived from NUOPC_Driver) NUOPC_Model (Multiphase Intialize, Run, Finalize) OCN ATM (internal surface layer) NUOPC_Connector (connect import state to export state, compute & execute regrid routeHandle(s)) WAV • Brokering of inter-model connections (NUOPC_Connector) • Coupling determined by model import fields (model specified BCs) • Field names obtained from NUOPC_FieldDictionary 2/20/13 5 Future Design with NUOPC-ESMF COAMPS_Driver (derived from NUOPC_Driver) NUOPC_Model (Multiphase Intialize, Run, Finalize) NUOPC_Mediator (flux calculations) ICE ATM MED OCN NUOPC_Connector (connect import state to export state, compute & execute regrid routeHandle(s)) WAV • Brokering of inter-model connections (NUOPC_Connector) • Coupling determined by model import fields (model specified BCs) • Field names obtained from NUOPC_FieldDictionary 2/20/13 6 Specialization from NUOPC_Driver use NUOPC_Driver, only: & routine_SetServices, & type_InternalState, & label_InternalState, & label_SetModelCount, & label_SetModelPetLists, & label_SetModelServices Required Methods: SetServices – set entry points for driver methods Specializing Methods: SetModelCount – set number of models controlled by driver SetModelPetLists – set processor layout for each model SetModelServices – call into SetServices for each model, define run sequence The run sequence encodes the order in which models and connectors are executed. Knowledge of inter-model data-dependencies is required. 2/20/13 7 Specialization from NUOPC_Model use NUOPC_Model, only: & routine_SetServices, & type_InternalState, & label_InternalState, & label_DataInitialize, & label_SetClock, & label_Advance Required Methods: SetServices – set entry points for model methods InitializeP0 – set version of NUOPC initialization sequence InitializeP1 – advertise import & exportable fields InitializeP2 – realize import fields & connected export fields Specializing Methods: SetClock – set internal clock DataInitialize – initialize export fields ModelAdvance – advance model in time 2/20/13 8 Specialization from NUOPC_Connector use NUOPC_Connector, only: & routine_SetServices, & type_InternalState, & label_InternalState, & label_ComputeRouteHandle, & label_ExecuteRouteHandle, & label_ReleaseRouteHandle Required Methods: SetServices – set entry points for connector methods Specializing Methods: ComputeRH – create & store export-to-import data routing ExecuteRH – execute export-to-import data routing ReleaseRH – destroy export-to-import data routing 2/20/13 9 ESMF to ESMF-NUOPC • Refactor code in each model’s ESMF layer – change single initialize phase into multiple phases and specializing attachable methods – change run phase to ModelAdvance method – acceptable amount of code change – resulting code is improved in that each method has a welldefined purpose that is understood by the driver • Implement new driver specialized from NUOPC_Driver – new driver is more streamlined and flexible – same driver will be used in several Navy ESM systems • Main challenge was in understanding the NUOPC API 2/20/13 10 Initialize Sequence – Satisfying Intermodel Data Dependencies ATM SST OCN 2/20/13 WIND SSH, SSC WAV • OCN does not require import fields to compute initial state • ATM requires SST to compute initial state • WAV requires WIND, SSH and SSC to compute initial state 11 Initialize Sequence – Satisfying Intermodel Data Dependencies • Each model “knows” what is required in order to compute its initial state and export fields (e.g., WAV requires wind and currents) • In DataInitialize method each model: – checks time-stamp on import fields required to compute export fields – sets “Updated” attribute on updated export fields • Connector ExecuteRH method time-stamps import fields that are mapped from “Updated” export fields • Driver cycles Connector ExecuteRH and model DataInitialize methods until all models declare that initialize datadependencies are satisfied or until a dead-lock is detected. 2/20/13 12 Initialize Sequence – Satisfying Intermodel Data Dependencies 2 ATM SST 2 1 WIND 2 OCN 2/20/13 3 SSH, SSC WAV 3 • Three steps of ExecuteRH & DataInitialize required • Each model only encodes its own required data dependencies • Driver executes generic sequence and detects dead-lock (no progress) 13 Field Brokering • Pre-NUOPC enabled COAMPS: – Fields do not have attributes – Inter-model connections imposed by driver using field name – COAMPS specific field names encoded into each model • NUOPC enabled COAMPS: – – – – 2/20/13 Fields have attributes (StandardName, Units, etc) Inter-model connections based on StandardNames NUOPC Field StandardNames encoded into each model Models can query NUOPC FieldDictionary to obtain CanonicalUnits and default ShortName 14 Further Developments in NUOPC • Field Brokering – Establish a method for constructing StandardNames that uniquely identify fields – CF, CSDMS? • Establish method by with the run sequence can be determined from Model attributes. – similar to the initialize phase definition 2/20/13 15 Thank-You Questions?