NCAR / ccpp-framework

Common Community Physics Package (CCPP)
http://www.dtcenter.org/community-code/common-community-physics-package-ccpp/
Other
26 stars 62 forks source link

Expand var compatibility test for active attribute #525

Closed dustinswales closed 5 months ago

dustinswales commented 5 months ago

This PR expands the existing var_compatibility_test to test the functionality of the "active" attribute.

User interface changes? No

Addresses #432

Screenshot of autogenerated code:

Screenshot 2024-01-25 at 3 26 03 PM
gold2718 commented 5 months ago

Please fill in the PR header. I'm not understanding how this addresses #432.

dustinswales commented 5 months ago

@gold2718 Not sure what else to put in there? (There's a code snippet of the correctly autogenerated code)

dustinswales commented 5 months ago

Can you tell me why the autogenerated code has the if (.true.) blocks?

I'm not sure why those lines are in there. Maybe @climbfuji knows their history and/or importance They are unnecessary and make the code tedious to look at.

I just pushed a changed that removes them. For example: Screenshot 2024-01-31 at 11 07 02 AM

climbfuji commented 5 months ago

The if (.true.) blocks are there just because it's easier to code - in prebuild, we don't have such a nice way to deal with indentation, therefore it makes like a lot easier to keep it the same regardless of the if condition. But, if you can do away with in in capgen, then that's much better of course!

dustinswales commented 5 months ago

The if (.true.) blocks are there just because it's easier to code - in prebuild, we don't have such a nice way to deal with indentation, therefore it makes like a lot easier to keep it the same regardless of the if condition. But, if you can do away with in in capgen, then that's much better of course!

@climbfuji This makes sense. Thanks for the history. And adios extra lines! @gold2718 @peverwhee Are we okay to proceed with this PR?

climbfuji commented 5 months ago

@dustinswales Can you confirm that after removing the if (.true.) then blocks, the if statements are still there if the active attribute is not the default .true.?

dustinswales commented 5 months ago

Extension of the auto-generated code snippet from above: Screenshot 2024-02-05 at 8 36 25 AM

climbfuji commented 5 months ago

Extension of the auto-generated code snippet from above: Screenshot 2024-02-05 at 8 36 25 AM

Great, thanks!