C C Function PHOTON - Calculate bremsstrahlung yield per el,MeV C for a given beam C energy and photon energy C DOUBLE PRECISION function photon(ebeam,egam,trad,zrad,arad) implicit none C DOUBLE PRECISION trad,zrad,arad DOUBLE PRECISION egam,ebeam,CE,CN C C Functions C DOUBLE PRECISION bethe,phie C if(egam.gt.ebeam) then write(6,*) 'You sould not see this message' photon = 0.0 return endif C call phinit(zrad) CE=3.4894E-4*zrad/arad CN=CE*zrad C photon = trad*(CN*BETHE(ebeam,egam)+CE*PHIE(ebeam,egam))/egam C return end C C************************************************************************ C * C This is PHIN, the nuclear bremsstrahlung package. It contains * C four modules: * C 1) DELTOL * C 2) TIP * C 3) BETHE * C 4) PHIN * C * C DELTOL(Z,DEL,TOL): * C Subroutine. Provides values for DEL and TOL for * C use by TIP. * C * C TIP(T0,DEL,TOL,PHITIP,KMATCH) * C Subroutine. Calculates the endpoint yeild (PHITIP) and * C the photon energy (KMATCH) at which a straight line is * C joined to the BETHE distribution. T0 is the incident * C electron kinetic energy. DEL and TOL are matching * C criteria. * C * C BETHE(T0,K): * C Subroutine. Calculates the BETHE distribution. * C * C PHIN(T0,K,KMATCH,PHITIP) * C Function routine. Calculates the nuclear bremsstrahlung * C yield at photon energy=K from electrons of kinetic * C energy=T0. If K .GT. KMATCH, it interpolates linearly * C between (PHITIP,T0) and (BETHE(T0,KMATCH),KMATCH). * C For K .LT. KMATCH, it simply calls BETHE. * C * C************************************************************************ C * C note: the common /BETH/ must be loaded before using any of * C these modules. * C * C************************************************************************ C SUBROUTINE PHINIT(Z) IMPLICIT NONE DOUBLE PRECISION Z DOUBLE PRECISION FCOUL,ZTHIRD,Z137,Z137SQ,Z23,ALOGZ23,ALOGZ3 DOUBLE PRECISION CTIP1,CTIP2,CTIP3,CTIP4,DEL,TOL DOUBLE PRECISION X,PI,PIZ137,G,F DOUBLE PRECISION GAMF COMMON/BETH/ FCOUL,ZTHIRD,Z137,Z137SQ, * Z23,ALOGZ23 COMMON/TIPCB/CTIP1,CTIP2,CTIP3,CTIP4,DEL,TOL GAMF(X)=1.-0.5748646*(X-1)+0.9512363*(X-1)**2 ! GAMMA FUNCTION, 1