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

Should capgen support pointer metadata? #513

Closed
gold2718 opened this issue Nov 13, 2023 · 3 comments
Closed

Should capgen support pointer metadata? #513

gold2718 opened this issue Nov 13, 2023 · 3 comments

Comments

@gold2718
Copy link
Collaborator

Summary of Issue:

Currently, capgen does not have the pointer attribute. This has not been a problem because capgen does not create pointers and does not need to pass any pointers to CCPP schemes.

However, in order to check if a variable passed with the active metadata is correct (in debug mode), this information might be needed. The circumstances could be:

  • The host model variable is a pointer
  • The variable has the active attribute (not hardcoded or defaulted to .true.)
  • The lower bound of the variable is not 1 (or ccpp_constant_one).

With this combination, the active check code could fail. At the very least, I think a case like this should be added to the unit tests and if it breaks, adding a pointer attribute might be a solution. In this case, capgen would add the pointer attribute to the group dummy argument. It should still (I think) be an error for schemes to have pointer variables, anyone have thoughts on this?

Are there other cases where the pointer attribute would a required addition to the defined metadata fields?

@gold2718 gold2718 added this to the capgen unification milestone Nov 13, 2023
@climbfuji
Copy link
Collaborator

Based on what we discussed recently - the combination of the active attribute on the host model side and associated mandatory optional arguments for physics schemes, do you agree that we don't need to support pointer metadata/variables?

@dustinswales @peverwhee @nusbaume @grantfirl also a question for you

@nusbaume
Copy link
Collaborator

Assuming the plans for the active attribute handle the use case(s) listed above then I am personally fine with not supporting pointers. The only other possible situation I could think of would be if a physics scheme explicitly needed a pointer as an input argument, but I can't currently think of a use case where that would be necessary.

@climbfuji
Copy link
Collaborator

I am closing this as "won't fix / not needed" based on the solution we came up with for potentially unallocated host model data (active attribute on host side, optional attribute on scheme side). We need to add something to the CCPP technical documentation that says pointer variables are not allowed in physics schemes.

Please reopen if you think this is not sufficient!

@climbfuji climbfuji closed this as not planned Won't fix, can't repro, duplicate, stale Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants