lai/31.contour_model.ncl
author Forrest Hoffman <forrest@climatemodeling.org>
Mon, 26 Jan 2009 22:08:20 -0500
changeset 0 0c6405ab2ff4
permissions -rw-r--r--
Initial commit of C-LAMP Diagnostics from Jeff Lee
forrest@0
     1
;*************************************************
forrest@0
     2
; ce_1.ncl
forrest@0
     3
;************************************************
forrest@0
     4
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"  
forrest@0
     5
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"  
forrest@0
     6
;************************************************
forrest@0
     7
begin
forrest@0
     8
;************************************************
forrest@0
     9
; read in model data
forrest@0
    10
;************************************************
forrest@0
    11
  diri  = "/fis/cgd/cseg/people/jeff/clamp_data/"
forrest@0
    12
  fili  = "i01.03cn_1545-1569_ANN_climo.nc"
forrest@0
    13
; fili  = "i01.04casa_1605-1629_ANN_climo.nc"
forrest@0
    14
forrest@0
    15
  g     = addfile(diri+fili,"r")
forrest@0
    16
  x     = g->TLAI
forrest@0
    17
  print (max(x))
forrest@0
    18
  print (min(x))
forrest@0
    19
forrest@0
    20
;************************************************
forrest@0
    21
; create default plot
forrest@0
    22
;************************************************
forrest@0
    23
forrest@0
    24
  wks = gsn_open_wks("ps","xy")         ; open a ps file
forrest@0
    25
; gsn_define_colormap(wks,"wgne15")          ; choose colormap
forrest@0
    26
  gsn_define_colormap(wks,"gui_default")     ; choose colormap
forrest@0
    27
forrest@0
    28
  res                     = True             ; Use plot options
forrest@0
    29
  res@cnFillOn            = True             ; Turn on color fill
forrest@0
    30
  res@gsnSpreadColors      = True            ; use full colormap
forrest@0
    31
; res@cnFillMode          = "RasterFill"     ; Turn on raster color
forrest@0
    32
; res@lbLabelAutoStride   = True
forrest@0
    33
  res@cnLinesOn           = False            ; Turn off contourn lines
forrest@0
    34
  res@mpFillOn            = False            ; Turn off map fill
forrest@0
    35
; res@tiMainString        = "Observed MODIS MOD 15A2"
forrest@0
    36
  res@tiMainString        = "Model i01.03cn"
forrest@0
    37
; res@tiMainString        = "Model i01.04casa"
forrest@0
    38
forrest@0
    39
  res@gsnSpreadColors     = True             ; use full colormap
forrest@0
    40
  res@cnLevelSelectionMode = "ManualLevels"    ; Manual contour invtervals
forrest@0
    41
  res@cnMinLevelValF       = 0.                ; Min level
forrest@0
    42
  res@cnMaxLevelValF       = 10.             ; Max level
forrest@0
    43
  res@cnLevelSpacingF      = 1.              ; interval
forrest@0
    44
forrest@0
    45
  plot = gsn_csm_contour_map_ce(wks,x(0,:,:),res)         ; for model
forrest@0
    46
  system("convert xy.ps xy.png")
forrest@0
    47
end