-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathetopo.ncl
75 lines (54 loc) · 1.59 KB
/
etopo.ncl
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
;; topography map from etopo data.
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
begin
din = "~/DATA/terrain/"
dout = "~/fig/"
fin = "ETOPO1_Ice_g_gmt4.grd"
;; latitude values
sl = 30.
nl = 60.
;; longitude values
wl = 130.
el = 160.
f = addfile(din + fin + ".nc","r")
z = f->z
wks = gsn_open_wks("png","topo")
gsn_define_colormap(wks,"gsdtol")
;; convertion
s = (sl+90)*60
n = (nl+90)*60
w = (wl+180)*60
e = (el+180)*60
;; printVarSummary(z)
;; print("s" + s + "n" + n + "w" + w + "e" + e)
z&x@units = "degrees_east"
z&y@units = "degrees_north"
res = True ; options desired
res@gsnMaximize = True ; maximize size of plot
res@gsnLeftString = "Height in meters"
res@tiMainString = "Topographical Map of East Asian region"
res@cnFillOn = True
res@gsnSpreadColors=True
res@cnLinesOn = False
res@cnLineLabelsOn = False
res@cnLevelSelectionMode = "ManualLevels"
res@cnMinLevelValF = 0.
res@cnMaxLevelValF = 4000.
res@cnLevelSpacingF = 200.
;; lablebar
res@lbOrientation = "vertical"
res@lbLabelStride = 2
;; res@lbLabelStrings = (/0., 100., 200., 400., 800., 1600., 3200., 4000. /)
mpres = True ; Map resources
mpres@mpDataBaseVersion = "HighRes"
mpres@mpGeophysicalLineThicknessF = 2.0
mpres@mpGeophysicalLineColor = "Black"
mpres@mpLimitMode = "LatLon"
mpres@mpMinLatF = sl
mpres@mpMaxLatF = nl
mpres@mpMinLonF = wl
mpres@mpMaxLonF = el
plot = gsn_csm_contour_map(wks,z,mpres)
end