Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
1 View

Allocatable Arrays in Fortran

Hello,

Can someone please help me understand what are allocatable arrays while writing a code in Fortran? When do we allocate/deallocate arrays? What is the role of the module? 

Thanks

Geetanjali
0 Kudos
3 Replies
Highlighted
1 View

It is advisable to consult

It is advisable to consult the documentation under the index of "allocatable arrays".

Essentially, an allocatable array is a placeholder of a descriptor that will define the rank (number of dimensions), size(s), and extents of an array who's capacity is unknown until runtime.

Older language standards require explicit allocation and deallocation, newer language features permit automatic allocate, reallocate, and deallocate of arrays.

Jim Dempsey
 

0 Kudos
Highlighted
Beginner
1 View

Ms. Yadav

Ms. Yadav

Judging from your question, I would suggest that some background reading would be the best way to become familiar with the purpose/operation/use of allocatable arrays. BUT, most books on Fortran are little more than a reiteration of the latest Fortran standard which simply states facts rather than provide background and (actually) assume the reader already understands Fortran concepts. They are very difficult to learn from. There is one book that I can recommend: Modern Fortran Explained by Metcalf, Reid, and Cohen.

https://www.amazon.com/gp/product/0199601429/ref=s9_acsd_simh_hd_bw_b129_c_x_2_w?pf_rd_m=ATVPDKIKX0D...

I think you will find the book as a whole to be very helpful and the section on alloacatable arrays particularly so.

0 Kudos
Highlighted
1 View

Thank you Jim and David

Thank you Jim and David

Geetanjali
0 Kudos