主题:求帮翻译一段Fortran代码
Fortran:
implicit none
integer*4 I,IQIN,IRIN
real*8 XIN,YIN,ZIN,EIN,WTIN,UIN,VIN,WIN
COMMON/BOUNDS/ECUT(3),PCUT(3),VACDST
real*8 ECUT, PCUT, VACDST
COMMON/GEOM/ZBOUND
real*8 ZBOUND
COMMON/MEDIA/ RLC(1),RLDU(1),RHO(1),MSGE(1),MGE(1),MSEKE(1),MEKE(1
*),MLEKE(1),MCMFP(1),MRANGE(1),IRAYLM(1), MEDIA(24,1), photon_xsect
*ions, comp_xsections, apx,upx, eii_xfile,NMED
CHARACTER*4 MEDIA
real*8 RLC, RLDU, RHO, apx, upx
integer*4 MSGE, MGE, MSEKE, MEKE, MLEKE, MCMFP, MRANGE, IRAYLM,
* NMED
character*16 eii_xfile
character*16 photon_xsections
character*16 comp_xsections
COMMON/MISC/ DUNIT,KMPI,KMPO,RHOR(3),MED(3),IRAYLR(3)
real*8 DUNIT, RHOR
integer*4 KMPI, KMPO
integer*2 MED, IRAYLR
COMMON/THRESH/RMT2,RMSQ, AP(1),AE(1),UP(1),UE(1),TE(1),THMOLL(1)
real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL
CHARACTER*4 MEDARR(24)
DATA MEDARR /'T','A',22*' '/
call egs_init
DO 1011 I=1,24
MEDIA(I,1)=MEDARR(I)
1011 CONTINUE
1012 CONTINUE
MED(1)=0
MED(3)=0
MED(2)=1
ECUT(2)=1.5
PCUT(2)=0.1
WRITE(6,1020)
1020 FORMAT('\f Start tutor1'//' CALL HATCH to get cross-section data'
*/)
CALL HATCH
WRITE(6,1030)AE(1)-0.511, AP(1)
1030 FORMAT(/' knock-on electrons can be created and any electron follo
*wed down to' /T40,F8.3,' MeV kinetic energy'/ ' brem photons can b
*e created and any photon followed down to ', /T40,F8.3,' MeV'
*)
ZBOUND=0.1
WRITE(6,1040)
1040 FORMAT(/T19,'Kinetic Energy(MeV)',T40,'charge',T48, 'angle w.r.t.Z
* axis-degrees')
IQIN=-1
EIN=20.511
XIN=0.0
YIN=0.0
ZIN=0.0
UIN=0.0
VIN=0.0
WIN=1.0
IRIN=2
WTIN=1.0
DO 1051 I=1,10
WRITE(6,1060)I
1060 FORMAT(' Start history',I4)
CALL SHOWER(IQIN,EIN,XIN,YIN,ZIN,UIN,VIN,WIN,IRIN,WTIN)
1051 CONTINUE
1052 CONTINUE
call egs_finish
STOP
END
翻译成C++该怎么翻译啊?
implicit none
integer*4 I,IQIN,IRIN
real*8 XIN,YIN,ZIN,EIN,WTIN,UIN,VIN,WIN
COMMON/BOUNDS/ECUT(3),PCUT(3),VACDST
real*8 ECUT, PCUT, VACDST
COMMON/GEOM/ZBOUND
real*8 ZBOUND
COMMON/MEDIA/ RLC(1),RLDU(1),RHO(1),MSGE(1),MGE(1),MSEKE(1),MEKE(1
*),MLEKE(1),MCMFP(1),MRANGE(1),IRAYLM(1), MEDIA(24,1), photon_xsect
*ions, comp_xsections, apx,upx, eii_xfile,NMED
CHARACTER*4 MEDIA
real*8 RLC, RLDU, RHO, apx, upx
integer*4 MSGE, MGE, MSEKE, MEKE, MLEKE, MCMFP, MRANGE, IRAYLM,
* NMED
character*16 eii_xfile
character*16 photon_xsections
character*16 comp_xsections
COMMON/MISC/ DUNIT,KMPI,KMPO,RHOR(3),MED(3),IRAYLR(3)
real*8 DUNIT, RHOR
integer*4 KMPI, KMPO
integer*2 MED, IRAYLR
COMMON/THRESH/RMT2,RMSQ, AP(1),AE(1),UP(1),UE(1),TE(1),THMOLL(1)
real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL
CHARACTER*4 MEDARR(24)
DATA MEDARR /'T','A',22*' '/
call egs_init
DO 1011 I=1,24
MEDIA(I,1)=MEDARR(I)
1011 CONTINUE
1012 CONTINUE
MED(1)=0
MED(3)=0
MED(2)=1
ECUT(2)=1.5
PCUT(2)=0.1
WRITE(6,1020)
1020 FORMAT('\f Start tutor1'//' CALL HATCH to get cross-section data'
*/)
CALL HATCH
WRITE(6,1030)AE(1)-0.511, AP(1)
1030 FORMAT(/' knock-on electrons can be created and any electron follo
*wed down to' /T40,F8.3,' MeV kinetic energy'/ ' brem photons can b
*e created and any photon followed down to ', /T40,F8.3,' MeV'
*)
ZBOUND=0.1
WRITE(6,1040)
1040 FORMAT(/T19,'Kinetic Energy(MeV)',T40,'charge',T48, 'angle w.r.t.Z
* axis-degrees')
IQIN=-1
EIN=20.511
XIN=0.0
YIN=0.0
ZIN=0.0
UIN=0.0
VIN=0.0
WIN=1.0
IRIN=2
WTIN=1.0
DO 1051 I=1,10
WRITE(6,1060)I
1060 FORMAT(' Start history',I4)
CALL SHOWER(IQIN,EIN,XIN,YIN,ZIN,UIN,VIN,WIN,IRIN,WTIN)
1051 CONTINUE
1052 CONTINUE
call egs_finish
STOP
END
翻译成C++该怎么翻译啊?