Re: Segmentation fault

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu Dec 05 2013 - 08:33:02 MST

The problem is that you are reading 365 files (days) of grids.
The grid sizes for these L3 files is 720x1440. Hence,

   so2PBL = f[:]->ColumnAmountSO2_PBL_OMI_Total_Column_Amount_SO2

is creating an array (365,720,1440) which has
365x720x1440=378432000 elements or 378432000*4=1513728000 bytes (1.5GB).

When you use 'where', it creates two arrays of the same size. One for
the True results and one for the False results. It then merges
the results into another array.

----
Why are you reading the entire array? You are only interested in
a region so only read the region you want. Something like
   latS = -36.0
   latN = -20.0
   lonW = -72.0
   lonE = -19.0
   so2PBL = 
f[:]->ColumnAmountSO2_PBL_OMI_Total_Column_Amount_SO2({latS:latN},{lonW:lonE})
   printVarSummary(so2PBL)
The result should be
	[ncl_join | 365] x [YDim_OMI_Total_Column_Amount_SO2 | 64] x 
[XDim_OMI_Total_Column_Amount_SO2 | 212]
Coordinates:
             YDim_OMI_Total_Column_Amount_SO2: [20.125..35.875]
             XDim_OMI_Total_Column_Amount_SO2: [-71.875..-19.125]
*NOTE* the above variable has the spatial coordinate associated
with the variable.
Not sure why you are doing this, renaming the coordinate dimensions
to lat and lon is *not* required.
;#================================================================================================================================
;# Definindo coordenas de lat/lon
;#================================================================================================================================
so2PBL!1= "lat" 
so2PBL!2= "lon"
lat = f[1]->YDim_OMI_Total_Column_Amount_SO2
lat@units="degrees_north"
lon = f[1]->XDim_OMI_Total_Column_Amount_SO2 
;coordenadas de # BUENOS AIRES 34.36S and 58.27W
lon@units="degrees_east"
so2PBL&lat = lat
so2PBL&lon = lon
If you want to rename them for some personal reason, you only need
   so2PBL!1= "lat"
   so2PBL!2= "lon"
   printVarSummary(so2PBL)  ; <==look at the output
	[ncl_join | 365] x [lat | 64] x [lon | 212]
             lat: [20.125..35.875]
             lon: [-71.875..-19.125]
On 12/5/13, 6:55 AM, Mateus Dias Nunes wrote:
> Hello,
>
> I'm having trouble running a script.
> When I run the script with the entire database (the period of one year, 365
> days) have a problem of segmentation:
> fatal: NclMalloc Failed: [errno = 12]
> Segmentation fault
> But when I run the script to only month of the year it works perfectly.
> so I need a way to make this database does not occupy any memory of the
> computer.
>
> Unable to identify that this problem occurs on line 77 by "where" function
>
> thank you
> _________________________________________
> MATEUS DIAS NUNES
> UNIVERSIDADE FEDERAL DE PELOTAS - UFPEL
> FACULDADE DE METEOROLOGIA
> TELEFONE: (53) 81125154
> _________________________________________
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Dec 5 08:33:11 2013

This archive was generated by hypermail 2.1.8 : Fri Dec 13 2013 - 11:39:30 MST