|
|
implicit deallocation
A few days ago, I realized that Fortran 2008 allows a finalizer to
allocate a local allocatable variable. That was not possible using
standard conforming Fortran 2003 code. It is now possible for the
finalizer for a local variable A to cause a local variable B to be
allocated if it is not already allocated. Similarly, the finalizer
for B could cause A to be allocated if it is not already allocated.
If A or B or both are allocated on exit from a subprogram, the effect
of implicit deallocation does not seem to be defined. My guess is
that most implementations will end up leaving one of A or B allocated
on exit. I have not yet been able to test my conjecture, as the test
program requires an implementation that supports both finalizers and
internal procedures as targets of procedure pointers.
Bob Corbett
|
|
0
|
|
|
|
Reply
|
robert.corbett (96)
|
4/20/2012 2:58:46 AM |
|
|
0 Replies
54 Views
(page loaded in 0.241 seconds)
Similiar Articles: Trying to implement dynamic arrays, but... - comp.lang.fortran ...PROGRAM mat_5 IMPLICIT NONE INTEGER, DIMENSION(:,:), ALLOCATABLE :: x INTEGER ... i,i)) x =3D i write(*,*) x deallocate(x ... Allocating, Deallocating and Reallocating - comp.lang.fortran ...DEALLOCATE( x ) Or, I could even ... holes left in memory due to a deallocate. On most systems, it can't defragment. If there are pointers (explicit or implicit ... Vector-values functions slow? - comp.lang.fortranHere, is a simple demo-program: program quick implicit none integer ... call seval(u,v,r) end do call cpu_time(tt1) print *, tt1-tt0 deallocate(u ... Random number in Fortran 90/95 - comp.lang.fortransubroutine save_seed() implicit none ... seed close(I_unit_seed) deallocate(last_seed) end subroutine save_seed ! subroutine load_seed() implicit ... Allocatable versus automatic arrays - comp.lang.fortranAllocation and >> deallocation do take time, but if much computation happens between ... On 06/04/2010 09:21 PM, glen herrmannsfeldt wrote: > implicit none ... intent(out) for pointer dummy argument - comp.lang.fortran ...I'm talking about the if (associated(pointer)) deallocate(pointer) regardless ... defining an actual argument: $ cat foo.f90 module mymodule implicit none ... Help needed: read 3-dimensional array from a MAT-file in Fortran ...When you are done with the target array of fp and the mxArray mx variable, deallocate ... plhs, nrhs, prhs) use MatlabAPImex use MatlabAPImx implicit ... ftnchek: identifier has embedded space - comp.lang.fortran ...If you use implicit none, that will catch a lot of the errors that relate to such ... users_must_not_use_this_identifier -- are ... specify that the user should deallocate ... Difference between passing a number and a variable to a subroutine ...This module contains all necessary modules IMPLICIT NONE ... buf(j)%ref = ref_buf(j) enddo deallocate(ref_buf ... Allocation and Deallocation of Memory - The Caml language: HomeAllocation and Deallocation of Memory Most languages permit dynamic memory allocation ... Implicit Reclamation Languages with implicit memory reclamation do not possess ... Copy Constructor, Assignment Operator, DestructorIf dynamic memory is involved, the assignment operator will often deallocate memory, then allocate new memory and copy. implicit destructor. As you might guess, this calls ... 7/19/2012 9:11:44 PM
|
|
|
|
|
|
|
|
|