# FORTRAN学习笔记(5): FORTRAN数组类型和存储结构

FORTRAN中的数组声明可以有如下几种类型：Explicit-shape Array,  Assumed-shape Array, Assumed-size Array, and Deferred-size Array

• Explicit-shape array: An explicit-shape array is declared with explicit values for the bounds in each dimension of the array(显式指定数组各维的上下界).

Both automatic array and adjustable array are explicit-shape arrays.

Automatic Array: an automatic array is an explicit shape array that is a local variable. Automaticarrays are only allowed in  function and subroutine subprograms, and are declared in the specification part of the subprogram. At least one bound of an automatic array must be a nonconstant specification expression. The bounds are determined when the subprogram is called.(自动数组是子程序的局地变量，在子程序内部声明，数组维数中至少一维由子程序的参数传递获得，其他维可在子程序中指定)

Adjustable Array: an adjustable array is an explicit shape array that is a dummy argument to a subprogram. At least one bound of an adjustable array must be a nonconstant specification expression. The bounds are determined when the subprogram is called.(局地可调数组是子程序的传递参数之一，同时可调数组维数中至少一维由子程序参数传递获得)

• Assumed-shape array: an assumed-shape array is a dummy argument array that assumes the shape of its associated actual argument array(假定形状数组通常在子程序内部声明，指定维数/rank，但不指定维的大小).

• Assumed-size array: an assumed-size array is a dummy argument array that assumes the size (only) of its associated actual argument array; the rank and extents can differ for the actual and dummy arrays(假定大小数组通常在子程序中声明，可以指定1维或多维的大小).

• Deferred-shape array: a deferred-shape array is an array pointer or an allocatable array(递延形状数组指数组指针或可分配数组，数组的维数和各维大小在指针赋值时或使用allocate语句时获得).

https://blog.sciencenet.cn/blog-430991-776466.html

## 相关博文

GMT+8, 2024-7-23 19:24