|
1 ; *********************************************** |
|
2 ; xy_4.ncl |
|
3 ; *********************************************** |
|
4 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" |
|
5 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" |
|
6 ;************************************************ |
|
7 begin |
|
8 ;************************************************ |
|
9 ; read in data |
|
10 ;************************************************ |
|
11 g = addfile ("data.81.nc","r") |
|
12 ;g = addfile ("data.933.nc","r") |
|
13 a = g->SITE_ID ; get ob data |
|
14 xo = g->LONG_DD ; get ob data |
|
15 yo = g->LAT_DD ; get ob data |
|
16 |
|
17 print (xo) |
|
18 nx = dimsizes(xo) |
|
19 do i= 0,nx-1 |
|
20 if (xo(i) .lt. 0.) then |
|
21 xo(i) = xo(i)+ 360. |
|
22 end if |
|
23 end do |
|
24 print (xo) |
|
25 |
|
26 a@long_name = "SITE_ID" |
|
27 |
|
28 ;f = addfile ("i01.03cn_1545-1569_ANN_climo.nc","r") |
|
29 f = addfile ("i01.04casa_1605-1629_ANN_climo.nc","r") |
|
30 b = f->NPP ; get model data |
|
31 xi = f->lon ; get model data |
|
32 yi = f->lat ; get model data |
|
33 |
|
34 sec_to_year = 86400.*365. |
|
35 |
|
36 bo = linint2_points(xi,yi,b,True,xo,yo,0) * sec_to_year |
|
37 print (bo) |
|
38 |
|
39 bo@long_name = "NPP (gC/m2/year)" |
|
40 |
|
41 ;************************************************ |
|
42 ; plotting parameters |
|
43 ;************************************************ |
|
44 ;wks = gsn_open_wks ("ps","xy") ; open workstation |
|
45 wks = gsn_open_wks ("png","xy") |
|
46 |
|
47 res = True ; plot mods desired |
|
48 ;res@tiMainString = "Model i01.03cn 81 sites" ; add title |
|
49 ;res@tiMainString = "Model i01.03cn 933 sites" ; add title |
|
50 res@tiMainString = "Model i01.04casa 81 sites" ; add title |
|
51 ;res@tiMainString = "Model i01.04casa 933 sites" ; add title |
|
52 res@xyMarkLineModes = "Markers" ; choose which have markers |
|
53 res@xyMarkers = 16 ; choose type of marker |
|
54 res@xyMarkerColor = "red" ; Marker color |
|
55 res@xyMarkerSizeF = 0.01 ; Marker size (default 0.01) |
|
56 |
|
57 res@tmLabelAutoStride = True ; nice tick mark labels |
|
58 |
|
59 ;plot = gsn_csm_xy (wks,t&nvalues,t(:),res) ; create plot |
|
60 plot = gsn_csm_xy (wks,a,bo,res) ; create plot |
|
61 |
|
62 ;************************************************ |
|
63 ; now create our own markers using NhlNewMarker |
|
64 ; available since ncl version 4.2.0.a030 |
|
65 ;************************************************ |
|
66 ; this example will create filled squares. You will have to play with |
|
67 ; the numbers a but to get the size and shape you desire. On the |
|
68 ; documentation page for NhlNewMarker, there is a table of values for |
|
69 ; the current marker set, to give you an idea of where to start. |
|
70 |
|
71 ; res@xyMarkerColor = "blue" |
|
72 ; res@tiMainString = "Make your own marker" |
|
73 ; res@xyMarkers = NhlNewMarker(wks, "^", 19, 0.0, 0.0, 1.3125, 1.5, 0.0) |
|
74 ; plot = gsn_csm_xy (wks,a,bo,res) |
|
75 |
|
76 end |