forrest@0: ;************************************************* forrest@0: ; ce_1.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 model data forrest@0: ;************************************************ forrest@0: diri = "/fis/cgd/cseg/people/jeff/clamp_data/model/" forrest@0: fili = "b30.061m_401_425_ANN_climo.nc" forrest@0: forrest@0: g = addfile(diri+fili,"r") forrest@0: x = g->CO2 forrest@0: xdim = dimsizes(x) forrest@0: nlev = xdim(1) forrest@0: y0 = x(0,0,:,:) forrest@0: forrest@0: ; get the co2 at the lowest level forrest@0: y0 = x(0,nlev-1,:,:) forrest@0: forrest@0: ; change to unit of observed (u mol/mol) forrest@0: ; Model_units [=] kgCO2 / kgDryAir forrest@0: ; 28.966 = molecular weight of dry air forrest@0: ; 44. = molecular weight of CO2 forrest@0: ; u mol = 1e-6 mol forrest@0: forrest@0: factor = (28.966/44.) * 1e6 forrest@0: y0 = y0 * factor forrest@0: forrest@0: y0@_FillValue = 1.e36 forrest@0: y0@units = "u mol/mol" forrest@0: ; y0 = where(y0 .lt. 287.,y0@_FillValue,y0) forrest@0: print (min(y0)+"/"+max(y0)) forrest@0: forrest@0: ;************************************************ forrest@0: ; create default plot forrest@0: ;************************************************ forrest@0: forrest@0: wks = gsn_open_wks("ps","xy") ; open a ps file forrest@0: gsn_define_colormap(wks,"gui_default") ; choose colormap forrest@0: forrest@0: res = True ; Use plot options forrest@0: res@cnFillOn = True ; Turn on color fill forrest@0: res@gsnSpreadColors = True ; use full colormap forrest@0: ; res@cnFillMode = "RasterFill" ; Turn on raster color forrest@0: ; res@lbLabelAutoStride = True forrest@0: res@cnLinesOn = False ; Turn off contourn lines forrest@0: res@mpFillOn = False ; Turn off map fill forrest@0: res@tiMainString = "Model b30.061m 401-425" forrest@0: forrest@0: res@gsnSpreadColors = True ; use full colormap forrest@0: res@cnLevelSelectionMode = "ManualLevels" ; Manual contour invtervals forrest@0: res@cnMinLevelValF = 286. ; Min level forrest@0: res@cnMaxLevelValF = 310. ; Max level forrest@0: res@cnLevelSpacingF = 2. ; interval forrest@0: forrest@0: plot = gsn_csm_contour_map_ce(wks,y0,res) ; for model forrest@0: system("convert xy.ps xy.png") forrest@0: end