COSMOS v7.655  COSMOSv7655
(AirShowerMC)
c3DV2DDCos.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine c3dv2ddcos (a, b, len)
 

Function/Subroutine Documentation

◆ c3dv2ddcos()

subroutine c3dv2ddcos ( type(coord a,
type(coord b,
real*8  len 
)

Definition at line 3 of file c3DV2DDCos.f.

Referenced by cifxhorizon(), cifxobssite(), and cresetposang().

3  implicit none
4 #include "Zcoord.h"
5  type(coord)::a ! input coord (only 3 vect is used)
6  type(coord)::b ! output coord. in direction cos. b can be a.
7  real*8 len ! output. length of a.
8 
9  len = sqrt( a%r(1)**2 + a%r(2)**2 + a%r(3)**2)
10  if(len .eq. 0.) then
11  b%r(1) = 0.
12  b%r(2) = 0.
13  b%r(3) = 1.
14  else
15  b%r(1) = a%r(1)/len
16  b%r(2) = a%r(2)/len
17  b%r(3) = a%r(3)/len
18  endif
real(4), save a
Definition: cNRLAtmos.f:20
real(4), save b
Definition: cNRLAtmos.f:21
Definition: Zcoord.h:43
Here is the caller graph for this function: