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