/usr/share/ncarg/nclex/contourplot/cn08n.ncl is in libncarg-data 6.1.2-7.
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 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; Copyright (C) 1995 ;
; University Corporation for Atmospheric Research ;
; All Rights Reserved ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; File: cn08n.ncl
;
; Author: Ethan Alpert
; National Center for Atmospheric Research
; PO 3000, Boulder, Colorado
;
; Converted to NCL by Ed Stautler
;
; Date: Fri Apr 28 11:47:03 MDT 1995
;
; Description: draws a vertical profile of temperature for longitudes
; separated by 5 degrees
;
begin
;
; Open data file containing grid of global temperatures.
;
filedir = ncargpath("data")
filename = filedir + "/cdf/contour.cdf"
a = addfile(filename,"r")
;
; set color table
;
cmap = (/ (/0.0, 0.0, 0.0/), \
(/1.0, 1.0, 1.0/), \
(/0.0, 0.0, 0.0/), \
(/1.0, 0.0, 0.0/), \
(/0.0, 1.0, 0.0/), \
(/0.0, 0.0, 1.0/), \
(/1.0, 1.0, 0.0/), \
(/0.0, 1.0, 1.0/), \
(/1.0, 0.0, 1.0/), \
(/0.5, 0.0, 0.0/), \
(/0.5, 1.0, 1.0/), \
(/0.0, 0.0, 0.5/), \
(/1.0, 1.0, 0.5/), \
(/0.5, 0.0, 1.0/), \
(/1.0, 0.5, 0.0/), \
(/0.0, 0.5, 1.0/), \
(/0.5, 1.0, 0.0/), \
(/0.5, 0.0, 0.5/), \
(/0.5, 1.0, 0.5/), \
(/1.0, 0.5, 1.0/), \
(/0.0, 0.5, 0.0/), \
(/0.5, 0.5, 1.0/), \
(/1.0, 0.0, 0.5/) /)
wks_type = "ncgm"
if (str_lower(wks_type).eq."ncgm")
;
; Open NCGM workstation.
;
wks = create "cn08Work" ncgmWorkstationClass defaultapp
"wkMetaName" : "cn08n.ncgm"
"wkColorMap" : cmap
end create
end if
if (str_lower(wks_type).eq."x11") then
;
; Create an X workstation.
;
wks = create "cn08Work" windowWorkstationClass defaultapp
"wkPause" : True
"wkColorMap" : cmap
end create
end if
if (str_lower(wks_type).eq."oldps") then
;
; Open PS workstation.
;
wks = create "cn08Work" psWorkstationClass defaultapp
"wkPSFileName" : "cn08n.ps"
"wkColorMap" : cmap
end create
end if
if (str_lower(wks_type).eq."oldpdf") then
;
; Open PDF workstation.
;
wks = create "cn08Work" pdfWorkstationClass defaultapp
"wkPDFFileName" : "cn08n.pdf"
"wkColorMap" : cmap
end create
end if
if (str_lower(wks_type).eq."pdf".or.str_lower(wks_type).eq."ps") then
;
; Open cairo PS/PDF workstation.
;
wks = create "cn08Work" documentWorkstationClass defaultapp
"wkFileName" : "cn08n"
"wkFormat" : wks_type
"wkColorMap" : cmap
end create
end if
if (str_lower(wks_type).eq."png") then
;
; Open cairo PNG workstation.
;
wks = create "cn08Work" imageWorkstationClass defaultapp
"wkFileName" : "cn08n"
"wkFormat" : wks_type
"wkColorMap" : cmap
end create
end if
;
; Set up initial scalar field with longitude of
; temperature data. Data is also converted to
; Degrees F from Degrees K before being assigned to
; sfDataArray resource
;
field1 = create "field1" scalarFieldClass defaultapp
"sfDataArray" : (a->T(0,:,:,0) - 273.15) * 9 / 5 + 32.0
"sfMissingValueV": a->T@_FillValue
"sfXArray" : a->lat
"sfYArray" : a->level
end create
;
; Determine extents of grid
;
lat = a->lat
min_lat = min(lat)
max_lat = max(lat)
level = a->level
min_level = min(level)
max_level = max(level)
;
; Create contour using manual spacing.
;
con1 = create "con1" contourPlotClass wks
"vpXF": .2
"vpYF": .8
"vpWidthF" : .6
"vpHeightF" : .6
"cnFillOn" : True
"cnScalarFieldData" : field1
"cnLevelSelectionMode" : "ManualLevels"
"cnMaxLevelCount" : 25
"cnMinLevelValF" : -80.0
"cnMaxLevelValF" : 110.0
"cnLevelSpacingF" : 10.0
"trXMinF" : min_lat
"trXMaxF" : max_lat
"trYMinF" : min_level
"trYMaxF" : max_level
"trYReverse" : True
"tiMainString" : "Longitude " + a->lon(0) + " Degrees"
end create
;
; Draw first step
;
draw(con1)
frame(wks)
;
; Loop on remaining longitude values and reset the title every iteration
;
do i = 1, filevardimsizes(a,"lon") - 1
setvalues field1
"sfDataArray" : (a->T(0,:,:,i) - 273.15) * 9 / 5 + 32.0
end setvalues
setvalues con1
"tiMainString" : "Longitude " + a->lon(i) + " Degrees"
end setvalues
draw(con1)
frame(wks)
end do
delete(con1)
delete(field1)
delete(wks)
end
|