[ncl-talk] wrf_user_getvar "slp" (error)

Borja Sas González saszalez at gmail.com
Tue Sep 24 06:25:22 MDT 2019


Hello everyone.

When executing the scipt when I look for the slp variable through
wrf_user_getvar I get an error. I have tried with many more variables, and
everything works correctly, it is only with that one. The mistake is:

 Copyright (C) 1995-2019 - All Rights Reserved

 University Corporation for Atmospheric Research

 NCAR Command Language Version 6.6.2

 The use of this software is governed by a License Agreement.

 See http://www.ncl.ucar.edu/ for more details.

fatal:NclMalloc Failed:[errno=12]

Violación de segmento

El script es:

begin


; Abrir archivo

files = systemfunc("ls
/home/ssd/chile/WRF/test/em_real/wrfout_d03_2017-12-31_00:00:00") + ".nc"

a = addfiles(files,"r")


; Definir latitud y longitud

lat = -22.056923

lon = -68.573862


; Localización del punto más próximo

opt = True

loc = wrf_user_ll_to_xy(a,lon,lat,opt)

loc2 = wrf_user_xy_to_ll(a,loc(0),loc(1),opt)



lat2 = loc(1) ; Latitud para las variables

lon2 = loc(0) ; Longitud para las variables



; Temperatura a 2m en ºC

;tk2 = wrf_user_getvar(a,"T2",-1)

;tk2 = tk2 - 273.15

;tk2 = decimalPlaces(tk2,2,True)


; Viento a 10 m en m/s

;u10 =  wrf_user_getvar(a,"U10",-1)

;v10 =  wrf_user_getvar(a,"V10",-1)

;wspd = wind_speed(u10,v10)

;wspd = decimalPlaces(wspd,2,True)


; Presión en superficie

psfc = wrf_user_getvar(a,"slp",-1)

psfc = decimalPlaces(psfc,2,True)


; Humedad relativa a 2 m

;rh2 = wrf_user_getvar(a,"rh2",-1)

;rh2 = decimalPlaces(rh2,2,True)


; Opciones del encabezado

csv_filename = "data.csv"

system("rm -f " + csv_filename)

fields = (/"TIME, TEMPERATURE (ºC), PRESSURE (hPa), RH (%)"/)


; Crear encabezado

dq = str_get_dq()

fields = dq + fields + dq

header = [/str_join(fields,",")/]



; Formato de escritura de las variables

;format = "%s,%g,%g,%g;%g"

format = "%s,%8.2f,%6.2f,%6.2f,%6.2f"


; Crea el archivo con el encabezado

write_table(csv_filename, "w", header, "%s")


; Loop temporal

times = wrf_user_getvar(a,"times",-1)

ntimes = dimsizes(times)

do it = 0,ntimes-1


; Crea el archivo con las variables

alist = [/times(it),psfc(it,lon2,lat2)/]

write_table(csv_filename, "a", alist, format)


end do


end
-- 
Borja Sas González
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190924/b1cb2037/attachment.html>


More information about the ncl-talk mailing list