Fortran - lbound throws error 6366 “The shapes of the array expressions do not conform”

后端 未结 1 980
臣服心动
臣服心动 2021-01-26 07:25

So I\'ve been confounded again by Fortran. Go figure. Anyway, I\'m trying to write a pretty simple routine the strips values off the end of an array. Everything complicated work

相关标签:
1条回答
  • 2021-01-26 07:57

    Lbound() returns an array! Read The Fortran Manual (RTFM) at https://gcc.gnu.org/onlinedocs/gfortran/LBOUND.html

    It returns an array with as many elements as is the rank ("dimension" 1D,2D,...) of the array.

    To get a single number, for a specific dimension, use the optional argument DIM.

    istart = lbound(list, 1)
    
    0 讨论(0)
提交回复
热议问题