;******************************************************************************* ;*Script para crear un panel para las brisas. Modelo tomado del trabajo del ;*panel para lo del polvo sahariano ;******************************************************************************* ; 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/csm/contributed.ncl" load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl" begin ;******************************************************************************* ; Bloque de lectura de ficheros (dos opciones) ; WRF ARW open one big file ;a = addfile("./wrfout_d03_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_d03*.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,"Panel_SBF_EXP07") plot = new(10,graphic) ;Create a plot array with 10 figures ;******************************************************************************* gsn_define_colormap(wks,"sunshine_9lev") ; Tabla de colores para gradientes ; Set basic resources res = True res@NoHeaderFooter = True ; elimina cabecera y pie de página res@MainTitle = "SBF with ECMWF data, Exp07" ;Give plot a main title pltres = True ; Plotting resources pltres@PanelPlot = True ; Todo va en un panel 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" ;******************************************************************************* ;Bloque de lectura de tiempos y datos de WRF ;******************************************************************************* 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, 6 ; multiple files, each 10 min D03 res@TimeLabel = times(it) ; keep some time information ; Get variables u10 = wrf_user_getvar(a,"U10",it) ; Get U10 u10@units = "m/s" u10@description = ""; "U10 component" v10 = wrf_user_getvar(a,"V10",it) ; Get V10 v10@units = "m/s" v10@description = ""; "v10 component" ; Define new variable speed=sqrt((u10*u10)+(v10*v10)) ;calculo del modulo speed@units = "m/s" speed@description = ""; "Wind at 10 m" printVarSummary (speed) ;********************************************************************** ; Plot options ;********************************************************************** ; Plotting options for speed opts_mod = res ; Add basic resources opts_mod@FieldTitle = "Speed" ; Overwrite the field title opts_mod@cnFillOn = True opts_mod@cnLinesOn = False opts_mod@lbLabelBarOn = False ; No la pintes para poner una única barra a todo opts_mod@ContourParameters = (/ 3.0,7.0,1./) ; Contour intervals SBF = wrf_contour(a[0],wks,speed,opts_mod) ; Create plot delete(opts_mod) ; Plotting options for Wind Vectors opts_v = res ; Add basic resources opts_v@FieldTitle = "U10,V10" ; Overwrite the field title opts_v@vcGlyphStyle = "CurlyVector" ;"LineArrow" ;"CurlyVector" opciones para el dibujo 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 vector = wrf_vector(a[0],wks,u10,v10,opts_v) ; Create plot delete(opts_v) ; Make plots plot(it) = wrf_map_overlays(a[0],wks,(/SBF,vector/),pltres,mpres) ; sin la presión end do ;fin del bucle de tiempos ;************************************************ ; Create panel ;************************************************ resP = True resP@txString = "SBF & wind evolution" ; Main title resP@gsnPanelLabelBar = True ; add common colorbar resP@lbTitlePosition = "Bottom" ; Pone la barra abajo resP@lbTitleOn = True ; Pone la leyenda de la barra resP@lbTitleString = "Wind speed (m/s)" ; Leyenda de la barra resP@lbTitleFontHeightF = 0.015 ; make labels smaller resP@gsnPanelBottom = 0.05 ; Reserva un espacio para la barra resP@gsnPanelYWhiteSpacePercent = 10 ; add ad space between plots resP@lbLabelFontHeightF = 0.01 ; make labels smaller resP@lbLabelAutoStride = True ; spacing of lbar labels resP@lbBoxMinorExtentF = 0.12 ; add common colorbar gsn_panel(wks,(/plot/),(/5,2/),resP) ; now draw as one plot end ;--------------------------------------------------------------