forrest@0: ; *********************************************** forrest@0: ; xy_4.ncl forrest@0: ; *********************************************** forrest@0: load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" forrest@0: load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" forrest@0: ;************************************************ forrest@0: begin forrest@0: ;************************************************ forrest@0: ; read in data forrest@0: ;************************************************ forrest@0: g = addfile ("data.81.nc","r") forrest@0: ;g = addfile ("data.933.nc","r") forrest@0: a = g->SITE_ID ; get ob data forrest@0: xo = g->LONG_DD ; get ob data forrest@0: yo = g->LAT_DD ; get ob data forrest@0: forrest@0: print (xo) forrest@0: nx = dimsizes(xo) forrest@0: do i= 0,nx-1 forrest@0: if (xo(i) .lt. 0.) then forrest@0: xo(i) = xo(i)+ 360. forrest@0: end if forrest@0: end do forrest@0: print (xo) forrest@0: forrest@0: a@long_name = "SITE_ID" forrest@0: forrest@0: ;f = addfile ("i01.03cn_1545-1569_ANN_climo.nc","r") forrest@0: f = addfile ("i01.04casa_1605-1629_ANN_climo.nc","r") forrest@0: b = f->NPP ; get model data forrest@0: xi = f->lon ; get model data forrest@0: yi = f->lat ; get model data forrest@0: forrest@0: sec_to_year = 86400.*365. forrest@0: forrest@0: bo = linint2_points(xi,yi,b,True,xo,yo,0) * sec_to_year forrest@0: print (bo) forrest@0: forrest@0: bo@long_name = "NPP (gC/m2/year)" forrest@0: forrest@0: ;************************************************ forrest@0: ; plotting parameters forrest@0: ;************************************************ forrest@0: ;wks = gsn_open_wks ("ps","xy") ; open workstation forrest@0: wks = gsn_open_wks ("png","xy") forrest@0: forrest@0: res = True ; plot mods desired forrest@0: ;res@tiMainString = "Model i01.03cn 81 sites" ; add title forrest@0: ;res@tiMainString = "Model i01.03cn 933 sites" ; add title forrest@0: res@tiMainString = "Model i01.04casa 81 sites" ; add title forrest@0: ;res@tiMainString = "Model i01.04casa 933 sites" ; add title forrest@0: res@xyMarkLineModes = "Markers" ; choose which have markers forrest@0: res@xyMarkers = 16 ; choose type of marker forrest@0: res@xyMarkerColor = "red" ; Marker color forrest@0: res@xyMarkerSizeF = 0.01 ; Marker size (default 0.01) forrest@0: forrest@0: res@tmLabelAutoStride = True ; nice tick mark labels forrest@0: forrest@0: ;plot = gsn_csm_xy (wks,t&nvalues,t(:),res) ; create plot forrest@0: plot = gsn_csm_xy (wks,a,bo,res) ; create plot forrest@0: forrest@0: ;************************************************ forrest@0: ; now create our own markers using NhlNewMarker forrest@0: ; available since ncl version 4.2.0.a030 forrest@0: ;************************************************ forrest@0: ; this example will create filled squares. You will have to play with forrest@0: ; the numbers a but to get the size and shape you desire. On the forrest@0: ; documentation page for NhlNewMarker, there is a table of values for forrest@0: ; the current marker set, to give you an idea of where to start. forrest@0: forrest@0: ; res@xyMarkerColor = "blue" forrest@0: ; res@tiMainString = "Make your own marker" forrest@0: ; res@xyMarkers = NhlNewMarker(wks, "^", 19, 0.0, 0.0, 1.3125, 1.5, 0.0) forrest@0: ; plot = gsn_csm_xy (wks,a,bo,res) forrest@0: forrest@0: end