From 6b0a2a81bcfff77190e1618216b98a686d0f71bb Mon Sep 17 00:00:00 2001 From: kamischi <karl-michael.schindler@web.de> Date: Mon, 23 Jan 2023 16:44:12 +0100 Subject: [PATCH] do the coverage test in a separate directory. This way the recompilation with the option --coverage is made sure. --- source/f90/gcov-analysis/.gitignore | 2 + source/f90/gcov-analysis/Makefile | 92 +++++++++++++++++++++++++++++ source/f90/gcov-analysis/bosin | 6 ++ source/f90/gcov-analysis/eelsin | 16 +++++ 4 files changed, 116 insertions(+) create mode 100644 source/f90/gcov-analysis/.gitignore create mode 100644 source/f90/gcov-analysis/Makefile create mode 100644 source/f90/gcov-analysis/bosin create mode 100644 source/f90/gcov-analysis/eelsin diff --git a/source/f90/gcov-analysis/.gitignore b/source/f90/gcov-analysis/.gitignore new file mode 100644 index 0000000..5fe92b4 --- /dev/null +++ b/source/f90/gcov-analysis/.gitignore @@ -0,0 +1,2 @@ +eelsou +bosou diff --git a/source/f90/gcov-analysis/Makefile b/source/f90/gcov-analysis/Makefile new file mode 100644 index 0000000..78d916b --- /dev/null +++ b/source/f90/gcov-analysis/Makefile @@ -0,0 +1,92 @@ +.SUFFIXES: .f90 .F90 .o + +# fortran compiler +FC = gfortran + +# fortran compiler options +FFLAGS = -g -gdwarf-2 -fbounds-check -fcheck=all --coverage +# gfortran version 4.8 does not know -fdiagnostics-color +# safeguard for major version >= 5 +GFORTAN_VERSION_GT_5 := $(shell echo `gcc -dumpversion | cut -f1 -d. ` \>= 5 | bc) +ifeq "$(GFORTAN_VERSION_GT_5)" "1" + FFLAGS += -fdiagnostics-color=auto +endif + +# implicit rules for compiling fortran files +%.o: ../%.f90 ; $(FC) $(FFLAGS) -c $< +%_mod.mod: ../%.f90 ; $(FC) $(FFLAGS) -c $< + +all: boson eels eels-boson + +bosonmods = sicot_mod.mod sintr_mod.mod rcffi_mod.mod +doboson.o: ../doboson.f90 $(bosonmods) + +sicot_mod.mod: sintr_mod.mod + +bosonsubs = doboson.o respon.o sicot.o sintr.o rcffi.o o1.o o2.o +boson: ../boson.f90 change_working_dir.o $(bosonsubs) $(bosonmods) + $(FC) $(FFLAGS) -o bosonf90 ../boson.f90 change_working_dir.o $(bosonsubs) + +eelsmods = quanc8_mod.mod queels_mod.mod seteps_mod.mod +doeels.o: ../doeels.f90 $(eelsmods) + +queels_mod.mod: quanc8_mod.mod fint1_mod.mod fint2_mod.mod fint3_mod.mod +quanc8_mod.mod: fun_mod.mod +fint1_mod.mod: surlos_mod.mod +fint2_mod.mod: surlos_mod.mod +fint3_mod.mod: surlos_mod.mod + +eelssubs = doeels.o usurlo.o quanc8.o fun.o queels.o fint1.o fint2.o fint3.o surlos.o seteps.o phint.o qrat.o +eels: ../eels.f90 change_working_dir.o $(eelssubs) $(eelsmods) + $(FC) $(FFLAGS) -o eelsf90 ../eels.f90 change_working_dir.o $(eelssubs) + +eels-boson: ../eels-boson.f90 change_working_dir.o $(eelssubs) $(eelsmods) $(bosonsubs) $(bosonmods) + $(FC) $(FFLAGS) -o eels-boson ../eels-boson.f90 change_working_dir.o $(eelssubs) $(bosonsubs) + +coverage: boson eels eels-boson + ./eelsf90 + ./bosonf90 + ./eels-boson + + gcov change_working_dir + + gcov bosonf90-boson + gcov doboson + gcov sicot + gcov sintr + gcov rcffi + gcov respon + + gcov eelsf90-eels + gcov doeels + gcov fint1 + gcov fint2 + gcov fint3 + gcov fun + gcov o1 + gcov o2 + gcov phint + gcov qrat + gcov quanc8 + gcov queels + gcov seteps + gcov surlos + gcov usurlo + + gcov eels-boson-eels-boson + +clean: + rm -f *.o + rm -rf *.dSYM + rm -f *.mod + rm -f *.so + rm -f *.gcno + rm -f *.gcda + rm -f *.gcov + rm -f eelsou bosou + rm -f bosonf90 bosonf90.exe + rm -f eelsf90 eelsf90.exe + rm -f eels-boson eels-boson.exe + +.PHONY: all clean coverage + diff --git a/source/f90/gcov-analysis/bosin b/source/f90/gcov-analysis/bosin new file mode 100644 index 0000000..7dd3315 --- /dev/null +++ b/source/f90/gcov-analysis/bosin @@ -0,0 +1,6 @@ + 300.0 t + 25.0 width + 0.5 gauss + 0.3 asym +-500.0 emin +1200.0 emax diff --git a/source/f90/gcov-analysis/eelsin b/source/f90/gcov-analysis/eelsin new file mode 100644 index 0000000..1db7dba --- /dev/null +++ b/source/f90/gcov-analysis/eelsin @@ -0,0 +1,16 @@ + 4.0 E0 ABTI0002 + 60.0 THETA ABTI0003 + 1.8 PHIA ABTI0004 + 1.8 PHIB ABTI0005 + 50.0 WMIN ABTI0006 + 700.0 WMAX ABTI0007 + 2.0 DW ABTI0008 +WFW: MnO layer on metal + ABTI0010 + 2 1 No-layers NPER No-periodic +MnO 994.00D+00 LAYER 1 name thickness + 4.95 1 epsinf No-Osc. + 269.0 16.000 5.00000E-02 wto, Q, lambda +Platinum 1000.00D+00 LAYER 2 ABTI0012 + 8.90 1 ABTI0013 +160000.0 -1 12.0000E-02 ABTI0014 -- GitLab