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

Go to the source code of this file.

Functions/Subroutines

subroutine ctranscoord2 (sys, a, b)
 

Function/Subroutine Documentation

◆ ctranscoord2()

subroutine ctranscoord2 ( character*(*)  sys,
type(coord a,
type(coord b 
)

Definition at line 2 of file ctransCoord2.f.

References cecent2llh(), cecent2sph(), cerrormsg(), cllh2ecent(), cllh2sph(), csph2ecent(), and csph2llh().

Referenced by atmncobptcl(), cgeomag(), cinitobs(), cmag2ecent(), and cresetposang().

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
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)
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz sys
Definition: ZavoidUnionMap.h:1
subroutine csph2llh(sph, llh)
Definition: csph2llh.f:2
subroutine cllh2sph(llh, sph)
Definition: cllh2sph.f:2
real(4), save a
Definition: cNRLAtmos.f:20
real(4), save b
Definition: cNRLAtmos.f:21
Definition: Zcoord.h:43
Here is the call graph for this function:
Here is the caller graph for this function: