Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
55) PR #3603 for #1770. Make lfric/eg20 compile.

54) PR #3587 towards #2216. Adds a new KernelInlineTrans to do
a deferred InlineTrans on Kernels after lower the PSy layer.

Expand Down
2 changes: 1 addition & 1 deletion doc/tutorials_and_examples/lfric_examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -341,4 +341,4 @@ algorithm layer run:
.. code-block:: bash

cd eg20/
psyclone-kern -gen alg ../code/testkern_mod.F90
psyclone-kern -api lfric -gen alg ../code/testkern_mod.F90
19 changes: 15 additions & 4 deletions examples/lfric/eg20/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@

include ../lfric_common.mk

GENERATED_FILES = test_alg_mod_psy.f90 testkern_mod.F90 test_alg_mod.[fx]90
GENERATED_FILES = test_alg_mod_psy.f90 testkern_mod.F90 test_alg_mod.[fx]90 \
*.o *.mod *.exe

OBJECTS = testkern_mod.o test_alg_mod_psy.o test_alg_mod.o driver.o

run: compile
@echo "The compiled code for lfric/eg20 is not executable."

compile: transform ${LFRIC_LIB}
@echo "#1770 Compilation is not supported: the generated code must be "
@echo "inserted into an LFRic mini-app."
# Although we compile and link, the resulting binary will not execute (because the
# driver does not do the necessary setup).
compile: transform ${LFRIC_LIB} ${OBJECTS}
$(F90) $(F90FLAGS) -o will_not_run.exe ${OBJECTS} ${LDFLAGS}

# Dependencies
%.F90:
Expand All @@ -36,3 +41,9 @@ test_alg_mod_psy.f90 test_alg_mod.f90: test_alg_mod.x90

allclean: clean
make -C $(LFRIC_PATH) allclean

%.o: %.F90
$(F90) $(F90FLAGS) -c $<

%.o: %.f90
$(F90) $(F90FLAGS) -c $<
18 changes: 18 additions & 0 deletions examples/lfric/eg20/driver.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
! -----------------------------------------------------------------------------
! SPDX-FileCopyrightText: Copyright (c) 2020-2026 Science and Technology
! Facilities Council
! SPDX-License-Identifier: BSD-3-Clause
! See the full LICENSE file in the project root for details.
! -----------------------------------------------------------------------------
!> A bare-bones driver program that allows the generated code to be compiled
!! and linked. The result will not execute because no attempt has been made
!! to perform the setup that a real LFRic application requires.
program driver
USE mesh_mod, ONLY: mesh_type
use test_alg_mod, only: test_alg
implicit none
TYPE(mesh_type), POINTER :: mesh

call test_alg(mesh)

end program driver
Loading
Loading