开发者

Logical Type and Select in Fortran

开发者 https://www.devze.com 2022-12-17 17:47 出处:网络
I have encountered the following statement in fortran: integeriparam(11), ipntr(14) logicalselect(maxncv)

I have encountered the following statement in fortran:

  integer           iparam(11), ipntr(14)
  logical           select(maxncv)
  Double precision
 &                  开发者_如何学Goax(maxn), d(maxncv,3), resid(maxn), 
 &                  v(ldv,maxncv), workd(3*maxn), 
 &                  workev(3*maxncv), 
 &                  workl(3*maxncv*maxncv+6*maxncv)

Well, I can understand what integer, Double precision is.

But what about logical select ? What do they mean?


"logical" is a boolean type, which takes on only the values .TRUE. or .FALSE. The declaration creates a 1D array of name "select" of length "maxncv", just as the previous declaration creates an integer 1D array "iparam" of length "11".

The layout (e.g., the continuation symbol on the start of continued lines) and the use of Double Precision suggest Fortran 77. For new code I recommend Fortran 95/2003.


logical is a datatype just like double precision is. select is a variable just like d is. maxncv is an array bound just like maxncv is.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号