; load functions and procedures 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/WRFUserARW.ncl" begin ;__________________________________________________________________ ; WRF ARW open one file a = addfile("./wrfout_d02_2007-04-10_12:00:00.nc","r") ;__________________________________________________________________ ;________________________________________________________________________ ; WRF ARW open multiple files ; get list of all files and open as "one big file" ; all_files = systemfunc ("ls /Users/lcana/Resultados_Brisas/wrfout*.nc") ; a = addfiles (all_files, "r") ; choose how files are combined and read in variable across files ; ListSetType (a, "cat") ; concatenate or "merge" (default) ;________________________________________________________________________ ; We generate plots, but what kind do we prefer? ; type = "x11" ; type = "pdf" ; type = "eps" type = "png" wks = gsn_open_wks(type,"SBF_10") gsn_define_colormap(wks,"sunshine_9lev") ; Change in colormap ; Set basic resources res = True res@MainTitle = "SBF with ECMWF data" ;Give plot a main title res@Footer = False ; Set Footers off pltres = True ; Plotting resources mpres = True ; Map resources ;_________________________________________________________________ mpres@mpProjection = "Mercator" mpres@mpGeophysicalLineColor = "Black" mpres@mpGridLineColor = "Black" mpres@mpPerimLineColor = "Black" mpres@mpGeophysicalLineThicknessF = 3.0 mpres@mpGridLineThicknessF = 0.5 mpres@mpGridSpacingF = 1.0 mpres@mpDataBaseVersion = "HighRes" ;---------------------------------------------------------------- times = wrf_user_list_times(a) ; get times in the file ntimes = dimsizes(times) ; number of times in the file do it = 0, ntimes-1, 1 ; multiple files, 10 min step for D03 res@TimeLabel = times(it) ; keep some time information ;---------------------------------------------------------------- ; Get variables u10 = wrf_user_getvar(a,"U10",it) ; Get U10 v10 = wrf_user_getvar(a,"V10",it) ; Get V10 u10@units = "" ; "m/s" don't write units (no header) v10@units = "" ; "m/s" module=sqrt((u10*u10)+(v10*v10)) ;calculo del modulo module@units = "" ; "m/s" don't write units (no header) printVarSummary (module) ;---------------------------------------------------------------- ; Plotting options for Module opts_mod = res ; Add basic resources opts_mod@FieldTitle = "" ; Overwrite the field title opts_mod@cnFillOn = True opts_mod@cnLinesOn = False opts_mod@ContourParameters = (/ 3.0,6.0,0.5/) ; Contour intervals SBF = wrf_contour(a,wks,module,opts_mod) ; Create plot delete(opts_mod) ; Plotting options for Wind Vectors opts_v = res ; Add basic resources opts_v@FieldTitle = "" ; Overwrite the field title opts_v@vcGlyphStyle = "CurlyVector" ; "LineArrow" ;"CurlyVector" opts_v@NumVectors = 30 ; Density of wind vectors opts_v@vcRefMagnitudeF = 5.0 ; add a reference vector opts_v@vcRefLengthF = 0.05 ; what the ref length is opts_v@vcRefAnnoOrthogonalPosF = -.535 ; move ref vector into plot vector = wrf_vector(a,wks,u10,v10,opts_v) ; Create plot delete(opts_v) ; MAKE PLOTS plot = wrf_map_overlays(a,wks, \ (/SBF,vector/),pltres,mpres) end do end ;--------------------------------------------------------------