28 #include "Zmagfield.h" 35 c ************************************
38 real*4 gnm(nmax, 0:nmax), hnm(nmax, nmax), year
39 real*4 gnmd(nmax, 0:nmax), hnmd(nmax, nmax)
41 common /zmagcoef/ gnm, gnmd, hnm, hnmd, year, nmx
42 c ************************************
46 real*4 r, sumn,
sume, sumd,
t, cost, sint,
x, tlonr, gmnc,
47 * cosml, sinml, hmnc,
temp 49 real*4 ssumd, ssumn, ssume
56 if(
llh.
sys .eq.
'llh')
then 63 if( abs(yearin-year) .gt. 7.)
then 66 *
' Year spec. for geomag data is invalid.', 1)
67 c elseif(abs(cdata.
lat) .gt. 90.)
then 68 elseif(abs(cdata.
r(1)) .gt. 90.5
d0)
then 70 c elseif(abs(cdata.
long) .gt. 360.)
then 71 elseif(abs(cdata.
r(2)) .gt. 360.5
d0)
then 73 c elseif(cdata.
h .gt. 5000.
d3)
then 74 elseif(cdata.
r(3) .gt. 100000.
d3)
then 76 c elseif(cdata.
h .lt. -3000.
d3)
then 77 elseif(cdata.
r(3) .lt. -3000.
d3)
then 81 c r=1./( 1.+cdata.
h/eradius )
82 r=1./( 1.+cdata.
r(3)/eradius )
86 c t=(90.-cdata.
lat)*torad
87 t=(90.-cdata.
r(1))*torad
91 c tlonr=cdata.
long*torad
92 tlonr=cdata.
r(2)*torad
103 ssumn = ssumn+ (gmnc*cosml+hmnc*sinml)*
105 ssume = ssume+
m *(-gmnc*sinml + hmnc*cosml)
107 ssumd = ssumd + (gmnc*cosml+ hmnc*sinml)
111 ssumd = ssumd + gmnc*
kpmnxn(
m,
n, sint,
x)
115 sumn = sumn + ssumn*
temp 117 sumd = sumd + ssumd*
temp *(
n + 1)
119 c original formula gives
data in nt.
129 call cerrormsg(
'Geometrical input data wrong', 0)
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
subroutine cerrormsg(msg, needrtn)
real *4 function kdpmnxsinn(m, n, sint, x)
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz r
! 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
latitude latitude this system is used *****************************************************************! type coord sequence union map real z z in m endmap xyz map real * lat
block data cblkIncident data *Za1ry *HeightOfInj d3
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 * long
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 llh
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz sys
real(4), dimension(:), allocatable, save h
real(4), dimension(:), allocatable, save temp
real *4 function kpmnxn(m, n, sint, x)
subroutine ctranscoord2(sys, a, b)
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
block data include Zlatfit h c fitting region data data data data data d0 data data d0 data data m
subroutine csetmagfield(sys, b1, b2, b3, b)
brief set Calculated magnetic field to /magfield/ b
real *4 function kpmnxisinn(m, n, sint, x)
! structure defining a particle at production ! Basic idea of what is to be contained in ! the particle structue is that dynamical ones should be included those derivable from the particle code ! is not included ******************************************************type fmom momentum sequence union map real e endmap map real * x
dE dx *! Nuc Int sampling table c