Difference between revisions of "Model Coupling ESMF"

From WikiROMS
Jump to navigationJump to search
Line 60: Line 60:
   ==> Entering <span class="red">ATM_SetServices</span>
   ==> Entering <span class="red">ATM_SetServices</span>
   ==> Entering <span class="green">DATA_SetServices</span>
   ==> Entering <span class="green">DATA_SetServices</span>
   ==> Entering <span class="darkTurquoise">Coupler_SetServices</span> for <span class="blue">ROMS</span>-TO-<span class="red">WRF</span>
   ==> Entering <span class="darkTurquoise">Coupler_SetServices</span> for <span class="blue">ROMS</span>-TO-<span class="red">ATM</span>
   ==> Entering <span class="darkTurquoise">Coupler_SetServices</span> for <span class="red">WRF</span>-TO-<span class="blue">ROMS</span>
   ==> Entering <span class="darkTurquoise">Coupler_SetServices</span> for <span class="red">ATM</span>-TO-<span class="blue">ROMS</span>
   ==> Entering <span class="darkTurquoise">Coupler_SetServices</span> for <span class="green">DATA</span>-TO-<span class="red">WRF</span>
   ==> Entering <span class="darkTurquoise">Coupler_SetServices</span> for <span class="green">DATA</span>-TO-<span class="red">ATM</span>
   ==> Entering ESM_SetRunSequence
   ==> Entering ESM_SetRunSequence
   ==> Entering <span class="blue">ROMS_SetInitializeP1</span>
   ==> Entering <span class="blue">ROMS_SetInitializeP1</span>
   ==> Entering <span class="red">WRF_SetInitializeP1</span>
   ==> Entering <span class="red">ATM_SetInitializeP1</span>
   ==> Entering <span class="green">DATA_SetInitializeP1</span>
   ==> Entering <span class="green">DATA_SetInitializeP1</span>
   ==> Entering <span class="blue">ROMS_SetInitializeP2</span>
   ==> Entering <span class="blue">ROMS_SetInitializeP2</span>
   ==> Entering <span class="blue">ROMS_SetGridArrays</span>
   ==> Entering <span class="blue">ROMS_SetGridArrays</span>
   ==> Entering <span class="blue">ROMS_SetStates</span>
   ==> Entering <span class="blue">ROMS_SetStates</span>
   ==> Entering <span class="red">WRF_SetInitializeP2</span>
   ==> Entering <span class="red">ATM_SetInitializeP2</span>
   ==> Entering <span class="red">WRF_SetGridArrays</span>
   ==> Entering <span class="red">ATM_SetGridArrays</span>
   ==> Entering <span class="red">WRF_SetStates</span>
   ==> Entering <span class="red">ATM_SetStates</span>
   ==> Entering <span class="green">DATA_SetInitializeP2</span>
   ==> Entering <span class="green">DATA_SetInitializeP2</span>
   ==> Entering <span class="green">DATA_Initialize</span>
   ==> Entering <span class="green">DATA_Initialize</span>
Line 82: Line 82:
   ==> Entering <span class="green">DATA_SetGridArrays</span>
   ==> Entering <span class="green">DATA_SetGridArrays</span>
   ==> Entering <span class="green">DATA_SetStates</span>
   ==> Entering <span class="green">DATA_SetStates</span>
   ==> Entering <span class="darkTurquoise">Coupler_ComputeRH</span> for <span class="blue">ROMS</span>-TO-<span class="red">WRF</span>
   ==> Entering <span class="darkTurquoise">Coupler_ComputeRH</span> for <span class="blue">ROMS</span>-TO-<span class="red">ATM</span>
   ==> Entering <span class="darkTurquoise">Coupler_ComputeRH</span> for <span class="red">WRF</span>-TO-<span class="blue">ROMS</span>
   ==> Entering <span class="darkTurquoise">Coupler_ComputeRH</span> for <span class="red">ATM</span>-TO-<span class="blue">ROMS</span>
   ==> Entering <span class="darkTurquoise">Coupler_ComputeRH</span> for <span class="green">DATA</span>-TO-<span class="red">WRF</span>
   ==> Entering <span class="darkTurquoise">Coupler_ComputeRH</span> for <span class="green">DATA</span>-TO-<span class="red">ATM</span>
   ==> Entering <span class="blue">ROMS_SetClock</span>
   ==> Entering <span class="blue">ROMS_SetClock</span>
   ==> Entering <span class="red">WRF_SetClock</span>
   ==> Entering <span class="red">ATM_SetClock</span>
   ==> Entering <span class="green">DATA_SetClock</span>
   ==> Entering <span class="green">DATA_SetClock</span>
   ==> Entering <span class="blue">ROMS_DataInit</span>
   ==> Entering <span class="blue">ROMS_DataInit</span>
   ==> Entering <span class="blue">ROMS_Export</span>
   ==> Entering <span class="blue">ROMS_Export</span>
   ==> Entering <span class="red">WRF_DataInit</span>
   ==> Entering <span class="red">ATM_DataInit</span>
[[Image:DATA-ATM-ROMS_Semi-Implicit_Avg_Coupling_Frame_0.png|550px]]
[[Image:DATA-ATM-ROMS_Semi-Implicit_Avg_Coupling_Frame_0.png|550px]]
   ==> Entering <span class="darkTurquoise">Coupler_ExecuteRH</span> for <span class="green">DATA</span>-TO-<span class="red">WRF</span>
   ==> Entering <span class="darkTurquoise">Coupler_ExecuteRH</span> for <span class="green">DATA</span>-TO-<span class="red">ATM</span>
[[Image:DATA-ATM-ROMS_Semi-Implicit_Avg_Coupling_Frame_1.png|550px]]
[[Image:DATA-ATM-ROMS_Semi-Implicit_Avg_Coupling_Frame_1.png|550px]]
   ==> Entering <span class="green">DATA_ModelAdvance</span>
   ==> Entering <span class="green">DATA_ModelAdvance</span>
Line 98: Line 98:
   ==> Entering <span class="green">DATA_Export</span>
   ==> Entering <span class="green">DATA_Export</span>
   ==> Entering <span class="green">DATA_TimeInterp</span>
   ==> Entering <span class="green">DATA_TimeInterp</span>
   ==> Entering <span class="darkTurquoise">Coupler_ExecuteRH</span> for <span class="blue">ROMS</span>-TO-<span class="red">WRF</span>
   ==> Entering <span class="darkTurquoise">Coupler_ExecuteRH</span> for <span class="blue">ROMS</span>-TO-<span class="red">ATM</span>
[[Image:DATA-ATM-ROMS_Semi-Implicit_Avg_Coupling_Frame_2.png|550px]]
[[Image:DATA-ATM-ROMS_Semi-Implicit_Avg_Coupling_Frame_2.png|550px]]
   ==> Entering <span class="red">WRF_SetRunClock</span>
   ==> Entering <span class="red">ATM_SetRunClock</span>
   ==> Entering <span class="red">WRF_CheckImport</span>
   ==> Entering <span class="red">ATM_CheckImport</span>
   ==> Entering <span class="red">WRF_ModelAdvance</span>
   ==> Entering <span class="red">ATM_ModelAdvance</span>
[[Image:DATA-ATM-ROMS_Semi-Implicit_Avg_Coupling_Frame_3.png|550px]]
[[Image:DATA-ATM-ROMS_Semi-Implicit_Avg_Coupling_Frame_3.png|550px]]
   ==> Entering <span class="red">WRF_Import</span>
   ==> Entering <span class="red">ATM_Import</span>
   ==> Entering <span class="red">WRF_ProcessImport</span>
   ==> Entering <span class="red">ATM_ProcessImport</span>
   ==> Entering <span class="red">WRF_Export</span>
   ==> Entering <span class="red">ATM_Export</span>
   ==> Entering <span class="darkTurquoise">Coupler_ExecuteRH</span> for <span class="red">WRF</span>-TO-<span class="blue">ROMS</span>
   ==> Entering <span class="darkTurquoise">Coupler_ExecuteRH</span> for <span class="red">ATM</span>-TO-<span class="blue">ROMS</span>
[[Image:DATA-ATM-ROMS_Semi-Implicit_Avg_Coupling_Frame_4.png|550px]]
[[Image:DATA-ATM-ROMS_Semi-Implicit_Avg_Coupling_Frame_4.png|550px]]
   ==> Entering <span class="blue">ROMS_SetRunClock</span>
   ==> Entering <span class="blue">ROMS_SetRunClock</span>
Line 115: Line 115:
   ==> Entering <span class="blue">ROMS_Import</span>
   ==> Entering <span class="blue">ROMS_Import</span>
   ==> Entering <span class="blue">ROMS_Export</span>
   ==> Entering <span class="blue">ROMS_Export</span>
   ==> Entering <span class="darkTurquoise">Coupler_ExecuteRH</span> for <span class="green">DATA</span>-TO-<span class="red">WRF</span>
   ==> Entering <span class="darkTurquoise">Coupler_ExecuteRH</span> for <span class="green">DATA</span>-TO-<span class="red">ATM</span>


==Coupling with Nested Grids==
==Coupling with Nested Grids==

Revision as of 13:33, 27 April 2022

EARTH SYSTEM MODEL FRAMEWORK (ESMF)

Overview

Significant progress has been made over the past decade in the standardization of coupling tools without reducing model diversity through the Earth System Modeling Framework (ESMF; Collins et al., 2005) and the National Unified Operational Prediction Capability (NUOPC) consortia. The NUOPC layer is a simplified infrastructure on top of the ESMF library (version 7 or higher) that provides conventions and templates to facilitate easy coupling between Earth System Models (ESM). It consists of four components: (i) a driver, (ii) the models, (iii) mediators, and (iv) connectors. The driver controls the models, mediators, connectors, and coordinates tasks such as initialization and time stepping. The mediators are custom codes that facilitate the coupling of the models, and control tasks such as flux calculations, rescaling, and averaging. The connectors join ESM components and perform operations such as regridding between the source and destination fields when needed. While the NUOPC layer is available in ESMF version 7 of higher, ROMS coupling requires version 8 or higher because it uses the RunSequence input configuration script and uses version 8 features for nesting.

The critical Fortran module that sits on top of each ESM is the so-called NUOPC cap file. There is a separate cap file for each coupled component, which, from the ROMS perspective, corresponds to the atmosphere, sea-ice, wave model, etc. Therefore, it is an abstract block that allows ROMS to communicate and exchange data seamlessly within the ESMF/NUOPC framework. The ROMS and other ESM grids may (and usually do) have a different geographical extent and horizontal resolution. So if, for example, the atmosphere component domain is larger than the ROMS domain, it is necessary to provide data from another source to the atmosphere model at all of the surface grid-points that lie outside the ROMS domain. Therefore, a DATA component and its cap file is also required for most applications. In this case, SST is exported from ROMS and DATA to the atmosphere component which imports at melded SST field.

The ROMS coupling interface with the ESMF/NUOPC library allows both driver and component methods of operation. In the driver method, it provides all the interfaces needed to couple to other ESM components including the executable driver, NUOPC-based generic ESM component services, model gridded components or NUOPC Model cap files, connectors between components for re-gridding source and destination fields, input scripts, and coupling metadata management. A NUOPC Model cap is a Fortran code layer that sits on top of the ESM component, making calls to the numerical kernel via the initialize, run, and finalize phases. Alternatively, in the component method, the NUOPC ROMS cap module is provided, and it can be adapted and incorporated into other NUOPC-based coupling systems, like the NOAA Environmental Modeling System (NEMS).

ROMS Coupling.png
Figure 1: ROMS driver mode ESMF/NUOPC coupling framework


A prototype of the ROMS coupling framework based on the ESMF/NUOPC library is illustrated in Figure 2 showing the Driver, Models, and Connectors. The Driver controls all the aspects of the coupling between the ESM components and their connections: configuration, initialization, time-stepping sequence, data exchanges, and termination. The Models are the gridded data and gridded geophysical numerical kernels wrapped into a NUOPC cap file interface. The Connectors between ESM components execute the remapping and regridding between the source and destination fields. The interpolation is usually linear with extrapolation support in the vicinity of masked grid cells. In this project, the coupling framework will include the Atmosphere Model (WRF), the Ocean Model (ROMS), and the Data Model since the grids are incongruent. The Data Model is needed because WRF requires sea surface temperature (SST) on those grid points not covered by ROMS (see Figure X).

Sequential Vs. Concurrent Mode

In sequential mode, all of the coupled model components are executed on all of the processors one after the other sequentially. In concurrent mode, each coupled model component executes on its own set of non-overlapping processors.

Regridding and Extrapolation Methods

Regridding interpolation methods between source and destination fields can be bilinear or conservative. Unmapped cells during regridding are usually located at land/sea boundaries. These unmapped cells can be mapped using the following methods: nearest source to destination, nearest inverse distance average, creep fill at specified level, or two steps extrapolation (Turuncoglu).

Indian Ocean Land/Sea Masks Mismatch??

! Cinfo(11) Field regridding method from source to destination:
! 'bilinear' => bilinear interpolation
! 'patch' => high-order patch recovery
! 'conservative1' => first-order conservative
! 'conservative2' => second-order conservative
! 'nearest' => nearest neighbor interpolation
! Cinfo(12) Field extrapolation method for unmapped points:
! 'none' => no extrapolation
! 'nearest' => nearest source to destination
! 'idavg' => nearest inverse distance average
! 'creep' => creep fill at specified level
! '2steps' => Turuncoglu's 2 steps extrapolation

'SST'
'sea_surface_temperature' ! standard name
'sea surface temperature'
't(:,:,N,itemp)', 'ROMS' ! source variable, ROMS
'C' ! source units
'Center' ! source grid-cell
'sst', 'WRF' ! destination variable, WRF
'K' ! destination units
'Center' ! destination grid-cell
'SST' ! DATA Model file variable
'bilinear' ! regridding method
'nearest' ! unmapped extrapolation method
.TRUE. ! connected to coupler
.FALSE. ! debug write into a NetCDF file
273.15d0 ! importing add offset
1.0d0 ! importing scale
'dSST'
'sea_surface_temperature_data' ! standard name
'sea surface temperature data'
'temperature', 'HyCOM' ! source variable, DATA
'C' ! source units
'Center' ! source grid-cell
'sst', 'WRF' ! destination variable, WRF
'K' ! destination units
'Center' ! destination grid-cell
'temperature' ! DATA field and time variables
'bilinear' ! regridding method
'nearest' ! unmapped extrapolation method
.TRUE. ! connected to coupler
.FALSE. ! debug write into a NetCDF file
273.15d0 ! importing add offset
1.0d0 ! importing scale

Explicit Vs. Semi-Implicit Run Sequence

DATA-ATM-ROMS Explicit Coupling.png   DATA-ATM-ROMS Semi-Implicit Avg Coupling.png
Explicit   Semi-Implicit, ATM Average
# Hurricane Irene Application (single time loop)

runSeq::
@240 # timeStep = 4 min interval
DATA -> WRF # DATA to WRF connector bw1.png
DATA
WRF -> ROMS # WRF to ROMS connector bw2.png
ROMS -> WRF # ROMS to WRF connector bw3.png
WRF bw4.png
ROMS bw5.png
@
::
 
# Hurricane Irene Application (single time loop)

runSeq::
@* # timeStep = wildcard (*)
DATA -> WRF # DATA to WRF connector bw1.png
DATA
ROMS -> WRF # ROMS to WRF connector bw2.png
WRF bw3.png
WRF -> ROMS # WRF to ROMS connector bw4.png
ROMS bw5.png
@
::
Atmosphere exports instantaneous fields   Atmosphere exports time-averaged fields

(Recommended for Conservation)

Semi-implicit Algorithm Deatils

 ==> Entering ESM_SetServices
 ==> Entering ESM_SetModelServices
 ==> Entering ROMS_SetServices
 ==> Entering ATM_SetServices
 ==> Entering DATA_SetServices
 ==> Entering Coupler_SetServices for ROMS-TO-ATM
 ==> Entering Coupler_SetServices for ATM-TO-ROMS
 ==> Entering Coupler_SetServices for DATA-TO-ATM
 ==> Entering ESM_SetRunSequence
 ==> Entering ROMS_SetInitializeP1
 ==> Entering ATM_SetInitializeP1
 ==> Entering DATA_SetInitializeP1
 ==> Entering ROMS_SetInitializeP2
 ==> Entering ROMS_SetGridArrays
 ==> Entering ROMS_SetStates
 ==> Entering ATM_SetInitializeP2
 ==> Entering ATM_SetGridArrays
 ==> Entering ATM_SetStates
 ==> Entering DATA_SetInitializeP2
 ==> Entering DATA_Initialize
 ==> Entering DATA_multifile
 ==> Entering DATA_checkfile
 ==> Entering DATA_inquiry
 ==> Entering DATA_ncvarcoords
 ==> Entering DATA_ncread
 ==> Entering DATA_SetGridArrays
 ==> Entering DATA_SetStates
 ==> Entering Coupler_ComputeRH for ROMS-TO-ATM
 ==> Entering Coupler_ComputeRH for ATM-TO-ROMS
 ==> Entering Coupler_ComputeRH for DATA-TO-ATM
 ==> Entering ROMS_SetClock
 ==> Entering ATM_SetClock
 ==> Entering DATA_SetClock
 ==> Entering ROMS_DataInit
 ==> Entering ROMS_Export
 ==> Entering ATM_DataInit

DATA-ATM-ROMS Semi-Implicit Avg Coupling Frame 0.png

 ==> Entering Coupler_ExecuteRH for DATA-TO-ATM

DATA-ATM-ROMS Semi-Implicit Avg Coupling Frame 1.png

 ==> Entering DATA_ModelAdvance
 ==> Entering DATA_ncread
 ==> Entering DATA_Export
 ==> Entering DATA_TimeInterp
 ==> Entering Coupler_ExecuteRH for ROMS-TO-ATM

DATA-ATM-ROMS Semi-Implicit Avg Coupling Frame 2.png

 ==> Entering ATM_SetRunClock
 ==> Entering ATM_CheckImport
 ==> Entering ATM_ModelAdvance

DATA-ATM-ROMS Semi-Implicit Avg Coupling Frame 3.png

 ==> Entering ATM_Import
 ==> Entering ATM_ProcessImport
 ==> Entering ATM_Export
 ==> Entering Coupler_ExecuteRH for ATM-TO-ROMS

DATA-ATM-ROMS Semi-Implicit Avg Coupling Frame 4.png

 ==> Entering ROMS_SetRunClock
 ==> Entering ROMS_CheckImport
 ==> Entering ROMS_ModelAdvance

DATA-ATM-ROMS Semi-Implicit Avg Coupling Frame 5.png

 ==> Entering ROMS_Import
 ==> Entering ROMS_Export
 ==> Entering Coupler_ExecuteRH for DATA-TO-ATM

Coupling with Nested Grids

Coupling with Nested Grids.png
Component Grid CoupledSet ImportState ExportState ConnectedTo
-------------------------------------------------------------------------------------------------------------------------------------------------
ROMS 1 ESM_02 Import_ESM_02 Export_ESM_02 COAMPS
COAMPS 1 ESM_01 Import_ESM_01 Export_ESM_01 DATA
COAMPS 2 ESM_02 Import_ESM_02 Export_ESM_02 ROMS, DATA
DATA 1 ESM_01 NONE Export_ESM_01 COAMPS
DATA 1 ESM_02 NONE Export_ESM_02 COAMPS


  • Set which ESM components are connected to the ocean component (ROMS) during coupling. If ROMS has nested grids, indicate which grids are connected to the other ESM components, [1:NgridsR] expected.
    Coupled(ATM2OCN) == T  ! atmosphere -> ROMS connected
    Coupled(ICE2OCN) == F  ! seaice -> ROMS connected
    Coupled(WAV2OCN) == F  ! wave -> ROMS connected
    Coupled(DAT2OCN) == F  ! DATA -> ROMS connected
  • Set which ESM components are connected to the atmosphere component during coupling. If the atmosphere component has nested grids, indicate which grids are connected to the other ESM components, [1:NgridsA] expected.
    Coupled(OCN2ATM) == F T  ! ROMS -> atmosphere connected
    Coupled(ICE2ATM) == F  ! seaice -> atmosphere connected
    Coupled(WAV2ATM) == F  ! wave -> atmosphere connected
    Coupled(DAT2ATM) == T T  ! DATA -> atmosphere connected