COSMOS v7.655  COSMOSv7655
(AirShowerMC)
ctransCoord2.f
Go to the documentation of this file.
1  subroutine ctranscoord2(sys, a, b)
2 ! sys: character string. input target coordinate system.
3 ! a: /coord/ input.
4 ! b: /coord/ outupt. b containes transformed coordinate.
5 ! b can be a.
6 ! a.sys \sys 'xyz' 'llh' 'sph'
7 !
8 ! 'xyz' o o o
9 ! 'llh' o o o
10 ! 'sph' o o o
11 !
12 !
13  implicit none
14 
15 #include "Zcoord.h"
16 
17 
18  type(coord)::a
19  type(coord)::b
20  character*(*) sys
21  character*70 msg
22 !
23  if(a%sys .eq. sys) then
24 ! already in the objective system
25  b = a
26  else
27  if(a%sys .eq. 'xyz') then
28  if(sys .eq. 'llh') then
29  call cecent2llh(a, b)
30  elseif(sys .eq. 'sph') then
31  call cecent2sph(a, b)
32  else
33  write(msg, *) 'error sys=',sys,' transCoord2'
34  call cerrormsg(msg, 0)
35  endif
36  elseif(a%sys .eq. 'llh') then
37  if(sys .eq. 'xyz') then
38  call cllh2ecent(a, b)
39  elseif(sys .eq. 'sph') then
40  call cllh2sph(a, b)
41  else
42  write(msg, *) 'error sys=',sys,' transCoord2'
43  call cerrormsg(msg, 0)
44  endif
45  elseif(a%sys .eq. 'sph') then ! from 'sph'
46  if(sys .eq. 'xyz') then
47  call csph2ecent(a, b) ! to 'xyz'
48  elseif(sys .eq. 'llh') then
49  call csph2llh(a, b) ! to 'llh'
50  else
51  write(msg, *) 'error a%sys=',a%sys,' transCoord2'
52  call cerrormsg(msg, 0)
53  endif
54  else
55  write(msg, *) 'error a%sys=',a%sys,' transCoord2'
56  call cerrormsg(msg, 0)
57  endif
58  endif
59  end
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
subroutine csph2ecent(a, b)
Definition: csph2eCent.f:2
subroutine cecent2sph(a, bb)
Definition: ceCent2sph.f:2
subroutine cllh2ecent(llh, xyz)
subroutine cecent2llh(xyz, llh)
subroutine ctranscoord2(sys, a, b)
Definition: ctransCoord2.f:2
subroutine csph2llh(sph, llh)
Definition: csph2llh.f:2
subroutine cllh2sph(llh, sph)
Definition: cllh2sph.f:2
Definition: Zcoord.h:43