/usr/share/ncarg/hluex/xyplot/xy17f.f is in libncarg-data 6.3.0-6build1.
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 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | C
C $Id: xy17f.f,v 1.9 2010-03-15 22:49:25 haley Exp $
C
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C C
C Copyright (C) 1996 C
C University Corporation for Atmospheric Research C
C All Rights Reserved C
C C
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C
C File: xy17f.f
C
C Author: Bob Lackman
C National Center for Atmospheric Research
C PO 3000, Boulder, Colorado
C
C Date: 24 Jan 1996
C
C Description: Reads an ASCII file with 4 variables:
C lon, u, v, and t. u, v, and t are plotted
C with 3 stacked y axes.
C
external NhlFAppClass
external NhlFNcgmWorkstationClass
external NhlFPSWorkstationClass
external NhlFPDFWorkstationClass
external NhlFCairoPSPDFWorkstationClass
external NhlFCairoImageWorkstationClass
external NhlFCairoWindowWorkstationClass
external NhlFXyPlotClass
external NhlFCoordArraysClass
parameter (ncurve=3, npts=129)
CHARACTER*7 wks_type
integer i, rlist, wks, appid, field1, field2, field3
integer xy1, xy2, xy3, grlist
integer num_dspec
data num_dspec /1/
C
C Create variables to contain data.
C
real a,b,c,d
real y (ncurve,npts), lon (npts), u (npts), v (npts), t (npts)
real y1val (5), y2val (6), y3val(5)
data y1val /-90.0 , -80.0, -70.0, -60.0, -50.0/
data y2val /10.0, 20.0, 30.0, 40.0, 50.0, 60.0/
data y3val /-20.0, -10.0, 0.0, 10.0, 20.0/
character*5 y1lab(5), y2lab(6), y3lab(5)
data y1lab /'-90.', '-80.', '-70.', '-60.', '-50.'/
data y2lab /'10.', '20.', '30.', '40.', '50.', '60.'/
data y3lab /'-20.', '-10.', '0.', '10.', '20.'/
C
C Define the workstation type
C
wks_type = "x11"
C
C Read ASCII file xy.asc
C
open(unit=10,file='xy.asc',status='old',form='formatted',err=105)
C
C xy.asc has 4 vars of length 129 longitudes, lon, u, v, t
C
C The data is taken at 43N latitude. Longitude is an index
C 1-129 standing for 0 deg - 360 deg in steps of 360/128?
C u and v are in m/s, and t is in deg K.
C
do 100 i=1,npts,1
read (10,101,END=103,ERR=103) a,b,c,d
lon(i)=a
u(i)=b
v(i)=c
t(i)=d
100 continue
101 FORMAT (4X,F6.2,5X,F5.2,4X,F6.2,4X,F6.2)
103 close (10)
do 104 i=1,npts,1
lon (i) = (lon(i)- 1.0) * 360.0/128.0
t (i) = (t(i) - 273.15) * 9 / 5 + 32.0
y (1,i) = u(i)
y (2,i) = v(i)
y (3,i) = (t(i) - 273.15) * 9.0 / 5.0 + 32.0
104 continue
call NhlFInitialize
call NhlFRLCreate (rlist,'setrl')
C
C Create Application object. The Application object name is used to
C determine the name of the resource file, which is "xy17.res" in this
C case.
C
call NhlFRLClear (rlist)
call NhlFRLSetString (rlist, 'appDefaultParent', 'True', ierr)
call NhlFRLSetString (rlist, 'appUsrDir', './', ierr)
call NhlFCreate (appid, 'xy17', NhlFAppClass, 0, rlist, ierr)
C
C If NCGM=1, then open NCGM workstation.
C
if (wks_type.eq."ncgm".or.wks_type.eq."NCGM") then
call NhlFRLClear (rlist)
call NhlFRLSetString (rlist, 'wkMetaName',
+ 'xy17f.ncgm', ierr)
call NhlFCreate (wks, 'xy17Work', NhlFNcgmWorkstationClass, 0,
+ rlist, ierr)
endif
C
C Create an X workstation.
C
if (wks_type.eq."x11".or.wks_type.eq."X11") then
call NhlFRLClear (rlist)
call NhlFRLSetString (rlist, 'wkPause', 'True', ierr)
call NhlFCreate (wks, 'xy17Work',
+ NhlFCairoWindowWorkstationClass,
+ 0, rlist, ierr)
endif
C
C Open PS workstation.
C
if (wks_type.eq."oldps".or.wks_type.eq."OLDPS") then
call NhlFRLClear (rlist)
call NhlFRLSetString (rlist, 'wkPSFileName',
+ 'xy17f.ps', ierr)
call NhlFCreate (wks, 'xy17Work', NhlFPSWorkstationClass,
+ 0, rlist, ierr)
endif
C
C Open PDF workstation.
C
if (wks_type.eq."oldpdf".or.wks_type.eq."OLDPDF") then
call NhlFRLClear (rlist)
call NhlFRLSetString (rlist, 'wkPDFFileName',
+ 'xy17f.pdf', ierr)
call NhlFCreate (wks, 'xy17Work', NhlFPDFWorkstationClass,
+ 0, rlist, ierr)
endif
C
C Open cairo PS/PDF workstation.
C
if (wks_type.eq."pdf".or.wks_type.eq."PDF".or.
+ wks_type.eq."ps".or.wks_type.eq."PS") then
call NhlFRLClear (rlist)
call NhlFRLSetString (rlist, 'wkFileName',
+ 'xy17f', ierr)
call NhlFRLSetString (rlist, 'wkFormat',wks_type,ierr)
call NhlFCreate (wks,'xy17Work',
+ NhlFCairoPSPDFWorkstationClass,
+ 0, rlist, ierr)
endif
C
C Open cairo PNG workstation.
C
if (wks_type.eq."png".or.wks_type.eq."PNG") then
call NhlFRLClear (rlist)
call NhlFRLSetString (rlist, 'wkFileName',
+ 'xy17f', ierr)
call NhlFRLSetString (rlist, 'wkFormat',wks_type,ierr)
call NhlFCreate (wks,'xy17Work',
+ NhlFCairoImageWorkstationClass,
+ 0, rlist, ierr)
endif
C
C Create a coordarrays data object and configure its extents missing
C values and at the same time convert it from Degrees K to Degrees F
C
call NhlFRLClear (rlist)
call NhlFRLSetFloatArray (rlist, 'caXArray', lon, npts, ierr)
call NhlFRLSetFloatArray (rlist, 'caYArray', t, npts, ierr)
call NhlFCreate (field1, 'field1', NhlFcoordArraysClass, appid,
+ rlist, ierr)
C
C Create a coordarrays data object and configure its extents missing
C values and at the same time convert it from Degrees K to Degrees F
C
call NhlFRLClear (rlist)
call NhlFRLSetFloatArray (rlist, 'caXArray', lon, npts, ierr)
call NhlFRLSetFloatArray (rlist, 'caYArray', u, npts, ierr)
call NhlFCreate (field2, 'field2', NhlFcoordArraysClass, appid,
+ rlist, ierr)
C
C Create a coordarrays data object and configure its extents missing
C values and at the same time convert it from Degrees K to Degrees F
C
call NhlFRLClear (rlist)
call NhlFRLSetFloatArray (rlist, 'caXArray', lon, npts, ierr)
call NhlFRLSetFloatArray (rlist, 'caYArray', v, npts, ierr)
call NhlFCreate (field3, 'field3', NhlFcoordArraysClass, appid,
+ rlist, ierr)
C
C Create XyPlot object for curve 1 and assign data to it
C
call NhlFRLClear (rlist)
call NhlFRLSetFloat (rlist, 'vpXF', 0.20, ierr)
call NhlFRLSetFloat (rlist, 'vpYF', 0.80, ierr)
call NhlFRLSetFloat (rlist, 'vpWidthF', 0.6, ierr)
call NhlFRLSetFloat (rlist, 'vpHeightF', 0.2, ierr)
call NhlFRLSetInteger (rlist, 'xyCoordData', field1, ierr)
call NhlFRLSetString (rlist, 'trYReverse', 'False', ierr)
call NhlFRLSetFloat (rlist, 'trYMaxF', -50.0, ierr)
call NhlFRLSetFloat (rlist, 'trYMinF', -90.0, ierr)
call NhlFRLSetFloat (rlist, 'trXMaxF', 360.0, ierr)
call NhlFRLSetFloat (rlist, 'trXMinF', 0.0, ierr)
call NhlFRLSetString (rlist, 'tmYROn', 'False', ierr)
call NhlFRLSetString (rlist, 'tmYUseLeft', 'False', ierr)
call NhlFRLSetString (rlist, 'tmXMajorGrid', 'True', ierr)
call NhlFRLSetString (rlist, 'tmXBLabelsOn', 'False', ierr)
call NhlFRLSetString (rlist, 'tmYLLabelsOn', 'True', ierr)
call NhlFRLSetFloat (rlist, 'tmYLMajorLengthF', 0.01, ierr)
call NhlFRLSetFloat (rlist, 'tmYLMajorOutwardLengthF',
+ 0.0,ierr)
call NhlFRLSetString (rlist, 'tmYLMode', 'Explicit', ierr)
call NhlFRLSetFloatArray (rlist, 'tmYLValues', y1val, 5, ierr)
call NhlFRLSetStringArray (rlist, 'tmYLLabels', y1lab, 5, ierr)
call NhlFRLSetString (rlist, 'tmYLLabelsOn', 'True', ierr)
call NhlFRLSetString (rlist, 'tmYLLabelFontColor','red', ierr)
call NhlFRLSetString (rlist, 'tiMainString',
+ 'Temperature, U, V Stacked Plots', ierr)
call NhlFRLSetString (rlist, 'tiYAxisString',
+ 'Temp (Deg C)', ierr)
call NhlFRLSetFloat (rlist, 'tiXAxisFontHeightF', 0.02, ierr)
call NhlFRLSetFloat (rlist, 'tiYAxisFontHeightF', 0.02, ierr)
call NhlFRLSetString (rlist, 'tiXAxisFont',
+ 'helvetica-bold', ierr)
call NhlFRLSetString (rlist, 'tiYAxisFont',
+ 'helvetica-bold', ierr)
call NhlFRLSetString (rlist, 'tiYAxisFontColor','red', ierr)
call NhlFRLSetString (rlist, 'tmYRMinorOn', 'False', ierr)
call NhlFRLSetString (rlist, 'tmYLMinorOn', 'False', ierr)
call NhlFCreate(xy1, 'xy1', NhlFxyPlotClass, wks, rlist, ierr)
C
C Create XyPlot object for curve 2 and assign data to it
C
call NhlFRLClear (rlist)
call NhlFRLSetFloat (rlist, 'vpXF', 0.20, ierr)
call NhlFRLSetFloat (rlist, 'vpYF', 0.60, ierr)
call NhlFRLSetFloat (rlist, 'vpWidthF', 0.6, ierr)
call NhlFRLSetFloat (rlist, 'vpHeightF', 0.2, ierr)
call NhlFRLSetInteger (rlist, 'xyCoordData', field2, ierr)
call NhlFRLSetString (rlist, 'trYReverse', 'False', ierr)
call NhlFRLSetFloat (rlist, 'trYMaxF', 60.0, ierr)
call NhlFRLSetFloat (rlist, 'trYMinF', 10.0, ierr)
call NhlFRLSetFloat (rlist, 'trXMaxF', 360.0, ierr)
call NhlFRLSetFloat (rlist, 'trXMinF', 0.0, ierr)
call NhlFRLSetString (rlist, 'tmYROn', 'True', ierr)
call NhlFRLSetString (rlist, 'tmYLOn', 'False', ierr)
call NhlFRLSetString (rlist, 'tmYUseLeft', 'False', ierr)
call NhlFRLSetString (rlist, 'tmXMajorGrid', 'True', ierr)
call NhlFRLSetString (rlist, 'tmYLLabelsOn', 'False', ierr)
call NhlFRLSetString (rlist, 'tmYRLabelsOn', 'True', ierr)
call NhlFRLSetString (rlist, 'tmYRMode', 'Explicit', ierr)
call NhlFRLSetFloatArray (rlist, 'tmYRValues', y2val, 6, ierr)
call NhlFRLSetStringArray (rlist, 'tmYRLabels', y2lab, 6, ierr)
call NhlFRLSetString (rlist, 'tmXBLabelsOn', 'False', ierr)
call NhlFRLSetString (rlist, 'tmYRLabelFontColor','green', ierr)
call NhlFRLSetString (rlist, 'tiYAxisString', 'U (m/s)', ierr)
call NhlFRLSetFloat (rlist, 'tiXAxisFontHeightF', 0.02, ierr)
call NhlFRLSetFloat (rlist, 'tiYAxisFontHeightF', 0.02, ierr)
call NhlFRLSetString (rlist, 'tiXAxisFont',
+ 'helvetica-bold', ierr)
call NhlFRLSetString (rlist, 'tiYAxisFont',
+ 'helvetica-bold', ierr)
call NhlFRLSetString (rlist, 'tiYAxisFontColor','green', ierr)
call NhlFRLSetString (rlist, 'tmYRMinorOn', 'False', ierr)
call NhlFRLSetString (rlist, 'tmYLMinorOn', 'False', ierr)
call NhlFCreate(xy2, 'xy2', NhlFxyPlotClass, wks, rlist, ierr)
C
C Create XyPlot object for curve 3 and assign data to it
C
C Increase the veiwport so the right scale will be about .15 NDC
C right of the other grids. Plot only the right vertical axis.
C .5NDC = 360 deg lon, thus .65NDC = 360+108 deg lon.
C
call NhlFRLClear (rlist)
call NhlFRLSetFloat (rlist,'vpXF', 0.20, ierr)
call NhlFRLSetFloat (rlist,'vpYF', 0.40, ierr)
call NhlFRLSetFloat (rlist,'vpWidthF', 0.6, ierr)
call NhlFRLSetFloat (rlist,'vpHeightF', 0.2, ierr)
call NhlFRLSetInteger (rlist,'xyCoordData', field3, ierr)
call NhlFRLSetString (rlist,'trYReverse', 'False', ierr)
call NhlFRLSetFloat (rlist,'trYMaxF', 20.0, ierr)
call NhlFRLSetFloat (rlist,'trYMinF', -20.0, ierr)
call NhlFRLSetFloat (rlist,'trXMaxF', 360.0, ierr)
call NhlFRLSetFloat (rlist,'trXMinF', 0.0, ierr)
call NhlFRLSetString (rlist,'tmYROn', 'False', ierr)
call NhlFRLSetString (rlist,'tmYUseLeft', 'False', ierr)
call NhlFRLSetString (rlist,'tmYLLabelsOn', 'True', ierr)
call NhlFRLSetString (rlist,'tmXBLabelsOn', 'True', ierr)
call NhlFRLSetString (rlist,'tmXMajorGrid', 'True', ierr)
call NhlFRLSetFloat (rlist,'tmYLMajorLengthF',0.01,ierr)
call NhlFRLSetFloat (rlist,'tmYLMajorOutwardLengthF',
+ 0.0, ierr)
call NhlFRLSetString (rlist,'tmYLMode', 'Explicit', ierr)
call NhlFRLSetString (rlist,'tmYLLabelsOn', 'True', ierr)
call NhlFRLSetString (rlist,'tmYLLabelFontColor','blue', ierr)
call NhlFRLSetString (rlist,'tiYAxisString','V (m/s)',ierr)
call NhlFRLSetString (rlist,'tiXAxisString',
+ 'Longitude (Degs)', ierr)
call NhlFRLSetFloat (rlist,'tiXAxisFontHeightF',0.02,ierr)
call NhlFRLSetFloat (rlist,'tiYAxisFontHeightF',0.02,ierr)
call NhlFRLSetString (rlist,'tiXAxisFont','helvetica-bold',
+ ierr)
call NhlFRLSetString (rlist,'tiYAxisFont','helvetica-bold',
+ ierr)
call NhlFRLSetString (rlist,'tiYAxisFontColor','blue', ierr)
call NhlFRLSetString (rlist,'tmYRMinorOn', 'False', ierr)
call NhlFRLSetString (rlist,'tmYLMinorOn', 'False', ierr)
call NhlFRLSetFloatArray (rlist,'tmYLValues',y3val,5,ierr)
call NhlFRLSetStringArray (rlist,'tmYLLabels',y3lab,5,ierr)
call NhlFCreate(xy3,'xy3',NhlFxyPlotClass,wks,rlist,ierr)
call NhlFRLCreate (grlist,'getrl')
call NhlFRLClear (grlist)
call NhlFRLGetIntegerArray(grlist, 'xyCoordDataSpec', dspec,
+ num_dspec, ierr)
call NhlFGetValues(xy1, grlist, ierr)
call NhlFRLClear (rlist)
call NhlFRLSetString (rlist, 'xyMonoLineColor', 'True', ierr)
call NhlFRLSetString (rlist, 'xyLineColor','red', ierr)
call NhlFSetValues (dspec, rlist, ierr)
call NhlFRLClear (grlist)
call NhlFRLGetIntegerArray(grlist, 'xyCoordDataSpec', dspec,
+ num_dspec, ierr)
call NhlFGetValues(xy2, grlist, ierr)
call NhlFRLClear (rlist)
call NhlFRLSetString (rlist, 'xyMonoLineColor', 'True', ierr)
call NhlFRLSetString (rlist, 'xyLineColor','green', ierr)
call NhlFSetValues (dspec, rlist, ierr)
call NhlFRLClear (grlist)
call NhlFRLGetIntegerArray (grlist, 'xyCoordDataSpec', dspec,
+ num_dspec, ierr)
call NhlFGetValues(xy3, grlist, ierr)
call NhlFRLClear (rlist)
call NhlFRLSetString (rlist, 'xyMonoLineColor', 'True', ierr)
call NhlFRLSetString (rlist, 'xyLineColor', 'blue', ierr)
call NhlFSetValues (dspec, rlist, ierr)
call NhlFDraw(xy1, ierr)
call NhlFDraw(xy2, ierr)
call NhlFDraw(xy3, ierr)
call NhlFFrame(wks, ierr)
call NhlFDestroy (wks, ierr)
call NhlFClose
stop
105 write (6,*) 'error in opening file xy.asc'
end
|