This file is indexed.

/usr/share/doc/libplplot11/examples/f77/x16f.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
c      $Id: x16f.fm4 11680 2011-03-27 17:57:51Z airwin $
c      plshades demo, using color fill
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
      include 'plplot_parameters.h'
      real*8 xx, yy, argx, argy, distort, r, t
      integer NLEVEL, NX, NY, PERIMETERPTS, xdim, ydim
      parameter(NLEVEL = 20)
c      xdim and ydim are the static dimensions of the 2D arrays while
c      NX and NY are the defined area.
      parameter(xdim=99, NX = 35)
      parameter(ydim=100, NY = 46)
      parameter(PERIMETERPTS = 100)
      real*8 clevel(NLEVEL), shedge(NLEVEL+1),
     &  z(xdim,ydim), w(xdim,ydim), xg1(xdim), yg1(ydim),
     &  xg2(xdim,ydim), yg2(xdim,ydim), zmin, zmax,
     &  px(PERIMETERPTS), py(PERIMETERPTS)
      integer fill_width, cont_color, cont_width
      integer i, j
c      dummy to fill argument list with something not currently used.
      character*1 defined
      real*8 tr(6)
      common /plplot/tr

c      Process command-line arguments
      call plparseopts(PL_PARSE_FULL)

c      Load color palettes
      call plspal0('cmap0_black_on_white.pal')
      call plspal1('cmap1_gray.pal',1)

c      Reduce colors in cmap 0 so that cmap 1 is useful on a 16-color display
      call plscmap0n(3)

c      Initialize plplot

      call plinit()
c      Set up transformation matrix

      tr(1) = 2.d0/(NX-1)
      tr(2) = 0.d0
      tr(3) = -1.d0
      tr(4) = 0.d0
      tr(5) = 2.d0/(NY-1)
      tr(6) = -1.d0

c      Calculate the data matrices.
      do i=1,NX
        xx = dble(i-1-(NX/2))/dble (NX/2)
        do j=1,NY
          yy = dble(j-1-(NY/2))/dble (NY/2) - 1.0d0
          z(i,j) = - sin(7.d0*xx) * cos(7.d0*yy) + xx*xx - yy*yy
          w(i,j) = - cos(7.d0*xx) * sin(7.d0*yy) + 2.d0*xx*yy
        enddo
      enddo

      call a2mnmx(z, NX, NY, zmin, zmax, xdim)
      do i = 1, NLEVEL
        clevel(i) = zmin + (zmax - zmin) * (i - 0.5d0) / dble(NLEVEL)
      enddo
      do i = 1, NLEVEL+1
        shedge(i) = zmin + (zmax - zmin) * dble(i-1) / dble(NLEVEL)
      enddo

c      Build the 1-d coord arrays.
      distort = 0.4d0
      do i=1,NX
        xx = -1.d0 + dble(i-1)*2.d0/dble(NX-1)
        xg1(i) = xx + distort*cos(0.5d0*PI*xx)
      enddo

      do j=1,NY
        yy = -1.d0 + dble(j-1)*2.d0/dble(NY-1)
        yg1(j) = yy - distort*cos(0.5d0*PI*yy)
      enddo

c      Build the 2-d coord arrays.
      do i=1,NX
        xx = -1.d0 + dble(i-1)*2.d0/dble(NX-1)
        argx = 0.5d0*PI*xx
        do j=1,NY
          yy = -1.d0 + dble(j-1)*2.d0/dble(NY-1)
          argy = 0.5d0*PI*yy
          xg2(i,j) = xx + distort*cos(argx)*cos(argy)
          yg2(i,j) = yy - distort*cos(argx)*cos(argy)
        enddo
      enddo

c      Plot using transform of index range to xmin, xmax, ymin, ymax
      call pladv(0)
      call plvpor(0.1d0, 0.9d0, 0.1d0, 0.9d0)
      call plwind(-1.0d0, 1.0d0, -1.0d0, 1.0d0)

      call plpsty(0)

      fill_width = 2
      cont_color = 0
      cont_width = 0
      call plshades0(z, NX, NY, defined, -1.d0, 1.d0, -1.d0, 1.d0,
     &  shedge, NLEVEL+1, fill_width,
     &  cont_color, cont_width, xdim)

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

c      Plot using 1d coordinate transform

      call plspal0('cmap0_black_on_white.pal')
      call plspal1('cmap1_blue_yellow.pal',1)
      call plscmap0n(3)

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

      call plpsty(0)

      fill_width = 2
      cont_color = 0
      cont_width = 0
      call plshades1(z, NX, NY, defined, -1.d0, 1.d0, -1.d0, 1.d0,
     &  shedge, NLEVEL+1, fill_width,
     &  cont_color, cont_width, xg1, yg1, xdim)

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

c      Plot using 2d coordinate transform

      call plspal0('cmap0_black_on_white.pal')
      call plspal1('cmap1_blue_red.pal',1)
      call plscmap0n(3)

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

      call plpsty(0)

      fill_width = 2
      cont_color = 0
      cont_width = 0
      call plshades2(z, NX, NY, defined, -1.d0, 1.d0, -1.d0, 1.d0,
     &  shedge, NLEVEL+1, fill_width,
     &  cont_color, cont_width, xg2, yg2, xdim)

      call plcol0(1)
      call plbox('bcnst', 0.0d0, 0, 'bcnstv', 0.0d0, 0)
      call plcol0(2)
      call plcon2(w, xdim, ny, 1, nx, 1, ny, clevel, NLEVEL, xg2, yg2)
      call pllab('distance', 'altitude',
     &  'Bogon density, with streamlines')

c      Plot using 2d coordinate transform and plshades contours.
      call plspal0('')
      call plspal1('',1)
      call plscmap0n(3)

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

      call plpsty(0)

      fill_width = 2
      cont_color = 2
      cont_width = 3
      call plshades2(z, NX, NY, defined, -1.d0, 1.d0, -1.d0, 1.d0,
     &  shedge, NLEVEL+1, fill_width,
     &  cont_color, cont_width, xg2, yg2, xdim)

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

c      Example with polar coordinates.
      call plspal0('cmap0_black_on_white.pal')
      call plspal1('cmap1_gray.pal',1)
      call plscmap0n(3)

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

      call plpsty(0)

c      Build new coordinate matrices.
      do i = 1, NX
        r = dble(i-1)/dble(NX-1)
        do j = 1, NY
          t = (2.d0*PI/dble(NY-1))*dble(j-1)
          xg2(i,j) = r*cos(t)
          yg2(i,j) = r*sin(t)
          z(i,j) = exp(-r*r)*cos(5.d0*PI*r)*cos(5.d0*t)
        enddo
      enddo

c      Need a new shedge to go along with the new data set.
      call a2mnmx(z, NX, NY, zmin, zmax, xdim)
      do i = 1, NLEVEL+1
        shedge(i) = zmin + (zmax - zmin) * dble(i-1) / dble(NLEVEL)
      enddo

c      Now we can shade the interior region.
      fill_width = 2
      cont_color = 0
      cont_width = 0
      call plshades2(z, NX, NY, defined, -1.d0, 1.d0, -1.d0, 1.d0,
     &  shedge, NLEVEL+1, fill_width,
     &  cont_color, cont_width, xg2, yg2, xdim)

c      Now we can draw the perimeter.  (If do before, shade stuff may overlap.)
      do i = 1, PERIMETERPTS
        t = (2.d0*PI/dble(PERIMETERPTS-1))*dble(i-1)
        px(i) = cos(t)
        py(i) = sin(t)
      enddo

      call plcol0(1)
      call plline(PERIMETERPTS, px, py)

c      And label the plot.
      call plcol0(2)
      call pllab( '', '',  'Tokamak Bogon Instability' )

      call plend
      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