How to check if Fortran array contains value?

后端 未结 1 1967
你的背包
你的背包 2020-12-09 01:57

I\'ve seen this asked for other languages, but having just found out how nicely Fortran can handle arrays, I thought there might be an easy way to do this without loops.

相关标签:
1条回答
  • 2020-12-09 02:33

    ANY should actually be the right choice

    if ( ANY( lastNeighArray=="n" ) ) then
    

    there is also ALL if you wanted the whole array to contain that value.

    0 讨论(0)
提交回复
热议问题