Access violation after nullifiying and again allocating pointer
- From: Klemens Barfus <klemens.barfus@xxxxxxxxxxxxxxxxxxx>
- Date: Thu, 08 Sep 2005 13:58:17 +0200
Dear list members,
working on a programm which calculates varying atmospheric profiles, I have a subroutine where the profile is stored in a pointer called 'profile'. Within this profile, there ia a pointer array called 'level' with parameter like temperature, pressure, etc.
When I calculate the profile for the next gridcell, I nullify first the profile to get rid of the old data.
This works fine, until there is an access violation. The appearance of this access violation seems to be independent of the data used in this moment.
A part of the code is shown below:
if(associated(profile))then nullify(profile) endif allocate(profile) ! calculation of number of levels profile%anz_z = INT((cloudtop - cloudbase)/dz) + 5 allocate(profile%level(1:profile%anz_z))
Access violation occurs always in the last allocation statement.
Any suggestions ?
Thanks for your help in advance !
Klemens
p.s.: I work with the Developer Studio 97 and Visual Fortran 5.0 .
- Follow-Ups:
- Re: Access violation after nullifiying and again allocating pointer
- From: Jan Vorbrüggen
- Re: Access violation after nullifiying and again allocating pointer
- Prev by Date: Re: Optimal programming advice
- Next by Date: Re: Optimal programming advice
- Previous by thread: Partial derivatives of gridded data
- Next by thread: Re: Access violation after nullifiying and again allocating pointer
- Index(es):
Relevant Pages
|