Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

Allocatable Arrays in Fortran

Yadav__Geetanjali
85 Views

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

0 Kudos
3 Replies
jimdempseyatthecove
Black Belt
85 Views

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
 

David_DiLaura1
Beginner
85 Views

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.

Yadav__Geetanjali
85 Views

Thank you Jim and David

Reply