Skip to content
Open
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
42c51b7
Add ifdef UM_PHYS, linear_model example runs
cjohnson-pi May 12, 2026
3f79afc
retry copying optimisation from lfric_atm]
cjohnson-pi May 13, 2026
f6f1a06
linear_model and lfric_atm run
cjohnson-pi May 13, 2026
0f9e2be
clearwhitespace
cjohnson-pi May 13, 2026
9bf79cb
removing PHYSICS_ROOT change
cjohnson-pi May 13, 2026
5f68c17
increase build wallclock
cjohnson-pi May 13, 2026
70c1ce1
Merge remote-tracking branch 'upstream/stable' into ifdefphys
cjohnson-pi May 14, 2026
0efabc0
use_physics false
cjohnson-pi May 15, 2026
23a5abb
correct for validate_rose-meta. Test suite completes.
cjohnson-pi May 15, 2026
fa5e41d
Adding updates from my HEAD branch...
ss421 May 15, 2026
eaaba2a
use lfric_atm optimisation options
cjohnson-pi May 18, 2026
3d3e72e
tidy
cjohnson-pi May 18, 2026
bcad2f5
revert jedi changes
cjohnson-pi May 18, 2026
db5d9a2
whitespace
cjohnson-pi May 18, 2026
ab70eb4
Merge remote-tracking branch 'cjohnson-pi/ifdefphys' into update_fore…
ss421 May 18, 2026
339b0b0
update build
cjohnson-pi May 18, 2026
b9da623
Make switch less strict, for jedi tests
cjohnson-pi May 20, 2026
6f79e5b
Merge remote-tracking branch 'cjohnson-pi/ifdefphys' into update_fore…
ss421 May 20, 2026
f0261b9
Merge remote-tracking branch 'cjohnson-pi/ifdefphys' into update_fore…
ss421 May 20, 2026
f3090de
Fix rose validate - need to use upgrade macro
ss421 May 20, 2026
80831af
Fix/add KGOs
ss421 May 20, 2026
f039571
Relabeled the name of the chcksum
ss421 May 20, 2026
d240f12
Code tidy
ss421 May 20, 2026
09d22e1
Update to fix rose validate correctly
ss421 May 21, 2026
d5a18cd
Update the forecast configuration
ss421 May 22, 2026
89c3bba
Update to revert previous change as noted by reviewer.
ss421 Jun 3, 2026
c51c69c
Remove file that is no longer used.
ss421 Jun 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 70 additions & 24 deletions applications/jedi_lfric_tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,17 @@ export PSYCLONE_TRANSFORMATION ?= minimum

export PROJECT_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))

# Note - socrates_interface must come before jules_interface as there are dependencies on each other.
export INTERNAL_DEPENDENCIES = $(CORE_ROOT_DIR)/infrastructure \
$(CORE_ROOT_DIR)/components/driver \
$(CORE_ROOT_DIR)/components/science \
$(CORE_ROOT_DIR)/components/inventory \
$(APPS_ROOT_DIR)/interfaces/jedi_lfric_interface \
$(CORE_ROOT_DIR)/components/lfric-xios \
$(APPS_ROOT_DIR)/science/shared \
$(APPS_ROOT_DIR)/interfaces/socrates_interface \
$(APPS_ROOT_DIR)/interfaces/jules_interface \
$(APPS_ROOT_DIR)/interfaces/physics_schemes_interface \
$(APPS_ROOT_DIR)/science/gungho \
$(APPS_ROOT_DIR)/science/linear \
$(APPS_ROOT_DIR)/science/adjoint
Expand All @@ -42,7 +47,7 @@ ifneq ("$(PSYCLONE_TRANSFORMATION)","none")
endif

.PHONY: default
default: build integration-tests
default: build
$(Q)echo > /dev/null

.PHONY: documentation doc docs
Expand All @@ -51,7 +56,12 @@ documentation doc docs: document-uml document-latex document-api

include $(CORE_ROOT_DIR)/infrastructure/build/lfric.mk
include $(INTERNAL_DEPENDENCIES:=/build/import.mk)
-include $(PROJECT_DIR)/build/project.mk
include build/project.mk

# Include transmute list only if not using minimum or no transformations
ifeq ($(filter "$(PSYCLONE_TRANSFORMATION)", "none" "minimum"),)
include build/psyclone_transmute_file_list.mk
endif

##############################################################################
# Documentation
Expand Down Expand Up @@ -97,7 +107,7 @@ build: export BIN_DIR ?= $(PROJECT_DIR)/bin
build: export LIB_DIR ?= $(PROJECT_DIR)/lib
build: export MOD_DIR ?= $(PROJECT_DIR)/mod
build: export CXX_LINK = TRUE
build: export PROGRAMS := $(basename $(notdir $(shell find source -maxdepth 1 -name '*.[Ff]90' -print)))
build: export PROGRAMS := $(basename $(notdir $(shell find source -maxdepth 1 -name '*.[Ff]90' -exec egrep -l "^\s*program" {} \;)))
build: export PROJECT = $(PROJECT_NAME)
build: export WORKING_DIR := $(WORKING_DIR)/jedi_lfric_tests

Expand All @@ -118,6 +128,20 @@ build: ALWAYS
$(Q)for SUBPROJECT in $(INTERNAL_DEPENDENCIES) ; do \
$(MAKE) $(QUIET_ARG) -f $$SUBPROJECT/build/import.mk ; done
$(call MESSAGE,========================================)
$(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,========================================)
Comment on lines +131 to +144

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The INTERNAL_DEPENDENCIES list is provided for doing exactly this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,Extracting $(PROJECT_NAME))
$(call MESSAGE,========================================)
$Q$(MAKE) $(QUIET_ARG) -f $(LFRIC_BUILD)/extract.mk \
Expand All @@ -127,16 +151,54 @@ build: ALWAYS
$(call MESSAGE,Generating $(PROJECT) namelist loaders)
$(call MESSAGE,=========================================================)
$Q$(MAKE) $(QUIET_ARG) -f $(LFRIC_BUILD)/configuration.mk \
PROJECT=$(PROJECT) \
SOURCE_DIR=source \
WORKING_DIR=$(WORKING_DIR) \
SOURCE_DIR=$(APPS_ROOT_DIR)/science/gungho/source \
META_FILE_DIR=$(META_FILE_DIR)
$(call MESSAGE,========================================)
$(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,========================================)
Comment on lines +157 to +177

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The INTERNAL_DEPENDENCIES should do away with this as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As with previous comment - I can test with this section (157-177) removed if you think that should work?

$(call MESSAGE,PSycloning $(PROJECT_NAME))
$(call MESSAGE,========================================)
$Q$(MAKE) $(QUIET_ARG) -f $(LFRIC_BUILD)/psyclone/psyclone_psykal.mk \
SOURCE_DIR=source \
OPTIMISATION_PATH=$(OPTIMISATION_PATH)
$(call MESSAGE,========================================)
$(call MESSAGE,Preprocess and PSyclone Transmute)
$(call MESSAGE,========================================)
$Q$(MAKE) $(QUIET_ARG) -f $(APPS_ROOT_DIR)/interfaces/physics_schemes_interface/build/pre_process_phys.mk \
SOURCE_DIR=$(WORKING_DIR) \
PSYCLONE_PHYSICS_FILES="$(PSYCLONE_PHYSICS_FILES)" \
PSYCLONE_DIRECTORIES="$(PSYCLONE_DIRECTORIES)" \
PSYCLONE_PHYSICS_EXCEPTION="$(PSYCLONE_PHYSICS_EXCEPTION)"
$Q$(MAKE) $(QUIET_ARG) -f $(APPS_ROOT_DIR)/interfaces/physics_schemes_interface/build/psyclone_transmute_pass.mk \
SOURCE_DIR=$(WORKING_DIR) \
OPTIMISATION_PATH_PSY=$(APPS_ROOT_DIR)/applications/$(PROJECT)/$(OPTIMISATION_PATH) \
PSYCLONE_PASS_NO_SCRIPT="$(PSYCLONE_PASS_NO_SCRIPT)"
$Q$(MAKE) $(QUIET_ARG) -f $(APPS_ROOT_DIR)/interfaces/physics_schemes_interface/build/psyclone_transmute.mk \
SOURCE_DIR=$(WORKING_DIR) \
OPTIMISATION_PATH_PSY=$(APPS_ROOT_DIR)/applications/$(PROJECT)/$(OPTIMISATION_PATH) \
PSYCLONE_PHYSICS_FILES="$(PSYCLONE_PHYSICS_FILES)" \
PSYCLONE_PASS_NO_SCRIPT="$(PSYCLONE_PASS_NO_SCRIPT)" \
PSYCLONE_DIRECTORIES="$(PSYCLONE_DIRECTORIES)" \
PSYCLONE_PHYSICS_EXCEPTION="$(PSYCLONE_PHYSICS_EXCEPTION)"
$(call MESSAGE,=========================================================)
$(call MESSAGE,Analysing $(PROJECT) build dependencies)
$(call MESSAGE,=========================================================)
Expand Down Expand Up @@ -181,24 +243,8 @@ unit-tests: unit-tests/run
##############################################################################
# Integration tests
#
integration-tests/%: export BIN_DIR ?= $(PROJECT_DIR)/test
integration-tests/%: export FFLAGS += -DINT_TEST
integration-tests/%: export IMPORT_PARTS = $(CORE_ROOT_DIR)/infrastructure \
$(CORE_ROOT_DIR)/components/science \
$(CORE_ROOT_DIR)/components/driver \
$(CORE_ROOT_DIR)/components/inventory \
$(CORE_ROOT_DIR)/components/lfric-xios \
$(APPS_ROOT_DIR)/interfaces/jedi_lfric_interface \
$(APPS_ROOT_DIR)/science/gungho \
$(APPS_ROOT_DIR)/science/linear \
$(APPS_ROOT_DIR)/science/adjoint
integration-tests/%: export META_FILE_DIR = rose-meta/jedi_lfric_tests/HEAD
integration-tests/%: export PROJECT = $(PROJECT_NAME)
integration-tests/%: export SOURCE_DIR = source
integration-tests/%: export TEST_DIR = integration-test
integration-tests/%: export WORKING_DIR := $(WORKING_DIR)/integration-tests
integration-tests: integration-tests/run

integration-tests:
$(call MESSAGE,Testing,"There are no integration tests.")

##############################################################################
# Clean
Expand Down
46 changes: 46 additions & 0 deletions applications/jedi_lfric_tests/build/compile_options.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
##############################################################################
# (c) Crown copyright 2026 Met Office. All rights reserved.
# The file LICENCE, distributed with this code, contains details of the terms
# under which the code may be used.
##############################################################################

# NOTE: Import of compile options from LFRic infrastructure is temporarily
# suspended here as a workaround for #2340 in which application of the
# -qoverride-limits option was preventing compilation of a UKCA module.
# include $(LFRIC_BUILD)/compile_options.mk

$(info UM physics specific compile options)

include $(PROJECT_DIR)/build/fortran/$(FORTRAN_COMPILER).mk

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should be needed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in the equivalent lfric_atm file but I can try to remove it here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

https://cylchub/services/cylc-review/view/steven.sandbach?&suite=update_forecast_config_ifdefphys1%2Frun1&no_fuzzy_time=0&path=log/job/1/build_jedi_lfric_tests_azspice_gnu_fast-debug-64bit/01/job.err


casim/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
ukca/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
jules/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
socrates/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
legacy/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
AC_assimilation/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
aerosols/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
atmosphere_service/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
boundary_layer/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
carbon/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
convection/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
diffusion_and_filtering/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
dynamics/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
dynamics_advection/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
electric/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
free_tracers/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
gravity_wave_drag/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
idealised/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
large_scale_cloud/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
large_scale_precipitation/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
physics_diagnostics/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
PWS_diagnostics/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
radiation_control/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
stochastic_physics/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
tracer_advection/%.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS)
%/limited_area_constants_mod.o: private FFLAGS_EXTRA = $(FFLAGS_INTEL_FIX_ARG)

$(info Disable warnings-turned-error caused by undeclared external functions - see ifort.mk)
%mpi_mod.o: private FFLAGS_EXTRA = $(FFLAGS_INTEL_EXTERNALS)
socrates/src/radiance_core/%.o: private FFLAGS_EXTRA = $(FFLAGS_INTEL_EXTERNALS)
socrates/src/interface_core/%.o: private FFLAGS_EXTRA = $(FFLAGS_INTEL_EXTERNALS)
13 changes: 13 additions & 0 deletions applications/jedi_lfric_tests/build/fortran/crayftn.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
##############################################################################
# (c) Crown copyright 2026 Met Office. All rights reserved.
# The file LICENCE, distributed with this code, contains details of the terms
# under which the code may be used.
##############################################################################
# Various things specific to the Cray Fortran compiler.
##############################################################################

$(info Project specials for Cray compiler)

export FFLAGS_UM_PHYSICS = -s real64

include $(PROJECT_DIR)/build/fortran/crayftn/$(PROFILE).mk

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
##############################################################################
# (c) Crown copyright 2026 Met Office. All rights reserved.
# The file LICENCE, distributed with this code, contains details of the terms
# under which the code may be used.
##############################################################################
##############################################################################
# Various things specific to fast-debug lfric_atm when using the
# Cray Fortran compiler.
# To override flags specified in LFRic Core, use
# FFLAGS_SAFE_OPTIMISATION, to add an additional flag to what is specified
# in Core, use FFLAGS_EXTRA. If you need to add debugging flags to a module,
# modify FFLAGS_DEBUG for the target module.
# All flag modification should be `private` so they are not inherited by
# submodules.
##############################################################################

# ==========================================================================
# NON-DEBUG FLAGS
# ==========================================================================
# UKCA
%ukca_emiss_mode_mod.o: private FFLAGS_SAFE_OPTIMISATION = -O0
%ukca_step_control_mod.o: private FFLAGS_SAFE_OPTIMISATION = -O0

# UM
%parcel_ascent_5a.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS) -hvector0

# LFRic Apps
%aerosol_ukca_alg_mod_psy.o: private FFLAGS_SAFE_OPTIMISATION = -O0
%bl_exp_alg_mod_psy.o: private FFLAGS_SAFE_OPTIMISATION = -O0
%bl_imp_alg_mod_psy.o: private FFLAGS_SAFE_OPTIMISATION = -O0
%conv_comorph_alg_mod_psy.o: private FFLAGS_SAFE_OPTIMISATION = -O0
%conv_comorph_kernel_mod.o: private FFLAGS_SAFE_OPTIMISATION = -O0
%conv_gr_alg_mod_psy.o: private FFLAGS_SAFE_OPTIMISATION = -O0
%gungho_model_mod.o: private FFLAGS_SAFE_OPTIMISATION = -O0
%init_aerosol_fields_alg_mod_psy.o: private FFLAGS_SAFE_OPTIMISATION = -O0
%jules_extra_kernel_mod.o: private FFLAGS_SAFE_OPTIMISATION = -O0
large_scale_precipitation/%.o: private FFLAGS_SAFE_OPTIMISATION = -O2 -hfp0 -hflex_mp=strict

# ==========================================================================
# DEBUG FLAGS
# ==========================================================================
# UKCA
%ukca_emiss_mode_mod.o: private FFLAGS_DEBUG = -G0
%ukca_step_control_mod.o: private FFLAGS_DEBUG = -G0

# LFRic Apps
%aerosol_ukca_alg_mod_psy.o: private FFLAGS_DEBUG = -G0
%bl_exp_alg_mod_psy.o: private FFLAGS_DEBUG = -G0
%bl_imp_alg_mod_psy.o: private FFLAGS_DEBUG = -G0
%conv_comorph_alg_mod_psy.o: private FFLAGS_DEBUG = -G0
%conv_comorph_kernel_mod.o: private FFLAGS_DEBUG = -G0
%conv_gr_alg_mod_psy.o: private FFLAGS_DEBUG = -G0
%gungho_model_mod.o: private FFLAGS_DEBUG = -G0
%init_aerosol_fields_alg_mod_psy.o: private FFLAGS_DEBUG = -G0
%jules_extra_kernel_mod.o: private FFLAGS_DEBUG = -G0
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
##############################################################################
# (c) Crown copyright 2026 Met Office. All rights reserved.
# The file LICENCE, distributed with this code, contains details of the terms
# under which the code may be used.
##############################################################################
##############################################################################
# Various things specific to full-debug lfric_atm when using the
# Cray Fortran compiler.
##############################################################################

# ==========================================================================
# NON-DEBUG FLAGS
# ==========================================================================

# ==========================================================================
# DEBUG FLAGS
# ==========================================================================
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
##############################################################################
# (c) Crown copyright 2026 Met Office. All rights reserved.
# The file LICENCE, distributed with this code, contains details of the terms
# under which the code may be used.
##############################################################################
##############################################################################
# Various things specific to production lfric_atm when using the
# Cray Fortran compiler.
##############################################################################

# ==========================================================================
# DIRECTORIES
# ==========================================================================
gravity_wave_drag/%.o: private FFLAGS_RISKY_OPTIMISATION = -O2 -hflex_mp=strict

# ==========================================================================
# MODULES
# ==========================================================================
# UKCA
%ukca_emiss_mode_mod.o: private FFLAGS_RISKY_OPTIMISATION = -O0
%ukca_step_control_mod.o: private FFLAGS_RISKY_OPTIMISATION = -O0

# UM
%parcel_ascent_5a.o: private FFLAGS_EXTRA = $(FFLAGS_UM_PHYSICS) -hvector0

# LFRic Apps
%aerosol_ukca_alg_mod_psy.o: private FFLAGS_RISKY_OPTIMISATION = -O0
%bl_exp_alg_mod_psy.o: private FFLAGS_RISKY_OPTIMISATION = -O0
%bl_imp_alg_mod_psy.o: private FFLAGS_RISKY_OPTIMISATION = -O0
%conv_comorph_alg_mod_psy.o: private FFLAGS_RISKY_OPTIMISATION = -O0
%conv_comorph_kernel_mod.o: private FFLAGS_RISKY_OPTIMISATION = -O0
%conv_gr_alg_mod_psy.o: private FFLAGS_RISKY_OPTIMISATION = -O0
%gungho_model_mod.o: private FFLAGS_RISKY_OPTIMISATION = -O0
%init_aerosol_fields_alg_mod_psy.o: private FFLAGS_RISKY_OPTIMISATION = -O0
%jules_extra_kernel_mod.o: private FFLAGS_RISKY_OPTIMISATION = -O0
large_scale_precipitation/%.o: private FFLAGS_SAFE_OPTIMISATION = -O3 -hipa3 -hflex_mp=conservative
40 changes: 40 additions & 0 deletions applications/jedi_lfric_tests/build/fortran/gfortran.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
##############################################################################
# (c) Crown copyright 2026 Met Office. All rights reserved.
# The file LICENCE, distributed with this code, contains details of the terms
# under which the code may be used.
##############################################################################
# Various things specific to the GNU Fortran compiler.
##############################################################################

$(info Project specials for GNU compiler)

export FFLAGS_UM_PHYSICS = -fdefault-real-8 -fdefault-double-8
# Most lfric_atm dependencies contain code with implicit lossy conversions and
# unused variables.
# We reset the FFLAGS_WARNINGS variable here in order to prevent
# -Werror induced build failures.
FFLAGS_WARNINGS = -Wall -Werror=character-truncation -Werror=unused-value \
-Werror=tabs
# But, we can apply some more lfric infrastructure checking to socrates
FFLAGS_SOCRATES_WARNINGS = -Werror=unused-variable

science/src/socrates/%.o science/src/socrates/%.mod: private FFLAGS_EXTRA = $(FFLAGS_SOCRATES_WARNINGS)

# We remove bounds checking (applied by -fcheck=all) and underflow checking. The
# latter is due to regular permitting of exponents going to zero for small numbers
# to imply total extinction of radiation passing through a medium
FFLAGS_RUNTIME = -fcheck=all,no-bounds -ffpe-trap=invalid,zero,overflow

# The lfric_atm app defines an extra set of debug flags for
# fast-debug which are the same as the full-debug settings
# except for some platforms
ifdef CRAY_ENVIRONMENT
# On the EXZ these options are switched off for fast-debug
# due to an unexpected FPE in the NetCDF library
FFLAGS_FASTD_INIT =
FFLAGS_FASTD_RUNTIME =
else
# Otherwise, use the same as the default full-debug settings
FFLAGS_FASTD_INIT = $(FFLAGS_INIT)
FFLAGS_FASTD_RUNTIME = $(FFLAGS_RUNTIME)
endif
Loading
Loading