[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 20000717: segmentation fault from gennet.f



>To: address@hidden
>From: Edward Colon <address@hidden>
>Subject: segmentation fault from gennet.f
>Organization: Comparative Planetology Laboratory, University of Louisville
>Keywords: 200007171948.e6HJmcT11051, gennet.f, user-contributed software

Hi Edward,

> I am utilizing the gennet.f fortran code to read a netcdf diagnostic
> file produced by a planetary isentropic vertical coordinate model. The
> gennet code does successfully produce a code that begins to read the
> netcdf file but will yield a segmentation fault when it attempts to
> read beyond the 22nd of 28 variables generated by the model. I have
> attempted to run the gdb debugger on the executable when I attempt to
> process the 23rd variable read and receive the cryptic error
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x805ff5f in getNCvx_double_double ()

Such an error typically means you are trying to store a value beyond
the memory allocated for the program.  In Fortran, this often
indicates an array bounds error.  With a netCDF call, it would be easy
to try to read more values than the array has space allocated for,
which would cause such an error.

> In the program code, the execution fails at 
>
> CALL NCVGT(NCID,ivarid,START,COUNT,
> +dhthetadt                      ,RCODE)
>
> I am guessing that there may be a problem with memory allocation so
> that I am including the variable initialization statements

You might want to print out the values of the START and COUNT arrays
and make sure they don't exceed the associated dimension of the netCDF
variable you are trying to read from, dhthetadt.  For example, if the
shape of dhthetadt were (128, 65, 8, 2), START was (1, 1, 1, 1, ...)
and count was (128, 65, 8, 3, ...), this could generate a segmentation
violation.

Other than that, we can't help much with GENNET.F, since it is
user-contributed software that we didn't write and thus don't support.
You might contact the author (Barry Schwartz) for more assistance.
The last email address I have for him is <address@hidden>.

--Russ

_____________________________________________________________________

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu