From 7be56b148e601e457833aa1a3d65f27d8290b09f Mon Sep 17 00:00:00 2001 From: Matthew Brett Date: Wed, 5 Jan 2011 00:13:56 +0000 Subject: [PATCH] BF - fixed parameter / variable nastiness in gfortran --- original/Makefile | 6 ++++-- original/stripack/stripack_prb.f90 | 10 ++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/original/Makefile b/original/Makefile index 097b362..c0b5d44 100644 --- a/original/Makefile +++ b/original/Makefile @@ -1,4 +1,5 @@ FC = gfortran +FFLAGS = -g -Wall STRIPACK_F90S = addnod arc_cosine areas bdyadd bnodes circum covsph crlist \ delarc delnb delnod edge getnp insert inside intadd intrsc \ @@ -14,19 +15,20 @@ fsplit: f90split/f90split.o clean: - rm *.f90 + - rm -rf */*.o - rm fsplit - rm libstripack.a - rm stirpack_prb* + - rm -rf temp libstripack.a: stripack/stripack.f90 fsplit - rm -rf temp - mkdir temp cd temp && ../fsplit ../stripack/stripack.f90 for filename in $(STRIPACK_F90S); do \ - $(FC) -c temp/$${filename}.f90 -o temp/$${filename}.o; \ + $(FC) $(FFLAGS) -c temp/$${filename}.f90 -o temp/$${filename}.o; \ done ; ar qc libstripack.a temp/*.o - rm -rf temp stripack-test: libstripack.a stripack/stripack_prb.o $(FC) -o stripack_prb stripack/stripack_prb.o -L. -lstripack diff --git a/original/stripack/stripack_prb.f90 b/original/stripack/stripack_prb.f90 index 061cade..2da5c1b 100644 --- a/original/stripack/stripack_prb.f90 +++ b/original/stripack/stripack_prb.f90 @@ -62,6 +62,7 @@ program stripack_prb integer nt logical numbr integer nv + integer vnmax real p(3) real, parameter :: pltsiz = 7.5E+00 real rc(2*nmax-4) @@ -84,6 +85,11 @@ program stripack_prb real yc(2*nmax-4) real z(nmax) real zc(2*nmax-4) +! +! store nmax in variable so it is mutable. Otherwise, when nmax is used as a +! mutable variable in subroutines, nasty errors can result in gfortran at least +! + vnmax = nmax ! call timestamp ( ) @@ -436,7 +442,7 @@ program stripack_prb n1 = 1 n2 = n - call edge ( n1, n2, x, y, z, nmax, iwk, list, lptr, lend, ier ) + call edge ( n1, n2, x, y, z, vnmax, iwk, list, lptr, lend, ier ) if ( ier /= 0 .and. ier /= 5 ) then write ( *, '(a)' ) ' ' @@ -460,7 +466,7 @@ program stripack_prb do - call delnod ( nn, nn, x, y, z, list, lptr, lend, lnew, nmax, iwk, ier ) + call delnod ( nn, nn, x, y, z, list, lptr, lend, lnew, vnmax, iwk, ier ) if ( ier /= 0 .and. ier /= 5 ) then write ( *, '(a)' ) ' '