How to put lat lon grid lines on..??

From: jayakrishnan pr <jkprdas_at_nyahnyahspammersnyahnyah>
Date: Wed Apr 06 2011 - 03:15:45 MDT

Dear all,
           I herewith gives my program for plotting MODIS _07_L2 data over
Indian region. I want to plot the lat and lon grid lines also..ie minor
grids on.How to do that..?

***********************************************************************************************************************************************************************
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/csm/contributed.ncl"
;*********************************
begin
;*********************************
; Read in four MODIS HDF files
;*********************************
  f = addfile("MOD07_L2.A2010119.0525.005.2010119133253.hdf","r")
  wv1s = f->Retrieved_Temperature_Profile(0,:,:)
  wv1 = wv1s@scale_factor*1.d * (wv1s - wv1s@add_offset)

  time = doubletoint(f->Scan_Start_Time(0,0))

  gdate = ut_inv_calendar(1993,1,1,0,0,time(0),"years since 1993-01-01",0)
  date2d = ut_calendar(gdate,0)
  date = date2d(0,:)
  lat2d1 = f->Latitude
  lon2d1 = f->Longitude

  wks = gsn_open_wks("eps", "mod07")
 gsn_define_colormap(wks,"cosam12") ; define colormap

  res = True

  res@gsnMaximize = True ; maximize pot in frame
  res@gsnFrame = False ; don't advance frame
  res@gsnDraw = False ; don't draw plot

  res@cnFillOn = True ; color Fill
  res@cnFillMode = "CellFill" ; Raster Mode
  res@cnRasterSmoothingOn = True
  res@cnRasterMinCellSizeF = 0.0005
  res@cnLinesOn = False ; Turn off contour lines
  res@cnLineLabelsOn = False ; Turn off contour lines
  res@cnMaxLevelCount = 100

  res@trGridType = "TriangularMesh"

  res@gsnAddCyclic = False ; Data is not cyclic

     res@cnFillOn = True
    res@cnLinesOn = False
    res@cnLineLabelsOn = False
    res@cnFillMode = "RasterFill" ; faster
  res1 = res

  res@lbTitleString = wv1s@long_name
  res@lbTitleFontHeightF = 0.01 ; Make font smaller
  res@lbLabelAutoStride = True ; Nice stride for labels
  res@lbLabelFontHeightF = 0.012 ; Make labels bigger
  res@lbBoxLinesOn = False

  res@mpDataBaseVersion = "MediumRes" ; Higher res coastline
  res@mpProjection = "Mercator"

  res@mpLimitMode = "LatLon"
res@mpMinLonF = 65. ; select a subregion
res@mpMaxLonF = 90.
res@mpMinLatF = 5.
res@mpMaxLatF = 30.

  res@mpGridAndLimbOn = True
  res@mpCenterLonF = 80 ; change map center
  res@mpCenterLatF = 20

  res@pmTickMarkDisplayMode = "Always"

  res@sfXArray = lon2d1
  res@sfYArray = lat2d1

  res = True
  res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
   res@cnLevelSpacingF = 2
  plot = gsn_csm_contour_map(wks,wv1, res)
  delete(res)
   res = True
  res@cnLineLabelsOn = True ; turn on line labels
  res@cnFillOn = True ; turn on color fill
  res@gsnSpreadColors = True ; use full range of
colors
  res@lbLabelAutoStride = True

  draw(plot)
  frame(wks)
  ;draw(plot1)
  frame(wks)
end

*****************************************************************************************************************************************************

-- 
Jayakrishnan.P.R.
CSIR-Research Fellow
Department of Atmospheric Sciences,
Cochin University of Science and Technology (CUSAT)
Cochin-682016, mob:09895417565

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Apr 6 03:15:51 2011

This archive was generated by hypermail 2.1.8 : Fri Apr 08 2011 - 09:34:26 MDT