0% found this document useful (0 votes)
97 views17 pages

Ionspeed For

The program calculates the Planck wavelength and relativistically correct velocity of singly charged ions specified by their chemical symbol or atomic mass and an accelerating voltage. It initializes element names and properties and enters a loop to get an ion from the user and perform the calculations.

Uploaded by

kgrhoads
Copyright
© Attribution (BY)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
97 views17 pages

Ionspeed For

The program calculates the Planck wavelength and relativistically correct velocity of singly charged ions specified by their chemical symbol or atomic mass and an accelerating voltage. It initializes element names and properties and enters a loop to get an ion from the user and perform the calculations.

Uploaded by

kgrhoads
Copyright
© Attribution (BY)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 17

program ionspeed

*----------------------------------------------------------------------
*
*----------------------------------------------------------------------
* The purpose of this program is to calculate the Planck wavelength and
* (relativistically correct) velocity of singly charged ions specified
* by accelerating voltage.
* Ions are specified by chemical symbol for standard mass, or by ? or
* - to specify mass in a.m.u.'s; integral AMU values are used.
* e specifies electrons
* D specifies deuterons
* Tr specifies tritium ions
* use H to specify protons
* use He to specify alpha particles
*-----------------------------------------------------------------------
*
* Author: Kevin G. Rhoads
* Date: October 22, 2009, January 9, 2004, June 21, 2001
* Language: Fortran 77 w/ some extensions to access command line
* Compiler: Microsoft Fortran PDS v5.1
* Targets: DOS, Win 3.0
*
*-----------------------------------------------------------------------
character*2 specie,oldspecie,answer*1
real energy,planck,momentum,lambda,nrmom,relmom
parameter (planck=6.6260755d-34)
real*8 relenergy,gamma
real mass,m,voltage,mph,mach,fpf
*-------- naturally occuring, non-radioactive elements
real b,p,as,he,h
parameter (b=11.0,p=31.0,as=75.0,he=4.0,h=1.0)
real ar,in,sb,ga,si
parameter (ar=40.0,in=115.0,sb=122.0,ga=70.0,si=28.0)
real me,bi,n,al,o
parameter (me=9.109389e-31,bi=209.0,n=14.0,al=27.0,o=16.0)
real be,mg,ge,se,te,fe
parameter (be=9.0,mg=24.0,ge=73.0,se=80.0,te=128.0,fe=56.0)
real c_,cd,zn,s,ca,sn
parameter (c_=12.0,cd=112.0,zn=65.0,s=32.0,ca=40.0,sn=119.0)
real kr,xe,ne,ba,sr,cu
parameter (kr=84.0,xe=131.0,ne=20.0,ba=137.0,sr=88.0,cu=64.0)
real co,ni,li,na,k,rb
parameter (co=59.0,ni=59.0,li=7.0,na=23.0,k=39.0,rb=86.0)
real cs,f,cl,br,i,mn
parameter (cs=133.0,f=19.0,cl=35.0,br=80.0,i=127.0,mn=55.0)
real sc,ti,v,cr,y,zr,nb
parameter (sc=45.0,ti=48.0,v=51.0,cr=52.0,y=89.0,zr=91.0,nb=93.0)
real mo,ru,rh,pd,ag,hg
parameter (mo=96.0,ru=101.0,rh=103.0,pd=106.0,ag=108.0,hg=201.)
real au,pt,ir,os,re,w
parameter (au=197.0,pt=195.0,ir=192.0,os=180.0,re=186,w=184.0)
real ta,hf,la,ce,pr
parameter (ta=181.0,hf=178.0,la=139.0,ce=140.0,pr=141.0)
real nd,sm,eu,gd,tb
parameter (nd=144.0,sm=150.0,eu=152.0,gd=157.0,tb=159.0)
real dy,ho,er,tm,yb,lu
parameter (dy=163.0,ho=165.0,er=167.0,tm=169.0,yb=173.0,lu=175.0)
real pb,tl
parameter (pb=207.0,tl=204.0)
*------- radioactives and not naturally occuring elements
real at,ac,fr,np,pa
parameter (at=210.0,ac=227.0,fr=233.0,np=237.0,pa=231.0)
real po,pu,pm,ra,rn
parameter (po=209.0,pu=244.0,pm=147.0,ra=226.0,rn=222.0)
real th,u,tc
parameter (th=232.0,u=238.0,tc=98.0)
*--------
real amu,nonrelspeed,relspeed,c,beta,qe,start,end,delta,step
parameter (amu=1.6605402e-27,c=299792458.0,qe=1.602177e-19)
equivalence (delta,step)
logical relativistic,opened,ranging
character boron*5,phos*10,arsenic*7,antimony*8,silicon*7
character gallium*7,indium*6,electrons*9,argon*5,unknown*3
character helium*6,hydrogen*8,bismuth*7,nitrogen*8
character aluminum*8,oxygen*6,beryllium*9,magnesium*9,germanium*9
character selenium*8,tellurium*9,iron*4,carbon*6,cadmium*7
character zinc*4,sulfur*6,calcium*7,tin*3,krypton*7,xenon*5
character neon*4,barium*6,strontium*9,copper*9,cobalt*6,nickel*6
character nickle*6,lithium*7,sodium*6,potassium*9,rubidium*8
character cesium*6,fluorine*8,flourine*8,chlorine*8,bromine*7
equivalence (nickel,nickle),(fluorine,flourine)
character iodine*6,scandium*8,titanium*8,vanadium*8,chromium*8
character manganese*9,yttrium*7,zirconium*9,niobium*7
character molybdenum*10,ruthenium*9,rhodium*7,palladium*9
character silver*6,mercury*7,gold*4,platinum*8,iridium*7
character osmium*6,rhenium*7,tungsten*8,tantalum*8,hafnium*7
character lanthanum*9,cerium*6,praseodymium*12,neodymium*9
character samarium*8,europium*8,gadolinium*10,terbium*7
character dysprosium*10,holmium*7,erbium*6,thulium*7
character ytterbium*9,lutetium*8,lead*4,thallium*8
character astatine*8,actinium*8,francium*8
character neptunium*9,protactinium*12,polonium*8
character promethium*10,plutonium*9,radium*6,radon*5
character thorium*7,uranium*7,technetium*10
character*13 name
*-----
*
* One time initializations next
*
boron = 'Boron'
phos = 'Phosphorus'
arsenic = 'Arsenic'
antimony = 'Antimony'
silicon = 'Silicon'
gallium = 'Gallium'
indium = 'Indium'
electrons = 'electrons'
argon = 'Argon'
helium = 'Helium'
hydrogen = 'Hydrogen'
bismuth = 'Bismuth'
nitrogen = 'Nitrogen'
aluminum = 'Aluminum'
beryllium = 'Beryllium'
oxygen = 'Oxygen'
magnesium = 'Magnesium'
germanium = 'Germanium'
selenium = 'Selenium'
tellurium = 'Tellurium'
iron = 'Iron'
carbon = 'Carbon'
cadmium = 'Cadmium'
zinc = 'Zinc'
sulfur = 'Sulfur'
calcium = 'Calcium'
tin = 'Tin'
krypton = 'Krypton'
xenon = 'Xenon'
neon = 'Neon'
barium = 'Barium'
strontium = 'Strontium'
copper = 'Copper'
nickel = 'Nickel'
cobalt = 'Cobalt'
lithium = 'Lithium'
sodium = 'Sodium'
potassium = 'Potassium'
rubidium = 'Rubidium'
cesium = 'Cesium'
fluorine = 'Fluorine'
chlorine = 'Chlorine'
bromine = 'Bromine'
iodine = 'Iodine'
scandium = 'Scandium'
titanium = 'Titanium'
vanadium = 'Vanadium'
chromium = 'Chromium'
manganese = 'Manganese'
yttrium = 'Yttrium'
zirconium = 'Zirconium'
niobium = 'Niobium'
molybdenum = 'Molybdenum'
ruthenium = 'Ruthenium'
rhodium = 'Rhodium'
palladium = 'Palladium'
silver = 'Silver'
mercury = 'Mercury'
gold = 'Gold'
platinum = 'Platinum'
iridium = 'Iridium'
osmium = 'Osmium'
rhenium = 'Rhenium'
tungsten = 'Tungsten'
tantalum = 'Tantalum'
hafnium = 'Hafnium'
lanthanum = 'Lanthanum'
cerium = 'Cerium'
praseodymium = 'Praseodymium'
neodymium = 'Neodymium'
samarium = 'Samarium'
europium = 'Europium'
gadolinium = 'Gadolinium'
terbium = 'Terbium'
dysprosium = 'Dysprosium'
holmium = 'Holmium'
erbium = 'Erbium'
thulium = 'Thulium'
ytterbium = 'Ytterbium'
lutetium = 'Lutetium'
lead = 'Lead'
thallium = 'Thallium'
unknown = '???'
*------ radioactives and not naturally occuring element names
astatine = 'Astatine'
actinium = 'Actinium'
francium = 'Francium'
neptunium = 'Neptunium'
protactinium = 'Protactinium'
polonium = 'Polonium'
promethium = 'Promethium'
plutonium = 'Plutonium'
radium = 'Radium'
radon = 'Radon'
thorium = 'Thorium'
uranium = 'Uranium'
technetium = 'Technetium'
*-----
print *,' '
print *,' Ion Speed calculator '
print *,' '
print *,' Copyright 2009 Kevin G. Rhoads'
print *,' Executables may be freely distributed on "as-is" basis'
print *,' '
print *,' Version 1.39 October 22, 2009 '
print *,' '
specie = '--'
oldspecie = '--'
name = unknown
*
* END OF One time initializations
*
*-----
9999 continue
print *,' Specify specie [e.g., Ar (blank to specify by amu''s)]'
print *,' by chemical symbol [e to calculate for electrons]'
read (*,'(A)') specie
if (specie(1:1).eq.'-'.and.oldspecie(1:1).ne.'-') then
specie = oldspecie
elseif (specie(1:1).eq.'a'.or.specie(1:1).eq.'A') then
if (specie(2:2).eq.'r'.or.specie(2:2).eq.'R') then
mass = ar * amu
m = ar
specie ='Ar'
name = argon
elseif (specie(2:2).eq.'s'.or.specie(2:2).eq.'S') then
mass = as * amu
m = as
specie ='As'
name = arsenic
elseif (specie(2:2).eq.'l'.or.specie(2:2).eq.'L') then
mass = al * amu
m = al
specie ='Al'
name = aluminum
elseif (specie(2:2).eq.'t'.or.specie(2:2).eq.'T') then
mass = at * amu
m = at
specie ='At'
name = astatine
elseif (specie(2:2).eq.'c'.or.specie(2:2).eq.'C') then
mass = ac * amu
m = ac
specie ='Ac'
name = actinium
elseif (specie(2:2).eq.'u'.or.specie(2:2).eq.'U') then
mass = au * amu
m = au
specie ='Au'
name = gold
elseif (specie(2:2).eq.'g'.or.specie(2:2).eq.'G') then
mass = ag * amu
m = ag
specie ='Ag'
name = silver
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'b'.or.specie(1:1).eq.'B') then
if (specie(2:2).eq.' ') then
mass = b * amu
m = b
specie ='B '
name = boron
elseif (specie(2:2).eq.'i'.or.specie(2:2).eq.'I') then
mass = bi * amu
m = bi
specie ='Bi'
name = bismuth
elseif (specie(2:2).eq.'e'.or.specie(2:2).eq.'E') then
mass = be * amu
m = be
specie ='Be'
name = beryllium
elseif (specie(2:2).eq.'a'.or.specie(2:2).eq.'A') then
mass = ba * amu
m = ba
specie ='Ba'

name = barium
elseif (specie(2:2).eq.'r'.or.specie(2:2).eq.'R') then
mass = br * amu
m = br
specie ='Br'
name = bromine
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'c'.or.specie(1:1).eq.'C') then
if (specie(2:2).eq.' ') then
mass = c_ * amu
m = c_
*
* c is speed of light and c_ is mass of carbon in a.m.u.'s
*
specie ='C '
name = carbon
elseif (specie(2:2).eq.'e'.or.specie(2:2).eq.'E') then
mass = ce * amu
m = ce
specie ='Ce'
name = cerium
elseif (specie(2:2).eq.'d'.or.specie(2:2).eq.'D') then
mass = cd * amu
m = cd
specie ='Cd'
name = cadmium
elseif (specie(2:2).eq.'a'.or.specie(2:2).eq.'A') then
mass = ca * amu
m = ca
specie ='Ca'
name = calcium
elseif (specie(2:2).eq.'l'.or.specie(2:2).eq.'L') then
mass = cl * amu
m = cl
specie ='Cl'
name = chlorine
elseif (specie(2:2).eq.'u'.or.specie(2:2).eq.'U') then
mass = cu * amu
m = cu
specie ='Cu'
name = copper
elseif (specie(2:2).eq.'o'.or.specie(2:2).eq.'O') then
mass = co * amu
m = co
specie ='Co'
name = cobalt
elseif (specie(2:2).eq.'r'.or.specie(2:2).eq.'R') then
mass = cr * amu
m = cr
specie ='Cr'
name = chromium
elseif (specie(2:2).eq.'s'.or.specie(2:2).eq.'S') then
mass = cs * amu
m = cs
specie ='Cs'
name = cesium
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'d'.or.specie(1:1).eq.'D') then
if (specie(2:2).eq.'y'.or.specie(2:2).eq.'Y') then
mass = dy * amu
m = dy
specie ='Dy'
name = dysprosium
elseif (specie(2:2).eq.' ') then
mass = 2.0 * amu
m = 2.0
specie = 'H*'
name = 'Deuterium'
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'e'.or.specie(1:1).eq.'E') then
if (specie(2:2).eq.'r'.or.specie(2:2).eq.'R') then
mass = er * amu
m = er
specie ='Er'
name = Erbium
elseif (specie(2:2).eq.'u'.or.specie(2:2).eq.'U') then
mass = eu * amu
m = eu
specie ='Eu'
name = Europium
elseif (specie(2:2).eq.' ') then
m = me / amu
mass = me
specie = 'e '
name = electrons
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'f'.or.specie(1:1).eq.'F') then
if (specie(2:2).eq.' ') then
mass = f * amu
m = f
specie ='F '
name = fluorine
elseif (specie(2:2).eq.'e'.or.specie(2:2).eq.'E') then
mass = fe * amu
m = fe
specie ='Fe'
name = iron
elseif (specie(2:2).eq.'r'.or.specie(2:2).eq.'R') then
mass = fr * amu
m = fr
specie ='Fr'
name = francium
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'g'.or.specie(1:1).eq.'G') then
if (specie(2:2).eq.'a'.or.specie(2:2).eq.'A') then
mass = ga * amu
m = ga
specie ='Ga'
name = gallium
elseif (specie(2:2).eq.'e'.or.specie(2:2).eq.'E') then
mass = ge * amu
m = ge
specie ='Ge'
name = germanium
elseif (specie(2:2).eq.'d'.or.specie(2:2).eq.'D') then
mass = gd * amu
m = gd
specie ='Gd'
name = gadolinium
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'h'.or.specie(1:1).eq.'H') then
if (specie(2:2).eq.'e'.or.specie(2:2).eq.'E') then
mass = he * amu
m = he
specie = 'He'
name = helium
elseif (specie(2:2).eq.'f'.or.specie(2:2).eq.'F') then
mass = hf * amu
m = hf
specie = 'Hf'
name = hafnium
elseif (specie(2:2).eq.'g'.or.specie(2:2).eq.'G') then
mass = hg * amu
m = hg
specie = 'Hg'
name = mercury
elseif (specie(2:2).eq.'o'.or.specie(2:2).eq.'O') then
mass = ho * amu

m = ho
specie = 'Ho'
name = holmium
elseif (specie(2:2).eq.' ') then
mass = h * amu
m = h
specie = 'H '
name = hydrogen
elseif (specie(2:2).eq.'*') then
mass = 2.0 * amu
m = 2.0
specie = 'H*'
name = 'Deuterium'
elseif (specie(2:2).eq.'*') then
mass = 3.0 * amu
m = 3.0
specie = 'H#'
name = 'Tritium'
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'i'.or.specie(1:1).eq.'I') then
if (specie(2:2).eq.' ') then
mass = i * amu
m = i
specie ='I '
name = iodine
elseif (specie(2:2).eq.'n'.or.specie(2:2).eq.'N') then
mass = in * amu
m = in
specie ='In'
name = indium
elseif (specie(2:2).eq.'r'.or.specie(2:2).eq.'R') then
mass = ir * amu
m = ir
specie ='Ir'
name = iridium
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'k'.or.specie(1:1).eq.'K') then
if (specie(2:2).eq.' ') then
mass = k * amu
m = k
specie ='K '
name = potassium
elseif (specie(2:2).eq.'r'.or.specie(2:2).eq.'R') then
mass = kr * amu
m = kr
specie ='Kr'
name = Krypton
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'l'.or.specie(1:1).eq.'L') then
if (specie(2:2).eq.'i'.or.specie(2:2).eq.'I') then
mass = li * amu
m = li
specie ='Li'
name = lithium
elseif (specie(2:2).eq.'a'.or.specie(2:2).eq.'A') then
mass = la * amu
m = la
specie ='La'
name = lanthanum
elseif (specie(2:2).eq.'u'.or.specie(2:2).eq.'U') then
mass = lu * amu
m = lu
specie ='Lu'
name = lutetium
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'m'.or.specie(1:1).eq.'M') then
if (specie(2:2).eq.'g'.or.specie(2:2).eq.'G') then
mass = mg * amu
m = mg
specie ='Mg'
name = magnesium
elseif (specie(2:2).eq.'n'.or.specie(2:2).eq.'N') then
mass = mn * amu
m = mn
specie ='Mn'
name = manganese
elseif (specie(2:2).eq.'o'.or.specie(2:2).eq.'O') then
mass = mo * amu
m = mo
specie ='Mo'
name = molybdenum
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'n'.or.specie(1:1).eq.'N') then
if (specie(2:2).eq.' ') then
mass = n * amu
m = n
specie ='N '
name = nitrogen
elseif (specie(2:2).eq.'a'.or.specie(2:2).eq.'A') then
mass = na * amu
m = na

specie ='Na'
name = sodium
elseif (specie(2:2).eq.'b'.or.specie(2:2).eq.'B') then
mass = nb * amu
m = nb
specie ='Nb'
name = niobium
elseif (specie(2:2).eq.'d'.or.specie(2:2).eq.'D') then
mass = nd * amu
m = nd
specie ='Nd'
name = neodymium
elseif (specie(2:2).eq.'e'.or.specie(2:2).eq.'E') then
mass = ne * amu
m = ne
specie ='Ne'
name = neon
elseif (specie(2:2).eq.'i'.or.specie(2:2).eq.'I') then
mass = ni * amu
m = ni
specie ='Ni'
name = nickel
elseif (specie(2:2).eq.'p'.or.specie(2:2).eq.'P') then
mass = np * amu
m = np
specie ='Np'
name = neptunium
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'o'.or.specie(1:1).eq.'O') then
if (specie(2:2).eq.' ') then
mass = o * amu
m = o
specie ='O '
name = oxygen
elseif (specie(2:2).eq.'s'.or.specie(2:2).eq.'S') then
mass = os * amu
m = os
specie ='Os'
name = osmium
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'p'.or.specie(1:1).eq.'P') then
if (specie(2:2).eq.' ') then
mass = p * amu
m = p
specie ='P '
name = phos
elseif (specie(2:2).eq.'b'.or.specie(2:2).eq.'B') then
mass = pb * amu
m = pb
specie ='Pb'
name = lead
elseif (specie(2:2).eq.'d'.or.specie(2:2).eq.'D') then
mass = pd * amu
m = pd
specie ='Pd'
name = palladium
elseif (specie(2:2).eq.'t'.or.specie(2:2).eq.'T') then
mass = pt * amu
m = pt
specie ='Pt'
name = platinum
elseif (specie(2:2).eq.'r'.or.specie(2:2).eq.'R') then
mass = pr * amu
m = pr
specie ='Pr'
name = praseodymium
elseif (specie(2:2).eq.'a'.or.specie(2:2).eq.'A') then
mass = pa * amu
m = pa
specie ='Pa'
name = protactinium
elseif (specie(2:2).eq.'o'.or.specie(2:2).eq.'O') then
mass = po * amu
m = po
specie ='Po'
name = polonium
elseif (specie(2:2).eq.'m'.or.specie(2:2).eq.'M') then
mass = pm * amu
m = pm
specie ='Pm'
name = promethium
elseif (specie(2:2).eq.'u'.or.specie(2:2).eq.'U') then
mass = pu * amu
m = pu
specie ='Pu'
name = plutonium
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'r'.or.specie(1:1).eq.'R') then
if (specie(2:2).eq.'b'.or.specie(2:2).eq.'B') then
mass = rb * amu
m = rb
specie ='Rb'
name = rubidium
elseif (specie(2:2).eq.'e'.or.specie(2:2).eq.'E') then
mass = re * amu
m = re
specie ='Re'
name = rhenium
elseif (specie(2:2).eq.'h'.or.specie(2:2).eq.'H') then
mass = rh * amu
m = rh
specie ='Rh'
name = rhodium
elseif (specie(2:2).eq.'u'.or.specie(2:2).eq.'U') then
mass = ru * amu
m = ru
specie ='Ru'
name = ruthenium
elseif (specie(2:2).eq.'a'.or.specie(2:2).eq.'A') then
mass = ra * amu
m = ra
specie ='Ra'
name = radium
elseif (specie(2:2).eq.'n'.or.specie(2:2).eq.'N') then
mass = rn * amu
m = rn
specie ='Rn'
name = radon
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'s'.or.specie(1:1).eq.'S') then
if (specie(2:2).eq.' ') then
mass = s * amu
m = s
specie ='S '
name = sulfur
elseif (specie(2:2).eq.'b'.or.specie(2:2).eq.'B') then
mass = sb * amu
m = sb
specie ='Sb'
name = antimony
elseif (specie(2:2).eq.'c'.or.specie(2:2).eq.'C') then
mass = sc * amu
m = sc
specie ='Sc'
name = scandium
elseif (specie(2:2).eq.'i'.or.specie(2:2).eq.'I') then
mass = si * amu
m = si
specie ='Si'
name = silicon
elseif (specie(2:2).eq.'e'.or.specie(2:2).eq.'E') then
mass = se * amu
m = se
specie ='Se'
name = selenium
elseif (specie(2:2).eq.'m'.or.specie(2:2).eq.'M') then
mass = sm * amu
m = sm
specie ='Sm'
name = samarium
elseif (specie(2:2).eq.'n'.or.specie(2:2).eq.'N') then
mass = sn * amu
m = sn
specie ='Sn'
name = tin
elseif (specie(2:2).eq.'r'.or.specie(2:2).eq.'R') then
mass = sr * amu
m = sr
specie ='Sr'
name = strontium
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'t'.or.specie(1:1).eq.'T') then
if (specie(2:2).eq.'e'.or.specie(2:2).eq.'E') then
mass = te * amu
m = te
specie ='Te'
name = tellurium
elseif (specie(2:2).eq.'a'.or.specie(2:2).eq.'A') then
mass = ta * amu
m = ta
specie ='Ta'
name = tantalum
elseif (specie(2:2).eq.'b'.or.specie(2:2).eq.'B') then
mass = tb * amu
m = tb
specie ='Tb'
name = terbium
elseif (specie(2:2).eq.'c'.or.specie(2:2).eq.'C') then
mass = tc * amu
m = tc
specie ='Tc'
name = technetium
elseif (specie(2:2).eq.'*') then
mass = 99.0 * amu
m = 99.0
specie ='Tc'
name = technetium//'-99'
elseif (specie(2:2).eq.'h'.or.specie(2:2).eq.'H') then
mass = th * amu
m = th
specie ='Th'
name = thorium
elseif (specie(2:2).eq.'i'.or.specie(2:2).eq.'I') then
mass = ti * amu
m = ti
specie ='Ti'
name = titanium
elseif (specie(2:2).eq.'l'.or.specie(2:2).eq.'L') then
mass = tl * amu
m = tl
specie ='Tl'
name = thallium
elseif (specie(2:2).eq.'m'.or.specie(2:2).eq.'M') then
mass = tm * amu
m = tm
specie ='Tm'
name = thulium
elseif (specie(2:2).eq.'r'.or.specie(2:2).eq.'R') then
mass = 3.0 * amu
m = 3.0
specie = 'H#'
name = 'Tritium'
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'u'.or.specie(1:1).eq.'U') then
if (specie(2:2).eq.' ') then
mass = u * amu
m = u
specie ='U '
name = uranium
elseif (specie(2:2).eq.'*'.or.specie(2:2).eq.'5') then
mass = 235.0 * amu
m = 235.0
specie ='U*'
name = uranium//'-235'
elseif (specie(2:2).eq.'#'.or.specie(2:2).eq.'3') then
mass = 233.0 * amu
m = 233.0
specie ='U#'
name = uranium//'-233'
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'v'.or.specie(1:1).eq.'V') then
if (specie(2:2).eq.' ') then
mass = v * amu
m = v
specie ='V '
name = vanadium
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'w'.or.specie(1:1).eq.'W') then
if (specie(2:2).eq.' ') then
mass = w * amu
m = w
specie ='W '
name = tungsten
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'x'.or.specie(1:1).eq.'X') then
if (specie(2:2).eq.'e'.or.specie(2:2).eq.'E') then
mass = xe * amu
m = xe
specie ='Xe'
name = xenon
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'y'.or.specie(1:1).eq.'Y') then
if (specie(2:2).eq.' ') then
mass = y * amu
m = y
specie ='Y '
name = yttrium
elseif (specie(2:2).eq.'b'.or.specie(2:2).eq.'b') then
mass = yb * amu
m = yb
specie ='Yb'
name = ytterbium
else
mass = -1
m = -1
name = unknown
endif
elseif (specie(1:1).eq.'z'.or.specie(1:1).eq.'Z') then
if (specie(2:2).eq.'n'.or.specie(2:2).eq.'N') then
mass = zn * amu
m = zn
specie ='Zn'
name = zinc
elseif (specie(2:2).eq.'r'.or.specie(2:2).eq.'R') then
mass = zr * amu
m = zr
specie ='Zr'
name = zirconium
else
mass = -1
m = -1
name = unknown
endif
else
mass = -1
m = -1
name = unknown
endif
9001 continue
if (mass.le.0.0) then
print *,' Specify ion specie mass in a.m.u.s'
read (*,*,err=9001) mass
m = mass
mass = mass * amu
specie = '??'
name = unknown
goto 9001
endif
if (m.lt.0.0) then
m = mass / amu
endif
9002 continue
ranging = .false.
Print *,' Specify acceleration voltage in kV (positive) '
read (*,*,err=9002) energy
if (energy.le.0.0) goto 9002
9012 continue
energy = energy * 1000.0
voltage = energy
* convert from electron volts to joules
energy = energy * qe
relenergy = energy + mass * c * c
nrmom = sqrt (2.0 * mass * energy)
nonrelspeed = nrmom / mass
gamma = relenergy / (mass * c * c)
if ( (gamma-1.0d0) .lt. 1.0d-8 ) then
beta = nonrelspeed / c
relspeed = nonrelspeed
relmom = nrmom
relativistic = .false.
else
beta = sqrt( 1.0 - 1.0 / (gamma * gamma) )
relspeed = beta * c
relmom = gamma * mass * relspeed
relativistic = .true.
endif
momentum = relmom
lambda = planck / momentum
inquire (unit=11,opened=opened)
if (.not.opened) then
open (unit=11,file='IONSPEED.LOG',status='unknown',err=9901)
goto 9902
9901 continue
open (unit=11,file='NUL',status='unknown',err=9902)
endif
9902 continue
if (.not.ranging) then
print *,'________________________________________',
& '_______________________________________'
endif
if (voltage.gt.1000.0) then
print 7001,' For ',name(1:len_trim(name)),' (',specie,
& '), mass=',m,' [amu] at ',voltage/1000.0,' [kV]:'
write (11,7001)' For ',name(1:len_trim(name)),' (',specie,
& '), mass=',m,' [amu] at ',voltage/1000.0,' [kV]:'
elseif (voltage.lt.1.0) then
print 7001,' For ',name(1:len_trim(name)),' (',specie,
& '), mass=',m,' [amu] at ',voltage*1000.0,' [mV]:'
write (11,7001)' For ',name(1:len_trim(name)),' (',specie,
& '), mass=',m,' [amu] at ',voltage*1000.0,' [mV]:'
else
print 7001,' For ',name(1:len_trim(name)),' (',specie,
& '), mass=',m,' [amu] at ',voltage,' [V]:'
write (11,7001)' For ',name(1:len_trim(name)),' (',specie,
& '), mass=',m,' [amu] at ',voltage,' [V]:'
endif
print *,' '
write (11,*) ' '
* 7001 format(a,a,a,a2,a,g11.5,a,g11.5,a)
if (.not.ranging) then
print 7002,' Planck wavelength [m] = ',lambda
print 7002,' Planck wavelength [cm] = ',lambda*100.0
print 7002,' Planck wavelength [A] = ',lambda*(1.0e10)
print *,' '
endif
write (11,7002) ' Planck wavelength [m] = ',lambda
write (11,7002) ' Planck wavelength [cm] = ',lambda*100.0
write (11,7002) ' Planck wavelength [A] = ',lambda*(1.0e10)
write (11,*) ' '
if (relativistic) then
if (.not.ranging)
& print 7002,' Relativistic Speed [m/s] = ',relspeed
write (11,7002) ' Relativistic Speed [m/s] = ',relspeed
mph = relspeed*(39.37/12.0)
fpf = relspeed*(14.0*24.0*60.0*60.0/201.168)
mach = mph/1090.0
if (.not.ranging) then
print 7002,' Relativistic Speed [cm/s] = ',
& relspeed*100.0
print 7002,' Relativistic Speed [mm/micros] = ',
& relspeed/1000.0
print 7002,' Relativistic Speed [ft/s] = ',mph
endif
write (11,7002) ' Relativistic Speed [cm/s] = ',
& relspeed*100.0
write (11,7002) ' Relativistic Speed [mm/micros] = ',
& relspeed/1000.0
write (11,7002) ' Relativistic Speed [km/s] = ',
& relspeed/1000.0
write (11,7002) ' Relativistic Speed [ft/s] = ',mph
mph = mph*(60.0/88.0)
if (.not.ranging) then
print 7002,' Relativistic Speed [mph] = ',mph
print 7002,' Relativistic Speed [Knots]= ',mph/1.1516
print 7002,' Relativistic Speed [Mach] = ',mach
print 7002,' Relativistic Speed [mps] = ',mph/3600.
print 7003,' beta (v/c) = ',beta
d print 7002,' Speed [Furlongs/Fortnight] ',fpf
print 7002,' relspeed / nonrelspeed = ',
& relspeed / nonrelspeed
print 7002,' microSeconds / meter = ',1.0e6/relspeed
print 7002,' microSeconds / cm = ',1.0e4/relspeed
endif

write (11,7002)' Relativistic Speed [mph] = ',mph


write (11,7002)' Relativistic Speed [Knots]= ',mph/1.1516
write (11,7002)' Relativistic Speed [Mach] = ',mach
write (11,7002)' Relativistic Speed [mps] = ',mph/3600.
write (11,7003)' beta (v/c) = ',beta
write (11,7002)' Speed [Furlongs/Fortnight] ',fpf
write (11,7002)' relspeed / nonrelspeed = ',
& relspeed / nonrelspeed
write (11,7002) ' milliSeconds / km = ',
& 1.0e6/relspeed
write (11,7002) ' microSeconds / meter = ',
& 1.0e6/relspeed
write (11,7002) ' microSeconds / cm = ',
& 1.0e4/relspeed
write (11,7002) ' microSeconds / km = ',
& 1.0e9/relspeed
else
if (.not.ranging) then
print 7002,' Non-Relativistic Speed [m/s] = ',nonrelspeed
print 7002,' Relativistic Speed [mm/micros] = ',
& nonrelspeed/1000.0
endif
write (11,7002) ' Non-Relativistic Speed [m/s] = ',
& nonrelspeed
mph = nonrelspeed*(39.37/12.0)
fpf = nonrelspeed*(14.0*24.0*60.0*60.0/201.168)
mach = mph/1090.0
if (.not.ranging) then
print 7002,' Non-Relativistic Speed [cm/s] = ',
& nonrelspeed*100.0
print 7002,' Non-Relativistic Speed [mm/micros] = ',
& nonrelspeed/1000.0
print 7002,' Non-Relativistic Speed [km/s] = ',
& nonrelspeed/1000.0
print 7002,' Non-Relativistic Speed [ft/s] = ',mph
endif
write (11,7002) ' Non-Relativistic Speed [cm/s] = ',
& nonrelspeed*100.0
write (11,7002) ' Non-Relativistic Speed [ft/s] = ',mph
mph = mph*(60.0/88.0)
if (.not.ranging) then
print 7002,' Non-Relativistic Speed [mph] = ',mph
print 7002,' Non-Relativistic Speed [Knots]= ',mph/1.1516
print 7002,' Non-Relativistic Speed [Mach] = ',mach
print 7002,' Non-Relativistic Speed [mi/s] = ',mph/3600.
print 7003,' beta (v/c) = ',beta
d print 7002,' Speed [Furlongs/Fortnight] ',fpf
print *,' '
print 7002,' microSeconds / meter = ',
& 1.0e6/nonrelspeed
print 7002,' microSeconds / cm = ',
& 1.0e4/nonrelspeed
endif
write (11,7002) ' Non-Relativistic Speed [mph] = ',mph
write (11,7002) ' Non-Relativistic Speed [Knots]= ',mph/1.1516
write (11,7002) ' Non-Relativistic Speed [Mach] = ',mach
write (11,7002) ' Non-Relativistic Speed [mi/s] = ',mph/3600.
write (11,7002) ' Non-Relativistic Speed [mm/micros] = ',
& nonrelspeed/1000.0
write (11,7002) ' Non-Relativistic Speed [km/s] = ',
& nonrelspeed/1000.0
write (11,7003) ' beta (v/c) = ',beta
write (11,7002) ' Speed [Furlongs/Fortnight] ',fpf
write (11,*) ' '
write (11,7002) ' milliSeconds / km = ',
& 1.0e6/nonrelspeed
write (11,7002) ' microSeconds / meter = ',
& 1.0e6/nonrelspeed
write (11,7002) ' microSeconds / cm = ',
& 1.0e4/nonrelspeed
write (11,7002) ' microSeconds / km = ',
& 1.0e9/nonrelspeed
endif
if (.not.ranging) then
print *,'________________________________________',
& '_______________________________________'
print *,' '
endif
write (11,*) '________________________________________',

& '_______________________________________'
print *,' '
write (11,*) ' '
9019 continue
if (ranging) then
energy = start
start = start + step
if (start.lt.end) goto 9012
ranging = .false.
goto 9019
else
print *,' another? ',
& '[N/y/v/r - v for another voltage, same specie]'
print *,' [N/y/v/r - r to compute range to IONSPEED.LOG]'
read (*,'(A)',err=9003) answer
oldspecie = specie
if (answer.eq.'v'.or.answer.eq.'V') goto 9002
if (answer.eq.'r'.or.answer.eq.'R') then
9013 continue
print *,' Start voltage (kV) = ?'
read (*,*,err=9013) start
if (start.le.0) then
print *,' start should be > 0'
goto 9013
endif
9014 continue
print *,' End voltage (kV) = ?'
read (*,*,err=9014) end
if (end.le.start) then
print *,' end should be > ',start
goto 9014
endif
9015 continue
print *,' Voltage step (kV) = ?'
read (*,*,err=9015) step
if (step.le.0) then
print *,' step should be > 0'
goto 9015
endif
ranging = .true.
energy = start
start = start + step
goto 9012
endif
if (answer.eq.'y'.or.answer.eq.'Y') goto 9999
endif
9003 continue
close (unit=10,status='keep',err=9004)
9004 continue
stop ' Bye'
*-----
7001 format(a,a,a,a2,a,g11.5,a,g11.5,a)
* 7002 format (a,g13.6)
7002 format (a,g18.9)
7003 format (a,f18.9)
7004 format (a,e18.9)
end

You might also like