1
! $Id: x11f.f90 11680 2011-03-27 17:57:51Z airwin $
4
! Copyright (C) 2004 Alan W. Irwin
6
! This file is part of PLplot.
8
! PLplot is free software; you can redistribute it and/or modify
9
! it under the terms of the GNU Library General Public License as
10
! published by the Free Software Foundation; either version 2 of the
11
! License, or (at your option) any later version.
13
! PLplot is distributed in the hope that it will be useful,
14
! but WITHOUT ANY WARRANTY; without even the implied warranty of
15
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
! GNU Library General Public License for more details.
18
! You should have received a copy of the GNU Library General Public
19
! License along with PLplot; if not, write to the Free Software
20
! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
use plplot, PI => PL_PI
24
integer i, j, k, ifshade, xpts, ypts
25
parameter (xpts=35, ypts=46)
27
real(kind=plflt) x(xpts), y(ypts), z(xpts,ypts), xx, yy, r
30
real(kind=plflt) alt(2),az(2)
32
data alt /33.0_plflt,17.0_plflt/
33
data az /24.0_plflt,115.0_plflt/
36
data title /'#frPLplot Example 11 - Alt=33, Az=24, Opt=3', &
37
'#frPLplot Example 11 - Alt=17, Az=115, Opt=3'/
39
parameter (nlevel = 10)
40
real(kind=plflt) zmin, zmax, step, clevel(nlevel)
41
! Process command-line arguments
42
call plparseopts(PL_PARSE_FULL)
46
x(i) = 3._plflt*dble(i-1-(xpts/2))/dble (xpts/2)
49
y(j) = 3._plflt*dble(j-1-(ypts/2))/dble (ypts/2)
56
z(i,j) = 3._plflt * (1._plflt-xx)*(1._plflt-xx) * &
57
exp(-(xx*xx) - (yy+1._plflt)*(yy+1._plflt)) - &
58
10._plflt * (xx/5._plflt - xx**3 - yy**5) * exp(-xx*xx-yy*yy) - &
59
1._plflt/3._plflt * exp(-(xx+1._plflt)*(xx+1._plflt) - (yy*yy))
61
! Jungfraujoch/Interlaken
62
if(z(i,j).lt.-1._plflt) z(i,j) = -1._plflt
66
call a2mnmx(z, xpts, ypts, zmin, zmax)
67
step = (zmax-zmin)/(nlevel+1)
69
clevel(i) = zmin + step*i
78
call plvpor(0.0_plflt, 1.0_plflt, 0.0_plflt, 0.9_plflt )
79
call plwind(-1.0_plflt, 1.0_plflt, -1.0_plflt, 1.5_plflt )
80
call plw3d(1.0_plflt, 1.0_plflt, 1.2_plflt, -3.0_plflt, &
81
3.0_plflt, -3.0_plflt, 3.0_plflt, zmin, zmax, alt(k),az(k))
82
call plbox3('bnstu','x axis', 0.0_plflt, 0, &
83
'bnstu', 'y axis', 0.0_plflt, 0, &
84
'bcdmnstuv','z axis', 0.0_plflt, 0)
88
call plmesh(x(:xpts), y(:ypts), z(:xpts,:ypts), &
90
elseif(ifshade.eq.1) then
91
! magnitude colored wireframe plot
92
call plmesh(x(:xpts), y(:ypts), z(:xpts,:ypts), &
93
ior(opt(k), MAG_COLOR))
94
elseif(ifshade.eq.2) then
95
! magnitude colored wireframe plot with sides
96
call plot3d(x(:xpts), y(:ypts), z(:xpts,:ypts), &
97
ior(opt(k), MAG_COLOR), .true.)
98
elseif(ifshade.eq.3) then
99
! magnitude colored wireframe plot with base contour
100
call plmeshc(x(:xpts), y(:ypts), z(:xpts,:ypts), &
101
ior(opt(k), ior(MAG_COLOR, BASE_CONT)), clevel)
103
stop 'x11f: bad logic'
106
call plmtex('t', 1.0_plflt, 0.5_plflt, 0.5_plflt, title(k))
112
!----------------------------------------------------------------------------
113
subroutine cmap1_init(gray)
114
! For gray.eq.1, basic grayscale variation from half-dark
115
! to light. Otherwise, hue variations around the front of the
116
! colour wheel from blue to green to red with constant lightness
122
real(kind=plflt) i(0:1), h(0:1), l(0:1), s(0:1)
128
! hue -- low: red (arbitrary if s=0)
130
! hue -- high: red (arbitrary if s=0)
132
! lightness -- low: half-dark
134
! lightness -- high: light
141
! This combination of hues ranges from blue to cyan to green to yellow
142
! to red (front of colour wheel) with constant lightness = 0.6
143
! and saturation = 0.8.
159
call plscmap1l(.false., i, h, l, s)
162
!----------------------------------------------------------------------------
164
! Minimum and the maximum elements of a 2-d array.
166
subroutine a2mnmx(f, nx, ny, fmin, fmax)
171
real(kind=plflt) f(nx, ny), fmin, fmax
177
fmax = max(fmax, f(i, j))
178
fmin = min(fmin, f(i, j))