esmf-org / esmf

The Earth System Modeling Framework (ESMF) is a suite of software tools for developing high-performance, multi-component Earth science modeling applications.
https://earthsystemmodeling.org/
Other
156 stars 75 forks source link

Adds extra metadata to fields about their origin #241

Open uturuncoglu opened 5 months ago

uturuncoglu commented 5 months ago

This PR aims to enhance NUOPC layer by adding extra metadata to the import and export states and also fields in those states about their origin. By this way, the acceptor component could query the metadata to see the origin of the fields like following,

       ! Get attribute from field
       call NUOPC_GetAttribute(field, name="ProviderCompName", value=cvalue, &
         isPresent=isPresent, isSet=isSet, rc=rc)
       if (ChkErr(rc,__LINE__,u_FILE_u)) return
uturuncoglu commented 5 months ago

@theurich @oehmke @danrosen25 I could able to query the fields in acceptor side and it looks like following,

 Field, ProviderCompName = ocean_fraction ATM
 Field, ProviderCompName = ocean_mask OCN

At this point I am aiming to create namespaces and nested states in the generic component side based on the information provided by the ProviderCompName metadata and plan to advertise fields to their own nested states. At this point, I am not sure how this will work. The generic component import state is a minor of the attached component export states and all the information is coming to import state in ModifyAdvertised. Is it possible to create namespaces and nested states after this point. If so, which phase need to be used and which phase will define namespaces and nested states. This is done in the Advertise for the mediator but I am not sure about the eugenic component. It is act like a mediator but little bit different.

uturuncoglu commented 5 months ago

@theurich @oehmke @danrosen25 BTW, I am not sure this is the right approach to make provider name information available to other components. Anyway, let me know what you think.

uturuncoglu commented 1 month ago

@theurich I add a new option transferAllNested to enable having nested states in the mirrored import and export states. I tested at least mirroring import states and it seems it is working. I think this also needs some entry also to documentation. If you don't ming could you point me the right place to add it. I think transferAllNested and also new metadata in field level CompName (provider name indicated in the run sequence) needs to be added. I'll keep testing and making brach synced with develop. When you have please check the implementation and let me know if something missing or logically wrong.