1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
C*GRGENV -- get value of PGPLOT environment parameter (f90/nag)
C+
SUBROUTINE GRGENV(NAME, VALUE, L)
USE f90_unix_env
C
CHARACTER*(*) NAME, VALUE
INTEGER L
C
C Return the value of a PGPLOT environment parameter. In Sun/Convex-UNIX,
C environment parameters are UNIX environment variables; e.g. parameter
C ENVOPT is environment variable PGPLOT_ENVOPT. Translation is not
C recursive and is case-sensitive.
C
C Arguments:
C NAME : (input) the name of the parameter to evaluate.
C VALUE : receives the value of the parameter, truncated or extended
C with blanks as necessary. If the parameter is undefined,
C a blank string is returned.
C L : receives the number of characters in VALUE, excluding
C trailing blanks. If the parameter is undefined, zero is
C returned.
C--
C 19-Jan-1988
C-----------------------------------------------------------------------
INTEGER errno,i,lg,lin
CHARACTER*32 TEST
C
TEST = 'PGPLOT_'//NAME
LIN = INDEX(TEST, ' ')-1
CALL getenv(test(:lin),value,lg,errno)
IF (errno .NE. 0) value = ' '
IF (VALUE.EQ.' ') THEN
L = 0
ELSE
DO 10 I=LEN(VALUE),1,-1
L = I
IF (VALUE(I:I).NE.' ') GOTO 20
10 CONTINUE
L = 0
20 CONTINUE
END IF
END
|