From WhiteG@dfo-mpo.gc.ca Fri Jun 28 14:22:15 2002
Date: Fri, 28 Jun 2002 09:15:02 -0300
From: George N. White III <WhiteG@dfo-mpo.gc.ca>
To: Albrecht Gebhardt <albrecht.gebhardt@uni-klu.ac.at>
Subject: sgeostat: minor problem (and patch) for inplg.f on SGI Irix

I have R-1.5.0 built using the SGI MipsPro compilers on Irix 6.5.
This gave:

$ R INSTALL sgeostat_1.0-17.tar.gz
* Installing *source* package 'sgeostat' ...
** libs
f90 -OPT:IEEE_NaN_inf=ON    -g -O2 -OPT:Olimit_opt=on -c inplg.f -o inplg.o

                  S0=SIGN(1,Y(I+1)-Y(I))
                     ^
f90-700 f90: ERROR INPLG, File = inplg.f, Line = 48, Column = 22
  No specific intrinsic exists for the intrinsic call "SIGN".

f90: MIPSpro Fortran 90 Version 7.3  (f61) Thu Jun 27, 2002  13:36:46
f90: 76 source lines
f90: 1 Error(s), 0 Warning(s), 0 Other message(s), 0 ANSI(s)
cf90: "explain cf90-message number" gives more information about each message
gmake: *** [inplg.o] Error 2
ERROR: compilation failed for package 'sgeostat'

This is the result of mixing types in the arguments to the SIGN
function.  The fix is:

*** inplg.f.000	Wed Apr 26 19:45:59 2000
--- inplg.f	Thu Jun 27 13:46:56 2002
***************
*** 1,4 ****
--- 1,7 ----
        SUBROUTINE INPLG(X,Y,N,X0,Y0,N0,INPL)
+ *     changes: George White, <gnw3@acm.org>
+ *        2002-06-27 clean up types for SIGN
+       IMPLICIT NONE
        INTEGER N,N0,INPL(*)
        DOUBLE PRECISION X(*),Y(*),X0(*),Y0(*)
  c
***************
*** 16,22 ****
  c            1: in polygon, 0: outside
  c
        INTEGER I,J,CRSCNT,OUTCNT
!       DOUBLE PRECISION D0,DJ
  c     close polygon
        X(N+1)=X(1)
        Y(N+1)=Y(1)
--- 19,25 ----
  c            1: in polygon, 0: outside
  c
        INTEGER I,J,CRSCNT,OUTCNT
!       DOUBLE PRECISION D0,DJ,S0
  c     close polygon
        X(N+1)=X(1)
        Y(N+1)=Y(1)
***************
*** 45,51 ****
                    D0=X0(J)-X(I)
                    DJ=(Y0(J)-Y(I))*(X(I+1)-X(I))/(Y(I+1)-Y(I))
  c                 change orientation if Y(I+1) > Y(I)
!                   S0=SIGN(1,Y(I+1)-Y(I))
                    IF (S0*D0.LT.S0*DJ) THEN
  c                 point J is on the "outer" side of edge I-->I+1
                       OUTCNT=OUTCNT+1
--- 48,54 ----
                    D0=X0(J)-X(I)
                    DJ=(Y0(J)-Y(I))*(X(I+1)-X(I))/(Y(I+1)-Y(I))
  c                 change orientation if Y(I+1) > Y(I)
!                   S0=SIGN(1.D0,Y(I+1)-Y(I))
                    IF (S0*D0.LT.S0*DJ) THEN
  c                 point J is on the "outer" side of edge I-->I+1
                       OUTCNT=OUTCNT+1

--
George N. White III <gnw3@acm.org> Bedford Institute of Oceanography


