- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
my previous question regarding initialization of local variables had been answerd... does anybody knows how to initialization of allocatble variables in the compiler?
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is none. You must do it yourself. The /Qzero option is there only to help with "dusty deck" programs that assumed static, zero allocation for local variables.
Please do not look for compiler switches to make up for errors in programming.
Please do not look for compiler switches to make up for errors in programming.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is none. You must do it yourself. The /Qzero option is there only to help with "dusty deck" programs that assumed static, zero allocation for local variables.
Please do not look for compiler switches to make up for errors in programming.
Please do not look for compiler switches to make up for errors in programming.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you're allocating within a derived type, you can set initializations there.
TYPE SurfaceData
CHARACTER(len=MaxNameLength) :: Name = ' ' ! User supplied name of the surface (must be unique)
INTEGER :: Construction = 0 ! Pointer to the construction in the Construct derived type
INTEGER :: Class =0
End Type SurfaceData
TYPE (SurfaceData), ALLOCATABLE, DIMENSION(:) :: Surface
When you allocate Surface, e.g. Allocate(Surface(20)) each element is initialized.
Linda
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page