vecuni
C VECUNI SOURCE CB215821 17/07/21 21:15:36 9513 c--------------------------------------------------------------------- c c c===================================================================== c = c This routine computes the length of the vector 'v' and converts = c it to a unit one. = c = c===================================================================== IMPLICIT INTEGER(I-N) integer n,i real*8 v (n), modul,moduli c modul = 0.0 d0 do i = 1, n modul = modul + v (i) **2 end do c if (modul .eq. 1.0 d0) return c modul = SQRT (modul) moduli = 1.0 d0 / modul do i = 1, n v (i) = v (i) * moduli end do c return end
© Cast3M 2003 - Tous droits réservés.
Mentions légales