<MINLOC Example Program>
Program minloc_example Real :: a(2,3) a = Reshape( (/2.,3.,5.,-1.,4.,-3./), (/2,3/)) Print *, Minloc(a) Print *, Minloc(a,Dim=1) Print *, Minloc(a,Dim=2) Print *, Minloc(a,Mask=a<5) End
■ Execution Results
2 3 1 2 2 1 3 1 1
Program minloc_example Real :: a(2,3) a = Reshape( (/2.,3.,5.,-1.,4.,-3./), (/2,3/)) Print *, Minloc(a) Print *, Minloc(a,Dim=1) Print *, Minloc(a,Dim=2) Print *, Minloc(a,Mask=a<5) End
2 3 1 2 2 1 3 1 1