1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/npp/12.scatter.linint2_points.ncl Mon Jan 26 22:08:20 2009 -0500
1.3 @@ -0,0 +1,76 @@
1.4 +; ***********************************************
1.5 +; xy_4.ncl
1.6 +; ***********************************************
1.7 +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
1.8 +load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
1.9 +;************************************************
1.10 +begin
1.11 +;************************************************
1.12 +; read in data
1.13 +;************************************************
1.14 + g = addfile ("data.81.nc","r")
1.15 +;g = addfile ("data.933.nc","r")
1.16 + a = g->SITE_ID ; get ob data
1.17 + xo = g->LONG_DD ; get ob data
1.18 + yo = g->LAT_DD ; get ob data
1.19 +
1.20 + print (xo)
1.21 + nx = dimsizes(xo)
1.22 + do i= 0,nx-1
1.23 + if (xo(i) .lt. 0.) then
1.24 + xo(i) = xo(i)+ 360.
1.25 + end if
1.26 + end do
1.27 + print (xo)
1.28 +
1.29 + a@long_name = "SITE_ID"
1.30 +
1.31 +;f = addfile ("i01.03cn_1545-1569_ANN_climo.nc","r")
1.32 + f = addfile ("i01.04casa_1605-1629_ANN_climo.nc","r")
1.33 + b = f->NPP ; get model data
1.34 + xi = f->lon ; get model data
1.35 + yi = f->lat ; get model data
1.36 +
1.37 + sec_to_year = 86400.*365.
1.38 +
1.39 + bo = linint2_points(xi,yi,b,True,xo,yo,0) * sec_to_year
1.40 + print (bo)
1.41 +
1.42 + bo@long_name = "NPP (gC/m2/year)"
1.43 +
1.44 +;************************************************
1.45 +; plotting parameters
1.46 +;************************************************
1.47 +;wks = gsn_open_wks ("ps","xy") ; open workstation
1.48 + wks = gsn_open_wks ("png","xy")
1.49 +
1.50 + res = True ; plot mods desired
1.51 +;res@tiMainString = "Model i01.03cn 81 sites" ; add title
1.52 +;res@tiMainString = "Model i01.03cn 933 sites" ; add title
1.53 + res@tiMainString = "Model i01.04casa 81 sites" ; add title
1.54 +;res@tiMainString = "Model i01.04casa 933 sites" ; add title
1.55 + res@xyMarkLineModes = "Markers" ; choose which have markers
1.56 + res@xyMarkers = 16 ; choose type of marker
1.57 + res@xyMarkerColor = "red" ; Marker color
1.58 + res@xyMarkerSizeF = 0.01 ; Marker size (default 0.01)
1.59 +
1.60 + res@tmLabelAutoStride = True ; nice tick mark labels
1.61 +
1.62 +;plot = gsn_csm_xy (wks,t&nvalues,t(:),res) ; create plot
1.63 + plot = gsn_csm_xy (wks,a,bo,res) ; create plot
1.64 +
1.65 +;************************************************
1.66 +; now create our own markers using NhlNewMarker
1.67 +; available since ncl version 4.2.0.a030
1.68 +;************************************************
1.69 +; this example will create filled squares. You will have to play with
1.70 +; the numbers a but to get the size and shape you desire. On the
1.71 +; documentation page for NhlNewMarker, there is a table of values for
1.72 +; the current marker set, to give you an idea of where to start.
1.73 +
1.74 +; res@xyMarkerColor = "blue"
1.75 +; res@tiMainString = "Make your own marker"
1.76 +; res@xyMarkers = NhlNewMarker(wks, "^", 19, 0.0, 0.0, 1.3125, 1.5, 0.0)
1.77 +; plot = gsn_csm_xy (wks,a,bo,res)
1.78 +
1.79 +end