1!$Id:$ 2 logical function cknon0(v, nn ) 3 4! * * F E A P * * A Finite Element Analysis Program 5 6!.... Copyright (c) 1984-2017: Regents of the University of California 7! All rights reserved 8 9!-----[--.----+----.----+----.-----------------------------------------] 10! Purpose: Check that real vector has a non-zero component 11 12! Inputs: 13! v(*) - Vector of real numbers 14! nn - Length of vector 15 16! Outputs: 17! cknon0 - true of non-zero entries exist; else false. 18!-----[--.----+----.----+----.-----------------------------------------] 19 implicit none 20 21 integer n,nn 22 real*8 v(*) 23 24 do n = 1,nn 25 if(v(n).ne.0.0d0) then 26 cknon0 = .true. 27 return 28 endif 29 end do ! n 30 31! Set false to indicate vector is zero 32 33 cknon0 = .false. 34 35 end 36