Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds extra metadata to fields about their origin #241

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

uturuncoglu
Copy link
Contributor

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 uturuncoglu added the feature/enhancement New feature or request label May 2, 2024
@uturuncoglu
Copy link
Contributor Author

@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
Copy link
Contributor Author

@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
Copy link
Contributor Author

@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.

@uturuncoglu
Copy link
Contributor Author

@theurich I added extra documentation. Please review it when you have time. I am also working on NUOPC app prototype to test new feature. Once it is ready, I'll open another PR in there and linked to here.

@theurich
Copy link
Member

@uturuncoglu sounds good. It is on my todo list. :-)

@uturuncoglu
Copy link
Contributor Author

@theurich BTW, we could extend the existing AtmOcnMirrorFields app but create new one from scratch. My impression is the creating a new one just dedicated to new option by simplifying AtmOcnMirrorFields would be better but just let me know if you have any preference.

@theurich
Copy link
Member

@theurich BTW, we could extend the existing AtmOcnMirrorFields app but create new one from scratch. My impression is the creating a new one just dedicated to new option by simplifying AtmOcnMirrorFields would be better but just let me know if you have any preference.

Yes, a dedicated proto is my preference here, too!

@uturuncoglu
Copy link
Contributor Author

@theurich I wonder if it is possible to set following attributes through use of NUOPC_SetAttribute. In the new NUOPC app prototype, I need to set them in ModifyAdvertised phase but actually, they are set using NUOPC_Advertise() call in the existing prototype.

SharePolicyGeomObject="share", &
      SharePolicyField="share", &

So, i am trying to construct the atmospheric component by querying nested states and without setting those sharing is not working properly and code hangs at some point. Anyway, let me know what you think. I could push current version to a branch if you want to see.

@uturuncoglu
Copy link
Contributor Author

@theurich Okay. I found it. No worries.

@uturuncoglu
Copy link
Contributor Author

New draft app prototype PR can be found in here esmf-org/nuopc-app-prototypes#7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants