NOAA-EMC / CMEPS

NUOPC Community Mediator for Earth Prediction Systems
https://escomp.github.io/CMEPS/
0 stars 20 forks source link

update to ESCOMP/master #57

Closed DeniseWorthen closed 2 years ago

DeniseWorthen commented 3 years ago

1) The Xgrid implementation for calculating A-O fluxes only has been added for CESM at ESCOMP/master (ESCOMP PR #216). This capability should be brought to NOAA-EMC to allow development of the Xgrid for ufs-weather.

2) Accumulation field bundles have been refactored (ESCOMP PR #226). The import and export accumulation FBs are no longer arrays (carried for multiple components). The import accumulation FBs (not used in UFS) are now module specific (runoff and glacial ice). The ocean export accumulation FBs (used for the ocean export in UFS) is now carried in a specific FBExpAccumOcn

3) Clean up of med.F90. When setting up the mediator mesh and related import/export fields from components on both grids and meshes, Med.F90 utilizes an IPDv03p4 phase to modify the the decomp/distribution of the transferred Grid/Mesh. In the refactored code, the process by which an incoming grid or mesh is modified (redistributed) to the mediator PEs is much more clear: a new grid/mesh is created on the mediator PEs and upon leaving the phase, the coordinates and geom base of the old grid or mesh is automatically transferred to the new grid/mesh.

The transfer of fields from the incoming grid/mesh is completed in the subsequent ``IPDv03p5`` phase. For a transferred grid, the ``IPDv03p5`` creates the mesh and then transfers all fields in the State to the mesh in a ``NUOPC_realize`` call. This call acts to kick out the old Grid-based field from the state, and replace it with a Mesh-based one.

It should be noted that the cleanup of med.F90 resolves an issue where the call to ``ESMF_FieldEmptyComplete`` resulted in a non-fatal error. Currently, an error message in the PET logs indicates an attempt to complete a field(s) that is already destroyed:
ESMF_Field.F90:314 ESMF_FieldValidate Invalid object  - Uninitialized or already destroyed Field: fieldstatus not ready

This error did not cause the code to abort because the complete call was also missing a subsequent ChkErr call. The error was produced because for a transferred Grid, the call to NUOPC_realize had already replaced the grid fields with the mesh fields. Thus the incoming grid field had already been destroyed (replaced by the mesh field).

4) Mediator history refactor. Currently to obtain a coupler history file (e.g. debugging the coupled model), a special med_phase_history_write needs to be added within the run sequence. The coupler history file is also not produced at the right frequency when there are different slow and fast coupling frequency in the run sequence. The refactor of the coupler history writing will allow each component to produce a coupler history file separately; the frequency of the coupler history files will be a configurable option at run time, and can be set differently for each coupled component where a history file is requested.

This update requires ESMF8.2.0bs14 or higher. Additional settings will also need to be added to the nems.configure.

This update will also change baselines because the mediator restart file will not contain the same fields due to the changes noted in item 2 above. Testing has shown that all common fields between the two mediator restarts and all other component model restart files are b4b with existing baselines.