opensubscriber
   Find in this group all groups
 
Unknown more information…

f : fortran-dev@lists.apple.com 21 December 2005 • 6:47AM -0500

Automatic Object and Memory management
by Christophe Peyret

REPLY TO AUTHOR
 
REPLY TO GROUP




I wonder if I can do something like that in fortran and if I can clearly
deallocate the object conectivty (see the example)


I have make a first module containing a type delaclaration with pointers :

module space_element
  !---------------------------
  use space_precision
  !---------------------------
  implicit none ; private
  include "mpif.h"
  type element
    private
    integer, pointer :: n1(:)      =>null()
    integer, pointer :: n2(:)      =>null()
    integer, pointer :: n3(:)      =>null()
    integer, pointer :: n4(:)      =>null()
  end type element
  public :: element
  ...
end module space_element

then to make a "common variable" of type element I make a second module
and I use the save attribute


module space_element_static
  use space_element, only: element
  type(element), save :: conectivity
end module space_element_static

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Fortran-dev mailing list      (Fortran-dev@list...)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/fortran-dev/subscriber%40opensubscriber.com

This email sent to subscriber@open...

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.