-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplotsst.ncl
More file actions
executable file
·52 lines (42 loc) · 1.76 KB
/
plotsst.ncl
File metadata and controls
executable file
·52 lines (42 loc) · 1.76 KB
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
; This file still has to be loaded manually
;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
;************************************************
; Read the file
;************************************************
in = addfile("sst.mnmean.nc","r")
TS = in->sst
sst = TS@scale_factor * tofloat(TS)
copy_VarAtts(TS, sst)
copy_VarCoords(TS, sst)
dims = dimsizes(sst)
;************************************************
; create plot
;************************************************
pixel = 2048
wks_type = "x11"
wks_type@wkWidth = pixel
wks_type@wkHeight = pixel
wks = gsn_open_wks(wks_type,"sst")
res = True ; plot mods desired
res@tiMainString = "Explicit Contour Levels"
res@cnFillOn = True ; turn on color fill
res@cnFillPalette = "gui_default" ; set color map
res@cnLinesOn = False ; turn off contour lines
res@gsnAddCyclic = True
;res@lbOrientation = "vertical" ; vertical label bars
res@cnLevelSelectionMode = "ExplicitLevels" ; set explicit contour levels
;res@cnLevels = (/232.7,234.2,238,240,244,248.4,252,258.3,276,286.5,292.1,300,306/)
res@cnLevels = (/-2.0, -1.0, 0.0, 5.0, 10.0, 15.0, 20.0, \
25.0, 28.0, 29.0, 30.0, 30.5, 31.0/)
;res@mpFillOn = False ; turn off gray continents
res@mpCenterLonF = 180 ; Centers the plot at 180
do n = 0, 11
m = n + 1
if(0 .eq. mod(m, 12)) then
res@tiMainString = "Monthly SST: 12"
else
res@tiMainString = "Monthly SST: " + mod(m, 12)
end if
sst_mn = dim_avg_n_Wrap(sst(n::12, :, :),0)
plot = gsn_csm_contour_map(wks, sst_mn, res) ; create plot
end do