forked from NOAA-PSL/ncl_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsstslpYearly.ncl
More file actions
executable file
·71 lines (59 loc) · 2.8 KB
/
sstslpYearly.ncl
File metadata and controls
executable file
·71 lines (59 loc) · 2.8 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
sst_file = addfile("sst.mnmean.nc","r")
SSTshort = sst_file->sst
sst = SSTshort@scale_factor * tofloat(SSTshort)
copy_VarAtts(SSTshort, sst)
copy_VarCoords(SSTshort, sst)
slp_file = addfile("slp.mon.mean.nc","r")
slp = slp_file->slp
dims = dimsizes(slp)
;=================================================;
month_names = (/"January", "Febrary", "March", \
"April", "May", "June", \
"July", "August", "September", \
"October", "November", "December"/)
;************************************************
;pixel = 2048
pixel = 1024
wks_type = "x11"
wks_type@wkWidth = pixel
wks_type@wkHeight = pixel
wks = gsn_open_wks(wks_type,"sst_slp")
res = True
res@mpFillOn = False
res@mpOutlineOn = True ; turn the map outline on
res@gsnDraw = False ; do not draw the plot
res@gsnFrame = False ; do not advance the frame
res@cnLevelSelectionMode = "ExplicitLevels" ; use explicit levels
res@cnLevels = fspan(-10, 36, 24)
;res@cnLevels = (/-10.0, -8.0, -6.0, -4.0, -2.0, -1.0, -0.5, 0.0, \
; 0.5, 1.0, 2.0, 4.0, 6.0, 8.0, 10.0/)
res@cnLineLabelsOn = False ; do not use line labels
res@cnFillOn = True ; color fill
res@cnLinesOn = False ; do not draw contour lines
res@cnFillPalette = "BlueDarkRed18"
res@tiMainString = "T/U @500hPa" ; set the main title
sres = True ; set up a second resource list
sres@gsnDraw = False ; do not draw the plot
sres@gsnFrame = False ; do not advance the frame
sres@cnLevelSelectionMode = "ExplicitLevels" ; use explicit levels
sres@cnLevels = fspan(980.0, 1040.0, 31) ; set the contour levels
;sres@cnLevels = (/-40.0, -30.0, -20.0, -15.0, -10.0, -8.0, -6.0, -4.0, -2.0, -1.0, 0.0, \
; 1.0, 2.0, 4.0, 6.0, 8.0, 10.0, 15.0, 20.0, 30.0, 40.0/)
sres@cnFillOn = False
sres@cnLinesOn = True
sres@mpFillOn = False
sres@mpOutlineOn = True ; turn the map outline on
;sres@cnLevelSelectionMode = "ManualLevels" ; manual contour levels
;sres@cnMinLevelValF = -4
;sres@cnMaxLevelValF = 4
;sres@cnLevelSpacingF = 0.25
sres@gsnContourZeroLineThicknessF = 0 ; eliminates zero contour
sres@gsnContourNegLineDashPattern = 1 ; sets negative contours to dash pattern 1
sst_ya = dim_avg_n_Wrap(sst,0)
slp_ya = dim_avg_n_Wrap(slp,0)
res@tiMainString = "Yearly Avg SST and SLP"
plot = gsn_csm_contour_map(wks, sst_ya, res)
plot_ov = gsn_csm_contour_map(wks, slp_ya, sres)
draw(plot)
draw(plot_ov)
frame(wks)