- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have something like this -
type output
real(kind=8) :: array1(10,20,30)
real(kind=8) :: array2(10,20,4)
end type output
type (output),save, dimension(54) :: array_o
Also, I have something like this -
type output_pointer
real(kind=8),pointer :: array1(:,:,:)
real(kind=8),pointer :: array2(:,:,:)
end type output_pointer
type (output),save, dimension(54) :: array_pointer
Are these permissible in fortran? I am getting no build error but I am getting runtime error.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Both should be acceptable. Can you provide an example.
Note, if you intend to have pointer to array point to an array (members of element of output_pointer pointing to members of element output) then the attribute of the members of output need the TARGET attribute (I am not sure if array_o needs TARGET, but the compiler will inform you if it does.)
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are these permissible in fortran? I am getting no build error but I am getting runtime error.
I don't see what your type output_pointer has got to do do with anything else.
If the code could be compiled into an EXE, the program may be syntactically correct, but, there could be other errors in the program, such as uninitialized variables, dangling/unallocated pointer variables, etc., that cause runtime errors.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page