[ncl-talk] wrf_map_overlays zoom fail

Borja Sas González saszalez at gmail.com
Wed Dec 19 15:28:25 MST 2018


Dear NCL users.

I have created a simple script, 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 that is drawn
is random.

Can someone help me find the error?

Thank you very much to all.

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 at MainTitle = "Kitersurf Wind"


;--- Establecimiento de 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


;--- Establecimiento de las variables de viento

  u10       = wrf_user_getvar(a,"U10",time)

  v10       = wrf_user_getvar(a,"V10",time)

  u10       = u10*1.94386

  v10       = v10*1.94386

  u10 at units = "kts"

  v10 at units = "kts"


;--- Establecimiento de las variables de viento para zoom

  u10z      = u10(y_start:y_end,x_start:x_end) ; u a 10 m con zoom

  v10z      = v10(y_start:y_end,x_start:x_end) ; v a 10 m con zoom

  u10       = u10*1.94386                      ; vector uz en knots

  v10       = v10*1.94386                      ; vector vz en knots

  u10 at units = "kts"                            ; unidad del vector uz

  v10 at units = "kts"                            ; unidad del vector vz


;--- Opciones de plotting de los vectores de viento


  opts = res

  opts at FieldTitle = "Viento"

  opts at NumVectors = 47

  vector  = wrf_vector(a,wks,u10,v10,opts)

  vectorz = wrf_vector(a,wks,u10z,v10z,opts)

  delete(opts)


  pltres = True


  mpres = True


;--- Variables del mapa de terreno

  mpres at mpGeophysicalLineColor = "Black"

  mpres at mpNationalLineColor = "Black"

  mpres at mpGridAndLimbOn = False

  mpres at mpDataBaseVersion = "HighRes"

  mpres at mpDataSetName = "Earth..4"

  mpres at mpGeophysicalLineThicknessF = 5

  mpres at mpNationalLineThicknessF = 3

  mpres at mpShapeMode = "FreeAspect"

  mpres at vpKeepAspect = True

  ;mpres at vpWidthF = 0.9

  ;mpres at vpHeightF = 0.6


;--- Creación de los gráficos para el dominio completo

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


;--- Creación de los gráficos para el dominio zoom

  mpres at ZoomIn = True

  mpres at Xstart = x_start

  mpres at Ystart = y_start

  mpres at Xend = x_end

  mpres at Yend = y_end


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


end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181219/9f755cd0/attachment.html>


More information about the ncl-talk mailing list