co2/31.contour_model.ncl
author Forrest Hoffman <forrest@climatemodeling.org>
Thu, 26 Mar 2009 14:02:21 -0400
changeset 1 4be95183fbcd
permissions -rw-r--r--
Modifications to scoring and graphics production for the final version of code for the C-LAMP paper in GCB.
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/model/"
forrest@0
    12
  fili  = "b30.061m_401_425_ANN_climo.nc"
forrest@0
    13
forrest@0
    14
  g     = addfile(diri+fili,"r")
forrest@0
    15
  x     = g->CO2
forrest@0
    16
  xdim  = dimsizes(x)
forrest@0
    17
  nlev  = xdim(1)
forrest@0
    18
  y0    = x(0,0,:,:)
forrest@0
    19
  
forrest@0
    20
; get the co2 at the lowest level
forrest@0
    21
  y0    = x(0,nlev-1,:,:)
forrest@0
    22
forrest@0
    23
; change to unit of observed (u mol/mol)
forrest@0
    24
; Model_units [=] kgCO2 / kgDryAir
forrest@0
    25
; 28.966 = molecular weight of dry air
forrest@0
    26
; 44.       = molecular weight of CO2
forrest@0
    27
; u mol = 1e-6 mol
forrest@0
    28
forrest@0
    29
  factor = (28.966/44.) * 1e6
forrest@0
    30
  y0     = y0 * factor
forrest@0
    31
forrest@0
    32
  y0@_FillValue = 1.e36
forrest@0
    33
  y0@units      = "u mol/mol"
forrest@0
    34
; y0 = where(y0 .lt. 287.,y0@_FillValue,y0)
forrest@0
    35
  print (min(y0)+"/"+max(y0))
forrest@0
    36
forrest@0
    37
;************************************************
forrest@0
    38
; create default plot
forrest@0
    39
;************************************************
forrest@0
    40
forrest@0
    41
  wks = gsn_open_wks("ps","xy")              ; open a ps file
forrest@0
    42
  gsn_define_colormap(wks,"gui_default")     ; choose colormap
forrest@0
    43
forrest@0
    44
  res                     = True             ; Use plot options
forrest@0
    45
  res@cnFillOn            = True             ; Turn on color fill
forrest@0
    46
  res@gsnSpreadColors      = True            ; use full colormap
forrest@0
    47
; res@cnFillMode          = "RasterFill"     ; Turn on raster color
forrest@0
    48
; res@lbLabelAutoStride   = True
forrest@0
    49
  res@cnLinesOn           = False            ; Turn off contourn lines
forrest@0
    50
  res@mpFillOn            = False            ; Turn off map fill
forrest@0
    51
  res@tiMainString        = "Model b30.061m 401-425"
forrest@0
    52
forrest@0
    53
  res@gsnSpreadColors     = True             ; use full colormap
forrest@0
    54
  res@cnLevelSelectionMode = "ManualLevels"  ; Manual contour invtervals
forrest@0
    55
  res@cnMinLevelValF       = 286.            ; Min level
forrest@0
    56
  res@cnMaxLevelValF       = 310.            ; Max level
forrest@0
    57
  res@cnLevelSpacingF      = 2.              ; interval
forrest@0
    58
forrest@0
    59
  plot = gsn_csm_contour_map_ce(wks,y0,res)         ; for model
forrest@0
    60
  system("convert xy.ps xy.png")
forrest@0
    61
end