Skip to content

Commit

Permalink
BF - fixed parameter / variable nastiness in gfortran
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-brett committed Jan 5, 2011
1 parent 1f996b9 commit 7be56b1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 4 additions & 2 deletions 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 \
Expand All @@ -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
Expand Down
10 changes: 8 additions & 2 deletions original/stripack/stripack_prb.f90
Expand Up @@ -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)
Expand All @@ -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 ( )

Expand Down Expand Up @@ -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)' ) ' '
Expand All @@ -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)' ) ' '
Expand Down

0 comments on commit 7be56b1

Please sign in to comment.