From e29d3a7889d5f9c5186973418daff7f6bbfd21ae Mon Sep 17 00:00:00 2001
From: kamischi <karl-michael.schindler@web.de>
Date: Wed, 24 Apr 2024 13:48:40 +0200
Subject: [PATCH] move debug from doboson to calling program

---
 source/f90/boson.f90      | 6 +++++-
 source/f90/doboson.f90    | 6 ++----
 source/f90/eels-boson.f90 | 5 ++++-
 tests/oxlog/boson.f90     | 6 +++++-
 tests/oxlog/doboson.f90   | 6 ++----
 5 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/source/f90/boson.f90 b/source/f90/boson.f90
index aaeeaff..fad627a 100644
--- a/source/f90/boson.f90
+++ b/source/f90/boson.f90
@@ -18,6 +18,7 @@ program boson
   character (len = 72) :: comment(2)
   double precision, allocatable :: xout(:), yout(:)
   integer :: nout
+  logical :: debug
 
 ! *** read input parameters
 
@@ -69,7 +70,10 @@ program boson
   allocate (xout(nout))
   allocate (yout(nout))
 
-  call doboson(t, width, gauss, asym, emin, emax, wmin, wmax, np, p2, xout, yout, nout)
+  debug = .false.
+
+  call doboson(t, width, gauss, asym, emin, emax, &
+               wmin, wmax, np, p2, debug xout, yout, nout)
 
   open(unit = 14, file = 'bosou')
   write(14, '(a, a, f6.1, a, f5.2)') comment(1), 'T =', t, ' GAUSS =', gauss
diff --git a/source/f90/doboson.f90 b/source/f90/doboson.f90
index f2ee66d..c920ac5 100644
--- a/source/f90/doboson.f90
+++ b/source/f90/doboson.f90
@@ -1,4 +1,4 @@
-subroutine doboson(t, width, gauss, asym, emin, emax, wmin, wmax, np, p, xout, yout, nout)
+subroutine doboson(t, width, gauss, asym, emin, emax, wmin, wmax, np, p, debug, xout, yout, nout)
 
 ! *******************************************************************
 ! *                                                                 *
@@ -32,6 +32,7 @@ subroutine doboson(t, width, gauss, asym, emin, emax, wmin, wmax, np, p, xout, y
   double precision, intent(in out) :: wmax
   integer, intent(in) :: np
   double precision, intent(in) :: p(np)
+  logical, intent(in) :: debug
   double precision, intent(in out) :: xout(nout), yout(nout)
   integer, intent(in out) :: nout
 
@@ -49,15 +50,12 @@ subroutine doboson(t, width, gauss, asym, emin, emax, wmin, wmax, np, p, xout, y
   double precision, allocatable :: p1(:), p2(:)
   double precision :: r1(nmax), r2(nmax)
 
-  logical :: debug
-
 ! remark : the two arrays r1 and r2 are used for fourier
 ! transforming the user-supplied instrumental response of the
 ! spectrometer that has to be coded in the external routine
 ! respon called when the input parameter gauss is < 0 or > 1.
 ! with 0 <= gauss <= 1, r1 and r2 are not used.
 
-  debug = .false.
   data fm1 / 0.0d0 /, fp1 / 0.0d0 /
   pi = 4 * datan(1.0d0)
 
diff --git a/source/f90/eels-boson.f90 b/source/f90/eels-boson.f90
index 815e1a1..2da9ecd 100644
--- a/source/f90/eels-boson.f90
+++ b/source/f90/eels-boson.f90
@@ -31,6 +31,7 @@ program eels_boson
   double precision, allocatable :: tmp_osc(:, :)
 
   double precision :: asym, emax, emin, gauss, t, width
+  logical :: debug
   integer :: ioStatus
   
   character (len = :), allocatable :: eelsin_name, eelsou_name
@@ -174,9 +175,11 @@ program eels_boson
   nout = 2**14
   allocate (xout(nout))
   allocate (yout(nout))
+  
+  debug = .false.
 
   call doboson(t, width, gauss, asym, emin, emax, &
-               wmin, wmax, nw, f, xout, yout, nout)
+               wmin, wmax, nw, f, debug, xout, yout, nout)
 
   comment(2) = comment(1)
   open(unit = 14, file = bosou_name)
diff --git a/tests/oxlog/boson.f90 b/tests/oxlog/boson.f90
index aaeeaff..fad627a 100644
--- a/tests/oxlog/boson.f90
+++ b/tests/oxlog/boson.f90
@@ -18,6 +18,7 @@ program boson
   character (len = 72) :: comment(2)
   double precision, allocatable :: xout(:), yout(:)
   integer :: nout
+  logical :: debug
 
 ! *** read input parameters
 
@@ -69,7 +70,10 @@ program boson
   allocate (xout(nout))
   allocate (yout(nout))
 
-  call doboson(t, width, gauss, asym, emin, emax, wmin, wmax, np, p2, xout, yout, nout)
+  debug = .false.
+
+  call doboson(t, width, gauss, asym, emin, emax, &
+               wmin, wmax, np, p2, debug xout, yout, nout)
 
   open(unit = 14, file = 'bosou')
   write(14, '(a, a, f6.1, a, f5.2)') comment(1), 'T =', t, ' GAUSS =', gauss
diff --git a/tests/oxlog/doboson.f90 b/tests/oxlog/doboson.f90
index f2ee66d..c920ac5 100644
--- a/tests/oxlog/doboson.f90
+++ b/tests/oxlog/doboson.f90
@@ -1,4 +1,4 @@
-subroutine doboson(t, width, gauss, asym, emin, emax, wmin, wmax, np, p, xout, yout, nout)
+subroutine doboson(t, width, gauss, asym, emin, emax, wmin, wmax, np, p, debug, xout, yout, nout)
 
 ! *******************************************************************
 ! *                                                                 *
@@ -32,6 +32,7 @@ subroutine doboson(t, width, gauss, asym, emin, emax, wmin, wmax, np, p, xout, y
   double precision, intent(in out) :: wmax
   integer, intent(in) :: np
   double precision, intent(in) :: p(np)
+  logical, intent(in) :: debug
   double precision, intent(in out) :: xout(nout), yout(nout)
   integer, intent(in out) :: nout
 
@@ -49,15 +50,12 @@ subroutine doboson(t, width, gauss, asym, emin, emax, wmin, wmax, np, p, xout, y
   double precision, allocatable :: p1(:), p2(:)
   double precision :: r1(nmax), r2(nmax)
 
-  logical :: debug
-
 ! remark : the two arrays r1 and r2 are used for fourier
 ! transforming the user-supplied instrumental response of the
 ! spectrometer that has to be coded in the external routine
 ! respon called when the input parameter gauss is < 0 or > 1.
 ! with 0 <= gauss <= 1, r1 and r2 are not used.
 
-  debug = .false.
   data fm1 / 0.0d0 /, fp1 / 0.0d0 /
   pi = 4 * datan(1.0d0)
 
-- 
GitLab