This file is indexed.

/usr/share/doc/libplplot11/examples/f77/x15f.f is in libplplot-dev 5.9.9-2ubuntu2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
c      $Id: x15f.fm4 11680 2011-03-27 17:57:51Z airwin $
c      Shade plot demo.
c      Does a variety of shade plots.
c
c      Copyright (C) 2004  Alan W. Irwin
c
c      This file is part of PLplot.
c
c      PLplot is free software; you can redistribute it and/or modify
c      it under the terms of the GNU Library General Public License as
c      published by the Free Software Foundation; either version 2 of the
c      License, or (at your option) any later version.
c
c      PLplot is distributed in the hope that it will be useful,
c      but WITHOUT ANY WARRANTY; without even the implied warranty of
c      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
c      GNU Library General Public License for more details.
c
c      You should have received a copy of the GNU Library General Public
c      License along with PLplot; if not, write to the Free Software
c      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

      implicit none

      integer  xdim, ydim, XPTS, YPTS
c      xdim and ydim are the static dimensions of the 2D arrays while
c      NX and NY are the defined area.
      parameter( xdim = 99, XPTS = 35, ydim = 100, YPTS = 46 )

      integer i,  j
      real*8  xx, yy
      real*8  z(xdim, ydim), zmin, zmax

      include 'plplot_parameters.h'
c      Process command-line arguments
      call plparseopts(PL_PARSE_FULL)

c      Set up color map 1 (but comment out because this makes
c      no difference for the current cmap0 plshade calls in plot1 and plot2.)

c      call cmap1_init2()

c      Initialize plplot

      call plinit()

c      Set up data array

      do i = 1,XPTS
        xx = dble(i-1 - (XPTS / 2)) / dble(XPTS / 2)
        do j = 1,YPTS
          yy = dble(j-1 - (YPTS / 2)) / dble(YPTS / 2) - 1.0d0
          z(i,j) = xx*xx - yy*yy + (xx - yy)/(xx*xx+yy*yy + 0.1d0)
        enddo
      enddo

      call a2mnmx(z, XPTS, YPTS, zmin, zmax, xdim)

      call plot1(z, XPTS, YPTS, zmin, zmax, xdim)
      call plot2(z, XPTS, YPTS, zmin, zmax, xdim)
      call plot3()

      call plend()
      end

c -------------------------------------------------------------------------
c      cmap1_init1
c
c      Initializes color map 1 in HLS space.
c -------------------------------------------------------------------------

      subroutine cmap1_init1()
      implicit none
      real*8   i(4), h(4), l(4), s(4)
      integer rev(4)

      i(1) = 0.0d0    ! left boundary
      i(2) = 0.45d0   ! just before center
      i(3) = 0.55d0   ! just after center
      i(4) = 1.0d0    ! right boundary

      h(1) = 260.0d0  ! hue -- low: blue-violet
      h(2) = 260.0d0  ! only change as we go over vertex
      h(3) = 20.0d0   ! hue -- high: red
      h(4) = 20.0d0   ! keep fixed


      l(1) = 0.5d0    ! lightness -- low
      l(2) = 0.0d0    ! lightness -- center
      l(3) = 0.0d0    ! lightness -- center
      l(4) = 0.5d0    ! lightness -- high

c     call plscolbg(255,255,255)
c     l(1) = 0.5d0    ! lightness -- low
c     l(2) = 1.0d0    ! lightness -- center
c     l(3) = 1.0d0    ! lightness -- center
c     l(4) = 0.5d0    ! lightness -- high

      s(1) = 1.0d0    ! maximum saturation
      s(2) = 1.0d0    ! maximum saturation
      s(3) = 1.0d0    ! maximum saturation
      s(4) = 1.0d0    ! maximum saturation

      rev(1) = 0
      rev(2) = 0
      rev(3) = 0
      rev(4) = 0

      call plscmap1l(0, 4, i, h, l, s, rev)
      end

c -------------------------------------------------------------------------
c      cmap1_init2
c
c      Initializes color map 1 in HLS space.
c -------------------------------------------------------------------------

      subroutine cmap1_init2()
      implicit none
      real*8 i(4), h(4), l(4), s(4)
      integer rev(4)

      i(1) = 0.0d0    ! left boundary
      i(2) = 0.45d0   ! just before center
      i(3) = 0.55d0   ! just after center
      i(4) = 1.0d0    ! right boundary

      h(1) = 260.0d0  ! hue -- low: blue-violet
      h(2) = 260.0d0  ! only change as we go over vertex
      h(3) = 20.0d0   ! hue -- high: red
      h(4) = 20.0d0   ! keep fixed


      l(1) = 0.6d0    ! lightness -- low
      l(2) = 0.0d0    ! lightness -- center
      l(3) = 0.0d0    ! lightness -- center
      l(4) = 0.6d0    ! lightness -- high

c     call plscolbg(255,255,255)
c     l(1) = 0.5d0    ! lightness -- low
c     l(2) = 1.0d0    ! lightness -- center
c     l(3) = 1.0d0    ! lightness -- center
c     l(4) = 0.5d0    ! lightness -- high

      s(1) = 1.0d0    ! maximum saturation
      s(2) = 0.5d0    ! maximum saturation
      s(3) = 0.5d0    ! maximum saturation
      s(4) = 1.0d0    ! maximum saturation

      rev(1) = 0
      rev(2) = 0
      rev(3) = 0
      rev(4) = 0

      call plscmap1l(0, 4, i, h, l, s, rev)
      end

c -------------------------------------------------------------------------
c      plot1
c
c      Illustrates a single shaded region.
c -------------------------------------------------------------------------

      subroutine plot1(z, XPTS, YPTS, zmin, zmax, xdim)
      implicit none

      integer xdim, XPTS, YPTS
      real*8  z(xdim,YPTS), zmin, zmax

      character*1 undefined
      real*8  shade_min, shade_max, sh_color
      integer sh_cmap, sh_width
      integer min_color, min_width, max_color, max_width

      sh_cmap   = 0
      min_color = 0
      min_width = 0
      max_color = 0
      max_width = 0

      call pladv(0)
      call plvpor( 0.1d0, 0.9d0,  0.1d0, 0.9d0)
      call plwind(-1.0d0, 1.0d0, -1.0d0, 1.0d0)

c      Plot using identity transform

      shade_min = zmin + (zmax-zmin)*0.4d0
      shade_max = zmin + (zmax-zmin)*0.6d0
      sh_color  = 7
      sh_width  = 2
      min_color = 9
      max_color = 2
      min_width = 2
      max_width = 2

      call plpsty(8)

c      Use_ plshade0 instead of plshade1 - identity mapping
      call plshade0(z, XPTS, YPTS, undefined,
     &  -1.d0, 1.d0, -1.d0, 1.d0,
     &  shade_min, shade_max,
     &  sh_cmap, sh_color, sh_width,
     &  min_color, min_width, max_color, max_width, xdim)

      call plcol0(1)
      call plbox('bcnst', 0.0d0, 0, 'bcnstv', 0.0d0, 0)
      call plcol0(2)
      call pllab('distance', 'altitude', 'Bogon flux')

      end

c -------------------------------------------------------------------------
c      plot2
c
c      Illustrates multiple adjacent shaded regions, using different fill
c      patterns for each region.
c -------------------------------------------------------------------------

      subroutine plot2(z, XPTS, YPTS, zmin, zmax, xdim)
      implicit none

      integer xdim, XPTS, YPTS
      real*8  z(xdim,YPTS), zmin, zmax

      character*1 undefined
      real*8  shade_min, shade_max, sh_color
      integer sh_cmap, sh_width
      integer min_color, min_width, max_color, max_width
      integer i,j

      integer nlin(10), inc(2,10), del(2,10)
      data nlin /1, 1, 1, 1, 1, 2, 2, 2, 2, 2/
      data ( (inc(i,j), i=1,2), j=1,10) /
     &     450, 0, -450, 0, 0, 0, 900, 0, 
     &     300, 0, 450,-450, 0, 900, 0, 450, 
     &     450, -450, 0, 900/
      data ( (del(i,j), i=1,2), j=1,10) /
     &     2000, 2000, 2000, 2000, 2000, 2000, 
     &     2000, 2000, 2000, 2000, 2000, 2000, 
     &     2000, 2000, 2000, 2000, 4000, 4000,
     &     4000, 2000/

      sh_cmap   = 0
      min_color = 0
      min_width = 0
      max_color = 0
      max_width = 0
      sh_width  = 2

      call pladv(0)
      call plvpor( 0.1d0, 0.9d0,  0.1d0, 0.9d0)
      call plwind(-1.0d0, 1.0d0, -1.0d0, 1.0d0)

c      Plot using identity transform

      do  i = 1,10
        shade_min = zmin + (zmax - zmin) * (i-1) / 10.0d0
        shade_max = zmin + (zmax - zmin) * i / 10.0d0
        sh_color = i+5
        call plpat(nlin(i),inc(1,i),del(1,i))
c        Use_ plshade0 instead of plshade1 - identity mapping
        call plshade0(z, XPTS, YPTS, undefined,
     &    -1.d0, 1.d0, -1.d0, 1.d0,
     &    shade_min, shade_max,
     &    sh_cmap, sh_color, sh_width,
     &    min_color, min_width, max_color, max_width, xdim)
      enddo

      call plcol0(1)
      call plbox('bcnst', 0.0d0, 0, 'bcnstv', 0.0d0, 0)
      call plcol0(2)
      call pllab('distance', 'altitude', 'Bogon flux')
      
      end

c--------------------------------------------------------------------------
c     plot3
c
c     Illustrates shaded regions in 3d, using a different fill pattern for 
c     each region.  
c--------------------------------------------------------------------------

      subroutine plot3
      implicit none
      real*8 xx1(5), xx2(5), yy1(5), yy2(5), zz1(5), zz2(5)
      data xx1 / -1.0d0, 1.0d0, 1.0d0, -1.0d0, -1.0d0/
      data xx2 / -1.0d0, 1.0d0, 1.0d0, -1.0d0, -1.0d0/
      data yy1 /1.0d0, 1.0d0, 0.0d0, 0.0d0, 1.0d0/
      data yy2 / -1.0d0, -1.0d0, 0.0d0, 0.0d0, -1.0d0/
      data zz1 / 0.0d0, 0.0d0, 1.0d0, 1.0d0, 0.0d0/
      data zz2 / 0.0d0, 0.0d0, 1.0d0, 1.0d0, 0.0d0/

      call pladv(0)
      call plvpor(0.1d0, 0.9d0, 0.1d0, 0.9d0)
      call plwind(-1.0d0, 1.0d0, -1.0d0, 1.0d0)
      call plw3d(1.d0, 1.d0, 1.d0, -1.0d0, 1.0d0, -1.0d0, 1.0d0, 0.0d0, 
     &     1.5d0, 30.d0, -40.d0)

c     Plot using identity transform 
    
      call plcol0(1)
      call plbox3("bntu", "X", 0.0d0, 0, "bntu", "Y", 0.0d0, 0, 
     &     "bcdfntu", "Z", 0.5d0, 0)
      call plcol0(2)
      call pllab("","","3-d polygon filling")

      call plcol0(3)
      call plpsty(1)
      call plline3(5, xx1, yy1, zz1)
      call plfill3(4, xx1, yy1, zz1)
      call plpsty(2)
      call plline3(5, xx2, yy2, zz2)
      call plfill3(4, xx2, yy2, zz2)

      end

c----------------------------------------------------------------------------
c      Subroutine a2mnmx
c      Minimum and the maximum elements of a 2-d array.

      subroutine a2mnmx(f, nx, ny, fmin, fmax, xdim)
      implicit none

      integer   i, j, nx, ny, xdim
      real*8    f(xdim, ny), fmin, fmax

      fmax = f(1, 1)
      fmin = fmax
      do j = 1, ny
        do  i = 1, nx
          fmax = max(fmax, f(i, j))
          fmin = min(fmin, f(i, j))
        enddo
      enddo
      end