Re: sample script

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue, 26 Feb 2008 13:48:53 -0700

The "Applications" page has many examples. This looks like a variation
of a WRF model output.
Please make an effort ...

;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"

begin

      f = addfile ("foo.nc", "r")
      time = f->time

      x = f->Whatever
      lat2d = f->XLAT(0,:,:)
     lon2d = f->XLONG(0,:,:)

  dimll = dimsizes(lat2d) ; get size of dimensions
  nlat = dimll(0)
  mlon = dimll(1)

;************************************************
; create lambert conformal plots
;************************************************
  wks = gsn_open_wks("ps" ,"WRF_lc") ; ps,pdf,x11,ncgm,eps
  gsn_define_colormap(wks,"BlAqGrYeOrReVi200") ; select color map

  res = True ; plot mods desired
  res_at_gsnMaximize = True ; uncomment to maximize size
  res_at_gsnSpreadColors = True ; use full range of colormap
  res_at_cnFillOn = True ; color plot desired
  res_at_cnLinesOn = False ; turn off contour lines
  res_at_cnLineLabelsOn = False ; turn off contour labels

  res_at_gsnAddCyclic = False ; regional data: not cyclic

  res_at_mpProjection = "LambertConformal"
  res_at_mpLambertParallel1F = f->TRUELAT1
  res_at_mpLambertParallel2F = f->TRUELAT2
  res_at_mpLambertMeridianF = f->CEN_LON
  res_at_mpLimitMode = "Corners"
  res_at_mpLeftCornerLatF = lat2d(0,0)
  res_at_mpLeftCornerLonF = lon2d(0,0)
  res_at_mpRightCornerLatF = lat2d(nlat-1,mlon-1)
  res_at_mpRightCornerLonF = lon2d(nlat-1,mlon-1)
  res_at_mpOutlineDrawOrder = "PostDraw" ; draw continental outline last
  res_at_mpFillDrawOrder = "PreDraw"
  res_at_mpOutlineBoundarySets = "GeophysicalAndUSStates" ; state boundaries
  res_at_mpFillOn = False ; turn off map fill
;************************************************
; establish title
;************************************************
  res_at_tiMainString = .....
  plot = gsn_csm_contour_map(wks, x, res)

end
Richard Anyah wrote:
> Hi,
> could anybody provide a sample ncl script that can be used for netcdf
> file, part of the ncdump output looks like this:
>
>
> time = UNLIMITED ; // (2 currently)
> StateVariable = 9978525 ;
> domain = 1 ;
> west_east_d01 = 249 ;
> west_east_stag_d01 = 250 ;
> south_north_d01 = 138 ;
> south_north_stag_d01 = 139 ;
> bottom_top_d01 = 35 ;
> bottom_top_stag_d01 = 36 ;
> soil_layers_stag_d01 = 5 ;
> variables:
> int copy(copy) ;
> copy:long_name = "ensemble member or copy" ;
> copy:units = "nondimensional" ;
> copy:valid_range = 1, 100 ;
> char CopyMetaData(copy, metadatalength) ;
> CopyMetaData:long_name = "Metadata for each copy/member" ;
> double time(time) ;
> time:long_name = "time" ;
> time:axis = "T" ;
> time:cartesian_axis = "T" ;
> time:calendar = "gregorian" ;
> time:units = "days since 1601-01-01 00:00:00" ;
> float DX(domain) ;
> DX:long_name = "X HORIZONTAL RESOLUTION" ;
> DX:units = "m" ;
> float DY(domain) ;
> DY:long_name = "Y HORIZONTAL RESOLUTION" ;
> DY:units = "m" ;
> float TRUELAT1(domain) ;
> TRUELAT1:long_name = "first standard parallel" ;
> TRUELAT1:units = "degrees, negative is south" ;
> float TRUELAT2(domain) ;
> TRUELAT2:long_name = "second standard parallel" ;
> TRUELAT2:units = "degrees, negative is south" ;
> float CEN_LAT(domain) ;
> CEN_LAT:long_name = "center latitude" ;
> CEN_LAT:units = "degrees, negative is south" ;
> float CEN_LON(domain) ;
>
>
>

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Feb 26 2008 - 13:48:53 MST

This archive was generated by hypermail 2.2.0 : Tue Feb 26 2008 - 16:44:49 MST