COSMOS v7.655  COSMOSv7655
(AirShowerMC)
convCoord.f
Go to the documentation of this file.
1 ! prepare envirionmental variables in setupenv
2 ! at execution, give (x,y,z) to be converted from stdin
3 ! converted data is put in stdout.
4 !
5  program convcoord
6  implicit none
7 
8 #include "Ztrack.h"
9 #include "Ztrackp.h"
10 #include "Ztrackv.h"
11 #include "Zobs.h"
12 #include "Zobsv.h"
13 
14  integer kgetenv2
15  integer leng, icon
16  character*120 input
17  character*20 fromto
18  real*8 x, y, z
19  type(coord)::xyzin
20  type(coord)::xyzout
21 !
22  leng = kgetenv2("PARAM", input)
23  write(0,*) ' leng =', leng
24  call copenfw2(11, input(1:leng), 1, icon)
25  if(icon .ne. 1) then
26  write(0,*) input, icon
27  write(0,*) ' cannnot be opened'
28  stop 1234
29  endif
30  write(0,*) ' reading parameter file'
31  call creadparam(11)
32  close(11)
33  write(0,*) ' parameter has been read'
34  leng = kgetenv2("FROMTO", input)
35  write(0,*) ' form to is ', input
36  fromto=input(1:leng)
37 
38  call cinitobs
39  call cprintobs(0)
40  do while(.true.)
41  read(*,*, end=1000 ) x, y, z
42  if(fromto .eq. 'xyz2det') then
43  call csetcoord('xyz', x,y,z, xyzin)
44 ! to detector system
45  call cxyz2det(obssites(noofsites).pos.xyz,
46  * xyzin, xyzout)
47  elseif( fromto .eq. 'det2xyz') then
48  call csetcoord('det', x, y, z, xyzin)
49  call cdet2xyz(obssites(noofsites).pos.xyz,
50  * xyzin, xyzout)
51  elseif( fromto .eq. 'xyz2prim') then
52  call csetcoord('xyz', x, y, z, xyzin)
53  call cxyz2prim(obssites(noofsites).pos.xyz,
54  * xyzin, xyzout)
55 ! elseif( fromto .eq. 'prim2zyz') then
56 ! call csetCoord('prim', x, y, z, xyzin)
57 ! call cprim2xyz(ObsSites(NoOfSites).pos.xyz,
58 ! * xyzin, xyzout)
59  else
60  write(0,*) ' fromto=', fromto, ' not supported'
61  stop 2222
62  endif
63  write(*,'(3g12.4)') xyzout.x, xyzout.y, xyzout.z
64  enddo
65  1000 continue
66  end
67 !c#include "BlockData/cblkElemag.h"
subroutine cprintobs(io)
Definition: cprintObs.f:2
subroutine cinitobs
Definition: cinitObs.f:7
latitude latitude this system is used *****************************************************************! type coord sequence union map real z z in m endmap xyz map real ! latitude in deg is to the north ! longitude in deg is to the east *h ! height in m endmap llh map real ! polar angle ! azimuthal angle *radius ! radial distance endmap sph endunion character *sys ! which system xyz
Definition: Zcoord.h:25
block data cblkElemag data *AnihiE ! Eposi< 1 TeV, anihilation considered *X0/365.667/, ! radiation length of air in kg/m2 *Ecrit/81.e-3/, ! critical energy of air in GeV *MaxComptonE/1./, ! compton is considered below 1 GeV *MaxPhotoE/1.e-3/, ! above this, PhotoElectric effect neg. *MinPhotoProdE/153.e-3/, ! below 153 MeV, no gp --> hadrons ! scattering const not MeV *Knockon true
Definition: cblkElemag.h:7
subroutine cxyz2prim(base, a, b)
Definition: cxyz2prim.f:5
subroutine copenfw2(io, fnin, form, icon)
Definition: copenf.f:205
subroutine creadparam(io)
Definition: creadParam.f:5
subroutine csetcoord(sys, x, y, z, a)
Definition: csetCoord.f:2
subroutine cdet2xyz(det, a, b)
Definition: cxyz2det.f:48
program convcoord
Definition: convCoord.f:5
Definition: Zcoord.h:43
subroutine cxyz2det(det, a, b)
Definition: cxyz2det.f:7