Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Comunicados
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

COUNT function dim=1

dave_frank
Principiante
509 Visualizações
Below uses arrays and data from COUNT function online documentation.
But the counts using dim=1, dim=2 are reversed ?
! -----------------------------
program test_count
integer :: a(3,2) = [1,5,7,3,6,8]
integer :: b(3,2) = [0,5,7,2,6,9]
write (*,91) 'count(a > 5) = ', count(a > 5)
write (*,91) 'count(a /= b) = ', count(a /= b)
write (*,91) 'count(a /= b,dim=1) = ', count(a /= b, dim=1)
write (*,91) 'count(a /= b,dim=2) = ', count(a /= b, dim=2)
91 format (a,3i2)
end program

Outputs:
count(a > 5) = 3
count(a /= b) = 3
count(a /= b,dim=1) = 1 2
count(a /= b,dim=2) = 2 0 1
0 Kudos
0 Respostas
Responder