Defined lat and long

From: Mittal, Moti <mmittal_at_nyahnyahspammersnyahnyah>
Date: Thu, 23 Apr 2009 17:39:19 -0400

In the following script, I want to plot O3 between 12.5 to 13.5 lat and 79.5 to 80.5 longitude.
I included res_at_mpMinLatF = 12.5 etc. (line 41-44) but still the plot gives me 11.5 to 14.5 latitude and 78 to 82 longitude which is the output from wrfout file.
How should I change my script?

Thank you.

Moti Mittal

Script;
 1 ;*************************************************
  2 ; WRF: color over map with lat/lon labels
  3 ;************************************************
  4 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
  5 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
  6 load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl"
  7 begin
  8 ;************************************************
  9 ; open file and read in data
 10 ;************************************************
 11 f = addfile ("/home/mmittal/CHENNAI/CHEM/WRFOUT/MAY/wrfout_d01_2007-05-03_06: 00:00.nc", "r")
 12 ;************************************************
 13 ; Read character variable Times; Convert to string for plots
 14 ; Read vertical coordinate for plot labels
 15 ;************************************************
 16 times = chartostring(f->Times) ; built-in function
 17 znu = f->ZNU(0,:) ; (Time, bottom_top)
 18 lat2d = f->XLAT(0,:,:)
 19 lon2d = f->XLONG(0,:,:)
 20 ;************************************************
 21 ; Read ozone at all times and levels
 22 ;************************************************
 23 x = f->o3 ; (Time, bottom_top, south_north, w est_east)
 24
 25 ;************************************************
 26 ; create plots
 27 ;************************************************
 28 wks = gsn_open_wks("x11" ,"WRF_po") ; ps,pdf,x11,ncgm,eps
 29 gsn_define_colormap(wks,"BlAqGrYeOrReVi200") ; select color map
 30
 31 res = True ; plot mods desired
 32 res_at_gsnMaximize = True ; uncomment to maximize size
 33 res_at_gsnSpreadColors = True ; use full range of colormap
 34 res_at_cnFillOn = True ; color plot desired
 35 res_at_cnLinesOn = True ; turn off contour lines
 36 res_at_cnLineLabelsOn = True ; turn off contour labels
 37 res_at_cnLevelSelectionMode = "ManualLevels"
 38 res_at_cnMinLevelValF = .025
 39 res_at_cnMaxLevelValF = .035
 40 res_at_cnLevelSpacingF = .002
 41 res_at_mpMinLatF = 12.5
 42 res_at_mpMaxLatF = 13.5
 43 res_at_mpMinLonF = 79.5
 44 res_at_mpMaxLonF = 80.5
 45
 46 ;************************************************
 47 ; Use WRF_contributed procedure to set map resources
 48 ;************************************************
 49 WRF_map_c (f, res, 0)
 50 ;************************************************
 51 ; set True for native projection (faster)
 52 ;************************************************
 53 res_at_tfDoNDCOverlay = False
 54 x_at_lat2d = lat2d
 55 x_at_lon2d = lon2d
56
 57
 58 ;************************************************
 59 ; Turn on lat / lon labeling
 60 ;************************************************
 61 res_at_pmTickMarkDisplayMode = "Always" ; turn on tickmarks
 62
 63 ;************************************************
 64 ; Loop over all times and levels ( uncomment )
 65 ; Demo: one arbitrarily closen time and level
 66 ;************************************************
 67 dimx = dimsizes(x) ; dimensions of x
 68 ntim = dimx(0) ; number of time steps
 69 klev = dimx(1) ; number of "bottom_top" levels
 70
 71 ; nt = ntim/2 ; arbitrary time
 72 ; kl = 1 ; " level
 73 do nt=0,ntim-1 ; uncomment for loop
 74 do kl=0,klev-1
 75 res_at_tiMainString = times(nt)
 76 res_at_gsnLeftString = x_at_description+" z="+znu(kl)
 77 plot = gsn_csm_contour_map(wks,x(nt,kl,:,:),res)
 78 ; now change the size of the tickmark labels
 79 res_at_tmXBLabelFontHeightF = 0.02 ; resize tick labels
 80 res_at_tmYLLabelFontHeightF = 0.02
 81 plot = gsn_csm_contour_map(wks,x(nt,kl,:,:),res)
 82 end do
 83 end do
 84 end

Professor, Department of Environment and Occupational Health
College of Public Health
University of South Florida
13201 Bruce B. Downs Blvd., MDC56
Tampa, Fl 33612-3805

Tel: (813) 974-9571
Fax: (813) 974-4986
Email: mmittal_at_health.usf.edu
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Apr 23 2009 - 15:39:19 MDT

This archive was generated by hypermail 2.2.0 : Fri Apr 24 2009 - 14:12:40 MDT