22 #include "Zmagfield.h" 30 if( a%sys .eq. sys)
then 32 elseif(sys .eq.
'xyz')
then 34 elseif(a%sys .eq.
'xyz')
then 35 if(sys .eq.
'hva')
then 37 elseif(sys .eq.
'ned')
then 40 write(msg, *)
' ctransMagTo: sys=', sys,
' invalid' 43 elseif(a%sys .eq.
'hva')
then 44 if( sys .eq.
'ned')
then 47 write(msg, *)
' ctransMagTo: sys=', sys,
' invalid' 50 elseif(a%sys .eq.
'ned')
then 51 if(sys .eq.
'hva')
then 54 write(msg, *)
' ctransMagTo: sys=', sys,
' invalid' 58 write(msg, *)
' ctransMagTo: a%sys=', a%sys,
' invalid' 67 #include "Zmagfield.h" 76 if(a%sys .eq.
'ned')
then 78 elseif(a%sys .eq.
'hva')
then 82 write(msg, *)
'cMag2eCent: mag system=',
84 *
' not yet supported' 97 #include "Zmagfield.h" 104 real*8 cosphi, sinphi, coslam, sinlam, x, y, z
106 if(pos%sys .ne.
'llh')
then 107 write(msg, *)
'cned2eCent: input pos%sys=',pos%sys,
108 *
' invalid. should be llh' 112 cosphi =
cos(pos%lat*torad)
113 sinphi = sin(pos%lat*torad)
114 coslam =
cos(pos%long*torad)
115 sinlam = sin(pos%long*torad)
116 x = - (a%d *cosphi + a%n*sinphi) *
119 y = - (a%d *cosphi + a%n*sinphi)* sinlam
121 z = - a%d *sinphi + a%n* cosphi
123 cosphi =
cos(pos%r(1)*torad)
124 sinphi = sin(pos%r(1)*torad)
125 coslam =
cos(pos%r(2)*torad)
126 sinlam = sin(pos%r(2)*torad)
127 x = - (a%z *cosphi + a%x*sinphi) *
130 y = - (a%z *cosphi + a%x*sinphi)* sinlam
132 z = - a%z *sinphi + a%x* cosphi
139 #include "Zglobalc.h" 141 #include "Zmagfield.h" 146 real*8 cosphi, sinphi, coslam, sinlam, x, y, z
147 real*8 adcans, n, e, d
150 if(pos%sys .ne.
'llh')
then 151 write(msg, *)
'cxyz2ned: input pos%sys=',pos%sys,
152 *
' invalid. should be llh' 155 if(a%sys .ne.
'xyz')
then 156 write(msg, *)
'cxyz2ned: a%sys=', a%sys,
' invalid' 161 cosphi =
cos(pos%lat*torad)
162 sinphi = sin(pos%lat*torad)
163 coslam =
cos(pos%long*torad)
164 sinlam = sin(pos%long*torad)
169 adcans = x * coslam + y *sinlam
170 d =- ( adcans*cosphi + z * sinphi )
172 n = - adcans*sinphi + z * cosphi
175 e = -x*sinlam + y*coslam
178 cosphi =
cos(pos%r(1)*torad)
179 sinphi = sin(pos%r(1)*torad)
180 coslam =
cos(pos%r(2)*torad)
181 sinlam = sin(pos%r(2)*torad)
186 adcans = x * coslam + y *sinlam
187 d =- ( adcans*cosphi + z * sinphi )
188 n = - adcans*sinphi + z * cosphi
191 e = -x*sinlam + y*coslam
198 #include "Zglobalc.h" 200 #include "Zmagfield.h" 219 #include "Zglobalc.h" 220 #include "Zmagfield.h" 227 h = sqrt(a%n**2+a%e**2)
228 if(a%e .eq. 0. .and. a%n .eq. 0.)
then 231 ang = atan2(a%e, a%n)*todeg
235 h = sqrt(a%x**2+a%y**2)
236 if(a%y .eq. 0. .and. a%x .eq. 0.)
then 239 ang = atan2(a%y, a%x)*todeg
250 #include "Zglobalc.h" 252 #include "Zmagfield.h" 258 n = a%h *
cos(a%a*torad)
259 e = a%h *sin(a%a*torad)
262 n = a%x *
cos(a%z*torad)
263 e = a%x *sin(a%z*torad)
subroutine cerrormsg(msg, needrtn)
subroutine chva2ned(a, b)
! for length to thickness conversion or v v ! integer maxnodes real Hinf ! This is used when making table for dim simulation ! The slant length for vertical height to km is ! divided by LenStep m steps ! It can cover the slant length of about km for cos
subroutine cned2ecent(pos, a, b)
subroutine cned2hva(a, b)
subroutine ctranscoord2(sys, a, b)
subroutine cmag2ecent(pos, a, b)
subroutine csetmagfield(sys, b1, b2, b3, b)
brief set Calculated magnetic field to /magfield/ b
subroutine ctransmagto(sys, pos, a, b)
subroutine cxyz2ned(pos, a, b)
subroutine cxyz2hva(pos, a, b)