Enable jedi_lfric to run lfric_atm forecast configurations#512
Enable jedi_lfric to run lfric_atm forecast configurations#512Steven Sandbach (ss421) wants to merge 26 commits into
Conversation
…cast_config_ifdefphys
…cast_config_ifdefphys
…cast_config_ifdefphys
|
Thanks reviewing Matt Shin (@matthewrmshin) - I see this has now been moved to code review and is now with Ricky Wong (@mo-rickywong) |
Matthew Hambley (MatthewHambley)
left a comment
There was a problem hiding this comment.
Code owner (build system) review: A few things seem off. Please explain why the are necessary.
There was a problem hiding this comment.
If you want to override compiler arguments on a per-file bases the FFLAGS_EXTRA variable is provided for this. Did you try this and find it didn't work?
There was a problem hiding this comment.
I did not and Im not sure what I need to do to test that. Can you help with this?
I've been following the structure of lfric_atm so all of these files are based on/copies from that. From what I understand, these are profile specific and needed because the per-file flag overrides differ between profiles. The FFLAGS_EXTRA in compile_options.mk is profile agnostic.
|
|
||
| $(info UM physics specific compile options) | ||
|
|
||
| include $(PROJECT_DIR)/build/fortran/$(FORTRAN_COMPILER).mk |
There was a problem hiding this comment.
I don't think this should be needed.
There was a problem hiding this comment.
This is in the equivalent lfric_atm file but I can try to remove it here.
There was a problem hiding this comment.
I tired removing that but it failed during build so it appears to be needed. The failure relates to code that is now being built. This File seems to include settings that are currently required by lfric-atm. See:
| $(Q)echo > /dev/null | ||
|
|
||
| include $(APPS_ROOT_DIR)/build/extract/extract_meta.mk | ||
| include $(CORE_ROOT_DIR)/infrastructure/build/lfric.mk | ||
| include $(INTERNAL_DEPENDENCIES:=/build/import.mk) | ||
| -include $(PROJECT_DIR)/build/project.mk | ||
| include build/project.mk |
There was a problem hiding this comment.
Why make this change?
There was a problem hiding this comment.
Im not sure, I made a bunch of changes to get this to work. I will try reverting it and see what happens.
There was a problem hiding this comment.
I've reverted and retested and all good so committed at: 89c3bba
| $(call MESSAGE,Extracting coupled_interface component) | ||
| $(call MESSAGE,========================================) | ||
| $Q$(MAKE) $(QUIET_ARG) -f $(LFRIC_BUILD)/extract.mk \ | ||
| SOURCE_DIR=$(APPS_ROOT_DIR)/interfaces/coupled_interface/source | ||
| $(call MESSAGE,========================================) | ||
| $(call MESSAGE,Extracting Gungho dynamical core) | ||
| $(call MESSAGE,========================================) | ||
| $Q$(MAKE) $(QUIET_ARG) -f $(LFRIC_BUILD)/extract.mk \ | ||
| SOURCE_DIR=$(APPS_ROOT_DIR)/science/gungho/source | ||
| $(call MESSAGE,========================================) | ||
| $(call MESSAGE,Extracting UM physics) | ||
| $(call MESSAGE,========================================) | ||
| $Q$(MAKE) $(QUIET_ARG) -f $(APPS_ROOT_DIR)/build/extract/extract_physics.mk | ||
| $(call MESSAGE,========================================) |
There was a problem hiding this comment.
The INTERNAL_DEPENDENCIES list is provided for doing exactly this.
There was a problem hiding this comment.
As noted I've been following lfric_atm in the minimal way possible. I'm not sure what I tried that didn't work but I think I did try to minimize what is included here. Can I clarify on your comment: do you think it should be possible to remove all of the highlighted text (131-144)? I can try that if so.
| $(call MESSAGE,PSycloning interface components) | ||
| $(call MESSAGE,========================================) | ||
| $Q$(MAKE) $(QUIET_ARG) -f $(LFRIC_BUILD)/psyclone/psyclone_psykal.mk \ | ||
| SOURCE_DIR=$(APPS_ROOT_DIR)/interfaces/coupled_interface/source \ | ||
| OPTIMISATION_PATH=$(OPTIMISATION_PATH) | ||
| $Q$(MAKE) $(QUIET_ARG) -f $(LFRIC_BUILD)/psyclone/psyclone_psykal.mk \ | ||
| SOURCE_DIR=$(APPS_ROOT_DIR)/interfaces/jules_interface/source \ | ||
| OPTIMISATION_PATH=$(OPTIMISATION_PATH) | ||
| $Q$(MAKE) $(QUIET_ARG) -f $(LFRIC_BUILD)/psyclone/psyclone_psykal.mk \ | ||
| SOURCE_DIR=$(APPS_ROOT_DIR)/interfaces/socrates_interface/source \ | ||
| OPTIMISATION_PATH=$(OPTIMISATION_PATH) | ||
| $Q$(MAKE) $(QUIET_ARG) -f $(LFRIC_BUILD)/psyclone/psyclone_psykal.mk \ | ||
| SOURCE_DIR=$(APPS_ROOT_DIR)/interfaces/physics_schemes_interface/source \ | ||
| OPTIMISATION_PATH=$(OPTIMISATION_PATH) | ||
| $(call MESSAGE,========================================) | ||
| $(call MESSAGE,PSycloning Gungho dynamical core) | ||
| $(call MESSAGE,========================================) | ||
| $Q$(MAKE) $(QUIET_ARG) -f $(LFRIC_BUILD)/psyclone/psyclone_psykal.mk \ | ||
| SOURCE_DIR=$(APPS_ROOT_DIR)/science/gungho/source \ | ||
| OPTIMISATION_PATH=$(OPTIMISATION_PATH) | ||
| $(call MESSAGE,========================================) |
There was a problem hiding this comment.
The INTERNAL_DEPENDENCIES should do away with this as well.
There was a problem hiding this comment.
As with previous comment - I can test with this section (157-177) removed if you think that should work?
| export FFLAGS_UM_PHYSICS = -s real64 | ||
|
|
||
| include $(PROJECT_DIR)/build/fortran/crayftn/$(PROFILE).mk No newline at end of file | ||
| include $(PROJECT_DIR)/../lfric_atm/build/fortran/crayftn/$(PROFILE).mk |
There was a problem hiding this comment.
This change seems unnecessary.
There was a problem hiding this comment.
This is a branch from: cjohnson-pi:ifdefphys in #502 where this particular change is being added. I see you have commented on that so it will be fixed by that PR.
|
|
||
| $(info UM physics specific compile options) | ||
|
|
||
| include $(LFRIC_ATM_DIR)/build/fortran/$(FORTRAN_COMPILER).mk |
There was a problem hiding this comment.
I don't think this should be necessary.
There was a problem hiding this comment.
This is a branch from: cjohnson-pi:ifdefphys in #502 where this particular change is being added. I see you have commented on that so it will be fixed by that PR.
PR Summary
Sci/Tech Reviewer: Matt Shin (@matthewrmshin)
Code Reviewer: Ricky Wong (@mo-rickywong)
This update requires the changes applied in: #502. This branch
Update forecast config ifdefphyswas created from the branch in that PR:cjohnson-pi/ifdefphys. The change being applied in this PR can be seen via: cjohnson-pi/lfric_apps@ifdefphys...ss421:lfric_apps:update_forecast_config_ifdefphysThis PR updates
jedi_lfric_teststo enable running of model forecast based on lfric_atm configurations. This requires settingUM_PHYSICSto true. The update largely follows thelfric_atmbuild configurations. I did not:FFLAG_GROUPSbecause I encountered build issues that may be linked to Adjoint code which is included in thejedi_lfriclibrary.A small bug was fixed (removal of clock double tick).
Three new
lfric_atmbased configurations have been added:nwp_gal9-C12,nwp_gal9-C12_daandnwp_gal9-C48_MG. The existinggh-si-for-linear-C12was removed as it was only a placeholder configuration and no longer required.Note: The
C48 testrequires a new input file reference directly at:/home/users/darth/srv/mobb-data/lfric-jedi/lfric-diag/lfric_bg_mi-be607_C48_20210602_la354.nccurrently and used in JEDI testing. Documentation on the file is included in: https://github.com/MetOffice/jjdocs/blob/38d5cfad6fd30cbea67e825775c5a20798490430/docs/Interfaces/ModelInterfaces/Input-Data/lfric-jedi-dir.rst?plain=1#L169The
applications/jedi_lfric_tests/integration-testwas removed as it was problematic when integrating the UM physics and currently not testing anything useful. Furthermore, none of the other applications include integration tests.Note: given the nature of this change I would like to test this branch again before the branch is merged into main.
Code Quality Checklist
Testing
Tested via
lfric-jedi: https://github.com/JCSDA-internal/lfric-jedi/pull/1274 using a sepearte branch at the head of main (see: ss421#2).trac.log
Test Suite Results - lfric_apps - update_forecast_config_ifdefphys/run5
Suite Information
Task Information
✅ succeeded tasks - 1172
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