NOAA-EMC / CMEPS

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

CMEPS is forced to use custom merges because sign of field imported from ATM is wrong or unit conversion is required #93

Closed DeniseWorthen closed 11 months ago

DeniseWorthen commented 1 year ago

CMEPS has the capability to define generic merges between components. However, these generic merges are not available when the sign of the field needs to change, or the field needs to be converted to one of different units (ie, latent->evap).

Because of this issue, multiple "custom" merges are required in med_phases_prep_ocn. For example, the sensible heat flux from the ATM has the wrong sign, requiring a custom merge:

       customwgt(:) = -ofrac(:)
       call med_merge_field(is_local%wrap%FBExp(compocn),      'Faxa_sen',  &
            FBinA=is_local%wrap%FBImp(compatm,compocn), fnameA='Faxa_sen', wgtA=customwgt, rc=rc)
       if (ChkErr(rc,__LINE__,u_FILE_u)) return

The ATM exports the latent heat flux, but the ocean requires the evaporative flux, which requires a custom merge to change the sign and units of the field:

       customwgt(:) = -ofrac(:) / const_lhvap
       call med_merge_field(is_local%wrap%FBExp(compocn),      'Faxa_evap', &
            FBinA=is_local%wrap%FBImp(compatm,compocn), fnameA='Faxa_lat' , wgtA=customwgt, rc=rc)
       if (ChkErr(rc,__LINE__,u_FILE_u)) return

The momemtum fluxes from the ATM also require a custom merge to change the sign.

This adds needless complexity to maintain these custom merges when a better solution is to have the ATM export the coupling field with the right sign or unit. This also makes it possible to leverage the existing diagnostic capabilities with CMEPS to examine global budgets for UFS applications.