Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

wrf_map_overlays zoom fail

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

JCollins

New member
Hello everyone.

I have created a simple script in NCL, in which the wind vectors are drawn at 10 m. Also, I try to zoom the domain, but it does not draw the latitude and longitude indicated in the script. The latitude and longitude is random.

Can someone help me find the error?

Thank you very much to all.

Code:
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

begin
;--- Open WRF output file
  a = addfile("wrfout_d03_2018-12-19_00:00:00.nc","r")

;--- Start the graphics
  wks = gsn_open_wks("x11","Puertito")

;--- Set some basic plot options
  res = True
  res@MainTitle = "Kitersurf Wind"

;--- Variables

  time = 12

  minlat = 28.10
  maxlat = 28.30
  minlon = -16.40
  maxlon = -16.15

  loc = wrf_user_ll_to_ij(a,(/minlon,maxlon/),(/minlat,maxlat/),True)

  x_start = loc(0,0) - 1
  x_end   = loc(0,1) - 1
  y_start = loc(1,0) - 1
  y_end   = loc(1,1) - 1

;--- Wind
  u10       = wrf_user_getvar(a,"U10",time)    
  v10       = wrf_user_getvar(a,"V10",time)   
  u10       = u10*1.94386                      
  v10       = v10*1.94386                      
  u10@units = "kts"                            
  v10@units = "kts"                            

;--- Wind Zoom
  u10z      = u10(y_start:y_end,x_start:x_end) 
  v10z      = v10(y_start:y_end,x_start:x_end) 
  u10       = u10*1.94386                     
  v10       = v10*1.94386                    
  u10@units = "kts"                           
  v10@units = "kts"                           

;--- Plotting Options

  opts = res
  opts@FieldTitle = "Viento"     
  opts@NumVectors = 47           
  vector  = wrf_vector(a,wks,u10,v10,opts)
  vectorz = wrf_vector(a,wks,u10z,v10z,opts)
  delete(opts)

  pltres = True

  mpres = True

;--- Terrain Options
  mpres@mpGeophysicalLineColor = "Black"
  mpres@mpNationalLineColor = "Black"
  mpres@mpGridAndLimbOn = False                  
  mpres@mpDataBaseVersion = "HighRes"         
  mpres@mpDataSetName = "Earth..4"              
  mpres@mpGeophysicalLineThicknessF = 5         
  mpres@mpNationalLineThicknessF = 3             
  mpres@mpShapeMode = "FreeAspect"
  mpres@vpKeepAspect = True
  ;mpres@vpWidthF = 0.9
  ;mpres@vpHeightF = 0.6

;--- Plot Full
  plot = wrf_map_overlays(a,wks,(/vector/),pltres,mpres)

;--- Plot Zoom
  mpres@ZoomIn = True        
  mpres@Xstart = x_start
  mpres@Ystart = y_start
  mpres@Xend = x_end
  mpres@Yend = y_end

  plot = wrf_map_overlays(a,wks,(/vectorz/),pltres,mpres)

end
 
Top