1
C @(#)tdscale.for 19.1 (ES0-DMD) 02/25/03 14:11:20
2
C===========================================================================
3
C Copyright (C) 1995 European Southern Observatory (ESO)
5
C This program is free software; you can redistribute it and/or
6
C modify it under the terms of the GNU General Public License as
7
C published by the Free Software Foundation; either version 2 of
8
C the License, or (at your option) any later version.
10
C This program is distributed in the hope that it will be useful,
11
C but WITHOUT ANY WARRANTY; without even the implied warranty of
12
C MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
C GNU General Public License for more details.
15
C You should have received a copy of the GNU General Public
16
C License along with this program; if not, write to the Free
17
C Software Foundation, Inc., 675 Massachusetss Ave, Cambridge,
20
C Corresponding concerning ESO-MIDAS should be addressed as follows:
21
C Internet e-mail: midas@eso.org
22
C Postal address: European Southern Observatory
23
C Data Management Division
24
C Karl-Schwarzschild-Strasse 2
25
C D 85748 Garching bei Muenchen
27
C===========================================================================
29
C++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
31
C.COPYRIGHT: Copyright (c) 1987 European Southern Observatory,
34
C.VERSION: 1.0 ESO-FORTRAN Conversion, AA 18:30 - 11 DEC 1987
36
C.LANGUAGE: F77+ESOext
40
C.IDENTIFICATION TDSCALE.FOR
41
C.KEYWORDS TABLE, APPLICATIONS
44
C FINDS NICE LIMITS, DISTANCE BETWEEN TICS AND NUMBER OF TIC MARKS
45
C FOR PLOTTING AND OTHER DISPLAY PURPOSES.
48
C------------------------------------------------------------------
49
SUBROUTINE TDSCAL(DMIN,DMAX,SCAL,XLOW,XUPP,ID,DTIC,NLAB)
51
REAL DMIN ! IN : minimum value
52
REAL DMAX ! IN : maximum value
53
REAL SCAL ! IN : scaling factor
54
REAL XLOW ! OUT: mantisa of lower limit
55
REAL XUPP ! OUT: mantisa of upper limit
56
INTEGER ID ! OUT: exponent of XLOW and XUPP
57
REAL DTIC ! OUT: distance between tic marks
58
INTEGER NLAB ! OUT : number of tic marks
60
REAL DELTA,XMIN,XMAX,XDIF
61
REAL OFFSET,SCALE,POTFAC
63
INTEGER LMIN,LMAX,LDIF
70
IF (DMIN.GT.DMAX) SCALE = -SCALE
71
IF (XMIN.EQ.XMAX .OR. SCALE.EQ.0.) RETURN
73
OFFSET = XDIF/ABS(SCALE*2.0) - 0.5*XDIF
76
POTFAC = ALOG10(XDIF/2.0)
77
IF (POTFAC.LT.0.) POTFAC = POTFAC - 1.0 + DELTA
81
IF (RLMIN.LT.0.) RLMIN = RLMIN - 1.0 + DELTA
83
RLMAX = XMAX/POTFAC + 1.0 - DELTA
84
IF (RLMAX.LT.0.) RLMAX = RLMAX - 1.0 + DELTA
87
IF (LDIF.GT.5) GO TO 10
92
10 IF (LDIF.GT.10) GO TO 20
93
IF (LMIN.LT.0) LMIN = LMIN - 1
95
IF (LMAX.LT.0) LMAX = LMAX - 1
101
20 IF (LMIN.LT.0) LMIN = LMIN - 4
103
IF (LMAX.LT.0) LMAX = LMAX - 4
104
LMAX = INT((LMAX+4)/5)*5
107
30 IF (SCALE.LT.0) GO TO 40