Re: Double Precision and Subroutine SET_(There was sth wrong in my last mail.)

From: Kate Hedstrom (kate AT arsc.edu)
Date: Mon May 02 2005 - 15:39:47 MDT

  • Next message: Malcolm Haylock: "NCAR Graphics, Mac OS 10.4 and XLF"

    On Mon, May 02, 2005 at 01:58:26PM -0700, Muhtarjan Osman wrote:
    >
    >
    > Hi-
    >
    > In one of my linear model, I need to interpret all of my real variables
    > to double precision. I did this by using the -r8 and -i4 in PGI
    > compiler. Unfortunately, the program gave me a error message:
    >
    >
    >
    > GKS ERROR NUMBER 51 ISSUED FROM SUBROUTINE GSVP :
    >
    > --RECTANGLE DEFINITION IS INVALID
    >
    > GKS ERROR NUMBER -113 ISSUED FROM SUBROUTINE GSWN :
    >
    > --Warning: XMIN > XMAX or YMIN > YMAX in window (non-standard NCAR
    > extension of GKS)
    >
    >
    >
    > I did some test printing and found the errors occurred at two places where
    > the subroutine SET was called.
    >
    >
    >
    > CALL SET(0.,1.,0.,1.,0.,1.,0.,1.,1)
    >
    >
    >
    > CALL SET(.1,.9,.3,.7,0.,1.,0.,1.,1)
    >
    >
    >
    > My question is if the -r8 option of compiler could affect the
    > arguments in a SET call. If so, how to use SET in this kind of situation?
    >
    >
    >
    > Any comment will be appreciated.

    You need to be consistent when using -r8. In this case it means
    recompiling NCARG with -r8. Right now, set is interpreting all the
    reals as 32-bit reals, but you are passing it 64-bit reals. I got away
    with this once on a Vax, but not with IEEE floating point.

    Alternately, you may want to be computing with 64-bit reals while
    plotting with 32-bit numbers. You can see if there is a way to protect
    the arguments to set by making them specifically 32-bit while the -r8
    flag is in effect. We had one system where we could say something like:

        real*4 one
        one = 1.0

    and so on. But then the Cray didn't like real*4, so we made a
    C-preprocessor tag:

    #ifdef cray
    #define SMALLREAL real
    #else
    #define SMALLREAL real*4
    #endif

         SMALLREAL one

    Now we just use f90 kinds and declare all our variables to be of the
    type desired, no -r8 flags at all.

    More than you ever wanted to know...
    Kate
    _______________________________________________
    ncarg-talk mailing list
    ncarg-talk AT unknown
    http://mailman.ucar.edu/mailman/listinfo/ncarg-talk



    This archive was generated by hypermail 2b29 : Tue May 03 2005 - 09:03:38 MDT