From 425905914151294edce94751b56609bf3918cddb Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 19 Mar 2024 10:56:50 +0100 Subject: [PATCH 1/2] Make C prototypes --- .gitignore | 3 +++ Makefile | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 259148f..90bafce 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,6 @@ *.exe *.out *.app + +# Generated prototype for linking tests +precice-prototype.h diff --git a/Makefile b/Makefile index e52ce89..5787460 100644 --- a/Makefile +++ b/Makefile @@ -5,5 +5,8 @@ all: precice precice: precice.f90 $(F03) -c $^ +prototype: precice.f90 + $(F03) -fc-prototypes -fsyntax-only $^ -I../.. $(shell pkg-config --libs libprecice) > precice-prototype.h + clean: - rm -f precice.mod precice.o + rm -f precice.mod precice.o precice-prototype.h From 61cc9ba8a96a8c163bb8478d52ad62bf7fb6e284 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 19 Mar 2024 14:21:01 +0100 Subject: [PATCH 2/2] Compile with -fimplicit-none, fix arguments --- Makefile | 4 ++-- examples/solverdummy/Makefile | 2 +- precice.f90 | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 5787460..caba66d 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,10 @@ F03 ?= gfortran all: precice precice: precice.f90 - $(F03) -c $^ + $(F03) -c -fimplicit-none $^ prototype: precice.f90 - $(F03) -fc-prototypes -fsyntax-only $^ -I../.. $(shell pkg-config --libs libprecice) > precice-prototype.h + $(F03) -fimplicit-none -fc-prototypes -fsyntax-only $^ -I../.. $(shell pkg-config --libs libprecice) > precice-prototype.h clean: rm -f precice.mod precice.o precice-prototype.h diff --git a/examples/solverdummy/Makefile b/examples/solverdummy/Makefile index b2e39b5..8b13541 100644 --- a/examples/solverdummy/Makefile +++ b/examples/solverdummy/Makefile @@ -3,7 +3,7 @@ F03 ?= gfortran all: solverdummy solverdummy: solverdummy.f90 - $(F03) -g $^ -o $@ -I../.. $(shell pkg-config --libs libprecice) + $(F03) -fimplicit-none -g $^ -o $@ -I../.. $(shell pkg-config --libs libprecice) clean: rm -f solverdummy diff --git a/precice.f90 b/precice.f90 index 0bd0390..0fd4ef0 100644 --- a/precice.f90 +++ b/precice.f90 @@ -103,7 +103,7 @@ subroutine precicef_requires_mesh_connectivity_for(meshName, required, meshNameL integer(kind=c_int), value :: meshNameLength end subroutine precicef_requires_mesh_connectivity_for - subroutine precicef_set_vertex(meshName, position, vertexID, meshNameLength) & + subroutine precicef_set_vertex(meshName, coordinates, id, meshNameLength) & & bind(c, name='precicef_set_vertex_') use, intrinsic :: iso_c_binding