Replicate COMPUTE_ANNEXED_DOFS in adjoint namelist for PSyKAl lite code#342
Replicate COMPUTE_ANNEXED_DOFS in adjoint namelist for PSyKAl lite code#342DrTVockerodtMO wants to merge 25 commits intoMetOffice:mainfrom
COMPUTE_ANNEXED_DOFS in adjoint namelist for PSyKAl lite code#342Conversation
…D_DOFS in PSyclone config but only applying to PSyKAl lite adjoints that need it
COMPUTE_ANNEXED_DOFS in adjoint namelist for PSyKAl lite codeCOMPUTE_ANNEXED_DOFS in adjoint namelist for PSyKAl lite code
james-bruten-mo
left a comment
There was a problem hiding this comment.
Hi Terry,
A couple of points for upgrade macro approval.
- The macro should only be added to the metadata section with metadata changes, in this case
lfric-adjoint. When theapply_macrosscript is run it will get copied everywhere that requires it. - The rose-apps shouldn't be changed in this branch. To test the changes create a test branch and apply the macros there. The example files do need manually updating however.
- You can automate the changing of the configuration generation as part of the macro. It requires a bit of python to sort, but means the new namelist doesn't need manually adding. See the section at https://github.com/MetOffice/lfric_apps/blob/main/applications/gungho_model/rose-meta/lfric-gungho_model/version20_21.py#L41 for an example
Understood, I'll revert those changes, thanks! |
|
@DanStoneMO - I think we need a configuration update for this. Can you take a look? We are still part way through completing the stack and configuration upgrades for 3.1 so we cant merge it until we have that. We should still be able to test it though. |
…ted lfric-adjoint macro to add namelist and value to rose-apps conditionally.
|
The macro currently isn't working so we're looking for a fix. The macro itself looks okay but the application of them has a problem it seems. |
|
Accompanying JEDI-side PR is now up at: https://github.com/JCSDA-internal/lfric-jedi/pull/1227 |
tom-j-h
left a comment
There was a problem hiding this comment.
As I said in my message, I don't think there's a way to get the upgrade macro to set false for adjoint_tests and true otherwise, but maybe CR will be able to help. Aside from that this looks fine. Will be good to tidy up once the PSyClone issue is sorted.
|
@DrTVockerodtMO, thanks for notifying the TCD Team about the issue. Out of curiosity, do you need this because you need different |
It's because the PSy layer is not PSycloned that we need the adjoint configuration variable to mimick what the custom PSyclone config does. This variable must always be in sync with the PSyclone config variable (hence not a pretty solution and definitely a workaround) until stfc/PSyclone#2674 is solved by including an adjoint copy routine built-in. |
PR Summary
Sci/Tech Reviewer: @tom-j-h
Code Reviewer: @stevemullerworth
Not a very fun solution... Involves creating a copy of the
COMPUTE_ANNEXED_DOFSvariable in the PSyclone config file for use in the PSyKAl lite adjoint. Unfortunately this is a pre-requisite for testing the adjoint in parallel, but I am open to other suggestions on how best to do this.Most of the changes are upgrade macros and configurations, for the core code changes look to the changeset to
science/adjoint/source/psy/adj_sci_psykal_builtin_lite_mod.f90.Issue stfc/PSyclone#2674 is open which details turning the copy routines into built-ins. Closing this issue will remove the need for the adjoint namelist variable as PSyclone should decide the loop stop point automatically based on its configuration.
Test branch: https://github.com/DrTVockerodtMO/lfric_apps/tree/test_psykal_lite_adjoint_fix
COMPUTE_ANNEXED_DOFS=false#322Linked-to
Code Quality Checklist
Testing
trac.log
Test Suite Results - lfric_apps - test_psykal_lite_adjoint_fix/run2
Suite Information
Task Information
✅ succeeded tasks - 1164
Security Considerations
Performance Impact
AI Assistance and Attribution
Documentation
PSyclone Approval
Sci/Tech Review
(Please alert the code reviewer via a tag when you have approved the SR)
Code Review