f01.justanswer.com · web view2013/03/27 · copyright national research council of canada, 2000.!...
TRANSCRIPT
![Page 1: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/1.jpg)
! Copyright National Research Council of Canada, 2000. ! All rights reserved. ! Copyright National Research Council of Canada, Ottawa, ! BEAM Code System 1999, all rights reserved ! This code is covered by the BEAM General License ! Copyright National Research Council of Canada, Ottawa, ! BEAM Code System 1999, all rights reserved ! This code is covered by the BEAM General License#define HAVE_C_COMPILER#ifdef HAVE_C_COMPILER#endif implicit none COMMON/BOUNDS/ECUT,PCUT,VACDST real*8 ECUT, PCUT, VACDST COMMON/BREMPR/ DL1(8,7),DL2(8,7),DL3(8,7),DL4(8,7),DL5(8,7),DL6(8, *7), ALPHI(2,7),BPAR(2,7),DELPOS(2,7), WA(7,50),PZ(7,50),ZELEM(7,50 *),RHOZ(7,50), PWR2I(50), DELCM(7),ZBRANG(7),LZBRANG(7),NNE(7), IBR *DST,IPRDST,ibr_nist,pair_nrc,itriplet, ASYM(7,50,2) CHARACTER*4 ASYM real*8 DL1,DL2,DL3,DL4,DL5,DL6, ALPHI, BPAR, DELPOS, WA, PZ, * ZELEM, RHOZ, PWR2I, DELCM, ZBRANG, LZBRANG integer*4 NNE, IBRDST, IPRDST, ibr_nist, itriplet, pair_nrc COMMON/ELECIN/ esig_e(7),psig_e(7), esige_max, psige_max, range_ep *(0:1,150,7), E_array(150,7), etae_ms0(150,7),etae_ms1(150,7),etap_ *ms0(150,7),etap_ms1(150,7),q1ce_ms0(150,7),q1ce_ms1(150,7),q1cp_ms *0(150,7),q1cp_ms1(150,7),q2ce_ms0(150,7),q2ce_ms1(150,7),q2cp_ms0( *150,7),q2cp_ms1(150,7),blcce0(150,7),blcce1(150,7), EKE0(7),EKE1(7 *), XR0(7),TEFF0(7),BLCC(7),XCC(7), ESIG0(150,7),ESIG1(150,7),PSIG0 *(150,7),PSIG1(150,7),EDEDX0(150,7),EDEDX1(150,7),PDEDX0(150,7),PDE *DX1(150,7),EBR10(150,7),EBR11(150,7),PBR10(150,7),PBR11(150,7),PBR *20(150,7),PBR21(150,7),TMXS0(150,7),TMXS1(150,7), expeke1(7), IUNR *ST(7),EPSTFL(7),IAPRIM(7), sig_ismonotone(0:1,7) real*8 esig_e, psig_e, esige_max, psige_max, range_ep, E_ar *ray, etae_ms0,etae_ms1, etap_ms0,etap_ms1, q1ce_ms0,q1ce_ms1, *q1cp_ms0,q1cp_ms1, q2ce_ms0,q2ce_ms1, q2cp_ms0,q2cp_ms1, blcce0 *,blcce1, expeke1, EKE0,EKE1, XR0, TEFF0, BLCC, XCC, ESIG0,E *SIG1, PSIG0,PSIG1, EDEDX0,EDEDX1, PDEDX0,PDEDX1, EBR10,EBR11, * PBR10,PBR11, PBR20,PBR21, TMXS0,TMXS1 integer*4 IUNRST, EPSTFL, IAPRIM logical sig_ismonotone common/geom/ xbound(128+1), ybound(128+1), zbound(128+1), xboun *d_min, xbound_max, ybound_min, ybound_max, zbound_min, zbound *_max, medsur, dsurround(4), IMAX, JMAX, KMAX, ijmax, irmax, * howfarless real*4 xbound, ybound, zbound, xbound_min, xbound_max, ybound_min, * ybound_max, zbound_min, zbound_max,dsurround integer medsur,IMAX, JMAX, KMAX, ijmax,irmax logical howfarless COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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
![Page 2: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/2.jpg)
COMMON/MISC/ DUNIT,KMPI,KMPO,RHOR( 2097154),MED( 2097154),IRAYLR real*8 DUNIT, RHOR integer*4 KMPI, KMPO integer*2 MED, IRAYLR COMMON/PHSPFILE/BEAM_SIZE,MODE_PHSP1,LATCH_OPT, NCASE_PHSP,LATBIT, *NBIT1,NBIT2,I_BIT_FILTER,NofREPEAT,ISMOOTH, OUTCNT,NRCYCL,IPARALLE *L,PARNUM,CYCLNUM real BEAM_SIZE INTEGER MODE_PHSP1,LATCH_OPT,NCASE_PHSP,LATBIT(20),NBIT1,NBIT2, I_ *BIT_FILTER,NofREPEAT,ISMOOTH,OUTCNT,NRCYCL,IPARALLEL,PARNUM,CYCLNU *M common/score/IWATCH,mxnp, endep( 2097153), endep2( 2097153), temp2 *, planarefe, planarefp,planarfe,planarfp,nestep,endep_tmp( 2097153 *), endep_last( 2097153) integer IWATCH, mxnp real endep_tmp REAL*8 endep, endep2, temp2,planarefe, planarefp, planarfe, planar *fp integer*8 nestep integer*2 endep_last common/source/ esrc, nhist, nnread, einsrc, xsrcold, ysrcold, * usrcold, vsrcold, wsrcold, weightold, latchold, frMU_indx, *zinc, xinl, xinu, yinl, yinu, zinl, zinu, thetax, thetay, * thetaz, uinc, vinc, winc, beamarea, xcol, ycol, xiso, yiso *, ziso, phicol, theta(60000), phi(60000), pang(60000), angfi *xed(60000), angmin(60000), angmax(60000), pgang(60000), xtemp( *60000), ytemp(60000), ztemp(60000), phicoltemp(60000), thetatem *p(60000), phitemp(60000), muIndex(60000), r_11(60000), r_12(600 *00), r_13(60000), r_21(60000), r_22(60000), r_23(60000), r_31(6000 *0), r_32(60000), r_33(60000), dsource, dsourcetemp(60000), ein, e *ksrcm, esrc_sp, SSD, einsrcold, iqinold, NINCSRC, r_dbs, ssd *_dbs, z_dbs, enflag, dflag, ismode, isource, iqin, * iqphsp, iqinc, MLCflag *, ixinl, ixinu, jyinl, jyinu, kzinl, * kzinu, klowx, khix, klowy, khiy, * klowz, khiz, survival_ratio, nsmiss, *nsrjct, nsoutside, nmissm, nshist, nphist, * nnphsp, IPRIMARY, * OLDSRC, npassi, nang, ivary(600 *00), ngang(60000), nset, more_in_cont, * numang, dose_stat, ndbsrjct, * i_dbs, iphatsrc, e_split, * i_iaea_in, i_unit_in, nhist_last, * the_beam_code, the_input_file, the *_vcu_input_file, the_pegs_file, the_ *phsp_file, the_vcu_code real*8 esrc,muIndex integer*8 nhist, nnread real*8 einsrc, xsrcold, ysrcold,usrcold,vsrcold,wsrcold,weightold, *latchold, frMU_indx real*4 zinc, xinl, xinu, yinl, yinu, zinl, zinu, thetax, thetay *, thetaz, uinc, vinc, winc, beamarea, xcol,ycol,xiso, yiso, zi *so, phicol, theta, phi, xtemp, ytemp, ztemp, phico *ltemp,thetatemp, phitemp, pang,angfixed,angmin,ang *max,pgang,r_11, r_12, r_13, r_21, r_22, r_23 *, r_31, r_32, r_33,dsource,dsourcetemp, * ein, eksrcm, esrc_sp, SSD, NINCSRC, * r_dbs, ssd_dbs,z_dbs,survival_ratio,einsrcold
![Page 3: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/3.jpg)
integer*4 isource, iqin, iqphsp, iqinc,iqinold,MLCflag, * ixinl, ixinu, jyinl, jyinu, kzinl, kzinu, * klowx, khix, klowy, khiy, klowz, khiz *, nsmiss, nsrjct,nsoutsid *e, nmissm,nshist,nphist,nnphsp, enflag, dflag, is *mode, IPRIMARY, OLDSRC,npassi,nang,ivary,ngang,numang,dose_stat, * ndbsrjct,i_dbs,iphatsrc,e_split,i_iaea_in,i_unit_in,more_in_c *ont,nset integer*2 nhist_last character*80 the_beam_code, the_vcu_code, the_input_file,the_pegs_ *file, the_vcu_input_file,the_phsp_file COMMON/SOURCE_FORPARALLEL/nnphsp_max, nnphsp_min integer*4 nnphsp_max, nnphsp_min COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000 *),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 COMMON/TIMEINFO/ TIMEN, DATEN, DNTIME character timen*8, daten*11, dntime*24 common/ET_control/ SMAXIR,estepe,ximax, skindepth_for_bca,transpo *rt_algorithm, bca_algorithm,exact_bca,spin_effects real*8 smaxir, estepe, ximax, skindepth_for_bca integer*4 transport_algorithm, bca_algorithm logical exact_bca, spin_effects common/CH_steps/ count_pII_steps,count_all_steps,is_ch_step real*8 count_pII_steps,count_all_steps logical is_ch_step COMMON/USERPS/n_split integer*4 n_split COMMON/USERRR/ESAVE_GLOBAL,RANGE_ECUTRR(7),IREJECT real*8 ESAVE_GLOBAL,RANGE_ECUTRR integer*4 IREJECT COMMON/EPCONT/EDEP,TSTEP,TUSTEP,USTEP,TVSTEP,VSTEP, RHOF,EOLD,ENEW *,EKE,ELKE,GLE,E_RANGE, x_final,y_final,z_final, u_final,v_final,w_ *final, IDISC,IROLD,IRNEW,IAUSFL(29) DOUBLE PRECISION EDEP real*8 TSTEP, TUSTEP, USTEP, VSTEP, TVSTEP, RHOF, EOLD, ENE *W, EKE, ELKE, GLE, E_RANGE, x_final,y_final,z_final, u_final, *v_final,w_final integer*4 IDISC, IROLD, IRNEW, IAUSFL common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch
![Page 4: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/4.jpg)
character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch COMMON/RWPHSP/ STRING_TEMP_ZLAST_OUT, STRING_TEMP_OUT, IHSTRY_PH *SP, iaea_dummy_long, ESHORT, WEIGHTTMP, WT_PHSP_SHORT, X_PHS *P_SHORT, Y_PHSP_SHORT, Z_PHSP_SHORT, U_PHSP_SHORT, V_PHSP_SHOR *T, W_PHSP_SHORT, ZLAST_PHSP_SHORT, EKMAX_PHSP_SHORT, EKMINE_PH *SP_SHORT, NINC_PHSP_SHORT, NUM_PHSP_TOT, PHOT_PHSP_TOT, iaea_re *sult, iaea_n_stat, iaea_q_typ, iaea_typ_q, iaea_q_index, I_P *HSP, IERR_PHSP, LATCHTMP, WRITE_PHSP_COUNTER, WRITE_PHSP_SOFAR *, PHSP_RESTART, PHSP_RECL, PHSP_RECL_OLD, iaea_extra_ints, ia *ea_extra_int_types,iaea_extra_float_types, MODE_RW CHARACTER*32000 STRING_TEMP_ZLAST_OUT(1) CHARACTER*28000 STRING_TEMP_OUT(1) integer*8 IHSTRY_PHSP(1),iaea_dummy_long REAL*4 ESHORT,WEIGHTTMP,WT_PHSP_SHORT,X_PHSP_SHORT,Y_PHSP_SHORT, Z *_PHSP_SHORT,U_PHSP_SHORT, V_PHSP_SHORT,W_PHSP_SHORT,ZLAST_PHSP_SHO *RT, EKMAX_PHSP_SHORT,EKMINE_PHSP_SHORT,NINC_PHSP_SHORT INTEGER NUM_PHSP_TOT,PHOT_PHSP_TOT, iaea_result,iaea_n_stat,iaea_q *_typ(3),iaea_typ_q(3),iaea_q_index,I_PHSP, IERR_PHSP,LATCHTMP, WRI *TE_PHSP_COUNTER(1),WRITE_PHSP_SOFAR(1), PHSP_RESTART,PHSP_RECL,PHS *P_RECL_OLD,iaea_extra_ints(2), iaea_extra_int_types(2),iaea_extra_ *float_types(1) CHARACTER*5 MODE_RW INTEGER LATCH_TEMP_OUT,NUM_PHSP_TOFLUSH,TEMP_PHSP_COUNTER,REM_PHSP REAL*4 REAL_TEMP_OUT(7) CHARACTER*32 REC_TEMP_OUT integer*8 NCASE,IHSTRY,tempdiv,jcase,orig_NCASE integer idosl(7),idosu(7),jdosl(7),jdosu(7), kdosl(7),kdosu(7),IZS *CAN(7),idgrp,n,j,i, maxx,maxy,maxz,maxbd,ngroup,igroup,nn,nnn,in,I *L,IU,JL,JU,KL,KU, medtmp,k,irl,ieof,IOUT,lnblnk1,IXXIN,JXXIN integer IRSECT, ihist, idose, nperpg, ipage, ios, irin, tem *ppar, jj, idd, iorstrt, ioutgeom, ioutgph, ioutphant, egs_o *pen_file, egs_open_datfile, ihowfarless, i_par_temp real*8 xin,yin,zin, uin,vin,win, weight,etotin, etot, mindelX,m *indelY,mindelZ real amass,tcpuold,ECUTIN,PCUTIN,ESTEPM(7),width, rhotmp,ECUTL,PCU *TL,TIMMAX,SMAX, timcpu, ainflu, minrhor, maxrhor character*256 PhantFileName, parname REAL XMIN_YMIN_ZMIN,YMIN_XMIN_ZMIN,ZMIN_XMIN_YMIN, XMIN_YMAX_ZMIN, *YMAX_XMIN_ZMIN,ZMIN_XMIN_YMAX, XMAX_YMAX_ZMIN,YMAX_XMAX_ZMIN,ZMIN_ *XMAX_YMAX, XMAX_YMIN_ZMIN,YMIN_XMAX_ZMIN,ZMIN_XMAX_YMIN, XMIN_YMIN *_ZMAX,YMIN_XMIN_ZMAX,ZMAX_XMIN_YMIN, XMIN_YMAX_ZMAX,YMAX_XMIN_ZMAX *,ZMAX_XMIN_YMAX, XMAX_YMAX_ZMAX,YMAX_XMAX_ZMAX,ZMAX_XMAX_YMAX, XMA *X_YMIN_ZMAX,YMIN_XMAX_ZMAX,ZMAX_XMAX_YMIN INTEGER IRESTART,ibatch,ncaseold character title(80) REAL BATCHT, TIMEB, SECNDS Integer CTError INTEGER zerodose, zerocount, MAX20, tempmax20, doseprint, ID *AT, zeroairdose, IPHANT INTEGER NETADJ REAL ETIMETOT integer*4 LELKE, lelktmp, lelec
![Page 5: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/5.jpg)
real*8 EKEI,ELKEI,fedep,elktmp,dedxmid,aux REAL*8 temp integer*8 nhist_old integer*4 n_repeat,i_repeat external combine_results#ifdef HAVE_C_COMPILER real*8 part_dose, part2_dose, current_result, current_uncertainty integer*8 n_run,n_tot,n_last,n_left,other_num_1,other_num_2 integer*4 n_job,p_per_phsp_chunk,n_run_chunk logical first_time#endif logical is_finished real CPUT0,CPUT1,CPUT2,TDUM real egs_tot_time, egs_etime call egs_init tdum = egs_tot_time(1) cput0=egs_etime() IOUT=1 idd=3 iorstrt=4 ioutgeom=17 ioutgph=13 ioutphant=18 WRITE(6,1010)1010 FORMAT(/' Begin execution with large arrays being zeroed'/ ' Thisi *s only needed for Linux g77 compiler - comment'/ ' this code near *the top of dosxyznrc.mortran if you are'/ ' not using a linux g77 *compiler'/) DO 1021 i=1, 2097154 MED(i) = 1 RHOR(i) =0.1021 CONTINUE1022 CONTINUE zeroairdose = 0 MAX20=0 IPHANT=0 doseprint=1 CALL DATETIME(1) WRITE(6,1030)TIMEN, DATEN WRITE(1,1030)TIMEN, DATEN1030 FORMAT(' ',79('*')/ ' NRCC/UW EGSnrc user-code DOSXYZnrc', ' ($Rev *ision: 1.47 $ last edited $Date: 2011/05/06 11:38:26 $)'/ ' ON ',' *x86_64-unknown-linux-gnu',' ',T60,A,1X,A / ' ',79('*')/ ' **',T79, *'**'/ ' **',T38,'DOSXYZnrc',T79,'**'/ ' **',T34,'Z pronounced zed' *,T79,'**'/ ' **',T79,'**'/ ' **',T10,'Code developed at the Nation *al Research Council of Canada', ' and',T79,'**'/ ' **',T15,'Univer *sity of Wisconsin as part of the OMEGA project', T79,'**'/ ' **',T *79,'**'/ ' **',T15, 'This is $Revision: 1.47 $ last edited $Date:2 *011/05/06 11:38:26 $', T79,'**'/ ' **',T79,'**'/ 1X ,79('*')) WRITE(6,1040)7,10000,128,128,128, 2097153,1 WRITE(1,1040)7,10000,128,128,128, 2097153,11040 FORMAT(/' The following parameters may be adjusted in dosxyz_u *ser_macros.mortran'/' $MXMED: Max number of media:',I3,/ ' $MXS *TACK: Max stack size:',I10/ ' $IMAX,etc: Max dose scoring regions * in x,y,z directions:', 3I5/ ' $MAXDOSE: Max dose scoring regions * consistent with above:',I7/ ' $DOSEZERO(=',I1,') 1=> all doses wi *th uncert > 50% are zeroed', ' in .3ddose file'/) WRITE(6,1050)1000, 200
![Page 6: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/6.jpg)
WRITE(1,1050)1000, 2001050 FORMAT(/' The following parameters may be adjusted in srcxyz.macro *s'/ ' $INVDIM: number of elements in inverse CPD for input energ *y spectra =', I5/ ' $NENSRC: number of bins in input energy spec *trum =', I5/) WRITE(6,1060) WRITE(1,1060)1060 FORMAT(1x,79('=')/1x,79('-')//' Title: ',$) READ(5,1070)title1070 FORMAT(80a1) WRITE(6,1080)Title WRITE(1,1080)Title1080 FORMAT(' ',80a1/1x,79('-')/1x,79('=')//) WRITE(6,1090)7 WRITE(1,1090)71090 FORMAT(' Number of media (min = 1, max =',I4,', 0 => CT data): ',$ *) read(5,'(I10)') NMED IF ((NMED .GT. 7 )) THEN NMED= 1 END IF WRITE(6,1100)NMED WRITE(1,1100)NMED1100 FORMAT(' ',t10,i7) IF ((NMED .EQ. 0)) THEN WRITE(6,1110) WRITE(1,1110)1110 FORMAT(' Input the full name of the file containing the CT pha *ntom created '/ ' using ctcreate '/ ' : ',$) read(5,'(A256)') PhantFileName WRITE(6,1120)PhantFileName(:lnblnk1(PhantFileName)) WRITE(1,1120)PhantFileName(:lnblnk1(PhantFileName))1120 FORMAT(A) Open(45,file=PhantFileName,status='old',access='sequential', i * ostat=ios) IF ((ios.NE.0)) THEN WRITE(6,1130) WRITE(1,1130)1130 FORMAT(/' The CT phantom file does not exist.'/ ' Try agai *n. ') STOP END IF WRITE(6,1140) WRITE(1,1140)1140 FORMAT(/' CT Phantom summary: ') read(45,'(i2)')NMED WRITE(6,1150)NMED WRITE(1,1150)NMED1150 FORMAT(/' NMED = ',i2) WRITE(6,1160) WRITE(1,1160)1160 FORMAT(/' media:') DO 1171 n=1,NMED read(45,'(24a1)') (media(j,n),j=1,24) WRITE(6,1180)(media(j,n),j=1,24) WRITE(1,1180)(media(j,n),j=1,24)1180 FORMAT(' ',24a1)1171 CONTINUE
![Page 7: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/7.jpg)
1172 CONTINUE read(45,*) (ESTEPM(i),i=1,NMED) WRITE(6,1190)(ESTEPM(i),i=1,NMED) WRITE(1,1190)(ESTEPM(i),i=1,NMED)1190 FORMAT(/' Dummy values of (ESTEPM(i),i=1,NMED)'/ ' : ',10f10.3 *) read(45,'(3i5)') IMAX,JMAX,KMAX WRITE(6,1200)IMAX,JMAX,KMAX WRITE(1,1200)IMAX,JMAX,KMAX1200 FORMAT(/' IMAX, JMAX, KMAX : ',3i4) IF ((IMAX .GT. 128 .OR. JMAX .GT. 128 .OR. KMAX .GT. 128)) THE * N WRITE(6,1210) WRITE(1,1210)1210 FORMAT(/' ***ERROR:'/ ' X, Y or Z dimension(s) of CT phant *om > maximum allowed in DOSXYZnrc '/ ' Change $IMAX, $JMAX, $KMAXi *n dosxyz_user_macros.mortran and recompile.') STOP END IF ijmax = IMAX*JMAX irmax =1 + IMAX*JMAX*KMAX read(45,*) (xbound(i),i=1,IMAX+1) read(45,*) (ybound(j),j=1,JMAX+1) read(45,*) (zbound(k),k=1,KMAX+1) xbound_min = xbound(1) xbound_max = xbound(IMAX+1) ybound_min = ybound(1) ybound_max = ybound(JMAX+1) zbound_min = zbound(1) zbound_max = zbound(KMAX+1) WRITE(6,1220)xbound_min,xbound_max,ybound_min,ybound_max, zbou * nd_min,zbound_max WRITE(1,1220)xbound_min,xbound_max,ybound_min,ybound_max, zbou * nd_min,zbound_max1220 FORMAT(/' x range : ',F12.5,' - ',F12.5,' cm'/ ' y range : ',F *12.5,' - ',F12.5,' cm'/ ' z range : ',F12.5,' - ',F12.5,' cm') DO 1231 k=1,KMAX DO 1241 j=1,JMAX read(45,1250) (med((1 + i + (j-1)*IMAX + (k-1)*ijmax)) * ,i=1,IMAX)1241 CONTINUE1242 CONTINUE read(45,*)1231 CONTINUE1232 CONTINUE1250 FORMAT(128i1) maxrhor=0. minrhor=999. DO 1261 k=1,KMAX DO 1271 j=1,JMAX read(45,*) (rhor((1 + i + (j-1)*IMAX + (k-1)*ijmax)),i * =1,IMAX) DO 1281 i=1,IMAX IF ((rhor((1 + i + (j-1)*IMAX + (k-1)*ijmax)) .GT. * maxrhor)) THEN maxrhor=rhor((1 + i + (j-1)*IMAX + (k-1)*ijmax * )) END IF
![Page 8: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/8.jpg)
IF ((rhor((1 + i + (j-1)*IMAX + (k-1)*ijmax)) .LT. * minrhor)) THEN minrhor=rhor((1 + i + (j-1)*IMAX + (k-1)*ijmax * )) END IF1281 CONTINUE1282 CONTINUE1271 CONTINUE1272 CONTINUE read(45,*)1261 CONTINUE1262 CONTINUE WRITE(6,1290)minrhor,maxrhor WRITE(1,1290)minrhor,maxrhor1290 FORMAT(/' Densities range from ',F12.5,' - ',F12.5,' g/cc') close(45) WRITE(6,1300) WRITE(1,1300)1300 FORMAT(/' ECUTIN,PCUTIN,(SMAX--DUMMY INPUT): ',$) read(5,'(3F15.0)') ECUTIN,PCUTIN,SMAX WRITE(6,1310)ECUTIN,PCUTIN,SMAX WRITE(1,1310)ECUTIN,PCUTIN,SMAX1310 FORMAT(/t10,3f10.3) WRITE(6,1320) WRITE(1,1320)1320 FORMAT(/' Input zeroairdose (1 to zero dose in air in .3ddosef *ile; 0[default]'/ ' to not zero this dose), doseprint (1 for full *dose output in .egslst;'/ ' 0[default] otherwise), MAX20 (1 to pri *nt out summary of 20 highest'/ ' doses; 0[default] to not print th *is summary)'/ ' : ',$) READ(5,'(3I5)')zeroairdose,doseprint,MAX20 IF((zeroairdose .NE.1))zeroairdose=0 IF((MAX20 .NE. 1))MAX20=0 IF((doseprint .NE. 1))doseprint=0 WRITE(6,1330)zeroairdose,doseprint,MAX20 WRITE(1,1330)zeroairdose,doseprint,MAX201330 FORMAT(3I5) idgrp=1 idosl(idgrp)=1 idosu(idgrp)=IMAX jdosl(idgrp)=1 jdosu(idgrp)=JMAX kdosl(idgrp)=1 kdosu(idgrp)=KMAX IZSCAN(idgrp)=1 ELSE DO 1341 n=1,NMED WRITE(6,1350)n WRITE(1,1350)n1350 FORMAT(' Medium',i3,': ',$) READ(5,1360)(media(j,n),j=1,24)1360 FORMAT(24a1) WRITE(6,1370)(media(j,n),j=1,24) WRITE(1,1370)(media(j,n),j=1,24)1370 FORMAT(' ',t20,24a1)1341 CONTINUE1342 CONTINUE med(1)=0
![Page 9: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/9.jpg)
DO 1381 n=2, 2097154 med(n)=11381 CONTINUE1382 CONTINUE WRITE(6,1390) WRITE(1,1390)1390 FORMAT(/' ECUTIN,PCUTIN,(ESTEPE,SMAX--DUMMY INPUTS): ',$) read(5,'(2F15.0,30F10.0,F15.0)') ECUTIN,PCUTIN,(ESTEPM(i),i=1, * NMED),SMAX WRITE(6,1400)ECUTIN,PCUTIN,(ESTEPM(i),i=1,NMED),SMAX WRITE(1,1400)ECUTIN,PCUTIN,(ESTEPM(i),i=1,NMED),SMAX1400 FORMAT(/t10,13f10.3) write(6,1410)128,128,128 write(1,1410)128,128,1281410 format(/' # regions in x (max=',I4,'),y (max=',I4,'),z (max=', *I4,') directions'/ ' (if<0,implies # groups of reg), IPHANT (1 to *output a .egsphant'/ ' file for dosxyz_show, 0[default] to not out *put this file)'/ ' : ',$) read(5,'(4I10)') maxx,maxy,maxz,IPHANT IF((maxx .EQ. 0))maxx=1 IF((maxx.GT.128))maxx=128 IF((maxy .EQ. 0))maxy=1 IF((maxy.GT.128))maxy=128 IF((maxz .EQ. 0))maxz=1 IF((maxz.GT.128))maxz=128 WRITE(6,1420)maxx,maxy,maxz,IPHANT WRITE(1,1420)maxx,maxy,maxz,IPHANT1420 FORMAT(' ',4i6) IF ((IPHANT.EQ.1)) THEN WRITE(6,1430)1430 FORMAT(//' Will output a .egsphant file to display isodose * contours'/ ' with dosxyz_show.'//) END IF maxbd=128 WRITE(6,1440) WRITE(1,1440)1440 FORMAT( / ' Input boundaries in the x-direction'/ ' ---------- *-------------------------') mindelX=1.e20 IF ((maxX .GT. 0)) THEN mindelX=1.e20 IF ((maxX .GT. maxbd)) THEN WRITE(6,1450)maxbd WRITE(1,1450)maxbd1450 FORMAT(t15,'***ERROR:'/ t15,'number of regions > max a *llowed (',i5,')') STOP END IF DO 1461 i=1,maxX WRITE(6,1470)i WRITE(1,1470)i1470 FORMAT(' Small boundary for region(',i3,') ',$) read(5,'(F15.0)') Xbound(i) IF (( (i .NE.1 ) .AND. ( Xbound(i) .LE. Xbound(i-1) )) * ) THEN WRITE(6,1480) WRITE(1,1480)1480 FORMAT(' *** Boundary out of order ***')
![Page 10: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/10.jpg)
END IF WRITE(6,1490)Xbound(i) WRITE(1,1490)Xbound(i)1490 FORMAT(' ',t10,f12.3) IF ((i.GE.2 .AND. Xbound(i)-Xbound(i-1).LT.mindelX)) T * HEN mindelX=Xbound(i)-Xbound(i-1) END IF1461 CONTINUE1462 CONTINUE WRITE(6,1500)maxX WRITE(1,1500)maxX1500 FORMAT(' Outer boundary for region(',i3,') ',$) read(5,'(F15.0)') Xbound(maxX + 1) WRITE(6,1510)Xbound(maxX+1) WRITE(1,1510)Xbound(maxX+1)1510 FORMAT(' ',t10,f12.3) IF((Xbound(maxX+1)-Xbound(maxX).LT.mindelX))mindelX=Xbound * (maxX+1)-Xbound(maxX) ELSE WRITE(6,1520) WRITE(1,1520)1520 FORMAT(' Initial boundary: ',$) read(5,'(F15.0)') Xbound(1) WRITE(6,1530)Xbound(1) WRITE(1,1530)Xbound(1)1530 FORMAT(' ',f12.3) ngroup = - maxX maxX = 0 DO 1541 igroup=1,ngroup WRITE(6,1550) WRITE(1,1550)1550 FORMAT(' Width in this group, number of regions in gro *up: ',$) read(5,'(F15.0,I10)') width,nn IF ((nn.LE.0)) THEN nn=1 END IF IF ((width.LE.0.0)) THEN width=1.0 END IF IF((width.LT.mindelX))mindelX=width WRITE(6,1560)width,nn WRITE(1,1560)width,nn1560 FORMAT(' ',f12.3,i5) nnn = min(nn,maxbd-maxX) IF ((nnn .NE. 0)) THEN DO 1571 in=maxX+1,maxX+nnn Xbound(in+1) = Xbound(in)+width1571 CONTINUE1572 CONTINUE END IF IF ((nn .NE. nnn)) THEN WRITE(6,1580)maxbd WRITE(1,1580)maxbd1580 FORMAT(t15,'***ERROR:'/ t15,'number of regions > m *ax allowed (',i5,')') STOP
![Page 11: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/11.jpg)
END IF maxX = maxX+nnn1541 CONTINUE1542 CONTINUE WRITE(6,1590)(Xbound(i),i=1,maxX+1) WRITE(1,1590)(Xbound(i),i=1,maxX+1)1590 FORMAT(' Boundaries'/(6f12.3)) END IF IMAX=maxx maxbd=128 WRITE(6,1600) WRITE(1,1600)1600 FORMAT( / ' Input boundaries in the y-direction'/ ' ---------- *-------------------------') mindelY=1.e20 IF ((maxY .GT. 0)) THEN mindelY=1.e20 IF ((maxY .GT. maxbd)) THEN WRITE(6,1610)maxbd WRITE(1,1610)maxbd1610 FORMAT(t15,'***ERROR:'/ t15,'number of regions > max a *llowed (',i5,')') STOP END IF DO 1621 i=1,maxY WRITE(6,1630)i WRITE(1,1630)i1630 FORMAT(' Small boundary for region(',i3,') ',$) read(5,'(F15.0)') Ybound(i) IF (( (i .NE.1 ) .AND. ( Ybound(i) .LE. Ybound(i-1) )) * ) THEN WRITE(6,1640) WRITE(1,1640)1640 FORMAT(' *** Boundary out of order ***') END IF WRITE(6,1650)Ybound(i) WRITE(1,1650)Ybound(i)1650 FORMAT(' ',t10,f12.3) IF ((i.GE.2 .AND. Ybound(i)-Ybound(i-1).LT.mindelY)) T * HEN mindelY=Ybound(i)-Ybound(i-1) END IF1621 CONTINUE1622 CONTINUE WRITE(6,1660)maxY WRITE(1,1660)maxY1660 FORMAT(' Outer boundary for region(',i3,') ',$) read(5,'(F15.0)') Ybound(maxY + 1) WRITE(6,1670)Ybound(maxY+1) WRITE(1,1670)Ybound(maxY+1)1670 FORMAT(' ',t10,f12.3) IF((Ybound(maxY+1)-Ybound(maxY).LT.mindelY))mindelY=Ybound * (maxY+1)-Ybound(maxY) ELSE WRITE(6,1680) WRITE(1,1680)1680 FORMAT(' Initial boundary: ',$) read(5,'(F15.0)') Ybound(1)
![Page 12: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/12.jpg)
WRITE(6,1690)Ybound(1) WRITE(1,1690)Ybound(1)1690 FORMAT(' ',f12.3) ngroup = - maxY maxY = 0 DO 1701 igroup=1,ngroup WRITE(6,1710) WRITE(1,1710)1710 FORMAT(' Width in this group, number of regions in gro *up: ',$) read(5,'(F15.0,I10)') width,nn IF ((nn.LE.0)) THEN nn=1 END IF IF ((width.LE.0.0)) THEN width=1.0 END IF IF((width.LT.mindelY))mindelY=width WRITE(6,1720)width,nn WRITE(1,1720)width,nn1720 FORMAT(' ',f12.3,i5) nnn = min(nn,maxbd-maxY) IF ((nnn .NE. 0)) THEN DO 1731 in=maxY+1,maxY+nnn Ybound(in+1) = Ybound(in)+width1731 CONTINUE1732 CONTINUE END IF IF ((nn .NE. nnn)) THEN WRITE(6,1740)maxbd WRITE(1,1740)maxbd1740 FORMAT(t15,'***ERROR:'/ t15,'number of regions > m *ax allowed (',i5,')') STOP END IF maxY = maxY+nnn1701 CONTINUE1702 CONTINUE WRITE(6,1750)(Ybound(i),i=1,maxY+1) WRITE(1,1750)(Ybound(i),i=1,maxY+1)1750 FORMAT(' Boundaries'/(6f12.3)) END IF JMAX=maxy maxbd=128 WRITE(6,1760) WRITE(1,1760)1760 FORMAT( / ' Input boundaries in the z-direction'/ ' ---------- *-------------------------') mindelZ=1.e20 IF ((maxZ .GT. 0)) THEN mindelZ=1.e20 IF ((maxZ .GT. maxbd)) THEN WRITE(6,1770)maxbd WRITE(1,1770)maxbd1770 FORMAT(t15,'***ERROR:'/ t15,'number of regions > max a *llowed (',i5,')') STOP END IF
![Page 13: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/13.jpg)
DO 1781 i=1,maxZ WRITE(6,1790)i WRITE(1,1790)i1790 FORMAT(' Small boundary for region(',i3,') ',$) read(5,'(F15.0)') Zbound(i) IF (( (i .NE.1 ) .AND. ( Zbound(i) .LE. Zbound(i-1) )) * ) THEN WRITE(6,1800) WRITE(1,1800)1800 FORMAT(' *** Boundary out of order ***') END IF WRITE(6,1810)Zbound(i) WRITE(1,1810)Zbound(i)1810 FORMAT(' ',t10,f12.3) IF ((i.GE.2 .AND. Zbound(i)-Zbound(i-1).LT.mindelZ)) T * HEN mindelZ=Zbound(i)-Zbound(i-1) END IF1781 CONTINUE1782 CONTINUE WRITE(6,1820)maxZ WRITE(1,1820)maxZ1820 FORMAT(' Outer boundary for region(',i3,') ',$) read(5,'(F15.0)') Zbound(maxZ + 1) WRITE(6,1830)Zbound(maxZ+1) WRITE(1,1830)Zbound(maxZ+1)1830 FORMAT(' ',t10,f12.3) IF((Zbound(maxZ+1)-Zbound(maxZ).LT.mindelZ))mindelZ=Zbound * (maxZ+1)-Zbound(maxZ) ELSE WRITE(6,1840) WRITE(1,1840)1840 FORMAT(' Initial boundary: ',$) read(5,'(F15.0)') Zbound(1) WRITE(6,1850)Zbound(1) WRITE(1,1850)Zbound(1)1850 FORMAT(' ',f12.3) ngroup = - maxZ maxZ = 0 DO 1861 igroup=1,ngroup WRITE(6,1870) WRITE(1,1870)1870 FORMAT(' Width in this group, number of regions in gro *up: ',$) read(5,'(F15.0,I10)') width,nn IF ((nn.LE.0)) THEN nn=1 END IF IF ((width.LE.0.0)) THEN width=1.0 END IF IF((width.LT.mindelZ))mindelZ=width WRITE(6,1880)width,nn WRITE(1,1880)width,nn1880 FORMAT(' ',f12.3,i5) nnn = min(nn,maxbd-maxZ) IF ((nnn .NE. 0)) THEN DO 1891 in=maxZ+1,maxZ+nnn
![Page 14: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/14.jpg)
Zbound(in+1) = Zbound(in)+width1891 CONTINUE1892 CONTINUE END IF IF ((nn .NE. nnn)) THEN WRITE(6,1900)maxbd WRITE(1,1900)maxbd1900 FORMAT(t15,'***ERROR:'/ t15,'number of regions > m *ax allowed (',i5,')') STOP END IF maxZ = maxZ+nnn1861 CONTINUE1862 CONTINUE WRITE(6,1910)(Zbound(i),i=1,maxZ+1) WRITE(1,1910)(Zbound(i),i=1,maxZ+1)1910 FORMAT(' Boundaries'/(6f12.3)) END IF KMAX=maxz xbound_min = xbound(1) xbound_max = xbound(IMAX+1) ybound_min = ybound(1) ybound_max = ybound(JMAX+1) zbound_min = zbound(1) zbound_max = zbound(KMAX+1) ijmax = IMAX*JMAX irmax =1 + IMAX*JMAX*KMAX WRITE(6,1920)irmax WRITE(1,1920)irmax1920 FORMAT(/' Total # regions including exterior =',i10) IF ((irmax .GT. 2097154)) THEN WRITE(6,1930) WRITE(1,1930)1930 FORMAT(/' *** That is too many regions ***'//) stop ' *** Stopping because too many regions asked for *** *' END IF WRITE(6,1940) WRITE(1,1940)1940 FORMAT(/' Input groups of regions for which density and medium * are not defaults')1951 CONTINUE WRITE(6,1960) WRITE(1,1960)1960 FORMAT(' Lower,upper i, j, k, MEDIUM, DENSITY',$) read(5,'(7I10,F15.0)') IL,IU,JL,JU,KL,KU,MEDTMP,RHOTMP IF (( (IL .EQ. 0) .AND. (IU .EQ. 0) )) THEN WRITE(6,1970) WRITE(1,1970)1970 FORMAT(/' Found blank line => end of this input') GO TO1952 END IF IF(((IL .LE. 0).OR.(IL .GT. IMAX)))IL = 1 IF(((IU .LT. IL).OR.(IU .GT. IMAX)))IU = IMAX IF(((JL .LE. 0).OR.(JL .GT. JMAX)))JL = 1 IF(((JU .LT. JL).OR.(JU .GT. JMAX)))JU = JMAX IF(((KL .LE. 0).OR.(KL .GT. KMAX)))KL = 1 IF(((KU .LT. KL).OR.(KU .GT. KMAX)))KU = KMAX
![Page 15: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/15.jpg)
IF(((medtmp .LT. 0).OR.(medtmp .GT. NMED)))medtmp = 1 WRITE(6,1980)IL,IU,JL,JU,KL,KU,MEDTMP,RHOTMP WRITE(1,1980)IL,IU,JL,JU,KL,KU,MEDTMP,RHOTMP1980 FORMAT(' ',3('(',i3,i4,')'), i4, f10.3) DO 1991 i=Il,IU DO 2001 j=JL,JU DO 2011 k=KL,KU irl = (1 + i + (j-1)*IMAX + (k-1)*ijmax) rhor(irl)=rhotmp med(irl)=medtmp2011 CONTINUE2012 CONTINUE2001 CONTINUE2002 CONTINUE1991 CONTINUE1992 CONTINUE GO TO 19511952 CONTINUE WRITE(6,2020) WRITE(1,2020)2020 FORMAT(//' Input groups of regions for which ECUT and PCUT are * not defaults') WRITE(6,2030) WRITE(1,2030)2030 FORMAT(' NB This option is disabled, just input 8 zeros.')2041 CONTINUE WRITE(6,2050) WRITE(1,2050)2050 FORMAT(' Dummy values of lower,upper i, j, k, ECUT, PCUT' *,$) read(5,'(6I10,2F15.0)') IL,IU,JL,JU,KL,KU,ECUTL,PCUTL IF (( IL .EQ. 0 .AND. IU .EQ. 0)) THEN WRITE(6,2060) WRITE(1,2060)2060 FORMAT(/' Found blank line => end of this input') GO TO2042 END IF WRITE(6,2070)IL,IU,JL,JU,KL,KU,ECUTL,PCUTL WRITE(1,2070)IL,IU,JL,JU,KL,KU,ECUTL,PCUTL2070 FORMAT(' ',3('(',i3,i4,')'),2(f10.3,1x)) GO TO 20412042 CONTINUE WRITE(6,2080) WRITE(1,2080)2080 FORMAT(//' Enter 8 numbers on one line'/ ' 3 pairs definingl *ower,upper x,y,z indicies of dose regions'/ ' for *which results are to be output'/ ' IZSCAN: non-zero for z- *scan/page'/ ' MAX20: if any one = 1, output summary of ma *x 20 doses.'/ ' end signaled by first pair both zero'/ ' forno * dose printed, MAX20 is still read from first line'/) idgrp=0 tempmax20=02091 CONTINUE idgrp=idgrp+1 read(5,'(8I10)') idosl(idgrp),idosu(idgrp),jdosl(idgrp),jd * osu(idgrp), kdosl(idgrp),kdosu(idgrp),IZSCAN(idgrp),tempma * x20 IF (((idosl(idgrp) .EQ. 0).AND.(idosu(idgrp) .EQ. 0))) THE
![Page 16: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/16.jpg)
* N WRITE(6,2100) WRITE(1,2100)2100 FORMAT(' Found blank line => end of this input') IF ((idgrp .EQ. 1)) THEN IF ((tempmax20 .EQ. 1 )) THEN MAX20 = 1 WRITE(6,2110) WRITE(1,2110)2110 FORMAT(' MAX20 =1 so will print largest 20 d *oses only') ELSE WRITE(6,2120) WRITE(1,2120)2120 FORMAT(' No doses will be output to egslst fil *e') END IF END IF GO TO2092 END IF IF((idosl(idgrp).LE.0))idosl(idgrp)=1 IF((idosu(idgrp).LE.0 .OR.idosu(idgrp).GE.IMAX))idosu(idgr * p)=IMAX IF((jdosl(idgrp).LE.0))jdosl(idgrp)=1 IF((jdosu(idgrp).LE.0 .OR.jdosu(idgrp).GE.JMAX))jdosu(idgr * p)=JMAX IF((kdosl(idgrp).LE.0))kdosl(idgrp)=1 IF((kdosu(idgrp).LE.0 .OR.kdosu(idgrp).GE.KMAX))kdosu(idgr * p)=KMAX IF((tempmax20.EQ.1))MAX20=1 WRITE(6,2130)idosl(idgrp),idosu(idgrp),jdosl(idgrp),jdosu( * idgrp), kdosl(idgrp),kdosu(idgrp),IZSCAN(idgrp),tempmax20 WRITE(1,2130)idosl(idgrp),idosu(idgrp),jdosl(idgrp),jdosu( * idgrp), kdosl(idgrp),kdosu(idgrp),IZSCAN(idgrp),tempmax202130 FORMAT(t5,3(i6,i4),i6,i6) GO TO 20912092 CONTINUE idgrp=idgrp-1 END IF dose_stat=0 call srcinput(ieof) WRITE(6,2140) WRITE(1,2140)2140 FORMAT(//' NCASE,IWATCH,TIMMAX,INSEED1,INSEED2,BEAM_SIZE,ISMOOTH,I *RESTART,IDAT,'/ ' IREJECT,ESAVE_GLOBAL,NRCYCL,IPARALLEL,PARNUM,n_s *plit,ihowfarless'/ ' : ',$) read(5,'(2I12,F15.0,2I10,F15.0,4I10,F15.0,5I10)') NCASE,IWATCH,TIM *MAX,IXXIN,JXXIN,BEAM_SIZE,ISMOOTH,IRESTART,IDAT,IREJECT, ESAVE_GLO *BAL,NRCYCL,IPARALLEL,PARNUM,n_split,ihowfarless IF ((n_split.LE.1 .AND. e_split.GT.1)) THEN WRITE(6,2150)2150 FORMAT(//' ***Warning: Electron splitting on with no photon sp *litting.'/ ' Electron splitting will not be done.'//) END IF IF ((TIMMAX.LE.0.0)) THEN TIMMAX = 0.99 END IF IF ((IWATCH .EQ. 0 .AND. NCASE .LT. 100)) THEN
![Page 17: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/17.jpg)
NCASE=100 END IF IF ((NCASE/10 .EQ. 0)) THEN NCASE=10 END IF jcase = NCASE/10 NCASE = jcase*10 IF (((IXXIN .LE. 0) .OR. (IXXIN .GT. 31328))) THEN WRITE(6,2160)2160 FORMAT(' First RN seed outside allowed range and default value * set') IXXIN=1802 END IF IF (((JXXIN .LE. 0) .OR. (JXXIN .GT. 30081))) THEN WRITE(6,2170)2170 FORMAT(' Second RN seed outside allowed range and default valu *e set') JXXIN=9373 END IF IF((i_parallel .GT. 0))JXXIN = JXXIN - 1 + i_parallel IF((BEAM_SIZE .LE. 0.0))BEAM_SIZE=100. IF((IRESTART .LT. 0 .OR. IRESTART .GT. 4))IRESTART=0 IF((IPARALLEL.LT.0))IPARALLEL=0 IF((PARNUM.LT.0))PARNUM=0#ifdef HAVE_C_COMPILER IF ((IPARALLEL.GT.1 .AND. n_parallel.GT.0)) THEN WRITE(6,2180)IPARALLEL, n_parallel2180 FORMAT(/' You have set IPARALLEL in the input file to ',I4,/ ' * But you are also running a C compiled code with n_parallel=',I4,/ *' IPARALLEL will be reset to 1, and control of the parallel run '/ * ' will be from the code.'/) IPARALLEL=1 END IF#endif IF ((IPARALLEL.GT.1 .AND. PARNUM.GT.IPARALLEL .AND. (isource .EQ. *2 .OR. isource .EQ. 8 .OR. isource .EQ. 20))) THEN WRITE(6,2190)2190 FORMAT(//' ****WARNING:'/ ' PARNUM is > IPARALLEL '/ ' It must * be in the range 1<=PARNUM<=IPARALLEL if you'/ ' want to partition * a phase space source.'/ ' PARNUM will be set to 0 for now, and th *e phase space'/ ' source will not be partitioned.'//) PARNUM=0 END IF IF((IPARALLEL.GT.1 .AND. PARNUM.GT.0))i_parallel=PARNUM IF ((NRCYCL .LE. 0 .AND. (isource.EQ.2 .OR. isource.EQ.8))) THEN IF ((iqin.EQ.1 .OR. enflag.EQ.3)) THEN NRCYCL=0 ELSE IF ((iqin.EQ.0)) THEN tempdiv=nphist ELSE IF((iqin.EQ.-1)) THEN tempdiv=nshist-nphist ELSE tempdiv=nshist END IF IF ((IPARALLEL.GT.1 .AND. PARNUM.GT.0)) THEN temppar=IPARALLEL ELSE
![Page 18: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/18.jpg)
temppar=1 END IF IF ((NINT(dble(temppar*NCASE)/dble(tempdiv)).LE.1)) THEN NRCYCL=0 ELSE IF((MOD(temppar*NCASE,tempdiv).EQ.0)) THEN NRCYCL=(temppar*NCASE)/tempdiv-1 ELSE NRCYCL=(temppar*NCASE)/tempdiv END IF END IF END IF IF ((ihowfarless.LE.0 .OR. ihowfarless.GT.1)) THEN ihowfarless=0 howfarless=.false. ELSE howfarless=.true. iausfl(6)=1 iausfl(16)=1 iausfl(18)=1 iausfl(20)=1 iausfl(24)=1 END IF IF ((iqin .EQ. 0)) THEN etotin = ein ELSE etotin = ein + 0.511 END IF WRITE(6,2200)NCASE,IWATCH,TIMMAX,IXXIN,JXXIN,BEAM_SIZE,ISMOOTH,IRE *START,IDAT, IREJECT,ESAVE_GLOBAL,NRCYCL,IPARALLEL,PARNUM,n_split,i *howfarless WRITE(1,2200)NCASE,IWATCH,TIMMAX,IXXIN,JXXIN,BEAM_SIZE,ISMOOTH,IRE *START,IDAT, IREJECT,ESAVE_GLOBAL,NRCYCL,IPARALLEL,PARNUM,n_split,i *howfarless2200 FORMAT(/i12,i4,f7.2,2i10,f7.2,i7,i5,i4,i4,F7.2,i4,i4,i4,i4,i4/) IF ((IRESTART.EQ.1)) THEN WRITE(6,2210) WRITE(1,2210)2210 FORMAT(/' Above RNG seeds will be replaced by those from previ *ous run.') END IF ixx = IXXIN jxx = JXXIN call init_ranmar call srcinit(weight) IF ((isource.EQ.20)) THEN orig_NCASE = NCASE NCASE = dble(NCASE)/dble(survival_ratio) jcase = NCASE/10 NCASE = jcase*10 IF ((NRCYCL .LE. 0)) THEN IF ((iqin.EQ.1 .OR. enflag.EQ.3)) THEN NRCYCL=0 ELSE IF ((iqin.EQ.0)) THEN tempdiv=nphist ELSE IF((iqin.EQ.-1)) THEN tempdiv=nshist-nphist ELSE
![Page 19: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/19.jpg)
tempdiv=nshist END IF IF ((IPARALLEL.GT.1 .AND. PARNUM.GT.0)) THEN temppar=IPARALLEL ELSE temppar=1 END IF IF ((NINT(dble(temppar*NCASE)/dble(tempdiv)).LE.1)) TH * EN NRCYCL=0 ELSE IF((MOD(temppar*NCASE,tempdiv).EQ.0)) THEN NRCYCL=dble(temppar*NCASE)/dble(tempdiv)-1 ELSE NRCYCL=(temppar*NCASE)/dble(tempdiv) END IF END IF END IF END IF IF (( isource .EQ. 2 .OR. isource .EQ. 8 .OR. isource .EQ. 20)) TH *EN IF ((NRCYCL.GT.0)) THEN WRITE(6,2220)NRCYCL2220 FORMAT(' Will recyle each phase space particle ',I4,' time *s before going on '/ ' to next particle.') END IF IF (( ISMOOTH .EQ. 1)) THEN WRITE(6,2230)2230 FORMAT(/' Will redistribute phase space particles if phase * space file'/ ' restarted and/or individual particles recycled') ELSE WRITE(6,2240)2240 FORMAT(' Restarted phase space files and recycled particle *s are not'/ ' redistributed') END IF END IF IF ((IRESTART .EQ. 0)) THEN WRITE(6,2250)2250 FORMAT(/' Starting a new calculation') ELSE IF((IRESTART .EQ. 1)) THEN WRITE(6,2260)2260 FORMAT(/' Restarting from a previous run') ELSE IF((IRESTART .EQ. 2)) THEN WRITE(6,2270)2270 FORMAT(/' Just create input file and exit') ELSE IF((IRESTART .EQ. 3)) THEN WRITE(6,2280)2280 FORMAT(/' Read in stored data and analyse') ELSE IF((IRESTART .EQ. 4)) THEN WRITE(6,2290)2290 FORMAT(/' Recombining parallel runs') ELSE IRESTART = 0 WRITE(6,2300)2300 FORMAT(/' IRESTART set to 0, start new caln') END IF IF ((IDAT .EQ. 0)) THEN WRITE(6,2310)2310 FORMAT(/' Store intermediate files for each batch')
![Page 20: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/20.jpg)
ELSE IF((IDAT .EQ. 1)) THEN WRITE(6,2320)2320 FORMAT(/' Do not store intermediate files at all') ELSE IF((IDAT .EQ. 2)) THEN WRITE(6,2330)2330 FORMAT(/' Store data files at end of run only') ELSE IDAT = 0 WRITE(6,2340)2340 FORMAT(/' Store intermediate files for each batch') END IF IF ((IPARALLEL.GT.1)) THEN WRITE(6,2350)2350 FORMAT(/' Will output binary .pardose files for later analysis * with combinedose.'/ ' With this set, the egslst files do not co *ntain dose listings either.') END IF IF ((IWATCH.EQ.4)) THEN ioutgeom=egs_open_file(ioutgeom,0,1,'.egsgeom') write(ioutgeom,2360)1,'QUAD', xbound_min,ybound_min,zbound_min * , xbound_min,ybound_max,zbound_min, xbound_max,ybound_max,zbou * nd_min, xbound_max,ybound_min,zbound_min2360 format(' ',I1,A4,12(F7.2,',')) write(ioutgeom,2370)1,'QUAD', xbound_min,ybound_min,zbound_max * , xbound_min,ybound_max,zbound_max, xbound_max,ybound_max,zbou * nd_max, xbound_max,ybound_min,zbound_max2370 format(' ',I1,A4,12(F7.2,',')) write(ioutgeom,2380)1,'QUAD', xbound_min,ybound_min,zbound_min * , xbound_min,ybound_min,zbound_max, xbound_min,ybound_max,zbou * nd_max, xbound_min,ybound_max,zbound_min2380 format(' ',I1,A4,12(F7.2,',')) write(ioutgeom,2390)1,'QUAD', xbound_max,ybound_min,zbound_min * , xbound_max,ybound_min,zbound_max, xbound_max,ybound_max,zbou * nd_max, xbound_max,ybound_max,zbound_min2390 format(' ',I1,A4,12(F7.2,',')) write(ioutgeom,2400)1,'QUAD', xbound_min,ybound_min,zbound_min * , xbound_min,ybound_min,zbound_max, xbound_max,ybound_min,zbou * nd_max, xbound_max,ybound_min,zbound_min2400 format(' ',I1,A4,12(F7.2,',')) write(ioutgeom,2410)1,'QUAD', xbound_min,ybound_max,zbound_min * , xbound_min,ybound_max,zbound_max, xbound_max,ybound_max,zbou * nd_max, xbound_max,ybound_max,zbound_min2410 format(' ',I1,A4,12(F7.2,',')) IF ((isource .EQ. 2 .OR. isource .EQ. 8)) THEN XMIN_YMIN_ZMIN = r_11(1)*(-BEAM_SIZE/2) + r_12(1)*(-BEAM_S * IZE/2) + r_13(1)*(dsource+0.1) + xiso YMIN_XMIN_ZMIN = r_21(1)*(-BEAM_SIZE/2) + r_22(1)*(-BEAM_S * IZE/2) + r_23(1)*(dsource+0.1) + yiso ZMIN_XMIN_YMIN = r_31(1)*(-BEAM_SIZE/2) + r_32(1)*(-BEAM_S * IZE/2) + r_33(1)*(dsource+0.1) + ziso XMIN_YMAX_ZMIN = r_11(1)*(-BEAM_SIZE/2) + r_12(1)*(BEAM_SI * ZE/2) + r_13(1)*(dsource+0.1) + xiso YMAX_XMIN_ZMIN = r_21(1)*(-BEAM_SIZE/2) + r_22(1)*(BEAM_SI * ZE/2) + r_23(1)*(dsource+0.1) + yiso ZMIN_XMIN_YMAX = r_31(1)*(-BEAM_SIZE/2) + r_32(1)*(BEAM_SI * ZE/2) + r_33(1)*(dsource+0.1) + ziso XMAX_YMIN_ZMIN = r_11(1)*(BEAM_SIZE/2) + r_12(1)*(-BEAM_SI * ZE/2) + r_13(1)*(dsource+0.1) + xiso
![Page 21: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/21.jpg)
YMIN_XMAX_ZMIN = r_21(1)*(BEAM_SIZE/2) + r_22(1)*(-BEAM_SI * ZE/2) + r_23(1)*(dsource+0.1) + yiso ZMIN_XMAX_YMIN = r_31(1)*(BEAM_SIZE/2) + r_32(1)*(-BEAM_SI * ZE/2) + r_33(1)*(dsource+0.1) + ziso XMAX_YMAX_ZMIN = r_11(1)*(BEAM_SIZE/2) + r_12(1)*(BEAM_SIZ * E/2) + r_13(1)*(dsource+0.1) + xiso YMAX_XMAX_ZMIN = r_21(1)*(BEAM_SIZE/2) + r_22(1)*(BEAM_SIZ * E/2) + r_23(1)*(dsource+0.1) + yiso ZMIN_XMAX_YMAX = r_31(1)*(BEAM_SIZE/2) + r_32(1)*(BEAM_SIZ * E/2) + r_33(1)*(dsource+0.1) + ziso XMIN_YMIN_ZMAX = r_11(1)*(-BEAM_SIZE/2) + r_12(1)*(-BEAM_S * IZE/2) + r_13(1)*(dsource-0.1) + xiso YMIN_XMIN_ZMAX = r_21(1)*(-BEAM_SIZE/2) + r_22(1)*(-BEAM_S * IZE/2) + r_23(1)*(dsource-0.1) + yiso ZMAX_XMIN_YMIN = r_31(1)*(-BEAM_SIZE/2) + r_32(1)*(-BEAM_S * IZE/2) + r_33(1)*(dsource-0.1) + ziso XMIN_YMAX_ZMAX = r_11(1)*(-BEAM_SIZE/2) + r_12(1)*(BEAM_SI * ZE/2) + r_13(1)*(dsource-0.1) + xiso YMAX_XMIN_ZMAX = r_21(1)*(-BEAM_SIZE/2) + r_22(1)*(BEAM_SI * ZE/2) + r_23(1)*(dsource-0.1) + yiso ZMAX_XMIN_YMAX = r_31(1)*(-BEAM_SIZE/2) + r_32(1)*(BEAM_SI * ZE/2) + r_33(1)*(dsource-0.1) + ziso XMAX_YMIN_ZMAX = r_11(1)*(BEAM_SIZE/2) + r_12(1)*(-BEAM_SI * ZE/2) + r_13(1)*(dsource-0.1) + xiso YMIN_XMAX_ZMAX = r_21(1)*(BEAM_SIZE/2) + r_22(1)*(-BEAM_SI * ZE/2) + r_23(1)*(dsource-0.1) + yiso ZMAX_XMAX_YMIN = r_31(1)*(BEAM_SIZE/2) + r_32(1)*(-BEAM_SI * ZE/2) + r_33(1)*(dsource-0.1) + ziso XMAX_YMAX_ZMAX = r_11(1)*(BEAM_SIZE/2) + r_12(1)*(BEAM_SIZ * E/2) + r_13(1)*(dsource-0.1) + xiso YMAX_XMAX_ZMAX = r_21(1)*(BEAM_SIZE/2) + r_22(1)*(BEAM_SIZ * E/2) + r_23(1)*(dsource-0.1) + yiso ZMAX_XMAX_YMAX = r_31(1)*(BEAM_SIZE/2) + r_32(1)*(BEAM_SIZ * E/2) + r_33(1)*(dsource-0.1) + ziso write(ioutgeom,2420)3,'QUAD', XMIN_YMIN_ZMIN,YMIN_XMIN_ZMI * N,ZMIN_XMIN_YMIN, XMIN_YMAX_ZMIN,YMAX_XMIN_ZMIN,ZMIN_XMIN_ * YMAX, XMAX_YMAX_ZMIN,YMAX_XMAX_ZMIN,ZMIN_XMAX_YMAX, XMAX_Y * MIN_ZMIN,YMIN_XMAX_ZMIN,ZMIN_XMAX_YMIN2420 format(' ',I1,A4,12(F7.2,',')) write(ioutgeom,2430)3,'QUAD', XMIN_YMIN_ZMAX,YMIN_XMIN_ZMA * X,ZMAX_XMIN_YMIN, XMIN_YMAX_ZMAX,YMAX_XMIN_ZMAX,ZMAX_XMIN_ * YMAX, XMAX_YMAX_ZMAX,YMAX_XMAX_ZMAX,ZMAX_XMAX_YMAX, XMAX_Y * MIN_ZMAX,YMIN_XMAX_ZMAX,ZMAX_XMAX_YMIN2430 format(' ',I1,A4,12(F7.2,',')) write(ioutgeom,2440)3,'QUAD', XMIN_YMIN_ZMIN,YMIN_XMIN_ZMI * N,ZMIN_XMIN_YMIN, XMIN_YMIN_ZMAX,YMIN_XMIN_ZMAX,ZMAX_XMIN_ * YMIN, XMIN_YMAX_ZMAX,YMAX_XMIN_ZMAX,ZMAX_XMIN_YMAX, XMIN_Y * MAX_ZMIN,YMAX_XMIN_ZMIN,ZMIN_XMIN_YMAX2440 format(' ',I1,A4,12(F7.2,',')) write(ioutgeom,2450)3,'QUAD', XMAX_YMIN_ZMIN,YMIN_XMAX_ZMI * N,ZMIN_XMAX_YMIN, XMAX_YMIN_ZMAX,YMIN_XMAX_ZMAX,ZMAX_XMAX_ * YMIN, XMAX_YMAX_ZMAX,YMAX_XMAX_ZMAX,ZMAX_XMAX_YMAX, XMAX_Y * MAX_ZMIN,YMAX_XMAX_ZMIN,ZMIN_XMAX_YMAX2450 format(' ',I1,A4,12(F7.2,',')) write(ioutgeom,2460)3,'QUAD', XMIN_YMIN_ZMIN,YMIN_XMIN_ZMI * N,ZMIN_XMIN_YMIN, XMIN_YMIN_ZMAX,YMIN_XMIN_ZMAX,ZMAX_XMIN_ * YMIN, XMAX_YMIN_ZMAX,YMIN_XMAX_ZMAX,ZMAX_XMAX_YMIN, XMAX_Y * MIN_ZMIN,YMIN_XMAX_ZMIN,ZMIN_XMAX_YMIN
![Page 22: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/22.jpg)
2460 format(' ',I1,A4,12(F7.2,',')) write(ioutgeom,2470)3,'QUAD', XMIN_YMAX_ZMIN,YMAX_XMIN_ZMI * N,ZMIN_XMIN_YMAX, XMIN_YMAX_ZMAX,YMAX_XMIN_ZMAX,ZMAX_XMIN_ * YMAX, XMAX_YMAX_ZMAX,YMAX_XMAX_ZMAX,ZMAX_XMAX_YMAX, XMAX_Y * MAX_ZMIN,YMAX_XMAX_ZMIN,ZMIN_XMAX_YMAX2470 format(' ',I1,A4,12(F7.2,',')) IF ((isource.EQ.8)) THEN DO 2481 I=2,numang XMIN_YMIN_ZMIN = r_11(I)*(-BEAM_SIZE/2) + r_12(I)* * (-BEAM_SIZE/2) + r_13(I)*(dsource+0.1) + xiso YMIN_XMIN_ZMIN = r_21(I)*(-BEAM_SIZE/2) + r_22(I)* * (-BEAM_SIZE/2) + r_23(I)*(dsource+0.1) + yiso ZMIN_XMIN_YMIN = r_31(I)*(-BEAM_SIZE/2) + r_32(I)* * (-BEAM_SIZE/2) + r_33(I)*(dsource+0.1) + ziso XMIN_YMAX_ZMIN = r_11(I)*(-BEAM_SIZE/2) + r_12(I)* * (BEAM_SIZE/2) + r_13(I)*(dsource+0.1) + xiso YMAX_XMIN_ZMIN = r_21(I)*(-BEAM_SIZE/2) + r_22(I)* * (BEAM_SIZE/2) + r_23(I)*(dsource+0.1) + yiso ZMIN_XMIN_YMAX = r_31(I)*(-BEAM_SIZE/2) + r_32(I)* * (BEAM_SIZE/2) + r_33(I)*(dsource+0.1) + ziso XMAX_YMIN_ZMIN = r_11(I)*(BEAM_SIZE/2) + r_12(I)*( * -BEAM_SIZE/2) + r_13(I)*(dsource+0.1) + xiso YMIN_XMAX_ZMIN = r_21(I)*(BEAM_SIZE/2) + r_22(I)*( * -BEAM_SIZE/2) + r_23(I)*(dsource+0.1) + yiso ZMIN_XMAX_YMIN = r_31(I)*(BEAM_SIZE/2) + r_32(I)*( * -BEAM_SIZE/2) + r_33(I)*(dsource+0.1) + ziso XMAX_YMAX_ZMIN = r_11(I)*(BEAM_SIZE/2) + r_12(I)*( * BEAM_SIZE/2) + r_13(I)*(dsource+0.1) + xiso YMAX_XMAX_ZMIN = r_21(I)*(BEAM_SIZE/2) + r_22(I)*( * BEAM_SIZE/2) + r_23(I)*(dsource+0.1) + yiso ZMIN_XMAX_YMAX = r_31(I)*(BEAM_SIZE/2) + r_32(I)*( * BEAM_SIZE/2) + r_33(I)*(dsource+0.1) + ziso XMIN_YMIN_ZMAX = r_11(I)*(-BEAM_SIZE/2) + r_12(I)* * (-BEAM_SIZE/2) + r_13(I)*(dsource-0.1) + xiso YMIN_XMIN_ZMAX = r_21(I)*(-BEAM_SIZE/2) + r_22(I)* * (-BEAM_SIZE/2) + r_23(I)*(dsource-0.1) + yiso ZMAX_XMIN_YMIN = r_31(I)*(-BEAM_SIZE/2) + r_32(I)* * (-BEAM_SIZE/2) + r_33(I)*(dsource-0.1) + ziso XMIN_YMAX_ZMAX = r_11(I)*(-BEAM_SIZE/2) + r_12(I)* * (BEAM_SIZE/2) + r_13(I)*(dsource-0.1) + xiso YMAX_XMIN_ZMAX = r_21(I)*(-BEAM_SIZE/2) + r_22(I)* * (BEAM_SIZE/2) + r_23(I)*(dsource-0.1) + yiso ZMAX_XMIN_YMAX = r_31(I)*(-BEAM_SIZE/2) + r_32(I)* * (BEAM_SIZE/2) + r_33(I)*(dsource-0.1) + ziso XMAX_YMIN_ZMAX = r_11(I)*(BEAM_SIZE/2) + r_12(I)*( * -BEAM_SIZE/2) + r_13(I)*(dsource-0.1) + xiso YMIN_XMAX_ZMAX = r_21(I)*(BEAM_SIZE/2) + r_22(I)*( * -BEAM_SIZE/2) + r_23(I)*(dsource-0.1) + yiso ZMAX_XMAX_YMIN = r_31(I)*(BEAM_SIZE/2) + r_32(I)*( * -BEAM_SIZE/2) + r_33(I)*(dsource-0.1) + ziso XMAX_YMAX_ZMAX = r_11(I)*(BEAM_SIZE/2) + r_12(I)*( * BEAM_SIZE/2) + r_13(I)*(dsource-0.1) + xiso YMAX_XMAX_ZMAX = r_21(I)*(BEAM_SIZE/2) + r_22(I)*( * BEAM_SIZE/2) + r_23(I)*(dsource-0.1) + yiso ZMAX_XMAX_YMAX = r_31(I)*(BEAM_SIZE/2) + r_32(I)*( * BEAM_SIZE/2) + r_33(I)*(dsource-0.1) + ziso write(ioutgeom,2490)3,'QUAD', XMIN_YMIN_ZMIN,YMIN_ * XMIN_ZMIN,ZMIN_XMIN_YMIN, XMIN_YMAX_ZMIN,YMAX_XMIN
![Page 23: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/23.jpg)
* _ZMIN,ZMIN_XMIN_YMAX, XMAX_YMAX_ZMIN,YMAX_XMAX_ZMI * N,ZMIN_XMAX_YMAX, XMAX_YMIN_ZMIN,YMIN_XMAX_ZMIN,ZM * IN_XMAX_YMIN2490 format(' ',I1,A4,12(F7.2,',')) write(ioutgeom,2500)3,'QUAD', XMIN_YMIN_ZMAX,YMIN_ * XMIN_ZMAX,ZMAX_XMIN_YMIN, XMIN_YMAX_ZMAX,YMAX_XMIN * _ZMAX,ZMAX_XMIN_YMAX, XMAX_YMAX_ZMAX,YMAX_XMAX_ZMA * X,ZMAX_XMAX_YMAX, XMAX_YMIN_ZMAX,YMIN_XMAX_ZMAX,ZM * AX_XMAX_YMIN2500 format(' ',I1,A4,12(F7.2,',')) write(ioutgeom,2510)3,'QUAD', XMIN_YMIN_ZMIN,YMIN_ * XMIN_ZMIN,ZMIN_XMIN_YMIN, XMIN_YMIN_ZMAX,YMIN_XMIN * _ZMAX,ZMAX_XMIN_YMIN, XMIN_YMAX_ZMAX,YMAX_XMIN_ZMA * X,ZMAX_XMIN_YMAX, XMIN_YMAX_ZMIN,YMAX_XMIN_ZMIN,ZM * IN_XMIN_YMAX2510 format(' ',I1,A4,12(F7.2,',')) write(ioutgeom,2520)3,'QUAD', XMAX_YMIN_ZMIN,YMIN_ * XMAX_ZMIN,ZMIN_XMAX_YMIN, XMAX_YMIN_ZMAX,YMIN_XMAX * _ZMAX,ZMAX_XMAX_YMIN, XMAX_YMAX_ZMAX,YMAX_XMAX_ZMA * X,ZMAX_XMAX_YMAX, XMAX_YMAX_ZMIN,YMAX_XMAX_ZMIN,ZM * IN_XMAX_YMAX2520 format(' ',I1,A4,12(F7.2,',')) write(ioutgeom,2530)3,'QUAD', XMIN_YMIN_ZMIN,YMIN_ * XMIN_ZMIN,ZMIN_XMIN_YMIN, XMIN_YMIN_ZMAX,YMIN_XMIN * _ZMAX,ZMAX_XMIN_YMIN, XMAX_YMIN_ZMAX,YMIN_XMAX_ZMA * X,ZMAX_XMAX_YMIN, XMAX_YMIN_ZMIN,YMIN_XMAX_ZMIN,ZM * IN_XMAX_YMIN2530 format(' ',I1,A4,12(F7.2,',')) write(ioutgeom,2540)3,'QUAD', XMIN_YMAX_ZMIN,YMAX_ * XMIN_ZMIN,ZMIN_XMIN_YMAX, XMIN_YMAX_ZMAX,YMAX_XMIN * _ZMAX,ZMAX_XMIN_YMAX, XMAX_YMAX_ZMAX,YMAX_XMAX_ZMA * X,ZMAX_XMAX_YMAX, XMAX_YMAX_ZMIN,YMAX_XMAX_ZMIN,ZM * IN_XMAX_YMAX2540 format(' ',I1,A4,12(F7.2,','))2481 CONTINUE2482 CONTINUE END IF IF ((isource.EQ.20 .OR. isource.EQ.21)) THEN WRITE(6,2550)172550 FORMAT(/' Not displaying all 10000 source planes'/) END IF END IF END IF call srcout skindepth_for_bca=0 i_par_temp=i_parallel IF((IPARALLEL.GT.0 .AND. n_parallel.EQ.0))i_parallel=0 call get_transport_parameter(-1) i_parallel=i_par_temp IF ((ECUTIN.GT.ECUT)) THEN WRITE(6,2560)ECUT2560 FORMAT(/' ****WARNING****'/ ' ECUTIN > ECUT input in EGSnrc pa *rameters ( ',F10.4,' MeV).'/ ' ECUT defaults to ECUTIN.'/) ECUT=ECUTIN ELSE ECUTIN=ECUT END IF IF ((PCUTIN.GT.PCUT)) THEN
![Page 24: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/24.jpg)
WRITE(6,2570)PCUT2570 FORMAT(/' ****WARNING****'/ ' PCUTIN > PCUT input in EGSnrc pa *rameters ( ',F10.4,' MeV).'/ ' PCUT defaults to PCUTIN.'/) PCUT=PCUTIN ELSE ECUTIN=ECUT END IF IF (((.NOT.exact_bca .OR. transport_algorithm.EQ.1) .AND. SMAXIR.E *Q.1e10)) THEN SMAXIR=5. END IF smax = smaxir WRITE(6,2580)2580 FORMAT(/ / ' Call hatch'/ ' ----------'/) call hatch call show_transport_parameter(6) call show_transport_parameter(iout) IF((howfarless))call modify_tmxs(MIN(mindelX,mindelY,mindelZ)) WRITE(6,2590) WRITE(1,2590)2590 FORMAT(/' Medium',t24,'AE',t34,'AP') DO 2601 n=1,NMED WRITE(6,2610)(media(j,n),j=1,15),ae(n),ap(n) WRITE(1,2610)(media(j,n),j=1,15),ae(n),ap(n)2610 FORMAT(1x,15a1,2f10.3)2601 CONTINUE2602 CONTINUE DO 2621 irl=1,irmax endep_last(irl)=02621 CONTINUE2622 CONTINUE IHSTRY=0 IF ((IRESTART .EQ. 0)) THEN nnread = 0 nsmiss=0 nmissm=0 ncaseold=0 nsrjct=0 nsoutside=0 ndbsrjct=0 planarefe=0. planarefp=0. planarfe=0. planarfp=0. NofREPEAT = 0 esrc=0. nestep=0 nhist=0 more_in_cont=0 frMU_indx=0 IF ((IPARALLEL.GT.1 .AND. PARNUM.GT.0)) THEN nnphsp=INT((PARNUM-1)*nshist/IPARALLEL)+1 ELSE nnphsp=1 END IF IF ((i_iaea_in.EQ.1)) THEN END IF DO 2631 irl=1,irmax
![Page 25: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/25.jpg)
endep(irl)=0.0 endep2(irl)=0.0 endep_tmp(irl)=0.02631 CONTINUE2632 CONTINUE tcpuold=0. ELSE IF((IRESTART .EQ. 1)) THEN WRITE(6,2640)2640 FORMAT(/' *** About to read dose data from previous run ***') i_par_temp=i_parallel IF((IPARALLEL.GT.0 .AND. n_parallel.EQ.0))i_parallel=0 iorstrt=egs_open_datfile(iorstrt,0,1,'.egsdat') i_parallel=i_par_temp DO 2651 irl=1,irmax READ(iorstrt,*)endep(irl),endep2(irl)2651 CONTINUE2652 CONTINUE READ(iorstrt,*) ncaseold,nnread,nsmiss,nmissm,nnphsp,NofREPEAT * ,tcpuold,esrc, planarefe,planarefp,planarfe,planarfp,nestep,ns * rjct,nsoutside,ndbsrjct, nhist read(iorstrt,*) urndm,crndm,cdrndm, cmrndm, ixx, jxx, rng_seed * , rng_array twom24 = 1./16777216. CLOSE(iorstrt) WRITE(6,2660)ncaseold WRITE(1,2660)ncaseold2660 FORMAT(/' Histories finshed in previous run',i12) IF ((isource.EQ.2 .OR. isource.EQ.8 .OR. isource.EQ.9)) THEN WRITE(6,2670)nhist WRITE(1,2670)nhist2670 FORMAT(/' Equivalent no. of primary histories',i12) END IF WRITE(6,2680)tcpuold/3600. WRITE(1,2680)tcpuold/3600.2680 FORMAT(/' Total previou CPU time (hour) ',f10.3) WRITE(6,2690) WRITE(1,2690)2690 FORMAT(/' Random number seeds for restart ',$) write(6,'(a,2i4,$)') ' ixx jxx = ',ixx,jxx write(1,'(a,2i4,$)') ' ixx jxx = ',ixx,jxx WRITE(6,2700)2700 FORMAT(/' ***Successfully read previous dose data file ***') ELSE IF((IRESTART .EQ. 2)) THEN GO TO 2710 ELSE IF((IRESTART .EQ. 3)) THEN NCASE=0 WRITE(6,2720)2720 FORMAT(/' *** About to read dose data from previous run ***') i_par_temp=i_parallel IF((IPARALLEL.GT.0 .AND. n_parallel.EQ.0))i_parallel=0 iorstrt=egs_open_datfile(iorstrt,0,1,'.egsdat') i_parallel=i_par_temp DO 2731 irl=1,irmax READ(iorstrt,*)endep(irl),endep2(irl)2731 CONTINUE2732 CONTINUE READ(iorstrt,*) ncaseold,nnread,nsmiss,nmissm,nnphsp,NofREPEAT * ,tcpuold,esrc, planarefe,planarefp,planarfe,planarfp,nestep,ns
![Page 26: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/26.jpg)
* rjct,nsoutside,ndbsrjct, nhist read(iorstrt,*) urndm,crndm,cdrndm, cmrndm, ixx, jxx, rng_seed * , rng_array twom24 = 1./16777216. CLOSE(iorstrt) WRITE(6,2740)ncaseold WRITE(1,2740)ncaseold2740 FORMAT(/' Histories finished in previous run',i12) WRITE(6,2750)tcpuold/3600. WRITE(1,2750)tcpuold/3600.2750 FORMAT(/' Total CPU time (hour) by then ',f10.3) timcpu=0 NCASE=0 WRITE(6,2760)2760 FORMAT(/' ***Successfully read previous dose data file ***') GO TO 2770 ELSE IF((IRESTART.EQ.4)) THEN call egs_combine_runs(combine_results,'.pardose') ainflu=temp2 IF(((isource .EQ. 0 .OR. isource .EQ. 1 .OR. isource .EQ. 3 .O * R. isource .EQ. 7) .AND. beamarea.GT.0.))ainflu=ainflu/beamare * a goto 2780 END IF IF ((IREJECT .EQ. 1)) THEN WRITE(6,2790)ESAVE_GLOBAL WRITE(1,2790)ESAVE_GLOBAL2790 FORMAT(/' Will perform charged-particle range rejection agains *t voxel boundaries'/ ' if particle energy is below ',F12.5,' MeV.' *) IF ((ESAVE_GLOBAL .LE. ECUTIN)) THEN WRITE(6,2800) WRITE(1,2800)2800 FORMAT(///' ****** NB ESAVE_GLOBAL <= ECUT so NO Range R *ejection', ' ***' //) IREJECT=0 ELSE lelec=-1 DO 2811 MEDIUM=1,NMED IF ((ECUTIN .EQ. AE(MEDIUM))) THEN RANGE_ECUTRR(MEDIUM)=0.0 ELSE EKE = ECUTIN- RM ELKE = LOG(EKE) LELKE=EKE1(MEDIUM)*ELKE+EKE0(MEDIUM) EKEI = E_array(LELKE,MEDIUM) ELKEI = (LELKE - eke0(MEDIUM))/eke1(MEDIUM) fedep = 1 - EKEI/EKE elktmp = 0.5*(ELKE+ELKEI+0.25*fedep*fedep*(1+fedep * *(1+0.875*fedep))) lelktmp = LELKE IF ((lelec .LT. 0)) THEN dedxmid=ededx1(Lelktmp,MEDIUM)*elktmp+ededx0(L * elktmp,MEDIUM) dedxmid = 1/dedxmid aux = ededx1(lelktmp,medium)*dedxmid ELSE dedxmid=pdedx1(Lelktmp,MEDIUM)*elktmp+pdedx0(L
![Page 27: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/27.jpg)
* elktmp,MEDIUM) dedxmid = 1/dedxmid aux = pdedx1(lelktmp,medium)*dedxmid END IF aux = aux*(1+2*aux)*(fedep/(2-fedep))**2/6 RANGE_ECUTRR(MEDIUM) = fedep*EKE*dedxmid*(1+aux) RANGE_ECUTRR(MEDIUM)=RANGE_ECUTRR(MEDIUM)+range_ep * (0,LELKE,MEDIUM) END IF2811 CONTINUE2812 CONTINUE END IF ELSE IREJECT=0 WRITE(6,2820) WRITE(1,2820)2820 FORMAT(/' No range rejection.') IF ((ESAVE_GLOBAL .GT. ECUTIN)) THEN WRITE(6,2830) WRITE(1,2830)2830 FORMAT(T10,' Why is ESAVE_GLOBAL set when there is no rang *e rejection?', /T15,'It is set to zero'/) ESAVE_GLOBAL = 0.0 END IF END IF IF ((n_split .GT. 1)) THEN iausfl(8) = 1 iausfl(14) = 1 iausfl(15) = 1 WRITE(6,2840)n_split WRITE(1,2840)n_split2840 FORMAT(/' Photons will be split ',I4,' times'/) END IF WRITE(6,2850) WRITE(1,2850)2850 FORMAT(//' ******************************************************* *********') IF ((isource.EQ.20)) THEN WRITE(6,2860)orig_NCASE WRITE(1,2860)orig_NCASE2860 FORMAT(/ ' Histories to be simulated for this run ',i12) WRITE(6,2870)NCASE WRITE(1,2870)NCASE2870 FORMAT( / ' Predicted histories to be analyzed after this run * ',i12) ELSE WRITE(6,2880)NCASE WRITE(1,2880)NCASE2880 FORMAT(/ ' Histories to be simulated for this run ',i12) WRITE(6,2890)ncaseold+NCASE WRITE(1,2890)ncaseold+NCASE2890 FORMAT(/ ' Histories to be analyzed after this run',i12) END IF WRITE(6,2900) WRITE(1,2900)2900 FORMAT(/ ' ******************************************************* *********') IF ((IDAT.EQ.0 .OR. IDAT.EQ.2)) THEN
![Page 28: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/28.jpg)
i_par_temp=i_parallel IF((IPARALLEL.GT.0 .AND. n_parallel.EQ.0))i_parallel=0 iorstrt=egs_open_file(iorstrt,0,1,'.egsdat') i_parallel=i_par_temp END IF IF ((IWATCH .NE. 0)) THEN call watch(-99,IWATCH) END IF TIMEB = egs_tot_time(0) WRITE(6,2910)TIMEB WRITE(1,2910)TIMEB2910 FORMAT(' Elapsed wall clock time to this point=',f12.3,' s'/) tdum = egs_tot_time(1) ETIMETOT=0 cput1=egs_etime() WRITE(6,2920)cput1 - cput0 WRITE(1,2920)cput1 - cput02920 FORMAT(/' CPU time so far for this run =',f12.3,' s'/) NETADJ=0 CYCLNUM=0 nhist_last=0#ifdef HAVE_C_COMPILER n_tot = ncaseold first_time = .true. is_finished = .false. part_dose=0 part2_dose=02930 CONTINUE IF ((isource .EQ. 20 .OR. isource .EQ. 21)) THEN more_in_cont=0 frMU_indx=0 END IF IF (( n_parallel .GT. 0 )) THEN call egs_pjob_control(ncase,n_run,n_left,n_tot,part_dose,part2 * _dose, current_result, current_uncertainty) IF (( n_run .EQ. 0 )) THEN write(6,'(//a,a//)') '****** No histories left in job cont *rol file', ' => end simulation' goto 2770 END IF jcase = n_run/10 IF (( jcase .LT. 1 )) THEN jcase = 1 n_run = jcase*10 END IF IF (( first_time )) THEN IF((isource.EQ.2.OR.isource.EQ.8.OR.isource.EQ.20))p_per_p * hsp_chunk=nshist/(n_parallel*10) first_time = .false. n_last = n_run write(6,'(//a,i12,a//)') '****** Running ',n_run,' histori *es' ELSE write(6,'(//a,i12,a)') '***** Finished ',n_last,' historie *s' write(6,'(/a/,20x,1pe11.4,a,0pf5.2,a/,a,i12,a//)') ' *current result including previous runs and other parallel jobs: ', * current_result, ' +/- ',current_uncertainty,' %', '
![Page 29: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/29.jpg)
*will run another ',n_run,' histories' END IF IF ((isource.EQ.2.OR.isource.EQ.8.OR.isource.EQ.20)) THEN n_run_chunk=(ncase-n_left)*n_parallel*10/ncase other_num_1=n_run_chunk*ncase other_num_2=(ncase-n_left)*n_parallel*10 IF ((other_num_1.LT.other_num_2)) THEN n_run_chunk=n_run_chunk+1 END IF nnphsp_min=(n_run_chunk-1)*p_per_phsp_chunk+1 IF ((n_left.EQ.0)) THEN nnphsp_max=nshist ELSE nnphsp_max=nnphsp_min+p_per_phsp_chunk-1 END IF nnphsp=nnphsp_min IF ((i_iaea_in.EQ.1)) THEN END IF CYCLNUM=0 write(6,'(/a/,a,i12,a,i12/,a//)') ' This simulation u *ses a phase space source.', ' This run will use from particle *',nnphsp_min,' to particle ', nnphsp_max, ' in the source fil *e.' END IF END IF#endif DO 2941 ibatch=1,10 IF ((ibatch .EQ. 1)) THEN CALL DATETIME(1) WRITE(6,2950)TIMEN WRITE(1,2950)TIMEN2950 FORMAT(/' BATCH #',2X,'TIME-ELAPSED',2X,'TOTAL CPUTIME',2X *,'RATIO',2X, 'TIME OF DAY',2X,'RNG pointers'// ' ',4X,'1',10X,'0.0 *',12X,'0.0',6X,'0.00',4X,A,' ',$) write(6,'(a,2i4,$)') ' ixx jxx = ',ixx,jxx write(1,'(a,2i4,$)') ' ixx jxx = ',ixx,jxx WRITE(6,2960) WRITE(1,2960)2960 FORMAT(' ') ELSE TIMEB = egs_tot_time(0) ETIMETOT=ETIMETOT+TIMEB CPUT2=egs_etime() CALL DATETIME(1) TIMCPU=CPUT2-CPUT1 WRITE(6,2970)IBATCH,ETIMETOT,TIMCPU,ETIMETOT/TIMCPU,TIMEN WRITE(1,2970)IBATCH,ETIMETOT,TIMCPU,ETIMETOT/TIMCPU,TIMEN2970 FORMAT(4X,I2,5X,F8.1,7X,F8.1,2X,F8.2,4X,A,' ',$) write(6,'(a,2i4,$)') ' ixx jxx = ',ixx,jxx write(1,'(a,2i4,$)') ' ixx jxx = ',ixx,jxx WRITE(6,2980) WRITE(1,2980)2980 FORMAT(' ') BATCHT=TIMCPU/FLOAT(IBATCH-1) IF ((TIMCPU+1.1*BATCHT .GT. TIMMAX*3600.)) THEN WRITE(6,2990) WRITE(1,2990)2990 FORMAT(' Not enough time for another batch within time
![Page 30: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/30.jpg)
* limit') END IF END IF DO 3001 ihist=1,jcase nhist_old=nhist IHSTRY=IHSTRY+1 call srchst(xin,yin,zin,uin,vin,win,irin,weight,latchi) IF ((((isource.EQ.20).OR.(isource.EQ.21 )).AND. weight.EQ. * 0)) THEN IHSTRY=IHSTRY-1 ELSE IF ((enflag .EQ. 1)) THEN esrc = esrc + weight*esrc_sp IF ((iqin .EQ.1)) THEN esrc = esrc + weight*1.0220068 END IF IF ((iqin .NE. 0)) THEN etotin = esrc_sp + 0.5110034 ELSE etotin = esrc_sp END IF ELSE IF((enflag .EQ. 2 .OR. enflag .EQ. 3)) THEN etotin = einsrc IF ((iqin .EQ. -1)) THEN esrc = esrc + weight*(etotin - 0.5110034) ELSE IF((iqin .EQ. 0)) THEN esrc = esrc + weight*etotin ELSE IF((iqin .EQ. 1)) THEN esrc = esrc + weight*(etotin + 0.5110034) END IF ELSE IF((enflag .EQ. 4)) THEN IF ((iqin .NE. 0)) THEN etotin = einsrc +0.511 ELSE etotin = einsrc END IF esrc = esrc + einsrc IF ((iqin .EQ.1)) THEN esrc = esrc + 0.5110034 END IF ELSE IF((enflag .GT. 5 )) THEN WRITE(6,3010)enflag3010 FORMAT(' Wrong enflag:',I10) STOP END IF IF ((IWATCH .GT. 0)) THEN WRITE(6,3020) 1,etotin,iqin,irin,xin,yin,zin,uin,v * in,win,latchi,weight3020 FORMAT(/' Initial shower values', t36,':',i3,f9.3, *2i4,3f8.3,3f7.3,i10,1pe10.3) END IF IF ((xin*xin+yin*yin.LT.0.31831)) THEN IF ((iqin .NE. 0)) THEN planarfe=planarfe+weight planarefe=planarefe+(etotin-0.5110034)*weight ELSE planarfp=planarfp+weight planarefp=planarefp+etotin*weight
![Page 31: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/31.jpg)
END IF END IF IF(((isource.NE.2 .AND. isource.NE.8 .AND. isource.NE. * 9) .OR. (dose_stat.EQ.1 .AND. NRCYCL.EQ.0) .OR. (dose_ * stat.EQ.1 .AND. CYCLNUM.EQ.1) .OR. ((isource.EQ.2 .OR. * isource.EQ.8) .AND. dose_stat.EQ.0 .AND. IPARALLEL.GT * .1 .AND. PARNUM.GT.0 .AND. ihist.EQ.1 .AND. IBATCH.EQ. * 1 .AND. nhist.EQ.nhist_old)))nhist=nhist+1 IF ((nhist.NE.nhist_old)) THEN nhist_last=nhist_last+1 IF ((nhist_last.EQ.32700)) THEN DO 3031 irl=1,irmax-1 endep_last(irl)=03031 CONTINUE3032 CONTINUE nhist_last=1 END IF END IF IF (( (iqin .NE. 0 .AND. e_split .GT. 1 .AND. n_split. * GT.1) .AND. (isource .EQ. 2 .OR. isource .EQ. 8 .OR. i * source .EQ. 9 ) )) THEN n_repeat = e_split ELSE n_repeat = 1 END IF DO 3041 i_repeat=1,n_repeat call shower(iqin,etotin,xin,yin,zin,uin,vin,win,ir * in,weight/n_repeat)3041 CONTINUE3042 CONTINUE IF((IWATCH .NE. 0))call watch(-1,IWATCH) END IF3001 CONTINUE3002 CONTINUE cput2=egs_etime() timcpu=cput2-cput1 IF ((IDAT .EQ. 0 .OR. (IDAT .EQ. 2 .AND. ibatch .EQ. 10) )) TH * EN rewind(iorstrt) DO 3051 irl=1,irmax endep(irl)=endep(irl)+endep_tmp(irl) endep2(irl)=endep2(irl)+endep_tmp(irl)*endep_tmp(irl) endep_tmp(irl)=0. WRITE(iorstrt,*)endep(irl),endep2(irl)3051 CONTINUE3052 CONTINUE WRITE(iorstrt,*) IHSTRY+ncaseold, nnread, nsmiss, nmissm, * nnphsp, NofREPEAT, tcpuold+timcpu, esrc, planarefe, planar * efp, planarfe, planarfp, nestep, nsrjct,nsoutside,ndbsrjct * ,nhist write(iorstrt,*) urndm,crndm,cdrndm, cmrndm, ixx, jxx, rng * _seed, rng_array END IF2941 CONTINUE2942 CONTINUE#ifdef HAVE_C_COMPILER IF (( n_parallel .GT. 0 )) THEN goto 2930
![Page 32: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/32.jpg)
END IF#endif IF((IDAT.EQ.0 .OR. IDAT.EQ.2))close(iorstrt) IF ((IWATCH.EQ.4)) THEN close(ioutgph) close(ioutgeom) END IF2770 CONTINUE IF ((IRESTART .NE. 3)) THEN WRITE(6,3060)timcpu,timcpu/3600.,dble(IHSTRY)/(timcpu/3600.) WRITE(1,3060)timcpu,timcpu/3600.,dble(IHSTRY)/(timcpu/3600.)3060 FORMAT(/' Total CPU time for run =',f8.1,' s =',f8.3,' hr =>', *F12.0,' hist/hr'/T3,' On ','x86_64-unknown-linux-gnu',' ') END IF IF ((IRESTART .EQ. 1)) THEN WRITE(6,3070)timcpu+tcpuold,(timcpu+tcpuold)/3600.,dble(IHSTRY * +ncaseold) /((timcpu+tcpuold)/3600.) WRITE(1,3070)timcpu+tcpuold,(timcpu+tcpuold)/3600.,dble(IHSTRY * +ncaseold) /((timcpu+tcpuold)/3600.)3070 FORMAT(/' CPU time for this+previous run =',f8.1,' s =',f8.3,' * hr =>', F12.0,' hist/hr'/T3,' On ','x86_64-unknown-linux-gnu','' *) ELSE IF((IRESTART .EQ. 3)) THEN WRITE(6,3080)timcpu+tcpuold,(timcpu+tcpuold)/3600.,float(ncase * old) /((timcpu+tcpuold)/3600.) WRITE(1,3080)timcpu+tcpuold,(timcpu+tcpuold)/3600.,float(ncase * old) /((timcpu+tcpuold)/3600.)3080 FORMAT(/' Total CPU time for old run =',f8.1,' s =',f8.3,' hr= *>', F12.0,' hist/hr'/T3,' On ','x86_64-unknown-linux-gnu',' ') END IF IF ((isource .EQ. 2 .OR. isource .EQ. 8 )) THEN WRITE(6,3090)nnread,nhist,nsrjct,nsoutside,ndbsrjct,nsmiss, fl * oat((NRCYCL+1)*(nnread-nsrjct-nsoutside-ndbsrjct)-nsmiss)/floa * t(nnread), NRCYCL,IHSTRY+ncaseold,OUTCNT WRITE(1,3090)nnread,nhist,nsrjct,nsoutside,ndbsrjct,nsmiss, fl * oat((NRCYCL+1)*(nnread-nsrjct-nsoutside-ndbsrjct)-nsmiss)/floa * t(nnread), NRCYCL,IHSTRY+ncaseold,OUTCNT3090 FORMAT(/' *************************************************** ******************'/ /' # of particles read from ph-sp file (N_read *) =',i12/ ' # of primary (non ph-sp) histories r *ead from ph-sp file =',i12/ ' # of particles discarded duet *o charge/LATCH/W/multiple passer =',i12/ ' # of particles discarde *d because beyond BEAM_SIZE =',i12/ ' # of photons rej *ected because beyond DBS splitting radius =',i12/ ' # of part *icles that missed geometry =',i12/ ' * N_used/N_read =',f12. *3/ ' # of times each particle in ph-sp file recycled '/ ' * (last particle may be recycled less than this) =' *,i12/ ' # of ph-sp particles simulated (N_used) *=',i12/ ' # of times ph-sp file restarted in this run * =',i12/ /' *********************************************** **********************') ELSE IF((isource.EQ.9)) THEN WRITE(6,3100)nnread,nhist,nsrjct,nsoutside,ndbsrjct,nsmiss,IHS * TRY+ncaseold, dble(IHSTRY+ncaseold)/float(nnread) WRITE(1,3100)nnread,nhist,nsrjct,nsoutside,ndbsrjct,nsmiss,IHS * TRY+ncaseold, dble(IHSTRY+ncaseold)/float(nnread)3100 FORMAT(/' ***************************************************
![Page 33: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/33.jpg)
******************'// ' # of particles read from BEAM simulation (N *_read) =',i12/ ' # of primary particles incident in B *EAM simulation =',i12/ ' # of particles discarded duet *o charge/LATCH/W/multiple passer =',i12/ ' # of particles discarde *d because beyond BEAM_SIZE =',i12/ ' # of photons rej *ected because beyond DBS splitting radius =',i12/ ' # of part *icles that missed geometry =',i12/ ' # *of particles simulated in DOSXYZnrc (N_used) =',i1 *2/ ' N_used/N_read =',f12.3/ /' **** *****************************************************************') ELSE IF((isource.EQ.20)) THEN WRITE(6,3110)orig_NCASE,survival_ratio,NCASE,nnread,nsrjct,nso * utside,ndbsrjct, 1-dble(IHSTRY+(NRCYCL+1)*(nsrjct+nsoutside+nd * bsrjct))/ dble((NRCYCL+1)*(nnread)),IHSTRY+ncaseold, dble(IHST * RY+ncaseold)/(float(nnread)*(NRCYCL+1)),OUTCNT WRITE(1,3110)orig_NCASE,survival_ratio,NCASE,nnread,nsrjct,nso * utside,ndbsrjct, 1-dble(IHSTRY+(NRCYCL+1)*(nsrjct+nsoutside+nd * bsrjct))/ dble((NRCYCL+1)*(nnread)),IHSTRY+ncaseold, dble(IHST * RY+ncaseold)/(float(nnread)*(NRCYCL+1)),OUTCNT3110 FORMAT(/' *************************************************** ******************'// ' # of particles originally requested (NCASE) * =',i12/ ' predicted survival ratio (based on * MLC blockage) =',f12.3/ ' # calculated number to read * from phsp (NCASE/survival_ratio) =',i12/ ' # of primary particl *es incident in VCU simulation (nnread) =',i12/ ' # of particle *s discarded due to charge/LATCH/W/multiple passer =',i12/ ' # of p *articles discarded because beyond BEAM_SIZE =',i12/ ' * # of photons rejected because beyond DBS splitting radius =' *,i12/ ' fr. of particles that missed geometry or got blocked by l *eaves=',f12.3/ ' # of particles used in DOSXYZnrc (N_used) * =',i12/ ' N_used/(nnread x N_recycle) * =',f12.3/ ' # of times ph-sp file restarted in th *is run =',i12/ /' **************************** *****************************************') ELSE IF((isource.EQ.21)) THEN WRITE(6,3120)nnread,nhist,nsrjct,nsoutside,ndbsrjct,nsmiss,IHS * TRY+ncaseold, dble(IHSTRY+ncaseold)/float(nnread) WRITE(1,3120)nnread,nhist,nsrjct,nsoutside,ndbsrjct,nsmiss,IHS * TRY+ncaseold, dble(IHSTRY+ncaseold)/float(nnread)3120 FORMAT(/' *************************************************** ******************'// ' # of particles read from BEAM simulation (N *_read) =',i12/ ' # of primary particles incident in B *EAM simulation =',i12/ ' # of particles discarded duet *o charge/LATCH/W/multiple passer =',i12/ ' # of particles discarde *d because beyond BEAM_SIZE =',i12/ ' # of photons rej *ected because beyond DBS splitting radius =',i12/ ' # of part *icles that missed geometry or got blocked by leaves =',i12/ ' # *of particles simulated in DOSXYZnrc (N_used) =',i1 *2/ ' N_used/N_read =',f12.3/ /' **** *****************************************************************') ELSE IF((isource .EQ. 1)) THEN WRITE(6,3130)nmissm WRITE(1,3130)nmissm3130 FORMAT(/' *************************************************** ******************'/ /' # of particles which missed the phantom wi *th source 1 =',i12/ /' ************************************ *********************************') ELSE IF((isource .EQ.4 )) THEN
![Page 34: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/34.jpg)
WRITE(1,3140) nnread,ncase+ncaseold,nsmiss WRITE(6,3140) nnread,ncase+ncaseold,nsmiss3140 FORMAT(/ ' *************************************************** *******************'/ /' No of particles reconstructed by source m *odel =',i12/ ' No of particles actually simulated * =',i12/ ' No of particles started outside the region surro *unding the '/ ' phantom and were excluded in the simulation * =',i12/ /' ************************************************* *********************'/) END IF etot=0. DO 3151 irl=1,irmax-1 etot=etot+endep(irl)3151 CONTINUE3152 CONTINUE IF ((enflag .EQ. 0)) THEN WRITE(6,3160)etot/(dble(IHSTRY+ncaseold)*ein) WRITE(1,3160)etot/(dble(IHSTRY+ncaseold)*ein)3160 FORMAT(/' Fraction of incident energy deposited in the phantom * =',f12.4/) ELSE IF(((enflag.EQ.1).OR.(enflag.EQ.2).OR.(enflag.EQ.3).OR.(enfla *g.EQ.4))) THEN WRITE(6,3170)etot/esrc WRITE(1,3170)etot/esrc3170 FORMAT(/' Fraction of incident energy deposited in the phantom * =',f12.4/) IF (((enflag .GT. 1))) THEN WRITE(6,3180)endep(irl)/esrc WRITE(1,3180)endep(irl)/esrc3180 FORMAT(/' Fraction of incident energy deposited in the reg *ion surrounding'/ ' the phantom when incident particles go through * it =',f12.4/) END IF END IF IF ((isource .EQ. 0 .OR. isource .EQ. 1 .OR. isource .EQ. 3 .OR. i *source .EQ. 7)) THEN temp2=dble(IHSTRY+ncaseold-nsmiss-nmissm) IF ((beamarea .EQ. 0)) THEN ainflu=dble(IHSTRY+ncaseold-nsmiss-nmissm) ELSE ainflu=dble(IHSTRY+ncaseold-nsmiss-nmissm)/beamarea END IF ELSE IF((isource .EQ. 2 .OR. isource .EQ. 8 )) THEN ainflu=dble(IHSTRY+ncaseold+nsmiss+ (NRCYCL+1)*(nsrjct+nsoutsi * de+ndbsrjct))/float(nshist)*NINCSRC temp2=ainflu ELSE IF((isource.EQ.4)) THEN ainflu=dble(IHSTRY+ncaseold-nsmiss) temp2=ainflu ELSE IF((isource.EQ.6)) THEN ainflu=dble(IHSTRY+ncaseold) temp2=ainflu ELSE IF((isource.EQ.9.OR.isource.EQ.10.OR.isource.EQ.21)) THEN ainflu=dble(nhist) temp2=ainflu ELSE IF((isource.EQ.20)) THEN ainflu = dble((NRCYCL+1)*(nnread))/dble(nshist)*NINCSRC temp2=ainflu
![Page 35: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/35.jpg)
END IF WRITE(6,3190)nestep,dble(nestep)/ainflu,count_pII_steps/dble(neste *p) WRITE(1,3190)nestep,dble(nestep)/ainflu,count_pII_steps/dble(neste *p)3190 FORMAT(/' Number of charged particle steps simulated, N_step = *',I15/ ' Number of charged particle steps/incident fluence =' *,1PE15.5/ ' No. of PRESTA-II steps/total no. of charged particle s *teps =',0PF15.5/) IF ((dose_stat.EQ.1)) THEN WRITE(6,3200) WRITE(1,3200)3200 FORMAT(//' ***WARNING***'/ ' Could not read no. of primary (no *n-phsp) histories from ph-sp file.'/ ' Dose analyzed assuming each * particle read from the ph-sp'/ ' file is an independent history. *May result in an underestimate'/ ' of the uncertainty.'//) ELSE IF((OUTCNT.GT.0)) THEN WRITE(6,3210) WRITE(1,3210)3210 FORMAT(//' ***WARNING***'/ ' The ph-sp source was restarted at * least once. This may lead'/ ' to an underestimate of uncertainty *, especially if restarted'/ ' many times. If restarted many times *, try re-running with'/ ' NRCYCL recalculated as described at topo *f dosxyznrc.mortran'//) END IF DO 3221 irl=1,irmax-1 IF ((IDAT.EQ.1)) THEN endep(irl)=endep(irl)+endep_tmp(irl) endep2(irl)=endep2(irl)+endep_tmp(irl)*endep_tmp(irl) END IF endep(irl)=endep(irl)/rhor(irl+1) endep2(irl)=endep2(irl)/(rhor(irl+1)*rhor(irl+1))3221 CONTINUE3222 CONTINUE#ifdef HAVE_C_COMPILER IF ((IPARALLEL.GT.1 .OR. n_parallel.GT.0)) THEN parname=egs_home(:lnblnk1(egs_home)) // user_code(:lnblnk1(use * r_code)) // '/' // work_dir(:lnblnk1(work_dir)) // output_file * (:lnblnk1(output_file)) IF ((n_parallel.GT.0)) THEN parname=parname(:lnblnk1(parname))//'_w' call egs_itostring(parname,i_parallel,.false.) END IF parname=parname(:lnblnk1(parname))//'.pardose' parname(lnblnk1(parname)+1:lnblnk1(parname)+1)=char(0) call write_pardose(temp2,IMAX,JMAX,KMAX,endep,endep2,parname) END IF#endif2780 CONTINUE DO 3231 i=1,IMAX DO 3241 j=1,JMAX DO 3251 k=1,KMAX irl= (i + (j-1)*IMAX + (k-1)*ijmax) temp=endep(irl)/temp2 endep2(irl)=endep2(irl)/temp2 endep2(irl)=(endep2(irl)-temp*temp)/(temp2-1) IF((endep2(irl).GT.0))endep2(irl)=sqrt(endep2(irl)) IF((endep(irl).NE.0))endep2(irl)=endep2(irl)/(endep(ir
![Page 36: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/36.jpg)
* l)/temp2) amass= (xbound(i+1)-xbound(i))* (ybound(j+1)-ybound(j) * )* (zbound(k+1)-zbound(k)) IF ((amass.NE.0.0)) THEN endep(irl) = endep(irl)*1.602e-10/(amass*ainflu) ELSE endep(irl) = 0.0 WRITE(6,3260)i,j,k WRITE(1,3260)i,j,k3260 FORMAT('AMASS is zero in I= ',I4,'J= ',I4,' K= ', *I4) WRITE(6,3270) WRITE(1,3270)3270 FORMAT('So the dose has been set to zero.') END IF IF((endep(irl).EQ.0.))endep2(irl)=0.99999993251 CONTINUE3252 CONTINUE3241 CONTINUE3242 CONTINUE3231 CONTINUE3232 CONTINUE IF ((doseprint .NE. 1)) THEN IF (((n_parallel.GT.0 .AND. is_finished).OR.IRESTART.EQ.4 )) T * HEN write(1,3280)title3280 format(//,'1',80a1 // t10, 'DOSXYZnrc ($Revision: 1.47 $)D *ose outputs (dose/F, Gy.cm**2)') ELSE IF ((((isource.EQ.0).OR.( isource.EQ.1).OR.( isource.EQ.3) * .OR. (isource.EQ.7)).AND. (beamarea .NE. 0.))) THEN write(1,3290)title,planarefe,planarefp,planarfe,planar * fp,ainflu3290 format( '1',80a1 // t5,'Elec/positron planar energy fl *uence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the p *hantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar energy f *luence scored in a 1cm**2 circle '/ t5,'centered at z-axis on thep *hantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positron planarfl *uence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the p *hantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar fluence *scored in a 1cm**2 circle '/ t5,'centered at z-axis on the phantom * surface =',1pe11.3,'(1/cm**2)'// t5,'Average planar fluence (numb *er/beam area), F =', 1pe11.3,'(1/cm**2)'// t10, 'DOSXYZnrc ($Revis *ion: 1.47 $) Dose outputs (dose/F, Gy.cm**2)') ELSE IF((isource.EQ.2.OR.isource.EQ.8)) THEN write(1,3300)title,planarefe,planarefp,planarfe,planar * fp, IHSTRY+ncaseold3300 format( '1',80a1 / t5,'Elec/positron planar energy flu *ence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the ph *antom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar energy fl *uence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the p *hantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positron planar f *luence scored in a 1cm**2 circle '/ t5,'centered at z-axis on thep *hantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar fluence *scored in a 1cm**2 circle '/ t5,'centered at z-axis on the phantom * surface =',1pe11.3,'(1/cm**2)'// t5,'No. of particles incident fr *om phase space file =',1i13/) IF ((OLDSRC.EQ.1)) THEN
![Page 37: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/37.jpg)
write(1,3310)3310 format(t10,' DOSXYZnrc ($Revision: 1.47$ *) Dose outputs '/ t10,'(Dose/incident particle from phase space fi *le, Gy)') ELSE write(1,3320)ainflu3320 format(t5,'No. of particles incident from original * source =',1f13.1// t10,' DOSXYZnrc ($Revision: 1.47 $) * Dose outputs '/ t10,'(Dose/incident particle from original source *, Gy)') END IF ELSE IF((((isource.EQ.4).OR.(isource.EQ.5)).OR. (((isource * .EQ.0).OR.( isource.EQ.1).OR.( isource.EQ.3).OR. (isource. * EQ.7)).AND.(beamarea.EQ.0.)))) THEN write(1,3330)title,planarefe,planarefp,planarfe,planar * fp,ainflu3330 format( '1',80a1 / t5,'Elec/positron planar energy flu *ence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the ph *antom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar energy fl *uence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the p *hantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positron planar f *luence scored in a 1cm**2 circle '/ t5,'centered at z-axis on thep *hantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar fluence *scored in a 1cm**2 circle '/ t5,'centered at z-axis on the phantom * surface =',1pe11.3,'(1/cm**2)'// t5,'Total number of incident par *ticles =',1pe11.3// t10,'DOSXYZnrc ($Revision: 1.47 $)', ' Dose ou *tputs (Dose/incident particle, Gy)') ELSE IF((isource.EQ.6)) THEN write(1,3340)title,ainflu3340 format( '1',80a1 / t5,'Total number of incident partic *les =',1pe11.3// t10,'DOSXYZnrc ($Revision: 1.47 $)', ' Dose outpu *ts (Dose/incident particle, Gy)') ELSE IF(((isource.EQ.9).OR.(isource.EQ.21))) THEN write(1,3350)title,planarefe,planarefp,planarfe,planar * fp, IHSTRY+ncaseold,nhist3350 format( '1',80a1 / t5,'Elec/positron planar energy flu *ence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the ph *antom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar energy fl *uence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the p *hantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positron planar f *luence scored in a 1cm**2 circle '/ t5,'centered at z-axis on thep *hantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar fluence *scored in a 1cm**2 circle '/ t5,'centered at z-axis on the phantom * surface =',1pe11.3,'(1/cm**2)'// t5,' No. of particles in *cident on DOSXYZ phantom =',1i13// t5,'No. of primary particles in *cident in BEAM simulation =',1i13// t10,' DOSXYZnrc ($Re *vision: 1.47 $) Dose outputs '/ t10,'(Dose/incident particle from *original source, Gy)') ELSE IF((isource.EQ.20)) THEN write(1,3360)title,planarefe,planarefp,planarfe,planar * fp, IHSTRY+ncaseold,nhist3360 format( '1',80a1 / t5,'Elec/positron planar energy flu *ence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the ph *antom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar energy fl *uence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the p *hantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positron planar f *luence scored in a 1cm**2 circle '/ t5,'centered at z-axis on thep *hantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar fluence
![Page 38: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/38.jpg)
*scored in a 1cm**2 circle '/ t5,'centered at z-axis on the phantom * surface =',1pe11.3,'(1/cm**2)'// t5,' No. of particles in *cident on DOSXYZ phantom =',1i13// t5,'No. of primary particles in *cident in VCU/BEAM simulation =',1i13// t10,' DOSXYZnrc *($Revision: 1.47 $) Dose outputs '/ t10,'(Dose/incident particlefr *om original source, Gy)') ELSE write(1,3370)title,planarefe,planarefp,planarfe,planar * fp,ainflu3370 format( '1',80a1 / t5,'Elec/positron planar energy flu *ence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the ph *antom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar energy fl *uence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the p *hantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positron planar f *luence scored in a 1cm**2 circle '/ t5,'centered at z-axis on thep *hantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar fluence *scored in a 1cm**2 circle '/ t5,'centered at z-axis on the phantom * surface =',1pe11.3,'(1/cm**2)'// t5,'on the phantom surface =',1p *e11.3,'(1/cm**2)'// t10,'DOSXYZnrc ($Revision: 1.47 $) Dose output *s', ' Gy.cm**2 (or Gy/incident particle)') END IF END IF write(1,3380)3380 format(/t5,'full dose output suppressed in this run') ELSE DO 3391 idose=1,idgrp IF ((IZSCAN(idose) .EQ. 1)) THEN k = (kdosu(idose) - kdosl(idose)) k = k + k/5 + 7 nperpg = 60/k IF ((nperpg .EQ. 0)) THEN WRITE(6,3400)nperpg3400 FORMAT(' Sets of depths per page = ',I2) nperpg = 1 WRITE(6,3410)nperpg3410 FORMAT(' Set to = ',I2) END IF IF (((n_parallel.GT.0 .AND. is_finished).OR.IRESTART.E * Q.4 )) THEN write(1,3420)title3420 format(//,'1',80a1 // t10, 'DOSXYZnrc ($Revision:1 *.47 $) Dose outputs (dose/F, Gy.cm**2)') ELSE IF ((((isource.EQ.0).OR.( isource.EQ.1).OR.( isour * ce.EQ.3).OR. (isource.EQ.7)).AND. (beamarea .NE. 0 * .))) THEN write(1,3430)title,planarefe,planarefp,planarf * e,planarfp,ainflu3430 format( '1',80a1 // t5,'Elec/positron planar e *nergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axiso *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planaren *ergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positron p *lanar fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis *on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar *fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the * phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Average planar fluen *ce (number/beam area), F =', 1pe11.3,'(1/cm**2)'// t10, 'DOSXYZnrc
![Page 39: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/39.jpg)
* ($Revision: 1.47 $) Dose outputs (dose/F, Gy.cm**2)') ELSE IF((isource.EQ.2.OR.isource.EQ.8)) THEN write(1,3440)title,planarefe,planarefp,planarf * e,planarfp, IHSTRY+ncaseold3440 format( '1',80a1 / t5,'Elec/positron planar en *ergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar e *nergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axiso *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positronpl *anar fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar f *luence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the *phantom surface =',1pe11.3,'(1/cm**2)'// t5,'No. of particles inci *dent from phase space file =',1i13/) IF ((OLDSRC.EQ.1)) THEN write(1,3450)3450 format(t10,' DOSXYZnrc ($Revisio *n: 1.47 $) Dose outputs '/ t10,'(Dose/incident particle from phase * space file, Gy)') ELSE write(1,3460)ainflu3460 format(t5,'No. of particles incident fromo *riginal source =',1f13.1// t10,' DOSXYZnrc ($Revision: *1.47 $) Dose outputs '/ t10,'(Dose/incident particle from original * source, Gy)') END IF ELSE IF((((isource.EQ.4).OR.(isource.EQ.5)).OR. (( * (isource.EQ.0).OR.( isource.EQ.1).OR.( isource.EQ. * 3).OR. (isource.EQ.7)).AND.(beamarea.EQ.0.)))) THE * N write(1,3470)title,planarefe,planarefp,planarf * e,planarfp,ainflu3470 format( '1',80a1 / t5,'Elec/positron planar en *ergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar e *nergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axiso *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positronpl *anar fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar f *luence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the *phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Total number of incid *ent particles =',1pe11.3// t10,'DOSXYZnrc ($Revision: 1.47 $)',' D *ose outputs (Dose/incident particle, Gy)') ELSE IF((isource.EQ.6)) THEN write(1,3480)title,ainflu3480 format( '1',80a1 / t5,'Total number of inciden *t particles =',1pe11.3// t10,'DOSXYZnrc ($Revision: 1.47 $)', ' Do *se outputs (Dose/incident particle, Gy)') ELSE IF(((isource.EQ.9).OR.(isource.EQ.21))) THEN write(1,3490)title,planarefe,planarefp,planarf * e,planarfp, IHSTRY+ncaseold,nhist3490 format( '1',80a1 / t5,'Elec/positron planar en *ergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar e *nergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axiso *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positronpl *anar fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar f
![Page 40: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/40.jpg)
*luence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the *phantom surface =',1pe11.3,'(1/cm**2)'// t5,' No. of parti *cles incident on DOSXYZ phantom =',1i13// t5,'No. of primary parti *cles incident in BEAM simulation =',1i13// t10,' DOSXYZn *rc ($Revision: 1.47 $) Dose outputs '/ t10,'(Dose/incident particl *e from original source, Gy)') ELSE IF((isource.EQ.20)) THEN write(1,3500)title,planarefe,planarefp,planarf * e,planarfp, IHSTRY+ncaseold,nhist3500 format( '1',80a1 / t5,'Elec/positron planar en *ergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar e *nergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axiso *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positronpl *anar fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar f *luence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the *phantom surface =',1pe11.3,'(1/cm**2)'// t5,' No. of parti *cles incident on DOSXYZ phantom =',1i13// t5,'No. of primary parti *cles incident in VCU/BEAM simulation =',1i13// t10,' DOS *XYZnrc ($Revision: 1.47 $) Dose outputs '/ t10,'(Dose/incident par *ticle from original source, Gy)') ELSE write(1,3510)title,planarefe,planarefp,planarf * e,planarfp,ainflu3510 format( '1',80a1 / t5,'Elec/positron planar en *ergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar e *nergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axiso *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positronpl *anar fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar f *luence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the *phantom surface =',1pe11.3,'(1/cm**2)'// t5,'on the phantom surfac *e =',1pe11.3,'(1/cm**2)'// t10,'DOSXYZnrc ($Revision: 1.47 $) Dose * outputs', ' Gy.cm**2 (or Gy/incident particle)') END IF END IF ipage=1 DO 3521 i=idosl(idose),idosu(idose) DO 3531 j=jdosl(idose),jdosu(idose),4 JL=j JU=min(j+3,jdosu(idose)) write(1,3540)xbound(i),xbound(i+1),i3540 format(//t15,'for x=',f10.3,' to',f10.3,5x,'i= *',i3) write(1,3550)(ybound(jj),jj=JL,JU+1)3550 format(/' ybounds:',f7.3,f12.3,3f17.3) write(1,3560)(jj,jj=JL ,JU)3560 format(t10,'j=',t17,5(i4,13x)) write(1,3570)zbound(kdosl(idose))3570 format(' zbounds (',f10.3,')') DO 3581 k=kdosl(idose),kdosu(idose) write(1,3590)zbound(k+1),k, (endep((i + (j * j-1)*IMAX + (k-1)*ijmax)),min(99.9d0, 100d * 0*endep2((i + (jj-1)*IMAX + (k-1)*ijmax))) * ,jj=JL,JU)3590 format(f8.3,i4,4(1pe11.3,'-',0pf4.1,'%') )
![Page 41: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/41.jpg)
IF ((mod(k,5) .EQ. 0)) THEN write(1,3600)3600 format(' ') END IF3581 CONTINUE3582 CONTINUE IF (( ( mod(ipage,nperpg) .EQ. 0) .AND. ( ( JU * .NE. jdosu(idose) ) .OR. ( i .NE. idosu(idose * ) )))) THEN IF (((n_parallel.GT.0 .AND. is_finished).O * R.IRESTART.EQ.4 )) THEN write(1,3610)title3610 format(//,'1',80a1 // t10, 'DOSXYZnrc( *$Revision: 1.47 $) Dose outputs (dose/F, Gy.cm**2)') ELSE IF ((((isource.EQ.0).OR.( isource.EQ.1 * ).OR.( isource.EQ.3).OR. (isource.EQ.7 * )).AND. (beamarea .NE. 0.))) THEN write(1,3620)title,planarefe,plana * refp,planarfe,planarfp,ainflu3620 format( '1',80a1 // t5,'Elec/posit *ron planar energy fluence scored in a 1cm**2 circle '/ t5,'centere *d at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Ph *oton planar energy fluence scored in a 1cm**2 circle '/ t5,'center *ed at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'E *lec/positron planar fluence scored in a 1cm**2 circle '/ t5,'cente *red at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,' *Photon planar fluence scored in a 1cm**2 circle '/ t5,'centered at * z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Averag *e planar fluence (number/beam area), F =', 1pe11.3,'(1/cm**2)'// t *10, 'DOSXYZnrc ($Revision: 1.47 $) Dose outputs (dose/F, Gy.cm**2) *') ELSE IF((isource.EQ.2.OR.isource.EQ.8) * ) THEN write(1,3630)title,planarefe,plana * refp,planarfe,planarfp, IHSTRY+nca * seold3630 format( '1',80a1 / t5,'Elec/positr *on planar energy fluence scored in a 1cm**2 circle '/ t5,'centered * at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Pho *ton planar energy fluence scored in a 1cm**2 circle '/ t5,'centere *d at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'El *ec/positron planar fluence scored in a 1cm**2 circle '/ t5,'center *ed at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'P *hoton planar fluence scored in a 1cm**2 circle '/ t5,'centered atz *-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'No. ofpa *rticles incident from phase space file =',1i13/) IF ((OLDSRC.EQ.1)) THEN write(1,3640)3640 format(t10,' DOSXYZn *rc ($Revision: 1.47 $) Dose outputs '/ t10,'(Dose/incident particl *e from phase space file, Gy)') ELSE write(1,3650)ainflu3650 format(t5,'No. of particles in *cident from original source =',1f13.1// t10,' DOSXYZnrc * ($Revision: 1.47 $) Dose outputs '/ t10,'(Dose/incident particlef *rom original source, Gy)')
![Page 42: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/42.jpg)
END IF ELSE IF((((isource.EQ.4).OR.(isource.E * Q.5)).OR. (((isource.EQ.0).OR.( isourc * e.EQ.1).OR.( isource.EQ.3).OR. (isourc * e.EQ.7)).AND.(beamarea.EQ.0.)))) THEN write(1,3660)title,planarefe,plana * refp,planarfe,planarfp,ainflu3660 format( '1',80a1 / t5,'Elec/positr *on planar energy fluence scored in a 1cm**2 circle '/ t5,'centered * at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Pho *ton planar energy fluence scored in a 1cm**2 circle '/ t5,'centere *d at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'El *ec/positron planar fluence scored in a 1cm**2 circle '/ t5,'center *ed at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'P *hoton planar fluence scored in a 1cm**2 circle '/ t5,'centered atz *-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Total nu *mber of incident particles =',1pe11.3// t10,'DOSXYZnrc ($Revision: * 1.47 $)', ' Dose outputs (Dose/incident particle, Gy)') ELSE IF((isource.EQ.6)) THEN write(1,3670)title,ainflu3670 format( '1',80a1 / t5,'Total numbe *r of incident particles =',1pe11.3// t10,'DOSXYZnrc ($Revision: 1. *47 $)', ' Dose outputs (Dose/incident particle, Gy)') ELSE IF(((isource.EQ.9).OR.(isource.EQ * .21))) THEN write(1,3680)title,planarefe,plana * refp,planarfe,planarfp, IHSTRY+nca * seold,nhist3680 format( '1',80a1 / t5,'Elec/positr *on planar energy fluence scored in a 1cm**2 circle '/ t5,'centered * at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Pho *ton planar energy fluence scored in a 1cm**2 circle '/ t5,'centere *d at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'El *ec/positron planar fluence scored in a 1cm**2 circle '/ t5,'center *ed at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'P *hoton planar fluence scored in a 1cm**2 circle '/ t5,'centered atz *-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,' No. of * particles incident on DOSXYZ phantom =',1i13// t5,'No. of primary * particles incident in BEAM simulation =',1i13// t10,' DOSXY *Znrc ($Revision: 1.47 $) Dose outputs '/ t10,'(Dose/incident parti *cle from original source, Gy)') ELSE IF((isource.EQ.20)) THEN write(1,3690)title,planarefe,plana * refp,planarfe,planarfp, IHSTRY+nca * seold,nhist3690 format( '1',80a1 / t5,'Elec/positr *on planar energy fluence scored in a 1cm**2 circle '/ t5,'centered * at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Pho *ton planar energy fluence scored in a 1cm**2 circle '/ t5,'centere *d at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'El *ec/positron planar fluence scored in a 1cm**2 circle '/ t5,'center *ed at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'P *hoton planar fluence scored in a 1cm**2 circle '/ t5,'centered atz *-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,' No. of * particles incident on DOSXYZ phantom =',1i13// t5,'No. of primary * particles incident in VCU/BEAM simulation =',1i13// t10,' * DOSXYZnrc ($Revision: 1.47 $) Dose outputs '/ t10,'(Dose/incide *nt particle from original source, Gy)')
![Page 43: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/43.jpg)
ELSE write(1,3700)title,planarefe,plana * refp,planarfe,planarfp,ainflu3700 format( '1',80a1 / t5,'Elec/positr *on planar energy fluence scored in a 1cm**2 circle '/ t5,'centered * at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Pho *ton planar energy fluence scored in a 1cm**2 circle '/ t5,'centere *d at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'El *ec/positron planar fluence scored in a 1cm**2 circle '/ t5,'center *ed at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'P *hoton planar fluence scored in a 1cm**2 circle '/ t5,'centered atz *-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'on theph *antom surface =',1pe11.3,'(1/cm**2)'// t10,'DOSXYZnrc ($Revision: *1.47 $) Dose outputs', ' Gy.cm**2 (or Gy/incident particle)') END IF END IF ipage=1 ELSE ipage = ipage+1 END IF3531 CONTINUE3532 CONTINUE3521 CONTINUE3522 CONTINUE ELSE IF((IZSCAN(idose) .EQ. 0)) THEN i = (idosu(idose) - idosl(idose)) i = i + i/5 + 7 nperpg = 60/i IF ((nperpg .EQ. 0)) THEN WRITE(6,3710)nperpg3710 FORMAT(' Sets of X scans per page = ',I2) nperpg = 1 WRITE(6,3720)nperpg3720 FORMAT(' Set to = ',I2) END IF IF (((n_parallel.GT.0 .AND. is_finished).OR.IRESTART.E * Q.4 )) THEN write(1,3730)title3730 format(//,'1',80a1 // t10, 'DOSXYZnrc ($Revision:1 *.47 $) Dose outputs (dose/F, Gy.cm**2)') ELSE IF ((((isource.EQ.0).OR.( isource.EQ.1).OR.( isour * ce.EQ.3).OR. (isource.EQ.7)).AND. (beamarea .NE. 0 * .))) THEN write(1,3740)title,planarefe,planarefp,planarf * e,planarfp,ainflu3740 format( '1',80a1 // t5,'Elec/positron planar e *nergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axiso *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planaren *ergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positron p *lanar fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis *on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar *fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the * phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Average planar fluen *ce (number/beam area), F =', 1pe11.3,'(1/cm**2)'// t10, 'DOSXYZnrc * ($Revision: 1.47 $) Dose outputs (dose/F, Gy.cm**2)') ELSE IF((isource.EQ.2.OR.isource.EQ.8)) THEN
![Page 44: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/44.jpg)
write(1,3750)title,planarefe,planarefp,planarf * e,planarfp, IHSTRY+ncaseold3750 format( '1',80a1 / t5,'Elec/positron planar en *ergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar e *nergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axiso *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positronpl *anar fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar f *luence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the *phantom surface =',1pe11.3,'(1/cm**2)'// t5,'No. of particles inci *dent from phase space file =',1i13/) IF ((OLDSRC.EQ.1)) THEN write(1,3760)3760 format(t10,' DOSXYZnrc ($Revisio *n: 1.47 $) Dose outputs '/ t10,'(Dose/incident particle from phase * space file, Gy)') ELSE write(1,3770)ainflu3770 format(t5,'No. of particles incident fromo *riginal source =',1f13.1// t10,' DOSXYZnrc ($Revision: *1.47 $) Dose outputs '/ t10,'(Dose/incident particle from original * source, Gy)') END IF ELSE IF((((isource.EQ.4).OR.(isource.EQ.5)).OR. (( * (isource.EQ.0).OR.( isource.EQ.1).OR.( isource.EQ. * 3).OR. (isource.EQ.7)).AND.(beamarea.EQ.0.)))) THE * N write(1,3780)title,planarefe,planarefp,planarf * e,planarfp,ainflu3780 format( '1',80a1 / t5,'Elec/positron planar en *ergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar e *nergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axiso *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positronpl *anar fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar f *luence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the *phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Total number of incid *ent particles =',1pe11.3// t10,'DOSXYZnrc ($Revision: 1.47 $)',' D *ose outputs (Dose/incident particle, Gy)') ELSE IF((isource.EQ.6)) THEN write(1,3790)title,ainflu3790 format( '1',80a1 / t5,'Total number of inciden *t particles =',1pe11.3// t10,'DOSXYZnrc ($Revision: 1.47 $)', ' Do *se outputs (Dose/incident particle, Gy)') ELSE IF(((isource.EQ.9).OR.(isource.EQ.21))) THEN write(1,3800)title,planarefe,planarefp,planarf * e,planarfp, IHSTRY+ncaseold,nhist3800 format( '1',80a1 / t5,'Elec/positron planar en *ergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar e *nergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axiso *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positronpl *anar fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar f *luence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the *phantom surface =',1pe11.3,'(1/cm**2)'// t5,' No. of parti
![Page 45: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/45.jpg)
*cles incident on DOSXYZ phantom =',1i13// t5,'No. of primary parti *cles incident in BEAM simulation =',1i13// t10,' DOSXYZn *rc ($Revision: 1.47 $) Dose outputs '/ t10,'(Dose/incident particl *e from original source, Gy)') ELSE IF((isource.EQ.20)) THEN write(1,3810)title,planarefe,planarefp,planarf * e,planarfp, IHSTRY+ncaseold,nhist3810 format( '1',80a1 / t5,'Elec/positron planar en *ergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar e *nergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axiso *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positronpl *anar fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar f *luence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the *phantom surface =',1pe11.3,'(1/cm**2)'// t5,' No. of parti *cles incident on DOSXYZ phantom =',1i13// t5,'No. of primary parti *cles incident in VCU/BEAM simulation =',1i13// t10,' DOS *XYZnrc ($Revision: 1.47 $) Dose outputs '/ t10,'(Dose/incident par *ticle from original source, Gy)') ELSE write(1,3820)title,planarefe,planarefp,planarf * e,planarfp,ainflu3820 format( '1',80a1 / t5,'Elec/positron planar en *ergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar e *nergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axiso *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positronpl *anar fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar f *luence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the *phantom surface =',1pe11.3,'(1/cm**2)'// t5,'on the phantom surfac *e =',1pe11.3,'(1/cm**2)'// t10,'DOSXYZnrc ($Revision: 1.47 $) Dose * outputs', ' Gy.cm**2 (or Gy/incident particle)') END IF END IF ipage=1 DO 3831 k=kdosl(idose),kdosu(idose) DO 3841 j=jdosl(idose),jdosu(idose),4 JL=J JU=min(j+3,jdosu(idose)) write(1,3850)zbound(k),zbound(k+1),k3850 format(//t15,'for z=',f10.3,' to',f10.3,5x,'k= *',i3) write(1,3860)(ybound(jj),jj=JL,JU+1)3860 format(/' ybounds:',f7.3,f12.3,3f17.3) write(1,3870)(jj,jj=JL ,JU)3870 format(t10,'j=',t17,5(i4,13x)) write(1,3880)xbound(idosl(idose))3880 format(' xbounds (',f10.3,')') DO 3891 i=idosl(idose),idosu(idose) write(1,3900)xbound(i+1),i, (endep((i + (j * j-1)*IMAX + (k-1)*ijmax)),min(99.9d0, 100d * 0*endep2((i + (jj-1)*IMAX + (k-1)*ijmax))) * ,jj=JL,JU)3900 format(f8.3,i4,4(1pe11.3,'-',0pf4.1,'%') ) IF ((mod(i,5) .EQ. 0)) THEN write(1,3910)
![Page 46: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/46.jpg)
3910 format(' ') END IF3891 CONTINUE3892 CONTINUE IF (( ( mod(ipage,nperpg) .EQ. 0) .AND. ( ( JU * .NE. jdosu(idose) ) .OR. ( k .NE. kdosu(idose * ) )))) THEN IF (((n_parallel.GT.0 .AND. is_finished).O * R.IRESTART.EQ.4 )) THEN write(1,3920)title3920 format(//,'1',80a1 // t10, 'DOSXYZnrc( *$Revision: 1.47 $) Dose outputs (dose/F, Gy.cm**2)') ELSE IF ((((isource.EQ.0).OR.( isource.EQ.1 * ).OR.( isource.EQ.3).OR. (isource.EQ.7 * )).AND. (beamarea .NE. 0.))) THEN write(1,3930)title,planarefe,plana * refp,planarfe,planarfp,ainflu3930 format( '1',80a1 // t5,'Elec/posit *ron planar energy fluence scored in a 1cm**2 circle '/ t5,'centere *d at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Ph *oton planar energy fluence scored in a 1cm**2 circle '/ t5,'center *ed at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'E *lec/positron planar fluence scored in a 1cm**2 circle '/ t5,'cente *red at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,' *Photon planar fluence scored in a 1cm**2 circle '/ t5,'centered at * z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Averag *e planar fluence (number/beam area), F =', 1pe11.3,'(1/cm**2)'// t *10, 'DOSXYZnrc ($Revision: 1.47 $) Dose outputs (dose/F, Gy.cm**2) *') ELSE IF((isource.EQ.2.OR.isource.EQ.8) * ) THEN write(1,3940)title,planarefe,plana * refp,planarfe,planarfp, IHSTRY+nca * seold3940 format( '1',80a1 / t5,'Elec/positr *on planar energy fluence scored in a 1cm**2 circle '/ t5,'centered * at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Pho *ton planar energy fluence scored in a 1cm**2 circle '/ t5,'centere *d at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'El *ec/positron planar fluence scored in a 1cm**2 circle '/ t5,'center *ed at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'P *hoton planar fluence scored in a 1cm**2 circle '/ t5,'centered atz *-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'No. ofpa *rticles incident from phase space file =',1i13/) IF ((OLDSRC.EQ.1)) THEN write(1,3950)3950 format(t10,' DOSXYZn *rc ($Revision: 1.47 $) Dose outputs '/ t10,'(Dose/incident particl *e from phase space file, Gy)') ELSE write(1,3960)ainflu3960 format(t5,'No. of particles in *cident from original source =',1f13.1// t10,' DOSXYZnrc * ($Revision: 1.47 $) Dose outputs '/ t10,'(Dose/incident particlef *rom original source, Gy)') END IF ELSE IF((((isource.EQ.4).OR.(isource.E
![Page 47: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/47.jpg)
* Q.5)).OR. (((isource.EQ.0).OR.( isourc * e.EQ.1).OR.( isource.EQ.3).OR. (isourc * e.EQ.7)).AND.(beamarea.EQ.0.)))) THEN write(1,3970)title,planarefe,plana * refp,planarfe,planarfp,ainflu3970 format( '1',80a1 / t5,'Elec/positr *on planar energy fluence scored in a 1cm**2 circle '/ t5,'centered * at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Pho *ton planar energy fluence scored in a 1cm**2 circle '/ t5,'centere *d at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'El *ec/positron planar fluence scored in a 1cm**2 circle '/ t5,'center *ed at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'P *hoton planar fluence scored in a 1cm**2 circle '/ t5,'centered atz *-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Total nu *mber of incident particles =',1pe11.3// t10,'DOSXYZnrc ($Revision: * 1.47 $)', ' Dose outputs (Dose/incident particle, Gy)') ELSE IF((isource.EQ.6)) THEN write(1,3980)title,ainflu3980 format( '1',80a1 / t5,'Total numbe *r of incident particles =',1pe11.3// t10,'DOSXYZnrc ($Revision: 1. *47 $)', ' Dose outputs (Dose/incident particle, Gy)') ELSE IF(((isource.EQ.9).OR.(isource.EQ * .21))) THEN write(1,3990)title,planarefe,plana * refp,planarfe,planarfp, IHSTRY+nca * seold,nhist3990 format( '1',80a1 / t5,'Elec/positr *on planar energy fluence scored in a 1cm**2 circle '/ t5,'centered * at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Pho *ton planar energy fluence scored in a 1cm**2 circle '/ t5,'centere *d at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'El *ec/positron planar fluence scored in a 1cm**2 circle '/ t5,'center *ed at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'P *hoton planar fluence scored in a 1cm**2 circle '/ t5,'centered atz *-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,' No. of * particles incident on DOSXYZ phantom =',1i13// t5,'No. of primary * particles incident in BEAM simulation =',1i13// t10,' DOSXY *Znrc ($Revision: 1.47 $) Dose outputs '/ t10,'(Dose/incident parti *cle from original source, Gy)') ELSE IF((isource.EQ.20)) THEN write(1,4000)title,planarefe,plana * refp,planarfe,planarfp, IHSTRY+nca * seold,nhist4000 format( '1',80a1 / t5,'Elec/positr *on planar energy fluence scored in a 1cm**2 circle '/ t5,'centered * at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Pho *ton planar energy fluence scored in a 1cm**2 circle '/ t5,'centere *d at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'El *ec/positron planar fluence scored in a 1cm**2 circle '/ t5,'center *ed at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'P *hoton planar fluence scored in a 1cm**2 circle '/ t5,'centered atz *-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,' No. of * particles incident on DOSXYZ phantom =',1i13// t5,'No. of primary * particles incident in VCU/BEAM simulation =',1i13// t10,' * DOSXYZnrc ($Revision: 1.47 $) Dose outputs '/ t10,'(Dose/incide *nt particle from original source, Gy)') ELSE write(1,4010)title,planarefe,plana
![Page 48: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/48.jpg)
* refp,planarfe,planarfp,ainflu4010 format( '1',80a1 / t5,'Elec/positr *on planar energy fluence scored in a 1cm**2 circle '/ t5,'centered * at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Pho *ton planar energy fluence scored in a 1cm**2 circle '/ t5,'centere *d at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'El *ec/positron planar fluence scored in a 1cm**2 circle '/ t5,'center *ed at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'P *hoton planar fluence scored in a 1cm**2 circle '/ t5,'centered atz *-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'on theph *antom surface =',1pe11.3,'(1/cm**2)'// t10,'DOSXYZnrc ($Revision: *1.47 $) Dose outputs', ' Gy.cm**2 (or Gy/incident particle)') END IF END IF ipage=1 ELSE ipage = ipage+1 END IF3841 CONTINUE3842 CONTINUE3831 CONTINUE3832 CONTINUE ELSE j = (idosu(idose) - idosl(idose)) j = j + j/5 + 7 nperpg = 60/j IF ((nperpg .EQ. 0)) THEN WRITE(6,4020)nperpg4020 FORMAT(' Sets of Y scans per page = ',I2) nperpg = 1 WRITE(6,4030)nperpg4030 FORMAT(' Set to = ',I2) END IF IF (((n_parallel.GT.0 .AND. is_finished).OR.IRESTART.E * Q.4 )) THEN write(1,4040)title4040 format(//,'1',80a1 // t10, 'DOSXYZnrc ($Revision:1 *.47 $) Dose outputs (dose/F, Gy.cm**2)') ELSE IF ((((isource.EQ.0).OR.( isource.EQ.1).OR.( isour * ce.EQ.3).OR. (isource.EQ.7)).AND. (beamarea .NE. 0 * .))) THEN write(1,4050)title,planarefe,planarefp,planarf * e,planarfp,ainflu4050 format( '1',80a1 // t5,'Elec/positron planar e *nergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axiso *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planaren *ergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positron p *lanar fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis *on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar *fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the * phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Average planar fluen *ce (number/beam area), F =', 1pe11.3,'(1/cm**2)'// t10, 'DOSXYZnrc * ($Revision: 1.47 $) Dose outputs (dose/F, Gy.cm**2)') ELSE IF((isource.EQ.2.OR.isource.EQ.8)) THEN write(1,4060)title,planarefe,planarefp,planarf * e,planarfp, IHSTRY+ncaseold
![Page 49: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/49.jpg)
4060 format( '1',80a1 / t5,'Elec/positron planar en *ergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar e *nergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axiso *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positronpl *anar fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar f *luence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the *phantom surface =',1pe11.3,'(1/cm**2)'// t5,'No. of particles inci *dent from phase space file =',1i13/) IF ((OLDSRC.EQ.1)) THEN write(1,4070)4070 format(t10,' DOSXYZnrc ($Revisio *n: 1.47 $) Dose outputs '/ t10,'(Dose/incident particle from phase * space file, Gy)') ELSE write(1,4080)ainflu4080 format(t5,'No. of particles incident fromo *riginal source =',1f13.1// t10,' DOSXYZnrc ($Revision: *1.47 $) Dose outputs '/ t10,'(Dose/incident particle from original * source, Gy)') END IF ELSE IF((((isource.EQ.4).OR.(isource.EQ.5)).OR. (( * (isource.EQ.0).OR.( isource.EQ.1).OR.( isource.EQ. * 3).OR. (isource.EQ.7)).AND.(beamarea.EQ.0.)))) THE * N write(1,4090)title,planarefe,planarefp,planarf * e,planarfp,ainflu4090 format( '1',80a1 / t5,'Elec/positron planar en *ergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar e *nergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axiso *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positronpl *anar fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar f *luence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the *phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Total number of incid *ent particles =',1pe11.3// t10,'DOSXYZnrc ($Revision: 1.47 $)',' D *ose outputs (Dose/incident particle, Gy)') ELSE IF((isource.EQ.6)) THEN write(1,4100)title,ainflu4100 format( '1',80a1 / t5,'Total number of inciden *t particles =',1pe11.3// t10,'DOSXYZnrc ($Revision: 1.47 $)', ' Do *se outputs (Dose/incident particle, Gy)') ELSE IF(((isource.EQ.9).OR.(isource.EQ.21))) THEN write(1,4110)title,planarefe,planarefp,planarf * e,planarfp, IHSTRY+ncaseold,nhist4110 format( '1',80a1 / t5,'Elec/positron planar en *ergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar e *nergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axiso *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positronpl *anar fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar f *luence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the *phantom surface =',1pe11.3,'(1/cm**2)'// t5,' No. of parti *cles incident on DOSXYZ phantom =',1i13// t5,'No. of primary parti *cles incident in BEAM simulation =',1i13// t10,' DOSXYZn
![Page 50: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/50.jpg)
*rc ($Revision: 1.47 $) Dose outputs '/ t10,'(Dose/incident particl *e from original source, Gy)') ELSE IF((isource.EQ.20)) THEN write(1,4120)title,planarefe,planarefp,planarf * e,planarfp, IHSTRY+ncaseold,nhist4120 format( '1',80a1 / t5,'Elec/positron planar en *ergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar e *nergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axiso *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positronpl *anar fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar f *luence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the *phantom surface =',1pe11.3,'(1/cm**2)'// t5,' No. of parti *cles incident on DOSXYZ phantom =',1i13// t5,'No. of primary parti *cles incident in VCU/BEAM simulation =',1i13// t10,' DOS *XYZnrc ($Revision: 1.47 $) Dose outputs '/ t10,'(Dose/incident par *ticle from original source, Gy)') ELSE write(1,4130)title,planarefe,planarefp,planarf * e,planarfp,ainflu4130 format( '1',80a1 / t5,'Elec/positron planar en *ergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar e *nergy fluence scored in a 1cm**2 circle '/ t5,'centered at z-axiso *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Elec/positronpl *anar fluence scored in a 1cm**2 circle '/ t5,'centered at z-axis o *n the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Photon planar f *luence scored in a 1cm**2 circle '/ t5,'centered at z-axis on the *phantom surface =',1pe11.3,'(1/cm**2)'// t5,'on the phantom surfac *e =',1pe11.3,'(1/cm**2)'// t10,'DOSXYZnrc ($Revision: 1.47 $) Dose * outputs', ' Gy.cm**2 (or Gy/incident particle)') END IF END IF ipage=1 DO 4141 k=kdosl(idose),kdosu(idose) DO 4151 i=idosl(idose),idosu(idose),4 JL=i JU=min(i+3,idosu(idose)) write(1,4160)zbound(k),zbound(k+1),k4160 format(//t15,'for z=',f10.3,' to',f10.3,5x,'k= *',i3) write(1,4170)(xbound(jj),jj=JL,JU+1)4170 format(/' xbounds:',f7.3,f12.3,3f17.3) write(1,4180)(jj,jj=JL ,JU)4180 format(t10,'i=',t17,5(i4,13x)) write(1,4190)ybound(jdosl(idose))4190 format(' ybounds (',f10.3,')') DO 4201 j=jdosl(idose),jdosu(idose) write(1,4210)ybound(j+1),j, (endep((jj + ( * j-1)*IMAX + (k-1)*ijmax)),min(99.9d0, 100d * 0*endep2((jj + (j-1)*IMAX + (k-1)*ijmax))) * ,jj=JL,JU)4210 format(f8.3,i4,4(1pe11.3,'-',0pf4.1,'%') ) IF ((mod(j,5) .EQ. 0)) THEN write(1,4220)4220 format(' ') END IF
![Page 51: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/51.jpg)
4201 CONTINUE4202 CONTINUE IF (( ( mod(ipage,nperpg) .EQ. 0) .AND. ( ( JU * .NE. idosu(idose) ) .OR. ( k .NE. kdosu(idose * ) )))) THEN IF (((n_parallel.GT.0 .AND. is_finished).O * R.IRESTART.EQ.4 )) THEN write(1,4230)title4230 format(//,'1',80a1 // t10, 'DOSXYZnrc( *$Revision: 1.47 $) Dose outputs (dose/F, Gy.cm**2)') ELSE IF ((((isource.EQ.0).OR.( isource.EQ.1 * ).OR.( isource.EQ.3).OR. (isource.EQ.7 * )).AND. (beamarea .NE. 0.))) THEN write(1,4240)title,planarefe,plana * refp,planarfe,planarfp,ainflu4240 format( '1',80a1 // t5,'Elec/posit *ron planar energy fluence scored in a 1cm**2 circle '/ t5,'centere *d at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Ph *oton planar energy fluence scored in a 1cm**2 circle '/ t5,'center *ed at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'E *lec/positron planar fluence scored in a 1cm**2 circle '/ t5,'cente *red at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,' *Photon planar fluence scored in a 1cm**2 circle '/ t5,'centered at * z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Averag *e planar fluence (number/beam area), F =', 1pe11.3,'(1/cm**2)'// t *10, 'DOSXYZnrc ($Revision: 1.47 $) Dose outputs (dose/F, Gy.cm**2) *') ELSE IF((isource.EQ.2.OR.isource.EQ.8) * ) THEN write(1,4250)title,planarefe,plana * refp,planarfe,planarfp, IHSTRY+nca * seold4250 format( '1',80a1 / t5,'Elec/positr *on planar energy fluence scored in a 1cm**2 circle '/ t5,'centered * at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Pho *ton planar energy fluence scored in a 1cm**2 circle '/ t5,'centere *d at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'El *ec/positron planar fluence scored in a 1cm**2 circle '/ t5,'center *ed at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'P *hoton planar fluence scored in a 1cm**2 circle '/ t5,'centered atz *-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'No. ofpa *rticles incident from phase space file =',1i13/) IF ((OLDSRC.EQ.1)) THEN write(1,4260)4260 format(t10,' DOSXYZn *rc ($Revision: 1.47 $) Dose outputs '/ t10,'(Dose/incident particl *e from phase space file, Gy)') ELSE write(1,4270)ainflu4270 format(t5,'No. of particles in *cident from original source =',1f13.1// t10,' DOSXYZnrc * ($Revision: 1.47 $) Dose outputs '/ t10,'(Dose/incident particlef *rom original source, Gy)') END IF ELSE IF((((isource.EQ.4).OR.(isource.E * Q.5)).OR. (((isource.EQ.0).OR.( isourc * e.EQ.1).OR.( isource.EQ.3).OR. (isourc
![Page 52: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/52.jpg)
* e.EQ.7)).AND.(beamarea.EQ.0.)))) THEN write(1,4280)title,planarefe,plana * refp,planarfe,planarfp,ainflu4280 format( '1',80a1 / t5,'Elec/positr *on planar energy fluence scored in a 1cm**2 circle '/ t5,'centered * at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Pho *ton planar energy fluence scored in a 1cm**2 circle '/ t5,'centere *d at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'El *ec/positron planar fluence scored in a 1cm**2 circle '/ t5,'center *ed at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'P *hoton planar fluence scored in a 1cm**2 circle '/ t5,'centered atz *-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Total nu *mber of incident particles =',1pe11.3// t10,'DOSXYZnrc ($Revision: * 1.47 $)', ' Dose outputs (Dose/incident particle, Gy)') ELSE IF((isource.EQ.6)) THEN write(1,4290)title,ainflu4290 format( '1',80a1 / t5,'Total numbe *r of incident particles =',1pe11.3// t10,'DOSXYZnrc ($Revision: 1. *47 $)', ' Dose outputs (Dose/incident particle, Gy)') ELSE IF(((isource.EQ.9).OR.(isource.EQ * .21))) THEN write(1,4300)title,planarefe,plana * refp,planarfe,planarfp, IHSTRY+nca * seold,nhist4300 format( '1',80a1 / t5,'Elec/positr *on planar energy fluence scored in a 1cm**2 circle '/ t5,'centered * at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Pho *ton planar energy fluence scored in a 1cm**2 circle '/ t5,'centere *d at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'El *ec/positron planar fluence scored in a 1cm**2 circle '/ t5,'center *ed at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'P *hoton planar fluence scored in a 1cm**2 circle '/ t5,'centered atz *-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,' No. of * particles incident on DOSXYZ phantom =',1i13// t5,'No. of primary * particles incident in BEAM simulation =',1i13// t10,' DOSXY *Znrc ($Revision: 1.47 $) Dose outputs '/ t10,'(Dose/incident parti *cle from original source, Gy)') ELSE IF((isource.EQ.20)) THEN write(1,4310)title,planarefe,plana * refp,planarfe,planarfp, IHSTRY+nca * seold,nhist4310 format( '1',80a1 / t5,'Elec/positr *on planar energy fluence scored in a 1cm**2 circle '/ t5,'centered * at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Pho *ton planar energy fluence scored in a 1cm**2 circle '/ t5,'centere *d at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'El *ec/positron planar fluence scored in a 1cm**2 circle '/ t5,'center *ed at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'P *hoton planar fluence scored in a 1cm**2 circle '/ t5,'centered atz *-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,' No. of * particles incident on DOSXYZ phantom =',1i13// t5,'No. of primary * particles incident in VCU/BEAM simulation =',1i13// t10,' * DOSXYZnrc ($Revision: 1.47 $) Dose outputs '/ t10,'(Dose/incide *nt particle from original source, Gy)') ELSE write(1,4320)title,planarefe,plana * refp,planarfe,planarfp,ainflu4320 format( '1',80a1 / t5,'Elec/positr
![Page 53: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/53.jpg)
*on planar energy fluence scored in a 1cm**2 circle '/ t5,'centered * at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'Pho *ton planar energy fluence scored in a 1cm**2 circle '/ t5,'centere *d at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'El *ec/positron planar fluence scored in a 1cm**2 circle '/ t5,'center *ed at z-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'P *hoton planar fluence scored in a 1cm**2 circle '/ t5,'centered atz *-axis on the phantom surface =',1pe11.3,'(1/cm**2)'// t5,'on theph *antom surface =',1pe11.3,'(1/cm**2)'// t10,'DOSXYZnrc ($Revision: *1.47 $) Dose outputs', ' Gy.cm**2 (or Gy/incident particle)') END IF END IF ipage=1 ELSE ipage = ipage+1 END IF4151 CONTINUE4152 CONTINUE4141 CONTINUE4142 CONTINUE END IF3391 CONTINUE3392 CONTINUE WRITE(1,'(''1'')') END IF IF ((IPHANT.EQ.1 .AND. (n_parallel.EQ.0.OR.(n_parallel.GT.0 .AND. *is_finished)))) THEN call write_phantom(ioutphant,nmed,media,estepm,IMAX,JMAX,KMAX, * xbound,ybound, zbound,rhor,med) END IF IF ((zeroairdose .EQ. 1)) THEN DO 4331 i=1,IMAX DO 4341 j=1,JMAX DO 4351 k=1,KMAX IF ((rhor((1 + i + (j-1)*IMAX + (k-1)*ijmax)) .LE. * 0.044)) THEN endep((i + (j-1)*IMAX + (k-1)*ijmax))=0.0 endep2((i + (j-1)*IMAX + (k-1)*ijmax))=0.99999 * 99 END IF4351 CONTINUE4352 CONTINUE4341 CONTINUE4342 CONTINUE4331 CONTINUE4332 CONTINUE END IF zerodose=1 zerocount=0 IF ((zerodose .EQ. 1)) THEN DO 4361 i=1,IMAX DO 4371 j=1,JMAX DO 4381 k=1,KMAX IF ((endep2((i + (j-1)*IMAX + (k-1)*ijmax)).GT.0.5 * .AND. endep((i + (j-1)*IMAX + (k-1)*ijmax)) .GT. * 0.0)) THEN endep((i + (j-1)*IMAX + (k-1)*ijmax))=0.0 endep2((i + (j-1)*IMAX + (k-1)*ijmax))=0.99999
![Page 54: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/54.jpg)
* 99 zerocount=zerocount+1 END IF4381 CONTINUE4382 CONTINUE4371 CONTINUE4372 CONTINUE4361 CONTINUE4362 CONTINUE END IF IF ((zerodose.EQ.1 .AND. zerocount .GT.0)) THEN WRITE(6,4390)zerocount WRITE(1,4390)zerocount4390 FORMAT(/' The dose values in ',I10,' voxels had error > 50% an *d have been'/ ' zeroed in the .3ddose file.'/) END IF IF (((IPARALLEL .LE. 1 .AND. n_parallel .EQ. 0) .OR. (n_parallel . *GT. 0 .AND. is_finished))) THEN call write_dose(IMAX,JMAX,KMAX,xbound,ybound,zbound,endep,ende * p2,idd,MAX20) ELSE WRITE(6,4400) WRITE(1,4400)4400 FORMAT(//' No dose outputs since this is a parallel run '//) END IF cput2=egs_etime() timcpu=1.0*(cput2-cput0) WRITE(6,4410)timcpu,timcpu/3600. WRITE(1,4410)timcpu,timcpu/3600.4410 FORMAT(/' Total CPU time for this run =',f8.1,' s =',f8.3,' hr') IF ((IRESTART.EQ.4)) THEN WRITE(6,4420) WRITE(1,4420)4420 FORMAT(/' CPU time is for combining .pardose files only.') ELSE IF((n_parallel.GT.0 .AND. is_finished)) THEN WRITE(6,4430) WRITE(1,4430)4430 FORMAT(/' CPU time is for last run to finish only.') END IF CALL DATETIME(1) WRITE(6,4440)DATEN, TIMEN WRITE(1,4440)DATEN, TIMEN4440 FORMAT(/' END OF RUN ',A11,1X,A8/)2710 CONTINUE call egs_finish#ifdef HAVE_C_COMPILER IF (( n_parallel .GT. 0 .AND. .NOT.is_finished )) THEN call egs_pjob_finish(n_job) IF (( n_job .EQ. 0 )) THEN is_finished = .true. call egs_combine_runs(combine_results,'.pardose') ainflu=temp2 IF(((isource .EQ. 0 .OR. isource .EQ. 1 .OR. isource .EQ. * 3 .OR. isource .EQ. 7) .AND. beamarea.GT.0.))ainflu=ainflu * /beamarea goto 2780 END IF END IF
![Page 55: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/55.jpg)
#endif IF((isource.EQ.9 .OR. isource.EQ.21))call finish_beamsource IF (((isource.EQ.20 .OR. isource .EQ. 21) .AND. MLCflag.EQ.1)) THE *N call finish_vcusource END IF call exit(0) stop 'Normal completion in main routine' end subroutine ausgab(iarg) ! Copyright National Research Council of Canada, Ottawa, ! BEAM Code System 1999, all rights reserved ! This code is covered by the BEAM General License implicit none COMMON/EPCONT/EDEP,TSTEP,TUSTEP,USTEP,TVSTEP,VSTEP, RHOF,EOLD,ENEW *,EKE,ELKE,GLE,E_RANGE, x_final,y_final,z_final, u_final,v_final,w_ *final, IDISC,IROLD,IRNEW,IAUSFL(29) DOUBLE PRECISION EDEP real*8 TSTEP, TUSTEP, USTEP, VSTEP, TVSTEP, RHOF, EOLD, ENE *W, EKE, ELKE, GLE, E_RANGE, x_final,y_final,z_final, u_final, *v_final,w_final integer*4 IDISC, IROLD, IRNEW, IAUSFL common/score/IWATCH,mxnp, endep( 2097153), endep2( 2097153), temp2 *, planarefe, planarefp,planarfe,planarfp,nestep,endep_tmp( 2097153 *), endep_last( 2097153) integer IWATCH, mxnp real endep_tmp REAL*8 endep, endep2, temp2,planarefe, planarefp, planarfe, planar *fp integer*8 nestep integer*2 endep_last COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000 *),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold COMMON/USERPS/n_split integer*4 n_split COMMON/USERRR/ESAVE_GLOBAL,RANGE_ECUTRR(7),IREJECT real*8 ESAVE_GLOBAL,RANGE_ECUTRR integer*4 IREJECT common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 common/source/ esrc, nhist, nnread, einsrc, xsrcold, ysrcold, * usrcold, vsrcold, wsrcold, weightold, latchold, frMU_indx, *zinc, xinl, xinu, yinl, yinu, zinl, zinu, thetax, thetay, * thetaz, uinc, vinc, winc, beamarea, xcol, ycol, xiso, yiso *, ziso, phicol, theta(60000), phi(60000), pang(60000), angfi *xed(60000), angmin(60000), angmax(60000), pgang(60000), xtemp( *60000), ytemp(60000), ztemp(60000), phicoltemp(60000), thetatem *p(60000), phitemp(60000), muIndex(60000), r_11(60000), r_12(600 *00), r_13(60000), r_21(60000), r_22(60000), r_23(60000), r_31(6000 *0), r_32(60000), r_33(60000), dsource, dsourcetemp(60000), ein, e *ksrcm, esrc_sp, SSD, einsrcold, iqinold, NINCSRC, r_dbs, ssd
![Page 56: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/56.jpg)
*_dbs, z_dbs, enflag, dflag, ismode, isource, iqin, * iqphsp, iqinc, MLCflag *, ixinl, ixinu, jyinl, jyinu, kzinl, * kzinu, klowx, khix, klowy, khiy, * klowz, khiz, survival_ratio, nsmiss, *nsrjct, nsoutside, nmissm, nshist, nphist, * nnphsp, IPRIMARY, * OLDSRC, npassi, nang, ivary(600 *00), ngang(60000), nset, more_in_cont, * numang, dose_stat, ndbsrjct, * i_dbs, iphatsrc, e_split, * i_iaea_in, i_unit_in, nhist_last, * the_beam_code, the_input_file, the *_vcu_input_file, the_pegs_file, the_ *phsp_file, the_vcu_code real*8 esrc,muIndex integer*8 nhist, nnread real*8 einsrc, xsrcold, ysrcold,usrcold,vsrcold,wsrcold,weightold, *latchold, frMU_indx real*4 zinc, xinl, xinu, yinl, yinu, zinl, zinu, thetax, thetay *, thetaz, uinc, vinc, winc, beamarea, xcol,ycol,xiso, yiso, zi *so, phicol, theta, phi, xtemp, ytemp, ztemp, phico *ltemp,thetatemp, phitemp, pang,angfixed,angmin,ang *max,pgang,r_11, r_12, r_13, r_21, r_22, r_23 *, r_31, r_32, r_33,dsource,dsourcetemp, * ein, eksrcm, esrc_sp, SSD, NINCSRC, * r_dbs, ssd_dbs,z_dbs,survival_ratio,einsrcold integer*4 isource, iqin, iqphsp, iqinc,iqinold,MLCflag, * ixinl, ixinu, jyinl, jyinu, kzinl, kzinu, * klowx, khix, klowy, khiy, klowz, khiz *, nsmiss, nsrjct,nsoutsid *e, nmissm,nshist,nphist,nnphsp, enflag, dflag, is *mode, IPRIMARY, OLDSRC,npassi,nang,ivary,ngang,numang,dose_stat, * ndbsrjct,i_dbs,iphatsrc,e_split,i_iaea_in,i_unit_in,more_in_c *ont,nset integer*2 nhist_last character*80 the_beam_code, the_vcu_code, the_input_file,the_pegs_ *file, the_vcu_input_file,the_phsp_file COMMON/SOURCE_FORPARALLEL/nnphsp_max, nnphsp_min integer*4 nnphsp_max, nnphsp_min common/geom/ xbound(128+1), ybound(128+1), zbound(128+1), xboun *d_min, xbound_max, ybound_min, ybound_max, zbound_min, zbound *_max, medsur, dsurround(4), IMAX, JMAX, KMAX, ijmax, irmax, * howfarless real*4 xbound, ybound, zbound, xbound_min, xbound_max, ybound_min, * ybound_max, zbound_min, zbound_max,dsurround integer medsur,IMAX, JMAX, KMAX, ijmax,irmax logical howfarless common/CH_steps/ count_pII_steps,count_all_steps,is_ch_step real*8 count_pII_steps,count_all_steps logical is_ch_step COMMON/MISC/ DUNIT,KMPI,KMPO,RHOR( 2097154),MED( 2097154),IRAYLR real*8 DUNIT, RHOR integer*4 KMPI, KMPO integer*2 MED, IRAYLR COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), photon_xsect *ions, comp_xsections, apx,upx, eii_xfile,NMED
![Page 57: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/57.jpg)
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/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD integer*4 iarg, ip real*8 XSI integer*4 irx,iry,irz,irold_loc,irnew_loc,outside,min_plane,iri,i, *ii,jj,kk, ibsearch,hwfl_rr,dirx,diry,dirz real*8 dist_loc, dist_tot, edep_loc, tv,t(2),xi,yi,zi,ui(2),vi(2), *wi(2), dist_tmp,x_tmp,y_tmp,z_tmp,edep_save,x_loc,y_loc,z_loc, xpl *n,ypln,zpln,dnear_loc,t_tot,t_rnd,dist_max,uii,vii,wii, distx,dist *y,distz,edep_frac LOGICAL ir_defined SAVE xi,yi,zi,ui,vi,wi,tv,iri,edep_save DATA edep_save/0.0/ IF((IWATCH .NE.0))call watch(iarg,IWATCH) mxnp=max(mxnp,np) IF ((np .GE. 10000)) THEN WRITE(6,4450)np, 10000 WRITE(1,4450)np, 100004450 FORMAT(//' In ausgab, np=',i3,' >= maximum stack allowed which * is',i3/ 1X,79('*')//) IF ((mxnp .GT. 10000)) THEN WRITE(6,4460)np, 10000 WRITE(1,4460)np, 100004460 FORMAT(//' In ausgab, np=',i3,' > maximum stack allowed wh *ich is',i3/ 1X,79('*')//' Must stop - you must increase $MXSTACKi *n'/ ' dosxyz_user_macros.mortran') stop '*** Stack overflow ***' END IF END IF IF (( n_split .GT. 1 )) THEN IF (( iarg .EQ. 7 .OR. iarg .EQ. 13 .OR. iarg .EQ. 14 )) THEN DO 4471 ip=NPold,NP IF (( iq(ip) .EQ. 0 )) THEN IF((rng_seed .GT. 128))call ranmar_get XSI = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( xsi*n_split .GT. 1)) THEN wt(ip) = 0 e(ip) = 0 ELSE wt(ip) = wt(ip)*n_split END IF END IF4471 CONTINUE4472 CONTINUE END IF END IF IF ((howfarless .AND. (iarg.EQ.15 .OR. iarg.EQ.17 .OR. iarg.EQ.19 *.OR. iarg.EQ.23) .AND. ir(np).LT.irmax+1)) THEN
![Page 58: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/58.jpg)
IF ((x(np).GT.xbound_max .OR. x(np).LT.xbound_min .OR. y(np).G * T.ybound_max .OR. y(np).LT.ybound_min .OR. z(np).GT.zbound_max * .OR. z(np).LT.zbound_min )) THEN IF ((enflag.GT.1)) THEN ir(np)=irmax+1 ELSE ir(np)=1 END IF ELSE irx=ibsearch(x(np),imax+1,xbound) iry=ibsearch(y(np),jmax+1,ybound) irz=ibsearch(z(np),kmax+1,zbound) ir(np)=(1 + irx + (iry-1)*IMAX + (irz-1)*ijmax) END IF irold=ir(np) END IF IF((iarg .GT.5))RETURN IF ((howfarless .AND. iarg.GT.0 .AND. edep_save.GT.0.0)) THEN irx=mod(irold-1,IMAX) IF((irx.EQ.0))irx=IMAX irz = 1 + (irold-1-irx)/ijmax iry = 1 + ( (irold-1-irx) - (irz-1)*ijmax)/IMAX IF (( x(np) .GT. xbound(irx) .AND. x(np) .LT. xbound(irx+1) .A * ND. y(np) .GT. ybound(iry) .AND. y(np) .LT. ybound(iry+1) .AND * . z(np) .GT. zbound(irz) .AND. z(np) .LT. zbound(irz+1) )) THE * N IF ((nhist_last .EQ. endep_last(irold-1))) THEN endep_tmp(irold-1) = endep_tmp(irold-1) + edep_save*wt * (np) ELSE endep(irold-1)=endep(irold-1)+endep_tmp(irold-1) endep2(irold-1)=endep2(irold-1) + endep_tmp(irold-1)*e * ndep_tmp(irold-1) endep_tmp(irold-1) = edep_save*wt(np) endep_last(irold-1)=nhist_last END IF irnew = irold ELSE IF ((.NOT.is_ch_step)) THEN t(1)=tv t(2)=0. ELSE IF((rng_seed .GT. 128))call ranmar_get t_rnd = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF ((t_rnd.LT.0.5)) THEN t(1)=1-((x(np)-xi)*ui(1)+(y(np)-yi)*vi(1)+(z(np)-z * i)*wi(1))/tv IF ((t(1).LT.1e-3)) THEN t(1)=SQRT((x(np)-xi)**2+(y(np)-yi)**2+(z(np)-z * i)**2) ui(1)=(x(np)-xi)/t(1) vi(1)=(y(np)-yi)/t(1) wi(1)=(z(np)-zi)/t(1) t(2)=0. ELSE t(1)=(tv**2-(x(np)-xi)**2-(y(np)-yi)**2-(z(np) * -zi)**2)/(2*tv*t(1))
![Page 59: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/59.jpg)
t(2)=tv-t(1) ui(2)=((x(np)-xi)-t(1)*ui(1))/(tv-t(1)) vi(2)=((y(np)-yi)-t(1)*vi(1))/(tv-t(1)) wi(2)=((z(np)-zi)-t(1)*wi(1))/(tv-t(1)) END IF ELSE ui(2)=u(np) vi(2)=v(np) wi(2)=w(np) t(2)=1-((x(np)-xi)*ui(2)+(y(np)-yi)*vi(2)+(z(np)-z * i)*wi(2))/tv IF ((t(2).LT.1e-3)) THEN t(1)=SQRT((x(np)-xi)**2+(y(np)-yi)**2+(z(np)-z * i)**2) ui(1)=(x(np)-xi)/t(1) vi(1)=(y(np)-yi)/t(1) wi(1)=(z(np)-zi)/t(1) t(2)=0. ELSE t(2)=(tv**2-(x(np)-xi)**2-(y(np)-yi)**2-(z(np) * -zi)**2)/(2*tv*t(2)) t(1)=tv-t(2) ui(1)=((x(np)-xi)-t(2)*ui(2))/(tv-t(2)) vi(1)=((y(np)-yi)-t(2)*vi(2))/(tv-t(2)) wi(1)=((z(np)-zi)-t(2)*wi(2))/(tv-t(2)) END IF END IF END IF t_tot=t(1)+t(2) irold_loc=irold irnew_loc=irold_loc edep_frac=edep_save/t_tot outside=0 DO 4481 i=1,2 IF ((t(i).GT.0. .AND. irold_loc.GT.1)) THEN IF ((i.EQ.2)) THEN xi=xi+ui(1)*t(1) yi=yi+vi(1)*t(1) zi=zi+wi(1)*t(1) END IF IF ((ui(i).GT.0)) THEN uii=1./abs(ui(i)) dirx=1 distx=(xbound(irx+1)-xi)*uii ELSE IF((ui(i).LT.0)) THEN uii=1./abs(ui(i)) dirx=-1 distx=(xi-xbound(irx))*uii ELSE dirx=0 uii=0 distx=1e20 END IF IF ((vi(i).GT.0)) THEN vii=1./abs(vi(i)) diry=1 disty=(ybound(iry+1)-yi)*vii ELSE IF((vi(i).LT.0)) THEN
![Page 60: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/60.jpg)
vii=1./abs(vi(i)) diry=-1 disty=(yi-ybound(iry))*vii ELSE diry=0 vii=0 disty=1e20 END IF IF ((wi(i).GT.0)) THEN wii=1./abs(wi(i)) dirz=1 distz=(zbound(irz+1)-zi)*wii ELSE IF((wi(i).LT.0)) THEN wii=1./abs(wi(i)) dirz=-1 distz=(zi-zbound(irz))*wii ELSE dirz=0 wii=0 distz=1e20 END IF dist_tot=0.4491 CONTINUE dist_max=t(i)-dist_tot IF ((distx.LT.disty .AND. distx.LT.distz .AND. * distx.LT.dist_max)) THEN dist_loc=distx irx=irx+dirx IF ((irx.GT.0 .AND. irx.LE.IMAX)) THEN disty=disty-distx distz=distz-distx irnew_loc=irold_loc+dirx distx=(xbound(irx+1)-xbound(irx))*uii ELSE outside=1 END IF ELSE IF((disty.LT.distz .AND. disty.LT.dist_ma * x)) THEN dist_loc=disty iry=iry+diry IF ((iry.GT.0 .AND. iry.LE.JMAX)) THEN distx=distx-disty distz=distz-disty irnew_loc=irold_loc+diry*IMAX disty=(ybound(iry+1)-ybound(iry))*vii ELSE outside=1 END IF ELSE IF((distz.LT.dist_max)) THEN dist_loc=distz irz=irz+dirz IF ((irz.GT.0 .AND. irz.LE.KMAX)) THEN distx=distx-distz disty=disty-distz irnew_loc=irold_loc+dirz*ijmax distz=(zbound(irz+1)-zbound(irz))*wii ELSE outside=1
![Page 61: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/61.jpg)
END IF ELSE dist_loc=dist_max END IF edep_loc=dist_loc*edep_frac IF ((nhist_last .EQ. endep_last(irold_loc-1))) * THEN endep_tmp(irold_loc-1) = endep_tmp(irold_l * oc-1) + edep_loc*wt(np) ELSE endep(irold_loc-1)=endep(irold_loc-1)+ende * p_tmp(irold_loc-1) endep2(irold_loc-1)=endep2(irold_loc-1) + * endep_tmp(irold_loc-1)*endep_tmp(irold_loc * -1) endep_tmp(irold_loc-1) = edep_loc*wt(np) endep_last(irold_loc-1)=nhist_last END IF IF ((outside.EQ.1)) THEN IF ((enflag.GT.1)) THEN irnew_loc=irmax+1 ELSE irnew_loc=1 END IF END IF irold_loc=irnew_loc dist_tot=dist_tot+dist_loc IF(((dist_tot.GE.t(i).OR.outside.EQ.1)))GO TO4 * 492 GO TO 44914492 CONTINUE END IF4481 CONTINUE4482 CONTINUE irnew=irnew_loc IF((irnew.NE.irold))ir(np)=irnew END IF END IF IF((iarg .EQ. 0 .AND. iq(np).NE.0))nestep = nestep + 1 IF ((howfarless)) THEN edep_save=0.0 hwfl_rr=0 END IF IF((iarg.EQ.5))RETURN IF ((ir(np).GT.1 .AND. edep.NE.0.0)) THEN IF ((iarg.EQ.0 .AND. howfarless .AND. ir(np).LT.irmax+1)) THEN * irx=mod(ir(np)-1,IMAX) IF((irx.EQ.0))irx=IMAX irz = 1 + (ir(np)-1-irx)/ijmax iry = 1 + ( (ir(np)-1-irx) - (irz-1)*ijmax)/IMAX dnear_loc=min(xbound(irx+1)-x(np),x(np)-xbound(irx), yboun * d(iry+1)-y(np),y(np)-ybound(iry), zbound(irz+1)-z(np),z(np * )-zbound(irz)) IF ((IREJECT.EQ.1 .AND. dnear_loc .GT. e_range-RANGE_ECUTR * R(MED(IR(NP)))* RHO(MED(IR(NP)))/RHOR(IR(NP)))) THEN edep=e(np)-prm hwfl_rr=1
![Page 62: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/62.jpg)
ELSE IF((dnear_loc .LT. vstep)) THEN xi=x(np) yi=y(np) zi=z(np) ui(1)=u(np) vi(1)=v(np) wi(1)=w(np) edep_save=edep IF ((.NOT.is_ch_step)) THEN tv=vstep ELSE tv=tvstep END IF RETURN END IF END IF IF ((nhist_last .EQ. endep_last(ir(np)-1))) THEN endep_tmp(ir(np)-1) = endep_tmp(ir(np)-1) + edep*wt(np) ELSE endep(ir(np)-1)=endep(ir(np)-1)+endep_tmp(ir(np)-1) endep2(ir(np)-1)=endep2(ir(np)-1) + endep_tmp(ir(np)-1)*en * dep_tmp(ir(np)-1) endep_tmp(ir(np)-1) = edep*wt(np) endep_last(ir(np)-1)=nhist_last END IF IF ((howfarless .AND. hwfl_rr.EQ.1)) THEN IF ((iq(np).EQ.-1)) THEN np=np-1 ELSE IF((iq(np).EQ.1)) THEN call annih_at_rest END IF iarg=-1 END IF END IF return end subroutine howfar ! Copyright National Research Council of Canada, Ottawa, ! BEAM Code System 1999, all rights reserved ! This code is covered by the BEAM General License implicit none COMMON/EPCONT/EDEP,TSTEP,TUSTEP,USTEP,TVSTEP,VSTEP, RHOF,EOLD,ENEW *,EKE,ELKE,GLE,E_RANGE, x_final,y_final,z_final, u_final,v_final,w_ *final, IDISC,IROLD,IRNEW,IAUSFL(29) DOUBLE PRECISION EDEP real*8 TSTEP, TUSTEP, USTEP, VSTEP, TVSTEP, RHOF, EOLD, ENE *W, EKE, ELKE, GLE, E_RANGE, x_final,y_final,z_final, u_final, *v_final,w_final integer*4 IDISC, IROLD, IRNEW, IAUSFL common/geom/ xbound(128+1), ybound(128+1), zbound(128+1), xboun *d_min, xbound_max, ybound_min, ybound_max, zbound_min, zbound *_max, medsur, dsurround(4), IMAX, JMAX, KMAX, ijmax, irmax, * howfarless real*4 xbound, ybound, zbound, xbound_min, xbound_max, ybound_min, * ybound_max, zbound_min, zbound_max,dsurround integer medsur,IMAX, JMAX, KMAX, ijmax,irmax logical howfarless COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000
![Page 63: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/63.jpg)
*),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold common/source/ esrc, nhist, nnread, einsrc, xsrcold, ysrcold, * usrcold, vsrcold, wsrcold, weightold, latchold, frMU_indx, *zinc, xinl, xinu, yinl, yinu, zinl, zinu, thetax, thetay, * thetaz, uinc, vinc, winc, beamarea, xcol, ycol, xiso, yiso *, ziso, phicol, theta(60000), phi(60000), pang(60000), angfi *xed(60000), angmin(60000), angmax(60000), pgang(60000), xtemp( *60000), ytemp(60000), ztemp(60000), phicoltemp(60000), thetatem *p(60000), phitemp(60000), muIndex(60000), r_11(60000), r_12(600 *00), r_13(60000), r_21(60000), r_22(60000), r_23(60000), r_31(6000 *0), r_32(60000), r_33(60000), dsource, dsourcetemp(60000), ein, e *ksrcm, esrc_sp, SSD, einsrcold, iqinold, NINCSRC, r_dbs, ssd *_dbs, z_dbs, enflag, dflag, ismode, isource, iqin, * iqphsp, iqinc, MLCflag *, ixinl, ixinu, jyinl, jyinu, kzinl, * kzinu, klowx, khix, klowy, khiy, * klowz, khiz, survival_ratio, nsmiss, *nsrjct, nsoutside, nmissm, nshist, nphist, * nnphsp, IPRIMARY, * OLDSRC, npassi, nang, ivary(600 *00), ngang(60000), nset, more_in_cont, * numang, dose_stat, ndbsrjct, * i_dbs, iphatsrc, e_split, * i_iaea_in, i_unit_in, nhist_last, * the_beam_code, the_input_file, the *_vcu_input_file, the_pegs_file, the_ *phsp_file, the_vcu_code real*8 esrc,muIndex integer*8 nhist, nnread real*8 einsrc, xsrcold, ysrcold,usrcold,vsrcold,wsrcold,weightold, *latchold, frMU_indx real*4 zinc, xinl, xinu, yinl, yinu, zinl, zinu, thetax, thetay *, thetaz, uinc, vinc, winc, beamarea, xcol,ycol,xiso, yiso, zi *so, phicol, theta, phi, xtemp, ytemp, ztemp, phico *ltemp,thetatemp, phitemp, pang,angfixed,angmin,ang *max,pgang,r_11, r_12, r_13, r_21, r_22, r_23 *, r_31, r_32, r_33,dsource,dsourcetemp, * ein, eksrcm, esrc_sp, SSD, NINCSRC, * r_dbs, ssd_dbs,z_dbs,survival_ratio,einsrcold integer*4 isource, iqin, iqphsp, iqinc,iqinold,MLCflag, * ixinl, ixinu, jyinl, jyinu, kzinl, kzinu, * klowx, khix, klowy, khiy, klowz, khiz *, nsmiss, nsrjct,nsoutsid *e, nmissm,nshist,nphist,nnphsp, enflag, dflag, is *mode, IPRIMARY, OLDSRC,npassi,nang,ivary,ngang,numang,dose_stat, * ndbsrjct,i_dbs,iphatsrc,e_split,i_iaea_in,i_unit_in,more_in_c *ont,nset integer*2 nhist_last character*80 the_beam_code, the_vcu_code, the_input_file,the_pegs_ *file, the_vcu_input_file,the_phsp_file COMMON/SOURCE_FORPARALLEL/nnphsp_max, nnphsp_min integer*4 nnphsp_max, nnphsp_min INTEGER ione, irl, i,j,k, irx,iry,irz real*8 dnearl, dist, xsrcp,ysrcp,zsrcp
![Page 64: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/64.jpg)
data ione/1/ irl = ir(np) CALL HOWNEAR(dnearl,X(NP),Y(NP),Z(NP),IR(NP)) dnear(np)=dnearl IF ((irl.EQ.1)) THEN idisc = 1 return ELSE IF((irl .EQ. irmax + 1)) THEN IF ((u(np) .GT. 0.0)) THEN dist = (xbound_min - x(np))/u(np) IF ((dist.GT.0.)) THEN ysrcp = y(np) + dist*v(np) zsrcp = z(np) + dist*w(np) IF (( (ysrcp .GE. ybound_min) .AND. (ysrcp .LE. ybound * _max) .AND. (zsrcp .GE. zbound_min) .AND. (zsrcp .LE. * zbound_max))) THEN DO 4501 j=1,JMAX IF (( (ybound(j) .LE. ysrcp) .AND. (ysrcp .LE. * ybound(j+1)) )) THEN DO 4511 k=1,KMAX IF (( (zbound(k) .LE. zsrcp) .AND. (zs * rcp .LE. zbound(k+1)) )) THEN IF ((dist .LT. ustep)) THEN ustep = dist irnew = IMAX*j + klowx + ijmax * *k ELSE irnew=ir(np) END IF return END IF4511 CONTINUE4512 CONTINUE END IF4501 CONTINUE4502 CONTINUE stop ' * Stopped in howfar on lower x-plane. Canno *t find irnew! *' END IF END IF ELSE IF((u(np) .LT. 0.0)) THEN dist = (xbound_max - x(np))/u(np) IF ((dist.GT.0.)) THEN ysrcp = y(np) + dist*v(np) zsrcp = z(np) + dist*w(np) IF (( (ysrcp .GE. ybound_min) .AND. (ysrcp .LE. ybound * _max) .AND. (zsrcp .GE. zbound_min) .AND. (zsrcp .LE. * zbound_max))) THEN DO 4521 j=1,JMAX IF (( (ybound(j) .LE. ysrcp) .AND. (ysrcp .LE. * ybound(j+1)) )) THEN DO 4531 k=1,KMAX IF (((zbound(k).LE. zsrcp).AND.(zsrcp. * LE. zbound(k+1)))) THEN IF ((dist .LT. ustep)) THEN ustep = dist irnew = IMAX*j + khix + ijmax* * k
![Page 65: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/65.jpg)
ELSE irnew=ir(np) END IF return END IF4531 CONTINUE4532 CONTINUE END IF4521 CONTINUE4522 CONTINUE stop ' * Stopped in howfar on upper x-plane. Canno *t find irnew! *' END IF END IF END IF IF ((v(np) .GT. 0.0)) THEN dist = (ybound_min - y(np))/v(np) IF ((dist.GT.0.)) THEN xsrcp = x(np) + dist*u(np) zsrcp = z(np) + dist*w(np) IF (( (xsrcp .GE. xbound_min) .AND. (xsrcp .LE. xbound * _max) .AND. (zsrcp .GE. zbound_min) .AND. (zsrcp .LE. * zbound_max))) THEN DO 4541 i=1,IMAX IF (( (xbound(i) .LE. xsrcp) .AND. (xsrcp .LE. * xbound(i+1)) )) THEN DO 4551 k=1,KMAX IF (( (zbound(k) .LE. zsrcp) .AND. (zs * rcp .LE. zbound(k+1)))) THEN IF ((dist .LT. ustep)) THEN ustep = dist irnew = i + klowy + ijmax*k ELSE irnew=ir(np) END IF return END IF4551 CONTINUE4552 CONTINUE END IF4541 CONTINUE4542 CONTINUE stop ' * Stopped in howfar on lower y-plane. Canno *t find irnew! *' END IF END IF ELSE IF((v(np) .LT. 0.0)) THEN dist = (ybound_max - y(np))/v(np) IF ((dist.GT.0.)) THEN xsrcp = x(np) + dist*u(np) zsrcp = z(np) + dist*w(np) IF (( (xsrcp .GE. xbound_min) .AND. (xsrcp .LE. xbound * _max) .AND. (zsrcp .GE. zbound_min) .AND. (zsrcp .LE. * zbound_max))) THEN DO 4561 i=1,IMAX IF (( (xbound(i) .LE. xsrcp) .AND. (xsrcp .LE. * xbound(i+1)) )) THEN DO 4571 k=1,KMAX
![Page 66: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/66.jpg)
IF (( (zbound(k) .LE. zsrcp) .AND. (zs * rcp .LE. zbound(k+1)) )) THEN IF ((dist .LT. ustep)) THEN ustep = dist irnew = i + khiy + ijmax*k ELSE irnew=ir(np) END IF return END IF4571 CONTINUE4572 CONTINUE END IF4561 CONTINUE4562 CONTINUE stop ' * Stopped in howfar on upper y-plane. Canno *t find irnew! *' END IF END IF END IF IF ((w(np) .GT. 0.0)) THEN dist = (zbound_min - z(np))/w(np) IF ((dist.GT.0.)) THEN xsrcp = x(np) + dist*u(np) ysrcp = y(np) + dist*v(np) IF (( (xsrcp .GE. xbound_min) .AND. (xsrcp .LE. xbound * _max) .AND. (ysrcp .GE. ybound_min) .AND. (ysrcp .LE. * ybound_max))) THEN DO 4581 i=1,IMAX IF (( (xbound(i) .LE. xsrcp) .AND. (xsrcp .LE. * xbound(i+1)) )) THEN DO 4591 j=1,JMAX IF (( (ybound(j) .LE. ysrcp) .AND. (ys * rcp .LE. ybound(j+1)) )) THEN IF ((dist .LT. ustep)) THEN ustep = dist irnew = i + klowz + IMAX*j ELSE irnew=ir(np) END IF return END IF4591 CONTINUE4592 CONTINUE END IF4581 CONTINUE4582 CONTINUE stop ' * Stopped in howfar on lower z-plane. Canno *t find irnew! *' END IF END IF ELSE IF((w(np) .LT. 0.0)) THEN dist = (zbound_max-z(np))/w(np) IF ((dist.GT.0.)) THEN xsrcp = x(np) + dist*u(np) ysrcp = y(np) + dist*v(np) IF (( (xsrcp .GE. xbound_min) .AND. (xsrcp .LE. xbound * _max) .AND. (ysrcp .GE. ybound_min) .AND. (ysrcp .LE.
![Page 67: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/67.jpg)
* ybound_max))) THEN DO 4601 i=1,IMAX IF (( (xbound(i) .LE. xsrcp) .AND. (xsrcp .LE. * xbound(i+1)) )) THEN DO 4611 j=1,JMAX IF (( (ybound(j) .LE. ysrcp) .AND. (ys * rcp .LE. ybound(j+1)) )) THEN IF ((dist .LT. ustep)) THEN ustep = dist irnew = i + khiz + IMAX*j ELSE irnew=ir(np) END IF return END IF4611 CONTINUE4612 CONTINUE END IF4601 CONTINUE4602 CONTINUE stop ' * Stopped in howfar on upper z-plane. Canno *t find irnew! *' END IF END IF END IF IF ((u(np).GT.0.)) THEN xsrcp=(xbound_max+dsurround(1)-x(np))/u(np) ELSE IF((u(np).LT.0.)) THEN xsrcp=(xbound_min-dsurround(1)-x(np))/u(np) ELSE xsrcp=1.0E10 END IF IF ((v(np).GT.0.)) THEN ysrcp=(ybound_max+dsurround(2)-y(np))/v(np) ELSE IF((v(np).LT.0.)) THEN ysrcp=(ybound_min-dsurround(2)-y(np))/v(np) ELSE ysrcp=1.0E10 END IF IF ((w(np).GT.0.)) THEN zsrcp=(zbound_max+dsurround(3)-z(np))/w(np) ELSE IF((w(np).LT.0.)) THEN zsrcp=(zbound_min-dsurround(4)-z(np))/w(np) ELSE zsrcp=1.0E10 END IF dist=min(xsrcp,ysrcp,zsrcp) IF ((dist.LT. ustep)) THEN ustep=dist irnew=1 ELSE irnew=ir(np) END IF ELSE IF((howfarless)) THEN dist=1e20 IF ((w(np) .GT. 0.0)) THEN dist = min(dist,(zbound_max-z(np))/w(np)) ELSE IF((w(np) .LT. 0.0)) THEN
![Page 68: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/68.jpg)
dist = min(dist,-( z(np) - zbound_min)/w(np)) END IF IF ((u(np) .GT. 0.0)) THEN dist = min(dist,(xbound_max-x(np))/u(np)) ELSE IF((u(np) .LT. 0.0)) THEN dist = min(dist,-( x(np) - xbound_min)/u(np)) END IF IF ((v(np) .GT. 0.0)) THEN dist = min(dist,(ybound_max-y(np))/v(np)) ELSE IF((v(np) .LT. 0.0)) THEN dist = min(dist,-( y(np) - ybound_min)/v(np)) END IF IF ((dist .LT. ustep)) THEN ustep=dist IF ((enflag .GT. 1)) THEN irnew=irmax+1 ELSE irnew=1 END IF ELSE irnew=irl END IF return ELSE irx=mod(irl-1,IMAX) IF((irx.EQ.0))irx=IMAX irz = 1 + (irl-1-irx)/ijmax iry = 1 + ( (irl-1-irx) - (irz-1)*ijmax)/IMAX IF ((w(np) .GT. 0.0)) THEN dist = (zbound(irz+1)-z(np))/w(np) IF ((dist .LT. ustep)) THEN ustep=dist IF ((irz .NE. KMAX)) THEN irnew=irl+ijmax ELSE IF((enflag .GT. 1)) THEN irnew=irmax+1 ELSE irnew=1 END IF END IF ELSE IF((w(np) .LT. 0.0)) THEN dist = -( z(np) - zbound(irz))/w(np) IF ((dist .LT. ustep)) THEN ustep = dist IF ((irz .NE. 1)) THEN irnew=irl-ijmax ELSE IF((enflag .GT. 1)) THEN irnew=irmax+1 ELSE irnew = 1 END IF END IF END IF IF ((u(np) .GT. 0.0)) THEN dist = (xbound(irx+1)-x(np))/u(np) IF ((dist .LT. ustep)) THEN ustep=dist IF ((irx .NE. IMAX)) THEN
![Page 69: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/69.jpg)
irnew=irl+ione ELSE IF((enflag .GT. 1)) THEN irnew=irmax+1 ELSE irnew=1 END IF END IF ELSE IF((u(np) .LT. 0.0)) THEN dist = -( x(np) - xbound(irx))/u(np) IF ((dist .LT. ustep)) THEN ustep = dist IF ((irx .NE. 1)) THEN irnew=irl-ione ELSE IF((enflag .GT. 1)) THEN irnew=irmax+1 ELSE irnew = 1 END IF END IF END IF IF ((v(np) .GT. 0.0)) THEN dist = (ybound(iry+1)-y(np))/v(np) IF ((dist .LT. ustep)) THEN ustep=dist IF ((iry .NE. JMAX)) THEN irnew=irl+IMAX ELSE IF((enflag .GT. 1)) THEN irnew=irmax+1 ELSE irnew=1 END IF END IF ELSE IF((v(np) .LT. 0.0)) THEN dist = -( y(np) - ybound(iry))/v(np) IF ((dist .LT. ustep)) THEN ustep = dist IF ((iry .NE. 1)) THEN irnew=irl-IMAX ELSE IF((enflag .GT. 1)) THEN irnew=irmax+1 ELSE irnew = 1 END IF END IF END IF return END IF end SUBROUTINE HOWNEAR (TPERP,X,Y,Z,IRL) ! Copyright National Research Council of Canada, Ottawa, ! BEAM Code System 1999, all rights reserved ! This code is covered by the BEAM General License implicit none common/geom/ xbound(128+1), ybound(128+1), zbound(128+1), xboun *d_min, xbound_max, ybound_min, ybound_max, zbound_min, zbound *_max, medsur, dsurround(4), IMAX, JMAX, KMAX, ijmax, irmax, * howfarless real*4 xbound, ybound, zbound, xbound_min, xbound_max, ybound_min,
![Page 70: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/70.jpg)
* ybound_max, zbound_min, zbound_max,dsurround integer medsur,IMAX, JMAX, KMAX, ijmax,irmax logical howfarless real*8 TPERP, X, Y, Z integer*4 IRL integer*4 IRX,IRY,IRZ TPERP=1.e10 IF ((IRL.EQ.1)) THEN TPERP=0 ELSE IF((IRL.EQ.irmax+1)) THEN IF (((X.GE.xbound_min .AND. X.LE.xbound_max .AND. Y.GE.ybound_ * min .AND. Y.LE.ybound_max) .AND. (Z.GE.zbound_max .OR. Z.LE.zb * ound_min))) THEN TPERP=MIN(TPERP,ABS(Z-zbound_min),ABS(Z-zbound_max)) ELSE IF ((Y.GE.ybound_min .AND. Y.LE.ybound_max .AND. (X.LE.xbo * und_min .OR. X.GE.xbound_max))) THEN TPERP=MIN(TPERP,ABS(X-xbound_min),ABS(X-xbound_max)) ELSE IF((X.GE.xbound_min .AND. X.LE.xbound_max .AND. (Y.LE * .ybound_min .OR. Y.GE.ybound_max))) THEN TPERP=MIN(TPERP,ABS(Y-ybound_min),ABS(Y-ybound_max)) ELSE IF(((X.GE.xbound_max .OR. X.LE.xbound_min) .AND. (Y.G * E.ybound_max .OR. Y.LE.ybound_min))) THEN TPERP=MIN(TPERP**2,(X-xbound_max)**2+(Y-ybound_max)**2 * , (X-xbound_max)**2+(Y-ybound_min)**2, (X-xbound_min)* * *2+(Y-ybound_max)**2, (X-xbound_min)**2+(Y-ybound_min) * **2) TPERP=SQRT(TPERP) ELSE TPERP=0. END IF IF ((Z.LT.zbound_min)) THEN TPERP=SQRT(TPERP**2+(Z-zbound_min)**2) ELSE IF((Z.GT.zbound_max)) THEN TPERP=SQRT(TPERP**2+(Z-zbound_max)**2) END IF END IF TPERP=MIN(TPERP,ABS(X-(xbound_min-dsurround(1))), ABS(X-(xboun * d_max+dsurround(1))), ABS(Y-(ybound_min-dsurround(2))), ABS(Y- * (ybound_max+dsurround(2))), ABS(Z-(zbound_min-dsurround(4))), * ABS(Z-(zbound_max+dsurround(3)))) ELSE IF((howfarless)) THEN TPERP=MIN(TPERP,X-xbound_min,xbound_max-X, Y-ybound_min,ybound * _max-Y, Z-zbound_min,zbound_max-Z) ELSE IRX=mod(IRL-1,IMAX) IF((IRX.EQ.0))IRX=IMAX IRZ = 1 + (IRL-1-IRX)/ijmax IRY = 1 + ( (IRL-1-IRX) - (IRZ-1)*ijmax)/IMAX TPERP=min(TPERP,(xbound(irx+1)-X),(X-xbound(irx))) TPERP=min(TPERP,(ybound(iry+1)-Y),(Y-ybound(iry))) TPERP=min(TPERP,(zbound(irz+1)-Z),(Z-zbound(irz))) END IF return end SUBROUTINE DATETIME(DUMMY) ! Copyright National Research Council of Canada, Ottawa, ! BEAM Code System 1999, all rights reserved
![Page 71: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/71.jpg)
! This code is covered by the BEAM General License implicit none COMMON/TIMEINFO/ TIMEN, DATEN, DNTIME character timen*8, daten*11, dntime*24 INTEGER DUMMY call egs_get_fdate(DNTIME) daten(1:7)=dntime(5:11) daten(8:11)=dntime(21:24) timen(1:8)=dntime(12:19) RETURN end subroutine write_dose(iimax,jjmax,kkmax,xbnd,ybnd,zbnd,dd,ddun,uni *tnum, writemax20) ! Copyright National Research Council of Canada, Ottawa, ! BEAM Code System 1999, all rights reserved ! This code is covered by the BEAM General License IMPLICIT NONE INTEGER iimax, jjmax, kkmax, ijkmax, irtmp, writemax20, unit *num, ii,jj,kk,mm,nn, NUMFRAC, MAXI(20),MAXJ(20),MAXK(20), egs_o *pen_file REAL xbnd(128+1), ybnd(128+1), zbnd(128+1), MAXDOS(20), MAXDOS *AVG, ERRMAXDOSAVG, ERR50AVG, ERR50FRAC, DOSEFRAC, DOSEmin, *ARUFRAC REAL*8 dd( 2097153), ddun( 2097153) unitnum=egs_open_file(unitnum,0,1,'.3ddose') write(unitnum,*)iimax,jjmax,kkmax write(unitnum,*)(xbnd(ii),ii=1,iimax+1) write(unitnum,*)(ybnd(jj),jj=1,jjmax+1) write(unitnum,*)(zbnd(kk),kk=1,kkmax+1) write(unitnum,*)(((dd((ii+(jj-1)*iimax+(kk-1)*iimax*jjmax)),ii=1,i *imax),jj=1,jjmax),kk=1,kkmax) write(unitnum,*)(((ddun((ii+(jj-1)*iimax+(kk-1)*iimax*jjmax)),ii=1 *,iimax),jj=1,jjmax),kk=1,kkmax) close(unitnum) ijkmax=iimax*jjmax*kkmax IF ((writemax20.EQ.1)) THEN DO 4621 mm=1,20 MAXDOS(mm)=0.04621 CONTINUE4622 CONTINUE DO 4631 ii=1,iimax DO 4641 jj=1,jjmax DO 4651 kk=1,kkmax irtmp = (ii+(jj-1)*iimax+(kk-1)*iimax*jjmax) DO 4661 mm=1,min(20,ijkmax) IF ((dd(irtmp).GE.MAXDOS(mm))) THEN DO 4671 nn=min(20,ijkmax),mm+1,-1 MAXDOS(nn)=MAXDOS(nn-1) MAXI(nn)=MAXI(nn-1) MAXJ(nn)=MAXJ(nn-1) MAXK(nn)=MAXK(nn-1)4671 CONTINUE4672 CONTINUE MAXDOS(mm)=dd(irtmp) MAXI(mm)=ii MAXJ(mm)=jj MAXK(mm)=kk GO TO4662
![Page 72: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/72.jpg)
END IF4661 CONTINUE4662 CONTINUE4651 CONTINUE4652 CONTINUE4641 CONTINUE4642 CONTINUE4631 CONTINUE4632 CONTINUE MAXDOSAVG=0. ERRMAXDOSAVG=0. DO 4681 mm=1,min(20,ijkmax) MAXDOSAVG=MAXDOSAVG+MAXDOS(mm) ERRMAXDOSAVG=ERRMAXDOSAVG+ddun((MAXI(mm)+(MAXJ(mm)-1)*iima * x+(MAXK(mm)-1)*iimax*jjmax))4681 CONTINUE4682 CONTINUE MAXDOSAVG=MAXDOSAVG/float(min(20,ijkmax)) ERRMAXDOSAVG=ERRMAXDOSAVG/float(min(20,ijkmax)) ERR50AVG=0. ERR50FRAC=0. DOSEFRAC=0.5 DOSEmin = DOSEFRAC*MAXDOS(1) ARUFRAC=0. NUMFRAC=0 DO 4691 ii=1,iimax DO 4701 jj=1,jjmax DO 4711 kk=1,kkmax irtmp = (ii+(jj-1)*iimax+(kk-1)*iimax*jjmax) IF ((dd(irtmp) .GT. DOSEmin )) THEN ERR50AVG =ERR50AVG +ddun(irtmp) ERR50FRAC=ERR50FRAC+ddun(irtmp)*dd(irtmp) ARUFRAC =ARUFRAC +ddun(irtmp)**2 NUMFRAC =NUMFRAC+1 END IF4711 CONTINUE4712 CONTINUE4701 CONTINUE4702 CONTINUE4691 CONTINUE4692 CONTINUE IF (( (NUMFRAC .NE. 0) .AND. (MAXDOS(1) .NE. 0.0))) THEN ERR50AVG=ERR50AVG/NUMFRAC ERR50FRAC=ERR50FRAC/(NUMFRAC*MAXDOS(1)) ARUFRAC=SQRT(ARUFRAC/NUMFRAC) ELSE WRITE(6,4720)DOSEFRAC4720 FORMAT(' Statistics really bad - analysis of average relat *ative uncertainty'/ ' on voxels with dose > ',F12.5,'*Dmax is mean *ingless') END IF WRITE(6,4730)min(20,ijkmax), MAXDOSAVG, min(20,ijkmax), ERRMAX * DOSAVG*100., DOSEFRAC, ERR50AVG*100., DOSEFRAC, ERR50FRAC*100, * DOSEFRAC, ARUFRAC*100., NUMFRAC, DOSEFRAC, min(20,ijkmax) WRITE(1,4730)min(20,ijkmax), MAXDOSAVG, min(20,ijkmax), ERRMAX * DOSAVG*100., DOSEFRAC, ERR50AVG*100., DOSEFRAC, ERR50FRAC*100, * DOSEFRAC, ARUFRAC*100., NUMFRAC, DOSEFRAC, min(20,ijkmax)4730 FORMAT(/' average of ',I2,' highest doses = ',T62,E12.5,' Gy/p
![Page 73: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/73.jpg)
*article'/ ' average % error of ',I2,' highest doses = ',T60,F9.3,' * %'/ ' average % error of doses >',F7.3,' of max dose = ',T60,F9.3 *,' %'/ ' (average error of doses >',F7.3,' of max dose)/(max dose) * =',T60,F9.3,' %'/ ' quadrature average % error of doses >',F7.3,' * of max dose =',T60,F9.3,' %'/ ' There are ',I11,' voxelswith dose * > ',F7.3,' of max dose ' // ' ',I2,' highest doses: '/ ' '/ ' * dose (Gy/particle) (x,y,z) (cm)'/' *----------------- ------------'/) DO 4741 mm=1,min(20,ijkmax) WRITE(6,4750)MAXDOS(mm),ddun((MAXI(mm)+(MAXJ(mm)-1)*iimax+ * (MAXK(mm)-1)*iimax*jjmax))*100, (xbnd(MAXI(mm)+1)+xbnd(MAX * I(mm)))/2., (ybnd(MAXJ(mm)+1)+ybnd(MAXJ(mm)))/2., (zbnd(MA * XK(mm)+1)+zbnd(MAXK(mm)))/2. WRITE(1,4750)MAXDOS(mm),ddun((MAXI(mm)+(MAXJ(mm)-1)*iimax+ * (MAXK(mm)-1)*iimax*jjmax))*100, (xbnd(MAXI(mm)+1)+xbnd(MAX * I(mm)))/2., (ybnd(MAXJ(mm)+1)+ybnd(MAXJ(mm)))/2., (zbnd(MA * XK(mm)+1)+zbnd(MAXK(mm)))/2.4750 FORMAT(' ',E12.5,' +/- ',F12.5,' % ( ',F12.5,',',F12.5,', *',F12.5,' )')4741 CONTINUE4742 CONTINUE END IF RETURN end subroutine write_phantom(iunit,nmed,media,estepe, iimax,jjmax,kkma *x,xbnd,ybnd,zbnd, rho,med) IMPLICIT NONE Character*4 media(24,7) INTEGER iunit, nmed, iimax, jjmax, kkmax, ii,jj,kk, egs_open *_file integer*2 med( 2097154) REAL xbnd(128+1), ybnd(128+1), zbnd(128+1), estepe(7) real*8 rho( 2097154) iunit=egs_open_file(iunit,0,1,'.egsphant') WRITE(iunit,'(i2)') nmed DO 4761 ii=1,nmed Write(iunit,'(24a1)') (media(jj,ii),jj=1,24)4761 CONTINUE4762 CONTINUE WRITE(iunit,*) (estepe(ii),ii=1,nmed) WRITE(iunit,'(3i5)') iimax,jjmax,kkmax WRITE(iunit,*) (xbnd(ii),ii=1,iimax+1) WRITE(iunit,*) (ybnd(jj),jj=1,jjmax+1) WRITE(iunit,*) (zbnd(kk),kk=1,kkmax+1) DO 4771 kk=1,kkmax DO 4781 jj=1,jjmax WRITE(iunit,1399) (med((1 + ii + (jj-1)*iimax + (kk-1)*iim * ax*jjmax)),ii=1,iimax)4781 CONTINUE4782 CONTINUE WRITE(iunit,*)4771 CONTINUE4772 CONTINUE1399 FORMAT(128i1) DO 4791 kk=1,kkmax DO 4801 jj=1,jjmax WRITE(iunit,*) (rho((1 + ii + (jj-1)*iimax + (kk-1)*iimax* * jjmax)),ii=1,iimax)
![Page 74: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/74.jpg)
4801 CONTINUE4802 CONTINUE WRITE(iunit,*)4791 CONTINUE4792 CONTINUE close(iunit) RETURN end subroutine combine_results(file_name) implicit none common/score/IWATCH,mxnp, endep( 2097153), endep2( 2097153), temp2 *, planarefe, planarefp,planarfe,planarfp,nestep,endep_tmp( 2097153 *), endep_last( 2097153) integer IWATCH, mxnp real endep_tmp REAL*8 endep, endep2, temp2,planarefe, planarefp, planarfe, planar *fp integer*8 nestep integer*2 endep_last character*(*) file_name integer*4 I,IMAX,JMAX,KMAX,lnblnk1 REAL*4 TENDEP( 2097153), TENDEP2( 2097153) REAL*8 TTEMP2 logical first_time data first_time/.true./ save first_time IF ((first_time)) THEN WRITE(6,4810) WRITE(1,4810)4810 FORMAT(/1X,'Summing the following .pardose files') WRITE(6,4820) WRITE(1,4820)4820 FORMAT(1X,'------------------------------------'/) END IF WRITE(6,4830)file_name(:lnblnk1(file_name)) WRITE(1,4830)file_name(:lnblnk1(file_name))4830 FORMAT(A) file_name=file_name(:lnblnk1(file_name))//char(0) call read_pardose(TTEMP2,IMAX,JMAX,KMAX,TENDEP,TENDEP2,file_name) IF ((first_time)) THEN first_time = .false. TEMP2=0. DO 4841 I=1,IMAX*JMAX*KMAX endep(I)=0.0 endep2(I)=0.04841 CONTINUE4842 CONTINUE END IF DO 4851 I=1,IMAX*JMAX*KMAX endep(i)=endep(i)+tendep(i) endep2(i)=endep2(i)+ tendep2(i)4851 CONTINUE4852 CONTINUE TEMP2=TEMP2+TTEMP2 return end integer function ibsearch(a, nsh, b) real*4 b(*)
![Page 75: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/75.jpg)
real*8 a integer min,max,help,nsh real*4 x min = 1 max = nsh x = a4861 IF(min.GE.max-1)GO TO 4862 help = (max+min) / 2 IF (( b(help).LE.x)) THEN min = help ELSE max = help END IF GO TO 48614862 CONTINUE ibsearch = min return end subroutine modify_tmxs(mindel) implicit none COMMON/BOUNDS/ECUT,PCUT,VACDST real*8 ECUT, PCUT, VACDST COMMON/ELECIN/ esig_e(7),psig_e(7), esige_max, psige_max, range_ep *(0:1,150,7), E_array(150,7), etae_ms0(150,7),etae_ms1(150,7),etap_ *ms0(150,7),etap_ms1(150,7),q1ce_ms0(150,7),q1ce_ms1(150,7),q1cp_ms *0(150,7),q1cp_ms1(150,7),q2ce_ms0(150,7),q2ce_ms1(150,7),q2cp_ms0( *150,7),q2cp_ms1(150,7),blcce0(150,7),blcce1(150,7), EKE0(7),EKE1(7 *), XR0(7),TEFF0(7),BLCC(7),XCC(7), ESIG0(150,7),ESIG1(150,7),PSIG0 *(150,7),PSIG1(150,7),EDEDX0(150,7),EDEDX1(150,7),PDEDX0(150,7),PDE *DX1(150,7),EBR10(150,7),EBR11(150,7),PBR10(150,7),PBR11(150,7),PBR *20(150,7),PBR21(150,7),TMXS0(150,7),TMXS1(150,7), expeke1(7), IUNR *ST(7),EPSTFL(7),IAPRIM(7), sig_ismonotone(0:1,7) real*8 esig_e, psig_e, esige_max, psige_max, range_ep, E_ar *ray, etae_ms0,etae_ms1, etap_ms0,etap_ms1, q1ce_ms0,q1ce_ms1, *q1cp_ms0,q1cp_ms1, q2ce_ms0,q2ce_ms1, q2cp_ms0,q2cp_ms1, blcce0 *,blcce1, expeke1, EKE0,EKE1, XR0, TEFF0, BLCC, XCC, ESIG0,E *SIG1, PSIG0,PSIG1, EDEDX0,EDEDX1, PDEDX0,PDEDX1, EBR10,EBR11, * PBR10,PBR11, PBR20,PBR21, TMXS0,TMXS1 integer*4 IUNRST, EPSTFL, IAPRIM logical sig_ismonotone COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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( 2097154),MED( 2097154),IRAYLR real*8 DUNIT, RHOR integer*4 KMPI, KMPO integer*2 MED, IRAYLR common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array
![Page 76: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/76.jpg)
real*4 twom24 common/ET_control/ SMAXIR,estepe,ximax, skindepth_for_bca,transpo *rt_algorithm, bca_algorithm,exact_bca,spin_effects real*8 smaxir, estepe, ximax, skindepth_for_bca integer*4 transport_algorithm, bca_algorithm logical exact_bca, spin_effects real*8 rm,eil,ei,p2,beta2,chi_a2,elke,eke,dedx0,estepx,si,sip1,tmx *s_orig, mindel integer*4 medium,i,neke,leil,lelke rm = 0.5110034 DO 4871 medium=1,nmed neke = meke(medium) eil = (1 - eke0(medium))/eke1(medium) leil = 1 ei = Exp(eil) leil = 1 p2 = ei*(ei+2*rm) beta2 = p2/(p2+rm*rm) chi_a2 = Xcc(medium)/(4*p2*blcc(medium)) dedx0=ededx1(Leil,MEDIUM)*eil+ededx0(Leil,MEDIUM) estepx = 2*p2*beta2*dedx0/ei/Xcc(medium)/(Log(1+1./chi_a2)*(1+ * chi_a2)-1) estepx = estepx*ximax IF (( estepx .GT. estepe )) THEN estepx = estepe END IF si = estepx*ei/dedx0 IF((si .LT. mindel/2.))si = mindel/2. DO 4881 i=1,neke - 1 elke = (i + 1 - eke0(medium))/eke1(medium) lelke = i tmxs_orig=tmxs1(i,MEDIUM)*elke+tmxs0(i,MEDIUM) eke = Exp(elke) lelke = i+1 p2 = eke*(eke+2*rm) beta2 = p2/(p2+rm*rm) chi_a2 = Xcc(medium)/(4*p2*blcc(medium)) dedx0=ededx1(Lelke,MEDIUM)*elke+ededx0(Lelke,MEDIUM) estepx = 2*p2*beta2*dedx0/eke/ Xcc(medium)/(Log(1+1./chi_a * 2)*(1+chi_a2)-1) estepx = estepx*ximax IF (( estepx .GT. estepe )) THEN estepx = estepe END IF sip1 = estepx*eke/dedx0 IF((sip1 .LT. mindel/2.))sip1 = mindel/2. tmxs1(i,medium) = (sip1 - si)*eke1(medium) tmxs0(i,medium) = sip1 - tmxs1(i,medium)*elke si = sip14881 CONTINUE4882 CONTINUE tmxs0(neke,medium) = tmxs0(neke - 1,medium) tmxs1(neke,medium) = tmxs1(neke - 1,medium)4871 CONTINUE4872 CONTINUE return end ! Copyright National Research Council of Canada, Ottawa,
![Page 77: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/77.jpg)
! BEAM Code System 1999, all rights reserved ! This code is covered by the BEAM General License SUBROUTINE BMODEL1 IMPLICIT NONE COMMON/ENERGYSRC/NENSRC,IMODE,ENSRCD,SRCPDF,SRCCDF,ENMIN,CDFINV,DE *LTAK REAL ENSRCD(200),SRCPDF(200),SRCCDF(200),ENMIN, CDFINV(1000,2),DEL *TAK INTEGER IMODE,NENSRC COMMON/SSMDIS/ISMMODE,NSSMDIS,IB_SSM,IC_SSM, SSMDIS,SSMPDF,SSMCDF, *SSMMIN,SSMMAX,CDFSSM INTEGER ISMMODE,NSSMDIS,IB_SSM,IC_SSM REAL SSMDIS(200),SSMPDF(200),SSMCDF(200),SSMMIN,SSMMAX, CDFSSM(200 *0,2) COMMON/BMODELC1/ NSMFPS,ISMFPS,IQSMFP,ILATCH,NSMFXX,NSMFYY,NSMFRR, * MSMFXY,MISMFP,SMFPXY,NSCATT,NFIELD,NFIELDi,NFIELDo,NFIELDe, RFIEL *D,RFIELDe,XFLDMN,XFLDMX,YFLDMN,YFLDMX, FLDRR2,FLDYY2,FLDXX2,SMFMNZ *,SMFMNX,SMFMXX, SMFMNY,SMFX2,SMFY2,SMFMXY,SMFMNR,SMFMXR, SMFRTN,SS *DVPS,FSMFBN,FSMABN,FSMFRR,FSMFXY,FSMFR11, FSMFR12,SMFDXX,SMFDYY,RF *ACTOR1,RFACTOR2, SMFNR2,SMFMR2,SMFMXZ,RSCATT,SMFMNE,SMFMXE,ERADII, * SSMFPS,RTREAT,RTREATe,XTREATMN,XTREATMX,YTREATMN,YTREATMX, XINSMX *,XINSMN,YINSMX,YINSMN,XINS,YINS,SMONAM,ABNTOTAL,ABNTOTALH INTEGER nSrc,source,n, KKKK,IRBIN, ESTYPE, NSMFPS,ISMFPS(22),IQ *SMFP(22),ILATCH(22),NSMFXX(22),NSMFYY(22), NSMFRR(22),MSMFXY(22),M *ISMFP(2000),SMFPXY(22),NSCATT, NFIELD,NFIELDi,NFIELDo,NFIELDe REAL RFIELD,RFIELDe,XFLDMN,XFLDMX,YFLDMN,YFLDMX, FLDRR2(22),FLDXX2 *(22),FLDYY2(22),SMFMNZ(22),SMFMNX(22),SMFMXX(22), SMFMNY(22),SMFX2 *(22),SMFY2(22),SMFMXY(22),SMFMNR(22),SMFMXR(22), SMFRTN(22),SSDVPS *(22+3),FSMFBN(22,200,2000,2), FSMABN(2000,2),FSMFRR(22,2000,2), FS *MFXY(22,200,200),FSMFR11(22,200), FSMFR12(22,200),SMFDXX(22),SMFDY *Y(22),RFACTOR1,RFACTOR2, SMFNR2(22),SMFMR2(22),SMFMXZ(22),RSCATT,S *MFMNE,SMFMXE,ERADII(200), RTREAT,RTREATe,XTREATMN,XTREATMX,YTREATM *N,YTREATMX, RRR,RRR1,RRR2,XXX,YYY,XXX1,YYY1,ZZZ1, DDMNX,DDMXX,DDMN *Y,DDMXY REAL XINSMX,XINSMN,YINSMX,YINSMN,XINS,YINS,ABNTOTAL,ABNTOTALH CHARACTER*80 SSMFPS,SMONAM INTEGER I,II,IINSRC IINSRC = 43 WRITE(6,4890)4890 FORMAT(/' Input name of file with source parameters (<80 chars ',' *with extension): '/,$) READ(5,605,END=4900)SMONAM WRITE(6,4910)SMONAM4910 FORMAT(/' Read source information from: '/A80) OPEN(UNIT=IINSRC,STATUS='OLD',NAME=SMONAM,ERR=4920) READ(IINSRC,605,END=4900) SSMFPS READ(IINSRC,*) NSMFPS DO 4931 I=1,NSMFPS READ(IINSRC,*) ISMFPS(I),IQSMFP(I),ILATCH(I) IF ((ISMFPS(I) .EQ. 1)) THEN READ(IINSRC,*) SMFMNZ(I),SMFMNX(I),SMFMXX(I),SMFMNY(I),SMF * MXY(I),SMFX2(I), SMFY2(I) SMFDXX(I)=SMFMXX(I)-SMFMNX(I) SMFDYY(I)=SMFMXY(I)-SMFMNY(I) ELSE IF((ISMFPS(I) .EQ. 11)) THEN READ(IINSRC,*) SMFMNZ(I),SMFMXZ(I),SMFMNX(I),SMFMXX(I),SMF * MNY(I),SMFMXY(I), SMFX2(I),SMFY2(I) SMFDXX(I)=SMFMXX(I)-SMFMNX(I)
![Page 78: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/78.jpg)
SMFDYY(I)=SMFMXY(I)-SMFMNY(I) ELSE IF((ISMFPS(I) .EQ. 2)) THEN READ(IINSRC,*) SMFMNZ(I),SMFMNX(I),SMFMXX(I),SMFMNY(I),SMF * MXY(I), SMFX2(I),SMFY2(I),SMFPXY(I) SMFDXX(I)=SMFMXX(I)-SMFMNX(I) SMFDYY(I)=SMFMXY(I)-SMFMNY(I) ELSE IF((ISMFPS(I) .EQ. 3)) THEN READ(IINSRC,*) SMFMNZ(I),SMFMNR(I),SMFMXR(I) SMFNR2(I)=SMFMNR(I)*SMFMNR(I) SMFMR2(I)=SMFMXR(I)*SMFMXR(I) ELSE IF((ISMFPS(I) .EQ. 4)) THEN READ(IINSRC,*) SMFMNZ(I),SMFMNX(I),SMFMXX(I),SMFMNY(I),SMF * MXY(I) SMFDXX(I)=SMFMXX(I)-SMFMNX(I) SMFDYY(I)=SMFMXY(I)-SMFMNY(I) ELSE IF((ISMFPS(I) .EQ. 5)) THEN READ(IINSRC,*) SMFMNZ(I),SMFMNR(I) SMFNR2(I)=SMFMNR(I)*SMFMNR(I) ELSE WRITE(6,4940)4940 FORMAT(///' *** SORRY, DO NOT HAVE THIS TYPE OF SOURCE *** *'/ //' *** START AGAIN'///) STOP END IF4931 CONTINUE4932 CONTINUE READ(IINSRC,*)NSSMDIS,SSMMIN,SMFMXE WRITE(6,4950)NSSMDIS,SSMMIN,SMFMXE4950 FORMAT('Energy bins: ',I4,' Emax:',F10.5,' Emin:',F10.5) READ(IINSRC,*)ESTYPE IF ((ESTYPE .EQ. 0)) THEN READ(IINSRC,*)RTREATe,RFIELDe ERADII(1) = RTREATe ERADII(2) = RFIELDe NFIELDe = 2 ELSE IF((ESTYPE .EQ. 1)) THEN READ(IINSRC,*)NFIELDe,RFIELDe IF ((NFIELDe.LT.0).OR.(NFIELDe.GT.200)) THEN WRITE(6,4960)NFIELDe4960 FORMAT(//'ERROR: number of bins for energy spectrum (',I3, *')'/) STOP ELSE READ(IINSRC,*)(ERADII(II),II=1,NFIELDe) END IF ELSE WRITE(6,4970)ESTYPE4970 FORMAT(//'ERROR: Unknown energy type (',I3,')'/) STOP END IF READ(IINSRC,*,END=4900) MSMFXY(1) WRITE(6,4980)MSMFXY(1)4980 FORMAT('Type of field: ',I4) IF ((MSMFXY(1) .EQ. 0).OR.(MSMFXY(1) .EQ. 1)) THEN READ(IINSRC,*)NFIELDi,RTREAT,NFIELDo,RFIELD NFIELD = NFIELDi + NFIELDo WRITE(6,4990)NFIELDi,RTREAT,NFIELDo,RFIELD4990 FORMAT(/' NFIELDi=',I10,' RTREAT=',F10.3,' NFIELDo=',I10, ' RF
![Page 79: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/79.jpg)
*IELD=',F10.3) RFACTOR1=FLOAT(NFIELDi)/(RTREAT**2) RFACTOR2=FLOAT(NFIELDo)/(RFIELD**2-RTREAT**2) ELSE IF((MSMFXY(1) .EQ. 2)) THEN READ(IINSRC,*)NFIELD,XFLDMN,XFLDMX,YFLDMN,YFLDMX READ(IINSRC,*)XTREATMN,XTREATMX,YTREATMN,YTREATMX ELSE WRITE(6,5000)5000 FORMAT(//' THERE IS SOMETHING WRONG WITH THE FIELD TYPE!'//) STOP END IF READ(IINSRC,605)SMONAM WRITE(6,5010)SMONAM5010 FORMAT('Phase-space file name: ',A) DO 5021 I=1,NSMFPS READ(IINSRC,*) ISMFPS(I) IF ((I .NE. ISMFPS(I))) THEN WRITE(6,5030)5030 FORMAT(/' There is something wrong with sub-source number! *'/) STOP END IF READ(IINSRC,*) ISMFPS(I),IQSMFP(I),ILATCH(I) IF (((IQSMFP(I).LT.-1).OR.(IQSMFP(I).GT.1))) THEN WRITE(6,5040)5040 FORMAT(/' There is something wrong with source charge!'/) STOP END IF IF (((ILATCH(I).LT.0).OR.(ILATCH(I).GT.22))) THEN WRITE(6,5050)5050 FORMAT(/' There is something wrong with LATCH!'/) STOP END IF IF ((ISMFPS(I) .EQ. 1)) THEN READ(IINSRC,*) SMFMNZ(I),SMFMNX(I),SMFMXX(I),SMFMNY(I),SMF * MXY(I),SMFX2(I), SMFY2(I) SMFDXX(I)=SMFMXX(I)-SMFMNX(I) SMFDYY(I)=SMFMXY(I)-SMFMNY(I) ELSE IF((ISMFPS(I) .EQ. 11)) THEN READ(IINSRC,*) SMFMNZ(I),SMFMXZ(I),SMFMNX(I),SMFMXX(I),SMF * MNY(I),SMFMXY(I), SMFX2(I),SMFY2(I) SMFDXX(I)=SMFMXX(I)-SMFMNX(I) SMFDYY(I)=SMFMXY(I)-SMFMNY(I) ELSE IF((ISMFPS(I) .EQ. 2)) THEN READ(IINSRC,*) SMFMNZ(I),SMFMNX(I),SMFMXX(I),SMFMNY(I),SMF * MXY(I), SMFX2(I),SMFY2(I),SMFPXY(I) SMFDXX(I)=SMFMXX(I)-SMFMNX(I) SMFDYY(I)=SMFMXY(I)-SMFMNY(I) ELSE IF((ISMFPS(I) .EQ. 3)) THEN READ(IINSRC,*) SMFMNZ(I),SMFMNR(I),SMFMXR(I) SMFNR2(I)=SMFMNR(I)*SMFMNR(I) SMFMR2(I)=SMFMXR(I)*SMFMXR(I) ELSE IF((ISMFPS(I) .EQ. 4)) THEN READ(IINSRC,*) SMFMNZ(I),SMFMNX(I),SMFMXX(I),SMFMNY(I),SMF * MXY(I) SMFDXX(I)=SMFMXX(I)-SMFMNX(I) SMFDYY(I)=SMFMXY(I)-SMFMNY(I) ELSE IF((ISMFPS(I) .EQ. 5)) THEN
![Page 80: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/80.jpg)
READ(IINSRC,*) SMFMNZ(I),SMFMNR(I) SMFNR2(I)=SMFMNR(I)*SMFMNR(I) ELSE WRITE(6,5060)5060 FORMAT(///' *** SORRY, DO NOT HAVE THIS TYPE OF SOURCE *** *'/ //' *** CHECK IT OUT AND TRY AGAIN'///) STOP END IF READ(IINSRC,*) SMFRTN(I),SSDVPS(I) IF((SSDVPS(I).LT.SMFMNZ(I)))SSDVPS(I)=SMFMNZ(I) WRITE(6,5070)I,I,SMFRTN(I)5070 FORMAT(/' *** Source:',I3,' ***'// ' Relative source intensity * for sub-source',I3,' IS',F10.3) IF ((I .GT. 1)) THEN SMFRTN(I)=SMFRTN(I)+SMFRTN(I-1) END IF READ(IINSRC,*)NSSMDIS,SSMMIN,SSMMAX DO 5081 IB_SSM=1,NSSMDIS SSMDIS(IB_SSM)=SSMMAX/FLOAT(NSSMDIS)*FLOAT(IB_SSM) IF ((SSMDIS(IB_SSM) .LE. SSMMIN)) THEN SSMDIS(IB_SSM)=SSMMIN+.00001*FLOAT(IB_SSM) END IF5081 CONTINUE5082 CONTINUE DO 5091 II=1,NFIELDe READ(IINSRC,*)(SSMPDF(IB_SSM),IB_SSM=1,NSSMDIS) CALL SSM_DISTRIBUTION DO 5101 IB_SSM=1,2000 FSMFBN(I,II,IB_SSM,1)=CDFSSM(IB_SSM,1) FSMFBN(I,II,IB_SSM,2)=CDFSSM(IB_SSM,2)5101 CONTINUE5102 CONTINUE5091 CONTINUE5092 CONTINUE READ(IINSRC,*,END=4900) MSMFXY(I) IF ((MSMFXY(I) .EQ. 0)) THEN READ(IINSRC,*)NFIELDi,RTREAT,NFIELDo,RFIELD NFIELD = NFIELDi + NFIELDo NSSMDIS = NFIELD SSMMIN = RTREAT SSMMAX = RFIELD SSMMIN=0.0 FLDRR2(I)=SMFMNR(I)*SMFMNR(I) DO 5111 IB_SSM=1,NSSMDIS IF (( IB_SSM .LE. NFIELDi )) THEN SSMDIS(IB_SSM)=SQRT((FLOAT(IB_SSM)/FLOAT(NFIELDi)) * * (RTREAT**2)) ELSE SSMDIS(IB_SSM)=SQRT(((RFIELD**2-RTREAT**2)* ((FLOA * T(IB_SSM-NFIELDi))/(FLOAT(NFIELDo))))+RTREAT**2) END IF5111 CONTINUE5112 CONTINUE READ(IINSRC,*)(SSMPDF(IB_SSM),IB_SSM=1,NSSMDIS) SSMMAX = SSMDIS(NSSMDIS) CALL SSM_DISTRIBUTION DO 5121 IB_SSM=1,2000 FSMFRR(I,IB_SSM,1)=CDFSSM(IB_SSM,1)
![Page 81: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/81.jpg)
FSMFRR(I,IB_SSM,2)=CDFSSM(IB_SSM,2)5121 CONTINUE5122 CONTINUE ELSE IF((MSMFXY(I) .EQ. 1)) THEN READ(IINSRC,*)NFIELDi,RTREAT,NFIELDo,RFIELD NFIELD = NFIELDi + NFIELDo NSSMDIS = NFIELD SSMMAX = RFIELD SSMMIN=0.0 FLDRR2(I)=SMFMNR(I)*SMFMNR(I) DO 5131 IB_SSM=1,NSSMDIS IF (( IB_SSM .LE. NFIELDi )) THEN SSMDIS(IB_SSM)=SQRT((FLOAT(IB_SSM)/FLOAT(NFIELDi)) * * (RTREAT**2)) ELSE SSMDIS(IB_SSM)=SQRT(((RFIELD**2-RTREAT**2)* ((FLOA * T(IB_SSM-NFIELDi))/(FLOAT(NFIELDo))))+RTREAT**2) END IF5131 CONTINUE5132 CONTINUE READ(IINSRC,*)(SSMPDF(IB_SSM),IB_SSM=1,NSSMDIS) SSMMAX = SSMDIS(NSSMDIS) CALL SSM_DISTRIBUTION DO 5141 IB_SSM=1,2000 FSMFRR(I,IB_SSM,1)=CDFSSM(IB_SSM,1) FSMFRR(I,IB_SSM,2)=CDFSSM(IB_SSM,2)5141 CONTINUE5142 CONTINUE READ(IINSRC,*)(FSMFR11(I,IB_SSM),IB_SSM=1,NFIELD) READ(IINSRC,*)(FSMFR12(I,IB_SSM),IB_SSM=1,NFIELD) ELSE IF((MSMFXY(I) .EQ. 2)) THEN READ(IINSRC,*)NSSMDIS,SSMMIN,SSMMAX READ(IINSRC,*)NSSMDIS,YFLDMN,YFLDMX READ(IINSRC,*)((FSMFXY(I,IB_SSM,IC_SSM),IB_SSM=1,NSSMDIS), * IC_SSM=1,NSSMDIS) DO 5151 IB_SSM=1,NSSMDIS SSMDIS(IB_SSM)=(SSMMAX-SSMMIN)/FLOAT(NSSMDIS)* FLOAT(I * B_SSM)+SSMMIN5151 CONTINUE5152 CONTINUE DO 5161 IB_SSM=1,NSSMDIS SSMPDF(IB_SSM)=0. DO 5171 IC_SSM=1,NSSMDIS SSMPDF(IB_SSM)=SSMPDF(IB_SSM)+FSMFXY(I,IB_SSM,IC_S * SM)5171 CONTINUE5172 CONTINUE5161 CONTINUE5162 CONTINUE CALL SSM_DISTRIBUTION DO 5181 IB_SSM=1,2000 FSMFRR(I,IB_SSM,1)=CDFSSM(IB_SSM,1) FSMFRR(I,IB_SSM,2)=CDFSSM(IB_SSM,2)5181 CONTINUE5182 CONTINUE FLDXX2(I)=(SMFMXX(I)-SMFMNX(I))*(SMFMXX(I)-SMFMNX(I))/4. FLDYY2(I)=(SMFMXY(I)-SMFMNY(I))*(SMFMXY(I)-SMFMNY(I))/4. SSMMIN=YFLDMN
![Page 82: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/82.jpg)
SSMMAX=YFLDMX DO 5191 IC_SSM=1,NSSMDIS DO 5201 IB_SSM=1,NSSMDIS SSMDIS(IB_SSM)=(SSMMAX-SSMMIN)/FLOAT(NSSMDIS)* FLO * AT(IB_SSM)+SSMMIN5201 CONTINUE5202 CONTINUE DO 5211 IB_SSM=1,NSSMDIS SSMPDF(IB_SSM)=FSMFXY(I,IC_SSM,IB_SSM)5211 CONTINUE5212 CONTINUE CALL SSM_DISTRIBUTION DO 5221 IB_SSM=1,NSSMDIS FSMFXY(I,IC_SSM,IB_SSM)=SSMCDF(IB_SSM)5221 CONTINUE5222 CONTINUE5191 CONTINUE5192 CONTINUE ELSE WRITE(6,5230)5230 FORMAT(//' THERE IS SOMETHING WRONG WITH THE FIELD TYPE!'/ */) STOP END IF5021 CONTINUE5022 CONTINUE NSSMDIS=40 SSMMIN=0.0 SSMMAX=0.1745 DO 5241 IB_SSM=1,NSSMDIS SSMDIS(IB_SSM)=SSMMAX/FLOAT(NSSMDIS)*FLOAT(IB_SSM)5241 CONTINUE5242 CONTINUE READ(IINSRC,*)(SSMPDF(IB_SSM),IB_SSM=1,NSSMDIS) ABNTOTAL=0. DO 5251 IB_SSM=1,40 ABNTOTAL=ABNTOTAL+SSMPDF(IB_SSM)5251 CONTINUE5252 CONTINUE ABNTOTALH=0. DO 5261 IB_SSM=1,40 ABNTOTALH=ABNTOTALH+SSMPDF(IB_SSM) IF (((ABNTOTAL.NE.0.).AND.(ABNTOTALH/ABNTOTAL.GE.0.707))) THEN RSCATT=100.*TAN(FLOAT(IB_SSM)*0.1745/FLOAT(40)) IF (((RSCATT.LE.0.).OR.(RSCATT.GT.50.))) THEN RSCATT=5. END IF GOTO 5270 END IF5261 CONTINUE5262 CONTINUE5270 CONTINUE CALL SSM_DISTRIBUTION DO 5281 IB_SSM=1,2000 FSMABN(IB_SSM,1)=CDFSSM(IB_SSM,1) FSMABN(IB_SSM,2)=CDFSSM(IB_SSM,2)5281 CONTINUE5282 CONTINUE
![Page 83: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/83.jpg)
WRITE(6,5290)5290 FORMAT(/' INFORMATION ABOUT THE SUB-SOURCES'// ' SUB-S *OURCE # CHARGE RELATIVE INTENSITY (%) (ACCUMULATED) SSD'//) DO 5301 I=1,NSMFPS IF ((I .EQ. 1)) THEN WRITE(6,5310)I,IQSMFP(I),SMFRTN(I)/SMFRTN(NSMFPS)*100., SM * FRTN(I)/SMFRTN(NSMFPS)*100.,SMFMNZ(I)5310 FORMAT(I8,I12,F15.2,' % ',F15.2,' %',F12.2/) END IF IF ((I .NE. NSMFPS)) THEN WRITE(6,5320)I+1,IQSMFP(I+1), (SMFRTN(I+1)-SMFRTN(I))/SMFR * TN(NSMFPS)*100., SMFRTN(I+1)/SMFRTN(NSMFPS)*100.,SMFMNZ(I+ * 1)5320 FORMAT(I8,I12,F15.2,' % ',F15.2,' %',F12.2/) END IF5301 CONTINUE5302 CONTINUE DO 5331 I=1,NSMFPS SMFRTN(I)=SMFRTN(I)*2000./SMFRTN(NSMFPS) IF ((I .EQ. NSMFPS)) THEN SMFRTN(I)=2000. END IF IF ((I .EQ. 1)) THEN IF ((INT(SMFRTN(I)) .LT. 1)) THEN WRITE(6,5340)I5340 FORMAT(/' SUB-SOURCE ',I4, ' IGNORED AS FRACTIONAL FLU *ENCE IS TOO SMALL!'/) ELSE DO 5351 IB_SSM=1,INT(SMFRTN(I)) MISMFP(IB_SSM)=I5351 CONTINUE5352 CONTINUE END IF ELSE IF ((INT(SMFRTN(I)) .EQ. INT(SMFRTN(I-1)))) THEN WRITE(6,5360)I5360 FORMAT(/' SUB-SOURCE ',I4, ' IGNORED AS FRACTIONAL FLU *ENCE IS TOO SMALL!'/) ELSE DO 5371 IB_SSM=INT(SMFRTN(I-1))+1,INT(SMFRTN(I)) MISMFP(IB_SSM)=I5371 CONTINUE5372 CONTINUE END IF END IF5331 CONTINUE5332 CONTINUE CLOSE(IINSRC)605 FORMAT(A80)100 FORMAT(' ',2(I2,' '),4(G14.7,' ')) RETURN4900 CONTINUE WRITE(6,5380)5380 FORMAT(//' *** unexpected end of file reading input for ISOURCE ** **') STOP5390 CONTINUE WRITE(6,5400)
![Page 84: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/84.jpg)
5400 FORMAT(//' *** format error on input for ISOURCE ***') STOP4920 CONTINUE WRITE(6,5410)5410 FORMAT(//' *** No directory/file can be found. ***') STOP END SUBROUTINE SSM_DISTRIBUTION COMMON/SSMDIS/ISMMODE,NSSMDIS,IB_SSM,IC_SSM, SSMDIS,SSMPDF,SSMCDF, *SSMMIN,SSMMAX,CDFSSM INTEGER ISMMODE,NSSMDIS,IB_SSM,IC_SSM REAL SSMDIS(200),SSMPDF(200),SSMCDF(200),SSMMIN,SSMMAX, CDFSSM(200 *0,2) SSMCDF(1)=SSMPDF(1) DO 5421 IB_SSM=2,NSSMDIS SSMCDF(IB_SSM)=SSMCDF(IB_SSM-1)+SSMPDF(IB_SSM)5421 CONTINUE5422 CONTINUE FNORM=1./SSMCDF(NSSMDIS) GRIDSZ=1/FLOAT(2000) DO 5431 IB_SSM=1,NSSMDIS SSMCDF(IB_SSM)=FNORM*SSMCDF(IB_SSM)5431 CONTINUE5432 CONTINUE DO 5441 K=1,2000 AK= FLOAT(K)*GRIDSZ DO 5451 I=1,NSSMDIS IF ((AK .LE. SSMCDF(I))) THEN GO TO 5460 END IF5451 CONTINUE5452 CONTINUE5460 IF ((I .NE. 1)) THEN CDFSSM(K,1)=SSMDIS(I-1) ELSE CDFSSM(K,1)=SSMMIN END IF CDFSSM(K,2)=SSMDIS(I)-CDFSSM(K,1)5441 CONTINUE5442 CONTINUE RETURN END ! Copyright National Research Council of Canada, 2000. ! All rights reserved. SUBROUTINE GET_INPUT IMPLICIT NONE ! Copyright National Research Council of Canada, 2000. ! All rights reserved. COMMON/GetInput/ ALLOWED_INPUTS(100,0:5), VALUES_SOUGHT(100), C *HAR_VALUE(100,100), VALUE(100,100), DEFAULT(100), VALUE_MIN(100 *), VALUE_MAX(100), NVALUE(100), TYPE(100), ERROR_FLAGS(100 *), i_errors, NMIN, NMAX, ERROR_FLAG, DELIMETER character ALLOWED_INPUTS*64,VALUES_SOUGHT*64, CHAR_VALUE*80,DELIME *TER*64 real*8 VALUE,DEFAULT,VALUE_MIN,VALUE_MAX integer*4 NVALUE,TYPE,NMIN,NMAX,ERROR_FLAG,ERROR_FLAGS,i_errors common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d
![Page 85: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/85.jpg)
*ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch CHARACTER*256 TEXT CHARACTER*256 KEEPTEXT CHARACTER*256 ORIGTEXT CHARACTER*80 TEXTPIECE CHARACTER*40 DELIM_START CHARACTER*40 DELIM_END CHARACTER*64 VNAME CHARACTER*64 VNAME1 integer*4 CURSOR integer*4 IINDEX integer*4 iVNAME integer*4 IVAL integer*4 UNITNUM integer*4 ERR integer*4 I,J,K,CHECK integer*4 LINE integer*4 INT_VALUE integer*4 INT_VALUE_MIN integer*4 INT_VALUE_MAX logical ALLOWED logical START_FOUND integer*4 ifound,length,lll,Kconvert integer*4 lnblnk1 logical IDEBUG character*1 blank integer*4 error_level integer*4 the_level data blank/' '/ data error_level/1/ save error_level IDEBUG = .false. ERROR_FLAG = 0 IF ((IDEBUG)) THEN WRITE(6,5470)NMIN,NMAX, 1005470 FORMAT(' Entering get_inputs seeking values', I5,' to', I5, ' *with a max allowed of',I5) END IF IF ((NMAX .LT. NMIN .OR. NMAX .GT. 100)) THEN WRITE(6,5480)NMAX, NMIN, 1005480 FORMAT(//' Error entering get_inputs: Asked for values from',I *5,' to',I5, ' with a max of',I5//' This implies a bug in the ca *lling routine'/ ' Fix it up and try again. Stopping now.') STOP END IF ERR=i_errors UNITNUM=i_input DELIM_START=':START '//DELIMETER(:lnblnk1(DELIMETER))//':' DELIM_END=':STOP '//DELIMETER(:lnblnk1(DELIMETER))//':'
![Page 86: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/86.jpg)
DO 5491 Kconvert=1,lnblnk1(DELIM_START) CURSOR=ICHAR(DELIM_START(Kconvert:Kconvert)) IF (((CURSOR.GE.97).AND.(CURSOR.LE.122))) THEN CURSOR=CURSOR-32 DELIM_START(Kconvert:Kconvert)=CHAR(CURSOR) END IF5491 CONTINUE5492 CONTINUE DO 5501 Kconvert=1,lnblnk1(DELIM_END) CURSOR=ICHAR(DELIM_END(Kconvert:Kconvert)) IF (((CURSOR.GE.97).AND.(CURSOR.LE.122))) THEN CURSOR=CURSOR-32 DELIM_END(Kconvert:Kconvert)=CHAR(CURSOR) END IF5501 CONTINUE5502 CONTINUE IF ((IDEBUG)) THEN WRITE(6,5510)DELIM_START,DELIM_END5510 FORMAT(' start and stop delimeters are:'/ A/A/) END IF DO 5521 I=NMIN,NMAX REWIND (UNITNUM) LINE=0 CHECK=0 ERROR_FLAGS(I)=0 IF ((TYPE(I) .EQ. 0 .OR. TYPE(I) .EQ. 1)) THEN VALUE(I,1) = DEFAULT(I) END IF IF ((TYPE(I) .EQ. 3)) THEN VALUE(I,1) = 0 END IF VNAME=VALUES_SOUGHT(I) iVNAME=lnblnk1(VNAME) IF (( ivname .LT. 1 )) THEN IF (( error_level .GT. 0 )) THEN write(ERR,*) ' ======================= Warning ======= *============== ' write(ERR,*) ' Empty VALUES_SOUGHT passt to Get_Inp *uts()! ' write(ERR,*) ' ======================================= *============== ' END IF ERROR_FLAG=1 ERROR_FLAGS(I)=1 goto 5530 END IF DO 5541 Kconvert=1,lnblnk1(vname) CURSOR=ICHAR(vname(Kconvert:Kconvert)) IF (((CURSOR.GE.97).AND.(CURSOR.LE.122))) THEN CURSOR=CURSOR-32 vname(Kconvert:Kconvert)=CHAR(CURSOR) END IF5541 CONTINUE5542 CONTINUE iindex = 0 IF ((DELIMETER .EQ. 'NONE')) THEN start_found = .true. ELSE
![Page 87: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/87.jpg)
start_found = .false. END IF5551 IF(iindex.NE.0)GO TO 55525560 CONTINUE LINE=LINE+1 IF (( start_found )) THEN READ(UNITNUM,END=5570,ERR=5580,FMT='(A256)') TEXT ELSE READ(UNITNUM,END=5590,ERR=5580,FMT='(A256)') TEXT END IF length = len(text)5601 IF(index(text,blank).NE.1)GO TO 5602 length = length - 1 IF (( length .GE. 2 )) THEN text=text(2:) ELSE GO TO5602 END IF GO TO 56015602 CONTINUE ifound = INDEX(text,'#') IF (( ifound .GT. 1 )) THEN text = text(1:ifound-1) ELSE IF (( ifound .EQ. 1 )) THEN text = blank END IF END IF ifound = INDEX(text,';') IF (( ifound .GT. 1 )) THEN text = text(1:ifound-1) ELSE IF (( ifound .EQ. 1 )) THEN text = blank END IF END IF length = lnblnk1(TEXT) TEXT=TEXT(:length) origtext = text(:length) DO 5611 Kconvert=1,lnblnk1(text) CURSOR=ICHAR(text(Kconvert:Kconvert)) IF (((CURSOR.GE.97).AND.(CURSOR.LE.122))) THEN CURSOR=CURSOR-32 text(Kconvert:Kconvert)=CHAR(CURSOR) END IF5611 CONTINUE5612 CONTINUE IF (( .NOT.start_found )) THEN IF ((INDEX(TEXT,DELIM_START) .NE. 0 )) THEN start_found = .true. END IF goto 5560 END IF iindex=INDEX(TEXT,VNAME(:iVNAME)) IF (( DELIMETER.NE.'NONE' )) THEN IF ((INDEX(TEXT,DELIM_END).NE.0)) THEN IF (( error_level .GT. 0 )) THEN WRITE (ERR,*) '***************ERROR***********
![Page 88: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/88.jpg)
*****' WRITE (ERR,*) '>>',VALUES_SOUGHT(I)(:lnblnk1(V * ALUES_SOUGHT(I))), '<<',' NOT FOUND' WRITE (ERR,*) 'END OF DELIMETER: ',DELIMETER(: * lnblnk1(DELIMETER)) END IF ERROR_FLAG=1 ERROR_FLAGS(I)=1 GOTO 5530 END IF END IF GO TO 55515552 CONTINUE CHECK=0 IF (( idebug )) THEN write(i_log,*) ' ******* Found: ' write(i_log,'(a,$)') ' text: ' length = lnblnk1(text) IF (( length .GT. 0 )) THEN DO 5621 lll=1,length write(i_log,'(a1,$)') text(lll:lll)5621 CONTINUE5622 CONTINUE write(i_log,*) END IF write(i_log,'(a,$)') ' origtext: ' length = lnblnk1(origtext) IF (( length .GT. 0 )) THEN DO 5631 lll=1,length write(i_log,'(a1,$)') origtext(lll:lll)5631 CONTINUE5632 CONTINUE write(i_log,*) END IF END IF IINDEX=IINDEX+iVNAME TEXT=TEXT(IINDEX:) origtext=origtext(iindex:) IF (( idebug )) THEN write(i_log,*) ' After removing vname: ' write(i_log,'(a,$)') ' text: ' length = lnblnk1(text) IF (( length .GT. 0 )) THEN DO 5641 lll=1,length write(i_log,'(a1,$)') text(lll:lll)5641 CONTINUE5642 CONTINUE write(i_log,*) END IF write(i_log,'(a,$)') ' origtext: ' length = lnblnk1(origtext) IF (( length .GT. 0 )) THEN DO 5651 lll=1,length write(i_log,'(a1,$)') origtext(lll:lll)5651 CONTINUE5652 CONTINUE write(i_log,*) END IF
![Page 89: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/89.jpg)
END IF IINDEX=INDEX(TEXT,'=') IF ((IINDEX.NE.0)) THEN TEXT=TEXT(IINDEX+1:) origtext=origtext(iindex+1:) ELSE IINDEX=INDEX(TEXT,':') IF ((IINDEX.NE.0)) THEN TEXT=TEXT(IINDEX+1:) origtext=origtext(iindex+1:) END IF END IF IF (( idebug )) THEN write(i_log,*) ' After removing leading equals: ' write(i_log,'(a,$)') ' text: ' length = lnblnk1(text) IF (( length .GT. 0 )) THEN DO 5661 lll=1,length write(i_log,'(a1,$)') text(lll:lll)5661 CONTINUE5662 CONTINUE write(i_log,*) END IF write(i_log,'(a,$)') ' origtext: ' length = lnblnk1(origtext) IF (( length .GT. 0 )) THEN DO 5671 lll=1,length write(i_log,'(a1,$)') origtext(lll:lll)5671 CONTINUE5672 CONTINUE write(i_log,*) END IF END IF IF (( (lnblnk1(TEXT).EQ.0) .OR. (lnblnk1(TEXT).EQ.1) )) THEN IF ((vname(:ivname).EQ.'TITLE')) THEN READ (UNITNUM,FMT='(A80)') TEXTPIECE IF ((lnblnk1(TEXTPIECE).NE.0)) THEN TEXT=TEXTPIECE(:lnblnk1(TEXTPIECE)) length = len(text)5681 IF(index(text,blank).NE.1)GO TO 5682 length = length - 1 IF (( length .GE. 2 )) THEN text=text(2:) ELSE GO TO5682 END IF GO TO 56815682 CONTINUE length = len(origtext)5691 IF(index(origtext,blank).NE.1)GO TO 5692 length = length - 1 IF (( length .GE. 2 )) THEN origtext=origtext(2:) ELSE GO TO5692 END IF GO TO 56915692 CONTINUE
![Page 90: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/90.jpg)
GOTO 5700 END IF END IF IF (( error_level .GT. 0 )) THEN WRITE (ERR,*) '*************ERROR*************' WRITE (ERR,*) 'VALUE SOUGHT: ',VALUES_SOUGHT(I) WRITE (ERR,*) 'VALUE NOT THERE!!' END IF ERROR_FLAG=1 ERROR_FLAGS(I)=1 RETURN END IF5700 CONTINUE iindex = index(text,'DEFAULT') IF (( iindex .NE. 0 )) THEN IF (( type(i) .NE. 2 )) THEN IF (( type(i) .NE. 3 )) THEN VALUE(I,1)=DEFAULT(I) ELSE VALUE(I,1)=0 END IF goto 5530 END IF END IF IF (((TYPE(I) .EQ. 0).OR.(TYPE(I) .EQ. 1))) THEN IVAL=1 IF (( idebug )) THEN write(i_log,*) ' *** Reading an integer or a real valu *e! ' END IF5711 CONTINUE IF (( idebug )) THEN write(i_log,*) ' In LOOP, ival = ',ival END IF IF ((lnblnk1(TEXT).EQ.0)) THEN IF (( error_level .GT. 0 )) THEN WRITE(ERR,*) '*************ERROR*************' WRITE (ERR,*) 'VALUE SOUGHT: ',VALUES_SOUGHT(I * ) WRITE (ERR,*) 'VALUE NOT THERE!!' END IF ERROR_FLAG=1 ERROR_FLAGS(I)=1 RETURN END IF READ(TEXT,END=5720,ERR=5730,FMT=*) VALUE(I,IVAL) IF (( idebug )) THEN write(i_log,*) ' Read value: ',ival,VALUE(I,IVAL) END IF IF (((VALUE(I,IVAL).GT.VALUE_MAX(I)).OR.(VALUE(I,IVAL) * .LT.VALUE_MIN(I)))) THEN IF ((TYPE(I).EQ.0)) THEN INT_VALUE=DEFAULT(I) IF (( error_level .GT. 0 )) THEN WRITE(ERR,*) '************WARNING********* ****' WRITE(ERR,5740) INT_VALUE, VALUES_SOUGHT(I * )(:lnblnk1(VALUES_SOUGHT(I)))
![Page 91: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/91.jpg)
END IF5740 FORMAT ( 'Default= ',I9,' used for: ', A ) INT_VALUE=VALUE(I,IVAL) INT_VALUE_MIN=VALUE_MIN(I) INT_VALUE_MAX=VALUE_MAX(I) IF (( error_level .GT. 0 )) THEN WRITE(ERR,5750) VALUES_SOUGHT(I)(:lnblnk1( * VALUES_SOUGHT(I))), INT_VALUE, INT_VALUE_M * IN,INT_VALUE_MAX END IF5750 FORMAT (A,'=', I9,' should be between ', I9,'a *nd ', I9) END IF IF ((TYPE(I).EQ.1)) THEN IF (( error_level .GT. 0 )) THEN WRITE(ERR,*) '************WARNING********* ****' WRITE(ERR,5760) DEFAULT(I), VALUES_SOUGHT( * I)(:lnblnk1(VALUES_SOUGHT(I)))5760 FORMAT ( 'Default= ',F12.6,' used for: ',A * ) WRITE(ERR,5770) VALUES_SOUGHT(I)(:lnblnk1( * VALUES_SOUGHT(I))), VALUE(I,IVAL), VALUE_M * IN(I),VALUE_MAX(I)5770 FORMAT (A,'=', F12.6,' should be between ' *, G14.6,' and ', G14.6) END IF END IF VALUE(I,IVAL)=DEFAULT(I) END IF IF((IVAL .EQ. NVALUE(I)))GO TO5712 IF (((INDEX(TEXT,',').NE.0).OR.(lnblnk1(TEXT).EQ.0))) * THEN IF (( idebug )) THEN write(i_log,*) ' A comma or a blank text found * -> ' write(i_log,*) ' searching for further input' END IF TEXT=TEXT(INDEX(TEXT,',')+1:)5781 IF(lnblnk1(TEXT).NE.0)GO TO 5782 IF (( idebug )) THEN write(i_log,*) ' Empty text -> reading nex *t line! ' END IF LINE=LINE+1 READ (UNITNUM,END=5720,ERR=5730,FMT='(A256)') * TEXT length = len(text)5791 IF(index(text,blank).NE.1)GO TO 5792 length = length - 1 IF (( length .GE. 2 )) THEN text=text(2:) ELSE GO TO5792 END IF GO TO 57915792 CONTINUE ifound = INDEX(text,'#')
![Page 92: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/92.jpg)
IF (( ifound .GT. 1 )) THEN text = text(1:ifound-1) ELSE IF (( ifound .EQ. 1 )) THEN text = blank END IF END IF ifound = INDEX(text,';') IF (( ifound .GT. 1 )) THEN text = text(1:ifound-1) ELSE IF (( ifound .EQ. 1 )) THEN text = blank END IF END IF length = lnblnk1(TEXT) TEXT=TEXT(:length) origtext = text(:length) DO 5801 Kconvert=1,lnblnk1(text) CURSOR=ICHAR(text(Kconvert:Kconvert)) IF (((CURSOR.GE.97).AND.(CURSOR.LE.122))) * THEN CURSOR=CURSOR-32 text(Kconvert:Kconvert)=CHAR(CURSOR) END IF5801 CONTINUE5802 CONTINUE DO 5811 K=1,NMAX vname1 = VALUES_SOUGHT(K) length = lnblnk1(vname1) IF (( length .GT. 0 )) THEN length = len(vname1)5821 IF(index(vname1,blank).NE.1)GO TO 5822 length = length - 1 IF (( length .GE. 2 )) THEN vname1=vname1(2:) ELSE GO TO5822 END IF GO TO 58215822 CONTINUE DO 5831 Kconvert=1,lnblnk1(vname1) CURSOR=ICHAR(vname1(Kconvert:Kconv * ert)) IF (((CURSOR.GE.97).AND.(CURSOR.LE * .122))) THEN CURSOR=CURSOR-32 vname1(Kconvert:Kconvert)=CHAR * (CURSOR) END IF5831 CONTINUE5832 CONTINUE IF ((INDEX(TEXT,vname1(:length)).NE.0) * ) THEN IF (( error_level .GT. 0 )) THEN WRITE(ERR,*) '************ERRO *R************' WRITE(ERR,*) 'VALUE SOUGHT: ',
![Page 93: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/93.jpg)
* VALUES_SOUGHT(I) WRITE(ERR,*) KEEPTEXT(:lnblnk1 * (KEEPTEXT)), '<--COMMA INDICAT *ES ANOTHER INPUT' WRITE(ERR,*) 'SEARCHED NEXT LI *NE: ', TEXT(:lnblnk1(TEXT)) WRITE(ERR,*) 'BUT NO OTHER INP *UT WAS DETECTED' END IF ERROR_FLAG=1 ERROR_FLAGS(I)=1 END IF END IF5811 CONTINUE5812 CONTINUE IF (( idebug )) THEN write(i_log,*) ' Next line: ' write(i_log,'(a,$)') ' text: ' length = lnblnk1(text) IF (( length .GT. 0 )) THEN DO 5841 lll=1,length write(i_log,'(a1,$)') text(lll:lll * )5841 CONTINUE5842 CONTINUE write(i_log,*) END IF write(i_log,'(a,$)') ' origtext: ' length = lnblnk1(origtext) IF (( length .GT. 0 )) THEN DO 5851 lll=1,length write(i_log,'(a1,$)') origtext(lll * :lll)5851 CONTINUE5852 CONTINUE write(i_log,*) END IF END IF GO TO 57815782 CONTINUE ELSE GO TO5712 END IF IVAL=IVAL+1 GO TO 57115712 CONTINUE IF (((NVALUE(I).NE.0).AND.(NVALUE(I).NE.IVAL))) THEN IF (( error_level .GT. 0 )) THEN WRITE (ERR,*) '**************ERROR**************' WRITE (ERR,*) 'VALUE SOUGHT: ', VALUES_SOUGHT(I) WRITE (ERR,*) 'ASKED FOR', NVALUE(I),' NUMERICAL I *NPUT(S)' WRITE (ERR,*) 'HOWEVER,', IVAL, ' WERE DETECTED' END IF ERROR_FLAG=1 ERROR_FLAGS(I)=1 ELSE NVALUE(I)=IVAL
![Page 94: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/94.jpg)
END IF5720 CONTINUE END IF IF (((TYPE(I) .EQ. 2) .OR. (TYPE(I) .EQ. 3))) THEN IVAL=1 IF (( idebug )) THEN write(i_log,*) ' Trying to read a string! ' END IF5861 CONTINUE IF (( idebug )) THEN write(i_log,*) ' In LOOP, ival = ',ival END IF IF ((lnblnk1(TEXT).EQ.0)) THEN IF (( error_level .GT. 0 )) THEN WRITE(ERR,*) '*************ERROR*************' WRITE (ERR,*) 'VALUE SOUGHT: ',VALUES_SOUGHT(I * ) WRITE (ERR,*) 'VALUE NOT THERE!!' END IF ERROR_FLAG=1 ERROR_FLAGS(I)=1 RETURN END IF IF ((vname(:ivname).EQ.'TITLE')) THEN TEXTPIECE=origtext GOTO 5870 END IF iindex = INDEX(origtext,',') IF (( iindex .NE. 0 )) THEN TEXTPIECE=origtext(:iindex-1) ELSE TEXTPIECE=origtext END IF5870 CONTINUE READ(TEXTPIECE,ERR=5880,FMT='(A80)') CHAR_VALUE(I,IVAL * ) length = len(CHAR_VALUE(I,IVAL))5891 IF(index(CHAR_VALUE(I,IVAL),blank).NE.1)GO TO 5892 length = length - 1 IF (( length .GE. 2 )) THEN CHAR_VALUE(I,IVAL)=CHAR_VALUE(I,IVAL)(2:) ELSE GO TO5892 END IF GO TO 58915892 CONTINUE IF (( idebug )) THEN write(i_log,*) ' Read the following char string: ' length = lnblnk1(CHAR_VALUE(I,IVAL)) IF (( length .GT. 0 )) THEN DO 5901 lll=1,length write(i_log,'(a1,$)') CHAR_VALUE(I,IVAL)(l * ll:lll)5901 CONTINUE5902 CONTINUE write(i_log,*) END IF END IF
![Page 95: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/95.jpg)
IF ((TYPE(I) .EQ. 3)) THEN DO 5911 Kconvert=1,lnblnk1(CHAR_VALUE(I,IVAL)) CURSOR=ICHAR(CHAR_VALUE(I,IVAL)(Kconvert:Kconv * ert)) IF (((CURSOR.GE.97).AND.(CURSOR.LE.122))) THEN CURSOR=CURSOR-32 CHAR_VALUE(I,IVAL)(Kconvert:Kconvert)=CHAR * (CURSOR) END IF5911 CONTINUE5912 CONTINUE ALLOWED=.FALSE. DO 5921 K=0,5 vname1 = ALLOWED_INPUTS(I,K) length = len(ALLOWED_INPUTS(I,K))5931 IF(index(ALLOWED_INPUTS(I,K),blank).NE.1)GO TO * 5932 length = length - 1 IF (( length .GE. 2 )) THEN ALLOWED_INPUTS(I,K)=ALLOWED_INPUTS(I,K * )(2:) ELSE GO TO5932 END IF GO TO 59315932 CONTINUE DO 5941 Kconvert=1,lnblnk1(ALLOWED_INPUTS(I,K) * ) CURSOR=ICHAR(ALLOWED_INPUTS(I,K)(Kconvert: * Kconvert)) IF (((CURSOR.GE.97).AND.(CURSOR.LE.122))) * THEN CURSOR=CURSOR-32 ALLOWED_INPUTS(I,K)(Kconvert:Kconvert) * =CHAR(CURSOR) END IF5941 CONTINUE5942 CONTINUE IF ((ALLOWED_INPUTS(I,K).EQ.CHAR_VALUE(I,IVAL) * )) THEN ALLOWED=.TRUE. VALUE(I,IVAL)=K IF (( idebug )) THEN write(i_log,*) ' Found a allowed_value * match ',k END IF END IF5921 CONTINUE5922 CONTINUE IF ((.NOT.ALLOWED)) THEN WRITE(ERR,*) '*************ERROR*************' IF ((IVAL.NE.1)) THEN WRITE (ERR,*) 'VALUE SOUGHT: ',VALUES_SOUG * HT(I) WRITE (ERR,*) 'SHOULD HAVE ONE INPUT ONLY' WRITE (ERR,*) 'APPARENT STATE: COMMA INDIC *ATING SECOND VALUE' ELSE
![Page 96: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/96.jpg)
WRITE (ERR,*) 'VALUE SOUGHT: ',VALUES_SOUG * HT(I) WRITE(ERR,*) 'INPUT-->', CHAR_VALUE(I,IVAL * )(:lnblnk1(CHAR_VALUE(I,IVAL))), '<--NOT A *LLOWED' WRITE(ERR,*) 'OPTIONS ARE:' WRITE(ERR,5950) (ALLOWED_INPUTS(I,K)(:lnbl * nk1(ALLOWED_INPUTS(I,K))),K=0,5) END IF5950 FORMAT(A40) ERROR_FLAG=1 ERROR_FLAGS(I)=1 END IF END IF IF ((vname(:ivname).EQ.'TITLE')) THEN GO TO5862 END IF DO 5961 K=1,LEN(KEEPTEXT) KEEPTEXT(K:K)=' '5961 CONTINUE5962 CONTINUE KEEPTEXT(:lnblnk1(TEXT))=TEXT iindex = INDEX(TEXT,',') IF (( iindex .NE. 0 .OR. lnblnk1(TEXT).EQ.0 )) THEN TEXT=TEXT(INDEX(TEXT,',')+1:) origtext=origtext(iindex+1:)5971 IF(lnblnk1(TEXT).NE.0)GO TO 5972 LINE=LINE+1 READ (UNITNUM,ERR=5880,FMT='(A256)') TEXT length = len(text)5981 IF(index(text,blank).NE.1)GO TO 5982 length = length - 1 IF (( length .GE. 2 )) THEN text=text(2:) ELSE GO TO5982 END IF GO TO 59815982 CONTINUE ifound = INDEX(text,'#') IF (( ifound .GT. 1 )) THEN text = text(1:ifound-1) ELSE IF (( ifound .EQ. 1 )) THEN text = blank END IF END IF ifound = INDEX(text,';') IF (( ifound .GT. 1 )) THEN text = text(1:ifound-1) ELSE IF (( ifound .EQ. 1 )) THEN text = blank END IF END IF length = lnblnk1(TEXT) TEXT=TEXT(:length) origtext = text(:length)
![Page 97: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/97.jpg)
DO 5991 Kconvert=1,lnblnk1(text) CURSOR=ICHAR(text(Kconvert:Kconvert)) IF (((CURSOR.GE.97).AND.(CURSOR.LE.122))) * THEN CURSOR=CURSOR-32 text(Kconvert:Kconvert)=CHAR(CURSOR) END IF5991 CONTINUE5992 CONTINUE DO 6001 K=1,NMAX vname1 = VALUES_SOUGHT(K) length = lnblnk1(vname1) IF (( length .GT. 0 )) THEN length = len(vname1)6011 IF(index(vname1,blank).NE.1)GO TO 6012 length = length - 1 IF (( length .GE. 2 )) THEN vname1=vname1(2:) ELSE GO TO6012 END IF GO TO 60116012 CONTINUE DO 6021 Kconvert=1,lnblnk1(vname1) CURSOR=ICHAR(vname1(Kconvert:Kconv * ert)) IF (((CURSOR.GE.97).AND.(CURSOR.LE * .122))) THEN CURSOR=CURSOR-32 vname1(Kconvert:Kconvert)=CHAR * (CURSOR) END IF6021 CONTINUE6022 CONTINUE IF ((INDEX(TEXT,vname1(:length)).NE.0) * ) THEN WRITE(ERR,*) '************ERROR*** **********' WRITE(ERR,*) 'VALUE SOUGHT: ',VALU * ES_SOUGHT(I) WRITE(ERR,*) KEEPTEXT(:lnblnk1(KEE * PTEXT)), '<--COMMA INDICATES ANOTH *ER INPUT' WRITE(ERR,*) 'SEARCHED NEXT LINE: *', TEXT(:lnblnk1(TEXT)) WRITE(ERR,*) 'BUT NO OTHER INPUT W *AS DETECTED' ERROR_FLAG=1 ERROR_FLAGS(I)=1 END IF END IF6001 CONTINUE6002 CONTINUE GO TO 59715972 CONTINUE ELSE GO TO5862 END IF
![Page 98: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/98.jpg)
IVAL=IVAL+1 GO TO 58615862 CONTINUE IF (((NVALUE(I).NE.0).AND.(NVALUE(I).NE.IVAL))) THEN IF (( error_level .GT. 0 )) THEN WRITE (ERR,*) '*******************ERROR*********** *********' WRITE (ERR,*) 'VALUE SOUGHT: ', VALUES_SOUGHT(I) WRITE (ERR,*) 'ASKED FOR', NVALUE(I),' INPUT(S)' WRITE (ERR,*) 'HOWEVER,', IVAL, ' WERE DETECTED' END IF ERROR_FLAG=1 ERROR_FLAGS(I)=1 ELSE NVALUE(I)=IVAL END IF END IF goto 55305570 IF (( error_level .GT. 0 )) THEN WRITE (ERR,*) '******************ERROR******************** ****' WRITE (ERR,*) 'END OF FILE REACHED BUT VALUE SOUGHT NOT FO *UND' WRITE (ERR,*) 'PROBABLY A MISSING/MISSPELLED END DELIMETER *' WRITE (ERR,*) 'VALUE SOUGHT: >>', VALUES_SOUGHT(I)(:lnblnk * 1(VALUES_SOUGHT(I))),'<<' WRITE (ERR,*) 'END DELIMETER: >>', DELIM_END(:lnblnk1(DELI * M_END)),'<<' END IF ERROR_FLAG=1 ERROR_FLAGS(I)=1 goto 55305590 IF (( error_level .GT. 0 )) THEN WRITE (ERR,*) '******************ERROR******************** ****' WRITE (ERR,*) 'END OF FILE REACHED BUT VALUE SOUGHT NOT FO *UND' WRITE (ERR,*) 'PROBABLY A MISSING/MISSPELLED START DELIMET *ER' WRITE (ERR,*) 'VALUE SOUGHT: >>', VALUES_SOUGHT(I)(:lnblnk * 1(VALUES_SOUGHT(I))),'<<' WRITE (ERR,*) 'START DELIMETER: >>', DELIM_START(:lnblnk1( * DELIM_START)),'<<' END IF ERROR_FLAG=1 ERROR_FLAGS(I)=1 goto 55305730 IF (( error_level .GT. 0 )) THEN WRITE (ERR,*) '***************ERROR***************' IF ((IVAL.GT.1)) THEN J=IVAL ELSE J=1 END IF WRITE (ERR,*) 'ERROR READING VALUE SOUGHT: ', VALUES_SOUGH * T(I) WRITE (ERR,*) 'LINE #',LINE
![Page 99: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/99.jpg)
WRITE (ERR,*) 'COULD NOT READ THE VALUE!!' WRITE (ERR,*) 'SHOULD BE AN INTEGER OR A REAL...' WRITE (ERR,*) 'IS THERE AN EXTRA COMMA AT THE END OF YOUR *INPUT?' END IF ERROR_FLAG=1 ERROR_FLAGS(I)=1 GOTO 55305880 IF (( error_level .GT. 0 )) THEN WRITE (ERR,*) '***************ERROR***************' WRITE (ERR,*) 'ERROR READING VALUE SOUGHT: ', VALUES_SOUGH * T(I) WRITE (ERR,*) 'LINE #',LINE WRITE (ERR,*) 'COULD NOT READ THE STRING !!' END IF ERROR_FLAG=1 ERROR_FLAGS(I)=15530 CONTINUE5521 CONTINUE5522 CONTINUE RETURN5580 WRITE (ERR,*) '***************ERROR***************' WRITE (ERR,*) 'ERROR READING TEXT ', TEXT,' ON LINE ',LINE goto 60306030 CONTINUE ERROR_FLAG=1 ERROR_FLAGS(I)=1 RETURN entry get_input_set_error_level(the_level) error_level = the_level return END subroutine get_transport_parameter(ounit) implicit none character*80 line character*512 toUpper integer*4 ounit COMMON/GetInput/ ALLOWED_INPUTS(100,0:5), VALUES_SOUGHT(100), C *HAR_VALUE(100,100), VALUE(100,100), DEFAULT(100), VALUE_MIN(100 *), VALUE_MAX(100), NVALUE(100), TYPE(100), ERROR_FLAGS(100 *), i_errors, NMIN, NMAX, ERROR_FLAG, DELIMETER character ALLOWED_INPUTS*64,VALUES_SOUGHT*64, CHAR_VALUE*80,DELIME *TER*64 real*8 VALUE,DEFAULT,VALUE_MIN,VALUE_MAX integer*4 NVALUE,TYPE,NMIN,NMAX,ERROR_FLAG,ERROR_FLAGS,i_errors COMMON/BOUNDS/ECUT,PCUT,VACDST real*8 ECUT, PCUT, VACDST common/ET_control/ SMAXIR,estepe,ximax, skindepth_for_bca,transpo *rt_algorithm, bca_algorithm,exact_bca,spin_effects real*8 smaxir, estepe, ximax, skindepth_for_bca integer*4 transport_algorithm, bca_algorithm logical exact_bca, spin_effects COMMON/EDGE/binding_energies(6,100), interaction_prob(6,100), rela *xation_prob(39,100), edge_energies(16,100), edge_number(100), edge *_a(16,100), edge_b(16,100), edge_c(16,100), edge_d(16,100), IEDGFL *,IPHTER real*8 binding_energies, interaction_prob, relaxation_prob, e *dge_energies, edge_a,edge_b,edge_c,edge_d
![Page 100: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/100.jpg)
integer*2 IEDGFL, IPHTER integer*4 edge_number common/compton_data/ iz_array(1538), be_array(1538), Jo_array(15 *38), erfJo_array(1538), ne_array(1538), shn_array(1538), *shell_array(100,7), eno_array(100,7), eno_atbin_array(100,7), n_sh *ell(7), radc_flag, ibcmp integer*4 iz_array,ne_array,shn_array,eno_atbin_array, shell_array *,n_shell,radc_flag real*8 be_array,Jo_array,erfJo_array,eno_array integer*2 ibcmp COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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( 2097154),MED( 2097154),IRAYLR real*8 DUNIT, RHOR integer*4 KMPI, KMPO integer*2 MED, IRAYLR COMMON/BREMPR/ DL1(8,7),DL2(8,7),DL3(8,7),DL4(8,7),DL5(8,7),DL6(8, *7), ALPHI(2,7),BPAR(2,7),DELPOS(2,7), WA(7,50),PZ(7,50),ZELEM(7,50 *),RHOZ(7,50), PWR2I(50), DELCM(7),ZBRANG(7),LZBRANG(7),NNE(7), IBR *DST,IPRDST,ibr_nist,pair_nrc,itriplet, ASYM(7,50,2) CHARACTER*4 ASYM real*8 DL1,DL2,DL3,DL4,DL5,DL6, ALPHI, BPAR, DELPOS, WA, PZ, * ZELEM, RHOZ, PWR2I, DELCM, ZBRANG, LZBRANG integer*4 NNE, IBRDST, IPRDST, ibr_nist, itriplet, pair_nrc common/eii_data/ eii_xsection_a( 10000), eii_xsection_b( 10000), * eii_cons(7), eii_a(40), eii_b(40), eii_z(40), eii_sh(40), eii *_nshells(100), eii_nsh(7), eii_first(7,50), eii_no(7,50), eii_ *flag real*8 eii_xsection_a,eii_xsection_b,eii_a,eii_b,eii_cons integer*4 eii_z,eii_sh,eii_nshells integer*4 eii_first,eii_no integer*4 eii_elements,eii_flag,eii_nsh common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch COMMON/rayleigh_inputs/iray_ff_media(7),iray_ff_file(7) character*24 iray_ff_media character*128 iray_ff_file integer*4 ival,num_ecut,num_pcut,num_smax,num_incoh,num_radc,num_c *oh,num_relax, num_pe_ang,num_brems_ang,num_brems_cs,num_pair_cs, n *um_ffmed,num_ffiles, num_pair_ang,num_eii,num_estepe,num_ximax,num
![Page 101: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/101.jpg)
*_triplet,num_pxsec, num_pxsec_out, num_cxsec, num_spin,num_bca,num *_alg,num_skin,itmp,iitmp,i,j,k,istart,iend, egs_open_file,lnblnk1 logical ecut_inregions,pcut_inregions,smax_inregions, incoh_inregi *ons,coh_inregions,relax_inregions, pe_inregions,aux_inregions character*15 output_strings(13) save output_strings,line save ecut_inregions,pcut_inregions,smax_inregions, incoh_inregions *,coh_inregions,relax_inregions, pe_inregions,aux_inregions DO 6041 k=1,80 line(k:k) = '='6041 CONTINUE6042 CONTINUE delimeter = 'MC TRANSPORT PARAMETER' ival = 0 ecut_inregions=.false. pcut_inregions=.false. smax_inregions=.false. incoh_inregions=.false. coh_inregions=.false. relax_inregions=.false. pe_inregions=.false. aux_inregions=.false. i_errors=15 i_errors=egs_open_file(i_errors,0,1,'.errors') write(i_errors,*) ' If you are not trying to reset transport param *eters, ' write(i_errors,*) ' ignore all the output until the message ' write(i_errors,*) ' ******************** end input transport param *eter *********************** ' write(i_errors,*) ival = ival + 1 num_ecut = ival values_sought(ival) = 'Global ECUT' nvalue(ival) = 1 type(ival) = 1 value_min(ival) = 0 value_max(ival) = 1e15 default(ival) = 0. ival = ival + 1 num_pcut = ival values_sought(ival) = 'Global PCUT' nvalue(ival) = 1 type(ival) = 1 value_min(ival) = 0 value_max(ival) = 1e15 default(ival) = 0. ival = ival + 1 num_smax = ival values_sought(ival) = 'Global SMAX' nvalue(ival) = 1 type(ival) = 1 value_min(ival) = 0 value_max(ival) = 1e15 default(ival) = 1e10 ival = ival + 1 num_incoh = ival values_sought(ival) = 'Bound Compton scattering' nvalue(ival) = 1
![Page 102: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/102.jpg)
type(ival) = 3 allowed_inputs(ival,0) = 'Off' allowed_inputs(ival,1) = 'On' allowed_inputs(ival,2) = 'On in Regions' allowed_inputs(ival,3) = 'Off in Regions' allowed_inputs(ival,4) = 'Simple' allowed_inputs(ival,5) = 'norej' ival = ival + 1 num_radc = ival values_sought(ival) = 'Radiative Compton corrections' nvalue(ival) = 1 type(ival) = 3 allowed_inputs(ival,0) = 'Off' allowed_inputs(ival,1) = 'On' ival = ival + 1 num_coh = ival values_sought(ival) = 'Rayleigh scattering' nvalue(ival) = 1 type(ival) = 3 allowed_inputs(ival,0) = 'Off' allowed_inputs(ival,1) = 'On' allowed_inputs(ival,2) = 'On in Regions' allowed_inputs(ival,3) = 'Off in Regions' allowed_inputs(ival,4) = 'custom' ival = ival + 1 num_relax = ival values_sought(ival) = 'Atomic relaxations' nvalue(ival) = 1 type(ival) = 3 allowed_inputs(ival,0) = 'Off' allowed_inputs(ival,1) = 'On' allowed_inputs(ival,2) = 'On in Regions' allowed_inputs(ival,3) = 'Off in Regions' ival = ival + 1 num_pe_ang = ival values_sought(ival) = 'Photoelectron angular sampling' nvalue(ival) = 1 type(ival) = 3 allowed_inputs(ival,0) = 'Off' allowed_inputs(ival,1) = 'On' allowed_inputs(ival,2) = 'On in Regions' allowed_inputs(ival,3) = 'Off in Regions' ival = ival + 1 num_brems_ang = ival values_sought(ival) = 'Brems angular sampling' nvalue(ival) = 1 type(ival) = 3 allowed_inputs(ival,0) = 'Simple' allowed_inputs(ival,1) = 'KM' ival = ival + 1 num_brems_cs = ival values_sought(ival) = 'Brems cross sections' nvalue(ival) = 1 type(ival) = 3 allowed_inputs(ival,0) = 'BH' allowed_inputs(ival,1) = 'NIST' allowed_inputs(ival,2) = 'NRC' ival = ival + 1
![Page 103: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/103.jpg)
num_pair_ang = ival values_sought(ival) = 'Pair angular sampling' nvalue(ival) = 1 type(ival) = 3 allowed_inputs(ival,0) = 'Off' allowed_inputs(ival,1) = 'Simple' allowed_inputs(ival,2) = 'KM' allowed_inputs(ival,3) = 'Uniform' allowed_inputs(ival,4) = 'Blend' ival = ival + 1 num_pair_cs = ival values_sought(ival) = 'Pair cross sections' nvalue(ival) = 1 type(ival) = 3 allowed_inputs(ival,0) = 'BH' allowed_inputs(ival,1) = 'NRC' ival = ival + 1 num_triplet = ival values_sought(ival) = 'Triplet production' nvalue(ival) = 1 type(ival) = 3 allowed_inputs(ival,0) = 'Off' allowed_inputs(ival,1) = 'On' ival = ival + 1 num_spin = ival values_sought(ival) = 'Spin effects' nvalue(ival) = 1 type(ival) = 3 allowed_inputs(ival,0) = 'Off' allowed_inputs(ival,1) = 'On' ival = ival + 1 num_eii = ival values_sought(ival) = 'Electron Impact Ionization' nvalue(ival) = 1 type(ival) = 2 ival = ival + 1 num_estepe = ival values_sought(ival) = 'ESTEPE' nvalue(ival) = 1 type(ival) = 1 value_min(ival) = 1e-5 value_max(ival) = 1 default(ival) = 0.25 ival = ival + 1 num_ximax = ival values_sought(ival) = 'XImax' nvalue(ival) = 1 type(ival) = 1 value_min(ival) = 0 value_max(ival) = 1 default(ival) = 0.5 ival = ival + 1 num_bca = ival values_sought(ival) = 'Boundary crossing algorithm' nvalue(ival) = 1 type(ival) = 3 allowed_inputs(ival,0) = 'Exact' allowed_inputs(ival,1) = 'PRESTA-I'
![Page 104: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/104.jpg)
ival = ival + 1 num_skin = ival values_sought(ival) = 'Skin depth for BCA' nvalue(ival) = 1 type(ival) = 1 value_min(ival) = -1 value_max(ival) = 1e15 default(ival) = 3 ival = ival + 1 num_alg = ival values_sought(ival) = 'Electron-step algorithm' nvalue(ival) = 1 type(ival) = 3 allowed_inputs(ival,0) = 'PRESTA-II' allowed_inputs(ival,1) = 'PRESTA-I' ival = ival + 1 num_pxsec = ival values_sought(ival) = 'Photon cross sections' nvalue(ival) = 1 type(ival) = 2 ival = ival + 1 num_pxsec_out = ival values_sought(ival) = 'Photon cross-sections output' nvalue(ival) = 1 type(ival) = 3 allowed_inputs(ival,0) = 'Off' allowed_inputs(ival,1) = 'On' ival = ival + 1 num_cxsec = ival values_sought(ival) = 'Compton cross sections' nvalue(ival) = 1 type(ival) = 2 Nmin = num_ecut Nmax = num_cxsec CALL GET_INPUT IF (( error_flags(num_ecut) .EQ. 0 )) THEN DO 6051 j=1, 2097154 ECUT = value(num_ecut,1)6051 CONTINUE6052 CONTINUE END IF IF (( error_flags(num_pcut) .EQ. 0 )) THEN DO 6061 j=1, 2097154 PCUT = value(num_pcut,1)6061 CONTINUE6062 CONTINUE END IF IF (( error_flags(num_smax) .EQ. 0 )) THEN DO 6071 j=1, 2097154 SMAXIR = value(num_smax,1)6071 CONTINUE6072 CONTINUE END IF IF (( error_flags(num_brems_ang) .EQ. 0 )) THEN ibrdst = value(num_brems_ang,1) END IF IF (( error_flags(num_brems_cs) .EQ. 0 )) THEN ibr_nist = value(num_brems_cs,1)
![Page 105: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/105.jpg)
END IF IF (( error_flags(num_radc) .EQ. 0 )) THEN radc_flag = value(num_radc,1) END IF IF (( error_flags(num_pair_ang) .EQ. 0 )) THEN iprdst = value(num_pair_ang,1) END IF IF (( error_flags(num_pair_cs) .EQ. 0 )) THEN pair_nrc = value(num_pair_cs,1) END IF IF (( error_flags(num_triplet) .EQ. 0 )) THEN itriplet = value(num_triplet,1) END IF IF (( error_flags(num_estepe) .EQ. 0 )) THEN estepe = value(num_estepe,1) END IF IF (( error_flags(num_ximax) .EQ. 0 )) THEN ximax = value(num_ximax,1) END IF IF (( error_flags(num_bca) .EQ. 0 )) THEN bca_algorithm = value(num_bca,1) IF (( bca_algorithm .EQ. 0 )) THEN exact_bca = .true. END IF END IF IF (( error_flags(num_alg) .EQ. 0 )) THEN transport_algorithm = value(num_alg,1) END IF IF (( error_flags(num_skin) .EQ. 0 )) THEN skindepth_for_bca = value(num_skin,1) END IF IF (( error_flags(num_spin) .EQ. 0 )) THEN itmp = value(num_spin,1) IF (( itmp .EQ. 1 )) THEN spin_effects = .true. ELSE spin_effects = .false. END IF END IF IF (( error_flags(num_eii) .EQ. 0 )) THEN eii_xfile = char_value(num_eii,1) eii_flag=1 IF ((toUpper(eii_xfile(:lnblnk1(eii_xfile))).eq.'ON' .OR. toUp * per(eii_xfile(:lnblnk1(eii_xfile))).eq.'IK' )) THEN eii_xfile = 'ik' write(i_log,*) '==> Using default EII data compilation ', * eii_xfile(:lnblnk1(eii_xfile)) ELSE IF((toUpper(eii_xfile(:lnblnk1(eii_xfile))).eq.'OFF')) TH * EN eii_xfile='Off' eii_flag=0 ELSE write(i_log,'(/a)') '***************** Warning: ' write(i_log,*) '==> Using non-default EII data compilation * ', eii_xfile(:lnblnk1(eii_xfile)) END IF END IF IF (( error_flags(num_pxsec) .EQ. 0 )) THEN
![Page 106: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/106.jpg)
photon_xsections = char_value(num_pxsec,1) END IF IF (( error_flags(num_pxsec_out) .EQ. 0 )) THEN xsec_out = value(num_pxsec_out,1) END IF IF (( error_flags(num_cxsec) .EQ. 0 )) THEN comp_xsections = char_value(num_cxsec,1) END IF IF (( error_flags(num_coh) .EQ. 0 )) THEN IF ((value(num_coh,1) .EQ. 4)) THEN write(*,'(/a/)') ' ===> custom ff requested!' ival = ival + 1 num_ffmed = ival values_sought(ival) = 'ff media names' type(ival) = 2 nvalue(ival) = 0 ival = ival + 1 num_ffiles = ival values_sought(ival) = 'ff file names' type(ival) = 2 nvalue(ival) = 0 Nmin = num_ffmed Nmax = num_ffiles CALL GET_INPUT IF (( error_flags(num_ffmed) .GT. 0 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(a/,a,I3)') 'Error reading custom ff! Ter *minating ...', ' error_flag = ', error_flags(num_ffmed) write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF IF (( error_flags(num_ffiles) .GT. 0 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(a/,a,I3)') 'Error reading ff file names! * Terminating ...', ' error_flag = ', error_flags(num_ffiles) write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF IF ((nvalue(num_ffmed).GT.7)) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(a,a,i3,a)') '***** Number of media with *custom ff larger ', 'than maximum number of media $MXMED = ',7, ' *increase $MXMED and try again!!!' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF DO 6081 i=1,nvalue(num_ffmed) iray_ff_media(i) = char_value(num_ffmed,i) iray_ff_file(i) = char_value(num_ffiles,i)6081 CONTINUE6082 CONTINUE value(num_coh,1) = 1 END IF write(*,'(/)') END IF aux_inregions = .false. IF (( error_flags(num_incoh) .EQ. 0 )) THEN write(i_log,*) 'Bound Compton start region'
![Page 107: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/107.jpg)
itmp = value(num_incoh,1) IF (( itmp .EQ. 2 .OR. itmp .EQ. 3 )) THEN ival = ival + 1 values_sought(ival) = 'Bound Compton start region' nvalue(ival) = 0 type(ival) = 0 value_min(ival) = 1 value_max(ival) = 2097154 default(ival) = 1 ival = ival + 1 values_sought(ival) = 'Bound Compton stop region' nvalue(ival) = 0 type(ival) = 0 value_min(ival) = 1 value_max(ival) = 2097154 default(ival) = 1 Nmin = ival-1 Nmax = ival CALL GET_INPUT IF (( error_flags(ival-1) .EQ. 0 .AND. error_flags(ival) . * EQ. 0 )) THEN IF (( nvalue(ival) .EQ. nvalue(ival-1) )) THEN iitmp = itmp-2 DO 6091 j=1, 2097154 ibcmp = iitmp6091 CONTINUE6092 CONTINUE iitmp = 1 - iitmp DO 6101 k=1,nvalue(ival) istart = value(ival-1,k) iend = value(ival,k) IF (( istart .LE. iend )) THEN DO 6111 j=istart,iend ibcmp = iitmp6111 CONTINUE6112 CONTINUE aux_inregions = .true. END IF6101 CONTINUE6102 CONTINUE ELSE value(num_incoh,1) = ibcmp END IF ELSE value(num_incoh,1) = ibcmp END IF ELSE IF((itmp .GT. 3))itmp = itmp-2 write(i_log,*) ' Setting all to ',itmp DO 6121 j=1, 2097154 ibcmp = itmp6121 CONTINUE6122 CONTINUE END IF ELSE value(num_incoh,1) = ibcmp END IF incoh_inregions = aux_inregions
![Page 108: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/108.jpg)
aux_inregions = .false. IF (( error_flags(num_coh) .EQ. 0 )) THEN write(i_log,*) 'Rayleigh start region' itmp = value(num_coh,1) IF (( itmp .EQ. 2 .OR. itmp .EQ. 3 )) THEN ival = ival + 1 values_sought(ival) = 'Rayleigh start region' nvalue(ival) = 0 type(ival) = 0 value_min(ival) = 1 value_max(ival) = 2097154 default(ival) = 1 ival = ival + 1 values_sought(ival) = 'Rayleigh stop region' nvalue(ival) = 0 type(ival) = 0 value_min(ival) = 1 value_max(ival) = 2097154 default(ival) = 1 Nmin = ival-1 Nmax = ival CALL GET_INPUT IF (( error_flags(ival-1) .EQ. 0 .AND. error_flags(ival) . * EQ. 0 )) THEN IF (( nvalue(ival) .EQ. nvalue(ival-1) )) THEN iitmp = itmp-2 DO 6131 j=1, 2097154 IRAYLR = iitmp6131 CONTINUE6132 CONTINUE iitmp = 1 - iitmp DO 6141 k=1,nvalue(ival) istart = value(ival-1,k) iend = value(ival,k) IF (( istart .LE. iend )) THEN DO 6151 j=istart,iend IRAYLR = iitmp6151 CONTINUE6152 CONTINUE aux_inregions = .true. END IF6141 CONTINUE6142 CONTINUE ELSE value(num_coh,1) = IRAYLR END IF ELSE value(num_coh,1) = IRAYLR END IF ELSE IF((itmp .GT. 3))itmp = itmp-2 write(i_log,*) ' Setting all to ',itmp DO 6161 j=1, 2097154 IRAYLR = itmp6161 CONTINUE6162 CONTINUE END IF ELSE
![Page 109: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/109.jpg)
value(num_coh,1) = IRAYLR END IF coh_inregions = aux_inregions aux_inregions = .false. IF (( error_flags(num_relax) .EQ. 0 )) THEN write(i_log,*) 'Relaxations start region' itmp = value(num_relax,1) IF (( itmp .EQ. 2 .OR. itmp .EQ. 3 )) THEN ival = ival + 1 values_sought(ival) = 'Relaxations start region' nvalue(ival) = 0 type(ival) = 0 value_min(ival) = 1 value_max(ival) = 2097154 default(ival) = 1 ival = ival + 1 values_sought(ival) = 'Relaxations stop region' nvalue(ival) = 0 type(ival) = 0 value_min(ival) = 1 value_max(ival) = 2097154 default(ival) = 1 Nmin = ival-1 Nmax = ival CALL GET_INPUT IF (( error_flags(ival-1) .EQ. 0 .AND. error_flags(ival) . * EQ. 0 )) THEN IF (( nvalue(ival) .EQ. nvalue(ival-1) )) THEN iitmp = itmp-2 DO 6171 j=1, 2097154 IEDGFL = iitmp6171 CONTINUE6172 CONTINUE iitmp = 1 - iitmp DO 6181 k=1,nvalue(ival) istart = value(ival-1,k) iend = value(ival,k) IF (( istart .LE. iend )) THEN DO 6191 j=istart,iend IEDGFL = iitmp6191 CONTINUE6192 CONTINUE aux_inregions = .true. END IF6181 CONTINUE6182 CONTINUE ELSE value(num_relax,1) = IEDGFL END IF ELSE value(num_relax,1) = IEDGFL END IF ELSE IF((itmp .GT. 3))itmp = itmp-2 write(i_log,*) ' Setting all to ',itmp DO 6201 j=1, 2097154 IEDGFL = itmp6201 CONTINUE
![Page 110: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/110.jpg)
6202 CONTINUE END IF ELSE value(num_relax,1) = IEDGFL END IF relax_inregions = aux_inregions aux_inregions = .false. IF (( error_flags(num_pe_ang) .EQ. 0 )) THEN write(i_log,*) 'PE sampling start region' itmp = value(num_pe_ang,1) IF (( itmp .EQ. 2 .OR. itmp .EQ. 3 )) THEN ival = ival + 1 values_sought(ival) = 'PE sampling start region' nvalue(ival) = 0 type(ival) = 0 value_min(ival) = 1 value_max(ival) = 2097154 default(ival) = 1 ival = ival + 1 values_sought(ival) = 'PE sampling stop region' nvalue(ival) = 0 type(ival) = 0 value_min(ival) = 1 value_max(ival) = 2097154 default(ival) = 1 Nmin = ival-1 Nmax = ival CALL GET_INPUT IF (( error_flags(ival-1) .EQ. 0 .AND. error_flags(ival) . * EQ. 0 )) THEN IF (( nvalue(ival) .EQ. nvalue(ival-1) )) THEN iitmp = itmp-2 DO 6211 j=1, 2097154 IPHTER = iitmp6211 CONTINUE6212 CONTINUE iitmp = 1 - iitmp DO 6221 k=1,nvalue(ival) istart = value(ival-1,k) iend = value(ival,k) IF (( istart .LE. iend )) THEN DO 6231 j=istart,iend IPHTER = iitmp6231 CONTINUE6232 CONTINUE aux_inregions = .true. END IF6221 CONTINUE6222 CONTINUE ELSE value(num_pe_ang,1) = IPHTER END IF ELSE value(num_pe_ang,1) = IPHTER END IF ELSE IF((itmp .GT. 3))itmp = itmp-2 write(i_log,*) ' Setting all to ',itmp
![Page 111: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/111.jpg)
DO 6241 j=1, 2097154 IPHTER = itmp6241 CONTINUE6242 CONTINUE END IF ELSE value(num_pe_ang,1) = IPHTER END IF pe_inregions = aux_inregions aux_inregions = .false. ival = ival + 1 num_ecut = ival values_sought(ival) = 'Set ECUT' nvalue(ival) = 0 type(ival) = 1 value_min(ival) = 0. value_max(ival) = 1e15 default(ival) = 0. ival = ival + 1 values_sought(ival) = 'Set ECUT start region' nvalue(ival) = 0 type(ival) = 0 value_min(ival) = 1 value_max(ival) = 2097154 default(ival) = 1 ival = ival + 1 values_sought(ival) = 'Set ECUT stop region' nvalue(ival) = 0 type(ival) = 0 value_min(ival) = 1 value_max(ival) = 2097154 default(ival) = 1 Nmin = num_ecut Nmax = num_ecut+2 error_flag = 0 CALL GET_INPUT IF (( error_flag .EQ. 0 )) THEN IF (( nvalue(num_ecut) .EQ. nvalue(ival) .AND. nvalue(ival-1) * .EQ. nvalue(ival) )) THEN DO 6251 k=1,nvalue(ival) istart = value(ival-1,k) iend = value(ival,k) IF (( istart .LE. iend )) THEN DO 6261 j=istart,iend ECUT = value(num_ecut,k)6261 CONTINUE6262 CONTINUE aux_inregions = .true. END IF6251 CONTINUE6252 CONTINUE END IF END IF ecut_inregions = aux_inregions aux_inregions = .false. ival = ival + 1 num_pcut = ival values_sought(ival) = 'Set PCUT'
![Page 112: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/112.jpg)
nvalue(ival) = 0 type(ival) = 1 value_min(ival) = 0. value_max(ival) = 1e15 default(ival) = 0. ival = ival + 1 values_sought(ival) = 'Set PCUT start region' nvalue(ival) = 0 type(ival) = 0 value_min(ival) = 1 value_max(ival) = 2097154 default(ival) = 1 ival = ival + 1 values_sought(ival) = 'Set PCUT stop region' nvalue(ival) = 0 type(ival) = 0 value_min(ival) = 1 value_max(ival) = 2097154 default(ival) = 1 Nmin = num_pcut Nmax = num_pcut+2 error_flag = 0 CALL GET_INPUT IF (( error_flag .EQ. 0 )) THEN IF (( nvalue(num_pcut) .EQ. nvalue(ival) .AND. nvalue(ival-1) * .EQ. nvalue(ival) )) THEN DO 6271 k=1,nvalue(ival) istart = value(ival-1,k) iend = value(ival,k) IF (( istart .LE. iend )) THEN DO 6281 j=istart,iend PCUT = value(num_pcut,k)6281 CONTINUE6282 CONTINUE aux_inregions = .true. END IF6271 CONTINUE6272 CONTINUE END IF END IF pcut_inregions = aux_inregions aux_inregions = .false. ival = ival + 1 num_smax = ival values_sought(ival) = 'Set SMAX' nvalue(ival) = 0 type(ival) = 1 value_min(ival) = 0. value_max(ival) = 1e15 default(ival) = 0. ival = ival + 1 values_sought(ival) = 'Set SMAX start region' nvalue(ival) = 0 type(ival) = 0 value_min(ival) = 1 value_max(ival) = 2097154 default(ival) = 1 ival = ival + 1
![Page 113: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/113.jpg)
values_sought(ival) = 'Set SMAX stop region' nvalue(ival) = 0 type(ival) = 0 value_min(ival) = 1 value_max(ival) = 2097154 default(ival) = 1 Nmin = num_smax Nmax = num_smax+2 error_flag = 0 CALL GET_INPUT IF (( error_flag .EQ. 0 )) THEN IF (( nvalue(num_smax) .EQ. nvalue(ival) .AND. nvalue(ival-1) * .EQ. nvalue(ival) )) THEN DO 6291 k=1,nvalue(ival) istart = value(ival-1,k) iend = value(ival,k) IF (( istart .LE. iend )) THEN DO 6301 j=istart,iend SMAXIR = value(num_smax,k)6301 CONTINUE6302 CONTINUE aux_inregions = .true. END IF6291 CONTINUE6292 CONTINUE END IF END IF smax_inregions = aux_inregions write(i_errors,*) write(i_errors,*) ' ******************** end input transport param *eter *********************** ' write(i_errors,*) output_strings(1) = allowed_inputs(num_pair_ang,iprdst) itmp = value(num_incoh,1) output_strings(2) = allowed_inputs(num_incoh,itmp) output_strings(12) = allowed_inputs(num_radc,radc_flag) itmp = value(num_coh,1) output_strings(3) = allowed_inputs(num_coh,itmp) itmp = value(num_relax,1) output_strings(4) = allowed_inputs(num_relax,itmp) itmp = value(num_pe_ang,1) output_strings(5) = allowed_inputs(num_pe_ang,itmp) output_strings(6) = allowed_inputs(num_brems_ang,ibrdst) output_strings(7) = allowed_inputs(num_bca,bca_algorithm) output_strings(8) = allowed_inputs(num_alg,transport_algorithm) output_strings(9) = allowed_inputs(num_brems_cs,ibr_nist) output_strings(10) = allowed_inputs(num_pair_cs,pair_nrc) output_strings(11) = allowed_inputs(num_triplet,itriplet) entry show_transport_parameter(ounit) IF((ounit .LE. 0))return write(ounit,*) write(ounit,'(a)') line write(ounit,*) write(ounit,'(a,/)') ' Electron/Photon transport * parameter' write(ounit,'(a,/)') line write(ounit,'(a,38x,a)') ' Photon cross sections', photon_xsection *s(:lnblnk1(photon_xsections))
![Page 114: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/114.jpg)
write(ounit,'(a,37x,a)') ' Compton cross sections', comp_xsections *(:lnblnk1(comp_xsections)) write(ounit,'(a,$)') ' Photon transport cutoff(MeV)' IF (( pcut_inregions )) THEN write(ounit,'(32x,a)') 'Set in regions' ELSE IF (( PCUT .GT. 1e-4 )) THEN write(ounit,'(32x,g14.4)') PCUT ELSE write(ounit,'(32x,a)') 'AP(medium)' END IF END IF write(ounit,'(a,39x,a3)') ' Pair angular sampling',output_strings( *1) write(ounit,'(a,41x,a3)') ' Pair cross sections',output_strings(10 *) write(ounit,'(a,42x,a3)') ' Triplet production',output_strings(11) write(ounit,'(a,36x,a14)') ' Bound Compton scattering',output_stri *ngs(2) IF (( radc_flag .EQ. 1 )) THEN write(i_log,'(/a)') '***************** Warning: ' write(i_log,*) 'You are trying to use radiative Compton correc *tions' write(i_log,*) 'without having included rad_compton.mortran' radc_flag = 0 END IF write(ounit,'(a,31x,a14)') ' Radiative Compton corrections',output *_strings(12) write(ounit,'(a,41x,a14)') ' Rayleigh scattering',output_strings(3 *) write(ounit,'(a,42x,a14)') ' Atomic relaxations',output_strings(4) write(ounit,'(a,30x,a14)') ' Photoelectron angular sampling',outpu *t_strings(5) write(ounit,*) write(ounit,'(a,$)') ' Electron transport cutoff(MeV)' IF (( ecut_inregions )) THEN write(ounit,'(30x,a)') 'Set in regions' ELSE IF (( ECUT .GT. 1e-4 )) THEN write(ounit,'(30x,f7.4)') ECUT ELSE write(ounit,'(30x,a)') 'AE(medium)' END IF END IF write(ounit,'(a,30x,a4)') ' Bremsstrahlung cross sections',output_ *strings(9) write(ounit,'(a,29x,a3)') ' Bremsstrahlung angular sampling',outpu *t_strings(6) IF (( spin_effects )) THEN write(ounit,'(a,48x,a)') ' Spin effects','On' ELSE write(ounit,'(a,48x,a)') ' Spin effects','Off' END IF write(ounit,'(a,34x,a)') ' Electron Impact Ionization',eii_xfile(: *lnblnk1(eii_xfile)) write(ounit,'(a,$)') ' Maxium electron step in cm (SMAX)' IF (( smax_inregions )) THEN write(ounit,'(27x,a)') 'Set in regions'
![Page 115: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/115.jpg)
ELSE IF (( SMAXIR .GT. 1e-4 )) THEN write(ounit,'(27x,g14.4)') SMAXIR ELSE write(ounit,'(27x,a)') 'Restriction is off' END IF END IF write(ounit,'(a,16x,f6.4)') ' Maximum fractional energy loss/step *(ESTEPE)',estepe write(ounit,'(a,21x,f6.4)') ' Maximum 1st elastic moment/step (XIM *AX)',ximax write(ounit,'(a,33x,a10)') ' Boundary crossing algorithm',output_s *trings(7) write(ounit,'(a,22x,g9.4)') ' Skin-depth for boundary crossing (MF *P)',skindepth_for_bca write(ounit,'(a,37x,a10)') ' Electron-step algorithm',output_strin *gs(8) write(ounit,*) write(ounit,'(a)') line write(ounit,*) return end subroutine set_elastic_parameter implicit none integer*4 ounit COMMON/GetInput/ ALLOWED_INPUTS(100,0:5), VALUES_SOUGHT(100), C *HAR_VALUE(100,100), VALUE(100,100), DEFAULT(100), VALUE_MIN(100 *), VALUE_MAX(100), NVALUE(100), TYPE(100), ERROR_FLAGS(100 *), i_errors, NMIN, NMAX, ERROR_FLAG, DELIMETER character ALLOWED_INPUTS*64,VALUES_SOUGHT*64, CHAR_VALUE*80,DELIME *TER*64 real*8 VALUE,DEFAULT,VALUE_MIN,VALUE_MAX integer*4 NVALUE,TYPE,NMIN,NMAX,ERROR_FLAG,ERROR_FLAGS,i_errors COMMON/ELECIN/ esig_e(7),psig_e(7), esige_max, psige_max, range_ep *(0:1,150,7), E_array(150,7), etae_ms0(150,7),etae_ms1(150,7),etap_ *ms0(150,7),etap_ms1(150,7),q1ce_ms0(150,7),q1ce_ms1(150,7),q1cp_ms *0(150,7),q1cp_ms1(150,7),q2ce_ms0(150,7),q2ce_ms1(150,7),q2cp_ms0( *150,7),q2cp_ms1(150,7),blcce0(150,7),blcce1(150,7), EKE0(7),EKE1(7 *), XR0(7),TEFF0(7),BLCC(7),XCC(7), ESIG0(150,7),ESIG1(150,7),PSIG0 *(150,7),PSIG1(150,7),EDEDX0(150,7),EDEDX1(150,7),PDEDX0(150,7),PDE *DX1(150,7),EBR10(150,7),EBR11(150,7),PBR10(150,7),PBR11(150,7),PBR *20(150,7),PBR21(150,7),TMXS0(150,7),TMXS1(150,7), expeke1(7), IUNR *ST(7),EPSTFL(7),IAPRIM(7), sig_ismonotone(0:1,7) real*8 esig_e, psig_e, esige_max, psige_max, range_ep, E_ar *ray, etae_ms0,etae_ms1, etap_ms0,etap_ms1, q1ce_ms0,q1ce_ms1, *q1cp_ms0,q1cp_ms1, q2ce_ms0,q2ce_ms1, q2cp_ms0,q2cp_ms1, blcce0 *,blcce1, expeke1, EKE0,EKE1, XR0, TEFF0, BLCC, XCC, ESIG0,E *SIG1, PSIG0,PSIG1, EDEDX0,EDEDX1, PDEDX0,PDEDX1, EBR10,EBR11, * PBR10,PBR11, PBR20,PBR21, TMXS0,TMXS1 integer*4 IUNRST, EPSTFL, IAPRIM logical sig_ismonotone COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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
![Page 116: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/116.jpg)
character*16 eii_xfile character*16 photon_xsections character*16 comp_xsections common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch integer*4 imed,ival,lnblnk1,nchanged character*24 medname ounit = i_log delimeter = 'MC TRANSPORT PARAMETER' call get_input_set_error_level(0) ival = 0 DO 6311 imed=1,nmed call egs_get_medium_name(imed,medname) ival = ival + 1 values_sought(ival) = 'scale elastic scattering in '// medname * (:lnblnk1(medname)) nvalue(ival) = 1 type(ival) = 1 value_min(ival) = 1e-3 value_max(ival) = 1e3 default(ival) = 16311 CONTINUE6312 CONTINUE Nmin = 1 Nmax = nmed CALL GET_INPUT nchanged = 0 DO 6321 imed=1,nmed IF((error_flags(imed) .EQ. 0))nchanged = nchanged + 16321 CONTINUE6322 CONTINUE IF (( nchanged .GT. 0 )) THEN write(ounit,'(//a)') '================ Elastic scattering scal *ed as follows ==================' DO 6331 imed=1,nmed IF (( error_flags(imed) .EQ. 0 )) THEN call egs_get_medium_name(imed,medname) xcc(imed) = xcc(imed)*value(imed,1) blcc(imed) = blcc(imed)*value(imed,1) write(ounit,'(a,t30,f10.6)') medname(:lnblnk1(medname) * ), value(imed,1) END IF6331 CONTINUE6332 CONTINUE write(ounit,'(a//)') '======================================== *================================' END IF return
![Page 117: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/117.jpg)
endC***************************************************************************CC This file was automatically generated by:C egs_install_Linux_self.exe version V4-r2-3-2C It contains various subroutines and functions for date, time,C CPU time, host name, etc.CC Attention: all changes will be lost the next time you runC egs_install_Linux_self.exe.CC***************************************************************************C $Id: egs_system_v1.f,v 1.1.1.1 2003/07/11 19:17:08 iwan Exp $C*****************************************************************************C egs_system(command) runs a system command and returns the statusC command must be null-terminatedC***************************************************************************** integer function egs_system(command) character*(*) command integer system, istat istat = system(command) egs_system = istat return endC $Id: egs_isdir_v1.f,v 1.1.1.1 2003/07/11 19:17:08 iwan Exp $C*****************************************************************************CC egs_isdir(file_name) Returns .true., if the string file_name points toC an existing directory. This version uses the lstatC intrinsic and then tests for bit 14 being set inC the mode element. This works on all Unix systemsC that I have access to (Linux, Aix, HP-UX, OSF1,C Solaris, IRIX)C*****************************************************************************
logical function egs_isdir(file_name) implicit none character*(*) file_name integer*4 lnblnk1, res, array(13), l, lstat logical btest egs_isdir = .false. l = lnblnk1(file_name) if( l.lt.len(file_name) ) file_name(l+1:l+1) = char(0) ! On some systems lstat only works if the string is 0-terminated res = lstat(file_name,array) if( l.lt.len(file_name) ) file_name(l+1:l+1) = ' ' if( res.eq.0 ) then ! Amost all compilers that have the lstat intrinsic return the
![Page 118: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/118.jpg)
! file mode in the 3rd array element. But the PGI compiler has ! its own opinion on the subject and returns it in the 5th element ! That's why the relevant element is written as 3 ! here, 3 gets replaced by the appropriate element ! by the configure script. if( btest(array(3),14) ) egs_isdir = .true. end if return endC $Id: egs_fdate_v1.f,v 1.1.1.1 2003/07/11 19:17:08 iwan Exp $C***************************************************************************CC egs_fdate(out): print a 24 char date and time string in the formC 'Tue Mar 18 08:16:42 2003'C to the unit specified by out without end of lineC i.e. the sequenceC write(6,'(a,$)') 'Today is 'C call egs_fdate(6)C write(6,'(a)') '. Have a nice date'C should result in something likeC Today is Tue Mar 18 08:16:42 2003. Have a nice dateC printed to unit 6.CC***************************************************************************
subroutine egs_fdate(ounit) integer ounit character*24 string call fdate(string) write(ounit,'(a,$)') string end
C***************************************************************************CC egs_get_fdate(string) assignes a 24 char date and time string to stringC string must be at least 24 chars long, otherwiseC this subroutine has no effect.CC***************************************************************************
subroutine egs_get_fdate(string) character*(*) string if( len(string).ge.24 ) call fdate(string) return endC $Id: egs_date_and_time_v1.f,v 1.1.1.1 2003/07/11 19:17:08 iwan Exp $C****************************************************************************** subroutine egs_date_and_time(vnow) integer vnow(8)
![Page 119: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/119.jpg)
character dat*8,tim*10,zon*5 call date_and_time(dat,tim,zon,vnow) return endC $Id: egs_date_v1.f,v 1.1.1.1 2003/07/11 19:17:08 iwan Exp $C*************************************************************************CC egs_date(ounit): print a 11 char string in the formC '18-Mar-2003'C to the unit specified by ounitC No end of line character is insertedCC*************************************************************************
subroutine egs_date(ounit) integer ounit character string*24, dat*11 call fdate(string) dat(1:2) = string(9:10) dat(3:3) = '-' dat(4:6) = string(5:7) dat(7:7) = '-' dat(8:11) = string(21:24) write(ounit,'(a,$)') dat return endC $Id: egs_time_v1.f,v 1.1.1.1 2003/07/11 19:17:08 iwan Exp $C*************************************************************************CC egs_time(ounit): print a 8 char string in the form hh:mm:ssC to the unit specified by ounitC No end of line character is insertedCC*************************************************************************
subroutine egs_time(ounit) integer ounit character string*24 call fdate(string) write(ounit,'(a,$)') string(12:19) return endC $Id: egs_secnds_v1.f,v 1.1.1.1 2003/07/11 19:17:08 iwan Exp $C*****************************************************************************CC real function egs_secnds(t0): returns seconds passed since midnight minus t0CC*****************************************************************************
real function egs_secnds(t0) real t0,t1
![Page 120: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/120.jpg)
character dat*8,tim*10,zon*5 integer values(8) call date_and_time(dat,tim,zon,values) t1 = 3600.*values(5) + 60.*values(6) + values(7) + 0.001*values(8) egs_secnds = t1 - t0 return end
C*****************************************************************************CC real function egs_tot_time()CC On first call returns seconds passed since 1/1/1970C On subsequent calls returnsC - seconds since last call, if flag = 0C - seconds since first call, elseCC*****************************************************************************
real function egs_tot_time(flag) integer flag character dat*8,tim*10,zon*5 integer vnow(8), vlast(8),i real t,egs_time_diff,t0 data vlast/1970,1,1,5*0/,t0/-1/ save vlast,t0 call date_and_time(dat,tim,zon,vnow) t = egs_time_diff(vlast,vnow) do i=1,8 vlast(i)=vnow(i) end do if( t0.lt.0 ) then t0 = 0 egs_tot_time = t else t0 = t0 + t if(flag.eq.0) then egs_tot_time = t else egs_tot_time = t0 end if end if return endC $Id: time_stuff.f,v 1.1.1.1 2003/07/11 19:17:08 iwan Exp $C****************************************************************************CC Returns the time difference between vstart and vendC vstart and vend are integer arrays of dimension 8 with elementsC corresponding to the specification of the data_and_time routine, i.e.C array(1) = yearC array(2) = month of the year (1...12)C array(3) = day of the month (1...31)C array(4) = difference in minutes from UTCC array(5) = hour of the day (1...23)
![Page 121: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/121.jpg)
C array(6) = minute of the hour (1...59)C array(7) = seconds of the minute (1...59)C array(8) = miliseconds of the second (1...999)CC Note: this implementation ignores the time difference from UTC fieldCC***************************************************************************** real function egs_time_diff(vstart,vend) integer vstart(8),vend(8) real egs_time_diff_o if( vend(1).lt.vstart(1).or. & (vend(1).eq.vstart(1).and.vend(2).lt.vstart(2)) ) then egs_time_diff = -egs_time_diff_o(vend,vstart) else egs_time_diff = egs_time_diff_o(vstart,vend) end if return end
C******************************************************************************CC day difference between the dates specified by the integer arrays vstart andC vend. The arrays are v(1)=year, v(2)=month, v(3)=dayCC****************************************************************************** integer function egs_day_diff(vstart,vend) integer vstart(3),vend(3),egs_day_diff_o if( vend(1).lt.vstart(1).or. & (vend(1).eq.vstart(1).and.vend(2).lt.vstart(2)) ) then egs_day_diff = -egs_day_diff_o(vend,vstart) else egs_day_diff = egs_day_diff_o(vstart,vend) end if return end
C******************************************************************************C Returns a 3-letter abreviation of the day of the week in the string day,C given a day specified by the integer array valuesC values(1)=year, values(2)=month, values(3)=dayC****************************************************************************** subroutine egs_weekday(values,day) character*(*) day integer values(3) integer days,vtmp(3),egs_day_diff,aux character*3 wdays(7) data wdays/'Mon','Tue','Wed','Thu','Fri','Sat','Sun'/ vtmp(1) = 1970 vtmp(2) = 1 vtmp(3) = 1 days = egs_day_diff(vtmp,values)
![Page 122: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/122.jpg)
aux = mod(days,7) days = 4 + aux if( days.gt.7 ) days = days - 7 day(:len(day)) = ' ' aux = min(len(day),3) day(:aux) = wdays(days)(:aux) return end
C*****************************************************************************C Same as egs_day_diff above, but assumes that vend specifies a later dateC than vstart.C***************************************************************************** integer function egs_day_diff_o(vstart,vend) integer vstart(3),vend(3) integer days logical next_month integer tm,m,ty,y integer mdays(12) data mdays/31,28,31,30,31,30,31,31,30,31,30,31/ days = 0 ty = vstart(1) y = vend(1) tm = vstart(2) m = vend(2) next_month = .true. do while(next_month) if( tm.eq.m.and.ty.eq.y ) then next_month = .false. else days = days + mdays(tm) if( tm.eq.2.and.mod(ty,4).eq.0 ) days = days + 1 tm = tm + 1 if( tm.gt.12 ) then ty = ty + 1 tm = 1 end if end if end do days = days + vend(3) - vstart(3) egs_day_diff_o = days return end
C******************************************************************************C Same as egs_time_diff above, but assumes that vend specifies a later dateC than vstart.C****************************************************************************** real function egs_time_diff_o(vstart,vend) integer vstart(8),vend(8) integer days,hours,minutes,secs,msecs integer egs_day_diff_o
![Page 123: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/123.jpg)
days = egs_day_diff_o(vstart,vend) hours = vend(5) - vstart(5) minutes = vend(6) - vstart(6) secs = vend(7) - vstart(7) msecs = vend(8) - vstart(8) egs_time_diff_o = 3600.*(24.*days+hours)+60.*minutes+secs+ & 0.001*msecs return end
C******************************************************************************C Returns in month a 3-letter abreviation of the month specified by mo, ifC mo is between 1 and 12, or an empty string otherwise.C****************************************************************************** subroutine egs_month(mo,month) integer mo character*(*) month integer iaux character*3 months(12) data months/'Jan','Feb','Mar','Apr','May','Jun', 'Jul','Aug','Sep' *,'Oct','Nov','Dec'/ iaux = min(len(month),3) month(:len(month)) = ' ' if( mo.ge.1.and.mo.le.12 ) month(:iaux) = months(mo)(:iaux) return end
C******************************************************************************C Converts a 3-letter abreviation of a month to its corresponding integerC value, if the string month is a valid month, or -1 otherwise.C****************************************************************************** integer function egs_conver_month(month) character*3 month character*3 months(12) integer i data months/'Jan','Feb','Mar','Apr','May','Jun', 'Jul','Aug','Sep' *,'Oct','Nov','Dec'/ do i=1,12 if( month.eq.months(i) ) then egs_conver_month = i return end if end do egs_conver_month = -1 return end
C $Id: egs_etime.f,v 1.1.1.1 2003/07/11 19:17:08 iwan Exp $C*****************************************************************************CC real function egs_etime(): returns CPU time consumed since the start ofC the program
![Page 124: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/124.jpg)
CC*****************************************************************************
real function egs_etime() real tarray(2),etime egs_etime = etime(tarray) return endC $Id: egs_canonical_system.f,v 1.1.1.1 2003/07/11 19:17:08 iwan Exp $C******************************************************************************CC Print the canonical system name as determined by the config.guess scriptC or the Windows installation program to the unit specified by ounit.CC*****************************************************************************
subroutine egs_print_canonical_system(ounit) integer ounit write(6,'(a,$)') 'x86_64-unknown-linux-gnu' return end
C******************************************************************************CC Assign the canonical system name as determined by the config.guess scriptC or the Windows installation program to the string pointed to by resCC******************************************************************************
subroutine egs_get_canonical_system(res) character*(*) res integer l1,l2 l1 = lnblnk1('x86_64-unknown-linux-gnu') l2 = len(res) res(:l2) = ' ' if( l2.ge.l1 ) then res(:l1) = 'x86_64-unknown-linux-gnu' else res(:l2) = 'x86_64-unknown-linux-gnu' end if return end
C $Id: egs_configuration_name.f,v 1.1.1.1 2003/07/11 19:17:08 iwan Exp $C******************************************************************************CC Print the configuration name as specified suring the configurationC process to the unit specified by ounit.C
![Page 125: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/125.jpg)
C*****************************************************************************
subroutine egs_print_configuration_name(ounit) integer ounit write(6,'(a,$)') 'x86_64-unknown-linux-gnu-gfortran' return end
C******************************************************************************CC Assign the configuration name as specified suring the configurationC process to the string pointed to by resCC******************************************************************************
subroutine egs_get_configuration_name(res) character*(*) res integer l1,l2 l1 = lnblnk1('x86_64-unknown-linux-gnu-gfortran') l2 = len(res) res(:l2) = ' ' if( l2.ge.l1 ) then res(:l1) = 'x86_64-unknown-linux-gnu-gfortran' else res(:l2) = 'x86_64-unknown-linux-gnu-gfortran' end if return end
C $Id: egs_hostnm_v1.f,v 1.1.1.1 2003/07/11 19:17:08 iwan Exp $C*****************************************************************************CC Print the host name to the unit specified by ounit without insertingC a new line character.CC*****************************************************************************
subroutine egs_print_hostnm(ounit) integer ounit character*256 string integer res,hostnm,lnblnk1 res = hostnm(string) if( res.ne.0 ) then write(6,'(a,a)') 'hostnm returned with a non-zero status ' stop end if write(ounit,'(a,$)') string(:lnblnk1(string)) return end
C*****************************************************************************C
![Page 126: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/126.jpg)
C Assign the host name to the string pointed to be hname.CC*****************************************************************************
subroutine egs_get_hostnm(hname) character*(*) hname character*256 string integer res,hostnm,lnblnk1,l1,l2,l res = hostnm(string) if( res.ne.0 ) then write(6,'(a,a)') 'hostnm returned with a non-zero status ' stop end if l1 = lnblnk1(string) l2 = len(hname) hname(:l2) = ' ' l = min(l1,l2) hname(:l) = string(:l) return end
! Copyright National Research Council of Canada, Ottawa, ! BEAM Code System 1999, all rights reserved ! This code is covered by the BEAM General License subroutine srcinput(ieof) ! Copyright National Research Council of Canada, Ottawa, ! BEAM Code System 1999, all rights reserved ! This code is covered by the BEAM General License implicit none real*8 temp,fnorm,binsok,gridsz,ak integer*4 i,k,j,ib,ieof dimension temp(12) CHARACTER*256 FILNAM CHARACTER*80 SPEC_TITLE CHARACTER*5 MODE integer*4 lnblnk1,ilen integer*4 latchm,nhistm real*8 einm,xinm,yinm,uinm,vinm,wtm,zlastm,Z_SOURCE COMMON/ENERGYSRC/NENSRC,IMODE,ENSRCD,SRCPDF,SRCCDF,ENMIN,CDFINV,DE *LTAK REAL ENSRCD(200),SRCPDF(200),SRCCDF(200),ENMIN, CDFINV(1000,2),DEL *TAK INTEGER IMODE,NENSRC common/geom/ xbound(128+1), ybound(128+1), zbound(128+1), xboun *d_min, xbound_max, ybound_min, ybound_max, zbound_min, zbound *_max, medsur, dsurround(4), IMAX, JMAX, KMAX, ijmax, irmax, * howfarless real*4 xbound, ybound, zbound, xbound_min, xbound_max, ybound_min, * ybound_max, zbound_min, zbound_max,dsurround integer medsur,IMAX, JMAX, KMAX, ijmax,irmax logical howfarless COMMON/PHSPFILE/BEAM_SIZE,MODE_PHSP1,LATCH_OPT, NCASE_PHSP,LATBIT, *NBIT1,NBIT2,I_BIT_FILTER,NofREPEAT,ISMOOTH, OUTCNT,NRCYCL,IPARALLE *L,PARNUM,CYCLNUM real BEAM_SIZE INTEGER MODE_PHSP1,LATCH_OPT,NCASE_PHSP,LATBIT(20),NBIT1,NBIT2, I_ *BIT_FILTER,NofREPEAT,ISMOOTH,OUTCNT,NRCYCL,IPARALLEL,PARNUM,CYCLNU
![Page 127: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/127.jpg)
*M common/score/IWATCH,mxnp, endep( 2097153), endep2( 2097153), temp2 *, planarefe, planarefp,planarfe,planarfp,nestep,endep_tmp( 2097153 *), endep_last( 2097153) integer IWATCH, mxnp real endep_tmp REAL*8 endep, endep2, temp2,planarefe, planarefp, planarfe, planar *fp integer*8 nestep integer*2 endep_last common/source/ esrc, nhist, nnread, einsrc, xsrcold, ysrcold, * usrcold, vsrcold, wsrcold, weightold, latchold, frMU_indx, *zinc, xinl, xinu, yinl, yinu, zinl, zinu, thetax, thetay, * thetaz, uinc, vinc, winc, beamarea, xcol, ycol, xiso, yiso *, ziso, phicol, theta(60000), phi(60000), pang(60000), angfi *xed(60000), angmin(60000), angmax(60000), pgang(60000), xtemp( *60000), ytemp(60000), ztemp(60000), phicoltemp(60000), thetatem *p(60000), phitemp(60000), muIndex(60000), r_11(60000), r_12(600 *00), r_13(60000), r_21(60000), r_22(60000), r_23(60000), r_31(6000 *0), r_32(60000), r_33(60000), dsource, dsourcetemp(60000), ein, e *ksrcm, esrc_sp, SSD, einsrcold, iqinold, NINCSRC, r_dbs, ssd *_dbs, z_dbs, enflag, dflag, ismode, isource, iqin, * iqphsp, iqinc, MLCflag *, ixinl, ixinu, jyinl, jyinu, kzinl, * kzinu, klowx, khix, klowy, khiy, * klowz, khiz, survival_ratio, nsmiss, *nsrjct, nsoutside, nmissm, nshist, nphist, * nnphsp, IPRIMARY, * OLDSRC, npassi, nang, ivary(600 *00), ngang(60000), nset, more_in_cont, * numang, dose_stat, ndbsrjct, * i_dbs, iphatsrc, e_split, * i_iaea_in, i_unit_in, nhist_last, * the_beam_code, the_input_file, the *_vcu_input_file, the_pegs_file, the_ *phsp_file, the_vcu_code real*8 esrc,muIndex integer*8 nhist, nnread real*8 einsrc, xsrcold, ysrcold,usrcold,vsrcold,wsrcold,weightold, *latchold, frMU_indx real*4 zinc, xinl, xinu, yinl, yinu, zinl, zinu, thetax, thetay *, thetaz, uinc, vinc, winc, beamarea, xcol,ycol,xiso, yiso, zi *so, phicol, theta, phi, xtemp, ytemp, ztemp, phico *ltemp,thetatemp, phitemp, pang,angfixed,angmin,ang *max,pgang,r_11, r_12, r_13, r_21, r_22, r_23 *, r_31, r_32, r_33,dsource,dsourcetemp, * ein, eksrcm, esrc_sp, SSD, NINCSRC, * r_dbs, ssd_dbs,z_dbs,survival_ratio,einsrcold integer*4 isource, iqin, iqphsp, iqinc,iqinold,MLCflag, * ixinl, ixinu, jyinl, jyinu, kzinl, kzinu, * klowx, khix, klowy, khiy, klowz, khiz *, nsmiss, nsrjct,nsoutsid *e, nmissm,nshist,nphist,nnphsp, enflag, dflag, is *mode, IPRIMARY, OLDSRC,npassi,nang,ivary,ngang,numang,dose_stat, * ndbsrjct,i_dbs,iphatsrc,e_split,i_iaea_in,i_unit_in,more_in_c *ont,nset integer*2 nhist_last character*80 the_beam_code, the_vcu_code, the_input_file,the_pegs_
![Page 128: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/128.jpg)
*file, the_vcu_input_file,the_phsp_file COMMON/SOURCE_FORPARALLEL/nnphsp_max, nnphsp_min integer*4 nnphsp_max, nnphsp_min COMMON/SSMDIS/ISMMODE,NSSMDIS,IB_SSM,IC_SSM, SSMDIS,SSMPDF,SSMCDF, *SSMMIN,SSMMAX,CDFSSM INTEGER ISMMODE,NSSMDIS,IB_SSM,IC_SSM REAL SSMDIS(200),SSMPDF(200),SSMCDF(200),SSMMIN,SSMMAX, CDFSSM(200 *0,2) COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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( 2097154),MED( 2097154),IRAYLR real*8 DUNIT, RHOR integer*4 KMPI, KMPO integer*2 MED, IRAYLR COMMON/BOUNDS/ECUT,PCUT,VACDST real*8 ECUT, PCUT, VACDST COMMON/RWPHSP/ STRING_TEMP_ZLAST_OUT, STRING_TEMP_OUT, IHSTRY_PH *SP, iaea_dummy_long, ESHORT, WEIGHTTMP, WT_PHSP_SHORT, X_PHS *P_SHORT, Y_PHSP_SHORT, Z_PHSP_SHORT, U_PHSP_SHORT, V_PHSP_SHOR *T, W_PHSP_SHORT, ZLAST_PHSP_SHORT, EKMAX_PHSP_SHORT, EKMINE_PH *SP_SHORT, NINC_PHSP_SHORT, NUM_PHSP_TOT, PHOT_PHSP_TOT, iaea_re *sult, iaea_n_stat, iaea_q_typ, iaea_typ_q, iaea_q_index, I_P *HSP, IERR_PHSP, LATCHTMP, WRITE_PHSP_COUNTER, WRITE_PHSP_SOFAR *, PHSP_RESTART, PHSP_RECL, PHSP_RECL_OLD, iaea_extra_ints, ia *ea_extra_int_types,iaea_extra_float_types, MODE_RW CHARACTER*32000 STRING_TEMP_ZLAST_OUT(1) CHARACTER*28000 STRING_TEMP_OUT(1) integer*8 IHSTRY_PHSP(1),iaea_dummy_long REAL*4 ESHORT,WEIGHTTMP,WT_PHSP_SHORT,X_PHSP_SHORT,Y_PHSP_SHORT, Z *_PHSP_SHORT,U_PHSP_SHORT, V_PHSP_SHORT,W_PHSP_SHORT,ZLAST_PHSP_SHO *RT, EKMAX_PHSP_SHORT,EKMINE_PHSP_SHORT,NINC_PHSP_SHORT INTEGER NUM_PHSP_TOT,PHOT_PHSP_TOT, iaea_result,iaea_n_stat,iaea_q *_typ(3),iaea_typ_q(3),iaea_q_index,I_PHSP, IERR_PHSP,LATCHTMP, WRI *TE_PHSP_COUNTER(1),WRITE_PHSP_SOFAR(1), PHSP_RESTART,PHSP_RECL,PHS *P_RECL_OLD,iaea_extra_ints(2), iaea_extra_int_types(2),iaea_extra_ *float_types(1) CHARACTER*5 MODE_RW INTEGER LATCH_TEMP_OUT,NUM_PHSP_TOFLUSH,TEMP_PHSP_COUNTER,REM_PHSP REAL*4 REAL_TEMP_OUT(7) CHARACTER*32 REC_TEMP_OUT common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m
![Page 129: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/129.jpg)
*scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch enflag = 0 WRITE(6,6340)6340 FORMAT(/ / ' Source configuration'/) WRITE(6,6350)6350 FORMAT(' (0) Parallel, rectangular beam incident from the fro *nt' / ' Requires 9 inputs:' / ' charge (-1,0,1), *' / ' 0 (mandatory, to identify source type),' / ' lowe *r x-coordinate of the beam (cm),' / ' upper x-coordinate *of the beam (cm),' / ' lower y-coordinate of the beam (cm *),' / ' upper y-coordinate of the beam (cm),' / ' * angle of beam with respect to the positive x-axis (degrees),'/ ' * angle of beam with respect to the positive y-axis (degree *s),'/ ' angle of beam with respect to the negative z-axis * (degrees) '/ ' (angles default to 90,90,0--incident on * front of phantom)'/) WRITE(6,6360)6360 FORMAT(' or (1) Parallel, rectangular beam incident from any dir *ection'/ ' Requires 10 inputs:' / ' charge (-1,0 *,1),' / ' 1 (mandatory, to identify source type),' / ' * x-coordinate of the isocenter (cm),' / ' y-coordinate * of the isocenter (cm),' / ' z-coordinate of the isocente *r (cm),' / ' angle between +z direction and the line join *ing the '/ ' center of the beam (collimator) to the *isocenter' / ' --called the polar angle(degrees),'/ ' * angle between +x direction and the projection of the'/ ' * line joining the center of the beam (collimator)'/ ' * to the isocenter on the xy plane--called the azimuthal' */ ' angle (degrees),'/ ' total x-widthof the *beam in the plane perpendicular' / ' to the beam direc *tion (cm),' / ' total y-width of the beam in the plane pe *rpendicular' / ' to the beam direction (cm),' /' * angle by which the collimator is rotated in the' / ' * collimator plane perpendicular to the beam' / ' direction (de *grees), ' / ' (+ve rotation is cou *nterclockwise looking along' / ' the beam direction' */) WRITE(6,6370)6370 FORMAT(' or (2) Full phase-space of each particle' / 'Requires 9 * inputs plus data stored in units 43 and 44:'/ ' charge (-1 elect *ron,0 photon,1 positron, 2 all),' / ' 2 (mandatory, to id *entify source type),' / ' x-coordinateof the isocenter (c *m),' / ' y-coordinate of the isocenter (cm),' / ' * z-coordinate of the isocenter (cm),' / ' angle between +z di *rection and the line joining the '/ ' origin in the pha *se space plane to the isocenter' / ' --called the polar a *ngle(degrees),' / ' angle between +x direction and the pr *ojection of the' / ' line joining the origin in the ph *ase space plane' / ' tothe isocenter on the xy plane-- *called the azimuthal'/ ' angle (degrees),' / ' absolute *distance from the isocenter to the origin' / ' in the *phase space plane ' / ' angle by which the *source is rotated in the' / ' phase space plane perpen *dicular to the beam' / ' direction (degrees), * ' / ' (+ve rotation is counterclockwise lo *oking down' / ' from the origin in the phase space plan *e),' / ' i_dbs--set to 1 if DBS was used in BEAM simulation used
![Page 130: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/130.jpg)
*' / ' to generate the phsp source and you want to reject *fat'/ ' photons, 0 otherwise,'/ ' DBS splitti *ng radius (cm),'/ ' SSD at which splitting radius defined * (cm),'/ ' Z at which phsp source collected (cm),'/ ' No *. of times to split charged particles.'/) WRITE(6,6380)6380 FORMAT(' or (3) Point, rectangular beam incident from the front' */ ' Requires 7 inputs:' / ' charge (-1,0,1),' /' * 3 (mandatory, to identify source type),' / 'lower x-coor *dinate of the beam (cm),' / ' upper x-coordinate of the b *eam (cm),' / ' lower y-coordinate of the beam (cm),' / ' * upper y-coordinate of the beam (cm),' / ' distance t *o the plane (cm),'/) WRITE(6,6390)6390 FORMAT(' or (6) Uniform isotropically radiating parallelepiped w *ithin'/ ' the phantom'/ ' Requires 8 inputs:'/ ' * charge (-1,0,1),' / ' 6 (mandatory, to identify * source type),' / ' lower x-coordinate of active volume ( *cm)'/ ' upper x-coordinate of active volume (cm),' / ' * lower y-coordinate of active volume (cm) '/ ' upper y *-coordinate of active volume (cm),' / ' lower z-coordinat *e of active volume (cm) ' / ' upper z-coordinate of acti *ve volume (cm) '/) WRITE(6,6400)6400 FORMAT(' or (7) Parallel beam incident from multiple, user-selec *ted angles'/ ' Requires 9 inputs on this line:'/ ' char *ge (-1,0,1),' / ' 7 (mandatory, to identify source type), *' / ' x-coordinate of the isocenter (cm),' / ' y-coo *rdinate of the isocenter (cm),' / ' z-coordinate of the i *socenter (cm),' / ' number of incident theta-phi pairs or * -ve number of', / ' groups of incident theta-phi pair *s where, within a group', / ' only theta or phi can va *ry, the varying angles are' / ' evenly distributed and * have equal probability,' / ' total x-width of the beam i *n the plane perpendicular' / ' to the beamdirection (c *m),' / ' total y-width of the beam in the plane perpendic *ular' / ' to the beam direction (cm),' / ' an *gle by which the collimator is rotated in the' / ' collima *tor plane perpendicular to the beam' / ' direction (degrees), * ' / ' (+ve rotation is counterclockw *ise looking along' / ' thebeam direction' /) WRITE(6,6410)6410 FORMAT(' or (8) Full phase-space incident from multiple angles'/ * ' Requires 8 inputs on this line and data stored in unit *s 43,44:'/ ' charge (-1 electron,0 photon,1 positron, 2al *l),' / ' 2 (mandatory, to identify source type),' / ' * x-coordinate of the isocenter (cm),' / ' y-coordinate * of the isocenter (cm),' / ' z-coordinate of the isocente *r (cm),' / ' number of incident theta-phi pairs or -ve nu *mber of', / ' groups of incident theta-phi pairs where *, within a group', / ' only theta or phi can vary, the * varying angles are' / ' evenly distributed and have e *qual probability,' / ' absolute distance from the isocent *er to the origin' / ' in the phase space plane * ' / ' angle by which the source is rotated in t *he' / ' phase space plane perpendicular to the beam' / * ' direction (degrees), '/ ' * (+ve rotation is counterclockwise looking down' /'
![Page 131: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/131.jpg)
* from the origin in the phase space plane),' / ' i_dbs--s *et to 1 if DBS was used in BEAM simulation used' / ' t *o generate the phsp source and you want to reject fat' / ' * photons, 0 otherwise,'/ ' DBS splitting radius (cm), *'/ ' SSD at which splitting radius defined(cm),'/ ' * Z at which phsp source collected (cm)',/ ' No. of times to * split charged particles.'/) WRITE(6,6420)6420 FORMAT(' or (9) BEAM simulation of treatment head' / 'Requires 1 *1 inputs plus name of accelerator simulation,'/ ' input file use *d in accelerator simulation, and pegs4'/ ' data used in accelera *tor simulation:'/ ' charge (-1 electron,0 photon,1 positr *on, 2 all),' / ' 9 (mandatory, to identify source type),' * / ' x-coordinate of the isocenter (cm),' / ' y- *coordinate of the isocenter (cm),' / ' z-coordinate of the is *ocenter (cm),' / ' angle between beam central axis and +z * axis in DOSXYZ'/ ' geometry--called the polar angle(d *egrees),' / ' angle between +x direction in DOSXYZ geomet *ry and' / ' beam central axis projected on the DOSXYZ *xy plane' / ' --called the azimuthal angle (degrees),' * / ' absolute distance from the isocenter to centre of' / * ' scoring plane in BEAM simulation,' / ' ang *le to rotate BEAM simulation about its central' / ' ax *is (degrees) (+ve rotation is counterclockwise'/ ' loo *king down the axis),' / ' i_dbs--set to 1 if DBS is being * used in BEAM simulation' / ' and you want to reject fat photon *s, 0 otherwise,'/ 'No. of times to split charged particles.'/) WRITE(6,6430)6430 FORMAT(' or (10) BEAM simulation source incident from multiple a *ngles' / ' Requires 10 inputs plus name of accelerator si *mulation,'/ ' input file used in accelerator simulation,a *nd pegs4'/ ' data used in accelerator simulation:'/ ' * charge (-1 electron,0 photon,1 positron, 2 all),' / ' 9 (man *datory, to identify source type),' / ' x-coordinate of th *e isocenter (cm),' / ' y-coordinate of the isocenter (cm) *,' / ' z-coordinate of the isocenter (cm),' / ' *number of incident theta-phi pairs or -ve number of', /' * groups of incident theta-phi pairs where, within a group', / ' * only theta or phi can vary, the varying angles are' / *' evenly distributed and have equal probability,' / ' * absolute distance from the isocenter to centre of' / ' * scoring plane in BEAM simulation,' / ' angle to rotate * BEAM simulation about its central' / ' axis (degrees) (+ve rot *ation is counterclockwise'/ ' looking down the axis),' / ' * i_dbs--set to 1 if DBS is being used in BEAM simulation' / ' * and you want to reject fat photons, 0 otherwise,'/ ' * No. of times to splitcharged particles.'/) WRITE(6,6440)6440 FORMAT(' or (20) Phase Space Incident from multiple settings '/' * optionally through an MLC'/ ' Requires 6 inputs plus na *me of the input file used'/ ' for vcu SIM. and the VCU code *(particleDmlc) if using MLC'/ ' data used in simulation:' */ ' charge (-1 electron,0 photon,1 positron, 2 all),' /' * 10 (mandatory, to identify source type),' / 'number of in *cident settings:x|y|ziso,theta,phi,phicol ', / ' absolute dista *nce from the isocenter to centre of' / ' scoring plane (above *the MLC if MLC present),' / ' i_dbs--set to 1 if DBS is b *eing used in simulation' / ' and you want to reject fat photons, 0
![Page 132: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/132.jpg)
* otherwise,'/ ' No. of times to split charged particles.' */) WRITE(6,6450)6450 FORMAT(' or (21) BEAM simulation of treatment head will multiple * settings' / ' optionally through a MLC'/ ' Requires na *me of accelerator simulation,'/ ' input file used in acce *lerator simulation, and pegs4'/ ' data used in accelerato *r simulation, name of input file'/ ' for vcu SIM. and the VC *U code (particleDmlc) if using MLC'/ ' charge (-1 electro *n,0 photon,1 positron, 2 all),' / ' 11 (mandatory, to ide *ntify source type),' / ' number of incident settings:x|y| *ziso,theta,phi,phicol ', / ' absolute distance from the i *socenter to centre of' / ' would be scoring plane (abovet *he MLC if MLC present),' / ' i_dbs--set to 1 if DBS is be *ing used in BEAM simulation' / ' and you want to rejec *t fat photons, 0 otherwise,'/ ' No. of times to split cha *rged particles.'/) WRITE(6,6460)6460 FORMAT(' All inputs on one line:',$) READ(5,6470)iqin,isource,(temp(i),i=1,12)6470 FORMAT(2i12,12f15.0) IF (( (iqin .LT. -1) .OR. (iqin .GT. 1 .AND. isource .NE. 2 .AND. *isource .LT. 8) .OR. (iqin .GT. 2) )) THEN iqin=0 END IF IF ((isource .EQ. 0)) THEN xinl = temp(1) xinu = temp(2) yinl = temp(3) yinu = temp(4) thetax = temp(5) thetay = temp(6) thetaz = temp(7) WRITE(6,6480)iqin,xinl,xinu,yinl,yinu,thetax,thetay,thetaz6480 FORMAT(/ ' Parallel beam incident from the front(+ve z-axis)'/ *' Electric charge of the source:',t40,i12 / ' x-boundaries:',t26,f *10.4,' cm --',f10.4,' cm' / ' y-boundaries:',t26,f10.4,'cm --',f10 *.4,' cm' / ' Angle relative to +x:',t40,f10.4 / ' Anglerelative to * +y:',t40,f10.4 / ' Angle relative to -z:',t40,f10.4 //) ELSE IF((isource .EQ. 1)) THEN xiso = temp(1) yiso = temp(2) ziso = temp(3) theta(1) = temp(4) phi(1) = temp(5) xcol = temp(6) ycol = temp(7) phicol = temp(8) WRITE(6,6490)iqin,xiso,yiso,ziso,theta(1),phi(1),xcol,ycol,phi * col6490 FORMAT(/ ' Parallel beam incident from an arbitrary direction' */ ' Electric charge of the source:' ,t40,i12 / ' x-coordinateof th *e isocenter:' ,t40,f10.4 / ' y-coordinate of the isocenter:',t40,f *10.4 / ' z-coordinate of the isocenter:' ,t40,f10.4 / 'Polar angle * of collimator center:' ,t40,f10.4 / ' Azimuthal angleof collimato *r center:',t40,f10.4 / ' Total x-collimator width:' ,t40,f10.4 / ' * Total y-collimator width:' ,t40,f10.4 / ' Collimator rotation ang *le:' ,t40,f10.4 //)
![Page 133: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/133.jpg)
ELSE IF((isource .EQ. 2)) THEN xiso = temp(1) yiso = temp(2) ziso = temp(3) theta(1) = temp(4) phi(1) = temp(5) dsource = temp(6) phicol = temp(7) iqphsp=iqin i_dbs=temp(8) r_dbs=temp(9) ssd_dbs=temp(10) z_dbs=temp(11) e_split=temp(12) WRITE(6,6500)xiso,yiso,ziso,theta(1),phi(1),dsource,phicol,e_s * plit6500 FORMAT(/ ' Full phase space from an arbitrary direction'/ ' x- *coordinate of the isocenter:' ,t55,f10.4/ ' y-coordinate of the is *ocenter:' ,t55,f10.4/ ' z-coordinate of the isocenter:' ,t55,f10.4 */ ' Polar angle of origin in source plane:',t55,f10.4/ ' Azimuthal * angle of origin in source plane:' ,t55,f10.4/ ' Distance from iso *center to origin in source plane:',t55,f10.4/ ' Source rotation an *gle:' ,t55,f10.4/ ' No. of times to split e+/e-:' ,t55,i10/) IF ((i_dbs.EQ.1)) THEN WRITE(6,6510)r_dbs,ssd_dbs,z_dbs6510 FORMAT(/ ' Directional Bremsstrahlung Splitting (DBS) used *'/ ' in BEAM simulation to generate phase space source with:'/ ' *DBS splitting radius:',t55,f10.4/ ' SSD where radius defined:', *t55,f10.4/ ' Z where source scored:',t55,f10.4/ ' Photons whose * trajectory takes them outside the DBS splitting'/ ' radius at the * SSD will be rejected.'/) IF ((ssd_dbs.LT.z_dbs)) THEN WRITE(6,6520)6520 FORMAT(//' ***WARNING:'/ ' SSD where DBS splitting rad *ius is defined < the Z'/ ' value of scoring plane for this source. *'/ ' Particle rejection will be turned off.'//) i_dbs=0 END IF ELSE i_dbs=0 END IF IF ((iqphsp.EQ.2)) THEN WRITE(6,6530)6530 FORMAT(/' Charge of incident particles to use: -1, 0, 1'/) ELSE WRITE(6,6540)iqphsp6540 FORMAT(/' Charge of incident particles to use: ',i2/) END IF ELSE IF((isource .EQ. 3)) THEN xinl = temp(1) xinu = temp(2) yinl = temp(3) yinu = temp(4) ssd = temp(5) WRITE(6,6550)iqin,xinl,xinu,yinl,yinu,ssd6550 FORMAT(/ ' Point source incident from the front(+ve z-axis)'/' * Electric charge of the source:',t40,i12 / ' x-boundaries:',t26,f1 *0.4,' cm --',f10.4,' cm' / ' y-boundaries:',t26,f10.4,' cm --',f10
![Page 134: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/134.jpg)
*.4,' cm' / ' SSD :',t40,f10.4 /) ELSE IF((isource .EQ. 4)) THEN xiso = temp(1) yiso = temp(2) ziso = temp(3) theta(1)= temp(4) phi(1) = temp(5) dsource = temp(6) phicol = temp(7) iqphsp = iqin WRITE(6,6560)xiso,yiso,ziso,theta(1),phi(1),dsource,phicol6560 FORMAT(/ ' Beam characterization model, source from an arbitra *ry direction'/ ' x-coordinate of the isocenter:' ,t50,f8.3/ ' y-co *ordinate of the isocenter:' ,t50,f8.3/ ' z-coordinate of the isoce *nter:' ,t50,f8.3/ ' Polar angle of source center:' ,t50,f8.3/ ' Az *imuthal angle of source center:' ,t50,f8.3/ ' Distance from isocen *ter to source centre:',t50,f8.3/ ' Source rotation angle:' ,t50,f8 *.3/ /) ELSE IF((isource .EQ. 6)) THEN xinl = temp(1) xinu = temp(2) yinl = temp(3) yinu = temp(4) zinl = temp(5) zinu = temp(6) WRITE(6,6570)iqin,xinl,xinu,yinl,yinu,zinl,zinu6570 FORMAT(/ ' Uniform isotropically radiating parallelepiped:'/ ' * Electric charge of the source:',t40,i12 / ' x-boundaries:',t26,f1 *0.4,' cm --',f10.4,' cm' / ' y-boundaries:',t26,f10.4,' cm --',f10 *.4,' cm' / ' z-boundaries:',t26,f10.4,' cm --',f10.4,' cm'/) IF ((xinl.GT.xinu)) THEN WRITE(6,6580)6580 FORMAT(//' ***ERROR in source 6:'/ ' xinl > xinu '//) STOP END IF IF ((yinl.GT.yinu)) THEN WRITE(6,6590)6590 FORMAT(//' ***ERROR in source 6:'/ ' yinl > yinu '//) STOP END IF IF ((zinl.GT.zinu)) THEN WRITE(6,6600)6600 FORMAT(//' ***ERROR in source 6:'/ ' zinl > zinu '//) STOP END IF ELSE IF((isource .EQ. 7)) THEN xiso = temp(1) yiso = temp(2) ziso = temp(3) nang = temp(4) xcol = temp(5) ycol = temp(6) phicol = temp(7) IF ((nang.GT.0)) THEN WRITE(6,6610)iqin,xiso,yiso,ziso,nang,xcol,ycol,phicol6610 FORMAT(/ ' Parallel beam incident from multiple, user-sele *cted angles'/ ' Electric charge of the source:' ,t40,i12 / ' x-coo *rdinate of the isocenter:' ,t40,f10.4 / ' y-coordinate of the isoc
![Page 135: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/135.jpg)
*enter:' ,t40,f10.4 / ' z-coordinate of the isocenter:' ,t40,f10.4/ * ' Number of incident theta-phi:' ,t40,i12 / ' Total x-collimator *width:' ,t40,f10.4 / ' Total y-collimator width:' ,t40,f10.4 / ' C *ollimator rotation angle:' ,t40,f10.4 /) IF ((nang.GT.60000)) THEN WRITE(6,6620)60000 WRITE(1,6620)600006620 FORMAT(//' ***ERROR in source 7***'/ ' Number of incid *ent theta-phi > max. allowed (',I4,')'/ ' Increase $MXANG in dosxy *z_user_macros.mortran, recompile'/ ' and try again.'//) STOP END IF temp(1)=0. DO 6631 I=1,nang WRITE(6,6640)I6640 FORMAT(' Incident theta-phi pair ',I4,':'/ ' theta( *deg.), phi (deg.), probability:',$) READ(5,6650)theta(I),phi(I),pang(I)6650 FORMAT(3F15.0) WRITE(6,6660)theta(I),phi(I),pang(I)6660 FORMAT(3F10.4) temp(1)=temp(1)+pang(I)6631 CONTINUE6632 CONTINUE DO 6671 I=1,nang pang(I)=pang(I)/temp(1) IF ((I.GT.1)) THEN pang(I)=pang(I)+pang(I-1) END IF6671 CONTINUE6672 CONTINUE numang=nang ELSE IF((nang.LT.0)) THEN WRITE(6,6680)iqin,xiso,yiso,ziso,-nang,xcol,ycol,phicol6680 FORMAT(/ ' Parallel beam incident from multiple, user-sele *cted angles'/ ' Electric charge of the source:' ,t40,i12 / ' x-coo *rdinate of the isocenter:' ,t40,f10.4 / ' y-coordinate of the isoc *enter:' ,t40,f10.4 / ' z-coordinate of the isocenter:' ,t40,f10.4/ * ' No. of theta-phi groups:' ,t40,i12 / ' Total x-collimator width *:' ,t40,f10.4 / ' Total y-collimator width:' ,t40,f10.4 /' Collima *tor rotation angle:' ,t40,f10.4 /) temp(1)=0. WRITE(6,6690)6690 FORMAT(' For each theta-phi group, input:'/ ' ivary (=0t *o vary phi, 1 to vary theta), fixed theta/phi (deg.), '/ ' min. *varying theta/phi (deg.), max. varying theta/phi (deg.), '/ ' no *. of varying angles in group (including min. and max.), '/ ' pro *bability for group (all on one line).') DO 6701 I=1,-nang WRITE(6,6710)I6710 FORMAT(' Incident theta-phi group ',I4,/ ' :',$) READ(5,6720)ivary(I),angfixed(I),angmin(I),angmax(I),n * gang(I),pgang(I)6720 FORMAT(I12,3F15.0,I12,F15.0) IF ((ngang(I).LT.2)) THEN WRITE(6,6730)6730 FORMAT(//' ***WARNING***'/ ' ngang(i) must be >=2. * It will be reset to 2 '/ ' in this case. '//)
![Page 136: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/136.jpg)
ngang(I)=2 END IF WRITE(6,6740)ivary(I),angfixed(I),angmin(I),angmax(I), * ngang(I),pgang(I)6740 FORMAT(I10,3F10.4,I10,F10.4) temp(1)=temp(1)+pgang(I)6701 CONTINUE6702 CONTINUE K=0 DO 6751 I=1,-nang pgang(I)=pgang(I)/temp(1) DO 6761 J=1,ngang(I) K=K+1 IF ((K.GT.60000)) THEN WRITE(6,6770)60000 WRITE(1,6770)600006770 FORMAT(//' ***ERROR in source 7***'/ ' Numbero *f incident theta-phi > max. allowed (',I4,')'/ ' Increase $MXANGin * dosxyz_user_macros.mortran, recompile'/ ' and try again.'//) STOP END IF IF ((ivary(I).EQ.1)) THEN phi(K)=angfixed(I) theta(K)=angmin(I)+(J-1)*(angmax(I)-angmin(I)) * /(ngang(I)-1) ELSE theta(K)=angfixed(I) phi(K)=angmin(I)+(J-1)*(angmax(I)-angmin(I))/( * ngang(I)-1) END IF pang(K)=pgang(I)/ngang(I) IF ((K.GT.1)) THEN pang(K)=pang(K)+pang(K-1) END IF6761 CONTINUE6762 CONTINUE6751 CONTINUE6752 CONTINUE numang=K END IF WRITE(6,6780)6780 FORMAT(' ') ELSE IF((isource .EQ. 8)) THEN xiso = temp(1) yiso = temp(2) ziso = temp(3) nang = temp(4) dsource = temp(5) phicol = temp(6) iqphsp=iqin i_dbs=temp(7) r_dbs=temp(8) ssd_dbs=temp(9) z_dbs=temp(10) e_split=temp(11) IF ((nang.GT.0)) THEN WRITE(6,6790)xiso,yiso,ziso,nang,dsource,phicol,e_split6790 FORMAT(/ ' Full hase space from multiple, user-selected an
![Page 137: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/137.jpg)
*gles'/ ' x-coordinate of the isocenter:' ,t55,f10.4/ ' y-coordinat *e of the isocenter:' ,t55,f10.4/ ' z-coordinate of the isocenter:' *,t55,f10.4/ ' Number of incident theta-phi:',t55,i10/ ' Distance f *rom isocenter to origin in source plane:',t55,f10.4/ ' Source rota *tion angle:' ,t55,f10.4/ ' No. of times to split e+/e-:',t55,i10/) IF ((i_dbs.EQ.1)) THEN WRITE(6,6800)r_dbs,ssd_dbs,z_dbs6800 FORMAT(/ ' Directional Bremsstrahlung Splitting (DBS)u *sed'/ ' in BEAM simulation to generate phase space source with:'/' * DBS splitting radius:',t55,f10.4/ ' SSD where radius define *d:',t55,f10.4/ ' Z where source scored:',t55,f10.4/ ' Photons w *hose trajectory takes them outside the DBS splitting'/ ' radius at * the SSD will be rejected.'/) IF ((ssd_dbs.LT.z_dbs)) THEN WRITE(6,6810)6810 FORMAT(//' ***WARNING:'/ ' SSD where DBS splitting * radius is defined < the Z'/ ' value of scoring plane for this sou *rce.'/ ' Particle rejection will be turned off.'//) i_dbs=0 END IF ELSE i_dbs=0 END IF IF ((iqphsp.EQ.2)) THEN WRITE(6,6820)6820 FORMAT(/' Charge of incident particles to use: -1, 0,1 *'/) ELSE WRITE(6,6830)iqphsp6830 FORMAT(/' Charge of incident particles to use: ',i2/) END IF IF ((nang.GT.60000)) THEN WRITE(6,6840)60000 WRITE(1,6840)600006840 FORMAT(//' ***ERROR in source 7***'/ ' Number of incid *ent theta-phi > max. allowed (',I4,')'/ ' Increase $MXANG in dosxy *z_user_macros.mortran, recompile'/ ' and try again.'//) STOP END IF temp(1)=0. DO 6851 I=1,nang WRITE(6,6860)I6860 FORMAT(' Incident theta-phi pair ',I4,':'/ ' theta( *deg.), phi (deg.), probability:',$) READ(5,6870)theta(I),phi(I),pang(I)6870 FORMAT(3F15.0) WRITE(6,6880)theta(I),phi(I),pang(I)6880 FORMAT(3F10.4) temp(1)=temp(1)+pang(I)6851 CONTINUE6852 CONTINUE DO 6891 I=1,nang pang(I)=pang(I)/temp(1) IF ((I.GT.1)) THEN pang(I)=pang(I)+pang(I-1) END IF6891 CONTINUE6892 CONTINUE
![Page 138: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/138.jpg)
numang=nang ELSE IF((nang.LT.0)) THEN WRITE(6,6900)xiso,yiso,ziso,-nang,dsource,phicol6900 FORMAT(/ ' Full phase space from multiple, user-selected a *ngles'/ ' x-coordinate of the isocenter:' ,t55,f10.4/ ' y-coordina *te of the isocenter:' ,t55,f10.4/ ' z-coordinate of the isocenter: *' ,t55,f10.4/ ' Number of theta-phi groups:',t55,i10/ ' Distance f *rom isocenter to origin in source plane:',t55,f10.4/ ' Source rota *tion angle:' ,t55,f10.4/) IF ((i_dbs.EQ.1)) THEN WRITE(6,6910)r_dbs,ssd_dbs,z_dbs6910 FORMAT(/ ' Directional Bremsstrahlung Splitting (DBS)u *sed'/ ' in BEAM simulation to generate phase space source with:'/' * DBS splitting radius:',t55,f10.4/ ' SSD where radius define *d:',t55,f10.4/ ' Z where source scored:',t55,f10.4/ ' Photons w *hose trajectory takes them outside the DBS splitting'/ ' radius at * the SSD will be rejected.'/) IF ((ssd_dbs.LT.z_dbs)) THEN WRITE(6,6920)6920 FORMAT(//' ***WARNING:'/ ' SSD where DBS splitting * radius is defined < the Z'/ ' value of scoring plane for this sou *rce.'/ ' Particle rejection will be turned off.'//) i_dbs=0 END IF ELSE i_dbs=0 END IF IF ((iqphsp.EQ.2)) THEN WRITE(6,6930)6930 FORMAT(/' Charge of incident particles to use: -1, 0,1 *'/) ELSE WRITE(6,6940)iqphsp6940 FORMAT(/' Charge of incident particles to use: ',i2/) END IF temp(1)=0. WRITE(6,6950)6950 FORMAT(' For each theta-phi group, input:'/ ' ivary (=0t *o vary phi, 1 to vary theta), fixed theta/phi (deg.), '/ ' min. *varying theta/phi (deg.), max. varying theta/phi (deg.), '/ ' no *. of varying angles in group (including min. and max.), '/ ' pro *bability for group (all on one line).') DO 6961 I=1,-nang WRITE(6,6970)I6970 FORMAT(' Incident theta-phi group ',I4,/ ' :',$) READ(5,6980)ivary(I),angfixed(I),angmin(I),angmax(I),n * gang(I),pgang(I)6980 FORMAT(I12,3F15.0,I12,F15.0) IF ((ngang(I).LT.2)) THEN WRITE(6,6990)6990 FORMAT(//' ***WARNING***'/ ' ngang(i) must be >=2. * It will be reset to 2 '/ ' in this case. '//) ngang(I)=2 END IF WRITE(6,7000)ivary(I),angfixed(I),angmin(I),angmax(I), * ngang(I),pgang(I)7000 FORMAT(I10,3F10.4,I10,F10.4) temp(1)=temp(1)+pgang(I)
![Page 139: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/139.jpg)
6961 CONTINUE6962 CONTINUE K=0 DO 7011 I=1,-nang pgang(I)=pgang(I)/temp(1) DO 7021 J=1,ngang(I) K=K+1 IF ((K.GT.60000)) THEN WRITE(6,7030)60000 WRITE(1,7030)600007030 FORMAT(//' ***ERROR in source 7***'/ ' Numbero *f incident theta-phi > max. allowed (',I4,')'/ ' Increase $MXANGin * dosxyz_user_macros.mortran, recompile'/ ' and try again.'//) STOP END IF IF ((ivary(I).EQ.1)) THEN phi(K)=angfixed(I) theta(K)=angmin(I)+(J-1)*(angmax(I)-angmin(I)) * /(ngang(I)-1) ELSE theta(K)=angfixed(I) phi(K)=angmin(I)+(J-1)*(angmax(I)-angmin(I))/( * ngang(I)-1) END IF pang(K)=pgang(I)/ngang(I) IF ((K.GT.1)) THEN pang(K)=pang(K)+pang(K-1) END IF7021 CONTINUE7022 CONTINUE7011 CONTINUE7012 CONTINUE numang=K END IF WRITE(6,7040)7040 FORMAT(' ') ELSE IF((isource .EQ. 9)) THEN xiso = temp(1) yiso = temp(2) ziso = temp(3) theta(1) = temp(4) phi(1) = temp(5) dsource = temp(6) phicol = temp(7) iqinc=iqin i_dbs=temp(8) e_split=temp(9) WRITE(6,7050)xiso,yiso,ziso,theta(1),phi(1),dsource,phicol,e_s * plit7050 FORMAT(/ ' BEAM simulation of treatment head incident from any * direction'/ ' x-coordinate of the isocenter:' ,t55,f10.4/ ' y-coo *rdinate of the isocenter:' ,t55,f10.4/ ' z-coordinate of the isoce *nter:' ,t55,f10.4/ ' Polar angle of beam central axis:',t55,f10.4/ *' Azimuthal angle of beam central axis:' ,t55,f10.4/ ' Distance fr *om isocenter to centre of'/ ' scoring plane in BEAM sim *ulation:',t55,f10.4/ ' Rotation angle about beam axis:',t55,f10.4/ * ' No. of times to split e+/e-:',t55,i10/) IF ((i_dbs.EQ.1)) THEN
![Page 140: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/140.jpg)
WRITE(6,7060)7060 FORMAT(' Fat photons resulting from DBS will be rejected'/ *) ELSE WRITE(6,7070)7070 FORMAT(' Fat photons resulting from DBS will not be reject *ed'/) i_dbs=0 END IF IF ((iqinc.EQ.2)) THEN WRITE(6,7080)7080 FORMAT(/' Charge of incident particles to use: -1, 0, 1'/) ELSE WRITE(6,7090)iqinc7090 FORMAT(/' Charge of incident particles to use: ',i2/) END IF ELSE IF((isource .EQ. 10)) THEN xiso = temp(1) yiso = temp(2) ziso = temp(3) nang = temp(4) dsource = temp(5) phicol = temp(6) iqinc=iqin i_dbs=temp(7) e_split=temp(8) IF ((nang.GT.0)) THEN WRITE(6,7100)xiso,yiso,ziso,nang,dsource,phicol,e_split7100 FORMAT(/ ' BEAM simulation source incident from multiple a *ngles'/ ' x-coordinate of the isocenter:' ,t55,f10.4/ ' y-coordina *te of the isocenter:' ,t55,f10.4/ ' z-coordinate of the isocenter: *' ,t55,f10.4/ ' No. of incident theta-phi:',t55,i10/ ' Distance fr *om isocenter to centre of'/ ' scoring plane in BEAM sim *ulation:',t55,f10.4/ ' Rotation angle about beam axis:',t55,f10.4/ *' No. of time to split e+/e-:',t55,i10/) ELSE IF((nang.LT.0)) THEN WRITE(6,7110)xiso,yiso,ziso,-nang,dsource,phicol,e_split7110 FORMAT(/ ' BEAM simulation source incident from multiple a *ngles'/ ' x-coordinate of the isocenter:' ,t55,f10.4/ ' y-coordina *te of the isocenter:' ,t55,f10.4/ ' z-coordinate of the isocenter: *' ,t55,f10.4/ ' No. of theta-phi groups:',t55,i10/ ' Distance from * isocenter to centre of'/ ' scoring plane in BEAM simul *ation:',t55,f10.4/ ' Rotation angle about beam axis:',t55,f10.4/ ' * No. of time to split e+/e-:',t55,i10/) END IF IF ((i_dbs.EQ.1)) THEN WRITE(6,7120)7120 FORMAT(' Fat photons resulting from DBS will be rejected'/ *) ELSE WRITE(6,7130)7130 FORMAT(' Fat photons resulting from DBS will not be reject *ed'/) i_dbs=0 END IF IF ((iqinc.EQ.2)) THEN WRITE(6,7140)7140 FORMAT(/' Charge of incident particles to use: -1, 0, 1'/)
![Page 141: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/141.jpg)
ELSE WRITE(6,7150)iqinc7150 FORMAT(/' Charge of incident particles to use: ',i2/) END IF IF ((nang.GT.0)) THEN IF ((nang.GT.60000)) THEN WRITE(6,7160)60000 WRITE(1,7160)600007160 FORMAT(//' ***ERROR in source 7***'/ ' Number of incid *ent theta-phi > max. allowed (',I4,')'/ ' Increase $MXANG in dosxy *z_user_macros.mortran, recompile'/ ' and try again.'//) STOP END IF temp(1)=0. DO 7171 I=1,nang WRITE(6,7180)I7180 FORMAT(' Incident theta-phi pair ',I4,':'/ ' theta( *deg.), phi (deg.), probability:',$) READ(5,7190)theta(I),phi(I),pang(I)7190 FORMAT(3F15.0) WRITE(6,7200)theta(I),phi(I),pang(I)7200 FORMAT(3F10.4) temp(1)=temp(1)+pang(I)7171 CONTINUE7172 CONTINUE DO 7211 I=1,nang pang(I)=pang(I)/temp(1) IF ((I.GT.1)) THEN pang(I)=pang(I)+pang(I-1) END IF7211 CONTINUE7212 CONTINUE numang=nang ELSE IF((nang.LT.0)) THEN temp(1)=0. WRITE(6,7220)7220 FORMAT(' For each theta-phi group, input:'/ ' ivary (=0t *o vary phi, 1 to vary theta), fixed theta/phi (deg.), '/ ' min. *varying theta/phi (deg.), max. varying theta/phi (deg.), '/ ' no *. of varying angles in group (including min. and max.), '/ ' pro *bability for group (all on one line).') DO 7231 I=1,-nang WRITE(6,7240)I7240 FORMAT(' Incident theta-phi group ',I4,/ ' :',$) READ(5,7250)ivary(I),angfixed(I),angmin(I),angmax(I),n * gang(I),pgang(I)7250 FORMAT(I12,3F15.0,I12,F15.0) IF ((ngang(I).LT.2)) THEN WRITE(6,7260)7260 FORMAT(//' ***WARNING***'/ ' ngang(i) must be >=2. * It will be reset to 2 '/ ' in this case. '//) ngang(I)=2 END IF WRITE(6,7270)ivary(I),angfixed(I),angmin(I),angmax(I), * ngang(I),pgang(I)7270 FORMAT(I10,3F10.4,I10,F10.4) temp(1)=temp(1)+pgang(I)7231 CONTINUE
![Page 142: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/142.jpg)
7232 CONTINUE K=0 DO 7281 I=1,-nang pgang(I)=pgang(I)/temp(1) DO 7291 J=1,ngang(I) K=K+1 IF ((K.GT.60000)) THEN WRITE(6,7300)60000 WRITE(1,7300)600007300 FORMAT(//' ***ERROR in source 7***'/ ' Numbero *f incident theta-phi > max. allowed (',I4,')'/ ' Increase $MXANGin * dosxyz_user_macros.mortran, recompile'/ ' and try again.'//) STOP END IF IF ((ivary(I).EQ.1)) THEN phi(K)=angfixed(I) theta(K)=angmin(I)+(J-1)*(angmax(I)-angmin(I)) * /(ngang(I)-1) ELSE theta(K)=angfixed(I) phi(K)=angmin(I)+(J-1)*(angmax(I)-angmin(I))/( * ngang(I)-1) END IF pang(K)=pgang(I)/ngang(I) IF ((K.GT.1)) THEN pang(K)=pang(K)+pang(K-1) END IF7291 CONTINUE7292 CONTINUE7281 CONTINUE7282 CONTINUE numang=K END IF WRITE(6,7310)7310 FORMAT(' ') ELSE IF((isource .EQ. 20)) THEN nset = temp(1) iqinc=iqin i_dbs=temp(2) e_split=temp(3) IF ((nset.GT.0)) THEN WRITE(6,7320)nset,e_split7320 FORMAT(/ ' Phase Space Incident from multiple settings and * through an MLC'/ ' Number of settings:',t55,f10.4/ ' No. of timet *o split e+/e-:',t55,i10/) IF ((i_dbs.EQ.1)) THEN WRITE(6,7330)7330 FORMAT(' Fat photons resulting from DBS will be reject *ed'/) ELSE WRITE(6,7340)7340 FORMAT(' Fat photons resulting from DBS will not be re *jected'/) i_dbs=0 END IF IF ((iqinc.EQ.2)) THEN WRITE(6,7350)7350 FORMAT(/' Charge of incident particles to use: -1, 0,1
![Page 143: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/143.jpg)
*'/) ELSE WRITE(6,7360)iqinc7360 FORMAT(/' Charge of incident particles to use: ',i2/) END IF IF ((nset.GT.60000)) THEN WRITE(6,7370)60000 WRITE(1,7370)600007370 FORMAT(//' ***ERROR in source 20***'/ ' Number of inci *dent settings > max. allowed (',I4,')'/ ' Increase $MXANG in dosxy *z_user_macros.mortran, recompile'/ ' and try again.'//) STOP END IF DO 7381 I=1,nset WRITE(6,7390)I7390 FORMAT(' Incident setting ',I4,':'/ ' xiso (cm), yi *so (cm), ziso (cm), theta (deg.)', ', phi (deg.), phicol (deg.),SA *D (cm), MU Index:',$) READ(5,7400)xtemp(I),ytemp(I),ztemp(I),thetatemp(I),ph * itemp(I), phicoltemp(I),dsourcetemp(I),muIndex(I)7400 FORMAT(8F15.0) WRITE(6,7410)xtemp(I),ytemp(I),ztemp(I),thetatemp(I),p * hitemp(I), phicoltemp(I),dsourcetemp(I), muIndex(I)7410 FORMAT(8F10.4)7381 CONTINUE7382 CONTINUE dsource=dsourcetemp(1) ELSE IF((nset.LT.0)) THEN WRITE(6,7420)nset WRITE(1,7420)nset7420 FORMAT(//' ***ERROR in source 20***'/ 'nset (',I8,') mustb *e positive'//) STOP END IF WRITE(6,7430)7430 FORMAT(' ') ELSE IF((isource .EQ. 21)) THEN nset=temp(1) i_dbs=temp(2) e_split=temp(3) iqinc=iqin IF ((nset.GT.0)) THEN WRITE(6,7440)nset,dsource,e_split7440 FORMAT(/ ' Full BEAM Sim. incident from multiple settings' */ ' Number of settings:',t55,f10.4/ ' Distance from isocenter to c *entre:',t55,f10.4/ ' No. of time to split e+/e-:',t55,i10/) IF ((i_dbs.EQ.1)) THEN WRITE(6,7450)7450 FORMAT(' Fat photons resulting from DBS will be reject *ed'/) ELSE WRITE(6,7460)7460 FORMAT(' Fat photons resulting from DBS will not be re *jected'/) i_dbs=0 END IF IF ((iqinc.EQ.2)) THEN WRITE(6,7470)
![Page 144: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/144.jpg)
7470 FORMAT(/' Charge of incident particles to use: -1, 0,1 *'/) ELSE WRITE(6,7480)iqphsp7480 FORMAT(/' Charge of incident particles to use: ',i2/) END IF IF ((nset.GT.60000)) THEN WRITE(6,7490)60000 WRITE(1,7490)600007490 FORMAT(//' ***ERROR in source 12***'/ ' Number of inci *dent settings > max. allowed (',I4,')'/ ' Increase $MXANG in dosxy *z_user_macros.mortran, recompile'/ ' and try again.'//) STOP END IF DO 7501 I=1,nset WRITE(6,7510)I7510 FORMAT(' Incident setting ',I4,':'/ ' xiso (cm), yiso * (cm), ziso (cm), theta (deg.)', ' phi (deg.), phicol (deg.), SAD * (cm), MU Index:',$) READ(5,7520)xtemp(I),ytemp(I),ztemp(I),thetatemp(I),ph * itemp(I), phicoltemp(I),dsourcetemp(I), muIndex(I)7520 FORMAT(8F15.0) WRITE(6,7530)xtemp(I),ytemp(I),ztemp(I),thetatemp(I),p * hitemp(I), phicoltemp(I),dsourcetemp(I),muIndex(I)7530 FORMAT(8F10.4)7501 CONTINUE7502 CONTINUE dsource=dsourcetemp(1) ELSE IF((nset.LT.0)) THEN WRITE(6,7540)nset WRITE(1,7540)nset7540 FORMAT(//' ***ERROR in source 21***'/ 'nset (',I8,') mustb *e positive'//) STOP END IF WRITE(6,7550)7550 FORMAT(' ') ELSE WRITE(6,7560)isource WRITE(1,7560)isource7560 FORMAT(' ***ISOURCE =', I10,' not valid: stopping') stop END IF WRITE(6,7570)7570 FORMAT(' Enflag(0=mono-E,1=spectr,2=phsp or full BEAM sim.,3=dosec *omp,4=beam model),'/' Mode(0,2), medsur(0 = vacuum), dsurround(1), * dflag(0=1 dsurround,'/ ' 1=4 dsurrounds), dsurround(2), dsurround *(3), dsurround(4)',/,' :',$) READ(5,7580)enflag,ismode,medsur,dsurround(1),dflag,dsurround(2),d *surround(3), dsurround(4)7580 FORMAT(3I12,F15.0,I12,3F15.0) IF ((enflag.GT.1)) THEN IF((ismode .NE. 2))ismode=0 IF ((dflag.NE.1)) THEN dflag=0 IF ((dsurround(1).LE.0.)) THEN dsurround(1)=50. WRITE(6,7590)dsurround(1)
![Page 145: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/145.jpg)
7590 FORMAT(/10x,' dsurround(1) defaults to',F8.3,' cm.'/) END IF dsurround(2)=dsurround(1) dsurround(3)=dsurround(1) dsurround(4)=dsurround(1) ELSE IF ((dsurround(1).LT.0.)) THEN dsurround(1)=0. WRITE(6,7600)dsurround(1)7600 FORMAT(/10x,' dsurround(1) defaults to',F8.3,' cm.'/) END IF IF ((dsurround(2).LT.0.)) THEN dsurround(2)=0. WRITE(6,7610)dsurround(2)7610 FORMAT(/10x,' dsurround(2) defaults to',F8.3,' cm.'/) END IF IF ((dsurround(3).LT.0.)) THEN dsurround(3)=0. WRITE(6,7620)dsurround(3)7620 FORMAT(/10x,' dsurround(3) defaults to',F8.3,' cm.'/) END IF IF ((dsurround(4).LT.0.)) THEN dsurround(4)=0. WRITE(6,7630)dsurround(4)7630 FORMAT(/10x,' dsurround(4) defaults to',F8.3,' cm.'/) END IF END IF END IF IF ((enflag .GT. 1 .AND. dflag .EQ. 1)) THEN WRITE(6,7640)enflag,ismode,medsur,dsurround(1),dflag,dsurround * (2),dsurround(3), dsurround(4)7640 FORMAT(3I12,F8.3,I12,3F8.3) ELSE WRITE(6,7650)enflag,ismode,medsur,dsurround(1),dflag7650 FORMAT(3I12,F8.3,I12) END IF IF ((enflag.GT.1)) THEN IF ((medsur.LE.0) .OR. ( medsur.GT.nmed)) THEN med((1 + imax + (jmax-1)*IMAX + (kmax-1)*ijmax)+1)=0 IF ((dflag.EQ.0)) THEN WRITE(6,7660)dsurround(1) WRITE(1,7660)dsurround(1)7660 FORMAT(/' The material in the region outside the phant *om is vacuum.'/ ' The thickness of this region (in x, y & z direct *ion) is:',F8.3,' cm'/) ELSE WRITE(6,7670)dsurround(1),dsurround(2),dsurround(3),ds * urround(4) WRITE(1,7670)dsurround(1),dsurround(2),dsurround(3),ds * urround(4)7670 FORMAT(/' The material in the region outside the phant *om is vacuum.'/ ' The thickness of this region in the x directioni *s:',F8.3,' cm'/ ' The thickness in the y direction is:',F8.3,' cm' */ ' The thickness in the +z direction is:',F8.3,' cm'/ ' The thick *ness in the -z direction is:',F8.3,' cm'/) END IF ELSE med((1 + imax + (jmax-1)*IMAX + (kmax-1)*ijmax)+1)=medsur
![Page 146: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/146.jpg)
IF ((dflag.EQ.0)) THEN WRITE(6,7680)(media(j,medsur),j=1,24),dsurround(1) WRITE(1,7680)(media(j,medsur),j=1,24),dsurround(1)7680 FORMAT(/' The material in the region outside the phant *om is:',24a1/ ' The thickness of this region (in x, y & z directio *n) is:',F8.3,' cm'/) ELSE WRITE(6,7690)(media(j,medsur),j=1,24),dsurround(1),dsu * rround(2), dsurround(3),dsurround(4) WRITE(1,7690)(media(j,medsur),j=1,24),dsurround(1),dsu * rround(2), dsurround(3),dsurround(4)7690 FORMAT(/' The material in the region outside the phant *om is:',24a1/ ' The thickness of this region in the x direction is *:',F8.3,' cm'/ ' The thickness in the y direction is:',F8.3,' cm'/ *' The thickness in the +z direction is:',F8.3,' cm'/' The thicknes *s in the -z direction is:',F8.3,' cm'/) END IF END IF dsurround(1)=dsurround(1)+0.0001 dsurround(2)=dsurround(2)+0.0001 dsurround(3)=dsurround(3)+0.0001 dsurround(4)=dsurround(4)+0.0001 END IF IF ((enflag .EQ. 0)) THEN WRITE(6,7700)7700 FORMAT(' Beam Energy (K.E. in MeV):',$) read(5,*) ein WRITE(6,7710)ein7710 FORMAT(F10.3) ELSE IF((enflag .EQ. 1)) THEN WRITE(6,7720)7720 FORMAT(' Energy spectrum:') WRITE(6,7730)7730 FORMAT(' Input name of file with spectrum data (A80): ',$) READ(5,101,ERR=7740) FILNAM101 FORMAT(A256) WRITE(6,7750)FILNAM WRITE(1,7750)FILNAM7750 FORMAT(/' Read input energy spectrum from: ',/A80) OPEN(UNIT=99,STATUS='OLD',file=FILNAM) READ(99,101) SPEC_TITLE READ(99,'(I10,F15.0,I5)')NENSRC,ENMIN,IMODE IF ((NENSRC .GT. 200)) THEN WRITE(6,7760)NENSRC,200 WRITE(1,7760)NENSRC,2007760 FORMAT(//' Number of energy bins=',I4, ' is greater than m *ax allowed =',I4/' Reduced to max allowed.'//) NENSRC = 200 END IF READ(99,'(2F20.0)')(ENSRCD(IB),SRCPDF(IB),IB=1,NENSRC) CLOSE(UNIT=99) WRITE(6,7770)NENSRC WRITE(1,7770)NENSRC7770 FORMAT(' Have read',I5,' input energy bins from file') IF ((IMODE.EQ.0)) THEN WRITE(6,7780) WRITE(1,7780)7780 FORMAT(' Counts/bin assumed')
![Page 147: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/147.jpg)
ELSE IF((IMODE .EQ. 1)) THEN WRITE(6,7790) WRITE(1,7790)7790 FORMAT(' Counts/MeV assumed') SRCPDF(1) = SRCPDF(1)*(ENSRCD(1)-ENMIN) DO 7801 IB=2,NENSRC SRCPDF(IB) = SRCPDF(IB)*(ENSRCD(IB)-ENSRCD(IB-1))7801 CONTINUE7802 CONTINUE ELSE WRITE(6,7810)IMODE WRITE(1,7810)IMODE7810 FORMAT(///'*****MODE not 0 or 1 in spectrum file? **' /80( *'*') //) END IF EIN = ENSRCD(NENSRC) WRITE(6,7820)ENMIN,EIN WRITE(1,7820)ENMIN,EIN7820 FORMAT(' Energy ranges from',F10.3,' MeV to',F12.3,' MeV') IF ((SRCPDF(1).GT.0.0)) THEN IF ((iqin.EQ.-1.AND.ENMIN.LT.ECUT)) THEN WRITE(6,7830) WRITE(1,7830)7830 FORMAT(//' *******WARNING:'/ ' min. energy of spectrum * < ECUT'/ ' May lead to artifically high dose in voxel(s) on which * source is incident'//) ELSE IF((iqin.EQ.0.AND.ENMIN.LT.PCUT)) THEN WRITE(6,7840) WRITE(1,7840)7840 FORMAT(//' *******WARNING:'/ ' min. energy of spectrum * < PCUT'/ ' May lead to artifically high dose in voxel(s) on which * source is incident'//) END IF ELSE DO 7851 IB=2,NENSRC IF ((SRCPDF(IB).GT.0.)) THEN IF ((iqin.EQ.-1.AND.ENSRCD(IB-1).LT.ECUT)) THEN WRITE(6,7860) WRITE(1,7860)7860 FORMAT(//' *******WARNING:'/ ' min. energy ofs *pectrum < ECUT'/ ' May lead to artifically high dose in voxel(s)on * which source is incident'//) ELSE IF((iqin.EQ.0.AND.ENSRCD(IB-1).LT.PCUT)) THEN * WRITE(6,7870) WRITE(1,7870)7870 FORMAT(//' *******WARNING:'/ ' min. energy ofs *pectrum < PCUT'/ ' May lead to artifically high dose in voxel(s)on * which source is incident'//) END IF GO TO7852 END IF7851 CONTINUE7852 CONTINUE END IF SRCCDF(1)=SRCPDF(1) DO 7881 IB=2,NENSRC SRCCDF(IB)=SRCCDF(IB-1)+SRCPDF(IB)
![Page 148: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/148.jpg)
7881 CONTINUE7882 CONTINUE FNORM=1./SRCCDF(NENSRC) BINSOK=0.0 DELTAK=1000 GRIDSZ=1/DELTAK DO 7891 IB=1,NENSRC SRCCDF(IB)=FNORM*SRCCDF(IB) IF ((IB .EQ. 1)) THEN IF ((SRCCDF(1) .LE. 3.*GRIDSZ )) THEN BINSOK = 1.0 END IF ELSE IF (((SRCCDF(IB)-SRCCDF(IB-1)) .LT. 3.*GRIDSZ)) THEN BINSOK=1.0 END IF END IF7891 CONTINUE7892 CONTINUE IF ((BINSOK.NE.0.0)) THEN WRITE(6,7900) WRITE(1,7900)7900 FORMAT(///' *******WARNING******'/ T20,'SOME OF NORMALIZED * BIN PROBABILITIES SO SMALL BINS MAY BE MISSED'/) END IF DO 7911 K=1,1000 AK= FLOAT(K)*GRIDSZ DO 7921 I=1,NENSRC IF ((AK .LE. SRCCDF(I))) THEN GO TO 5460 END IF7921 CONTINUE7922 CONTINUE5460 IF ((I .NE. 1)) THEN CDFINV(K,1) = ENSRCD(I-1) ELSE CDFINV(K,1) = ENMIN END IF CDFINV(K,2) = ENSRCD(I)-CDFINV(K,1)7911 CONTINUE7912 CONTINUE IF ((IWATCH .NE. 0)) THEN WRITE(6,7930)SPEC_TITLE7930 FORMAT(1x,80A1) WRITE(6,7940)7940 FORMAT(/' ENSRCD, SRCPDF, SRCCDF:'//) WRITE(6,7950)(ENSRCD(IB),SRCPDF(IB),SRCCDF(IB),IB=1,NENSRC * )7950 FORMAT(3E17.7) WRITE(6,7960)7960 FORMAT(//) END IF ELSE IF(( (enflag .EQ. 2) .OR. (enflag .EQ. 3) )) THEN IF ((isource.EQ.2 .OR. isource.EQ.8)) THEN OLDSRC=0 WRITE(6,7970)7970 FORMAT(' Input name of phase space file (A80)'/' : ',$) READ(5,101,ERR=7980) FILNAM
![Page 149: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/149.jpg)
WRITE(6,7990)FILNAM WRITE(1,7990)FILNAM7990 FORMAT(/' Particles will be read from file: ',/A80) i_iaea_in=0 ilen=lnblnk1(FILNAM) IF ((FILNAM(ilen-8:ilen).EQ.'.IAEAphsp')) THEN i_iaea_in=1 FILNAM=FILNAM(:ilen-9) END IF IF ((i_iaea_in.EQ.1)) THEN i_unit_in=44 WRITE(6,8000)8000 FORMAT(//' Sorry, this code has not been compiled with * the IAEA phase'/ ' space handling macros.'//) WRITE(6,8010)nshist,nphist,ein,NINCSRC,Z_SOURCE8010 FORMAT(T10,' IAEA format Phase space source with:'/ T5 *,' Total number of particles =',I13/ T5,' * Number of photons =',I13/ T5,' *Maximum particle kinetic energy =',F13.3,' MeV'/ T5,' # of particl *es incident from original source =',F13.1/ T5,' * Z where source scored =',F13.3,' cm'/) ELSE IF ((ismode.GT.0)) THEN PHSP_RECL=4*8 OPEN(UNIT=44,FILE=FILNAM,FORM='UNFORMATTED',ACCESS * ='DIRECT', RECL=PHSP_RECL,STATUS='OLD',IOSTAT=IERR * _PHSP) IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8020)8020 FORMAT(/' ***error opening file as MODE2 ****' */' *** THE FILE FORMAT MAY BE WRONG (I.E., NOT A MODE2 FILE) ***'/ * /' *** WE NOW TRY TO OPEN IT AS A MODE3 FILE ***'//) OPEN(UNIT=44,STATUS='OLD',FILE=FILNAM, FORM='U *NFORMATTED', IOSTAT=IERR_PHSP) IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8030)8030 FORMAT(//' *** PHASE SPACE FILE CANNOT BEF *OUND. ***') STOP END IF READ(44,REC=1,IOSTAT=IERR_PHSP)MODE,NUM_PHSP_T * OT,PHOT_PHSP_TOT, EKMAX_PHSP_SHORT,EKMINE_PHSP * _SHORT,NINC_PHSP_SHORT nshist=NUM_PHSP_TOT nphist=PHOT_PHSP_TOT ein=EKMAX_PHSP_SHORT temp(2)=EKMINE_PHSP_SHORT NINCSRC=NINC_PHSP_SHORT IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8040)8040 FORMAT(//' ***ERROR READING HEADER OF PHAS *E SPACE FILE*** '//) STOP END IF IF ((MODE .NE. 'MODE3')) THEN WRITE(6,8050)8050 FORMAT(//' That file does not start with M *ODE3,', ' as all old compressed files (with ZLAST) must'/ ' Check
![Page 150: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/150.jpg)
* it out and try again!'///) IERR_PHSP=1 STOP ELSE WRITE(6,8060)8060 FORMAT(//' This is a MODE3 file! '/ ' Plea *se convert it into a MODE2 file using [readphsp] ', ' and try agai *n!'///) IERR_PHSP=1 STOP END IF END IF READ(44,REC=1,IOSTAT=IERR_PHSP)MODE,NUM_PHSP_TOT,P * HOT_PHSP_TOT, EKMAX_PHSP_SHORT,EKMINE_PHSP_SHORT,N * INC_PHSP_SHORT nshist=NUM_PHSP_TOT nphist=PHOT_PHSP_TOT ein=EKMAX_PHSP_SHORT temp(2)=EKMINE_PHSP_SHORT NINCSRC=NINC_PHSP_SHORT IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8070)8070 FORMAT(//' ***ERROR READING HEADER OF PHASE SP *ACE FILE*** '//) STOP END IF IF ((MODE .NE. 'MODE2')) THEN WRITE(6,8080)8080 FORMAT(//' That file does not start with MODE2 *,', ' as standard compressed files with ZLAST must'/ ' Check it o *ut and try again!'///) IERR_PHSP=1 STOP END IF ELSE IF((ismode.EQ.0)) THEN PHSP_RECL=4*7 OPEN(UNIT=44,FILE=FILNAM,FORM='UNFORMATTED',ACCESS * ='DIRECT', RECL=PHSP_RECL,STATUS='OLD',IOSTAT=IERR * _PHSP) IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8090)8090 FORMAT(/' ***ERROR opening file as MODE0****'/ *' *** THE FILE FORMAT MAY BE WRONG (I.E., NOT A MODE0 FILE) ***'/ */' *** WE NOW TRY TO OPEN IT AS A MODE1 FILE***'//) OPEN(UNIT=44,STATUS='OLD',FILE=FILNAM, FORM='U *NFORMATTED', IOSTAT=IERR_PHSP) IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8100)8100 FORMAT(//' *** PHASE SPACE FILE CANNOT BEF *OUND. ***') STOP END IF READ(44,REC=1,IOSTAT=IERR_PHSP)MODE,NUM_PHSP_T * OT,PHOT_PHSP_TOT, EKMAX_PHSP_SHORT,EKMINE_PHSP * _SHORT,NINC_PHSP_SHORT nshist=NUM_PHSP_TOT nphist=PHOT_PHSP_TOT ein=EKMAX_PHSP_SHORT
![Page 151: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/151.jpg)
temp(2)=EKMINE_PHSP_SHORT NINCSRC=NINC_PHSP_SHORT IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8110)8110 FORMAT(//' ***ERROR READING HEADER OF PHAS *E SPACE FILE*** '//) STOP END IF IF ((MODE .NE. 'MODE1')) THEN WRITE(6,8120)8120 FORMAT(//' That file does not start with M *ODE1,', ' as all old compressed files must'/ ' Check it out and t *ry again!'///) IERR_PHSP=1 STOP ELSE WRITE(6,8130)8130 FORMAT(//' This is a MODE1 file! '/ ' Plea *se convert it into a MODE0 file using [readphsp] ', 'and try again *!'///) IERR_PHSP=1 STOP END IF END IF READ(44,REC=1,IOSTAT=IERR_PHSP)MODE,NUM_PHSP_TOT,P * HOT_PHSP_TOT, EKMAX_PHSP_SHORT,EKMINE_PHSP_SHORT,N * INC_PHSP_SHORT nshist=NUM_PHSP_TOT nphist=PHOT_PHSP_TOT ein=EKMAX_PHSP_SHORT temp(2)=EKMINE_PHSP_SHORT NINCSRC=NINC_PHSP_SHORT IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8140)8140 FORMAT(//' ***ERROR READING HEADER OF PHASE SP *ACE FILE*** '//) STOP END IF IF ((MODE .NE. 'MODE0')) THEN WRITE(6,8150)8150 FORMAT(/' Does not start with MODE0 as files w *ithout ZLAST must'/ ' Try again!'//) IERR_PHSP=1 STOP END IF ELSE IF((ismode.LT.0)) THEN WRITE(6,8160)8160 FORMAT(/' First, try to open it as a MODE0 file') PHSP_RECL=4*7 OPEN(UNIT=44,FILE=FILNAM,FORM='UNFORMATTED',ACCESS * ='DIRECT', RECL=PHSP_RECL,STATUS='OLD',IOSTAT=IERR * _PHSP) IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8170)8170 FORMAT(/' Now try to open it as a MODE2 file') ismode=1 PHSP_RECL=4*8 OPEN(UNIT=44,FILE=FILNAM,FORM='UNFORMATTED',AC
![Page 152: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/152.jpg)
* CESS='DIRECT', RECL=PHSP_RECL,STATUS='OLD',IOS * TAT=IERR_PHSP) IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8180)8180 FORMAT(//' *** PHASE SPACE FILE CANNOT BEF *OUND. ***') ELSE READ(44,REC=1,IOSTAT=IERR_PHSP)MODE,NUM_PH * SP_TOT,PHOT_PHSP_TOT, EKMAX_PHSP_SHORT,EKM * INE_PHSP_SHORT,NINC_PHSP_SHORT nshist=NUM_PHSP_TOT nphist=PHOT_PHSP_TOT ein=EKMAX_PHSP_SHORT temp(2)=EKMINE_PHSP_SHORT NINCSRC=NINC_PHSP_SHORT IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8190)8190 FORMAT(//' ***ERROR READING HEADER OFP *HASE SPACE FILE*** '//) STOP END IF IF ((MODE.NE.'MODE2')) THEN WRITE(6,8200)8200 FORMAT(//' That file does not start wi *th MODE2,', ' as standard compressed files with ZLAST must'/ ' Ch *eck it out and try again!'///) CLOSE(44) STOP END IF END IF ELSE READ(44,REC=1,IOSTAT=IERR_PHSP)MODE,NUM_PHSP_T * OT,PHOT_PHSP_TOT, EKMAX_PHSP_SHORT,EKMINE_PHSP * _SHORT,NINC_PHSP_SHORT nshist=NUM_PHSP_TOT nphist=PHOT_PHSP_TOT ein=EKMAX_PHSP_SHORT temp(2)=EKMINE_PHSP_SHORT NINCSRC=NINC_PHSP_SHORT IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8210)8210 FORMAT(//' ***ERROR READING HEADER OF PHAS *E SPACE FILE*** '//) STOP END IF ismode=0 IF ((MODE.NE.'MODE0')) THEN WRITE(6,8220)8220 FORMAT(/' The file does not start with MOD *E0 as it supposed to') CLOSE(44) WRITE(6,8230)8230 FORMAT(/' Now try to open it as a MODE2 fi *le') ismode=1 PHSP_RECL=4*8 OPEN(UNIT=44,FILE=FILNAM,FORM='UNFORMATTED *',ACCESS='DIRECT', RECL=PHSP_RECL,STATUS='OLD',IOSTAT=IERR_PHSP)
![Page 153: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/153.jpg)
IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8240)8240 FORMAT(//' *** PHASE SPACE FILE CANNOT * BE OPENED. ***') ELSE READ(44,REC=1,IOSTAT=IERR_PHSP)MODE,NU * M_PHSP_TOT,PHOT_PHSP_TOT, EKMAX_PHSP_S * HORT,EKMINE_PHSP_SHORT,NINC_PHSP_SHORT nshist=NUM_PHSP_TOT nphist=PHOT_PHSP_TOT ein=EKMAX_PHSP_SHORT temp(2)=EKMINE_PHSP_SHORT NINCSRC=NINC_PHSP_SHORT IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8250)8250 FORMAT(//' ***ERROR READING HEADER * OF PHASE SPACE FILE*** '//) STOP END IF IF ((MODE.NE.'MODE2')) THEN WRITE(6,8260)8260 FORMAT(//' That file does not star *t with MODE2,', ' as standard compressed files with ZLAST must'/ ' * Check it out and try again!'///) CLOSE(44) STOP END IF END IF END IF END IF END IF IF ((NINCSRC.LT.2.)) THEN WRITE(6,8270) WRITE(1,8270)8270 FORMAT(//' ******WARNING*****'/ ' PHASE SPACE SOUR *CE WAS GENERATED USING AN OLDER'/ ' VERSION OF BEAM IN WHICH # OFP *ARTICLES INCIDENT FROM'/ ' ORIGINAL SOURCE WAS NOT STORED. THISNU *MBER WILL'/ ' BE SET EQUAL TO THE NUMBER OF PARTICLES IN THE PHASE *'/ ' SPACE SOURCE, AND DOSE WILL BE NORMALIZED'/ ' WITH RESPECTTO *THE # OF HISTORIES RUN...NOT'/ ' THE # OF INCIDENT PARTICLES FROM *THE ORIGINAL SOURCE'//) NINCSRC=nshist OLDSRC=1 END IF WRITE(6,8280)nshist,nphist,ein,temp(2),NINCSRC WRITE(1,8280)nshist,nphist,ein,temp(2),NINCSRC8280 FORMAT(/' Total number of particles in file :',I1 *3/ ' Total number of photons :',I13/ 'The rest are *electrons/positrons.'/ ' '/ ' Maximum kinetic energyof the particl *es: ',F13.3,' MeV'/ ' Minimum kinetic energy ofthe electrons: * ',F13.3,' MeV'/ ' # of particles incident fromoriginal source: *',F13.1) nhistm=0 IF ((ismode.NE.0)) THEN READ(44,REC=2,IOSTAT=IERR_PHSP) latchm,ESHORT,X_PH * SP_SHORT,Y_PHSP_SHORT, U_PHSP_SHORT,V_PHSP_SHORT,W * T_PHSP_SHORT,ZLAST_PHSP_SHORT ELSE
![Page 154: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/154.jpg)
READ(44,REC=2,IOSTAT=IERR_PHSP) latchm,ESHORT,X_PH * SP_SHORT,Y_PHSP_SHORT, U_PHSP_SHORT,V_PHSP_SHORT,W * T_PHSP_SHORT END IF IF ((ESHORT.LT.0.0)) THEN nhistm=nhistm+1 ESHORT=ABS(ESHORT) END IF einm=ESHORT wtm=WT_PHSP_SHORT xinm=X_PHSP_SHORT yinm=Y_PHSP_SHORT uinm=U_PHSP_SHORT vinm=V_PHSP_SHORT IF((ismode.NE.0))zlastm=ZLAST_PHSP_SHORT IF ((nhistm.NE.1)) THEN dose_stat=1 WRITE(6,8290)8290 FORMAT(//' ***WARNING***'/ ' Cannot read no. of pr *imary (non-phsp) histories from ph-sp source.'/ ' Dose and fluence * will be analyzed assuming each particle read from'/ ' the ph-sp f *ile is an independent history. May result in an'/ ' underestimate * of uncertainties.'//) END IF END IF ELSE IF((isource .EQ.9 .OR. isource.EQ.10 )) THEN WRITE(6,8300)8300 FORMAT(' Input name of beam code (BEAM_accelname), input f *ile (no ext.), '/ ' pegs data (no ext.) (A256)'/' : ',$) READ(5,'(A)',ERR=8310) FILNAM WRITE(6,8320)FILNAM(:lnblnk1(FILNAM))8320 FORMAT(A) the_beam_code=FILNAM(:INDEX(FILNAM,',')-1) FILNAM=FILNAM(INDEX(FILNAM,',')+1:)8331 IF(INDEX(the_beam_code,' ').NE.1)GO TO 8332 IF ((len(the_beam_code).GE.2)) THEN the_beam_code=the_beam_code(2:) ELSE GO TO8332 END IF GO TO 83318332 CONTINUE the_beam_code=the_beam_code(:lnblnk1(the_beam_code)) the_input_file=FILNAM(:INDEX(FILNAM,',')-1) FILNAM=FILNAM(INDEX(FILNAM,',')+1:)8341 IF(INDEX(the_input_file,' ').NE.1)GO TO 8342 IF ((len(the_input_file).GE.2)) THEN the_input_file=the_input_file(2:) ELSE GO TO8342 END IF GO TO 83418342 CONTINUE the_input_file=the_input_file(:lnblnk1(the_input_file)) the_pegs_file=FILNAM(:lnblnk1(FILNAM))8351 IF(INDEX(the_pegs_file,' ').NE.1)GO TO 8352 IF ((len(the_pegs_file).GE.2)) THEN the_pegs_file=the_pegs_file(2:)
![Page 155: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/155.jpg)
ELSE GO TO8352 END IF GO TO 83518352 CONTINUE WRITE(6,8360)the_beam_code(:lnblnk1(the_beam_code)),the_in * put_file(:lnblnk1(the_input_file)), the_pegs_file(:lnblnk1 * (the_pegs_file))8360 FORMAT(/' BEAM simulation name: ',A/ ' input fil *e: ',A/ ' pegs data for BEAM: ',A/) ELSE IF((isource .EQ. 20)) THEN WRITE(6,8370)8370 FORMAT(' Input name of MLC code (VCU - particelDmlc), '/ ' * phase space file above MLC, '/ ' input file for MLC code (A256)'/ *' : ',$) READ(5,'(A)',ERR=8380) FILNAM WRITE(6,8390)FILNAM(:lnblnk1(FILNAM))8390 FORMAT(A) the_vcu_code=FILNAM(:INDEX(FILNAM,',')-1) FILNAM=FILNAM(INDEX(FILNAM,',')+1:)8401 IF(INDEX(the_vcu_code,' ').NE.1)GO TO 8402 IF ((len(the_vcu_code).GE.2)) THEN the_vcu_code=the_vcu_code(2:) ELSE GO TO8402 END IF GO TO 84018402 CONTINUE the_vcu_code=the_vcu_code(:lnblnk1(the_vcu_code)) IF ((the_vcu_code.EQ.'0')) THEN MLCflag = 0 ELSE MLCflag =1 END IF the_phsp_file=FILNAM(:INDEX(FILNAM,',')-1) FILNAM=FILNAM(INDEX(FILNAM,',')+1:)8411 IF(INDEX(the_phsp_file,' ').NE.1)GO TO 8412 IF ((len(the_phsp_file).GE.2)) THEN the_phsp_file=the_phsp_file(2:) ELSE GO TO8412 END IF GO TO 84118412 CONTINUE the_phsp_file=the_phsp_file(:lnblnk1(the_phsp_file)) WRITE(6,8420)the_phsp_file(:lnblnk1(the_phsp_file))8420 FORMAT(/'phase space file: ',A/) WRITE(6,8430)the_phsp_file WRITE(1,8430)the_phsp_file8430 FORMAT(/' Particles will be read from file: ',/A80) i_iaea_in=0 ilen=lnblnk1(FILNAM) IF ((FILNAM(ilen-8:ilen).EQ.'.IAEAphsp')) THEN i_iaea_in=1 FILNAM=FILNAM(:ilen-9) END IF IF ((i_iaea_in.EQ.1)) THEN i_unit_in=44
![Page 156: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/156.jpg)
WRITE(6,8440)8440 FORMAT(//' Sorry, this code has not been compiled with * the IAEA phase'/ ' space handling macros.'//) WRITE(6,8450)nshist,nphist,ein,NINCSRC,Z_SOURCE8450 FORMAT(T10,' IAEA format Phase space source with:'/ T5 *,' Total number of particles =',I13/ T5,' * Number of photons =',I13/ T5,' *Maximum particle kinetic energy =',F13.3,' MeV'/ T5,' # of particl *es incident from original source =',F13.1/ T5,' * Z where source scored =',F13.3,' cm'/) ELSE IF ((ismode.GT.0)) THEN PHSP_RECL=4*8 OPEN(UNIT=44,FILE=the_phsp_file,FORM='UNFORMATTED' * ,ACCESS='DIRECT', RECL=PHSP_RECL,STATUS='OLD',IOST * AT=IERR_PHSP) IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8460)8460 FORMAT(/' ***error opening file as MODE2 ****' */' *** THE FILE FORMAT MAY BE WRONG (I.E., NOT A MODE2 FILE) ***'/ * /' *** WE NOW TRY TO OPEN IT AS A MODE3 FILE ***'//) OPEN(UNIT=44,STATUS='OLD',FILE=the_phsp_file, * FORM='UNFORMATTED', IOSTAT=IERR_PHSP) IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8470)8470 FORMAT(//' *** PHASE SPACE FILE CANNOT BEF *OUND. ***') STOP END IF READ(44,REC=1,IOSTAT=IERR_PHSP)MODE,NUM_PHSP_T * OT,PHOT_PHSP_TOT, EKMAX_PHSP_SHORT,EKMINE_PHSP * _SHORT,NINC_PHSP_SHORT nshist=NUM_PHSP_TOT nphist=PHOT_PHSP_TOT ein=EKMAX_PHSP_SHORT temp(2)=EKMINE_PHSP_SHORT NINCSRC=NINC_PHSP_SHORT IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8480)8480 FORMAT(//' ***ERROR READING HEADER OF PHAS *E SPACE FILE*** '//) STOP END IF IF ((MODE .NE. 'MODE3')) THEN WRITE(6,8490)8490 FORMAT(//' That file does not start with M *ODE3,', ' as all old compressed files (with ZLAST) must'/ ' Check * it out and try again!'///) IERR_PHSP=1 STOP ELSE WRITE(6,8500)8500 FORMAT(//' This is a MODE3 file! '/ ' Plea *se convert it into a MODE2 file using [readphsp] ', ' and try agai *n!'///) IERR_PHSP=1 STOP END IF
![Page 157: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/157.jpg)
END IF READ(44,REC=1,IOSTAT=IERR_PHSP)MODE,NUM_PHSP_TOT,P * HOT_PHSP_TOT, EKMAX_PHSP_SHORT,EKMINE_PHSP_SHORT,N * INC_PHSP_SHORT nshist=NUM_PHSP_TOT nphist=PHOT_PHSP_TOT ein=EKMAX_PHSP_SHORT temp(2)=EKMINE_PHSP_SHORT NINCSRC=NINC_PHSP_SHORT IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8510)8510 FORMAT(//' ***ERROR READING HEADER OF PHASE SP *ACE FILE*** '//) STOP END IF IF ((MODE .NE. 'MODE2')) THEN WRITE(6,8520)8520 FORMAT(//' That file does not start with MODE2 *,', ' as standard compressed files with ZLAST must'/ ' Check it o *ut and try again!'///) IERR_PHSP=1 STOP END IF ELSE IF((ismode.EQ.0)) THEN PHSP_RECL=4*7 OPEN(UNIT=44,FILE=the_phsp_file,FORM='UNFORMATTED' * ,ACCESS='DIRECT', RECL=PHSP_RECL,STATUS='OLD',IOST * AT=IERR_PHSP) IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8530)8530 FORMAT(/' ***ERROR opening file as MODE0****'/ *' *** THE FILE FORMAT MAY BE WRONG (I.E., NOT A MODE0 FILE) ***'/ */' *** WE NOW TRY TO OPEN IT AS A MODE1 FILE***'//) OPEN(UNIT=44,STATUS='OLD',FILE=the_phsp_file, * FORM='UNFORMATTED', IOSTAT=IERR_PHSP) IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8540)8540 FORMAT(//' *** PHASE SPACE FILE CANNOT BEF *OUND. ***') STOP END IF READ(44,REC=1,IOSTAT=IERR_PHSP)MODE,NUM_PHSP_T * OT,PHOT_PHSP_TOT, EKMAX_PHSP_SHORT,EKMINE_PHSP * _SHORT,NINC_PHSP_SHORT nshist=NUM_PHSP_TOT nphist=PHOT_PHSP_TOT ein=EKMAX_PHSP_SHORT temp(2)=EKMINE_PHSP_SHORT NINCSRC=NINC_PHSP_SHORT IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8550)8550 FORMAT(//' ***ERROR READING HEADER OF PHAS *E SPACE FILE*** '//) STOP END IF IF ((MODE .NE. 'MODE1')) THEN WRITE(6,8560)8560 FORMAT(//' That file does not start with M
![Page 158: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/158.jpg)
*ODE1,', ' as all old compressed files must'/ ' Check it out and t *ry again!'///) IERR_PHSP=1 STOP ELSE WRITE(6,8570)8570 FORMAT(//' This is a MODE1 file! '/ ' Plea *se convert it into a MODE0 file using [readphsp] ', 'and try again *!'///) IERR_PHSP=1 STOP END IF END IF READ(44,REC=1,IOSTAT=IERR_PHSP)MODE,NUM_PHSP_TOT,P * HOT_PHSP_TOT, EKMAX_PHSP_SHORT,EKMINE_PHSP_SHORT,N * INC_PHSP_SHORT nshist=NUM_PHSP_TOT nphist=PHOT_PHSP_TOT ein=EKMAX_PHSP_SHORT temp(2)=EKMINE_PHSP_SHORT NINCSRC=NINC_PHSP_SHORT IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8580)8580 FORMAT(//' ***ERROR READING HEADER OF PHASE SP *ACE FILE*** '//) STOP END IF IF ((MODE .NE. 'MODE0')) THEN WRITE(6,8590)8590 FORMAT(/' Does not start with MODE0 as files w *ithout ZLAST must'/ ' Try again!'//) IERR_PHSP=1 STOP END IF ELSE IF((ismode.LT.0)) THEN WRITE(6,8600)8600 FORMAT(/' First, try to open it as a MODE0 file') PHSP_RECL=4*7 OPEN(UNIT=44,FILE=the_phsp_file,FORM='UNFORMATTED' * ,ACCESS='DIRECT', RECL=PHSP_RECL,STATUS='OLD',IOST * AT=IERR_PHSP) IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8610)8610 FORMAT(/' Now try to open it as a MODE2 file') ismode=1 PHSP_RECL=4*8 OPEN(UNIT=44,FILE=the_phsp_file,FORM='UNFORMAT *TED',ACCESS='DIRECT', RECL=PHSP_RECL,STATUS='OLD',IOSTAT=IERR_PHSP * ) IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8620)8620 FORMAT(//' *** PHASE SPACE FILE CANNOT BEF *OUND. ***') ELSE READ(44,REC=1,IOSTAT=IERR_PHSP)MODE,NUM_PH * SP_TOT,PHOT_PHSP_TOT, EKMAX_PHSP_SHORT,EKM * INE_PHSP_SHORT,NINC_PHSP_SHORT nshist=NUM_PHSP_TOT
![Page 159: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/159.jpg)
nphist=PHOT_PHSP_TOT ein=EKMAX_PHSP_SHORT temp(2)=EKMINE_PHSP_SHORT NINCSRC=NINC_PHSP_SHORT IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8630)8630 FORMAT(//' ***ERROR READING HEADER OFP *HASE SPACE FILE*** '//) STOP END IF IF ((MODE.NE.'MODE2')) THEN WRITE(6,8640)8640 FORMAT(//' That file does not start wi *th MODE2,', ' as standard compressed files with ZLAST must'/ ' Ch *eck it out and try again!'///) CLOSE(44) STOP END IF END IF ELSE READ(44,REC=1,IOSTAT=IERR_PHSP)MODE,NUM_PHSP_T * OT,PHOT_PHSP_TOT, EKMAX_PHSP_SHORT,EKMINE_PHSP * _SHORT,NINC_PHSP_SHORT nshist=NUM_PHSP_TOT nphist=PHOT_PHSP_TOT ein=EKMAX_PHSP_SHORT temp(2)=EKMINE_PHSP_SHORT NINCSRC=NINC_PHSP_SHORT IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8650)8650 FORMAT(//' ***ERROR READING HEADER OF PHAS *E SPACE FILE*** '//) STOP END IF ismode=0 IF ((MODE.NE.'MODE0')) THEN WRITE(6,8660)8660 FORMAT(/' The file does not start with MOD *E0 as it supposed to') CLOSE(44) WRITE(6,8670)8670 FORMAT(/' Now try to open it as a MODE2 fi *le') ismode=1 PHSP_RECL=4*8 OPEN(UNIT=44,FILE=the_phsp_file,FORM='UNFO *RMATTED',ACCESS='DIRECT', RECL=PHSP_RECL,STATUS='OLD',IOSTAT=IERR_ * PHSP) IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8680)8680 FORMAT(//' *** PHASE SPACE FILE CANNOT * BE OPENED. ***') ELSE READ(44,REC=1,IOSTAT=IERR_PHSP)MODE,NU * M_PHSP_TOT,PHOT_PHSP_TOT, EKMAX_PHSP_S * HORT,EKMINE_PHSP_SHORT,NINC_PHSP_SHORT nshist=NUM_PHSP_TOT nphist=PHOT_PHSP_TOT
![Page 160: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/160.jpg)
ein=EKMAX_PHSP_SHORT temp(2)=EKMINE_PHSP_SHORT NINCSRC=NINC_PHSP_SHORT IF ((IERR_PHSP.NE.0)) THEN WRITE(6,8690)8690 FORMAT(//' ***ERROR READING HEADER * OF PHASE SPACE FILE*** '//) STOP END IF IF ((MODE.NE.'MODE2')) THEN WRITE(6,8700)8700 FORMAT(//' That file does not star *t with MODE2,', ' as standard compressed files with ZLAST must'/ ' * Check it out and try again!'///) CLOSE(44) STOP END IF END IF END IF END IF END IF IF ((NINCSRC.LT.2.)) THEN WRITE(6,8710) WRITE(1,8710)8710 FORMAT(//' ******WARNING*****'/ ' PHASE SPACE SOUR *CE WAS GENERATED USING AN OLDER'/ ' VERSION OF BEAM IN WHICH # OFP *ARTICLES INCIDENT FROM'/ ' ORIGINAL SOURCE WAS NOT STORED. THISNU *MBER WILL'/ ' BE SET EQUAL TO THE NUMBER OF PARTICLES IN THE PHASE *'/ ' SPACE SOURCE, AND DOSE WILL BE NORMALIZED'/ ' WITH RESPECTTO *THE # OF HISTORIES RUN...NOT'/ ' THE # OF INCIDENT PARTICLES FROM *THE ORIGINAL SOURCE'//) NINCSRC=nshist OLDSRC=1 END IF WRITE(6,8720)nshist,nphist,ein,temp(2),NINCSRC WRITE(1,8720)nshist,nphist,ein,temp(2),NINCSRC8720 FORMAT(/' Total number of particles in file :',I1 *3/ ' Total number of photons :',I13/ 'The rest are *electrons/positrons.'/ ' '/ ' Maximum kinetic energyof the particl *es: ',F13.3,' MeV'/ ' Minimum kinetic energy ofthe electrons: * ',F13.3,' MeV'/ ' # of particles incident fromoriginal source: *',F13.1) nhistm=0 IF ((ismode.NE.0)) THEN READ(44,REC=2,IOSTAT=IERR_PHSP) latchm,ESHORT,X_PH * SP_SHORT,Y_PHSP_SHORT, U_PHSP_SHORT,V_PHSP_SHORT,W * T_PHSP_SHORT,ZLAST_PHSP_SHORT ELSE READ(44,REC=2,IOSTAT=IERR_PHSP) latchm,ESHORT,X_PH * SP_SHORT,Y_PHSP_SHORT, U_PHSP_SHORT,V_PHSP_SHORT,W * T_PHSP_SHORT END IF IF ((ESHORT.LT.0.0)) THEN nhistm=nhistm+1 ESHORT=ABS(ESHORT) END IF einm=ESHORT wtm=WT_PHSP_SHORT
![Page 161: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/161.jpg)
xinm=X_PHSP_SHORT yinm=Y_PHSP_SHORT uinm=U_PHSP_SHORT vinm=V_PHSP_SHORT IF((ismode.NE.0))zlastm=ZLAST_PHSP_SHORT IF ((nhistm.NE.1)) THEN dose_stat=1 WRITE(6,8730)8730 FORMAT(//' ***WARNING***'/ ' Cannot read no. of pr *imary (non-phsp) histories from ph-sp source.'/ ' Dose and fluence * will be analyzed assuming each particle read from'/ ' the ph-sp f *ile is an independent history. May result in an'/ ' underestimate * of uncertainties.'//) END IF END IF the_vcu_input_file=FILNAM(:lnblnk1(FILNAM))8741 IF(INDEX(the_vcu_input_file,' ').NE.1)GO TO 8742 IF ((len(the_input_file).GE.2)) THEN the_vcu_input_file=the_vcu_input_file(2:) ELSE GO TO8742 END IF GO TO 87418742 CONTINUE the_vcu_input_file=the_vcu_input_file(:lnblnk1(the_vcu_inp * ut_file)) WRITE(6,8750)the_vcu_input_file(:lnblnk1(the_vcu_input_fil * e)) WRITE(1,8750)the_vcu_input_file(:lnblnk1(the_vcu_input_fil * e))8750 FORMAT(/'input file: ',A/) ELSE IF((isource.EQ.21)) THEN WRITE(6,8760)8760 FORMAT(' Input name of beam code (BEAM_accelname), BEAM in *put file (no ext.), '/ ' name of MLC code (VCU - particelDmlc), VC *U input file'/ ' pegs data (no ext.) (A256)'/' : ',$) READ(5,'(A)',ERR=8770) FILNAM WRITE(6,8780)FILNAM(:lnblnk1(FILNAM))8780 FORMAT(A) the_beam_code=FILNAM(:INDEX(FILNAM,',')-1) FILNAM=FILNAM(INDEX(FILNAM,',')+1:)8791 IF(INDEX(the_beam_code,' ').NE.1)GO TO 8792 IF ((len(the_beam_code).GE.2)) THEN the_beam_code=the_beam_code(2:) ELSE GO TO8792 END IF GO TO 87918792 CONTINUE the_beam_code=the_beam_code(:lnblnk1(the_beam_code)) the_input_file=FILNAM(:INDEX(FILNAM,',')-1) FILNAM=FILNAM(INDEX(FILNAM,',')+1:)8801 IF(INDEX(the_input_file,' ').NE.1)GO TO 8802 IF ((len(the_input_file).GE.2)) THEN the_input_file=the_input_file(2:) ELSE GO TO8802 END IF
![Page 162: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/162.jpg)
GO TO 88018802 CONTINUE the_input_file=the_input_file(:lnblnk1(the_input_file)) the_pegs_file=FILNAM(:INDEX(FILNAM,',')-1) FILNAM=FILNAM(INDEX(FILNAM,',')+1:)8811 IF(INDEX(the_pegs_file,' ').NE.1)GO TO 8812 IF ((len(the_pegs_file).GE.2)) THEN the_pegs_file=the_pegs_file(2:) ELSE GO TO8812 END IF GO TO 88118812 CONTINUE the_vcu_code=FILNAM(:INDEX(FILNAM,',')-1) FILNAM=FILNAM(INDEX(FILNAM,',')+1:)8821 IF(INDEX(the_vcu_code,' ').NE.1)GO TO 8822 IF ((len(the_vcu_code).GE.2)) THEN the_vcu_code=the_vcu_code(2:) ELSE GO TO8822 END IF GO TO 88218822 CONTINUE the_vcu_code=the_vcu_code(:lnblnk1(the_vcu_code)) IF ((the_vcu_code.EQ.'0')) THEN MLCflag = 0 ELSE MLCflag = 1 END IF the_vcu_input_file=FILNAM(:lnblnk1(FILNAM))8831 IF(INDEX(the_vcu_input_file,' ').NE.1)GO TO 8832 IF ((len(the_input_file).GE.2)) THEN the_vcu_input_file=the_vcu_input_file(2:) ELSE GO TO8832 END IF GO TO 88318832 CONTINUE the_vcu_input_file=the_vcu_input_file(:lnblnk1(the_vcu_inp * ut_file)) WRITE(6,8840)the_beam_code(:lnblnk1(the_beam_code)),the_in * put_file(:lnblnk1(the_input_file)), the_pegs_file(:lnblnk1 * (the_pegs_file)),the_vcu_code(:lnblnk1(the_vcu_code)), the * _vcu_input_file(:lnblnk1(the_vcu_input_file))8840 FORMAT(/' BEAM simulation name: ',A/ ' input fil *e: ',A/ ' pegs data for BEAM: ',A/ ' VCU simulation name: ',A/' * vcu input file: ',A/) END IF IF (( enflag .EQ. 3)) THEN WRITE(6,8850) WRITE(1,8850)8850 FORMAT(/' I_BIT_FILTER(0-incl/excl bits,1-excl bits,2-incl * regions,3-excl regions),'/ ' NBIT1(# bits/regions to incl [I_BIT_ *FILTER=0 or 2] '/ ' or excl [I_BIT_FILTER=1 o *r 3],'/ ' NBIT2(# bits to excl [I_BIT_FILTER=0 only])--all on onel *ine'/ ' :',$) READ(5,8860)I_BIT_FILTER,NBIT1,NBIT28860 FORMAT(3i5)
![Page 163: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/163.jpg)
WRITE(6,8870)I_BIT_FILTER,NBIT1,NBIT2 WRITE(1,8870)I_BIT_FILTER,NBIT1,NBIT28870 FORMAT(3i5) IF ((I_BIT_FILTER.LT.0 .OR. I_BIT_FILTER .GT. 3)) THEN WRITE(6,8880)8880 FORMAT(//' ***ERROR: I_BIT_FILTER out of range.'//) STOP END IF IF ((I_BIT_FILTER.NE.0 .AND. NBIT2 .NE. 0)) THEN WRITE(6,8890) WRITE(1,8890)8890 FORMAT(//' ***WARNING: NBIT2 is not 0 and you are usin *g'/ ' I_BIT_FILTER=1, 2 or 3. NBIT2 set to 0 here.'//) NBIT2=0 END IF IF ((NBIT1.LT.0)) THEN WRITE(6,8900) WRITE(1,8900)8900 FORMAT(//' ***ERROR: NBIT1 < 0'//) STOP END IF IF ((NBIT2.LT.0)) THEN WRITE(6,8910) WRITE(1,8910)8910 FORMAT(//' ***ERROR: NBIT2 < 0'//) STOP END IF IF ((I_BIT_FILTER .LT. 2 .AND. (NBIT1+NBIT2.LT.0.OR.NBIT1+ * NBIT2.GT.29))) THEN WRITE(6,8920) WRITE(1,8920)8920 FORMAT(//' ***ERROR: '/ ' Total # of bits must be >= 0 * and <= 29'//) STOP ELSE IF((NBIT1.LT.0.OR.NBIT1.GT.24)) THEN WRITE(6,8930) WRITE(1,8930)8930 FORMAT(//' ***ERROR: '/ ' Total # of regions must be > *= 0 and <= 23'//) STOP END IF IF ((NBIT1 .NE. 0)) THEN IF ((I_BIT_FILTER.EQ.0.OR.I_BIT_FILTER.EQ.2)) THEN WRITE(6,8940) WRITE(1,8940)8940 FORMAT(/' BIT(I)/IREGION_TO_BIT(I) (I=1,NBIT1) toi *nclude:'/' ',$) END IF IF ((I_BIT_FILTER.EQ.1.OR.I_BIT_FILTER.EQ.3)) THEN WRITE(6,8950) WRITE(1,8950)8950 FORMAT(/' BIT(I)/IREGION_TO_BIT(I) (I=1,Nbit1) toe *xclude:'/' ',$) END IF READ(5,8960)(LATBIT(i),i=1,NBIT1)8960 FORMAT(30i5) WRITE(6,8970)(LATBIT(i),i=1,NBIT1) WRITE(1,8970)(LATBIT(i),i=1,NBIT1)
![Page 164: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/164.jpg)
8970 FORMAT(30i5) DO 8981 i=1,NBIT1 IF ((I_BIT_FILTER .LT. 2 .AND. (LATBIT(i).LT.0.OR. * LATBIT(i).GT.28))) THEN WRITE(6,8990)8990 FORMAT(//' ***ERROR:'/ ' BIT(I) must be >= 0 a *nd <= 28'//) STOP ELSE IF((LATBIT(I).LT.0.OR.LATBIT(I).GT.23)) THEN WRITE(6,9000)9000 FORMAT(//' ***ERROR:'/ ' IREGION_TO_BIT(I) mus *t be >=0 and <= 23'//) STOP END IF8981 CONTINUE8982 CONTINUE END IF IF ((NBIT2 .NE. 0)) THEN WRITE(6,9010) WRITE(1,9010)9010 FORMAT(/' BIT(I)/IREGION_TO_BIT(I) (I=NBIT1+1,NBIT1+NB *IT2) to exclude:'/' ',$) READ(5,9020)(LATBIT(NBIT1+i),i=1,NBIT2)9020 FORMAT(30i5) WRITE(6,9030)(LATBIT(NBIT1+i),i=1,NBIT2) WRITE(1,9030)(LATBIT(NBIT1+i),i=1,NBIT2)9030 FORMAT(30i5) DO 9041 i=1,NBIT2 IF ((LATBIT(NBIT1+i).LT.0 .OR. LATBIT(NBIT1+i).GT. * 28)) THEN WRITE(6,9050)9050 FORMAT(//' ***ERROR:'/ ' BIT(I) must be >= 0a *nd <= 28'//) STOP END IF9041 CONTINUE9042 CONTINUE END IF END IF ELSE IF((isource .EQ. 4)) THEN CALL BMODEL1 ELSE WRITE(6,9060)9060 FORMAT('In srcxyznrc: error on input, ENFLAG inconsistent ') STOP END IF return7740 CONTINUE WRITE(6,9070) WRITE(1,9070)9070 FORMAT(//' *** error on reading spectrum file name ***') STOP7980 CONTINUE WRITE(6,9080) WRITE(1,9080)9080 FORMAT(//' *** error on reading file name ***') STOP9090 CONTINUE
![Page 165: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/165.jpg)
WRITE(6,9100) WRITE(1,9100)9100 FORMAT(//' *** Error on opening file ***'// ' *** Please check whe *ther this is a MODE0 file or '/ ' *** it is in the right directory *, and try again!'//) STOP8310 CONTINUE WRITE(6,9110) WRITE(1,9110)9110 FORMAT(//' *** error on reading accelerator, input file, pegs data ****') STOP8380 CONTINUE WRITE(6,9120) WRITE(1,9120)9120 FORMAT(//' *** error on reading VCU sim., input file names ***') STOP8770 CONTINUE WRITE(6,9130) WRITE(1,9130)9130 FORMAT(//' *** error on reading accelerator, input file, pegs data ****'// ' (MLC code, MLC input file if selected) '//) STOP end subroutine srcinit(weight) ! Copyright National Research Council of Canada, Ottawa, ! BEAM Code System 1999, all rights reserved ! This code is covered by the BEAM General License implicit none common/geom/ xbound(128+1), ybound(128+1), zbound(128+1), xboun *d_min, xbound_max, ybound_min, ybound_max, zbound_min, zbound *_max, medsur, dsurround(4), IMAX, JMAX, KMAX, ijmax, irmax, * howfarless real*4 xbound, ybound, zbound, xbound_min, xbound_max, ybound_min, * ybound_max, zbound_min, zbound_max,dsurround integer medsur,IMAX, JMAX, KMAX, ijmax,irmax logical howfarless COMMON/PHSPFILE/BEAM_SIZE,MODE_PHSP1,LATCH_OPT, NCASE_PHSP,LATBIT, *NBIT1,NBIT2,I_BIT_FILTER,NofREPEAT,ISMOOTH, OUTCNT,NRCYCL,IPARALLE *L,PARNUM,CYCLNUM real BEAM_SIZE INTEGER MODE_PHSP1,LATCH_OPT,NCASE_PHSP,LATBIT(20),NBIT1,NBIT2, I_ *BIT_FILTER,NofREPEAT,ISMOOTH,OUTCNT,NRCYCL,IPARALLEL,PARNUM,CYCLNU *M common/source/ esrc, nhist, nnread, einsrc, xsrcold, ysrcold, * usrcold, vsrcold, wsrcold, weightold, latchold, frMU_indx, *zinc, xinl, xinu, yinl, yinu, zinl, zinu, thetax, thetay, * thetaz, uinc, vinc, winc, beamarea, xcol, ycol, xiso, yiso *, ziso, phicol, theta(60000), phi(60000), pang(60000), angfi *xed(60000), angmin(60000), angmax(60000), pgang(60000), xtemp( *60000), ytemp(60000), ztemp(60000), phicoltemp(60000), thetatem *p(60000), phitemp(60000), muIndex(60000), r_11(60000), r_12(600 *00), r_13(60000), r_21(60000), r_22(60000), r_23(60000), r_31(6000 *0), r_32(60000), r_33(60000), dsource, dsourcetemp(60000), ein, e *ksrcm, esrc_sp, SSD, einsrcold, iqinold, NINCSRC, r_dbs, ssd *_dbs, z_dbs, enflag, dflag, ismode, isource, iqin, * iqphsp, iqinc, MLCflag *, ixinl, ixinu, jyinl, jyinu, kzinl,
![Page 166: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/166.jpg)
* kzinu, klowx, khix, klowy, khiy, * klowz, khiz, survival_ratio, nsmiss, *nsrjct, nsoutside, nmissm, nshist, nphist, * nnphsp, IPRIMARY, * OLDSRC, npassi, nang, ivary(600 *00), ngang(60000), nset, more_in_cont, * numang, dose_stat, ndbsrjct, * i_dbs, iphatsrc, e_split, * i_iaea_in, i_unit_in, nhist_last, * the_beam_code, the_input_file, the *_vcu_input_file, the_pegs_file, the_ *phsp_file, the_vcu_code real*8 esrc,muIndex integer*8 nhist, nnread real*8 einsrc, xsrcold, ysrcold,usrcold,vsrcold,wsrcold,weightold, *latchold, frMU_indx real*4 zinc, xinl, xinu, yinl, yinu, zinl, zinu, thetax, thetay *, thetaz, uinc, vinc, winc, beamarea, xcol,ycol,xiso, yiso, zi *so, phicol, theta, phi, xtemp, ytemp, ztemp, phico *ltemp,thetatemp, phitemp, pang,angfixed,angmin,ang *max,pgang,r_11, r_12, r_13, r_21, r_22, r_23 *, r_31, r_32, r_33,dsource,dsourcetemp, * ein, eksrcm, esrc_sp, SSD, NINCSRC, * r_dbs, ssd_dbs,z_dbs,survival_ratio,einsrcold integer*4 isource, iqin, iqphsp, iqinc,iqinold,MLCflag, * ixinl, ixinu, jyinl, jyinu, kzinl, kzinu, * klowx, khix, klowy, khiy, klowz, khiz *, nsmiss, nsrjct,nsoutsid *e, nmissm,nshist,nphist,nnphsp, enflag, dflag, is *mode, IPRIMARY, OLDSRC,npassi,nang,ivary,ngang,numang,dose_stat, * ndbsrjct,i_dbs,iphatsrc,e_split,i_iaea_in,i_unit_in,more_in_c *ont,nset integer*2 nhist_last character*80 the_beam_code, the_vcu_code, the_input_file,the_pegs_ *file, the_vcu_input_file,the_phsp_file COMMON/SOURCE_FORPARALLEL/nnphsp_max, nnphsp_min integer*4 nnphsp_max, nnphsp_min common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch real*8 weight, costheta,sintheta, coscol,sincol, cosphi,sinphi integer*4 i WRITE(6,9140) WRITE(1,9140)9140 FORMAT(' ') IF ((isource .EQ. 0)) THEN IF ((xinl .LT. xbound(1))) THEN xinl = xbound(1) END IF
![Page 167: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/167.jpg)
IF ((xinu .LE. xinl)) THEN xinu = xinl END IF IF (( xinu .GT. xbound(imax+1) )) THEN xinu=xbound(imax+1) END IF IF (( xinl .GT. xbound(imax+1) )) THEN xinl=xbound(imax+1) END IF WRITE(6,9150) WRITE(1,9150)9150 FORMAT(/' Index ranges of beam field'/ ' --------------------- *-----'/) ixinl=09161 CONTINUE ixinl=ixinl+1 IF(((xbound(ixinl) .LE. xinl .AND. xbound(ixinl+1) .GT. xi * nl)))GO TO9162 GO TO 91619162 CONTINUE ixinu=ixinl-19171 CONTINUE ixinu=ixinu+1 IF(((xbound(ixinu) .LE. xinu .AND. xbound(ixinu+1) .GE. xi * nu)))GO TO9172 GO TO 91719172 CONTINUE WRITE(6,9180)xinl,xinu WRITE(1,9180)xinl,xinu9180 FORMAT(' ',2f10.3,$) WRITE(6,9190)ixinl,ixinu WRITE(1,9190)ixinl,ixinu9190 FORMAT(' i index ranges over i=',i3,' to',i4) IF ((yinl .LT. ybound(1))) THEN yinl = ybound(1) END IF IF ((yinu .LE. yinl)) THEN yinu = yinl END IF IF (( yinu .GT. ybound(jmax+1))) THEN yinu=ybound(jmax+1) END IF IF (( yinl .GT. ybound(jmax+1))) THEN yinl=ybound(jmax+1) END IF jyinl=09201 CONTINUE jyinl=jyinl+1 IF(((ybound(jyinl) .LE. yinl .AND. ybound(jyinl+1) .GT. yi * nl)))GO TO9202 GO TO 92019202 CONTINUE jyinu=jyinl-19211 CONTINUE jyinu=jyinu+1 IF(((ybound(jyinu) .LE. yinu .AND. ybound(jyinu+1) .GE. yi * nu)))GO TO9212 GO TO 9211
![Page 168: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/168.jpg)
9212 CONTINUE WRITE(6,9220)yinl,yinu WRITE(1,9220)yinl,yinu9220 FORMAT(' ',2f10.3,$) WRITE(6,9230)jyinl,jyinu WRITE(1,9230)jyinl,jyinu9230 FORMAT(' j index ranges over j=',i3,' to',i4) winc = cos(thetaz*3.141593/180.) uinc = cos(thetax*3.141593/180.) vinc = cos(thetay*3.141593/180.) IF ((thetaz .GT. 90. .OR. thetaz .LT. -90.)) THEN WRITE(6,9240)9240 FORMAT(//' ***ERROR in source 0'/ ' thetaz set so that sou *rce is not incident on front of'/ ' phantom. Check incident angle *s and try again.'//) STOP ELSE IF((thetax .GT. 180. .OR. thetax .LT. 0.)) THEN WRITE(6,9250)9250 FORMAT(//' ***ERROR in source 0'/ ' thetax set so that sou *rce is not incident on front of'/ ' phantom. Check incident angle *s and try again.'//) STOP ELSE IF((thetay .GT. 180. .OR. thetay .LT. 0.)) THEN WRITE(6,9260)9260 FORMAT(//' ***ERROR in source 0'/ ' thetay set so that sou *rce is not incident on front of'/ ' phantom. Check incident angle *s and try again.'//) STOP END IF IF ((uinc*uinc+vinc*vinc+winc*winc.GT.1.001 .OR. uinc*uinc+vin * c*vinc+winc*winc.LT.0.009)) THEN WRITE(6,9270)9270 FORMAT(//' ***ERROR in source 0'/ ' Sum of squares of inci *dent direction cosines must be 1.'/ ' Check angles and try again.' *//) STOP ELSE winc=SQRT(1-uinc*uinc-vinc*vinc) thetaz = acos(winc)*180./3.141593 END IF WRITE(6,9280) WRITE(1,9280)9280 FORMAT(/' Angle of beam to'/ ' axes(in deg, 90,90,0 is normal *): ',$) WRITE(6,9290)thetax,thetay,thetaz WRITE(1,9290)thetax,thetay,thetaz9290 FORMAT(' ',3f10.2,' deg') beamarea = (xinu - xinl)*(yinu - yinl) zinc = zbound(1) weight = 1.0 return END IF IF ((isource .EQ. 1 .OR. isource.EQ.7)) THEN dsource= max( (xiso-xbound(1 ))**2+(yiso-ybound(1 ))**2+(ziso- * zbound(1 ))**2, (xiso-xbound(imax+1))**2+(yiso-ybound(1 ))**2+ * (ziso-zbound(1 ))**2, (xiso-xbound(1 ))**2+(yiso-ybound(jmax+1 * ))**2+(ziso-zbound(1 ))**2, (xiso-xbound(1 ))**2+(yiso-ybound( * 1 ))**2+(ziso-zbound(kmax+1))**2, (xiso-xbound(imax+1))**2+(yi
![Page 169: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/169.jpg)
* so-ybound(jmax+1))**2+(ziso-zbound(1 ))**2, (xiso-xbound(imax+ * 1))**2+(yiso-ybound(1 ))**2+(ziso-zbound(kmax+1))**2, (xiso-xb * ound(1 ))**2+(yiso-ybound(jmax+1))**2+(ziso-zbound(kmax+1))**2 * , (xiso-xbound(imax+1))**2+(yiso-ybound(jmax+1))**2+(ziso-zbou * nd(kmax+1))**2) dsource = -sqrt(dsource + xcol**2+ ycol**2) beamarea = xcol*ycol ELSE IF((isource .EQ. 2 .OR. isource.EQ.8)) THEN dsource = -dsource esrc = 0 OUTCNT = 0 ELSE IF((isource .EQ. 3 )) THEN IF ((xinl .LT. xbound(1))) THEN xinl = xbound(1) END IF IF ((xinu .LE. xinl)) THEN xinu = xinl END IF IF (( xinu .GT. xbound(imax+1) )) THEN xinu=xbound(imax+1) END IF IF (( xinl .GT. xbound(imax+1) )) THEN xinl=xbound(imax+1) END IF WRITE(6,9300) WRITE(1,9300)9300 FORMAT(/' Index ranges of beam field'/ ' --------------------- *-----'/) ixinl=09311 CONTINUE ixinl=ixinl+1 IF(((xbound(ixinl) .LE. xinl .AND. xbound(ixinl+1) .GT. xi * nl)))GO TO9312 GO TO 93119312 CONTINUE ixinu=ixinl-19321 CONTINUE ixinu=ixinu+1 IF(((xbound(ixinu) .LE. xinu .AND. xbound(ixinu+1) .GE. xi * nu)))GO TO9322 GO TO 93219322 CONTINUE WRITE(6,9330)xinl,xinu WRITE(1,9330)xinl,xinu9330 FORMAT(' ',2f10.3,$) WRITE(6,9340)ixinl,ixinu WRITE(1,9340)ixinl,ixinu9340 FORMAT(' i index ranges over i=',i3,' to',i4) IF ((yinl .LT. ybound(1))) THEN yinl = ybound(1) END IF IF ((yinu .LE. yinl)) THEN yinu = yinl END IF IF (( yinu .GT. ybound(jmax+1))) THEN yinu=ybound(jmax+1) END IF IF (( yinl .GT. ybound(jmax+1))) THEN
![Page 170: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/170.jpg)
yinl=ybound(jmax+1) END IF jyinl=09351 CONTINUE jyinl=jyinl+1 IF(((ybound(jyinl) .LE. yinl .AND. ybound(jyinl+1) .GT. yi * nl)))GO TO9352 GO TO 93519352 CONTINUE jyinu=jyinl-19361 CONTINUE jyinu=jyinu+1 IF(((ybound(jyinu) .LE. yinu .AND. ybound(jyinu+1) .GE. yi * nu)))GO TO9362 GO TO 93619362 CONTINUE WRITE(6,9370)yinl,yinu WRITE(1,9370)yinl,yinu9370 FORMAT(' ',2f10.3,$) WRITE(6,9380)jyinl,jyinu WRITE(1,9380)jyinl,jyinu9380 FORMAT(' j index ranges over j=',i3,' to',i4) beamarea = (xinu - xinl)*(yinu - yinl) zinc = zbound(1) weight = 1.0 return ELSE IF((isource .EQ. 6 )) THEN IF ((xinl.LT.xbound(1))) THEN IF ((xinu .LT. xbound(1))) THEN WRITE(6,9390)9390 FORMAT(//' ***ERROR in source 6:'/ ' xinl & xinu < xbo *und(1) of volume'//) STOP ELSE xinl= xbound(1) WRITE(6,9400)xinl WRITE(1,9400)xinl9400 FORMAT(//' ***WARNING in source 6:'/ ' xinl < xbound(1 *)'/ ' xinl reset to',F10.4,' cm'//) END IF END IF IF ((xinu .GT. xbound(imax+1))) THEN IF ((xinl .GT. xbound(imax+1))) THEN WRITE(6,9410)9410 FORMAT(//' ***ERROR in source 6:'/ ' xinl & xinu > max * xbound of volume'//) STOP ELSE xinu=xbound(imax+1) WRITE(6,9420)xinu WRITE(1,9420)xinu9420 FORMAT(//' ***WARNING in source 6:'/ ' xinu > max xbou *nd of geometry'/ ' xinu reset to',F10.4,' cm'//) END IF END IF IF ((yinl.LT.ybound(1))) THEN IF ((yinu .LT. ybound(1))) THEN WRITE(6,9430)
![Page 171: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/171.jpg)
9430 FORMAT(//' ***ERROR in source 6:'/ ' yinl & yinu < ybo *und(1) of volume'//) STOP ELSE yinl= ybound(1) WRITE(6,9440)yinl WRITE(1,9440)yinl9440 FORMAT(//' ***WARNING in source 6:'/ ' yinl < ybound(1 *)'/ ' yinl reset to',F10.4,' cm'//) END IF END IF IF ((yinu .GT. ybound(jmax+1))) THEN IF ((yinl .GT. ybound(jmax+1))) THEN WRITE(6,9450)9450 FORMAT(//' ***ERROR in source 6:'/ ' yinl & yinu > max * ybound of volume'//) STOP ELSE yinu=ybound(jmax+1) WRITE(6,9460)yinu WRITE(1,9460)yinu9460 FORMAT(//' ***WARNING in source 6:'/ ' yinu > max ybou *nd of geometry'/ ' yinu reset to',F10.4,' cm'//) END IF END IF IF ((zinl.LT.zbound(1))) THEN IF ((zinu .LT. zbound(1))) THEN WRITE(6,9470)9470 FORMAT(//' ***ERROR in source 6:'/ ' zinl & zinu < zbo *und(1) of volume'//) STOP ELSE zinl= zbound(1) WRITE(6,9480)zinl WRITE(1,9480)zinl9480 FORMAT(//' ***WARNING in source 6:'/ ' zinl < zbound(1 *)'/ ' zinl reset to',F10.4,' cm'//) END IF END IF IF ((zinu .GT. zbound(kmax+1))) THEN IF ((zinl .GT. zbound(kmax+1))) THEN WRITE(6,9490)9490 FORMAT(//' ***ERROR in source 6:'/ ' zinl & zinu > max * zbound of volume'//) STOP ELSE zinu=zbound(kmax+1) WRITE(6,9500)zinu WRITE(1,9500)zinu9500 FORMAT(//' ***WARNING in source 6:'/ ' zinu > max zbou *nd of geometry'/ ' zinu reset to',F10.4,' cm'//) END IF END IF WRITE(6,9510) WRITE(1,9510)9510 FORMAT(/' Index ranges of source volume'/ ' ------------------ *-----------'/) ixinl=0
![Page 172: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/172.jpg)
9521 CONTINUE ixinl=ixinl+1 IF(((xbound(ixinl) .LE. xinl .AND. xbound(ixinl+1) .GT. xi * nl)))GO TO9522 GO TO 95219522 CONTINUE ixinu=ixinl-19531 CONTINUE ixinu=ixinu+1 IF(((xbound(ixinu) .LE. xinu .AND. xbound(ixinu+1) .GE. xi * nu)))GO TO9532 GO TO 95319532 CONTINUE WRITE(6,9540)xinl,xinu WRITE(1,9540)xinl,xinu9540 FORMAT(' ',2f10.3,$) WRITE(6,9550)ixinl,ixinu WRITE(1,9550)ixinl,ixinu9550 FORMAT(' i index ranges over i=',i3,' to',i4) jyinl=09561 CONTINUE jyinl=jyinl+1 IF(((ybound(jyinl) .LE. yinl .AND. ybound(jyinl+1) .GT. yi * nl)))GO TO9562 GO TO 95619562 CONTINUE jyinu=jyinl-19571 CONTINUE jyinu=jyinu+1 IF(((ybound(jyinu) .LE. yinu .AND. ybound(jyinu+1) .GE. yi * nu)))GO TO9572 GO TO 95719572 CONTINUE WRITE(6,9580)yinl,yinu WRITE(1,9580)yinl,yinu9580 FORMAT(' ',2f10.3,$) WRITE(6,9590)jyinl,jyinu WRITE(1,9590)jyinl,jyinu9590 FORMAT(' j index ranges over j=',i3,' to',i4) kzinl=09601 CONTINUE kzinl=kzinl+1 IF(((zbound(kzinl) .LE. zinl .AND. zbound(kzinl+1) .GT. zi * nl)))GO TO9602 GO TO 96019602 CONTINUE kzinu=kzinl-19611 CONTINUE kzinu=kzinu+1 IF(((zbound(kzinu) .LE. zinu .AND. zbound(kzinu+1) .GE. zi * nu)))GO TO9612 GO TO 96119612 CONTINUE WRITE(6,9620)zinl,zinu WRITE(1,9620)zinl,zinu9620 FORMAT(' ',2f10.3,$) WRITE(6,9630)kzinl,kzinu WRITE(1,9630)kzinl,kzinu
![Page 173: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/173.jpg)
9630 FORMAT(' k index ranges over k=',i3,' to',i4) weight=1.0 ELSE IF((isource .EQ. 9 .OR. isource.EQ.10)) THEN dsource = -dsource WRITE(6,9640)'About to call init_beamsource'9640 FORMAT(//a) call init_beamsource(i_parallel,'x86_64-unknown-linux-gnu-gfor *tran', hen_house,egs_home,the_beam_code, the_pegs_file,the_input_f * ile) ELSE IF((isource .EQ. 20)) THEN dsource = -dsource IF ((MLCflag .EQ. 1)) THEN WRITE(6,9650)'About to initialise MLC code and run calibra *tion...'9650 FORMAT(//a) survival_ratio = 0 call init_vcusource(survival_ratio,'x86_64-unknown-linux-g *nu-gfortran',hen_house, egs_home,the_vcu_code,the_vcu_input_file) WRITE(6,9660)survival_ratio WRITE(1,9660)survival_ratio9660 FORMAT('Survival Ratio is: ', F5.4) ELSE WRITE(6,9670) WRITE(1,9670)9670 FORMAT(/'No external vcu library'/) survival_ratio = 1 END IF esrc = 0 OUTCNT = 0 ELSE IF((isource .EQ. 21)) THEN dsource = -dsource WRITE(6,9680)'About to call init_beamsource'9680 FORMAT(//a) call init_beamsource(i_parallel,'x86_64-unknown-linux-gnu-gfor *tran', hen_house,egs_home,the_beam_code, the_pegs_file,the_input_f * ile) WRITE(6,9690)'Done initialization'9690 FORMAT(//a) survival_ratio = 1 IF ((MLCflag .EQ. 1)) THEN WRITE(6,9700)'About to initialise MLC code...'9700 FORMAT(//a) call init_vcusource(survival_ratio,'x86_64-unknown-linux-g *nu-gfortran',hen_house, egs_home,the_vcu_code,the_vcu_input_file) ELSE WRITE(6,9710) WRITE(1,9710)9710 FORMAT(/'No external library MLC'/) END IF END IF IF ((isource .GT.3 .AND. isource .LT.7)) THEN dsource=-dsource END IF IF ((isource .NE. 20 .AND. isource .NE. 21)) THEN costheta = cos(theta(1)*3.141593/180.) sintheta = sin(theta(1)*3.141593/180.) coscol = cos(phicol*3.141593/180.) sincol = sin(phicol*3.141593/180.)
![Page 174: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/174.jpg)
cosphi = cos(phi(1)*3.141593/180.) sinphi = sin(phi(1)*3.141593/180.) r_11(1) = costheta*cosphi*coscol + sinphi*sincol r_12(1) = -costheta*cosphi*sincol + sinphi*coscol r_13(1) = -sintheta*cosphi r_21(1) = costheta*sinphi*coscol - cosphi*sincol r_22(1) = -costheta*sinphi*sincol - cosphi*coscol r_23(1) = -sintheta*sinphi r_31(1) = -sintheta*coscol r_32(1) = sintheta*sincol r_33(1) = -costheta END IF IF ((isource.EQ.7 .OR. isource.EQ.8 .OR. isource.EQ.10)) THEN DO 9721 I=2,numang costheta = cos(theta(I)*3.141593/180.) sintheta = sin(theta(I)*3.141593/180.) cosphi = cos(phi(I)*3.141593/180.) sinphi= sin(phi(I)*3.141593/180.) r_11(I) = costheta*cosphi*coscol + sinphi*sincol r_12(I) = -costheta*cosphi*sincol + sinphi*coscol r_13(I) = -sintheta*cosphi r_21(I) = costheta*sinphi*coscol - cosphi*sincol r_22(I) = -costheta*sinphi*sincol - cosphi*coscol r_23(I) = -sintheta*sinphi r_31(I) = -sintheta*coscol r_32(I) = sintheta*sincol r_33(I) = -costheta9721 CONTINUE9722 CONTINUE END IF klowx = 2 - imax - ijmax khix=1 - ijmax klowy=1 - ijmax khiy=1 - imax klowz=1 - imax khiz = 1 - imax - ijmax + ijmax*kmax weight = 1.0 return end subroutine srcout ! Copyright National Research Council of Canada, Ottawa, ! BEAM Code System 1999, all rights reserved ! This code is covered by the BEAM General License implicit none common/source/ esrc, nhist, nnread, einsrc, xsrcold, ysrcold, * usrcold, vsrcold, wsrcold, weightold, latchold, frMU_indx, *zinc, xinl, xinu, yinl, yinu, zinl, zinu, thetax, thetay, * thetaz, uinc, vinc, winc, beamarea, xcol, ycol, xiso, yiso *, ziso, phicol, theta(60000), phi(60000), pang(60000), angfi *xed(60000), angmin(60000), angmax(60000), pgang(60000), xtemp( *60000), ytemp(60000), ztemp(60000), phicoltemp(60000), thetatem *p(60000), phitemp(60000), muIndex(60000), r_11(60000), r_12(600 *00), r_13(60000), r_21(60000), r_22(60000), r_23(60000), r_31(6000 *0), r_32(60000), r_33(60000), dsource, dsourcetemp(60000), ein, e *ksrcm, esrc_sp, SSD, einsrcold, iqinold, NINCSRC, r_dbs, ssd *_dbs, z_dbs, enflag, dflag, ismode, isource, iqin, * iqphsp, iqinc, MLCflag *, ixinl, ixinu, jyinl, jyinu, kzinl,
![Page 175: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/175.jpg)
* kzinu, klowx, khix, klowy, khiy, * klowz, khiz, survival_ratio, nsmiss, *nsrjct, nsoutside, nmissm, nshist, nphist, * nnphsp, IPRIMARY, * OLDSRC, npassi, nang, ivary(600 *00), ngang(60000), nset, more_in_cont, * numang, dose_stat, ndbsrjct, * i_dbs, iphatsrc, e_split, * i_iaea_in, i_unit_in, nhist_last, * the_beam_code, the_input_file, the *_vcu_input_file, the_pegs_file, the_ *phsp_file, the_vcu_code real*8 esrc,muIndex integer*8 nhist, nnread real*8 einsrc, xsrcold, ysrcold,usrcold,vsrcold,wsrcold,weightold, *latchold, frMU_indx real*4 zinc, xinl, xinu, yinl, yinu, zinl, zinu, thetax, thetay *, thetaz, uinc, vinc, winc, beamarea, xcol,ycol,xiso, yiso, zi *so, phicol, theta, phi, xtemp, ytemp, ztemp, phico *ltemp,thetatemp, phitemp, pang,angfixed,angmin,ang *max,pgang,r_11, r_12, r_13, r_21, r_22, r_23 *, r_31, r_32, r_33,dsource,dsourcetemp, * ein, eksrcm, esrc_sp, SSD, NINCSRC, * r_dbs, ssd_dbs,z_dbs,survival_ratio,einsrcold integer*4 isource, iqin, iqphsp, iqinc,iqinold,MLCflag, * ixinl, ixinu, jyinl, jyinu, kzinl, kzinu, * klowx, khix, klowy, khiy, klowz, khiz *, nsmiss, nsrjct,nsoutsid *e, nmissm,nshist,nphist,nnphsp, enflag, dflag, is *mode, IPRIMARY, OLDSRC,npassi,nang,ivary,ngang,numang,dose_stat, * ndbsrjct,i_dbs,iphatsrc,e_split,i_iaea_in,i_unit_in,more_in_c *ont,nset integer*2 nhist_last character*80 the_beam_code, the_vcu_code, the_input_file,the_pegs_ *file, the_vcu_input_file,the_phsp_file COMMON/SOURCE_FORPARALLEL/nnphsp_max, nnphsp_min integer*4 nnphsp_max, nnphsp_min COMMON/SSMDIS/ISMMODE,NSSMDIS,IB_SSM,IC_SSM, SSMDIS,SSMPDF,SSMCDF, *SSMMIN,SSMMAX,CDFSSM INTEGER ISMMODE,NSSMDIS,IB_SSM,IC_SSM REAL SSMDIS(200),SSMPDF(200),SSMCDF(200),SSMMIN,SSMMAX, CDFSSM(200 *0,2) COMMON/BMODELC1/ NSMFPS,ISMFPS,IQSMFP,ILATCH,NSMFXX,NSMFYY,NSMFRR, * MSMFXY,MISMFP,SMFPXY,NSCATT,NFIELD,NFIELDi,NFIELDo,NFIELDe, RFIEL *D,RFIELDe,XFLDMN,XFLDMX,YFLDMN,YFLDMX, FLDRR2,FLDYY2,FLDXX2,SMFMNZ *,SMFMNX,SMFMXX, SMFMNY,SMFX2,SMFY2,SMFMXY,SMFMNR,SMFMXR, SMFRTN,SS *DVPS,FSMFBN,FSMABN,FSMFRR,FSMFXY,FSMFR11, FSMFR12,SMFDXX,SMFDYY,RF *ACTOR1,RFACTOR2, SMFNR2,SMFMR2,SMFMXZ,RSCATT,SMFMNE,SMFMXE,ERADII, * SSMFPS,RTREAT,RTREATe,XTREATMN,XTREATMX,YTREATMN,YTREATMX, XINSMX *,XINSMN,YINSMX,YINSMN,XINS,YINS,SMONAM,ABNTOTAL,ABNTOTALH INTEGER nSrc,source,n, KKKK,IRBIN, ESTYPE, NSMFPS,ISMFPS(22),IQ *SMFP(22),ILATCH(22),NSMFXX(22),NSMFYY(22), NSMFRR(22),MSMFXY(22),M *ISMFP(2000),SMFPXY(22),NSCATT, NFIELD,NFIELDi,NFIELDo,NFIELDe REAL RFIELD,RFIELDe,XFLDMN,XFLDMX,YFLDMN,YFLDMX, FLDRR2(22),FLDXX2 *(22),FLDYY2(22),SMFMNZ(22),SMFMNX(22),SMFMXX(22), SMFMNY(22),SMFX2 *(22),SMFY2(22),SMFMXY(22),SMFMNR(22),SMFMXR(22), SMFRTN(22),SSDVPS *(22+3),FSMFBN(22,200,2000,2), FSMABN(2000,2),FSMFRR(22,2000,2), FS *MFXY(22,200,200),FSMFR11(22,200), FSMFR12(22,200),SMFDXX(22),SMFDY
![Page 176: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/176.jpg)
*Y(22),RFACTOR1,RFACTOR2, SMFNR2(22),SMFMR2(22),SMFMXZ(22),RSCATT,S *MFMNE,SMFMXE,ERADII(200), RTREAT,RTREATe,XTREATMN,XTREATMX,YTREATM *N,YTREATMX, RRR,RRR1,RRR2,XXX,YYY,XXX1,YYY1,ZZZ1, DDMNX,DDMXX,DDMN *Y,DDMXY REAL XINSMX,XINSMN,YINSMX,YINSMN,XINS,YINS,ABNTOTAL,ABNTOTALH CHARACTER*80 SSMFPS,SMONAM COMMON/PHSPFILE/BEAM_SIZE,MODE_PHSP1,LATCH_OPT, NCASE_PHSP,LATBIT, *NBIT1,NBIT2,I_BIT_FILTER,NofREPEAT,ISMOOTH, OUTCNT,NRCYCL,IPARALLE *L,PARNUM,CYCLNUM real BEAM_SIZE INTEGER MODE_PHSP1,LATCH_OPT,NCASE_PHSP,LATBIT(20),NBIT1,NBIT2, I_ *BIT_FILTER,NofREPEAT,ISMOOTH,OUTCNT,NRCYCL,IPARALLEL,PARNUM,CYCLNU *M integer*4 i,lnblnk1,IOUTLIST IOUTLIST = 6 WRITE(6,9730) WRITE(1,9730)9730 FORMAT( /' ',79('*')//t10, 'Summary of source parameters (srcxyznr *c $Revision: 1.26 $)' / ' ',79('*')/) IF ((isource .EQ. 0)) THEN WRITE(6,9740)iqin,xinl,xinu,yinl,yinu,thetax,thetay,thetaz WRITE(1,9740)iqin,xinl,xinu,yinl,yinu,thetax,thetay,thetaz9740 FORMAT( t20,' Parallel beam incident from the front(+ve z-axis *)'/ / t25,' Electric charge of the source:',t57,i12 / t25,' x-boun *daries:',t43,f10.4,' cm-',f10.4,' cm' / t25,' y-boundaries:',t43,f *10.4,' cm-',f10.4,' cm' / T25,' Angle relative to +x:',t57,f10.4,' * degrees' / T25,' Angle relative to +y:',t57,f10.4,' degrees' / T2 *5,' Angle relative to -z:',t57,f10.4,' degrees' /) ELSE IF((isource .EQ. 1)) THEN WRITE(6,9750)iqin,xiso,yiso,ziso,theta(1),phi(1),xcol,ycol,phi * col WRITE(1,9750)iqin,xiso,yiso,ziso,theta(1),phi(1),xcol,ycol,phi * col9750 FORMAT( t15,' Parallel beam incident from an arbitrary directi *on' / / t20,' Electric charge of the source:' ,t62,i12 / t20,' x-c *oordinate of the isocenter,' ,t62,f10.4,' cm' / t20,' y-coordinate * of the isocenter,' ,t62,f10.4,' cm' / t20,' z-coordinate of the i *socenter,' ,t62,f10.4,' cm' / t20,' Polar angle of collimator cent *er:',t62,f10.4,' degrees'/ t20,' Azimuthal angle of collimator cen *ter:',t62,f10.4,' degrees'/ t20,' Total x-width of collimator,' ,t *62,f10.4,' cm' / t20,' Total y-width of collimator,' ,t62,f10.4,' *cm'/ t20,' Collimator rotation angle,' ,t62,f10.4,' degrees'/) ELSE IF((isource .EQ. 2)) THEN WRITE(6,9760)xiso,yiso,ziso,theta(1),phi(1),dsource,phicol,nsh * ist WRITE(1,9760)xiso,yiso,ziso,theta(1),phi(1),dsource,phicol,nsh * ist9760 FORMAT( t15,' Full phase space input for each incident particl *e' // t10,' x-coordinate of the isocenter,' ,t62,f10.4,' cm' / t10 *,' y-coordinate of the isocenter,' ,t62,f10.4,' cm' / t10,' z-coor *dinate of the isocenter,' ,t62,f10.4,' cm' / t10,' Polar angle of *source plane:' ,t62,f10.4,' degrees'/ t10,' Azimuthal angle of ori *gin in source plane:' ,t62,f10.4,' degrees'/ t10,' Distance from i *socenter to origin in source', ' plane:',t62,f10.4,' cm'/ t10,' So *urce plane rotation angle,' ,t62,f10.4,' degrees'/ t10,' Total num *ber of particles in phase space file:',t62,i12/) IF ((i_dbs.EQ.1)) THEN WRITE(6,9770)r_dbs,ssd_dbs,z_dbs
![Page 177: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/177.jpg)
WRITE(1,9770)r_dbs,ssd_dbs,z_dbs9770 FORMAT( ' Directional Bremsstrahlung Splitting (DBS) used' */ ' in BEAM simulation to generate phase space source with:'/ ' * DBS splitting radius:',t55,f10.4/ ' SSD where radius defined:' *,t55,f10.4/ ' Z where source scored:',t55,f10.4/ ' Photons whos *e trajectory takes them outside the DBS splitting'/ ' radius at th *e SSD will be rejected.'/) END IF IF ((IPARALLEL.GT.1)) THEN IF ((PARNUM.GT.0)) THEN WRITE(6,9780)IPARALLEL,INT((PARNUM-1)*nshist/IPARALLEL * )+1, INT(PARNUM*nshist/IPARALLEL) WRITE(1,9780)IPARALLEL,INT((PARNUM-1)*nshist/IPARALLEL * )+1, INT(PARNUM*nshist/IPARALLEL)9780 FORMAT(' This is one of ',i4,' parallel simulations *.'/ ' It will use from particle ',i12,' to particle ',i12,' in' */ ' the phase space source for the simulation.'/) ELSE IF((PARNUM.EQ.0)) THEN WRITE(6,9790)IPARALLEL WRITE(1,9790)IPARALLEL9790 FORMAT(' This is one of ',i4,' parallel simulations *.'/ ' It will use the entire specified phase space source'/ ' *for the simulation.'/) END IF END IF IF ((iqphsp.EQ.2)) THEN WRITE(6,9800) WRITE(1,9800)9800 FORMAT(' Particles to be simulated: all'/) ELSE IF((iqphsp.EQ.0)) THEN WRITE(6,9810) WRITE(1,9810)9810 FORMAT(' Particles to be simulated: photon only'/) ELSE IF((iqphsp.EQ.1)) THEN WRITE(6,9820) WRITE(1,9820)9820 FORMAT(' Particles to be simulated: positron only'/) ELSE IF((iqphsp.EQ.-1)) THEN WRITE(6,9830) WRITE(1,9830)9830 FORMAT(' Particles to be simulated: electron only'/) END IF IF ((e_split.GT.1 .AND. iqphsp.NE.0)) THEN WRITE(6,9840)e_split WRITE(1,9840)e_split9840 FORMAT(/' Charged particles will be split ',i10,' times.'/ *) END IF ELSE IF((isource .EQ. 3)) THEN WRITE(6,9850)iqin,xinl,xinu,yinl,yinu,ssd WRITE(1,9850)iqin,xinl,xinu,yinl,yinu,ssd9850 FORMAT( t20,' Point source incident from the front(+ve z-axis) *'/ t25,' Electric charge of the source:',t57,i12 / t25,' x-boundar *ies:',t43,f10.4,' cm-',f10.4,' cm' / t25,' y-boundaries:',t43,f10. *4,' cm-',f10.4,' cm' / t25,' SSD ',f10.4 *,' cm' /) ELSE IF((isource .EQ. 6)) THEN WRITE(6,9860)iqin,xinl,xinu,yinl,yinu,zinl,zinu
![Page 178: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/178.jpg)
WRITE(1,9860)iqin,xinl,xinu,yinl,yinu,zinl,zinu9860 FORMAT( t20,' Uniform isotropically radiating parallelepiped'/ *t20,' within DOSXYZ volume'/ t25,' Electric charge of the source:' *,t57,i12 / t25,' x-boundaries:',t43,f10.4,' cm-',f10.4,' cm'/ t25, *' y-boundaries:',t43,f10.4,' cm-',f10.4,' cm' / t25,' z-boundaries *:',t43,f10.4,' cm-',f10.4,' cm'/) ELSE IF((isource .EQ. 7)) THEN IF ((nang.GT.0)) THEN WRITE(6,9870)iqin,xiso,yiso,ziso,nang,xcol,ycol,phicol WRITE(1,9870)iqin,xiso,yiso,ziso,nang,xcol,ycol,phicol9870 FORMAT( t15,' Parallel beam incident from multiple, user-s *elected angles' / / t20,' Electric charge of the source:' ,t62,i12 */ t20,' x-coordinate of the isocenter,' ,t62,f10.4,' cm'/ t20,' y- *coordinate of the isocenter,' ,t62,f10.4,' cm' /t20,' z-coordinate * of the isocenter,' ,t62,f10.4,' cm' /t20,' number of incident the *ta-phi:' ,t62,i12/ t20,' Total x-width of collimator,' ,t62,f10.4, *' cm' / t20,' Total y-width of collimator,' ,t62,f10.4,' cm'/ t20, *' Collimator rotation angle,',t62,f10.4,' degrees') WRITE(6,9880) WRITE(1,9880)9880 FORMAT(t20,' theta-phi theta phi norma *lized'/ t20,' pair (deg.) (deg.) probability' *) DO 9891 I=1,nang IF ((I.EQ.1)) THEN WRITE(6,9900)I,theta(I),phi(I),pang(I) WRITE(1,9900)I,theta(I),phi(I),pang(I)9900 FORMAT(t20,i7,f16.4,f13.4,f15.4) ELSE WRITE(6,9910)I,theta(I),phi(I),pang(I)-pang(I-1) WRITE(1,9910)I,theta(I),phi(I),pang(I)-pang(I-1)9910 FORMAT(t20,i7,f16.4,f13.4,f15.4) END IF9891 CONTINUE9892 CONTINUE ELSE IF((nang.LT.0)) THEN WRITE(6,9920)iqin,xiso,yiso,ziso,-nang,xcol,ycol,phicol WRITE(1,9920)iqin,xiso,yiso,ziso,-nang,xcol,ycol,phicol9920 FORMAT( t15,' Parallel beam incident from side at user-sel *ected angles' / / t20,' Electric charge of the source:' ,t62,i12 / *t20,' x-coordinate of the isocenter,' ,t62,f10.4,' cm' /t20,' y-co *ordinate of the isocenter,' ,t62,f10.4,' cm' / t20,' z-coordinate *of the isocenter,' ,t62,f10.4,' cm' / t20,' no. of theta-phi group *s:' ,t62,i12/ t20,' Total x-width of collimator,' ,t62,f10.4,' cm' * / t20,' Total y-width of collimator,' ,t62,f10.4,' cm'/ t20,' Col *limator rotation angle,' ,t62,f10.4,' degrees') WRITE(6,9930) WRITE(1,9930)9930 FORMAT(' theta-phi theta (deg.) phi (deg.)no. t *heta- normalized'/ ' group min. max. min. max *. phi pairs probability') DO 9941 I=1,-nang IF ((ivary(I).EQ.1)) THEN WRITE(6,9950)I,angmin(I),angmax(I),angfixed(I),ang * fixed(I),ngang(I), pgang(I) WRITE(1,9950)I,angmin(I),angmax(I),angfixed(I),ang * fixed(I),ngang(I), pgang(I)9950 FORMAT(I8,F11.4,F10.4,F9.4,F10.4,I7,F14.4)
![Page 179: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/179.jpg)
ELSE WRITE(6,9960)I,angfixed(I),angfixed(I),angmin(I),a * ngmax(I),ngang(I), pgang(I) WRITE(1,9960)I,angfixed(I),angfixed(I),angmin(I),a * ngmax(I),ngang(I), pgang(I)9960 FORMAT(I8,F11.4,F10.4,F9.4,F10.4,I7,F14.4) END IF9941 CONTINUE9942 CONTINUE END IF WRITE(6,9970) WRITE(1,9970)9970 FORMAT(' ') ELSE IF((isource .EQ. 8)) THEN IF ((nang.GT.0)) THEN WRITE(6,9980)xiso,yiso,ziso,nang,dsource,phicol,nshist WRITE(1,9980)xiso,yiso,ziso,nang,dsource,phicol,nshist9980 FORMAT( t15,' Full phase space input incident from multipl *e angles' // t10,' x-coordinate of the isocenter,' ,t62,f10.4,' cm *' / t10,' y-coordinate of the isocenter,' ,t62,f10.4,' cm' / t10,' * z-coordinate of the isocenter,' ,t62,f10.4,' cm' / t10,' number o *f incident theta-phi:' ,t62,i10/ t10,' Distance from isocenter too *rigin in source', ' plane:',t62,f10.4,' cm'/ t10,' Source plane ro *tation angle,' ,t62,f10.4,' degrees'/ t10,' Total number of partic *les in phase space file:',t62,i12/) WRITE(6,9990) WRITE(1,9990)9990 FORMAT(t10,' theta-phi theta phi norma *lized'/ t10,' pair (deg.) (deg.) probability' *) DO 10001 I=1,nang IF ((I.EQ.1)) THEN WRITE(6,10010)I,theta(I),phi(I),pang(I) WRITE(1,10010)I,theta(I),phi(I),pang(I)10010 FORMAT(t10,i7,f16.4,f13.4,f15.4) ELSE WRITE(6,10020)I,theta(I),phi(I),pang(I)-pang(I-1) WRITE(1,10020)I,theta(I),phi(I),pang(I)-pang(I-1)10020 FORMAT(t10,i7,f16.4,f13.4,f15.4) END IF10001 CONTINUE10002 CONTINUE ELSE IF((nang.LT.0)) THEN WRITE(6,10030)xiso,yiso,ziso,-nang,dsource,phicol,nshist WRITE(1,10030)xiso,yiso,ziso,-nang,dsource,phicol,nshist10030 FORMAT( t15,' Full phase space input incident from multipl *e angles' // t10,' x-coordinate of the isocenter,' ,t62,f10.4,' cm *' / t10,' y-coordinate of the isocenter,' ,t62,f10.4,' cm' / t10,' * z-coordinate of the isocenter,' ,t62,f10.4,' cm' / t10,' number t *heta-phi groups:' ,t62,i10/ t10,' Distance from isocenter to origi *n in source', ' plane:',t62,f10.4,' cm'/ t10,' Source plane rotati *on angle,' ,t62,f10.4,' degrees'/ t10,' Total number of particlesi *n phase space file:',t62,i12/) WRITE(6,10040) WRITE(1,10040)10040 FORMAT(' theta-phi theta (deg.) phi (deg.)no. t *heta- normalized'/ ' group min. max. min. max *. phi pairs probability')
![Page 180: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/180.jpg)
DO 10051 I=1,-nang IF ((ivary(I).EQ.1)) THEN WRITE(6,10060)I,angmin(I),angmax(I),angfixed(I),an * gfixed(I),ngang(I), pgang(I) WRITE(1,10060)I,angmin(I),angmax(I),angfixed(I),an * gfixed(I),ngang(I), pgang(I)10060 FORMAT(I8,F11.4,F10.4,F9.4,F10.4,I7,F14.4) ELSE WRITE(6,10070)I,angfixed(I),angfixed(I),angmin(I), * angmax(I),ngang(I), pgang(I) WRITE(1,10070)I,angfixed(I),angfixed(I),angmin(I), * angmax(I),ngang(I), pgang(I)10070 FORMAT(I8,F11.4,F10.4,F9.4,F10.4,I7,F14.4) END IF10051 CONTINUE10052 CONTINUE END IF WRITE(6,10080) WRITE(1,10080)10080 FORMAT(' ') IF ((i_dbs.EQ.1)) THEN WRITE(6,10090)r_dbs,ssd_dbs,z_dbs WRITE(1,10090)r_dbs,ssd_dbs,z_dbs10090 FORMAT( ' Directional Bremsstrahlung Splitting (DBS) used' */ ' in BEAM simulation to generate phase space source with:'/ ' * DBS splitting radius:',t55,f10.4/ ' SSD where radius defined:' *,t55,f10.4/ ' Z where source scored:',t55,f10.4/ ' Photons whos *e trajectory takes them outside the DBS splitting'/ ' radius at th *e SSD will be rejected.'/) END IF IF ((IPARALLEL.GT.1)) THEN IF ((PARNUM.GT.0)) THEN WRITE(6,10100)IPARALLEL,INT((PARNUM-1)*nshist/IPARALLE * L)+1, INT(PARNUM*nshist/IPARALLEL) WRITE(1,10100)IPARALLEL,INT((PARNUM-1)*nshist/IPARALLE * L)+1, INT(PARNUM*nshist/IPARALLEL)10100 FORMAT(' This is one of ',i4,' parallel simulations *.'/ ' It will use from particle ',i12,' to particle ',i12,' in' */ ' the phase space source for the simulation.'/) ELSE IF((PARNUM.EQ.0)) THEN WRITE(6,10110)IPARALLEL WRITE(1,10110)IPARALLEL10110 FORMAT(' This is one of ',i4,' parallel simulations *.'/ ' It will use the entire specified phase space source'/ ' *for the simulation.'/) END IF END IF IF ((iqphsp.EQ.2)) THEN WRITE(6,10120) WRITE(1,10120)10120 FORMAT(' Particles to be simulated: all'/) ELSE IF((iqphsp.EQ.0)) THEN WRITE(6,10130) WRITE(1,10130)10130 FORMAT(' Particles to be simulated: photon only'/) ELSE IF((iqphsp.EQ.1)) THEN WRITE(6,10140) WRITE(1,10140)
![Page 181: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/181.jpg)
10140 FORMAT(' Particles to be simulated: positron only'/) ELSE IF((iqphsp.EQ.-1)) THEN WRITE(6,10150) WRITE(1,10150)10150 FORMAT(' Particles to be simulated: electron only'/) END IF IF ((e_split.GT.1 .AND. iqphsp.NE.0)) THEN WRITE(6,10160)e_split WRITE(1,10160)e_split10160 FORMAT(/' Charged particles will be split ',i10,' times.'/ *) END IF ELSE IF((isource.EQ.9)) THEN WRITE(6,10170)xiso,yiso,ziso,theta(1),phi(1),dsource,phicol, t * he_beam_code(:lnblnk1(the_beam_code)),the_input_file(:lnblnk1( * the_input_file)), the_pegs_file(:lnblnk1(the_pegs_file)) WRITE(1,10170)xiso,yiso,ziso,theta(1),phi(1),dsource,phicol, t * he_beam_code(:lnblnk1(the_beam_code)),the_input_file(:lnblnk1( * the_input_file)), the_pegs_file(:lnblnk1(the_pegs_file))10170 FORMAT( t15,' BEAM treatment head simulation used as source:'/ */ t10,' x-coordinate of the isocenter,' ,t62,f10.4,' cm' / t10,' y *-coordinate of the isocenter,' ,t62,f10.4,' cm' / t10,' z-coordina *te of the isocenter,' ,t62,f10.4,' cm' / t10,' Polar angle of beam * axis:' ,t62,f10.4,' degrees'/ t10,' Azimuthal angle of beam axis: *' ,t62,f10.4,' degrees'/ t10,' Distance from isocenter to centre o *f scoring', ' plane:',t62,f10.4,' cm'/ t10,' Rotation angle about *beam axis,' ,t62,f10.4,' degrees'/ t10,' BEAM simulation: ',a/ t10 *,' input file: ',a/ t10,' pegs data file: ',a/) IF ((i_dbs.EQ.1)) THEN WRITE(6,10180) WRITE(1,10180)10180 FORMAT(t10,' Fat photons from DBS will be rejected.'/) ELSE WRITE(6,10190) WRITE(1,10190)10190 FORMAT(t10,' Fat photons from DBS will not be rejected.'/) END IF IF ((iqinc.EQ.2)) THEN WRITE(6,10200) WRITE(1,10200)10200 FORMAT(' Particles to be simulated: all'/) ELSE IF((iqinc.EQ.0)) THEN WRITE(6,10210) WRITE(1,10210)10210 FORMAT(' Particles to be simulated: photon only'/) ELSE IF((iqinc.EQ.1)) THEN WRITE(6,10220) WRITE(1,10220)10220 FORMAT(' Particles to be simulated: positron only'/) ELSE IF((iqinc.EQ.-1)) THEN WRITE(6,10230) WRITE(1,10230)10230 FORMAT(' Particles to be simulated: electron only'/) END IF IF ((e_split.GT.1 .AND. iqphsp.NE.0)) THEN WRITE(6,10240)e_split WRITE(1,10240)e_split10240 FORMAT(/' Charged particles will be split ',i10,' times.'/
![Page 182: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/182.jpg)
*) END IF ELSE IF((isource.EQ.10)) THEN IF ((nang.GT.0)) THEN WRITE(6,10250)xiso,yiso,ziso,nang,dsource,phicol, the_beam * _code(:lnblnk1(the_beam_code)),the_input_file(:lnblnk1(the * _input_file)), the_pegs_file(:lnblnk1(the_pegs_file)) WRITE(1,10250)xiso,yiso,ziso,nang,dsource,phicol, the_beam * _code(:lnblnk1(the_beam_code)),the_input_file(:lnblnk1(the * _input_file)), the_pegs_file(:lnblnk1(the_pegs_file))10250 FORMAT( t15,' BEAM simulation source from multiple angles: *' // t10,' x-coordinate of the isocenter,' ,t62,f10.4,' cm' / t10, *' y-coordinate of the isocenter,' ,t62,f10.4,' cm' / t10,' z-coord *inate of the isocenter,' ,t62,f10.4,' cm' / t10,' number of incide *nt theta-phi:' ,t62,i10/ t10,' Distance from isocenter tocentre of * scoring', ' plane:',t62,f10.4,' cm'/ t10,' Rotation angle about b *eam axis,' ,t62,f10.4,' degrees'/ t10,' BEAM simulation:',a/ t10,' * input file: ',a/ t10,' pegs data file: ',a/) WRITE(6,10260) WRITE(1,10260)10260 FORMAT(t10,' theta-phi theta phi norma *lized'/ t10,' pair (deg.) (deg.) probability' *) DO 10271 I=1,nang IF ((I.EQ.1)) THEN WRITE(6,10280)I,theta(I),phi(I),pang(I) WRITE(1,10280)I,theta(I),phi(I),pang(I)10280 FORMAT(t10,i7,f16.4,f13.4,f15.4) ELSE WRITE(6,10290)I,theta(I),phi(I),pang(I)-pang(I-1) WRITE(1,10290)I,theta(I),phi(I),pang(I)-pang(I-1)10290 FORMAT(t10,i7,f16.4,f13.4,f15.4) END IF10271 CONTINUE10272 CONTINUE ELSE IF((nang.LT.0)) THEN WRITE(6,10300)xiso,yiso,ziso,-nang,dsource,phicol, the_bea * m_code(:lnblnk1(the_beam_code)),the_input_file(:lnblnk1(th * e_input_file)), the_pegs_file(:lnblnk1(the_pegs_file)) WRITE(1,10300)xiso,yiso,ziso,-nang,dsource,phicol, the_bea * m_code(:lnblnk1(the_beam_code)),the_input_file(:lnblnk1(th * e_input_file)), the_pegs_file(:lnblnk1(the_pegs_file))10300 FORMAT( t15,' BEAM simulation source from multiple angles: *' // t10,' x-coordinate of the isocenter,' ,t62,f10.4,' cm' / t10, *' y-coordinate of the isocenter,' ,t62,f10.4,' cm' / t10,' z-coord *inate of the isocenter,' ,t62,f10.4,' cm' / t10,' number of theta- *phi groups:' ,t62,i10/ t10,' Distance from isocenter to centre of *scoring', ' plane:',t62,f10.4,' cm'/ t10,' Rotation angleabout bea *m axis,' ,t62,f10.4,' degrees'/ t10,' BEAM simulation: ',a/ t10,' * input file: ',a/ t10,' pegs data file: ',a/) WRITE(6,10310) WRITE(1,10310)10310 FORMAT(' theta-phi theta (deg.) phi (deg.)no. t *heta- normalized'/ ' group min. max. min. max *. phi pairs probability') DO 10321 I=1,-nang IF ((ivary(I).EQ.1)) THEN WRITE(6,10330)I,angmin(I),angmax(I),angfixed(I),an
![Page 183: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/183.jpg)
* gfixed(I),ngang(I), pgang(I) WRITE(1,10330)I,angmin(I),angmax(I),angfixed(I),an * gfixed(I),ngang(I), pgang(I)10330 FORMAT(I8,F11.4,F10.4,F9.4,F10.4,I7,F14.4) ELSE WRITE(6,10340)I,angfixed(I),angfixed(I),angmin(I), * angmax(I),ngang(I), pgang(I) WRITE(1,10340)I,angfixed(I),angfixed(I),angmin(I), * angmax(I),ngang(I), pgang(I)10340 FORMAT(I8,F11.4,F10.4,F9.4,F10.4,I7,F14.4) END IF10321 CONTINUE10322 CONTINUE END IF IF ((i_dbs.EQ.1)) THEN WRITE(6,10350) WRITE(1,10350)10350 FORMAT(t10,' Fat photons from DBS will be rejected.'/) ELSE WRITE(6,10360) WRITE(1,10360)10360 FORMAT(t10,' Fat photons from DBS will not be rejected.'/) END IF IF ((iqinc.EQ.2)) THEN WRITE(6,10370) WRITE(1,10370)10370 FORMAT(' Particles to be simulated: all'/) ELSE IF((iqinc.EQ.0)) THEN WRITE(6,10380) WRITE(1,10380)10380 FORMAT(' Particles to be simulated: photon only'/) ELSE IF((iqinc.EQ.1)) THEN WRITE(6,10390) WRITE(1,10390)10390 FORMAT(' Particles to be simulated: positron only'/) ELSE IF((iqinc.EQ.-1)) THEN WRITE(6,10400) WRITE(1,10400)10400 FORMAT(' Particles to be simulated: electron only'/) END IF IF ((e_split.GT.1 .AND. iqphsp.NE.0)) THEN WRITE(6,10410)e_split WRITE(1,10410)e_split10410 FORMAT(/' Charged particles will be split ',i10,' times.'/ *) END IF ELSE IF((isource.EQ.20)) THEN IF ((nset.GT.0)) THEN WRITE(6,10420)numang,dsource,nshist,the_vcu_code(:lnblnk1( * the_vcu_code)), the_vcu_input_file(:lnblnk1(the_vcu_input_ * file)) WRITE(1,10420)numang,dsource,nshist,the_vcu_code(:lnblnk1( * the_vcu_code)), the_vcu_input_file(:lnblnk1(the_vcu_input_ * file))10420 FORMAT( t15,'Phase Space Incident from multiple settings a *nd through an MLC ' // t10,' number of incident settings:' ,t62,i1 *0/ t10,' first distance from isocenter to origin in source', ' pla *ne:',t62,f10.4,' cm'/ t10,' Total number of particles in phase spa
![Page 184: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/184.jpg)
*ce file:',t62,i12/ t10,' VCU simulation: ',a/ t10,' VCU input file *: ',a/) WRITE(6,10430) WRITE(1,10430)10430 FORMAT(t10,' setting xiso yiso ziso * theta', ' phi phicol ', 'SAD MU Index *'/ t10,' num (cm) (cm) (cm) * (deg.)', ' (deg.) (deg.) (cm)') DO 10441 I=1,nset WRITE(6,10450)I,xtemp(I),ytemp(I),ztemp(I),thetatemp(I * ),phitemp(I), phicoltemp(I),dsourcetemp(I),muIndex(I) WRITE(1,10450)I,xtemp(I),ytemp(I),ztemp(I),thetatemp(I * ),phitemp(I), phicoltemp(I),dsourcetemp(I),muIndex(I)10450 FORMAT(t10,i7,f15.4,f11.4,f15.4,f12.4,f13.4,f11.4,f11. *4,f10.4)10441 CONTINUE10442 CONTINUE END IF WRITE(6,10460) WRITE(1,10460)10460 FORMAT(' ') IF ((i_dbs.EQ.1)) THEN WRITE(6,10470) WRITE(1,10470)10470 FORMAT(t10,' Fat photons from DBS will be rejected.'/) ELSE WRITE(6,10480) WRITE(1,10480)10480 FORMAT(t10,' Fat photons from DBS will not be rejected.'/) END IF IF ((iqinc.EQ.2)) THEN WRITE(6,10490) WRITE(1,10490)10490 FORMAT(' Particles to be simulated: all'/) ELSE IF((iqinc.EQ.0)) THEN WRITE(6,10500) WRITE(1,10500)10500 FORMAT(' Particles to be simulated: photon only'/) ELSE IF((iqinc.EQ.1)) THEN WRITE(6,10510) WRITE(1,10510)10510 FORMAT(' Particles to be simulated: positron only'/) ELSE IF((iqinc.EQ.-1)) THEN WRITE(6,10520) WRITE(1,10520)10520 FORMAT(' Particles to be simulated: electron only'/) END IF IF ((e_split.GT.1 .AND. iqphsp.NE.0)) THEN WRITE(6,10530)e_split WRITE(1,10530)e_split10530 FORMAT(/' Charged particles will be split ',i10,' times.'/ *) END IF ELSE IF((isource.EQ.21)) THEN IF ((nset.GT.0)) THEN WRITE(6,10540)numang,dsource, the_beam_code(:lnblnk1(the_b * eam_code)),the_input_file(:lnblnk1(the_input_file)), the_p * egs_file(:lnblnk1(the_pegs_file)),the_vcu_code(:lnblnk1(th
![Page 185: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/185.jpg)
* e_vcu_code)), the_vcu_input_file(:lnblnk1(the_vcu_input_fi * le)) WRITE(1,10540)numang,dsource, the_beam_code(:lnblnk1(the_b * eam_code)),the_input_file(:lnblnk1(the_input_file)), the_p * egs_file(:lnblnk1(the_pegs_file)),the_vcu_code(:lnblnk1(th * e_vcu_code)), the_vcu_input_file(:lnblnk1(the_vcu_input_fi * le))10540 FORMAT( t15,'BEAM treatment simulation used as source ' // *t10,' number of incident settings:' ,t62,i10/ t10,' first distance * from isocenter to origin in source', ' plane:',t62,f10.4,' cm'/ t *10,' BEAM simulation: ',a/ t10,' input file: ',a/t10,' pegs data f *ile: ',a/ t10,' VCU simulation: ',a/ t10,' VCU input file: ',a/) WRITE(6,10550) WRITE(1,10550)10550 FORMAT(t10,' setting xiso yiso ziso * theta', ' phi phicol ', 'SAD MU Index *'/ t10,' num (cm) (cm) (cm) * (deg.)', ' (deg.) (deg.) (cm)') DO 10561 I=1,nset WRITE(6,10570)I,xtemp(I),ytemp(I),ztemp(I),thetatemp(I * ),phitemp(I), phicoltemp(I),dsourcetemp(I),muIndex(I) WRITE(1,10570)I,xtemp(I),ytemp(I),ztemp(I),thetatemp(I * ),phitemp(I), phicoltemp(I),dsourcetemp(I),muIndex(I)10570 FORMAT(t10,i7,f15.4,f11.4,f15.4,f12.4,f13.4,f11.4,f11. *4,f10.4)10561 CONTINUE10562 CONTINUE END IF WRITE(6,10580) WRITE(1,10580)10580 FORMAT(' ') IF ((i_dbs.EQ.1)) THEN WRITE(6,10590) WRITE(1,10590)10590 FORMAT(t10,' Fat photons from DBS will be rejected.'/) ELSE WRITE(6,10600) WRITE(1,10600)10600 FORMAT(t10,' Fat photons from DBS will not be rejected.'/) END IF IF ((iqinc.EQ.2)) THEN WRITE(6,10610) WRITE(1,10610)10610 FORMAT(' Particles to be simulated: all'/) ELSE IF((iqinc.EQ.0)) THEN WRITE(6,10620) WRITE(1,10620)10620 FORMAT(' Particles to be simulated: photon only'/) ELSE IF((iqinc.EQ.1)) THEN WRITE(6,10630) WRITE(1,10630)10630 FORMAT(' Particles to be simulated: positron only'/) ELSE IF((iqinc.EQ.-1)) THEN WRITE(6,10640) WRITE(1,10640)10640 FORMAT(' Particles to be simulated: electron only'/) END IF IF ((e_split.GT.1 .AND. iqphsp.NE.0)) THEN
![Page 186: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/186.jpg)
WRITE(6,10650)e_split WRITE(1,10650)e_split10650 FORMAT(/' Charged particles will be split ',i10,' times.'/ *) END IF END IF IF ((isource .EQ. 4)) THEN WRITE(6,10660)xiso,yiso,ziso,theta(1),phi(1),dsource,phicol10660 FORMAT(/t20,' Beam characterization model' // t10,' x-coordina *te of the isocenter,' ,t55,f8.3,' cm' / t10,' y-coordinate of thei *socenter,' ,t55,f8.3,' cm' / t10,' z-coordinate of the isocenter,' * ,t55,f8.3,' cm' / t10,' Polar angle of source plane:' ,t55,f8.3,' * degrees'/ t10,' Azimuthal angle of source plane:' ,t55,f8.3,' deg *rees'/ t10,' Distance from isocenter to source centre:',t55,f8.3,' * cm'/ t10,' Source rotation angle,' ,t55,f8.3,' degrees'/) UINC=0. VINC=0. WINC=0. EIN=SMFMXE DO 10671 IQIN=1,NSMFPS IF ((IQSMFP(IQIN) .EQ. -1)) THEN UINC=1. ELSE IF((IQSMFP(IQIN) .EQ. 0)) THEN VINC=2. ELSE IF((IQSMFP(IQIN) .EQ. +1)) THEN WINC=4. ELSE WINC=10. END IF10671 CONTINUE10672 CONTINUE IQIN=INT(UINC+VINC+WINC) IF ((IQIN .EQ. 1)) THEN WRITE(IOUTLIST,10680) ELSE IF((IQIN .EQ. 2)) THEN WRITE(IOUTLIST,10690) ELSE IF((IQIN .EQ. 3)) THEN WRITE(IOUTLIST,10700) ELSE IF((IQIN .EQ. 4)) THEN WRITE(IOUTLIST,10710) ELSE IF((IQIN .EQ. 5)) THEN WRITE(IOUTLIST,10720) ELSE IF((IQIN .EQ. 6)) THEN WRITE(IOUTLIST,10730) ELSE IF((IQIN .EQ. 7)) THEN WRITE(IOUTLIST,10740) ELSE WRITE(IOUTLIST,10750) END IF10680 FORMAT(T20,'INITIAL PARTICLES are electrons only')10690 FORMAT(T20,'INITIAL PARTICLES are photons only')10700 FORMAT(T20,'INITIAL PARTICLES are electrons and photons')10710 FORMAT(T20,'INITIAL PARTICLES are positrons only')10720 FORMAT(T20,'INITIAL PARTICLES are electrons and positrons')10730 FORMAT(T20,'INITIAL PARTICLES are photons and positrons')10740 FORMAT(T20,'INITIAL PARTICLES are electrons, photons and posit *rons')10750 FORMAT(T20,'ERROR: INITIAL PARTICLES are unknown')
![Page 187: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/187.jpg)
END IF return end subroutine srchst(xin,yin,zin,uin,vin,win,irin,weight,latchi) ! Copyright National Research Council of Canada, Ottawa, ! BEAM Code System 1999, all rights reserved ! This code is covered by the BEAM General License implicit none COMMON/ENERGYSRC/NENSRC,IMODE,ENSRCD,SRCPDF,SRCCDF,ENMIN,CDFINV,DE *LTAK REAL ENSRCD(200),SRCPDF(200),SRCCDF(200),ENMIN, CDFINV(1000,2),DEL *TAK INTEGER IMODE,NENSRC common/source/ esrc, nhist, nnread, einsrc, xsrcold, ysrcold, * usrcold, vsrcold, wsrcold, weightold, latchold, frMU_indx, *zinc, xinl, xinu, yinl, yinu, zinl, zinu, thetax, thetay, * thetaz, uinc, vinc, winc, beamarea, xcol, ycol, xiso, yiso *, ziso, phicol, theta(60000), phi(60000), pang(60000), angfi *xed(60000), angmin(60000), angmax(60000), pgang(60000), xtemp( *60000), ytemp(60000), ztemp(60000), phicoltemp(60000), thetatem *p(60000), phitemp(60000), muIndex(60000), r_11(60000), r_12(600 *00), r_13(60000), r_21(60000), r_22(60000), r_23(60000), r_31(6000 *0), r_32(60000), r_33(60000), dsource, dsourcetemp(60000), ein, e *ksrcm, esrc_sp, SSD, einsrcold, iqinold, NINCSRC, r_dbs, ssd *_dbs, z_dbs, enflag, dflag, ismode, isource, iqin, * iqphsp, iqinc, MLCflag *, ixinl, ixinu, jyinl, jyinu, kzinl, * kzinu, klowx, khix, klowy, khiy, * klowz, khiz, survival_ratio, nsmiss, *nsrjct, nsoutside, nmissm, nshist, nphist, * nnphsp, IPRIMARY, * OLDSRC, npassi, nang, ivary(600 *00), ngang(60000), nset, more_in_cont, * numang, dose_stat, ndbsrjct, * i_dbs, iphatsrc, e_split, * i_iaea_in, i_unit_in, nhist_last, * the_beam_code, the_input_file, the *_vcu_input_file, the_pegs_file, the_ *phsp_file, the_vcu_code real*8 esrc,muIndex integer*8 nhist, nnread real*8 einsrc, xsrcold, ysrcold,usrcold,vsrcold,wsrcold,weightold, *latchold, frMU_indx real*4 zinc, xinl, xinu, yinl, yinu, zinl, zinu, thetax, thetay *, thetaz, uinc, vinc, winc, beamarea, xcol,ycol,xiso, yiso, zi *so, phicol, theta, phi, xtemp, ytemp, ztemp, phico *ltemp,thetatemp, phitemp, pang,angfixed,angmin,ang *max,pgang,r_11, r_12, r_13, r_21, r_22, r_23 *, r_31, r_32, r_33,dsource,dsourcetemp, * ein, eksrcm, esrc_sp, SSD, NINCSRC, * r_dbs, ssd_dbs,z_dbs,survival_ratio,einsrcold integer*4 isource, iqin, iqphsp, iqinc,iqinold,MLCflag, * ixinl, ixinu, jyinl, jyinu, kzinl, kzinu, * klowx, khix, klowy, khiy, klowz, khiz *, nsmiss, nsrjct,nsoutsid *e, nmissm,nshist,nphist,nnphsp, enflag, dflag, is *mode, IPRIMARY, OLDSRC,npassi,nang,ivary,ngang,numang,dose_stat, * ndbsrjct,i_dbs,iphatsrc,e_split,i_iaea_in,i_unit_in,more_in_c
![Page 188: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/188.jpg)
*ont,nset integer*2 nhist_last character*80 the_beam_code, the_vcu_code, the_input_file,the_pegs_ *file, the_vcu_input_file,the_phsp_file COMMON/SOURCE_FORPARALLEL/nnphsp_max, nnphsp_min integer*4 nnphsp_max, nnphsp_min common/geom/ xbound(128+1), ybound(128+1), zbound(128+1), xboun *d_min, xbound_max, ybound_min, ybound_max, zbound_min, zbound *_max, medsur, dsurround(4), IMAX, JMAX, KMAX, ijmax, irmax, * howfarless real*4 xbound, ybound, zbound, xbound_min, xbound_max, ybound_min, * ybound_max, zbound_min, zbound_max,dsurround integer medsur,IMAX, JMAX, KMAX, ijmax,irmax logical howfarless common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 COMMON/SSMDIS/ISMMODE,NSSMDIS,IB_SSM,IC_SSM, SSMDIS,SSMPDF,SSMCDF, *SSMMIN,SSMMAX,CDFSSM INTEGER ISMMODE,NSSMDIS,IB_SSM,IC_SSM REAL SSMDIS(200),SSMPDF(200),SSMCDF(200),SSMMIN,SSMMAX, CDFSSM(200 *0,2) COMMON/BMODELC1/ NSMFPS,ISMFPS,IQSMFP,ILATCH,NSMFXX,NSMFYY,NSMFRR, * MSMFXY,MISMFP,SMFPXY,NSCATT,NFIELD,NFIELDi,NFIELDo,NFIELDe, RFIEL *D,RFIELDe,XFLDMN,XFLDMX,YFLDMN,YFLDMX, FLDRR2,FLDYY2,FLDXX2,SMFMNZ *,SMFMNX,SMFMXX, SMFMNY,SMFX2,SMFY2,SMFMXY,SMFMNR,SMFMXR, SMFRTN,SS *DVPS,FSMFBN,FSMABN,FSMFRR,FSMFXY,FSMFR11, FSMFR12,SMFDXX,SMFDYY,RF *ACTOR1,RFACTOR2, SMFNR2,SMFMR2,SMFMXZ,RSCATT,SMFMNE,SMFMXE,ERADII, * SSMFPS,RTREAT,RTREATe,XTREATMN,XTREATMX,YTREATMN,YTREATMX, XINSMX *,XINSMN,YINSMX,YINSMN,XINS,YINS,SMONAM,ABNTOTAL,ABNTOTALH INTEGER nSrc,source,n, KKKK,IRBIN, ESTYPE, NSMFPS,ISMFPS(22),IQ *SMFP(22),ILATCH(22),NSMFXX(22),NSMFYY(22), NSMFRR(22),MSMFXY(22),M *ISMFP(2000),SMFPXY(22),NSCATT, NFIELD,NFIELDi,NFIELDo,NFIELDe REAL RFIELD,RFIELDe,XFLDMN,XFLDMX,YFLDMN,YFLDMX, FLDRR2(22),FLDXX2 *(22),FLDYY2(22),SMFMNZ(22),SMFMNX(22),SMFMXX(22), SMFMNY(22),SMFX2 *(22),SMFY2(22),SMFMXY(22),SMFMNR(22),SMFMXR(22), SMFRTN(22),SSDVPS *(22+3),FSMFBN(22,200,2000,2), FSMABN(2000,2),FSMFRR(22,2000,2), FS *MFXY(22,200,200),FSMFR11(22,200), FSMFR12(22,200),SMFDXX(22),SMFDY *Y(22),RFACTOR1,RFACTOR2, SMFNR2(22),SMFMR2(22),SMFMXZ(22),RSCATT,S *MFMNE,SMFMXE,ERADII(200), RTREAT,RTREATe,XTREATMN,XTREATMX,YTREATM *N,YTREATMX, RRR,RRR1,RRR2,XXX,YYY,XXX1,YYY1,ZZZ1, DDMNX,DDMXX,DDMN *Y,DDMXY REAL XINSMX,XINSMN,YINSMX,YINSMN,XINS,YINS,ABNTOTAL,ABNTOTALH CHARACTER*80 SSMFPS,SMONAM COMMON/PHSPFILE/BEAM_SIZE,MODE_PHSP1,LATCH_OPT, NCASE_PHSP,LATBIT, *NBIT1,NBIT2,I_BIT_FILTER,NofREPEAT,ISMOOTH, OUTCNT,NRCYCL,IPARALLE *L,PARNUM,CYCLNUM real BEAM_SIZE INTEGER MODE_PHSP1,LATCH_OPT,NCASE_PHSP,LATBIT(20),NBIT1,NBIT2, I_ *BIT_FILTER,NofREPEAT,ISMOOTH,OUTCNT,NRCYCL,IPARALLEL,PARNUM,CYCLNU *M COMMON/RWPHSP/ STRING_TEMP_ZLAST_OUT, STRING_TEMP_OUT, IHSTRY_PH *SP, iaea_dummy_long, ESHORT, WEIGHTTMP, WT_PHSP_SHORT, X_PHS *P_SHORT, Y_PHSP_SHORT, Z_PHSP_SHORT, U_PHSP_SHORT, V_PHSP_SHOR *T, W_PHSP_SHORT, ZLAST_PHSP_SHORT, EKMAX_PHSP_SHORT, EKMINE_PH *SP_SHORT, NINC_PHSP_SHORT, NUM_PHSP_TOT, PHOT_PHSP_TOT, iaea_re
![Page 189: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/189.jpg)
*sult, iaea_n_stat, iaea_q_typ, iaea_typ_q, iaea_q_index, I_P *HSP, IERR_PHSP, LATCHTMP, WRITE_PHSP_COUNTER, WRITE_PHSP_SOFAR *, PHSP_RESTART, PHSP_RECL, PHSP_RECL_OLD, iaea_extra_ints, ia *ea_extra_int_types,iaea_extra_float_types, MODE_RW CHARACTER*32000 STRING_TEMP_ZLAST_OUT(1) CHARACTER*28000 STRING_TEMP_OUT(1) integer*8 IHSTRY_PHSP(1),iaea_dummy_long REAL*4 ESHORT,WEIGHTTMP,WT_PHSP_SHORT,X_PHSP_SHORT,Y_PHSP_SHORT, Z *_PHSP_SHORT,U_PHSP_SHORT, V_PHSP_SHORT,W_PHSP_SHORT,ZLAST_PHSP_SHO *RT, EKMAX_PHSP_SHORT,EKMINE_PHSP_SHORT,NINC_PHSP_SHORT INTEGER NUM_PHSP_TOT,PHOT_PHSP_TOT, iaea_result,iaea_n_stat,iaea_q *_typ(3),iaea_typ_q(3),iaea_q_index,I_PHSP, IERR_PHSP,LATCHTMP, WRI *TE_PHSP_COUNTER(1),WRITE_PHSP_SOFAR(1), PHSP_RESTART,PHSP_RECL,PHS *P_RECL_OLD,iaea_extra_ints(2), iaea_extra_int_types(2),iaea_extra_ *float_types(1) CHARACTER*5 MODE_RW INTEGER LATCH_TEMP_OUT,NUM_PHSP_TOFLUSH,TEMP_PHSP_COUNTER,REM_PHSP REAL*4 REAL_TEMP_OUT(7) CHARACTER*32 REC_TEMP_OUT common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch common/score/IWATCH,mxnp, endep( 2097153), endep2( 2097153), temp2 *, planarefe, planarefp,planarfe,planarfp,nestep,endep_tmp( 2097153 *), endep_last( 2097153) integer IWATCH, mxnp real endep_tmp REAL*8 endep, endep2, temp2,planarefe, planarefp, planarfe, planar *fp integer*8 nestep integer*2 endep_last real*8 xsrc,ysrc,zsrc, xsrcp,ysrcp,zsrcp, usrc,vsrc,wsrc, xinde *l,yindel,zindel, xin,yin,zin, uin,vin,win, enin, zsrcdum, r1, *rnno1,rnno2, fw, rxyz, costheta,sintheta, weight, zlast, dist, *dist_dbs, coscol,sincol, cosphi,sinphi real*8 RBEAM,DIST_RAY integer*4 ix,jy,kz,i,j,k, irin, latchi, ibit integer*8 n_hist_dum save wsrc zsrc = dsource IF ((isource .EQ. 0)) THEN xindel = xinu-xinl IF ((xindel .EQ. 0.0)) THEN xin=xinl ELSE IF((rng_seed .GT. 128))call ranmar_get r1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 xin = xinl + r1*xindel
![Page 190: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/190.jpg)
END IF yindel = yinu-yinl IF ((YINDEL .EQ. 0.0)) THEN yin=yinl ELSE IF((rng_seed .GT. 128))call ranmar_get r1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 yin = yinl + r1*yindel END IF zin = zinc uin=uinc vin=vinc win=winc IF ((xindel .EQ. 0.0)) THEN ix=ixinl ELSE ix=ixinl-110761 CONTINUE ix=ix+1 IF((( xbound(ix) .LE. xin .AND. xbound(ix+1) .GT. xin * )))GO TO10762 GO TO 1076110762 CONTINUE END IF IF ((yindel .EQ. 0.0)) THEN jy=jyinl ELSE jy=jyinl-110771 CONTINUE jy=jy+1 IF((( ybound(jy) .LE. yin .AND. ybound(jy+1) .GT. yin) * ))GO TO10772 GO TO 1077110772 CONTINUE END IF irin = 1 + ix +(jy-1)*imax IF ((enflag .EQ. 1)) THEN IF((rng_seed .GT. 128))call ranmar_get RNNO1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get RNNO2 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 K = MIN(DELTAK*RNNO1+1.,DELTAK) esrc_sp = CDFINV(K,1) + RNNO2*CDFINV(K,2) END IF return END IF IF ((isource .EQ. 3)) THEN xindel = xinu-xinl yindel = yinu-yinl IF ((xindel .EQ. 0.0 .OR. yindel .EQ. 0.0 )) THEN XIN = xinl YIN = yinl RXYZ=SQRT(SSD*SSD+XIN*XIN+YIN*YIN) ELSE10781 CONTINUE
![Page 191: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/191.jpg)
IF((rng_seed .GT. 128))call ranmar_get r1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 xin=r1*xindel+xinl IF((rng_seed .GT. 128))call ranmar_get r1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 yin=r1*yindel+yinl IF((rng_seed .GT. 128))call ranmar_get r1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 RXYZ=SQRT(SSD*SSD+xin*xin+yin*yin) win=SSD/RXYZ FW=win**3. IF((r1.LT.FW))GOTO 10790 GO TO 1078110782 CONTINUE10790 CONTINUE END IF zin = zinc uin=XIN/RXYZ vin=YIN/RXYZ IF ((xindel .EQ. 0.0)) THEN ix=ixinl ELSE ix=ixinl-110801 CONTINUE ix=ix+1 IF((( xbound(ix) .LE. xin .AND. xbound(ix+1) .GT. xin * )))GO TO10802 GO TO 1080110802 CONTINUE END IF IF ((yindel .EQ. 0.0)) THEN jy=jyinl ELSE jy=jyinl-110811 CONTINUE jy=jy+1 IF((( ybound(jy) .LE. yin .AND. ybound(jy+1) .GT. yin) * ))GO TO10812 GO TO 1081110812 CONTINUE END IF irin = 1 + ix +(jy-1)*imax IF ((enflag .EQ. 1)) THEN IF((rng_seed .GT. 128))call ranmar_get RNNO1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get RNNO2 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 K = MIN(DELTAK*RNNO1+1.,DELTAK) esrc_sp = CDFINV(K,1) + RNNO2*CDFINV(K,2) END IF return END IF IF ((isource .EQ. 6)) THEN
![Page 192: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/192.jpg)
xindel = xinu-xinl yindel = yinu-yinl zindel = zinu-zinl IF ((xindel .EQ. 0.0)) THEN xin=xinl ELSE IF((rng_seed .GT. 128))call ranmar_get r1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 xin = xinl + r1*xindel END IF IF ((yindel .EQ. 0.0)) THEN yin=yinl ELSE IF((rng_seed .GT. 128))call ranmar_get r1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 yin = yinl + r1*yindel END IF IF ((zindel .EQ. 0.0)) THEN zin=zinl ELSE IF((rng_seed .GT. 128))call ranmar_get r1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 zin = zinl + r1*zindel END IF IF((rng_seed .GT. 128))call ranmar_get costheta = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 costheta=2.*costheta-1 sintheta=SQRT(1.0-costheta**2) IF((rng_seed .GT. 128))call ranmar_get phi(1) = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 phi(1)=6.283185*phi(1) uin=sintheta*COS(phi(1)) vin=sintheta*SIN(phi(1)) win=costheta IF ((xindel .EQ. 0.0)) THEN ix=ixinl ELSE ix=ixinl-110821 CONTINUE ix=ix+1 IF((( xbound(ix) .LE. xin .AND. xbound(ix+1) .GT. xin * )))GO TO10822 GO TO 1082110822 CONTINUE END IF IF ((yindel .EQ. 0.0)) THEN jy=jyinl ELSE jy=jyinl-110831 CONTINUE jy=jy+1 IF((( ybound(jy) .LE. yin .AND. ybound(jy+1) .GT. yin) * ))GO TO10832
![Page 193: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/193.jpg)
GO TO 1083110832 CONTINUE END IF IF ((zindel .EQ. 0.0)) THEN kz=kzinl ELSE kz=kzinl-110841 CONTINUE kz=kz+1 IF((( zbound(kz) .LE. zin .AND. zbound(kz+1) .GT. zin) * ))GO TO10842 GO TO 1084110842 CONTINUE END IF irin = (1 + ix + (jy-1)*IMAX + (kz-1)*ijmax) IF ((enflag .EQ. 1)) THEN IF((rng_seed .GT. 128))call ranmar_get RNNO1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get RNNO2 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 K = MIN(DELTAK*RNNO1+1.,DELTAK) esrc_sp = CDFINV(K,1) + RNNO2*CDFINV(K,2) END IF return END IF10850 CONTINUE IF ((isource .EQ. 1 .OR. isource.EQ.7)) THEN wsrc = 1.0 usrc = 0. vsrc = 0. IF((rng_seed .GT. 128))call ranmar_get xsrc = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get ysrc = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 xsrc = (xsrc-0.5)*xcol ysrc = (ysrc-0.5)*ycol IF ((enflag .EQ. 1)) THEN IF((rng_seed .GT. 128))call ranmar_get RNNO1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get RNNO2 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 K = MIN(DELTAK*RNNO1+1.,DELTAK) enin = CDFINV(K,1) + RNNO2*CDFINV(K,2) esrc_sp = enin END IF ELSE IF((isource .EQ. 2 .OR. isource.EQ.8)) THEN IF ((NRCYCL.GT.0 .AND. CYCLNUM.GT.0 .AND. CYCLNUM.LE.NRCYCL)) * THEN NofREPEAT=NofREPEAT+1 CYCLNUM=CYCLNUM+1 xsrc=xsrcold ysrc=ysrcold
![Page 194: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/194.jpg)
usrc=usrcold vsrc=vsrcold ELSE10861 CONTINUE10870 CONTINUE IF ((n_parallel.GT.0 .AND. nnphsp.GT.nnphsp_max)) THEN nnphsp=nnphsp_min OUTCNT=OUTCNT+1 WRITE(6,10880)10880 FORMAT(///' ***WARNING*** USED ALL PARTICLES FROMC *HUNK IN SOURCE FILE!'/ ' RESTARTING FROM FIRST PARTI *CLE IN THIS CHUNK.'// /1x,79('*')//) IF ((i_iaea_in.EQ.1)) THEN nhist=OUTCNT*NINCSRC/(n_parallel*10) END IF ELSE IF((IPARALLEL.GT.1 .AND. PARNUM.GT.0 .AND. nnphsp * .GT. INT(PARNUM*nshist/IPARALLEL))) THEN NofREPEAT = NofREPEAT + 1 OUTCNT=OUTCNT+1 WRITE(6,10890) WRITE(1,10890)10890 FORMAT(/' *** Warning *** Used all particles fromp *artition of source file'/ ' Restarting from first *particle in this partition'/) nnphsp = INT((PARNUM-1)*nshist/IPARALLEL)+1 IF ((i_iaea_in.EQ.1)) THEN nhist=OUTCNT*NINCSRC/IPARALLEL END IF ELSE IF(( nnphsp .GT. nshist)) THEN NofREPEAT = NofREPEAT + 1 OUTCNT=OUTCNT+1 WRITE(6,10900) WRITE(1,10900)10900 FORMAT(/' *** Warning *** Used all particles froms *ource file'/ ' Restarting from first particle infi *le'/) nnphsp = 1 IF ((i_iaea_in.EQ.1)) THEN nhist=OUTCNT*NINCSRC END IF END IF nnphsp = nnphsp+1 IF ((i_iaea_in.EQ.1)) THEN ELSE IF ((ismode.NE.0)) THEN READ(44,REC=nnphsp,IOSTAT=IERR_PHSP) latchi,ES * HORT,X_PHSP_SHORT,Y_PHSP_SHORT, U_PHSP_SHORT,V * _PHSP_SHORT,WT_PHSP_SHORT,ZLAST_PHSP_SHORT ELSE READ(44,REC=nnphsp,IOSTAT=IERR_PHSP) latchi,ES * HORT,X_PHSP_SHORT,Y_PHSP_SHORT, U_PHSP_SHORT,V * _PHSP_SHORT,WT_PHSP_SHORT END IF IF ((ESHORT.LT.0.0)) THEN nhist=nhist+1 ESHORT=ABS(ESHORT) END IF einsrc=ESHORT
![Page 195: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/195.jpg)
weight=WT_PHSP_SHORT xsrc=X_PHSP_SHORT ysrc=Y_PHSP_SHORT usrc=U_PHSP_SHORT vsrc=V_PHSP_SHORT IF((ismode.NE.0))zlast=ZLAST_PHSP_SHORT IF ((IERR_PHSP.EQ.0)) THEN einsrc=ESHORT IF ((BTEST(latchi,31))) THEN npassi = 1 latchi = IBCLR(latchi,31) ELSE npassi = 0 END IF IF ((BTEST(latchi,30))) THEN iqin = -1 latchi = IBCLR(latchi,30) latchi = IBCLR(latchi,29) ELSE IF ((BTEST(latchi,29))) THEN iqin = 1 latchi = IBCLR(latchi,29) ELSE iqin = 0 END IF END IF wsrc = min( 1., usrc**2 + vsrc**2) wsrc = sqrt(1. - wsrc) wsrc = SIGN(wsrc,weight) weight=ABS(weight) END IF END IF nnread = nnread +1 IF ((wsrc .LT. 0.0)) THEN nsrjct=nsrjct+1 goto 10870 END IF IF (( npassi.EQ.1 )) THEN nsrjct=nsrjct+1 goto 10870 ELSE IF(( iqin.EQ.1 .AND. iqphsp .NE. 1 .AND. iqphsp . * NE.2)) THEN nsrjct=nsrjct+1 goto 10870 ELSE IF(( iqin.EQ.0 .AND. iqphsp .NE. 0 .AND. iqphsp . * NE.2)) THEN nsrjct=nsrjct+1 goto 10870 ELSE IF(( iqin.EQ.-1 .AND. iqphsp .NE.-1 .AND. iqphsp * .NE.2)) THEN nsrjct=nsrjct+1 goto 10870 ELSE IF((i_dbs.EQ.1 .AND. iqin.EQ.0)) THEN dist_dbs=(ssd_dbs-z_dbs)/wsrc IF (((xsrc+usrc*dist_dbs)**2+(ysrc+vsrc*dist_dbs)* * *2.GT.r_dbs**2)) THEN ndbsrjct=ndbsrjct+1 goto 10870
![Page 196: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/196.jpg)
END IF END IF IF ((enflag .EQ. 3)) THEN IF ((I_BIT_FILTER .EQ. 0)) THEN DO 10911 IBIT=1,NBIT1 IF ((BTEST(latchi,LATBIT(IBIT)))) THEN GO TO10912 END IF IF ((IBIT.EQ.NBIT1)) THEN nsrjct=nsrjct+1 goto 10870 END IF10911 CONTINUE10912 CONTINUE DO 10921 IBIT=1,NBIT2 IF ((BTEST(latchi,LATBIT(IBIT+NBIT1)))) TH * EN nsrjct=nsrjct+1 goto 10870 END IF10921 CONTINUE10922 CONTINUE goto 10930 ELSE IF((I_BIT_FILTER.EQ.1)) THEN DO 10941 IBIT=1,NBIT1 IF ((BTEST(latchi,LATBIT(IBIT)))) THEN nsrjct=nsrjct+1 goto 10870 END IF10941 CONTINUE10942 CONTINUE goto 10930 ELSE IF((I_BIT_FILTER.EQ.2)) THEN DO 10951 IBIT=1,NBIT1 IF ((IBITS(latchi,24,5).EQ.LATBIT(IBIT))) * THEN goto 10930 END IF10951 CONTINUE10952 CONTINUE nsrjct=nsrjct+1 goto 10870 ELSE IF((I_BIT_FILTER.EQ.3)) THEN DO 10961 IBIT=1,NBIT1 IF ((IBITS(latchi,24,5).EQ.LATBIT(IBIT))) * THEN nsrjct=nsrjct+1 goto 10870 END IF10961 CONTINUE10962 CONTINUE goto 10930 END IF END IF10930 CONTINUE IF ((ABS(xsrc) .GE. (BEAM_SIZE/2.0) .OR. ABS(ysrc).GE. * (BEAM_SIZE/2.0))) THEN nsoutside=nsoutside+1
![Page 197: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/197.jpg)
END IF IF(((ABS(xsrc) .LT. (BEAM_SIZE/2.0) .AND. ABS(ysrc).LT * .(BEAM_SIZE/2.0))))GO TO10862 GO TO 1086110862 CONTINUE IF ((NRCYCL.GT.0)) THEN CYCLNUM=1 NofREPEAT=0 xsrcold=xsrc ysrcold=ysrc usrcold=usrc vsrcold=vsrc END IF END IF ELSE IF(( isource .EQ. 9 .OR. isource .EQ.10 )) THEN10971 CONTINUE10980 CONTINUE call sample_beamsource(einsrc,xsrc,ysrc,zsrcdum,usrc,vsrc, * wsrc,weight, iqin,latchi,nhist,iphatsrc) nnread = nnread +1 IF (( iqinc .LT. 2 .AND. iqin .NE. iqinc )) THEN nsrjct=nsrjct+1 goto 10980 ELSE IF(( iqinc .EQ. 3 .AND. iqin .EQ. 0 )) THEN nsrjct=nsrjct+1 goto 10980 ELSE IF((i_dbs.EQ.1 .AND. iqin.EQ.0 .AND. iphatsrc.GT.1)) * THEN nsrjct=ndbsrjct+1 goto 10980 END IF IF ((enflag .EQ. 3)) THEN IF ((I_BIT_FILTER .EQ. 0)) THEN DO 10991 IBIT=1,NBIT1 IF ((BTEST(latchi,LATBIT(IBIT)))) THEN GO TO10992 END IF IF ((IBIT.EQ.NBIT1)) THEN nsrjct=nsrjct+1 goto 10980 END IF10991 CONTINUE10992 CONTINUE DO 11001 IBIT=1,NBIT2 IF ((BTEST(latchi,LATBIT(IBIT+NBIT1)))) THEN nsrjct=nsrjct+1 goto 10980 END IF11001 CONTINUE11002 CONTINUE goto 11010 ELSE IF((I_BIT_FILTER.EQ.1)) THEN DO 11021 IBIT=1,NBIT1 IF ((BTEST(latchi,LATBIT(IBIT)))) THEN nsrjct=nsrjct+1 goto 10980 END IF11021 CONTINUE
![Page 198: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/198.jpg)
11022 CONTINUE goto 11010 ELSE IF((I_BIT_FILTER.EQ.2)) THEN DO 11031 IBIT=1,NBIT1 IF ((IBITS(latchi,24,5).EQ.LATBIT(IBIT))) THEN goto 11010 END IF11031 CONTINUE11032 CONTINUE nsrjct=nsrjct+1 goto 10980 ELSE IF((I_BIT_FILTER.EQ.3)) THEN DO 11041 IBIT=1,NBIT1 IF ((IBITS(latchi,24,5).EQ.LATBIT(IBIT))) THEN nsrjct=nsrjct+1 goto 10980 END IF11041 CONTINUE11042 CONTINUE goto 11010 END IF END IF11010 CONTINUE IF ((ABS(xsrc) .GE. (BEAM_SIZE/2.0) .OR. ABS(ysrc).GE.(BEA * M_SIZE/2.0))) THEN nsoutside=nsoutside+1 END IF IF(((ABS(xsrc) .LT. (BEAM_SIZE/2.0) .AND. ABS(ysrc).LT.(BE * AM_SIZE/2.0))))GO TO10972 GO TO 1097110972 CONTINUE ELSE IF(( isource .EQ. 20 )) THEN IF ((NRCYCL.GT.0 .AND. CYCLNUM.GT.0 .AND. CYCLNUM.LE.NRCYCL)) * THEN NofREPEAT=NofREPEAT+1 CYCLNUM=CYCLNUM+1 einsrc=einsrcold xsrc=xsrcold ysrc=ysrcold usrc=usrcold vsrc=vsrcold wsrc=wsrcold weight=weightold latchi=latchold iqin=iqinold ELSE11051 CONTINUE11060 CONTINUE IF ((more_in_cont .EQ. 0)) THEN IF ((n_parallel.GT.0 .AND. nnphsp.GT.nnphsp_max)) * THEN nnphsp=nnphsp_min OUTCNT=OUTCNT+1 WRITE(6,11070)11070 FORMAT(///' ***WARNING*** USED ALL PARTICLES F *ROM CHUNK IN SOURCE FILE!'/ ' RESTARTING FROM FIRSTP *ARTICLE IN THIS CHUNK.'// /1x,79('*')//) IF ((i_iaea_in.EQ.1)) THEN
![Page 199: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/199.jpg)
nhist=OUTCNT*NINCSRC/(n_parallel*10) END IF ELSE IF((IPARALLEL.GT.1 .AND. PARNUM.GT.0 .AND. nn * phsp .GT. INT(PARNUM*nshist/IPARALLEL))) THEN NofREPEAT = NofREPEAT + 1 OUTCNT=OUTCNT+1 WRITE(6,11080) WRITE(1,11080)11080 FORMAT(/' *** Warning *** Used all particles f *rom partition of source file'/ ' Restarting from f *irst particle in this partition'/) nnphsp = INT((PARNUM-1)*nshist/IPARALLEL)+1 IF ((i_iaea_in.EQ.1)) THEN nhist=OUTCNT*NINCSRC/IPARALLEL END IF ELSE IF(( nnphsp .GT. nshist)) THEN NofREPEAT = NofREPEAT + 1 OUTCNT=OUTCNT+1 WRITE(6,11090) WRITE(1,11090)11090 FORMAT(/' *** Warning *** Used all particles f *rom source file'/ ' Restarting from first particle * in file'/) nnphsp = 1 IF ((i_iaea_in.EQ.1)) THEN nhist=OUTCNT*NINCSRC END IF END IF nnphsp = nnphsp+1 IF ((i_iaea_in.EQ.1)) THEN ELSE IF ((ismode.NE.0)) THEN READ(44,REC=nnphsp,IOSTAT=IERR_PHSP) latch * i,ESHORT,X_PHSP_SHORT,Y_PHSP_SHORT, U_PHSP * _SHORT,V_PHSP_SHORT,WT_PHSP_SHORT,ZLAST_PH * SP_SHORT ELSE READ(44,REC=nnphsp,IOSTAT=IERR_PHSP) latch * i,ESHORT,X_PHSP_SHORT,Y_PHSP_SHORT, U_PHSP * _SHORT,V_PHSP_SHORT,WT_PHSP_SHORT END IF IF ((ESHORT.LT.0.0)) THEN nhist=nhist+1 ESHORT=ABS(ESHORT) END IF einsrc=ESHORT weight=WT_PHSP_SHORT xsrc=X_PHSP_SHORT ysrc=Y_PHSP_SHORT usrc=U_PHSP_SHORT vsrc=V_PHSP_SHORT IF((ismode.NE.0))zlast=ZLAST_PHSP_SHORT IF ((IERR_PHSP.EQ.0)) THEN einsrc=ESHORT IF ((BTEST(latchi,31))) THEN npassi = 1 latchi = IBCLR(latchi,31) ELSE
![Page 200: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/200.jpg)
npassi = 0 END IF IF ((BTEST(latchi,30))) THEN iqin = -1 latchi = IBCLR(latchi,30) latchi = IBCLR(latchi,29) ELSE IF ((BTEST(latchi,29))) THEN iqin = 1 latchi = IBCLR(latchi,29) ELSE iqin = 0 END IF END IF wsrc = min( 1., usrc**2 + vsrc**2) wsrc = sqrt(1. - wsrc) wsrc = SIGN(wsrc,weight) weight=ABS(weight) END IF END IF IF ((MLCflag.EQ.1)) THEN IF((rng_seed .GT. 128))call ranmar_get RNNO1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 frMU_indx = RNNO1 END IF nnread = nnread +1 END IF IF ((MLCflag.EQ.1)) THEN call sample_vcusource(einsrc,xsrc,ysrc,zsrcdum,usr * c, vsrc,wsrc,weight,iqin,latchi,n_hist_dum, more_i * n_cont,frMU_indx) END IF IF (( iqinc .LT. 2 .AND. iqin .NE. iqinc )) THEN nsrjct=nsrjct+1 goto 11060 ELSE IF(( iqinc .EQ. 3 .AND. iqin .EQ. 0 )) THEN nsrjct=nsrjct+1 goto 11060 ELSE IF((i_dbs.EQ.1 .AND. iqin.EQ.0 .AND. iphatsrc.EQ. * 1)) THEN nsrjct=ndbsrjct+1 goto 11060 END IF IF ((enflag .EQ. 3)) THEN IF ((I_BIT_FILTER .EQ. 0)) THEN DO 11101 IBIT=1,NBIT1 IF ((BTEST(latchi,LATBIT(IBIT)))) THEN GO TO11102 END IF IF ((IBIT.EQ.NBIT1)) THEN nsrjct=nsrjct+1 goto 11060 END IF11101 CONTINUE11102 CONTINUE DO 11111 IBIT=1,NBIT2 IF ((BTEST(latchi,LATBIT(IBIT+NBIT1)))) TH
![Page 201: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/201.jpg)
* EN nsrjct=nsrjct+1 goto 11060 END IF11111 CONTINUE11112 CONTINUE goto 11120 ELSE IF((I_BIT_FILTER.EQ.1)) THEN DO 11131 IBIT=1,NBIT1 IF ((BTEST(latchi,LATBIT(IBIT)))) THEN nsrjct=nsrjct+1 goto 11060 END IF11131 CONTINUE11132 CONTINUE goto 11120 ELSE IF((I_BIT_FILTER.EQ.2)) THEN DO 11141 IBIT=1,NBIT1 IF ((IBITS(latchi,24,5).EQ.LATBIT(IBIT))) * THEN goto 11120 END IF11141 CONTINUE11142 CONTINUE nsrjct=nsrjct+1 goto 11060 ELSE IF((I_BIT_FILTER.EQ.3)) THEN DO 11151 IBIT=1,NBIT1 IF ((IBITS(latchi,24,5).EQ.LATBIT(IBIT))) * THEN nsrjct=nsrjct+1 goto 11060 END IF11151 CONTINUE11152 CONTINUE goto 11120 END IF END IF11120 CONTINUE IF ((ABS(xsrc) .GE. (BEAM_SIZE/2.0) .OR. ABS(ysrc).GE. * (BEAM_SIZE/2.0))) THEN nsoutside=nsoutside+1 END IF IF(((ABS(xsrc) .LT. (BEAM_SIZE/2.0) .AND. ABS(ysrc).LT * .(BEAM_SIZE/2.0))))GO TO11052 GO TO 1105111052 CONTINUE IF ((NRCYCL.GT.0)) THEN CYCLNUM=1 NofREPEAT=0 einsrcold=einsrc xsrcold=xsrc ysrcold=ysrc usrcold=usrc vsrcold=vsrc wsrcold=wsrc weightold=weight latchold=latchi
![Page 202: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/202.jpg)
iqinold=iqin END IF END IF ELSE IF(( isource .EQ. 21)) THEN11161 CONTINUE11170 CONTINUE IF ((more_in_cont .EQ. 0)) THEN call motionsample_beamsource(einsrc,xsrc,ysrc,zsrcdum, * usrc,vsrc,wsrc, weight,iqin,latchi,nhist,iphatsrc,frMU * _indx) IF ((frMU_indx.EQ.0.0)) THEN IF((rng_seed .GT. 128))call ranmar_get RNNO1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 frMU_indx = RNNO1 END IF nnread = nnread +1 END IF IF ((MLCflag.EQ.1)) THEN call sample_vcusource(einsrc,xsrc,ysrc,zsrcdum,usrc, v * src,wsrc,weight,iqin,latchi,n_hist_dum, more_in_cont,f * rMU_indx) IF ((weight.EQ.0.0)) THEN goto 11170 more_in_cont=0 END IF END IF IF (( iqinc .LT. 2 .AND. iqin .NE. iqinc )) THEN nsrjct=nsrjct+1 goto 11170 ELSE IF(( iqinc .EQ. 3 .AND. iqin .EQ. 0 )) THEN nsrjct=nsrjct+1 goto 11170 ELSE IF((i_dbs.EQ.1 .AND. iqin.EQ.0 .AND. iphatsrc.EQ.1)) * THEN nsrjct=ndbsrjct+1 goto 11170 END IF IF ((enflag .EQ. 3)) THEN IF ((I_BIT_FILTER .EQ. 0)) THEN DO 11181 IBIT=1,NBIT1 IF ((BTEST(latchi,LATBIT(IBIT)))) THEN GO TO11182 END IF IF ((IBIT.EQ.NBIT1)) THEN nsrjct=nsrjct+1 goto 11170 END IF11181 CONTINUE11182 CONTINUE DO 11191 IBIT=1,NBIT2 IF ((BTEST(latchi,LATBIT(IBIT+NBIT1)))) THEN nsrjct=nsrjct+1 goto 11170 END IF11191 CONTINUE11192 CONTINUE goto 11200
![Page 203: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/203.jpg)
ELSE IF((I_BIT_FILTER.EQ.1)) THEN DO 11211 IBIT=1,NBIT1 IF ((BTEST(latchi,LATBIT(IBIT)))) THEN nsrjct=nsrjct+1 goto 11170 END IF11211 CONTINUE11212 CONTINUE goto 11200 ELSE IF((I_BIT_FILTER.EQ.2)) THEN DO 11221 IBIT=1,NBIT1 IF ((IBITS(latchi,24,5).EQ.LATBIT(IBIT))) THEN goto 11200 END IF11221 CONTINUE11222 CONTINUE nsrjct=nsrjct+1 goto 11170 ELSE IF((I_BIT_FILTER.EQ.3)) THEN DO 11231 IBIT=1,NBIT1 IF ((IBITS(latchi,24,5).EQ.LATBIT(IBIT))) THEN nsrjct=nsrjct+1 goto 11170 END IF11231 CONTINUE11232 CONTINUE goto 11200 END IF END IF11200 CONTINUE IF ((ABS(xsrc) .GE. (BEAM_SIZE/2.0) .OR. ABS(ysrc).GE.(BEA * M_SIZE/2.0))) THEN nsoutside=nsoutside+1 END IF IF(((ABS(xsrc) .LT. (BEAM_SIZE/2.0) .AND. ABS(ysrc).LT.(BE * AM_SIZE/2.0))))GO TO11162 GO TO 1116111162 CONTINUE ELSE IF((isource .EQ. 4)) THEN11241 CONTINUE NNREAD = NNREAD +1 IF((rng_seed .GT. 128))call ranmar_get ZZZ1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 source=INT(ZZZ1*2000.) IF ((source .GE. 2000)) THEN nSrc=MISMFP(2000) ELSE nSrc=MISMFP(source+1) END IF IQIN=IQSMFP(nSrc) IF ((MSMFXY(nSrc) .EQ. 0)) THEN IF((rng_seed .GT. 128))call ranmar_get RRR = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get RRR1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1
![Page 204: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/204.jpg)
KKKK = MIN(FLOAT(2000)*RRR+1.,FLOAT(2000)) RBEAM = FSMFRR(nSrc,KKKK,1) + RRR1*FSMFRR(nSrc,KKKK,2) IF((rng_seed .GT. 128))call ranmar_get RRR1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 YIN=RRR1*6.2831852 XIN=RBEAM*COS(YIN) YIN=RBEAM*SIN(YIN) ELSE IF((MSMFXY(nSrc) .EQ. 2)) THEN IF((rng_seed .GT. 128))call ranmar_get XXX = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get YYY = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 KKKK = MIN(FLOAT(2000)*XXX+1.,FLOAT(2000)) XIN = FSMFRR(nSrc,KKKK,1) + YYY*FSMFRR(nSrc,KKKK,2) source=INT((XIN-XFLDMN)*FLOAT(NFIELD)/(XFLDMX-XFLDMN)) * +1 IF((rng_seed .GT. 128))call ranmar_get XXX1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get YYY1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 KKKK = MIN(FLOAT(2000)*XXX1+1.,FLOAT(2000)) XXX= FLOAT(KKKK)/FLOAT(2000) DO 11251 IRBIN=1,NFIELD IF ((XXX .LE. FSMFXY(nSrc,source,IRBIN))) THEN GO TO 5460 END IF11251 CONTINUE11252 CONTINUE5460 IF ((IRBIN.NE.1)) THEN XXX=(YFLDMX-YFLDMN)/FLOAT(NFIELD)*FLOAT(IRBIN-1)+Y * FLDMN ELSE XXX=YFLDMN END IF IF((XXX.LE.YFLDMN))XXX=YFLDMN+0.00001*FLOAT(IRBIN-1) YYY=(YFLDMX-YFLDMN)/FLOAT(NFIELD) YIN = XXX + YYY1*YYY ELSE IF((MSMFXY(nSrc) .EQ. 1)) THEN IF((rng_seed .GT. 128))call ranmar_get RRR = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get RRR2 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 KKKK = MIN(FLOAT(2000)*RRR+1.,FLOAT(2000)) IF (( FSMFRR(nSrc,KKKK,1) .LE. RTREAT )) THEN IRBIN=INT(RFACTOR1*FSMFRR(nSrc,KKKK,1)**2)+1 ELSE IRBIN=INT(RFACTOR2*(FSMFRR(nSrc,KKKK,1)**2-RTREAT* * *2))+NFIELDi+1 END IF IF ((RRR2 .LE. 0.25)) THEN11261 CONTINUE
![Page 205: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/205.jpg)
IF((rng_seed .GT. 128))call ranmar_get RRR = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get RRR1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 XIN=FSMFRR(nSrc,KKKK,1) + RRR1*FSMFRR(nSrc,KKK * K,2) YIN=(2.*FSMFRR(nSrc,KKKK,1)+FSMFRR(nSrc,KKKK,2 * ))*RRR -FSMFRR(nSrc,KKKK,1) RRR1=FSMFR11(nSrc,IRBIN)-FSMFR12(nSrc,IRBIN)*Y * IN*YIN IF((rng_seed .GT. 128))call ranmar_get RRR = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((RRR .LE. RRR1))GOTO 11270 GO TO 1126111262 CONTINUE ELSE IF((RRR2 .LE. 0.5)) THEN11281 CONTINUE IF((rng_seed .GT. 128))call ranmar_get RRR = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get RRR1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 YIN=FSMFRR(nSrc,KKKK,1) + RRR1*FSMFRR(nSrc,KKK * K,2) XIN=(2.*FSMFRR(nSrc,KKKK,1)+FSMFRR(nSrc,KKKK,2 * ))*RRR -FSMFRR(nSrc,KKKK,1)-FSMFRR(nSrc,KKKK,2 * ) RRR1=FSMFR11(nSrc,IRBIN)-FSMFR12(nSrc,IRBIN)*X * IN*XIN IF((rng_seed .GT. 128))call ranmar_get RRR = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((RRR .LE. RRR1))GOTO 11270 GO TO 1128111282 CONTINUE ELSE IF((RRR2 .LE. 0.75)) THEN11291 CONTINUE IF((rng_seed .GT. 128))call ranmar_get RRR = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get RRR1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 XIN=-(FSMFRR(nSrc,KKKK,1) + RRR1*FSMFRR(nSrc,K * KKK,2)) YIN=(2.*FSMFRR(nSrc,KKKK,1)+FSMFRR(nSrc,KKKK,2 * ))*RRR -FSMFRR(nSrc,KKKK,1)-FSMFRR(nSrc,KKKK,2 * ) RRR1=FSMFR11(nSrc,IRBIN)-FSMFR12(nSrc,IRBIN)*Y * IN*YIN IF((rng_seed .GT. 128))call ranmar_get RRR = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((RRR .LE. RRR1))GOTO 11270
![Page 206: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/206.jpg)
GO TO 1129111292 CONTINUE ELSE11301 CONTINUE IF((rng_seed .GT. 128))call ranmar_get RRR = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get RRR1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 YIN=-(FSMFRR(nSrc,KKKK,1) + RRR1*FSMFRR(nSrc,K * KKK,2)) XIN=(2.*FSMFRR(nSrc,KKKK,1)+FSMFRR(nSrc,KKKK,2 * ))*RRR -FSMFRR(nSrc,KKKK,1) RRR1=FSMFR11(nSrc,IRBIN)-FSMFR12(nSrc,IRBIN)*X * IN*XIN IF((rng_seed .GT. 128))call ranmar_get RRR = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((RRR .LE. RRR1))GOTO 11270 GO TO 1130111302 CONTINUE END IF11270 CONTINUE END IF IF ((ISMFPS(nSrc) .EQ. 1)) THEN NSCATT=011311 CONTINUE IF((rng_seed .GT. 128))call ranmar_get ZZZ1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF ((ZZZ1 .NE. 0.0)) THEN RRR=SQRT(1/ZZZ1-1)*RSCATT*SMFMNZ(nSrc)/100. ELSE RRR=1.0E+30 END IF IF((rng_seed .GT. 128))call ranmar_get XXX1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 XXX1=XXX1*6.283185 XXX=SIN(XXX1) YYY=COS(XXX1) XINS=(XIN+XXX*RRR)*(SSDVPS(nSrc)-SMFMNZ(nSrc))/SSD * VPS(nSrc) YINS=(YIN+YYY*RRR)*(SSDVPS(nSrc)-SMFMNZ(nSrc))/SSD * VPS(nSrc) IF ((ABS(XINS) .LE. SMFX2(nSrc)) .AND. (ABS(YINS) * .LE. SMFY2(nSrc))) THEN GOTO 11320 END IF NSCATT=NSCATT+1 IF ((NSCATT .EQ. 3)) THEN XINS=(2.*ZZZ1-1.)*SMFX2(nSrc) YINS=(0.31831*XXX1-1.)*SMFY2(nSrc) GOTO 11320 END IF GO TO 1131111312 CONTINUE
![Page 207: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/207.jpg)
11320 CONTINUE IF ((XINS .LT. SMFMXX(nSrc)).AND.(XINS .GT. SMFMNX(nSr * c)).AND. (YINS .LT. SMFMXY(nSrc)).AND.(YINS .GT. SMFMN * Y(nSrc))) THEN IF ((XIN .LT. SMFMXX(nSrc)).AND.(XIN .GT. SMFMNX(n * Src)).AND. (YIN .LT. SMFMXY(nSrc)).AND.(YIN .GT. S * MFMNY(nSrc))) THEN DDMXX=1./((SMFMXX(nSrc)-XIN)*(SMFMXX(nSrc) -XI * N)+SMFMNZ(nSrc)*SMFMNZ(nSrc))**(1.5) DDMNX=1./((SMFMNX(nSrc)-XIN)*(SMFMNX(nSrc) -XI * N)+SMFMNZ(nSrc)*SMFMNZ(nSrc))**(1.5)+DDMXX DDMXY=1./((SMFMXY(nSrc)-YIN)*(SMFMXY(nSrc) -YI * N)+SMFMNZ(nSrc)*SMFMNZ(nSrc))**(1.5)+DDMNX DDMNY=1./((SMFMNY(nSrc)-YIN)*(SMFMNY(nSrc) -YI * N)+SMFMNZ(nSrc)*SMFMNZ(nSrc))**(1.5)+DDMXY IF((rng_seed .GT. 128))call ranmar_get XXX = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get XXX1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF ((XXX .LE. (DDMXX/DDMNY))) THEN XINS=SMFMXX(nSrc)+XXX1*XXX1*(SMFX2(nSrc)-S * MFMXX(nSrc)) XXX=YINS*(XINS*XINS+SMFMNZ(nSrc)*SMFMNZ(nS * rc))/ (SMFMNZ(nSrc)*SMFMNZ(nSrc)) IF((ABS(XXX).LT.SMFY2(nSrc)))YINS=XXX ELSE IF((XXX .LE. (DDMNX/DDMNY))) THEN XINS=SMFMNX(nSrc)+XXX1*XXX1*(-SMFX2(nSrc)- * SMFMNX(nSrc)) XXX=YINS*(XINS*XINS+SMFMNZ(nSrc)*SMFMNZ(nS * rc))/ (SMFMNZ(nSrc)*SMFMNZ(nSrc)) IF((ABS(XXX).LT.SMFY2(nSrc)))YINS=XXX ELSE IF((XXX .LE. (DDMXY/DDMNY))) THEN YINS=SMFMXY(nSrc)+XXX1*XXX1*(SMFY2(nSrc)-S * MFMXY(nSrc)) XXX=XINS*(YINS*YINS+SMFMNZ(nSrc)*SMFMNZ(nS * rc))/ (SMFMNZ(nSrc)*SMFMNZ(nSrc)) IF((ABS(XXX).LT.SMFX2(nSrc)))XINS=XXX ELSE YINS=SMFMNY(nSrc)+XXX1*XXX1*(-SMFY2(nSrc)- * SMFMNY(nSrc)) XXX=XINS*(YINS*YINS+SMFMNZ(nSrc)*SMFMNZ(nS * rc))/ (SMFMNZ(nSrc)*SMFMNZ(nSrc)) IF((ABS(XXX).LT.SMFX2(nSrc)))XINS=XXX END IF ELSE YINSMX=(YINS-YIN)/(XINS-XIN)*(SMFMXX(nSrc)-XIN * S)+YINS IF ((YINSMX.GT.SMFMXY(nSrc).OR.YINSMX.LT.SMFMN * Y(nSrc))) THEN DDMXY=0. ELSE DDMXY=1./(SMFMNZ(nSrc)*SMFMNZ(nSrc)+(SMFMX * X(nSrc)-XIN)* (SMFMXX(nSrc)-XIN)+(YINSMX-Y * IN)*(YINSMX-YIN))**(1.5) END IF YINSMN=(YINS-YIN)/(XINS-XIN)*(SMFMNX(nSrc)-XIN
![Page 208: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/208.jpg)
* S)+YINS IF ((YINSMN.GT.SMFMXY(nSrc).OR.YINSMN.LT.SMFMN * Y(nSrc))) THEN DDMNY=DDMXY ELSE DDMNY=1./(SMFMNZ(nSrc)*SMFMNZ(nSrc)+(SMFMN * X(nSrc)-XIN)* (SMFMNX(nSrc)-XIN)+(YINSMN-Y * IN)*(YINSMN-YIN))**(1.5)+DDMXY END IF XINSMX=(XINS-XIN)/(YINS-YIN)*(SMFMXY(nSrc)-YIN * S)+XINS IF ((XINSMX.GT.SMFMXX(nSrc).OR.XINSMX.LT.SMFMN * X(nSrc))) THEN DDMXX=DDMNY ELSE DDMXX=1./(SMFMNZ(nSrc)*SMFMNZ(nSrc)+(SMFMX * Y(nSrc)-YIN)* (SMFMXY(nSrc)-YIN)+(XINSMX-X * IN)*(XINSMX-XIN))**(1.5)+DDMNY END IF XINSMN=(XINS-XIN)/(YINS-YIN)*(SMFMNY(nSrc)-YIN * S)+XINS IF ((XINSMN.GT.SMFMXX(nSrc).OR.XINSMN.LT.SMFMN * X(nSrc))) THEN DDMNX=DDMXX ELSE DDMNX=1./(SMFMNZ(nSrc)*SMFMNZ(nSrc)+(SMFMN * Y(nSrc)-YIN)* (SMFMNY(nSrc)-YIN)+(XINSMN-X * IN)*(XINSMN-XIN))**(1.5)+DDMXX END IF IF((rng_seed .GT. 128))call ranmar_get XXX = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( XXX .LE. (DDMXY/DDMNX))) THEN XINS=SMFMXX(nSrc) YINS=YINSMX ELSE IF((XXX .LE. (DDMNY/DDMNX))) THEN XINS=SMFMNX(nSrc) YINS=YINSMN ELSE IF((XXX .LE. (DDMXX/DDMNX))) THEN XINS=XINSMX YINS=SMFMXY(nSrc) ELSE XINS=XINSMN YINS=SMFMNY(nSrc) END IF END IF END IF ELSE IF((ISMFPS(nSrc) .EQ. 11)) THEN NSCATT=0 RRR=ABS((YIN-SMFMNY(nSrc))*(XIN-SMFMNX(nSrc))* (SMFMXY * (nSrc)-YIN)*(SMFMXX(nSrc)-XIN))/625. IF ((RRR.GT.1.)) THEN RRR=1 END IF RRR=SQRT(RRR)*(SMFMXZ(nSrc)-SMFMNZ(nSrc))11330 CONTINUE IF((rng_seed .GT. 128))call ranmar_get XXX1 = rng_array(rng_seed)*twom24
![Page 209: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/209.jpg)
rng_seed = rng_seed + 1 XXX1=1.-2.*XXX1 ZZZ1=RRR+XXX1*(SMFMXZ(nSrc)-SMFMNZ(nSrc)-RRR) IF((ZZZ1.GT.(SMFMXZ(nSrc)-SMFMNZ(nSrc)) .OR. ZZZ1.LT.0 * .))GOTO 1133011341 CONTINUE IF((rng_seed .GT. 128))call ranmar_get RRR = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF ((RRR .NE. 0.0)) THEN RRR=SQRT(1/RRR-1)*RSCATT*(ZZZ1+SMFMNZ(nSrc))/1 * 00. ELSE RRR=1.0E+30 END IF IF((rng_seed .GT. 128))call ranmar_get XXX1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 XXX1=XXX1*6.283185 XXX=SIN(XXX1) YYY=COS(XXX1) XINS=(XIN+XXX*RRR)*(SSDVPS(nSrc)-ZZZ1)/SSDVPS(nSrc * ) YINS=(YIN+YYY*RRR)*(SSDVPS(nSrc)-ZZZ1)/SSDVPS(nSrc * ) IF ((ABS(XINS) .LE. SMFX2(nSrc)) .AND. (ABS(YINS) * .LE. SMFY2(nSrc))) THEN GOTO 11350 END IF NSCATT=NSCATT+1 IF ((NSCATT .EQ. 3)) THEN IF((rng_seed .GT. 128))call ranmar_get RRR = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 XINS=(2.*RRR-1.)*SMFX2(nSrc) YINS=(0.31831*XXX1-1.)*SMFY2(nSrc) GOTO 11350 END IF GO TO 1134111342 CONTINUE11350 CONTINUE IF ((XINS .LT. SMFMXX(nSrc)).AND.(XINS .GT. SMFMNX(nSr * c)).AND. (YINS .LT. SMFMXY(nSrc)).AND.(YINS .GT. SMFMN * Y(nSrc))) THEN IF ((XIN .LT. SMFMXX(nSrc)).AND.(XIN .GT. SMFMNX(n * Src)).AND. (YIN .LT. SMFMXY(nSrc)).AND.(YIN .GT. S * MFMNY(nSrc))) THEN XXX=(ZZZ1+SMFMNZ(nSrc))*(ZZZ1+SMFMNZ(nSrc)) DDMXX=1./(XXX+(SMFMXX(nSrc)-XIN)*(SMFMXX(nSrc) * -XIN))**(1.5) DDMNX=1./(XXX+(SMFMNX(nSrc)-XIN)*(SMFMNX(nSrc) * -XIN))**(1.5)+DDMXX DDMXY=1./(XXX+(SMFMXY(nSrc)-YIN)*(SMFMXY(nSrc) * -YIN))**(1.5)+DDMNX DDMNY=1./(XXX+(SMFMNY(nSrc)-YIN)*(SMFMNY(nSrc) * -YIN))**(1.5)+DDMXY IF((rng_seed .GT. 128))call ranmar_get XXX = rng_array(rng_seed)*twom24
![Page 210: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/210.jpg)
rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get XXX1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF ((XXX .LE. (DDMXX/DDMNY))) THEN XINS=SMFMXX(nSrc)+XXX1*XXX1*(SMFX2(nSrc)-S * MFMXX(nSrc)) XXX=YINS*(XINS*XINS+SMFMNZ(nSrc)*SMFMNZ(nS * rc))/ (SMFMNZ(nSrc)*SMFMNZ(nSrc)) IF((ABS(XXX).LT.SMFY2(nSrc)))YINS=XXX ELSE IF((XXX .LE. (DDMNX/DDMNY))) THEN XINS=SMFMNX(nSrc)+XXX1*XXX1*(-SMFX2(nSrc)- * SMFMNX(nSrc)) XXX=YINS*(XINS*XINS+SMFMNZ(nSrc)*SMFMNZ(nS * rc))/ (SMFMNZ(nSrc)*SMFMNZ(nSrc)) IF((ABS(XXX).LT.SMFY2(nSrc)))YINS=XXX ELSE IF((XXX .LE. (DDMXY/DDMNY))) THEN YINS=SMFMXY(nSrc)+XXX1*XXX1*(SMFY2(nSrc)-S * MFMXY(nSrc)) XXX=XINS*(YINS*YINS+SMFMNZ(nSrc)*SMFMNZ(nS * rc))/ (SMFMNZ(nSrc)*SMFMNZ(nSrc)) IF((ABS(XXX).LT.SMFX2(nSrc)))XINS=XXX ELSE YINS=SMFMNY(nSrc)+XXX1*XXX1*(-SMFY2(nSrc)- * SMFMNY(nSrc)) XXX=XINS*(YINS*YINS+SMFMNZ(nSrc)*SMFMNZ(nS * rc))/ (SMFMNZ(nSrc)*SMFMNZ(nSrc)) IF((ABS(XXX).LT.SMFX2(nSrc)))XINS=XXX END IF ELSE YINSMX=(YINS-YIN)/(XINS-XIN)*(SMFMXX(nSrc)-XIN * S)+YINS XXX=(ZZZ1+SMFMNZ(nSrc))*(ZZZ1+SMFMNZ(nSrc)) IF ((YINSMX.GT.SMFMXY(nSrc).OR.YINSMX.LT.SMFMN * Y(nSrc))) THEN DDMXY=0. ELSE DDMXY=1./(XXX+(SMFMXX(nSrc)-XIN)* (SMFMXX( * nSrc)-XIN)+(YINSMX-YIN)*(YINSMX-YIN))**(1. * 5) END IF YINSMN=(YINS-YIN)/(XINS-XIN)*(SMFMNX(nSrc)-XIN * S)+YINS IF ((YINSMN.GT.SMFMXY(nSrc).OR.YINSMN.LT.SMFMN * Y(nSrc))) THEN DDMNY=DDMXY ELSE DDMNY=1./(XXX+(SMFMNX(nSrc)-XIN)* (SMFMNX( * nSrc)-XIN)+(YINSMN-YIN)*(YINSMN-YIN))**(1. * 5)+DDMXY END IF XINSMX=(XINS-XIN)/(YINS-YIN)*(SMFMXY(nSrc)-YIN * S)+XINS IF ((XINSMX.GT.SMFMXX(nSrc).OR.XINSMX.LT.SMFMN * X(nSrc))) THEN DDMXX=DDMNY ELSE DDMXX=1./(XXX+(SMFMXY(nSrc)-YIN)* (SMFMXY(
![Page 211: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/211.jpg)
* nSrc)-YIN)+(XINSMX-XIN)*(XINSMX-XIN))**(1. * 5)+DDMNY END IF XINSMN=(XINS-XIN)/(YINS-YIN)*(SMFMNY(nSrc)-YIN * S)+XINS IF ((XINSMN.GT.SMFMXX(nSrc).OR.XINSMN.LT.SMFMN * X(nSrc))) THEN DDMNX=DDMXX ELSE DDMNX=1./(XXX+(SMFMNY(nSrc)-YIN)* (SMFMNY( * nSrc)-YIN)+(XINSMN-XIN)*(XINSMN-XIN))**(1. * 5)+DDMXX END IF IF((rng_seed .GT. 128))call ranmar_get XXX = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( XXX .LE. (DDMXY/DDMNX))) THEN XINS=SMFMXX(nSrc) YINS=YINSMX ELSE IF((XXX .LE. (DDMNY/DDMNX))) THEN XINS=SMFMNX(nSrc) YINS=YINSMN ELSE IF((XXX .LE. (DDMXX/DDMNX))) THEN XINS=XINSMX YINS=SMFMXY(nSrc) ELSE XINS=XINSMN YINS=SMFMNY(nSrc) END IF END IF END IF ELSE IF((ISMFPS(nSrc) .EQ. 2)) THEN NSCATT=011361 CONTINUE IF((rng_seed .GT. 128))call ranmar_get ZZZ1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF ((ZZZ1 .NE. 0.0)) THEN RRR=SQRT(1/ZZZ1-1)*RSCATT*SMFMNZ(nSrc)/100. ELSE RRR=1.0E+30 END IF IF((rng_seed .GT. 128))call ranmar_get XXX1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 XXX1=XXX1*6.283185 XXX=SIN(XXX1) YYY=COS(XXX1) XINS=(XIN+XXX*RRR)*(SSDVPS(nSrc)-SMFMNZ(nSrc))/SSD * VPS(nSrc) YINS=(YIN+YYY*RRR)*(SSDVPS(nSrc)-SMFMNZ(nSrc))/SSD * VPS(nSrc) IF ((ABS(XINS) .LE. SMFX2(nSrc)).AND.(ABS(YINS) .L * E. SMFY2(nSrc))) THEN GOTO 11370 END IF NSCATT=NSCATT+1 IF ((NSCATT .EQ. 3)) THEN
![Page 212: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/212.jpg)
XINS=(2.*ZZZ1-1.)*SMFX2(nSrc) YINS=(0.31831*XXX1-1.)*SMFY2(nSrc) GOTO 11370 END IF GO TO 1136111362 CONTINUE11370 CONTINUE IF ((SMFPXY(nSrc) .EQ. 0)) THEN IF ((YINS .LT. SMFMXY(nSrc)).AND.(YINS .GT. SMFMNY * (nSrc))) THEN DDMXY=1./(SMFMNZ(nSrc)*SMFMNZ(nSrc)+(SMFMXY(nS * rc)-YIN)* (SMFMXY(nSrc)-YIN))**(1.5) DDMNY=1./(SMFMNZ(nSrc)*SMFMNZ(nSrc)+(SMFMNY(nS * rc)-YIN)* (SMFMNY(nSrc)-YIN))**(1.5)+DDMXY IF((rng_seed .GT. 128))call ranmar_get XXX = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF ((XXX .LE. (DDMXY/DDMNY))) THEN YINS=SMFMXY(nSrc) ELSE YINS=SMFMNY(nSrc) END IF XXX=XINS*(YINS*YINS+SMFMNZ(nSrc)*SMFMNZ(nSrc)) * / (SMFMNZ(nSrc)*SMFMNZ(nSrc)) IF((ABS(XXX).LT.SMFX2(nSrc)))XINS=XXX END IF ELSE IF ((XINS .LT. SMFMXX(nSrc)).AND.(XINS .GT. SMFMNX * (nSrc))) THEN DDMXX=1./(SMFMNZ(nSrc)*SMFMNZ(nSrc)+(SMFMXX(nS * rc)-XIN)* (SMFMXX(nSrc)-XIN))**(1.5) DDMNX=1./(SMFMNZ(nSrc)*SMFMNZ(nSrc)+(SMFMNX(nS * rc)-XIN)* (SMFMNX(nSrc)-XIN))**(1.5)+DDMXX IF((rng_seed .GT. 128))call ranmar_get XXX = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF ((XXX .LE. (DDMXX/DDMNX))) THEN XINS=SMFMXX(nSrc) ELSE XINS=SMFMNX(nSrc) END IF XXX=YINS*(XINS*XINS+SMFMNZ(nSrc)*SMFMNZ(nSrc)) * / (SMFMNZ(nSrc)*SMFMNZ(nSrc)) IF((ABS(XXX).LT.SMFY2(nSrc)))YINS=XXX END IF END IF ELSE IF((ISMFPS(nSrc) .EQ. 3)) THEN IF ((SMFMNR(nSrc) .EQ. 0.0)) THEN XINS=0.0 YINS=0.0 ELSE NSCATT=011381 CONTINUE IF((rng_seed .GT. 128))call ranmar_get ZZZ1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF ((ZZZ1 .NE. 0.0)) THEN RRR=SQRT(1/ZZZ1-1)*RSCATT*SMFMNZ(nSrc)/100
![Page 213: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/213.jpg)
* . ELSE RRR=1.0E+30 END IF IF((rng_seed .GT. 128))call ranmar_get XXX1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 XXX1=XXX1*6.283185 XXX=SIN(XXX1) YYY=COS(XXX1) XINS=(XIN+XXX*RRR)*(SSDVPS(nSrc)-SMFMNZ(nSrc)) * /SSDVPS(nSrc) YINS=(YIN+YYY*RRR)*(SSDVPS(nSrc)-SMFMNZ(nSrc)) * /SSDVPS(nSrc) IF (((XINS*XINS+YINS*YINS) .LE. SMFMR2(nSrc))) * THEN GOTO 11390 END IF NSCATT=NSCATT+1 IF ((NSCATT .EQ. 3)) THEN RRR=ZZZ1*(SMFMXR(nSrc)-SMFMNR(nSrc))+SMFMN * R(nSrc) XINS=RRR*XXX YINS=RRR*YYY GOTO 11390 END IF GO TO 1138111382 CONTINUE11390 CONTINUE RRR=SQRT(XINS*XINS+YINS*YINS) XINS=SMFMNR(nSrc)*XINS/RRR YINS=SMFMNR(nSrc)*YINS/RRR END IF ELSE IF((ISMFPS(nSrc) .EQ. 4)) THEN NSCATT=011401 CONTINUE IF((rng_seed .GT. 128))call ranmar_get ZZZ1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF ((ZZZ1 .NE. 0.0)) THEN RRR=SQRT(1/ZZZ1-1)*RSCATT*SMFMNZ(nSrc)/SSDVPS( * nSrc) ELSE RRR=1.0E+30 END IF IF((rng_seed .GT. 128))call ranmar_get XXX1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 XXX1=XXX1*6.283185 XXX=SIN(XXX1) YYY=COS(XXX1) XINS=(XIN+XXX*RRR)*(SSDVPS(nSrc)-SMFMNZ(nSrc))/SSD * VPS(nSrc) YINS=(YIN+YYY*RRR)*(SSDVPS(nSrc)-SMFMNZ(nSrc))/SSD * VPS(nSrc) IF ((XINS .LE. SMFMXX(nSrc)).AND.(XINS .GE. SMFMNX * (nSrc)).AND. (YINS .LE. SMFMXY(nSrc)).AND.(YINS .G * E. SMFMNY(nSrc))) THEN
![Page 214: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/214.jpg)
GOTO 11410 END IF NSCATT=NSCATT+1 IF ((NSCATT .EQ. 4)) THEN XINS=(2.*ZZZ1-1)*(SMFMXX(nSrc)-SMFMNX(nSrc)) YINS=(.31831*XXX1-1)*(SMFMXY(nSrc)-SMFMNY(nSrc * )) GOTO 11410 END IF GO TO 1140111402 CONTINUE11410 CONTINUE ELSE IF((ISMFPS(nSrc) .EQ. 5)) THEN IF ((SMFMNR(nSrc) .EQ. 0.0)) THEN XINS=0.0 YINS=0.0 ELSE NSCATT=011421 CONTINUE IF((rng_seed .GT. 128))call ranmar_get ZZZ1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF ((ZZZ1 .NE. 0.0)) THEN RRR=SQRT(1/ZZZ1-1)*RSCATT*SMFMNZ(nSrc)/SSD * VPS(nSrc) ELSE RRR=1.0E+30 END IF IF((rng_seed .GT. 128))call ranmar_get XXX1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 XXX1=XXX1*6.283185 XXX=SIN(XXX1) YYY=COS(XXX1) XINS=(XIN+XXX*RRR)*(SSDVPS(nSrc)-SMFMNZ(nSrc)) * /SSDVPS(nSrc) YINS=(YIN+YYY*RRR)*(SSDVPS(nSrc)-SMFMNZ(nSrc)) * /SSDVPS(nSrc) IF (((XINS*XINS+YINS*YINS) .LE. SMFNR2(nSrc))) * THEN GOTO 11430 END IF NSCATT=NSCATT+1 IF ((NSCATT .EQ. 4)) THEN RRR=ZZZ1*SMFMNR(nSrc) XINS=XIN+XXX*RRR YINS=YIN+YYY*RRR GOTO 11430 END IF GO TO 1142111422 CONTINUE11430 CONTINUE END IF ELSE WRITE(6,11440)nSrc11440 FORMAT(//' SOURCE TYPE =',I4,' ? SOMETHING MUST BE WRO *NG!'/ ' YOU SHOULD CHECK THE SOURCE INPUT DATA. '/ ' THE PROGRAMME * STOPS HERE, SORRY!!!')
![Page 215: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/215.jpg)
STOP END IF IF ((XINS .EQ. 0.0 .AND. YINS .EQ. 0.0)) THEN DIST_RAY=SQRT(XIN*XIN+YIN*YIN+SMFMNZ(nSrc)*SMFMNZ(nSrc * )) UIN=XIN/DIST_RAY VIN=YIN/DIST_RAY ELSE XXX=(XIN-XINS) YYY=(YIN-YINS) IF ((ISMFPS(nSrc) .EQ. 11)) THEN DIST_RAY=SQRT(XXX*XXX+YYY*YYY+(SMFMNZ(nSrc)+ZZZ1)* * (SMFMNZ(nSrc))+ZZZ1) ELSE DIST_RAY=SQRT(XXX*XXX+YYY*YYY+SMFMNZ(nSrc)*SMFMNZ( * nSrc)) END IF UIN=XXX/DIST_RAY VIN=YYY/DIST_RAY END IF WIN=MIN(1.0,SQRT(1.-UIN*UIN-VIN*VIN)) IF ((IQSMFP(nSrc) .NE. 0 .AND. RSCATT .NE.0.)) THEN XXX1=UIN YYY1=VIN RRR2=WIN11450 CONTINUE IF((rng_seed .GT. 128))call ranmar_get RRR = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get RRR1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 KKKK = MIN(FLOAT(2000)*RRR+1.,FLOAT(2000)) RRR = FSMABN(KKKK,1) + RRR1*FSMABN(KKKK,2) IF((IQSMFP(nSrc).EQ.0.AND.ISMFPS(nSrc).GT.2))RRR=RRR*0 * .01 IF((rng_seed .GT. 128))call ranmar_get RRR1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 RRR1=6.283185*RRR1 XXX=SIN(RRR)*COS(RRR1) YYY=SIN(RRR)*SIN(RRR1) RRR1=XXX1*XXX1+YYY1*YYY1 IF ((RRR1.LT.1.0E-20)) THEN UIN=XXX VIN=YYY WIN=RRR2*COS(RRR) ELSE RRR1=SQRT(RRR1) WIN=RRR2*COS(RRR)-XXX*RRR1 IF((WIN.LE.0.0))GOTO 11450 UIN=XXX1*RRR2*XXX/RRR1-YYY1*YYY/RRR1+XXX1*COS(RRR) VIN=YYY1*RRR2*XXX/RRR1+XXX1*YYY/RRR1+YYY1*COS(RRR) END IF END IF IF((rng_seed .GT. 128))call ranmar_get RRR = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1
![Page 216: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/216.jpg)
IF((rng_seed .GT. 128))call ranmar_get RRR1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 KKKK = MIN(FLOAT(2000)*RRR+1.,FLOAT(2000)) IF ((MSMFXY(nSrc).EQ.0)) THEN DO 11461 n=1,NFIELDe IF (( SQRT(XIN*XIN+YIN*YIN) .LE. ERADII(n) )) THEN EIN = FSMFBN(nSrc,n,KKKK,1) + RRR1*FSMFBN(nSrc * ,n,KKKK,2) GO TO11462 END IF11461 CONTINUE11462 CONTINUE ELSE IF((MSMFXY(nSrc).EQ.1)) THEN DO 11471 n=1,NFIELDe IF (((ABS(XIN) .LE. ERADII(n)) .AND. (ABS(YIN) .LE * . ERADII(n)))) THEN EIN = FSMFBN(nSrc,n,KKKK,1) + RRR1*FSMFBN(nSrc * ,n,KKKK,2) GO TO11472 END IF11471 CONTINUE11472 CONTINUE ELSE IF((MSMFXY(nSrc).EQ.2)) THEN IF (((XIN.LE.XTREATMX) .AND. (YIN.LE.YTREATMX) .AND. ( * XIN.GT.XTREATMN) .AND. (YIN.GT.YTREATMN))) THEN EIN = FSMFBN(nSrc,1,KKKK,1) + RRR1*FSMFBN(nSrc,1,K * KKK,2) ELSE EIN = FSMFBN(nSrc,2,KKKK,1) + RRR1*FSMFBN(nSrc,2,K * KKK,2) END IF END IF WSRC=WIN VSRC=VIN USRC=UIN YSRC=YIN XSRC=XIN EINSRC = EIN IF(((ABS(XSRC) .LT. (BEAM_SIZE/2.0) .AND. ABS(YSRC).LT.(BE * AM_SIZE/2.0))))GO TO11242 GO TO 1124111242 CONTINUE END IF IF ((NofREPEAT .GT. 0 .AND. ISMOOTH .EQ. 1)) THEN CALL SHIFT_XYUV(NofREPEAT,xsrc,ysrc,usrc,vsrc) END IF IF ((isource.LT.7 .OR. isource.EQ.9)) THEN uin = r_11(1)*usrc + r_12(1)*vsrc + r_13(1)*wsrc vin = r_21(1)*usrc + r_22(1)*vsrc + r_23(1)*wsrc win = r_31(1)*usrc + r_32(1)*vsrc + r_33(1)*wsrc xsrcp = r_11(1)*xsrc + r_12(1)*ysrc + r_13(1)*zsrc + xiso ysrcp = r_21(1)*xsrc + r_22(1)*ysrc + r_23(1)*zsrc + yiso zsrcp = r_31(1)*xsrc + r_32(1)*ysrc + r_33(1)*zsrc + ziso ELSE IF((isource.EQ.20 .OR. isource.EQ.21)) THEN IF ((isource.EQ.20 .AND. MLCflag.NE.1)) THEN IF((rng_seed .GT. 128))call ranmar_get RNNO1 = rng_array(rng_seed)*twom24
![Page 217: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/217.jpg)
rng_seed = rng_seed + 1 frMU_indx=RNNO1 END IF DO 11481 I=1,nset IF ((frMU_indx.LT.muIndex(I))) THEN K=I GO TO11482 END IF11481 CONTINUE11482 CONTINUE zsrc = -1.0*(dsourcetemp(K-1)+(dsourcetemp(K)-dsourcetemp(K-1) * )* (frMU_indx-muIndex(K-1))/(muIndex(K)-muIndex(K-1))) theta(1)=thetatemp(K-1)+(thetatemp(K)-thetatemp(K-1))* (frMU_i * ndx-muIndex(K-1))/(muIndex(K)-muIndex(K-1)) phi(1)=phitemp(K-1)+(phitemp(K)-phitemp(K-1))* (frMU_indx-muIn * dex(K-1))/(muIndex(K)-muIndex(K-1)) phicol=phicoltemp(K-1)+(phicoltemp(K)-phicoltemp(K-1))* (frMU_ * indx-muIndex(K-1))/(muIndex(K)-muIndex(K-1)) xiso=xtemp(K-1)+(xtemp(K)-xtemp(K-1))* (frMU_indx-muIndex(K-1) * )/(muIndex(K)-muIndex(K-1)) yiso=ytemp(K-1)+(ytemp(K)-ytemp(K-1))* (frMU_indx-muIndex(K-1) * )/(muIndex(K)-muIndex(K-1)) ziso=ztemp(K-1)+(ztemp(K)-ztemp(K-1))* (frMU_indx-muIndex(K-1) * )/(muIndex(K)-muIndex(K-1)) costheta = cos(theta(1)*3.141593/180.) sintheta = sin(theta(1)*3.141593/180.) coscol = cos(phicol*3.141593/180.) sincol = sin(phicol*3.141593/180.) cosphi = cos(phi(1)*3.141593/180.) sinphi = sin(phi(1)*3.141593/180.) r_11(1) = costheta*cosphi*coscol + sinphi*sincol r_12(1) = -costheta*cosphi*sincol + sinphi*coscol r_13(1) = -sintheta*cosphi r_21(1) = costheta*sinphi*coscol - cosphi*sincol r_22(1) = -costheta*sinphi*sincol - cosphi*coscol r_23(1) = -sintheta*sinphi r_31(1) = -sintheta*coscol r_32(1) = sintheta*sincol r_33(1) = -costheta uin = r_11(1)*usrc + r_12(1)*vsrc + r_13(1)*wsrc vin = r_21(1)*usrc + r_22(1)*vsrc + r_23(1)*wsrc win = r_31(1)*usrc + r_32(1)*vsrc + r_33(1)*wsrc xsrcp = r_11(1)*xsrc + r_12(1)*ysrc + r_13(1)*zsrc + xiso ysrcp = r_21(1)*xsrc + r_22(1)*ysrc + r_23(1)*zsrc + yiso zsrcp = r_31(1)*xsrc + r_32(1)*ysrc + r_33(1)*zsrc + ziso ELSE IF((rng_seed .GT. 128))call ranmar_get RNNO1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 K=numang DO 11491 I=1,numang-1 IF ((RNNO1.LT.pang(I))) THEN K=I GO TO11492 END IF11491 CONTINUE11492 CONTINUE uin = r_11(K)*usrc + r_12(K)*vsrc + r_13(K)*wsrc
![Page 218: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/218.jpg)
vin = r_21(K)*usrc + r_22(K)*vsrc + r_23(K)*wsrc win = r_31(K)*usrc + r_32(K)*vsrc + r_33(K)*wsrc xsrcp = r_11(K)*xsrc + r_12(K)*ysrc + r_13(K)*zsrc + xiso ysrcp = r_21(K)*xsrc + r_22(K)*ysrc + r_23(K)*zsrc + yiso zsrcp = r_31(K)*xsrc + r_32(K)*ysrc + r_33(K)*zsrc + ziso END IF IF ((isource .EQ. 1 .OR. isource.EQ.7)) THEN IF ((uin .GT. 0.0)) THEN dist = (xbound_min - xsrcp)/uin yin = ysrcp + dist*vin zin = zsrcp + dist*win IF (( (yin .GE. ybound_min) .AND. (yin .LE. ybound_max) .A * ND. (zin .GE. zbound_min) .AND. (zin .LE. zbound_max))) TH * EN DO 11501 j=1,jmax IF (( (ybound(j) .LE. yin) .AND. (yin .LE. ybound( * j+1)) )) THEN DO 11511 k=1,kmax IF (( (zbound(k) .LE. zin) .AND. (zin .LE. * zbound(k+1)) )) THEN xin = xbound_min irin = imax*j + klowx + ijmax*k return END IF11511 CONTINUE11512 CONTINUE END IF11501 CONTINUE11502 CONTINUE stop ' * Stopped in srchst on lower x-plane. Can not f *ind irin! *' END IF ELSE IF((uin .LT. 0.0)) THEN dist = (xbound_max - xsrcp)/uin yin = ysrcp + dist*vin zin = zsrcp + dist*win IF (( (yin .GE. ybound_min) .AND. (yin .LE. ybound_max) .A * ND. (zin .GE. zbound_min) .AND. (zin .LE. zbound_max))) TH * EN DO 11521 j=1,jmax IF (( (ybound(j) .LE. yin) .AND. (yin .LE. ybound( * j+1)) )) THEN DO 11531 k=1,kmax IF (( (zbound(k) .LE. zin) .AND. (zin .LE. * zbound(k+1)) )) THEN xin = xbound_max irin = imax*j + khix + ijmax*k return END IF11531 CONTINUE11532 CONTINUE END IF11521 CONTINUE11522 CONTINUE stop ' * Stopped in srchst on upper x-plane. Can not f *ind irin! *' END IF END IF
![Page 219: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/219.jpg)
IF ((vin .GT. 0.0)) THEN dist = (ybound_min - ysrcp)/vin xin = xsrcp + dist*uin zin = zsrcp + dist*win IF (( (xin .GE. xbound_min) .AND. (xin .LE. xbound_max) .A * ND. (zin .GE. zbound_min) .AND. (zin .LE. zbound_max))) TH * EN DO 11541 i=1,imax IF (( (xbound(i) .LE. xin) .AND. (xin .LE. xbound( * i+1)) )) THEN DO 11551 k=1,kmax IF (( (zbound(k) .LE. zin) .AND. (zin .LE. * zbound(k+1)) )) THEN yin = ybound_min irin = i + klowy + ijmax*k return END IF11551 CONTINUE11552 CONTINUE END IF11541 CONTINUE11542 CONTINUE stop ' * Stopped in srchst on lower y-plane. Can not f *ind irin! *' END IF ELSE IF((vin .LT. 0.0)) THEN dist = (ybound_max - ysrcp)/vin xin = xsrcp + dist*uin zin = zsrcp + dist*win IF (( (xin .GE. xbound_min) .AND. (xin .LE. xbound_max) .A * ND. (zin .GE. zbound_min) .AND. (zin .LE. zbound_max))) TH * EN DO 11561 i=1,imax IF (( (xbound(i) .LE. xin) .AND. (xin .LE. xbound( * i+1)) )) THEN DO 11571 k=1,kmax IF (( (zbound(k) .LE. zin) .AND. (zin .LE. * zbound(k+1)) )) THEN yin = ybound_max irin = i + khiy + ijmax*k return END IF11571 CONTINUE11572 CONTINUE END IF11561 CONTINUE11562 CONTINUE stop ' * Stopped in srchst on upper y-plane. Can not f *ind irin! *' END IF END IF IF ((win .GT. 0.0)) THEN dist = (zbound_min - zsrcp)/win xin = xsrcp + dist*uin yin = ysrcp + dist*vin IF (( (xin .GE. xbound_min) .AND. (xin .LE. xbound_max) .A * ND. (yin .GE. ybound_min) .AND. (yin .LE. ybound_max))) TH * EN
![Page 220: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/220.jpg)
DO 11581 i=1,imax IF (( (xbound(i) .LE. xin) .AND. (xin .LE. xbound( * i+1)) )) THEN DO 11591 j=1,jmax IF (( (ybound(j) .LE. yin) .AND. (yin .LE. * ybound(j+1)) )) THEN zin = zbound_min irin = i + klowz + imax*j return END IF11591 CONTINUE11592 CONTINUE END IF11581 CONTINUE11582 CONTINUE stop ' * Stopped in srchst on lower z-plane. Can not f *ind irin! *' END IF ELSE IF((win .LT. 0.0)) THEN dist = (zbound_max-zsrcp)/win xin = xsrcp + dist*uin yin = ysrcp + dist*vin IF (( (xin .GE. xbound_min) .AND. (xin .LE. xbound_max) .A * ND. (yin .GE. ybound_min) .AND. (yin .LE. ybound_max))) TH * EN DO 11601 i=1,imax IF (( (xbound(i) .LE. xin) .AND. (xin .LE. xbound( * i+1)) )) THEN DO 11611 j=1,jmax IF (( (ybound(j) .LE. yin) .AND. (yin .LE. * ybound(j+1)) )) THEN zin = zbound_max irin = i + khiz + imax*j return END IF11611 CONTINUE11612 CONTINUE END IF11601 CONTINUE11602 CONTINUE stop ' * Stopped in srchst on upper z-plane. Can not f *ind irin! *' END IF END IF nmissm = nmissm+1 goto 10850 ELSE xin = xsrcp yin = ysrcp zin = zsrcp IF ((IWATCH.EQ.-9999)) THEN WRITE(*,*)' xin,yin,zin ',xin,yin,zin END IF IF ((((isource.EQ.20).OR.(isource.EQ.21 )).AND. weight.EQ.0)) * THEN nsmiss = nsmiss + 1 END IF IF (( (xin .GE. xbound_min) .AND. (xin .LE. xbound_max) .AND.
![Page 221: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/221.jpg)
* (yin .GE. ybound_min) .AND. (yin .LE. ybound_max) .AND. (zin . * GE. zbound_min) .AND. (zin .LE. zbound_max))) THEN DO 11621 i=1,imax IF (( (xbound(i) .LE. xin) .AND. (xin .LE. xbound(i+1) * ) )) THEN DO 11631 j=1,jmax IF (( (ybound(j) .LE. yin) .AND. (yin .LE. ybo * und(j+1)) )) THEN DO 11641 k=1,kmax IF (( (zbound(k) .LE. zin) .AND. (zin * .LE. zbound(k+1)) )) THEN irin = (1 + i + (j-1)*IMAX + (k-1) * *ijmax) return END IF11641 CONTINUE11642 CONTINUE END IF11631 CONTINUE11632 CONTINUE END IF11621 CONTINUE11622 CONTINUE stop ' * Stopped in srchst. Cannot find irin! *' ELSE IF(( (xin.GT. xbound_max+dsurround(1)) .OR. (xin .LT. xbo * und_min-dsurround(1)).OR. (yin.GT. ybound_max+dsurround(2)) .O * R. (yin .LT. ybound_min-dsurround(2)).OR. (zin.GT. zbound_max+ * dsurround(3)) .OR. (zin .LT. zbound_min-dsurround(4)))) THEN IF (((isource.EQ.20) .AND. weight.EQ.0)) THEN return ELSE nsmiss = nsmiss+1 goto 10850 END IF ELSE irin = imax*jmax*kmax+2 return END IF END IF end SUBROUTINE SHIFT_XYUV(NofREPEAT,xsrc,ysrc,usrc,vsrc) ! Copyright National Research Council of Canada, Ottawa, ! BEAM Code System 1999, all rights reserved ! This code is covered by the BEAM General License implicit none real*8 xsrc,ysrc,usrc,vsrc, X,Y,U,V integer*4 NofREPEAT X = xsrc Y = ysrc U = usrc V = vsrc IF ((NofREPEAT .EQ. 1)) THEN xsrc = -X ysrc = Y usrc = -U vsrc = V ELSE IF((NofREPEAT .EQ. 2)) THEN xsrc = X
![Page 222: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/222.jpg)
ysrc = -Y usrc = U vsrc = -V ELSE IF((NofREPEAT .EQ. 3)) THEN xsrc = -X ysrc = -Y usrc = -U vsrc = -V ELSE IF((NofREPEAT .GT. 3)) THEN NofREPEAT = 0 END IF RETURN END#define HAVE_LOAD_DSO#ifndef HAVE_LOAD_DSO subroutine init_beamsource(i_parallel,conf_name, hen_house,egs_hom *e,the_beam_code, the_pegs_file,the_input_file) integer*4 i_parallel character*(*) conf_name character*(*) hen_house,egs_home,the_beam_code,the_pegs_file,the_i *nput_file write(6,*) 'You need a working C compiler to use source 9!' call exit(1) end subroutine sample_beamsource(einsrc,xsrc,ysrc,zsrc,usrc,vsrc,wsrc, *weight, iqin,latchi,nhist,iphatsrc) return end subroutine motionsample_beamsource(einsrc,xsrc,ysrc,zsrc,usrc,vsrc *,wsrc,weight, iqin,latchi,nhist,iphatsrc,frMU_indx) return end subroutine finish_beamsource return end subroutine call init_vcusource(conf_name,hen_house,egs_home, the_v *cu_code,the_input_file) character*(*) conf_name character*(*) hen_house,egs_home,the_vcu_code,the_input_file write(6,*) 'You need a working C compiler to use source 9!' call exit(1) end subroutine sample_vcusource(einsrc,xsrc,ysrc,zsrc,usrc,vsrc,wsrc,w *eight, iqin,latchi,n_hist_dum,more_in_cont,iphatsrc,frMU_indx) return end subroutine finish_vcusource return end#endif ! Copyright National Research Council of Canada, 2000. ! All rights reserved. subroutine init_ranmar implicit none common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array
![Page 223: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/223.jpg)
real*4 twom24 integer*4 s,t integer*4 i,j,k,l,m,ii,jj IF((ixx .LE. 0 .OR. ixx .GT. 31328))ixx = 1802 IF((jxx .LE. 0 .OR. jxx .GT. 30081))jxx = 9373 i = mod(ixx/177,177) + 2 j = mod(ixx, 177) + 2 k = mod(jxx/169,178) + 1 l = mod(jxx, 169) DO 11651 ii=1,97 s = 0 t = 8388608 DO 11661 jj=1,24 m = mod(mod(i*j,179)*k,179) IF (( fool_optimizer .EQ. 999 )) THEN write(6,*) i,j,k,m,s,t END IF i = j IF (( fool_optimizer .EQ. 999 )) THEN write(6,*) i,j,k,m,s,t END IF j = k IF (( fool_optimizer .EQ. 999 )) THEN write(6,*) i,j,k,m,s,t END IF k = m IF (( fool_optimizer .EQ. 999 )) THEN write(6,*) i,j,k,m,s,t END IF l = mod(53*l+1,169) IF (( fool_optimizer .EQ. 999 )) THEN write(6,*) i,j,k,m,s,t END IF IF((mod(l*m,64) .GE. 32))s = s + t IF (( fool_optimizer .EQ. 999 )) THEN write(6,*) i,j,k,m,s,t END IF t = t/2 IF (( fool_optimizer .EQ. 999 )) THEN write(6,*) i,j,k,m,s,t END IF11661 CONTINUE11662 CONTINUE urndm(ii) = s11651 CONTINUE11652 CONTINUE crndm = 362436 cdrndm = 7654321 cmrndm = 16777213 twom24 = 1./16777216. ixx = 97 jxx = 33 rng_seed = 128 + 1 return end subroutine ranmar_get implicit none common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm,
![Page 224: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/224.jpg)
*i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 integer*4 i,iopt IF((rng_seed .EQ. 999999))call init_ranmar DO 11671 i=1,128 iopt = urndm(ixx) - urndm(jxx) IF((iopt .LT. 0))iopt = iopt + 16777216 urndm(ixx) = iopt ixx = ixx - 1 jxx = jxx - 1 IF ((ixx .EQ. 0)) THEN ixx = 97 ELSE IF(( jxx .EQ. 0 )) THEN jxx = 97 END IF crndm = crndm - cdrndm IF((crndm .LT. 0))crndm = crndm + cmrndm iopt = iopt - crndm IF((iopt .LT. 0))iopt = iopt + 16777216 rng_array(i) = iopt11671 CONTINUE11672 CONTINUE rng_seed = 1 return end SUBROUTINE WATCH(IARG,IWATCH) ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none integer*4 iarg,iwatch,IP,ICOUNT,JHSTRY,J,N real*8 KE integer*4 graph_unit integer egs_open_file integer*4 ku,kr,ka COMMON/BOUNDS/ECUT,PCUT,VACDST real*8 ECUT, PCUT, VACDST COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000 *),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold COMMON/EPCONT/EDEP,TSTEP,TUSTEP,USTEP,TVSTEP,VSTEP, RHOF,EOLD,ENEW *,EKE,ELKE,GLE,E_RANGE, x_final,y_final,z_final, u_final,v_final,w_ *final, IDISC,IROLD,IRNEW,IAUSFL(29) DOUBLE PRECISION EDEP real*8 TSTEP, TUSTEP, USTEP, VSTEP, TVSTEP, RHOF, EOLD, ENE *W, EKE, ELKE, GLE, E_RANGE, x_final,y_final,z_final, u_final, *v_final,w_final integer*4 IDISC, IROLD, IRNEW, IAUSFL common/egs_vr/ e_max_rr, prob_RR, nbr_split, i_play_RR, i_ *survived_RR, * n_RR_warning, i_do_rr real*8 e_max_rr,prob_RR integer*4 nbr_split,i_play_RR,i_survived_RR,n_RR_warning integer*2 i_do_rr
![Page 225: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/225.jpg)
COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch DATA ICOUNT/0/,JHSTRY/1/ graph_unit/-1/ save ICOUNT,JHSTRY,graph_unit ku = 13 kr = 0 ka = 1 IF ((IARG .EQ. -99)) THEN DO 11681 J=1,29 IAUSFL(J)=111681 CONTINUE11682 CONTINUE IAUSFL(22)=0 IAUSFL(23)=0 IAUSFL(24)=0 END IF IF ((IARG .EQ. -1)) THEN IF ((IWATCH .EQ. 4)) THEN IF (( graph_unit .LT. 0 )) THEN graph_unit = egs_open_file(ku,kr,ka,'.egsgph') END IF WRITE(graph_unit,11690) 0,0,0,0.0,0.0,0.0,0.0,JHSTRY JHSTRY=JHSTRY+1 ELSE WRITE(6,11700)JHSTRY11700 FORMAT(' END OF HISTORY',I8,3X,40('*')/) JHSTRY=JHSTRY+1 ICOUNT=ICOUNT+2 RETURN END IF END IF IF (( (IWATCH .NE. 4) .AND. ((ICOUNT .GE. 50) .OR. (ICOUNT .EQ. 0) * .OR. (IARG .EQ. -99)) )) THEN ICOUNT=1 WRITE(6,11710)11710 FORMAT(//T39,' NP',3X,'ENERGY Q REGION X',7X, 'Y',7X,'Z',6 *X,'U',6X,'V',6X,'W',6X,'LATCH',2X,'WEIGHT'/) END IF IF (((IWATCH .EQ. 4) .AND. (IARG .GE. 0) .AND. (IARG .NE. 5))) THE *N IF((graph_unit .LT. 0))graph_unit = egs_open_file(ku,kr,ka,'.e *gsgph') WRITE(graph_unit,11690) NP,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),E(N * P)
![Page 226: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/226.jpg)
11690 FORMAT(2I4,1X,I6,4G15.8,I12) END IF IF((IARG .EQ. 5 .OR. IARG .LT. 0))RETURN IF((IWATCH .EQ. 4))RETURN KE=E(NP) IF ((IQ(NP).NE.0)) THEN KE=E(NP)-0.511 END IF IF ((IARG .EQ. 0 .AND. IWATCH .EQ. 2)) THEN ICOUNT=ICOUNT+1 WRITE(6,11720)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP),V(NP * ), W(NP),LATCH(NP),WT(NP)11720 FORMAT(T11,'STEP ABOUT TO OCCUR', T36,':',I5,F9.3,2I4,3F8.3,3F *7.3,I10,1PE10.3) ELSE IF((IARG .EQ. 0)) THEN RETURN END IF IF (( IARG .EQ. 1)) THEN ICOUNT=ICOUNT+1 WRITE(6,11730)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP),V(NP * ), W(NP),LATCH(NP),WT(NP)11730 FORMAT(' Discard AE,AP<E<ECUT',T36,':',I5,F9.3,2I4,3F8.3,3F7. *3,I10,1PE10.3) ELSE IF((IARG .EQ. 2)) THEN ICOUNT=ICOUNT+1 WRITE(6,11740)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP),V(NP * ), W(NP),LATCH(NP),WT(NP)11740 FORMAT(' Discard E<AE,AP',T36,':',I5,F9.3,2I4,3F8.3,3F7.3,I10 *,1PE10.3) ELSE IF((IARG .EQ. 3)) THEN ICOUNT=ICOUNT+1 WRITE(6,11750)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP),V(NP * ), W(NP),LATCH(NP),WT(NP)11750 FORMAT(' Discard -user request',T36,':',I5,F9.3,2I4,3F8.3,3F7. *3,I10,1PE10.3) ELSE IF((IARG .EQ. 4)) THEN WRITE(6,11760)EDEP,IR(NP)11760 FORMAT(T10,'Local energy deposition',T36,':',F12.5,' MeV in re *gion ',I6) ELSE IF((IARG .EQ. 6)) THEN ICOUNT=ICOUNT+1 WRITE(6,11770)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP),V(NP * ), W(NP),LATCH(NP),WT(NP)11770 FORMAT(' bremsstrahlung about to occur',T36,':',I5,F9.3,2I4,3 *F8.3,3F7.3,I10,1PE10.3) ELSE IF((IARG .EQ. 7)) THEN IF ((nbr_split .EQ.1)) THEN DO 11781 IP=NPold,NP IF ((IQ(IP).EQ.-1)) THEN KE = E(IP) - RM ICOUNT=ICOUNT+1 WRITE(6,11790)IP,KE,IQ(IP),IR(IP),X(IP),Y(IP),Z(IP * ),U(IP),V(IP), W(IP),LATCH(IP),WT(IP)11790 FORMAT(T10,'Resulting electron',T36,':',I5,F9.3,2I *4,3F8.3,3F7.3,I10,1PE10.3) ELSE KE = E(IP) ICOUNT=ICOUNT+1
![Page 227: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/227.jpg)
WRITE(6,11800)IP,KE,IQ(IP),IR(IP),X(IP),Y(IP),Z(IP * ),U(IP),V(IP), W(IP),LATCH(IP),WT(IP)11800 FORMAT(T10,'Resulting photon',T36,':',I5,F9.3,2I4, *3F8.3,3F7.3,I10,1PE10.3) END IF11781 CONTINUE11782 CONTINUE ELSE KE = E(NPold) - RM ICOUNT=ICOUNT+1 WRITE(6,11810)NPold,KE,IQ(NPold),IR(NPold),X(NPold),Y(NPol * d),Z(NPold),U(NPold),V(NPold), W(NPold),LATCH(NPold),WT(NP * old)11810 FORMAT(T10,'Resulting electron',T36,':',I5,F9.3,2I4,3F8.3, *3F7.3,I10,1PE10.3) DO 11821 IP=NPold+1,NP KE= E(IP) IF ((IP .EQ. NPold+1)) THEN ICOUNT=ICOUNT+1 WRITE(6,11830)IP,KE,IQ(IP),IR(IP),X(IP),Y(IP),Z(IP * ),U(IP),V(IP), W(IP),LATCH(IP),WT(IP)11830 FORMAT(T10,'Split photons',T36,':',I5,F9.3,2I4,3F8 *.3,3F7.3,I10,1PE10.3) ELSE ICOUNT=ICOUNT+1 WRITE(6,11840)IP,KE,IQ(IP),IR(IP),X(IP),Y(IP),Z(IP * ),U(IP),V(IP), W(IP),LATCH(IP),WT(IP)11840 FORMAT(T36,':',I5,F9.3,2I4,3F8.3,3F7.3,I10,1PE10.3 *) END IF11821 CONTINUE11822 CONTINUE END IF ELSE IF((IARG .EQ. 8)) THEN ICOUNT=ICOUNT+1 WRITE(6,11850)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP),V(NP * ), W(NP),LATCH(NP),WT(NP)11850 FORMAT(' Moller about to occur',T36,':',I5,F9.3,2I4,3F8.3,3F *7.3,I10,1PE10.3) ELSE IF((IARG .EQ. 9)) THEN IF ((NP.EQ.NPold)) THEN ICOUNT=ICOUNT+1 WRITE(6,11860)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP), * V(NP), W(NP),LATCH(NP),WT(NP)11860 FORMAT(T11,'Interaction rejected',T36,':',I5,F9.3,2I4,3F8. *3,3F7.3,I10,1PE10.3) ELSE DO 11871 IP=NPold,NP KE = E(IP) - ABS(IQ(NP))*RM IF ((IP.EQ.NPold)) THEN ICOUNT=ICOUNT+1 WRITE(6,11880)IP,KE,IQ(IP),IR(IP),X(IP),Y(IP),Z(IP * ),U(IP),V(IP), W(IP),LATCH(IP),WT(IP)11880 FORMAT(T11,'Resulting electrons',T36,':',I5,F9.3,2 *I4,3F8.3,3F7.3,I10,1PE10.3) ELSE ICOUNT=ICOUNT+1 WRITE(6,11890)IP,KE,IQ(IP),IR(IP),X(IP),Y(IP),Z(IP
![Page 228: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/228.jpg)
* ),U(IP),V(IP), W(IP),LATCH(IP),WT(IP)11890 FORMAT(T36,':',I5,F9.3,2I4,3F8.3,3F7.3,I10,1PE10.3 *) END IF11871 CONTINUE11872 CONTINUE END IF ELSE IF((IARG .EQ. 10)) THEN ICOUNT=ICOUNT+1 WRITE(6,11900)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP),V(NP * ), W(NP),LATCH(NP),WT(NP)11900 FORMAT(' Bhabba about to occur',T36,':',I5,F9.3,2I4,3F8.3,3F *7.3,I10,1PE10.3) ELSE IF((IARG .EQ. 11)) THEN IF ((NP.EQ.NPold)) THEN ICOUNT=ICOUNT+1 WRITE(6,11910)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP), * V(NP), W(NP),LATCH(NP),WT(NP)11910 FORMAT(T11,'Interaction rejected',T36,':',I5,F9.3,2I4,3F8. *3,3F7.3,I10,1PE10.3) ELSE DO 11921 IP=NPold,NP KE = E(IP) - ABS(IQ(IP))*RM IF ((IP.EQ.NPold)) THEN ICOUNT=ICOUNT+1 WRITE(6,11930)IP,KE,IQ(IP),IR(IP),X(IP),Y(IP),Z(IP * ),U(IP),V(IP), W(IP),LATCH(IP),WT(IP)11930 FORMAT(T11,'Resulting e- or e+',T36,':',I5,F9.3,2I *4,3F8.3,3F7.3,I10,1PE10.3) ELSE ICOUNT=ICOUNT+1 WRITE(6,11940)IP,KE,IQ(IP),IR(IP),X(IP),Y(IP),Z(IP * ),U(IP),V(IP), W(IP),LATCH(IP),WT(IP)11940 FORMAT(T36,':',I5,F9.3,2I4,3F8.3,3F7.3,I10,1PE10.3 *) END IF11921 CONTINUE11922 CONTINUE END IF ELSE IF((IARG .EQ. 12)) THEN ICOUNT=ICOUNT+1 WRITE(6,11950)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP),V(NP * ), W(NP),LATCH(NP),WT(NP)11950 FORMAT(' Positron about to decay in flight',T36,':',I5,F9.3,2I *4,3F8.3,3F7.3,I10,1PE10.3) ELSE IF((IARG .EQ. 13)) THEN IF ((NP.EQ.NPold)) THEN ICOUNT=ICOUNT+1 WRITE(6,11960)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP), * V(NP), W(NP),LATCH(NP),WT(NP)11960 FORMAT(T11,'Interaction rejected',T36,':',I5,F9.3,2I4,3F8. *3,3F7.3,I10,1PE10.3) ELSE DO 11971 IP=NPold,NP KE = E(IP) - ABS(IQ(IP))*RM IF ((IP.EQ.NPold)) THEN ICOUNT=ICOUNT+1 WRITE(6,11980)IP,KE,IQ(IP),IR(IP),X(IP),Y(IP),Z(IP
![Page 229: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/229.jpg)
* ),U(IP),V(IP), W(IP),LATCH(IP),WT(IP)11980 FORMAT(T11,'Resulting photons',T36,':',I5,F9.3,2I4 *,3F8.3,3F7.3,I10,1PE10.3) ELSE ICOUNT=ICOUNT+1 WRITE(6,11990)IP,KE,IQ(IP),IR(IP),X(IP),Y(IP),Z(IP * ),U(IP),V(IP), W(IP),LATCH(IP),WT(IP)11990 FORMAT(T36,':',I5,F9.3,2I4,3F8.3,3F7.3,I10,1PE10.3 *) END IF11971 CONTINUE11972 CONTINUE END IF ELSE IF((IARG .EQ. 28)) THEN ICOUNT=ICOUNT+1 WRITE(6,12000)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP),V(NP * ), W(NP),LATCH(NP),WT(NP)12000 FORMAT(' Positron will annihilate at rest',T36,':',I5,F9.3,2I4 *,3F8.3,3F7.3,I10,1PE10.3) ELSE IF((IARG .EQ. 14)) THEN IF ((NP.EQ.NPold)) THEN ICOUNT=ICOUNT+1 WRITE(6,12010)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP), * V(NP), W(NP),LATCH(NP),WT(NP)12010 FORMAT(T11,'Interaction rejected',T36,':',I5,F9.3,2I4,3F8. *3,3F7.3,I10,1PE10.3) ELSE DO 12021 IP=NPold,NP KE = E(IP) - ABS(IQ(IP))*RM IF ((IP.EQ.NPold)) THEN ICOUNT=ICOUNT+1 WRITE(6,12030)IP,KE,IQ(IP),IR(IP),X(IP),Y(IP),Z(IP * ),U(IP),V(IP), W(IP),LATCH(IP),WT(IP)12030 FORMAT(' Positron annihilates at rest',T36,':',I5, *F9.3,2I4,3F8.3,3F7.3,I10,1PE10.3) ELSE ICOUNT=ICOUNT+1 WRITE(6,12040)IP,KE,IQ(IP),IR(IP),X(IP),Y(IP),Z(IP * ),U(IP),V(IP), W(IP),LATCH(IP),WT(IP)12040 FORMAT(T36,':',I5,F9.3,2I4,3F8.3,3F7.3,I10,1PE10.3 *) END IF12021 CONTINUE12022 CONTINUE END IF ELSE IF((IARG .EQ. 15)) THEN ICOUNT=ICOUNT+1 WRITE(6,12050)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP),V(NP * ), W(NP),LATCH(NP),WT(NP)12050 FORMAT(' Pair production about to occur',T36,':',I5,F9.3,2I4,3 *F8.3,3F7.3,I10,1PE10.3) ELSE IF((IARG .EQ. 16)) THEN IF ((NP.EQ.NPold .AND. i_survived_rr .EQ. 0)) THEN ICOUNT=ICOUNT+1 WRITE(6,12060)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP), * V(NP), W(NP),LATCH(NP),WT(NP)12060 FORMAT(T11,'Interaction rejected',T36,':',I5,F9.3,2I4,3F8. *3,3F7.3,I10,1PE10.3)
![Page 230: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/230.jpg)
ELSE IF((NP.EQ.NPold .AND. i_survived_rr .GT. 0)) THEN WRITE(6,12070)i_survived_rr,prob_rr12070 FORMAT(T10,'Russian Roulette eliminated ',I2, ' particle(s *) with probability ',F8.5) ICOUNT=ICOUNT+1 WRITE(6,12080)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP), * V(NP), W(NP),LATCH(NP),WT(NP)12080 FORMAT(T10,'Now on top of stack',T36,':',I5,F9.3,2I4,3F8.3 *,3F7.3,I10,1PE10.3) ELSE DO 12091 IP=NPold,NP KE = E(IP) - ABS(IQ(IP))*RM IF ((IP.EQ.NPold)) THEN ICOUNT=ICOUNT+1 WRITE(6,12100)IP,KE,IQ(IP),IR(IP),X(IP),Y(IP),Z(IP * ),U(IP),V(IP), W(IP),LATCH(IP),WT(IP)12100 FORMAT(T11,'Resulting pair',T36,':',I5,F9.3,2I4,3F *8.3,3F7.3,I10,1PE10.3) ELSE ICOUNT=ICOUNT+1 WRITE(6,12110)IP,KE,IQ(IP),IR(IP),X(IP),Y(IP),Z(IP * ),U(IP),V(IP), W(IP),LATCH(IP),WT(IP)12110 FORMAT(T36,':',I5,F9.3,2I4,3F8.3,3F7.3,I10,1PE10.3 *) END IF12091 CONTINUE12092 CONTINUE IF ((i_survived_rr .GT. 0)) THEN WRITE(6,12120)i_survived_rr,prob_rr12120 FORMAT(T10,'Russian Roulette eliminated ',I2,' * particle(s) with probability ',F8.5) ICOUNT=ICOUNT+1 WRITE(6,12130)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U( * NP),V(NP), W(NP),LATCH(NP),WT(NP)12130 FORMAT(T10,'Now on top of stack',T36,':',I5,F9.3,2I4,3 *F8.3,3F7.3,I10,1PE10.3) END IF END IF ELSE IF((IARG .EQ. 17)) THEN ICOUNT=ICOUNT+1 WRITE(6,12140)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP),V(NP * ), W(NP),LATCH(NP),WT(NP)12140 FORMAT(' Compton about to occur',T36,':',I5,F9.3,2I4,3F8.3,3F *7.3,I10,1PE10.3) ELSE IF((IARG .EQ. 18)) THEN IF ((NP .EQ. NPold .AND. i_survived_rr .EQ. 0)) THEN ICOUNT=ICOUNT+1 WRITE(6,12150)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP), * V(NP), W(NP),LATCH(NP),WT(NP)12150 FORMAT(T11,'Interaction rejected',T36,':',I5,F9.3,2I4,3F8. *3,3F7.3,I10,1PE10.3) ELSE IF((NP .GT. NPold)) THEN DO 12161 IP=NPold,NPold+1 KE = E(IP) - ABS(IQ(IP))*RM IF ((IQ(IP).NE.0)) THEN ICOUNT=ICOUNT+1 WRITE(6,12170)IP,KE,IQ(IP),IR(IP),X(IP),Y(IP),Z(IP * ),U(IP),V(IP), W(IP),LATCH(IP),WT(IP)
![Page 231: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/231.jpg)
12170 FORMAT(T11,'compton electron created',T36,':',I5,F *9.3,2I4,3F8.3,3F7.3,I10,1PE10.3) ELSE ICOUNT=ICOUNT+1 WRITE(6,12180)IP,KE,IQ(IP),IR(IP),X(IP),Y(IP),Z(IP * ),U(IP),V(IP), W(IP),LATCH(IP),WT(IP)12180 FORMAT(T11,'compton scattered photon',T36,':',I5,F *9.3,2I4,3F8.3,3F7.3,I10,1PE10.3) END IF12161 CONTINUE12162 CONTINUE END IF IF ((i_survived_rr .GT. 0)) THEN WRITE(6,12190)i_survived_rr,prob_rr12190 FORMAT(T10,'Russian Roulette eliminated ',I2, ' particle(s *) with probability ',F8.5) ICOUNT=ICOUNT+1 WRITE(6,12200)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP), * V(NP), W(NP),LATCH(NP),WT(NP)12200 FORMAT(T10,'Now on top of stack',T36,':',I5,F9.3,2I4,3F8.3 *,3F7.3,I10,1PE10.3) END IF ELSE IF((IARG .EQ. 19)) THEN ICOUNT=ICOUNT+1 WRITE(6,12210)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP),V(NP * ), W(NP),LATCH(NP),WT(NP)12210 FORMAT(' Photoelectric about to occur',T36,':',I5,F9.3,2I4,3F8 *.3,3F7.3,I10,1PE10.3) ELSE IF((IARG .EQ. 20)) THEN IF ((NPold.EQ.NP .AND. IQ(NP).EQ.0 .AND. i_survived_rr .EQ. 0) * ) THEN ICOUNT=ICOUNT+1 WRITE(6,12220)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP), * V(NP), W(NP),LATCH(NP),WT(NP)12220 FORMAT(T11,'Photon energy below N-shell',/, T11,'Photon di *scarded',T36,':',I5,F9.3,2I4,3F8.3,3F7.3,I10,1PE10.3) ELSE IF((IQ(NPold) .EQ. -1 .AND. i_survived_rr .EQ. 0)) THEN KE= E(NPold)-RM ICOUNT=ICOUNT+1 WRITE(6,12230)NPold,KE,IQ(NPold),IR(NPold),X(NPold),Y(NPol * d),Z(NPold),U(NPold),V(NPold), W(NPold),LATCH(NPold),WT(NP * old)12230 FORMAT(T10,'Resulting photoelectron',T36,':',I5,F9.3,2I4,3 *F8.3,3F7.3,I10,1PE10.3) ELSE IF((i_survived_rr .GT. 0)) THEN IF ((NP.EQ.NPold-1 .OR. IQ(NPold) .NE. -1)) THEN IF ((i_survived_rr .GT. 1)) THEN WRITE(6,12240)i_survived_rr-1,prob_rr12240 FORMAT(T10,'Russian Roulette eliminated ',I4, ' pa *rticle(s) with probability ',F8.5,' plus') END IF WRITE(6,12250)prob_rr12250 FORMAT(T10,'Russian Roulette eliminated resulting phot *oelectron', ' with probability ',F8.5) ELSE KE = E(NPold) - RM ICOUNT=ICOUNT+1 WRITE(6,12260)NPold,KE,IQ(NPold),IR(NPold),X(NPold),Y(
![Page 232: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/232.jpg)
* NPold),Z(NPold),U(NPold),V(NPold), W(NPold),LATCH(NPol * d),WT(NPold)12260 FORMAT(T10,'Resulting photoelectron?',T36,':',I5,F9.3, *2I4,3F8.3,3F7.3,I10,1PE10.3) WRITE(6,12270)i_survived_rr,prob_rr12270 FORMAT(T10,'Russian Roulette eliminated ',I4, ' partic *le(s) with probability ',F8.5) END IF ICOUNT=ICOUNT+1 WRITE(6,12280)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP), * V(NP), W(NP),LATCH(NP),WT(NP)12280 FORMAT(T10,'Now on top of stack',T36,':',I5,F9.3,2I4,3F8.3 *,3F7.3,I10,1PE10.3) END IF ELSE IF((IARG .EQ. 24)) THEN ICOUNT=ICOUNT+1 WRITE(6,12290)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP),V(NP * ), W(NP),LATCH(NP),WT(NP)12290 FORMAT(' Rayleigh scattering occured',T36,':',I5,F9.3,2I4,3F8. *3,3F7.3,I10,1PE10.3) ELSE IF((IARG .EQ. 25)) THEN ICOUNT=ICOUNT+1 WRITE(6,12300)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP),V(NP * ), W(NP),LATCH(NP),WT(NP)12300 FORMAT(T10,'Fluorescent X-ray created',T36,':',I5,F9.3,2I4,3F8 *.3,3F7.3,I10,1PE10.3) ELSE IF((IARG .EQ. 26)) THEN ICOUNT=ICOUNT+1 WRITE(6,12310)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP),V(NP * ), W(NP),LATCH(NP),WT(NP)12310 FORMAT(T10,'Coster-Kronig e- created',T36,':',I5,F9.3,2I4,3F8. *3,3F7.3,I10,1PE10.3) ELSE IF((IARG .EQ. 27)) THEN ICOUNT=ICOUNT+1 WRITE(6,12320)NP,KE,IQ(NP),IR(NP),X(NP),Y(NP),Z(NP),U(NP),V(NP * ), W(NP),LATCH(NP),WT(NP)12320 FORMAT(T10,'Auger electron created',T36,':',I5,F9.3,2I4,3F8.3, *3F7.3,I10,1PE10.3) END IF IF ((IARG .EQ. 0 .AND. IWATCH .EQ. 2)) THEN WRITE(6,12330)USTEP,TUSTEP,VSTEP,TVSTEP,EDEP12330 FORMAT(T5,'USTEP,TUSTEP,VSTEP,TVSTEP,EDEP',T36,': ',5(1PE13 *.4)) ICOUNT=ICOUNT+1 END IF IF((NP .EQ. 1 .OR. IARG .EQ. 0))RETURN IF (( IARG .LE. 3)) THEN N=NP-1 KE = E(N) - ABS(IQ(N))*RM ICOUNT=ICOUNT+1 WRITE(6,12340)N,KE,IQ(N),IR(N),X(N),Y(N),Z(N),U(N),V(N), W(N), * LATCH(N),WT(N)12340 FORMAT(T10,'Now on top of stack',T36,':',I5,F9.3,2I4,3F8.3,3F7 *.3,I10,1PE10.3) END IF RETURN END SUBROUTINE SIGMA(NDATA,ISTAT,MODE,IERR)
![Page 233: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/233.jpg)
! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none integer*4 NDATA,ISTAT,MODE,IERR COMMON/ERROR/DATA(1,10) real*8 data common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch integer*4 n,non0,i real*8 stat,sdenom real*8 emax,avg,error,datum,argmnt DATA EMAX/99.9/ IERR=0 IF (((MODE .LT. 0) .OR. (MODE .GT. 2))) THEN MODE=2 IERR=1 END IF IF (((NDATA.LE.0).OR.(NDATA.GT.1).OR.(ISTAT.LE.0).OR.(ISTAT.GT.10) *)) THEN IERR=-1 RETURN END IF IF ((ISTAT .EQ. 1)) THEN IERR=10 DO 12351 N=1,NDATA DATA(N,2)=EMAX12351 CONTINUE12352 CONTINUE RETURN END IF IF ((MODE.NE.0)) THEN STAT=FLOAT(ISTAT) SDENOM=STAT*(STAT-1.) END IF DO 12361 N=1,NDATA NON0=0 AVG=0.0 ERROR=0.0 DO 12371 I=1,ISTAT DATUM=DATA(N,I) IF ((DATUM.NE.0.0)) THEN NON0=NON0+1 AVG=AVG+DATUM ERROR=ERROR+DATUM**2 END IF12371 CONTINUE12372 CONTINUE IF ((NON0 .EQ. 0)) THEN
![Page 234: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/234.jpg)
IERR=11 ERROR=EMAX GOTO 12380 ELSE IF(((NON0 .EQ. 1) .AND. (MODE .EQ. 0))) THEN ERROR=EMAX GOTO12380 ELSE IF ((MODE .EQ. 0)) THEN STAT=FLOAT(NON0) SDENOM=STAT*(STAT-1.) END IF END IF AVG=AVG/STAT ARGMNT=ERROR-STAT*AVG**2 IF ((ARGMNT.LT.0.0)) THEN WRITE(6,12390)ARGMNT,ERROR,STAT,AVG,SDENOM12390 FORMAT(' ***** - SQ RT IN SIGMA. ARGMNT,ERROR,STAT,AVG,SDE *NOM='/' ',5E12.4) ARGMNT=0.0 END IF ERROR=SQRT(ARGMNT/SDENOM) IF ((AVG .EQ. 0.)) THEN ERROR=EMAX ELSE ERROR=100.*ERROR/ABS(AVG) END IF IF((MODE .EQ. 2))AVG=AVG*STAT12380 CONTINUE DATA(N,1)=AVG DATA(N,2)=MIN(EMAX,ERROR)12361 CONTINUE12362 CONTINUE RETURN END subroutine prepare_alias_sampling(nsbin,fs_array,ws_array,ibin_arr *ay) ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none integer*4 nsbin,ibin_array(nsbin) real*8 fs_array(nsbin),ws_array(nsbin) integer*4 i,j_l,j_h real*8 sum,aux sum = 0 DO 12401 i=1,nsbin IF((fs_array(i) .LT. 1e-30))fs_array(i) = 1e-30 ws_array(i) = -fs_array(i) ibin_array(i) = 1 sum = sum + fs_array(i)12401 CONTINUE12402 CONTINUE sum = sum/nsbin DO 12411 i=1,nsbin-1 DO 12421 j_h=1,nsbin IF (( ws_array(j_h) .LT. 0 )) THEN IF((abs(ws_array(j_h)) .GT. sum))GOTO 12430 END IF12421 CONTINUE
![Page 235: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/235.jpg)
12422 CONTINUE j_h = nsbin12430 CONTINUE DO 12431 j_l=1,nsbin IF (( ws_array(j_l) .LT. 0 )) THEN IF((abs(ws_array(j_l)) .LT. sum))GOTO 12440 END IF12431 CONTINUE12432 CONTINUE j_l = nsbin12440 aux = sum - abs(ws_array(j_l)) ws_array(j_h) = ws_array(j_h) + aux ws_array(j_l) = -ws_array(j_l)/sum ibin_array(j_l) = j_h IF((i .EQ. nsbin-1))ws_array(j_h) = 112411 CONTINUE12412 CONTINUE return end real*8 function alias_sample(nsbin,xs_array,ws_array,ibin_array) ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none integer*4 nsbin,ibin_array(nsbin) real*8 xs_array(0:nsbin),ws_array(nsbin) common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 real*8 v1,v2,aj integer*4 j IF((rng_seed .GT. 128))call ranmar_get v1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get v2 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 aj = 1 + v1*nsbin j = aj IF((j .GT. nsbin))j = nsbin aj = aj - j IF (( aj .GT. ws_array(j) )) THEN j = ibin_array(j) END IF alias_sample = (1-v2)*xs_array(j-1) + v2*xs_array(j) return end subroutine egs_init implicit none common/my_times/ t_elapsed, t_cpu, t_first real*8 t_elapsed, t_cpu integer t_first(8) real egs_tot_time,egs_etime real*8 dum call egs_set_defaults call egs_check_arguments call egs_init1
![Page 236: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/236.jpg)
return end subroutine egs_init1 implicit none common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch COMMON/MISC/ DUNIT,KMPI,KMPO,RHOR( 2097154),MED( 2097154),IRAYLR real*8 DUNIT, RHOR integer*4 KMPI, KMPO integer*2 MED, IRAYLR common/my_times/ t_elapsed, t_cpu, t_first real*8 t_elapsed, t_cpu integer t_first(8) real egs_tot_time,egs_etime integer l, lnblnk1, l1, l2 integer i character arg*256,tmp_string*512, tmp1_string*512, ucode_dir*512, *line*80, line1*80,dattim*24 logical have_input,egs_isdir,egs_strip_extension,ex, on_egs_home,i *s_opened integer*4 mypid integer getpid integer istat, egs_system, u, pos1, pos2,egs_get_unit,itmp real*8 dum t_elapsed = 0 t_cpu = egs_etime() dum = egs_tot_time(1) call egs_date_and_time(t_first) DO 12451 i=1,len(line) line(i:i) = '='12451 CONTINUE12452 CONTINUE DO 12461 i=1,len(line1) line1(i:i) = '.'12461 CONTINUE12462 CONTINUE on_egs_home = .false. inquire(file=pegs_file,exist=ex) IF (( ex )) THEN kmpi=egs_get_unit(kmpi) IF ((kmpi.LT.0)) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'failed to get a free Fortran I/O unit for pegs * file' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF open(kmpi,file=pegs_file,status='old',err=12470)
![Page 237: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/237.jpg)
goto 12480 END IF arg = pegs_file(:lnblnk1(pegs_file)) ex = egs_strip_extension(arg,'.pegs4dat') l = lnblnk1(egs_home) l1 = lnblnk1('pegs4data') + 2*lnblnk1('/') l2 = lnblnk1(arg) + lnblnk1('.pegs4dat') IF (( l + l1 + l2 .GT. 256 )) THEN write(i_log,'(/a)') '***************** Warning: ' write(i_log,*) 'pegs4 data file name (including absolute path)' write(i_log,'(a,i4,a)') 'is too long (',l+l1+l2,') characters' ELSE pegs_file = egs_home(:lnblnk1(egs_home)) // 'pegs4' // '/' // 'd *ata' // '/' // arg(:lnblnk1(arg)) // '.pegs4dat' inquire(file=pegs_file,exist=ex) IF (( ex )) THEN kmpi=egs_get_unit(kmpi) IF ((kmpi.LT.0)) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'failed to get a free Fortran I/O unit for pe *gs file' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF open(kmpi,file=pegs_file,status='old',err=12470) on_egs_home = .true. goto 12480 END IF END IF l = lnblnk1(hen_house) IF (( l + l1 + l2 .GT. 256 )) THEN write(i_log,'(/a)') '***************** Warning: ' write(i_log,*) 'pegs4 data file name (including absolute path)' write(i_log,'(a,i4,a)') 'is too long (',l+l1+l2,') characters' ELSE pegs_file = hen_house(:lnblnk1(hen_house)) // 'pegs4' // '/' // * 'data' // '/' // arg(:lnblnk1(arg)) // '.pegs4dat' inquire(file=pegs_file,exist=ex) IF (( ex )) THEN kmpi=egs_get_unit(kmpi) IF ((kmpi.LT.0)) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'failed to get a free Fortran I/O unit for pe *gs file' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF open(kmpi,file=pegs_file,status='old',err=12470) goto 12480 END IF END IF write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'could not find pegs4 file named ',arg(:lnblnk1(arg *)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1)12480 CONTINUE DO 12491 i=1,len(tmp_string)
![Page 238: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/238.jpg)
tmp_string(i:i) = ' '12491 CONTINUE12492 CONTINUE tmp_string = hen_house(:lnblnk1(hen_house)) // 'data' // '/' i_nist_data=76 i_incoh=78 i_photo_relax=77 i_photo_cs=79 i_mscat=11 DO 12501 i=1,len(tmp1_string) tmp1_string(i:i) = ' '12501 CONTINUE12502 CONTINUE tmp1_string = tmp_string(:lnblnk1(tmp_string)) // 'photo_cs.data' inquire(file=tmp1_string,exist=ex,opened=is_opened,number=itmp) IF (( .NOT.ex )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'EGSnrc data file ','photo_cs.data',' does not ex *ist' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF IF (( .NOT.is_opened )) THEN i_photo_cs=egs_get_unit(i_photo_cs) IF ((i_photo_cs.LT.0)) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'failed to get a free Fortran I/O unit for data * file ', tmp1_string(:lnblnk1(tmp1_string)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF open(i_photo_cs,file=tmp1_string,status='old',err=12510) ELSE i_photo_cs = itmp END IF DO 12521 i=1,len(tmp1_string) tmp1_string(i:i) = ' '12521 CONTINUE12522 CONTINUE tmp1_string = tmp_string(:lnblnk1(tmp_string)) // 'msnew.data' inquire(file=tmp1_string,exist=ex,opened=is_opened,number=itmp) IF (( .NOT.ex )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'EGSnrc data file ','msnew.data',' does not exist *' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF IF (( .NOT.is_opened )) THEN i_mscat=egs_get_unit(i_mscat) IF ((i_mscat.LT.0)) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'failed to get a free Fortran I/O unit for data * file ', tmp1_string(:lnblnk1(tmp1_string)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF open(i_mscat,file=tmp1_string,status='old',err=12510)
![Page 239: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/239.jpg)
ELSE i_mscat = itmp END IF DO 12531 i=1,len(tmp1_string) tmp1_string(i:i) = ' '12531 CONTINUE12532 CONTINUE tmp1_string = tmp_string(:lnblnk1(tmp_string)) // 'incoh.data' inquire(file=tmp1_string,exist=ex,opened=is_opened,number=itmp) IF (( .NOT.ex )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'EGSnrc data file ','incoh.data',' does not exist *' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF IF (( .NOT.is_opened )) THEN i_incoh=egs_get_unit(i_incoh) IF ((i_incoh.LT.0)) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'failed to get a free Fortran I/O unit for data * file ', tmp1_string(:lnblnk1(tmp1_string)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF open(i_incoh,file=tmp1_string,status='old',err=12510) ELSE i_incoh = itmp END IF DO 12541 i=1,len(tmp1_string) tmp1_string(i:i) = ' '12541 CONTINUE12542 CONTINUE tmp1_string = tmp_string(:lnblnk1(tmp_string)) // 'photo_relax.dat *a' inquire(file=tmp1_string,exist=ex,opened=is_opened,number=itmp) IF (( .NOT.ex )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'EGSnrc data file ','photo_relax.data',' does not * exist' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF IF (( .NOT.is_opened )) THEN i_photo_relax=egs_get_unit(i_photo_relax) IF ((i_photo_relax.LT.0)) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'failed to get a free Fortran I/O unit for data * file ', tmp1_string(:lnblnk1(tmp1_string)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF open(i_photo_relax,file=tmp1_string,status='old',err=12510) ELSE i_photo_relax = itmp END IF DO 12551 i=1,len(ucode_dir) ucode_dir(i:i) = ' '
![Page 240: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/240.jpg)
12551 CONTINUE12552 CONTINUE ucode_dir = egs_home(:lnblnk1(egs_home)) // user_code(:lnblnk1(use *r_code)) // '/' have_input = .false. i_input=5 IF (( lnblnk1(input_file) .GT. 0 )) THEN have_input = .true. l = lnblnk1(egs_home) l1 = lnblnk1(user_code)+1 l2 = lnblnk1(input_file) + lnblnk1('.egsinp') IF (( l + l1 + l2 .GT. 1024 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'input file name (including path) is too long ' * ,l+l1+l2 write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF tmp_string = ucode_dir(:lnblnk1(ucode_dir)) // input_file(:lnbln * k1(input_file)) // '.egsinp' inquire(file=tmp_string,exist=ex) IF (( .NOT.ex )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'input file ',tmp_string(:lnblnk1(tmp_string)), * ' does not exist ' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF open(i_input,file=tmp_string,status='old',err=12560) END IF DO 12571 i=1,len(work_dir) work_dir(i:i) = ' '12571 CONTINUE12572 CONTINUE work_dir = 'egsrun_' mypid = getpid() call egs_itostring(work_dir,mypid,.false.) call egs_get_hostnm(host_name) IF((lnblnk1(host_name) .LT. 1))host_name = 'unknown' IF (( have_input )) THEN work_dir = work_dir(:lnblnk1(work_dir)) // '_' // input_file(:ln * blnk1(input_file)) // '_' // host_name(:lnblnk1(host_name)) // ' */' ELSE work_dir = work_dir(:lnblnk1(work_dir)) // '_noinput_' // host_n * ame(:lnblnk1(host_name)) // '/' END IF DO 12581 i=1,len(tmp_string) tmp_string(i:i) = ' '12581 CONTINUE12582 CONTINUE tmp_string = ucode_dir(:lnblnk1(ucode_dir)) // work_dir(:lnblnk1(w *ork_dir)) DO 12591 i=1,lnblnk1(tmp_string) IF (( tmp_string(i:i) .EQ. '/' )) THEN tmp_string(i:i) = '/' END IF12591 CONTINUE
![Page 241: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/241.jpg)
12592 CONTINUE ex = egs_isdir(tmp_string) IF (( ex )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'a directory named ',tmp_string(:lnblnk1(tmp_stri * ng)),' already exists?' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF tmp1_string = 'mkdir ' // tmp_string(:lnblnk1(tmp_string)) l = lnblnk1(tmp1_string) tmp1_string(l+1:l+1) = char(0) istat = egs_system(tmp1_string) IF (( istat .NE. 0 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'failed to create working directory ',tmp1_string * (:lnblnk1(tmp1_string)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF call egs_open_units(.true.) write(i_log,'(a)') line write(i_log,'(a,a,t55,a,$)') 'EGSnrc version 4 for ','x86_64-unkno *wn-linux-gnu',' ' call egs_get_fdate(dattim) write(i_log,'(a,/,a)') dattim,line pos1 = lnblnk1('output file(s)') pos2 = 80 - lnblnk1('x86_64-unknown-linux-gnu-gfortran') pos2 = min(pos2,80-lnblnk1(user_code)) DO 12601 i=1,len(tmp_string) tmp_string(i:i) = ' '12601 CONTINUE12602 CONTINUE tmp_string = pegs_file call egs_strip_path(tmp_string) ex = egs_strip_extension(tmp_string,'.pegs4dat') IF (( on_egs_home )) THEN tmp_string = tmp_string(:lnblnk1(tmp_string)) // ' on EGS_HOME' ELSE tmp_string = tmp_string(:lnblnk1(tmp_string)) // ' on HEN_HOUSE' END IF IF (( lnblnk1(tmp_string) .GT. lnblnk1(pegs_file) )) THEN DO 12611 i=1,len(tmp_string) tmp_string(i:i) = ' '12611 CONTINUE12612 CONTINUE tmp_string = pegs_file END IF pos2 = min(pos2,80-lnblnk1(tmp_string)) pos2 = min(pos2,80-lnblnk1(host_name)) IF((have_input))pos2 = min(pos2,80-lnblnk1(input_file)) pos2 = min(pos2,80-lnblnk1(output_file)) IF((pos2 .LT. pos1+2))pos2 = pos1 + 2 write(i_log,'(a,$)') 'configuration' l = pos2 - lnblnk1('configuration') write(i_log,'(a,$)') line1(:l) write(i_log,'(a)') 'x86_64-unknown-linux-gnu-gfortran' write(i_log,'(a,$)') 'user code'
![Page 242: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/242.jpg)
l = pos2 - lnblnk1('user code') write(i_log,'(a,$)') line1(:l) write(i_log,'(a)') user_code(:lnblnk1(user_code)) write(i_log,'(a,$)') 'pegs file' l = pos2 - lnblnk1('pegs file') write(i_log,'(a,$)') line1(:l) write(i_log,'(a)') tmp_string(:lnblnk1(tmp_string)) write(i_log,'(a,$)') 'using host' l = pos2 - lnblnk1('using host') write(i_log,'(a,$)') line1(:l) write(i_log,'(a)') host_name(:lnblnk1(host_name)) IF (( have_input )) THEN write(i_log,'(a,$)') 'input file' l = pos2 - lnblnk1('input file') write(i_log,'(a,$)') line1(:l) write(i_log,'(a)') input_file(:lnblnk1(input_file)) END IF write(i_log,'(a,$)') 'output file(s)' l = pos2 - lnblnk1('output file(s)') write(i_log,'(a,$)') line1(:l) write(i_log,'(a)') output_file(:lnblnk1(output_file)) IF (( n_parallel .GT. 0 )) THEN write(i_log,'(a,$)') 'number of parallel jobs' l = pos2 - lnblnk1('number of parallel jobs') write(i_log,'(a,$)') line1(:l) write(i_log,'(i2)') n_parallel write(i_log,'(a,$)') 'job number' l = pos2 - lnblnk1('job number') write(i_log,'(a,$)') line1(:l) write(i_log,'(i2)') i_parallel END IF write(i_log,'(a)') line return12560 write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'failed to open input file ',tmp_string(:lnblnk1(tm *p_string)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1)12470 write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'failed to open existing pegs file ',pegs_file(:lnb *lnk1(pegs_file)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1)12510 write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'failed to open EGSnrc data file ',tmp1_string(:lnb *lnk1(tmp1_string)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1) return end subroutine egs_check_arguments implicit none common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext
![Page 243: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/243.jpg)
*ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch character arg*256,tmp_string*512, line1*80 logical have_arg,egs_isdir,egs_strip_extension,ex, on_egs_home integer narg, iargc, i, lnblnk1, l, l2,i_help,egs_get_unit narg = iargc() IF((narg .LT. 1))return have_arg = .false. DO 12621 i=1,narg-1 call getarg(i,arg) l = lnblnk1(arg) IF (( ( l .EQ. lnblnk1('-H') .AND. arg(:l) .EQ. '-H' ) .OR. ( l * .EQ. lnblnk1('--hen-house') .AND. arg(:l) .EQ. '--hen-house' ) ) * ) THEN have_arg = .true. call getarg(i+1,arg) GO TO12622 END IF12621 CONTINUE12622 CONTINUE IF (( have_arg )) THEN l = lnblnk1(arg) DO 12631 i=1,len(hen_house) hen_house(i:i) = ' '12631 CONTINUE12632 CONTINUE IF (( l .GT. 0 )) THEN IF (( l .GT. 254 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(a,i5)') ' HEN_HOUSE argument is too long',l write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF hen_house(:l) = arg(:lnblnk1(arg)) IF((hen_house(l:l) .NE. '/'))hen_house(l+1:l+1) = '/' ELSE write(i_log,'(/a)') '***************** Error: ' write(i_log,'(a)') ' empty argument after -H' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF DO 12641 i=1,lnblnk1(hen_house) IF (( hen_house(i:i) .EQ. '/' )) THEN hen_house(i:i) = '/' END IF12641 CONTINUE12642 CONTINUE END IF IF (( .NOT.egs_isdir(hen_house) )) THEN write(i_log,'(/a)') '***************** Warning: ' write(i_log,'(a,a)') ' HEN_HOUSE directory ',hen_house(:lnblnk1( * hen_house)) write(i_log,'(a)') 'does not exist. Hope you know what you are d *oing.'
![Page 244: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/244.jpg)
END IF have_arg = .false. DO 12651 i=1,narg call getarg(i,arg) l = lnblnk1(arg) IF (( ( l .EQ. lnblnk1('-h') .AND. arg(:l) .EQ. '-h' ) .OR. ( l * .EQ. lnblnk1('--help') .AND. arg(:l) .EQ. '--help' ) )) THEN have_arg = .true. GO TO12652 END IF12651 CONTINUE12652 CONTINUE IF (( have_arg )) THEN call getarg(0,arg) call egs_strip_path(arg) write(i_log,'(//,a,a,a,//)') 'Usage: ',arg(:lnblnk1(arg)),' [arg *s] ' tmp_string = hen_house(:lnblnk1(hen_house)) // 'pieces/help_mess *age' i_help=98 i_help=egs_get_unit(i_help) IF ((i_help.LT.0)) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'failed to get a free Fortran I/O unit for help * file' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF open(i_help,file=tmp_string,status='old',err=12660)12671 CONTINUE read(i_help,'(a)',err=12680,end=12680) line1 write(i_log,'(a)') line1 GO TO 1267112672 CONTINUE12680 CONTINUE call exit(0)12660 CONTINUE write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'Did not find the help_message file!' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF have_arg = .false. DO 12691 i=1,narg call getarg(i,arg) l = lnblnk1(arg) IF (( ( l .EQ. lnblnk1('-b') .AND. arg(:l) .EQ. '-b' ) .OR. ( l * .EQ. lnblnk1('--batch') .AND. arg(:l) .EQ. '--batch' ) )) THEN have_arg = .true. GO TO12692 END IF12691 CONTINUE12692 CONTINUE IF((have_arg))is_batch = .true. have_arg = .false. DO 12701 i=1,narg-1 call getarg(i,arg) l = lnblnk1(arg)
![Page 245: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/245.jpg)
IF (( ( l .EQ. lnblnk1('-P') .AND. arg(:l) .EQ. '-P' ) .OR. ( l * .EQ. lnblnk1('--parallel') .AND. arg(:l) .EQ. '--parallel' ) )) * THEN have_arg = .true. call getarg(i+1,arg) GO TO12702 END IF12701 CONTINUE12702 CONTINUE IF (( have_arg )) THEN read(arg,*,err=12710) n_parallel IF((n_parallel .LT. 0))goto 12710 goto 1272012710 CONTINUE write(i_log,'(/a)') '***************** Warning: ' write(i_log,*) ' Wrong/missing parallel job number argument, -P *option ignored' n_parallel = 012720 CONTINUE END IF have_arg = .false. DO 12731 i=1,narg-1 call getarg(i,arg) l = lnblnk1(arg) IF (( ( l .EQ. lnblnk1('-j') .AND. arg(:l) .EQ. '-j' ) .OR. ( l * .EQ. lnblnk1('--job') .AND. arg(:l) .EQ. '--job' ) )) THEN have_arg = .true. call getarg(i+1,arg) GO TO12732 END IF12731 CONTINUE12732 CONTINUE IF (( have_arg )) THEN read(arg,*,err=12740) i_parallel IF((i_parallel .LT. 0))goto 12740 goto 1275012740 CONTINUE write(i_log,'(/a)') '***************** Warning: ' write(i_log,*) ' Wrong/missing job argument, -j option ognored' i_parallel = 012750 CONTINUE END IF have_arg = .false. DO 12761 i=1,narg-1 call getarg(i,arg) l = lnblnk1(arg) IF (( ( l .EQ. lnblnk1('-f') .AND. arg(:l) .EQ. '-f' ) .OR. ( l * .EQ. lnblnk1('--first-job') .AND. arg(:l) .EQ. '--first-job' ) ) * ) THEN have_arg = .true. call getarg(i+1,arg) GO TO12762 END IF12761 CONTINUE12762 CONTINUE IF (( have_arg )) THEN read(arg,*,err=12770) first_parallel IF((first_parallel .LT. 1))goto 12770
![Page 246: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/246.jpg)
goto 1278012770 CONTINUE write(i_log,'(/a)') '***************** Warning: ' write(i_log,*) ' Wrong/missing first job argument, -f option ogn *ored' first_parallel = 112780 CONTINUE END IF IF (( n_parallel .GT. 0 .OR. i_parallel .GT. 0 )) THEN IF (( n_parallel*i_parallel .EQ. 0 )) THEN write(i_log,'(/a)') '***************** Warning: ' write(i_log,*) 'You need to specify number of jobs AND job num *ber ', '=> will not use parallel run ' n_parallel = 0 i_parallel = 0 END IF IF (( first_parallel .GT. i_parallel )) THEN write(i_log,'(/a)') '***************** Warning: ' write(i_log,*) 'i_parallel (',i_parallel, ') can not be smalle *r than first_parallel (',first_parallel,')' first_parallel = i_parallel END IF END IF have_arg = .false. DO 12791 i=1,narg-1 call getarg(i,arg) l = lnblnk1(arg) IF (( ( l .EQ. lnblnk1('-e') .AND. arg(:l) .EQ. '-e' ) .OR. ( l * .EQ. lnblnk1('--egs-home') .AND. arg(:l) .EQ. '--egs-home' ) )) * THEN have_arg = .true. call getarg(i+1,arg) GO TO12792 END IF12791 CONTINUE12792 CONTINUE IF (( have_arg )) THEN l = lnblnk1(arg) DO 12801 i=1,len(egs_home) egs_home(i:i) = ' '12801 CONTINUE12802 CONTINUE IF (( l .EQ. 0 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(a)') ' empty argument after -e' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF IF (( l .GT. 254 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(a,i5)') ' EGS_HOME argument is too long ',l write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF egs_home(:l) = arg(:lnblnk1(arg)) IF((egs_home(l:l) .NE. '/'))egs_home(l+1:l+1) = '/' DO 12811 i=1,lnblnk1(egs_home) IF (( egs_home(i:i) .EQ. '/' )) THEN
![Page 247: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/247.jpg)
egs_home(i:i) = '/' END IF12811 CONTINUE12812 CONTINUE END IF IF (( .NOT.egs_isdir(egs_home) )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) ' EGS_HOME directory ',egs_home(:lnblnk1(egs_home * )),' does not exist.' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF on_egs_home = .false. have_arg = .false. DO 12821 i=1,narg-1 call getarg(i,arg) l = lnblnk1(arg) IF (( ( l .EQ. lnblnk1('-p') .AND. arg(:l) .EQ. '-p' ) .OR. ( l * .EQ. lnblnk1('--pegs-file') .AND. arg(:l) .EQ. '--pegs-file' ) ) * ) THEN have_arg = .true. call getarg(i+1,arg) GO TO12822 END IF12821 CONTINUE12822 CONTINUE IF (( .NOT.have_arg )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'no pegs4 data file name supplied' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF pegs_file = arg(:lnblnk1(arg)) call egs_get_usercode(user_code) have_arg = .false. DO 12831 i=1,narg-1 call getarg(i,arg) l = lnblnk1(arg) IF (( ( l .EQ. lnblnk1('-i') .AND. arg(:l) .EQ. '-i' ) .OR. ( l * .EQ. lnblnk1('--input') .AND. arg(:l) .EQ. '--input' ) )) THEN have_arg = .true. call getarg(i+1,arg) GO TO12832 END IF12831 CONTINUE12832 CONTINUE IF (( have_arg )) THEN ex = egs_strip_extension(arg,'.egsinp') l2 = lnblnk1(arg) + lnblnk1('.egsinp') IF (( l2 .GT. 256 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'input file name is too long ',l2 write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF input_file = arg(:lnblnk1(arg)) END IF have_arg = .false.
![Page 248: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/248.jpg)
DO 12841 i=1,narg-1 call getarg(i,arg) l = lnblnk1(arg) IF (( ( l .EQ. lnblnk1('-o') .AND. arg(:l) .EQ. '-o' ) .OR. ( l * .EQ. lnblnk1('--output') .AND. arg(:l) .EQ. '--output' ) )) THEN have_arg = .true. call getarg(i+1,arg) GO TO12842 END IF12841 CONTINUE12842 CONTINUE IF (( have_arg )) THEN l = lnblnk1(arg) IF (( l .GT. 256 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'output file name is too long ',l write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF output_file(:l) = arg(:lnblnk1(arg)) ELSE IF (( lnblnk1(input_file) .GT. 0 )) THEN output_file(:lnblnk1(input_file)) = input_file(:lnblnk1(input_ * file)) ELSE output_file = 'test' END IF END IF return end subroutine egs_open_units(flag) implicit none logical flag common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch character tmp_string*1024, tmp1_string*1024, tmp2_string*1024, uco *de_dir*1024, input_line*100, arg*20 integer i,lnblnk1,u,l,istart,egs_get_unit,i_iofile logical ex,is_open DO 12851 i=1,len(tmp_string) tmp_string(i:i) = ' '12851 CONTINUE12852 CONTINUE DO 12861 i=1,len(ucode_dir) ucode_dir(i:i) = ' '12861 CONTINUE12862 CONTINUE ucode_dir = egs_home(:lnblnk1(egs_home)) // user_code(:lnblnk1(use
![Page 249: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/249.jpg)
*r_code)) // '/' IF (( flag )) THEN tmp_string = ucode_dir(:lnblnk1(ucode_dir)) // work_dir(:lnblnk1 * (work_dir)) ELSE tmp_string = ucode_dir(:lnblnk1(ucode_dir)) END IF tmp_string = tmp_string(:lnblnk1(tmp_string)) // output_file(:lnbl *nk1(output_file)) IF (( i_parallel .GT. 0 )) THEN tmp_string = tmp_string(:lnblnk1(tmp_string)) // '_w' call egs_itostring(tmp_string,i_parallel,.false.) END IF DO 12871 i=1,len(tmp1_string) tmp1_string(i:i) = ' '12871 CONTINUE12872 CONTINUE i_log=6 IF (( is_batch )) THEN tmp1_string = tmp_string(:lnblnk1(tmp_string)) // '.egslog' open(i_log,file=tmp1_string,status='unknown',err=12880) END IF DO 12891 i=1,len(tmp2_string) tmp2_string(i:i) = ' '12891 CONTINUE12892 CONTINUE tmp2_string = ucode_dir(:lnblnk1(ucode_dir)) // user_code(:lnblnk1 *(user_code)) // '.io' inquire(file=tmp2_string,exist=ex) n_files = 0 IF (( ex )) THEN i_iofile=99 i_iofile=egs_get_unit(i_iofile) IF ((i_iofile.LT.1)) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'failed to get a free Fortran I/O unit for .io *file' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF open(i_iofile,file=tmp2_string,status='old',err=12900)12911 CONTINUE read(i_iofile,'(a)',err=12920,end=12920) input_line IF((input_line(1:1) .EQ. '#'))GO TO12911 read(input_line,*,err=12920,end=12920) u istart = 1 DO 12931 i=lnblnk1(input_line),1,-1 IF (( input_line(i:i) .EQ. ' ' )) THEN istart = i+1 GO TO12932 END IF12931 CONTINUE12932 CONTINUE DO 12941 i=1,len(arg) arg(i:i) = ' '12941 CONTINUE12942 CONTINUE DO 12951 i=istart,lnblnk1(input_line)
![Page 250: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/250.jpg)
arg(i+1-istart:i+1-istart) = input_line(i:i)12951 CONTINUE12952 CONTINUE inquire(unit=u,opened=is_open) IF (( is_open )) THEN write(i_log,'(/a)') '***************** Warning: ' write(i_log,'(a,i3,a,a,a,/,a,/,a,/)') 'Unit ',u,' which you *want to connect to a ', arg(:lnblnk1(arg)),' file ', 'is already i *n use. Will assume this code is being used as', 'a shared library *source and this file will be opened explicitly.' ELSE n_files = n_files + 1 IF (( n_files .GT. 20 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'Too many units requested in .io.', ' Incre *as $mx_units and retry' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF file_units(n_files) = u DO 12961 i=1,len(file_extensions(n_files)) file_extensions(n_files)(i:i) = ' '12961 CONTINUE12962 CONTINUE l = lnblnk1(arg) IF (( l .GT. 10 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'extension ',arg(:lnblnk1(arg)),' is longer * than ', 10,' chars. ', 'Increase $max_extension_length and retry *' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF file_extensions(n_files) = arg(:lnblnk1(arg)) tmp1_string = tmp_string(:lnblnk1(tmp_string)) // arg(:lnbln * k1(arg)) open(u,file=tmp1_string,status='unknown') END IF GO TO 1291112912 CONTINUE12920 close(i_iofile) END IF return12880 write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'failed to open output file ',tmp1_string(:lnblnk1( *tmp1_string)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1)12900 write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'failed to open existing .io file',tmp2_string(:lnb *lnk1(tmp2_string)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1) return end subroutine egs_finish implicit none common /egs_io/ file_extensions(20), file_units(20), user_code, i
![Page 251: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/251.jpg)
*nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch common/my_times/ t_elapsed, t_cpu, t_first real*8 t_elapsed, t_cpu integer t_first(8) real egs_tot_time,egs_etime character line*80,base*512,base1*512,tmp_string*512,junk_file*128, *fname*512 character dattim*24 integer i,l,lnblnk1,istat,egs_system,n_open,unlink,i_junk,egs_get_ *unit logical is_open,egs_isdir real*8 t1,t2,tt_cpu DO 12971 i=1,len(line) line(i:i) = '='12971 CONTINUE12972 CONTINUE IF (( n_parallel .EQ. 0 .OR. i_parallel .GT. 0 )) THEN t_elapsed = egs_tot_time(1) tt_cpu = egs_etime() - t_cpu t1 = t_elapsed t2 = t1/3600 write(i_log,'(//a,/,a,/)') line,'Finished simulation' write(i_log,'(2x,a,t30,f9.1,a,f7.3,a)') 'Elapsed time: ',t1,' s *(',t2,' h)' t1 = tt_cpu t2 = t1/3600 write(i_log,'(2x,a,t30,f9.1,a,f7.3,a)') 'CPU time:',t1,' s (',t2 * ,' h)' write(i_log,'(2x,a,t30,f10.3)') 'Ratio:',t_elapsed/tt_cpu END IF call egs_get_fdate(dattim) write(i_log,'(//a,t56,a,/,a)') 'End of run ',dattim,line n_open=0 DO 12981 i=1,len(base) base(i:i) = ' '12981 CONTINUE12982 CONTINUE base = egs_home(:lnblnk1(egs_home)) // user_code(:lnblnk1(user_cod *e)) DO 12991 i=1,99 IF (( is_batch .OR. i .NE. i_log )) THEN inquire(i,opened=is_open) IF (( is_open )) THEN inquire(i,name=fname) IF ((index(fname(:lnblnk1(fname)),base(:lnblnk1(base))).GT.0 * )) THEN close(i) n_open = n_open+1
![Page 252: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/252.jpg)
END IF END IF END IF12991 CONTINUE12992 CONTINUE IF (( lnblnk1(work_dir) .EQ. 0 )) THEN return END IF DO 13001 i=1,len(base) base(i:i) = ' '13001 CONTINUE13002 CONTINUE base = egs_home(:lnblnk1(egs_home)) // user_code(:lnblnk1(user_cod *e)) // '/' // work_dir(:lnblnk1(work_dir)) DO 13011 i=1,lnblnk1(base) IF (( base(i:i) .EQ. '/' )) THEN base(i:i) = '/' END IF13011 CONTINUE13012 CONTINUE IF (( egs_isdir(base) )) THEN DO 13021 i=1,len(tmp_string) tmp_string(i:i) = ' '13021 CONTINUE13022 CONTINUE DO 13031 i=1,len(junk_file) junk_file(i:i) = ' '13031 CONTINUE13032 CONTINUE junk_file = work_dir(:lnblnk1(work_dir)) l = lnblnk1(junk_file) junk_file(l:l) = ' ' junk_file = junk_file(:lnblnk1(junk_file)) // '_junk' tmp_string = base(:lnblnk1(base)) // junk_file(:lnblnk1(junk_fil * e)) i_junk=99 i_junk=egs_get_unit(i_junk) IF ((i_junk.LT.0)) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'failed to get a free Fortran I/O unit for junk * file' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF open(i_junk,file=tmp_string,status='unknown') write(i_junk,*) 'junk' close(i_junk) DO 13041 i=1,len(base1) base1(i:i) = ' '13041 CONTINUE13042 CONTINUE base = egs_home(:lnblnk1(egs_home)) // user_code(:lnblnk1(user_c * ode)) // '/' // work_dir(:lnblnk1(work_dir)) base1 = egs_home(:lnblnk1(egs_home)) // user_code(:lnblnk1(user_ * code)) DO 13051 i=1,len(tmp_string) tmp_string(i:i) = ' '13051 CONTINUE
![Page 253: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/253.jpg)
13052 CONTINUE tmp_string = 'mv -f ' // base(:lnblnk1(base)) // '* ' // base1( * :lnblnk1(base1)) l = lnblnk1(tmp_string)+1 tmp_string(l:l) = char(0) istat = egs_system(tmp_string) IF (( istat .NE. 0 )) THEN write(i_log,'(/a)') '***************** Warning: ' write(i_log,*) 'Moving files from working directory failed ?' write(i_log,*) '=> will not remove working directory' ELSE DO 13061 i=1,len(tmp_string) tmp_string(i:i) = ' '13061 CONTINUE13062 CONTINUE tmp_string = 'rm -rf ' // base(:lnblnk1(base)) l = lnblnk1(tmp_string)+1 tmp_string(l:l) = char(0) istat = egs_system(tmp_string) IF (( istat .NE. 0 )) THEN write(i_log,'(/a)') '***************** Warning: ' write(i_log,*) 'Failed to remove working directory ', work_d * ir(:lnblnk1(work_dir)) END IF DO 13071 i=1,len(tmp_string) tmp_string(i:i) = ' '13071 CONTINUE13072 CONTINUE tmp_string = base1(:lnblnk1(base1)) // '/' // junk_file(:lnbln * k1(junk_file)) l = lnblnk1(tmp_string)+1 tmp_string(l:l) = char(0) istat = unlink(tmp_string) END IF END IF DO 13081 i=1,len(work_dir) work_dir(i:i) = ' '13081 CONTINUE13082 CONTINUE return end subroutine egs_set_defaults implicit none COMMON/BOUNDS/ECUT,PCUT,VACDST real*8 ECUT, PCUT, VACDST COMMON/BREMPR/ DL1(8,7),DL2(8,7),DL3(8,7),DL4(8,7),DL5(8,7),DL6(8, *7), ALPHI(2,7),BPAR(2,7),DELPOS(2,7), WA(7,50),PZ(7,50),ZELEM(7,50 *),RHOZ(7,50), PWR2I(50), DELCM(7),ZBRANG(7),LZBRANG(7),NNE(7), IBR *DST,IPRDST,ibr_nist,pair_nrc,itriplet, ASYM(7,50,2) CHARACTER*4 ASYM real*8 DL1,DL2,DL3,DL4,DL5,DL6, ALPHI, BPAR, DELPOS, WA, PZ, * ZELEM, RHOZ, PWR2I, DELCM, ZBRANG, LZBRANG integer*4 NNE, IBRDST, IPRDST, ibr_nist, itriplet, pair_nrc common/compton_data/ iz_array(1538), be_array(1538), Jo_array(15 *38), erfJo_array(1538), ne_array(1538), shn_array(1538), *shell_array(100,7), eno_array(100,7), eno_atbin_array(100,7), n_sh *ell(7), radc_flag, ibcmp integer*4 iz_array,ne_array,shn_array,eno_atbin_array, shell_array
![Page 254: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/254.jpg)
*,n_shell,radc_flag real*8 be_array,Jo_array,erfJo_array,eno_array integer*2 ibcmp COMMON/EDGE/binding_energies(6,100), interaction_prob(6,100), rela *xation_prob(39,100), edge_energies(16,100), edge_number(100), edge *_a(16,100), edge_b(16,100), edge_c(16,100), edge_d(16,100), IEDGFL *,IPHTER real*8 binding_energies, interaction_prob, relaxation_prob, e *dge_energies, edge_a,edge_b,edge_c,edge_d integer*2 IEDGFL, IPHTER integer*4 edge_number COMMON/ELECIN/ esig_e(7),psig_e(7), esige_max, psige_max, range_ep *(0:1,150,7), E_array(150,7), etae_ms0(150,7),etae_ms1(150,7),etap_ *ms0(150,7),etap_ms1(150,7),q1ce_ms0(150,7),q1ce_ms1(150,7),q1cp_ms *0(150,7),q1cp_ms1(150,7),q2ce_ms0(150,7),q2ce_ms1(150,7),q2cp_ms0( *150,7),q2cp_ms1(150,7),blcce0(150,7),blcce1(150,7), EKE0(7),EKE1(7 *), XR0(7),TEFF0(7),BLCC(7),XCC(7), ESIG0(150,7),ESIG1(150,7),PSIG0 *(150,7),PSIG1(150,7),EDEDX0(150,7),EDEDX1(150,7),PDEDX0(150,7),PDE *DX1(150,7),EBR10(150,7),EBR11(150,7),PBR10(150,7),PBR11(150,7),PBR *20(150,7),PBR21(150,7),TMXS0(150,7),TMXS1(150,7), expeke1(7), IUNR *ST(7),EPSTFL(7),IAPRIM(7), sig_ismonotone(0:1,7) real*8 esig_e, psig_e, esige_max, psige_max, range_ep, E_ar *ray, etae_ms0,etae_ms1, etap_ms0,etap_ms1, q1ce_ms0,q1ce_ms1, *q1cp_ms0,q1cp_ms1, q2ce_ms0,q2ce_ms1, q2cp_ms0,q2cp_ms1, blcce0 *,blcce1, expeke1, EKE0,EKE1, XR0, TEFF0, BLCC, XCC, ESIG0,E *SIG1, PSIG0,PSIG1, EDEDX0,EDEDX1, PDEDX0,PDEDX1, EBR10,EBR11, * PBR10,PBR11, PBR20,PBR21, TMXS0,TMXS1 integer*4 IUNRST, EPSTFL, IAPRIM logical sig_ismonotone COMMON/EPCONT/EDEP,TSTEP,TUSTEP,USTEP,TVSTEP,VSTEP, RHOF,EOLD,ENEW *,EKE,ELKE,GLE,E_RANGE, x_final,y_final,z_final, u_final,v_final,w_ *final, IDISC,IROLD,IRNEW,IAUSFL(29) DOUBLE PRECISION EDEP real*8 TSTEP, TUSTEP, USTEP, VSTEP, TVSTEP, RHOF, EOLD, ENE *W, EKE, ELKE, GLE, E_RANGE, x_final,y_final,z_final, u_final, *v_final,w_final integer*4 IDISC, IROLD, IRNEW, IAUSFL common/CH_steps/ count_pII_steps,count_all_steps,is_ch_step real*8 count_pII_steps,count_all_steps logical is_ch_step common/ET_control/ SMAXIR,estepe,ximax, skindepth_for_bca,transpo *rt_algorithm, bca_algorithm,exact_bca,spin_effects real*8 smaxir, estepe, ximax, skindepth_for_bca integer*4 transport_algorithm, bca_algorithm logical exact_bca, spin_effects COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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( 2097154),MED( 2097154),IRAYLR real*8 DUNIT, RHOR integer*4 KMPI, KMPO
![Page 255: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/255.jpg)
integer*2 MED, IRAYLR COMMON/PHOTIN/ EBINDA(7), GE0(7),GE1(7), GMFP0(200,7),GMFP1(200,7) *,GBR10(200,7),GBR11(200,7),GBR20(200,7),GBR21(200,7), RCO0(7),RCO1 *(7), RSCT0(100,7),RSCT1(100,7), COHE0(200,7),COHE1(200,7), DPMFP, *MPGEM(1,7), NGR(7) real*8 EBINDA, GE0,GE1, GMFP0,GMFP1, GBR10,GBR11, GBR20,GBR21, * RCO0,RCO1, RSCT0,RSCT1, COHE0,COHE1, DPMFP integer*4 * MPGEM, * NGR common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000 *),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL COMMON/UPHIIN/SINC0,SINC1,SIN0(1002),SIN1(1002) real*8 SINC0,SINC1,SIN0,SIN1 COMMON/UPHIOT/THETA,SINTHE,COSTHE,SINPHI, COSPHI,PI,TWOPI,PI5D2 real*8 THETA, SINTHE, COSTHE, SINPHI, COSPHI, PI,TWOPI,PI5D2 COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD common/egs_vr/ e_max_rr, prob_RR, nbr_split, i_play_RR, i_ *survived_RR, * n_RR_warning, i_do_rr real*8 e_max_rr,prob_RR integer*4 nbr_split,i_play_RR,i_survived_RR,n_RR_warning integer*2 i_do_rr common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch common/spin_data/ spin_rej(7,0:1,0: 31,0:15,0:31), espin_min,espin *_max,espml,b2spin_min,b2spin_max, dbeta2,dbeta2i,dlener,dleneri,dq *q1,dqq1i, fool_intel_optimizer real*4 spin_rej,espin_min,espin_max,espml,b2spin_min,b2spin_max, d *beta2,dbeta2i,dlener,dleneri,dqq1,dqq1i logical fool_intel_optimizer common/eii_data/ eii_xsection_a( 10000), eii_xsection_b( 10000), * eii_cons(7), eii_a(40), eii_b(40), eii_z(40), eii_sh(40), eii *_nshells(100), eii_nsh(7), eii_first(7,50), eii_no(7,50), eii_
![Page 256: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/256.jpg)
*flag real*8 eii_xsection_a,eii_xsection_b,eii_a,eii_b,eii_cons integer*4 eii_z,eii_sh,eii_nshells integer*4 eii_first,eii_no integer*4 eii_elements,eii_flag,eii_nsh COMMON/rayleigh_inputs/iray_ff_media(7),iray_ff_file(7) character*24 iray_ff_media character*128 iray_ff_file integer i,j,lnblnk1 CHARACTER*4 MEDIA1(24) EQUIVALENCE(MEDIA1(1),MEDIA(1,1)) character fool_dec data MEDIA1/'N','A','I',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' *',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '/ data fool_dec/'/'/ data fool_intel_optimizer/.false./ vacdst = 1e8 DO 13091 i=1, 2097154 ECUT = 0. PCUT = 0. ibcmp = 0 IEDGFL = 0 IPHTER = 0 SMAXIR = 1e10 i_do_rr = 0 e_max_rr = 0 med(i) = 1 rhor(i) = 0 IRAYLR = 013091 CONTINUE13092 CONTINUE eii_flag = 0 eii_xfile = 'Off' xsec_out = 0 photon_xsections = 'si' comp_xsections = 'default' DO 13101 i=1,7 iraylm(i) = 0 DO 13111 j=1,len(iray_ff_file(i)) iray_ff_file(i)(j:j) = ' '13111 CONTINUE13112 CONTINUE DO 13121 j=1,len(iray_ff_media(i)) iray_ff_media(i)(j:j) = ' '13121 CONTINUE13122 CONTINUE ae(i)=0 ap(i)=0 ue(i)=0 up(i)=0 te(i)=0 thmoll(i)=013101 CONTINUE13102 CONTINUE DO 13131 i=1,6 DO 13141 j=1,100 binding_energies(i,j) = 013141 CONTINUE
![Page 257: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/257.jpg)
13142 CONTINUE13131 CONTINUE13132 CONTINUE ibrdst = 0 ibr_nist = 0 pair_nrc = 0 itriplet = 0 iprdst = 1 rhof = 1 DO 13151 i=1,5 iausfl(i) = 113151 CONTINUE13152 CONTINUE DO 13161 i=6,29 iausfl(i) = 013161 CONTINUE13162 CONTINUE ximax = 0.5 estepe = 0.25 skindepth_for_bca = 3 transport_algorithm = 0 bca_algorithm = 1 exact_bca = .false. spin_effects = .true. count_pII_steps = 0 count_all_steps = 0 radc_flag = 0 nmed = 1 kmpi = 12 kmpo = 8 dunit = 1 rng_seed = 999999 latchi = 0 rm = 0.5110034 rmt2 = 2*rm rmsq = rm*rm pi = 4*datan(1d0) twopi = 2*pi pi5d2 = 2.5*pi nbr_split = 1 i_play_RR = 0 i_survived_RR = 0 prob_RR = -1 n_RR_warning = 0 DO 13171 i=1,len(hen_house) hen_house(i:i) = ' '13171 CONTINUE13172 CONTINUE i = lnblnk1('/home/beamnrc/HEN_HOUSE/') hen_house(:i) = '/home/beamnrc/HEN_HOUSE/' IF (( '/' .NE. fool_dec )) THEN DO 13181 j=1,i IF((hen_house(j:j) .EQ. '/'))hen_house(j:j) = '/'13181 CONTINUE13182 CONTINUE END IF IF((hen_house(i:i) .NE. '/'))hen_house(i+1:i+1) = '/' n_files = 0
![Page 258: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/258.jpg)
DO 13191 i=1,len(egs_home) egs_home(i:i) = ' '13191 CONTINUE13192 CONTINUE call getenv('EGS_HOME',egs_home) i = lnblnk1(egs_home) IF (( '/' .NE. fool_dec )) THEN DO 13201 j=1,i IF((egs_home(j:j) .EQ. '/'))egs_home(j:j) = '/'13201 CONTINUE13202 CONTINUE END IF IF((i .GT. 0 .AND. egs_home(i:i) .NE. '/'))egs_home(i+1:i+1) = '/' DO 13211 i=1,len(input_file) input_file(i:i) = ' '13211 CONTINUE13212 CONTINUE DO 13221 i=1,len(output_file) output_file(i:i) = ' '13221 CONTINUE13222 CONTINUE DO 13231 i=1,len(work_dir) work_dir(i:i) = ' '13231 CONTINUE13232 CONTINUE DO 13241 i=1,len(pegs_file) pegs_file(i:i) = ' '13241 CONTINUE13242 CONTINUE DO 13251 i=1,len(host_name) host_name(i:i) = ' '13251 CONTINUE13252 CONTINUE n_parallel = 0 i_parallel = 0 n_chunk = 0 is_batch = .false. first_parallel = 1 return end logical function egs_strip_extension(filen,fext) implicit none character*(*) filen,fext integer l1,l2,lnblnk1,i l1 = lnblnk1(filen) l2 = lnblnk1(fext) IF (( l1 .GE. l2 .AND. filen(l1-l2+1:l1) .EQ. fext(:l2) )) THEN egs_strip_extension = .true. DO 13261 i=l1-l2+1,len(filen) filen(i:i) = ' '13261 CONTINUE13262 CONTINUE ELSE egs_strip_extension = .false. END IF return end logical function egs_is_absolute_path(fn)
![Page 259: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/259.jpg)
implicit none character*(*) fn integer i,lnblnk1 DO 13271 i=1,lnblnk1(fn) IF (( fn(i:i) .EQ. '/' )) THEN egs_is_absolute_path = .true. return END IF13271 CONTINUE13272 CONTINUE egs_is_absolute_path = .false. return end integer function egs_get_unit(iunit) implicit none integer*4 iunit, i logical is_open IF (( iunit .GT. 0 )) THEN inquire(iunit,opened=is_open) IF (( .NOT.is_open )) THEN egs_get_unit = iunit return END IF END IF DO 13281 i=1,99 inquire(i,opened=is_open) IF (( .NOT.is_open )) THEN egs_get_unit = i return END IF13281 CONTINUE13282 CONTINUE egs_get_unit = -1 return end integer function egs_open_file(iunit,rl,action,extension) implicit none integer*4 iunit, rl, action character*(*) extension common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch logical egs_is_absolute_path,is_open integer egs_get_unit integer i,lnblnk1 character*1024 tmp_string,error_string integer*4 the_unit egs_open_file = -1 the_unit = egs_get_unit(iunit)
![Page 260: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/260.jpg)
IF (( the_unit .LT. 0 )) THEN IF (( action .EQ. 0 )) THEN egs_open_file = -1 return END IF write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'No free Fortran I/O units left' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF IF (( egs_is_absolute_path(extension) )) THEN inquire(file=extension,opened=is_open) IF ((is_open)) THEN inquire(file=extension,number=the_unit) write(i_log,'(/a)') '***************** Warning: ' write(i_log,'(a,a,/,a,i3,/,a,/,a)') 'File ',extension(:lnblnk1 * (extension)), ' is already opened and connected to unit ',the_ * unit, ' Will not try to re-open this file, assuming it has bee *n opened', ' by the .io file.' ELSE IF(( rl .EQ. 0 )) THEN open(the_unit,file=extension,status='unknown') ELSE open(the_unit,file=extension,status='unknown',form='unformatte *d', access='direct', recl=rl) END IF egs_open_file = the_unit return END IF DO 13291 i=1,len(tmp_string) tmp_string(i:i) = ' '13291 CONTINUE13292 CONTINUE tmp_string = egs_home(:lnblnk1(egs_home)) // user_code(:lnblnk1(us *er_code)) // '/' // work_dir(:lnblnk1(work_dir)) // output_file(:l *nblnk1(output_file)) IF (( i_parallel .GT. 0 )) THEN tmp_string = tmp_string(:lnblnk1(tmp_string)) // '_w' call egs_itostring(tmp_string,i_parallel,.false.) END IF tmp_string = tmp_string(:lnblnk1(tmp_string)) // extension(:lnblnk *1(extension)) inquire(file=tmp_string,opened=is_open) IF ((is_open)) THEN inquire(file=tmp_string,number=the_unit) write(i_log,'(/a)') '***************** Warning: ' write(i_log,'(a,a,/,a,i3,/,a,/,a,/)') 'File ',tmp_string(:lnblnk * 1(tmp_string)), ' is already opened and connected to unit ',the_ * unit, ' Will not try to re-open this file, assuming it has been *opened', ' by specifying it in the .io file.' ELSE IF(( rl .EQ. 0 )) THEN open(the_unit,file=tmp_string,status='unknown',err=13300) ELSE open(the_unit,file=tmp_string,status='unknown',form='unformatted *', access='direct', recl=rl,err=13300) END IF egs_open_file = the_unit return13300 error_string = 'In egs_open_file: failed to open file ' // tmp_str
![Page 261: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/261.jpg)
*ing(:lnblnk1(tmp_string)) // char(10) // 'iunit = ' call egs_itostring(error_string,iunit,.false.) error_string = error_string(:lnblnk1(error_string)) // ' the_unit *= ' call egs_itostring(error_string,the_unit,.false.) write(i_log,'(/a)') '***************** Error: ' write(i_log,'(a)') error_string(:lnblnk1(error_string)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1) end integer function egs_open_datfile(iunit,rl,action,extension) implicit none integer*4 iunit,rl,action character*(*) extension common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch integer i,the_unit,lnblnk1,egs_get_unit logical egs_is_absolute_path character base*1024, fn*1024 egs_open_datfile = -1 the_unit = egs_get_unit(iunit) IF (( the_unit .LT. 0 )) THEN IF (( action .EQ. 0 )) THEN egs_open_datfile = -1 return END IF write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'No free Fortran I/O units left' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF IF (( egs_is_absolute_path(extension) )) THEN IF (( rl .EQ. 0 )) THEN open(the_unit,file=extension,status='old',err=13310) ELSE open(the_unit,file=extension,status='old',form='unformatted', * access='direct',recl=rl,err=13310) END IF egs_open_datfile = the_unit return13310 CONTINUE IF (( action .EQ. 0 )) THEN egs_open_datfile = -2 return END IF write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'Failed to open file ',extension(:lnblnk1(extensi * on))
![Page 262: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/262.jpg)
write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF DO 13321 i=1,len(base) base(i:i) = ' '13321 CONTINUE13322 CONTINUE DO 13331 i=1,len(fn) fn(i:i) = ' '13331 CONTINUE13332 CONTINUE base = egs_home(:lnblnk1(egs_home)) // user_code(:lnblnk1(user_cod *e)) // '/' IF (( i_parallel .GT. 0 )) THEN fn = base(:lnblnk1(base)) // output_file(:lnblnk1(output_file)) * // '_w' call egs_itostring(fn,i_parallel,.false.) fn = fn(:lnblnk1(fn)) // extension(:lnblnk1(extension)) ELSE fn = base(:lnblnk1(base)) // output_file(:lnblnk1(output_file)) * // extension(:lnblnk1(extension)) END IF IF (( rl .EQ. 0 )) THEN open(the_unit,file=fn,status='old',err=13340) ELSE open(the_unit,file=fn,status='old',form='unformatted',access='di *rect', recl=rl,err=13340) END IF egs_open_datfile = the_unit return13340 CONTINUE write(i_log,'(/a)') '***************** Warning: ' write(i_log,'(a,a)') 'Failed to open ',fn(:lnblnk1(fn)) DO 13351 i=1,len(fn) fn(i:i) = ' '13351 CONTINUE13352 CONTINUE IF (( i_parallel .GT. 0 )) THEN fn = base(:lnblnk1(base)) // input_file(:lnblnk1(input_file)) // * '_w' call egs_itostring(fn,i_parallel,.false.) fn = fn(:lnblnk1(fn)) // extension(:lnblnk1(extension)) ELSE fn = base(:lnblnk1(base)) // input_file(:lnblnk1(input_file)) // * extension(:lnblnk1(extension)) END IF IF (( rl .EQ. 0 )) THEN open(the_unit,file=fn,status='old',err=13360) ELSE open(the_unit,file=fn,status='old',form='unformatted',access='di *rect', recl=rl,err=13360) END IF egs_open_datfile = the_unit return13360 CONTINUE write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'Failed to open data file' write(i_log,'(/a)') '***************** Quiting now.'
![Page 263: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/263.jpg)
call exit(1) end integer function egs_open_file_junk(iunit,do_it_anyway,filen) implicit none integer*4 iunit logical do_it_anyway character*(*) filen logical aux integer*4 the_unit,i inquire(file=filen,exist=aux) IF (( .NOT.aux )) THEN egs_open_file_junk = -2 return END IF IF (( iunit .LT. 0 )) THEN the_unit = -iunit ELSE the_unit = iunit END IF IF (( the_unit .NE. 0 )) THEN inquire(unit=the_unit,opened=aux) IF (( aux )) THEN IF (( .NOT.do_it_anyway )) THEN egs_open_file_junk = -4 return END IF IF((iunit .LT. 0))the_unit = 0 END IF END IF IF (( the_unit .EQ. 0 )) THEN DO 13371 i=1,99 inquire(unit=i,opened=aux) IF (( .NOT.aux )) THEN the_unit = i GO TO13372 END IF13371 CONTINUE13372 CONTINUE IF (( the_unit .EQ. 0 )) THEN egs_open_file_junk = -1 return END IF END IF open(the_unit,file=filen,status='old',err=13380) egs_open_file_junk = the_unit return13380 egs_open_file_junk = -3 return end subroutine egs_strip_path(fname) implicit none character*(*) fname integer i,l,l1,lnblnk1,j character slash slash = '/' l = lnblnk1(fname) DO 13391 i=1,l IF (( fname(i:i) .EQ. slash )) THEN
![Page 264: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/264.jpg)
fname(i:i) = '/' END IF13391 CONTINUE13392 CONTINUE DO 13401 i=l,1,-1 IF (( fname(i:i) .EQ. '/' .OR. fname(i:i) .EQ. slash )) THEN l1 = l-i fname(:l1) = fname(i+1:l) DO 13411 j=l1+1,len(fname) fname(j:j) = ' '13411 CONTINUE13412 CONTINUE return END IF13401 CONTINUE13402 CONTINUE return end subroutine egs_combine_runs(combine_routine,extension) implicit none external combine_routine character*(*) extension common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch character*1024 tmp_string,base integer lnblnk1 integer*4 i,j logical ex DO 13421 i=1,len(base) base(i:i) = ' '13421 CONTINUE13422 CONTINUE base = egs_home(:lnblnk1(egs_home)) // user_code(:lnblnk1(user_cod *e)) // '/' // output_file(:lnblnk1(output_file)) // '_w' DO 13431 j=1,250 DO 13441 i=1,len(tmp_string) tmp_string(i:i) = ' '13441 CONTINUE13442 CONTINUE tmp_string = base(:lnblnk1(base)) call egs_itostring(tmp_string,j,.false.) tmp_string = tmp_string(:lnblnk1(tmp_string)) // extension(:lnbl * nk1(extension)) inquire(file=tmp_string,exist=ex) IF((ex))call combine_routine(tmp_string)13431 CONTINUE13432 CONTINUE return
![Page 265: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/265.jpg)
end subroutine egs_get_usercode(ucode) implicit none common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch character*(*) ucode character*512 arg integer l,l1,lnblnk1,i call getarg(0,arg) call egs_strip_path(arg) l = lnblnk1(arg) IF (( arg(l-3:l) .EQ. '.exe' )) THEN arg(l-3:l) = ' ' l = l - 4 END IF IF (( arg(l-5:l) .EQ. '_debug' )) THEN arg(l-5:l) = ' ' l = l-5 END IF IF (( arg(l-5:l) .EQ. '_noopt' )) THEN arg(l-5:l) = ' ' l = l-5 END IF l1 = len(ucode) IF (( l .GT. l1 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) ' user code name is too long (',l,' chars)' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF DO 13451 i=1,len(ucode) ucode(i:i) = ' '13451 CONTINUE13452 CONTINUE ucode(:l) = arg(:l) return end subroutine egs_itostring(string,i,leave_space) implicit none character*(*) string integer*4 i integer l,lnblnk1,idiv,itmp,iaux logical first,leave_space l = lnblnk1(string)+1 IF((l .GT. 1 .AND. leave_space))l=l+1 idiv = 1000000000 itmp = i first = .false.
![Page 266: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/266.jpg)
do while(idiv.gt.0) iaux = itmp/idiv IF (( (iaux .GT. 0 .OR. first ) .AND. l .LE. len(string) )) THEN string(l:l) = char(iaux+48) first = .true. l = l+1 END IF itmp = itmp - iaux*idiv idiv = idiv/10 end do return end real*8 function egs_rndm() implicit none common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 IF((rng_seed .GT. 128))call ranmar_get egs_rndm = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 return end integer function egs_add_medium(medname) implicit none character*(*) medname COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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 /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch integer*4 i,l,imed,medname_len character c logical same l = min(len(medname),24) medname_len = l DO 13461 i=1,l c = medname(i:i) IF (( ichar(c) .EQ. 0 )) THEN medname_len = i-1
![Page 267: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/267.jpg)
GO TO13462 END IF13461 CONTINUE13462 CONTINUE DO 13471 imed=1,nmed l = 24 DO 13481 i=1,24 IF (( media(i,imed)(1:1) .EQ. ' ' )) THEN l = i-1 GO TO13482 END IF13481 CONTINUE13482 CONTINUE IF (( l .EQ. medname_len )) THEN same = .true. DO 13491 i=1,l c = medname(i:i) IF (( c .NE. media(i,imed)(1:1) )) THEN same = .false. GO TO13492 END IF13491 CONTINUE13492 CONTINUE IF (( same )) THEN egs_add_medium = imed return END IF END IF13471 CONTINUE13472 CONTINUE nmed = nmed + 1 IF (( nmed .GT. 7 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(a,/,a,i3,a)') 'In egs_add_medium: maximum number o *f media exceeded ', 'Increase the macro $MXMED (currently ',7,') a *nd retry' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF l = min(len(medname),24) DO 13501 i=1,l c = medname(i:i) IF (( ichar(c) .EQ. 0 )) THEN l = i-1 GO TO13502 END IF media(i,nmed) = ' ' media(i,nmed)(1:1) = c13501 CONTINUE13502 CONTINUE IF (( l .LT. 24 )) THEN DO 13511 i=l+1,24 media(i,nmed) = ' '13511 CONTINUE13512 CONTINUE END IF egs_add_medium = nmed return
![Page 268: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/268.jpg)
end subroutine egs_get_medium_name(imed,medname) implicit none character*(*) medname COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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 /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch integer*4 i,l,imed DO 13521 i=1,len(medname) medname(i:i) = ' '13521 CONTINUE13522 CONTINUE IF (( imed .LT. 1 .OR. imed .GT. nmed )) THEN return END IF l = 24 DO 13531 l=24,1,-1 IF((media(l,imed)(1:1) .NE. ' '))GO TO1353213531 CONTINUE13532 CONTINUE l = min(l,len(medname)) DO 13541 i=1,l medname(i:i) = media(i,imed)(1:1)13541 CONTINUE13542 CONTINUE return end subroutine egs_get_electron_data(func,imed,which) implicit none integer*4 imed,which external func COMMON/ELECIN/ esig_e(7),psig_e(7), esige_max, psige_max, range_ep *(0:1,150,7), E_array(150,7), etae_ms0(150,7),etae_ms1(150,7),etap_ *ms0(150,7),etap_ms1(150,7),q1ce_ms0(150,7),q1ce_ms1(150,7),q1cp_ms *0(150,7),q1cp_ms1(150,7),q2ce_ms0(150,7),q2ce_ms1(150,7),q2cp_ms0( *150,7),q2cp_ms1(150,7),blcce0(150,7),blcce1(150,7), EKE0(7),EKE1(7 *), XR0(7),TEFF0(7),BLCC(7),XCC(7), ESIG0(150,7),ESIG1(150,7),PSIG0 *(150,7),PSIG1(150,7),EDEDX0(150,7),EDEDX1(150,7),PDEDX0(150,7),PDE *DX1(150,7),EBR10(150,7),EBR11(150,7),PBR10(150,7),PBR11(150,7),PBR
![Page 269: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/269.jpg)
*20(150,7),PBR21(150,7),TMXS0(150,7),TMXS1(150,7), expeke1(7), IUNR *ST(7),EPSTFL(7),IAPRIM(7), sig_ismonotone(0:1,7) real*8 esig_e, psig_e, esige_max, psige_max, range_ep, E_ar *ray, etae_ms0,etae_ms1, etap_ms0,etap_ms1, q1ce_ms0,q1ce_ms1, *q1cp_ms0,q1cp_ms1, q2ce_ms0,q2ce_ms1, q2cp_ms0,q2cp_ms1, blcce0 *,blcce1, expeke1, EKE0,EKE1, XR0, TEFF0, BLCC, XCC, ESIG0,E *SIG1, PSIG0,PSIG1, EDEDX0,EDEDX1, PDEDX0,PDEDX1, EBR10,EBR11, * PBR10,PBR11, PBR20,PBR21, TMXS0,TMXS1 integer*4 IUNRST, EPSTFL, IAPRIM logical sig_ismonotone COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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 /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch real*8 lemin,lemax lemin = (1 - eke0(imed))/eke1(imed) lemax = (meke(imed) - eke0(imed))/eke1(imed) IF (( which .EQ. 1 )) THEN call func(meke(imed),lemin,lemax,esig0(1,imed),esig1(1,imed)) ELSE IF(( which .EQ. 2 )) THEN call func(meke(imed),lemin,lemax,psig0(1,imed),psig1(1,imed)) ELSE IF(( which .EQ. 3 )) THEN call func(meke(imed),lemin,lemax,ededx0(1,imed),ededx1(1,imed)) ELSE IF(( which .EQ. 4 )) THEN call func(meke(imed),lemin,lemax,pdedx0(1,imed),pdedx1(1,imed)) ELSE IF(( which .EQ. 5 )) THEN call func(meke(imed),lemin,lemax,ebr10(1,imed),ebr11(1,imed)) ELSE IF(( which .EQ. 6 )) THEN call func(meke(imed),lemin,lemax,pbr10(1,imed),pbr11(1,imed)) ELSE IF(( which .EQ. 7 )) THEN call func(meke(imed),lemin,lemax,pbr20(1,imed),pbr21(1,imed)) ELSE IF(( which .EQ. 8 )) THEN call func(meke(imed),lemin,lemax,tmxs0(1,imed),tmxs1(1,imed)) ELSE IF(( which .EQ. 9 )) THEN call func(meke(imed),lemin,lemax,range_ep(0,1,imed),range_ep(1,1 * ,imed)) ELSE write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'Unknown electron data type ',which write(i_log,'(/a)') '***************** Quiting now.'
![Page 270: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/270.jpg)
call exit(1) END IF return end subroutine egs_get_photon_data(func,imed,which) implicit none integer*4 imed,which external func COMMON/PHOTIN/ EBINDA(7), GE0(7),GE1(7), GMFP0(200,7),GMFP1(200,7) *,GBR10(200,7),GBR11(200,7),GBR20(200,7),GBR21(200,7), RCO0(7),RCO1 *(7), RSCT0(100,7),RSCT1(100,7), COHE0(200,7),COHE1(200,7), DPMFP, *MPGEM(1,7), NGR(7) real*8 EBINDA, GE0,GE1, GMFP0,GMFP1, GBR10,GBR11, GBR20,GBR21, * RCO0,RCO1, RSCT0,RSCT1, COHE0,COHE1, DPMFP integer*4 * MPGEM, * NGR COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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 /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch real*8 lemin,lemax lemin = (1 - ge0(imed))/ge1(imed) lemax = (mge(imed) - ge0(imed))/ge1(imed) IF (( which .EQ. 1 )) THEN call func(mge(imed),lemin,lemax,gmfp0(1,imed),gmfp1(1,imed)) ELSE IF(( which .EQ. 2 )) THEN call func(mge(imed),lemin,lemax,gbr10(1,imed),gbr11(1,imed)) ELSE IF(( which .EQ. 3 )) THEN call func(mge(imed),lemin,lemax,gbr20(1,imed),gbr21(1,imed)) ELSE IF(( which .EQ. 4 )) THEN call func(mge(imed),lemin,lemax,cohe0(1,imed),cohe1(1,imed)) ELSE write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'Unknown photon data type ',which write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF return end
![Page 271: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/271.jpg)
subroutine egs_scale_xcc(imed,factor) implicit none integer*4 imed real*8 factor COMMON/ELECIN/ esig_e(7),psig_e(7), esige_max, psige_max, range_ep *(0:1,150,7), E_array(150,7), etae_ms0(150,7),etae_ms1(150,7),etap_ *ms0(150,7),etap_ms1(150,7),q1ce_ms0(150,7),q1ce_ms1(150,7),q1cp_ms *0(150,7),q1cp_ms1(150,7),q2ce_ms0(150,7),q2ce_ms1(150,7),q2cp_ms0( *150,7),q2cp_ms1(150,7),blcce0(150,7),blcce1(150,7), EKE0(7),EKE1(7 *), XR0(7),TEFF0(7),BLCC(7),XCC(7), ESIG0(150,7),ESIG1(150,7),PSIG0 *(150,7),PSIG1(150,7),EDEDX0(150,7),EDEDX1(150,7),PDEDX0(150,7),PDE *DX1(150,7),EBR10(150,7),EBR11(150,7),PBR10(150,7),PBR11(150,7),PBR *20(150,7),PBR21(150,7),TMXS0(150,7),TMXS1(150,7), expeke1(7), IUNR *ST(7),EPSTFL(7),IAPRIM(7), sig_ismonotone(0:1,7) real*8 esig_e, psig_e, esige_max, psige_max, range_ep, E_ar *ray, etae_ms0,etae_ms1, etap_ms0,etap_ms1, q1ce_ms0,q1ce_ms1, *q1cp_ms0,q1cp_ms1, q2ce_ms0,q2ce_ms1, q2cp_ms0,q2cp_ms1, blcce0 *,blcce1, expeke1, EKE0,EKE1, XR0, TEFF0, BLCC, XCC, ESIG0,E *SIG1, PSIG0,PSIG1, EDEDX0,EDEDX1, PDEDX0,PDEDX1, EBR10,EBR11, * PBR10,PBR11, PBR20,PBR21, TMXS0,TMXS1 integer*4 IUNRST, EPSTFL, IAPRIM logical sig_ismonotone COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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 IF (( imed .GT. 0 .AND. imed .LE. nmed )) THEN xcc(imed) = xcc(imed)*factor END IF return end subroutine egs_write_string(ounit,string) implicit none integer*4 ounit character*(*) string write(ounit,'(a,$)') string call flush(ounit) return end subroutine egs_swap_2(c) character c(2),tmp tmp=c(2) c(2)=c(1) c(1)=tmp return end subroutine egs_swap_4(c) character c(4),tmp tmp=c(4) c(4)=c(1) c(1)=tmp tmp=c(3)
![Page 272: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/272.jpg)
c(3)=c(2) c(2)=tmp return end subroutine set_spline(x,f,a,b,c,d,n) ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none integer*4 n real*8 x(n),f(n),a(n),b(n),c(n),d(n) integer*4 m1,m2,m,mr real*8 s,r m1 = 2 m2 = n-1 s = 0 DO 13551 m=1,m2 d(m) = x(m+1) - x(m) r = (f(m+1) - f(m))/d(m) c(m) = r - s s = r13551 CONTINUE13552 CONTINUE s=0 r=0 c(1)=0 c(n)=0 DO 13561 m=m1,m2 c(m) = c(m) + r*c(m-1) b(m) = 2*(x(m-1) - x(m+1)) - r*s s = d(m) r = s/b(m)13561 CONTINUE13562 CONTINUE mr = m2 DO 13571 m=m1,m2 c(mr) = (d(mr)*c(mr+1) - c(mr))/b(mr) mr = mr - 113571 CONTINUE13572 CONTINUE DO 13581 m=1,m2 s = d(m) r = c(m+1) - c(m) d(m) = r/s c(m) = 3*c(m) b(m) = (f(m+1)-f(m))/s - (c(m)+r)*s a(m) = f(m)13581 CONTINUE13582 CONTINUE return end real*8 function spline(s,x,a,b,c,d,n) ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none integer*4 n real*8 s,x(n),a(n),b(n),c(n),d(n) integer m_lower,m_upper,direction,m,ml,mu,mav real*8 q
![Page 273: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/273.jpg)
IF (( x(1) .GT. x(n) )) THEN direction = 1 m_lower = n m_upper = 0 ELSE direction = 0 m_lower = 0 m_upper = n END IF IF (( s .GE. x(m_upper + direction) )) THEN m = m_upper + 2*direction - 1 ELSE IF(( s .LE. x(m_lower+1-direction) )) THEN m = m_lower - 2*direction + 1 ELSE ml = m_lower mu = m_upper13591 IF(iabs(mu-ml).LE.1)GO TO 13592 mav = (ml+mu)/2 IF (( s .LT. x(mav) )) THEN mu = mav ELSE ml = mav END IF GO TO 1359113592 CONTINUE m = mu + direction - 1 END IF q = s - x(m) spline = a(m) + q*(b(m) + q*(c(m) + q*d(m))) return end subroutine prepare_alias_table(nsbin,xs_array,fs_array,ws_array,ib *in_array) ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none integer nsbin integer*4 ibin_array(nsbin) real*8 xs_array(0:nsbin),fs_array(0:nsbin),ws_array(nsbin) integer*4 i,j_l,j_h real*8 sum,aux sum = 0 DO 13601 i=1,nsbin aux = 0.5*(fs_array(i)+fs_array(i-1))*(xs_array(i)-xs_array(i-1) * ) IF((aux .LT. 1e-30))aux = 1e-30 ws_array(i) = -aux ibin_array(i) = 1 sum = sum + aux13601 CONTINUE13602 CONTINUE sum = sum/nsbin DO 13611 i=1,nsbin-1 DO 13621 j_h=1,nsbin IF (( ws_array(j_h) .LT. 0 )) THEN IF((abs(ws_array(j_h)) .GT. sum))GOTO 13630 END IF13621 CONTINUE
![Page 274: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/274.jpg)
13622 CONTINUE j_h = nsbin13630 CONTINUE DO 13631 j_l=1,nsbin IF (( ws_array(j_l) .LT. 0 )) THEN IF((abs(ws_array(j_l)) .LT. sum))GOTO 13640 END IF13631 CONTINUE13632 CONTINUE j_l = nsbin13640 aux = sum - abs(ws_array(j_l)) ws_array(j_h) = ws_array(j_h) + aux ws_array(j_l) = -ws_array(j_l)/sum ibin_array(j_l) = j_h IF((i .EQ. nsbin-1))ws_array(j_h) = 113611 CONTINUE13612 CONTINUE return end real*8 function alias_sample1(nsbin,xs_array,fs_array,ws_array,ibi *n_array) ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none integer nsbin integer*4 ibin_array(nsbin) real*8 xs_array(0:nsbin),fs_array(0:nsbin),ws_array(nsbin) common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 integer*4 j real*8 r1,r2,aj,x,dx,a,rnno1 IF((rng_seed .GT. 128))call ranmar_get r1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get r2 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 aj = 1 + r1*nsbin j = aj aj = aj - j IF((aj .GT. ws_array(j)))j = ibin_array(j) x = xs_array(j-1) dx = xs_array(j)-x IF (( fs_array(j-1) .GT. 0 )) THEN a = fs_array(j)/fs_array(j-1)-1 IF (( abs(a) .LT. 0.2 )) THEN rnno1 = 0.5*(1-r2)*a alias_sample1 = x + r2*dx*(1+rnno1*(1-r2*a)) ELSE alias_sample1 = x - dx/a*(1-sqrt(1+r2*a*(2+a))) END IF ELSE alias_sample1 = x + dx*sqrt(r2) END IF return
![Page 275: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/275.jpg)
end subroutine gauss_legendre(x1,x2,x,w,n) ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none integer*4 n real*8 x1,x2,x(n),w(n) real*8 eps,Pi parameter (eps = 3.D-14,Pi=3.141592654D0) integer*4 i,m,j real*8 xm,xl,z,z1,p1,p2,p3,pp m = (n + 1)/2 xm=0.5d0*(x2+x1) xl=0.5d0*(x2-x1) DO 13651 i=1,m z=cos(Pi*(i-.25d0)/(n+.5d0))13661 CONTINUE p1=1.d0 p2=0.d0 DO 13671 j=1,n p3 = p2 p2 = p1 p1=((2.d0*j-1.d0)*z*p2-(j-1.d0)*p3)/j13671 CONTINUE13672 CONTINUE pp=n*(z*p1-p2)/(z*z-1.d0) z1=z z=z1-p1/pp IF(((abs(z-z1) .LT. eps)))GO TO13662 GO TO 1366113662 CONTINUE x(i)=xm-xl*z x(n+1-i)=xm+xl*z w(i)=2.d0*xl/((1.d0-z*z)*pp*pp) w(n+1-i)=w(i)13651 CONTINUE13652 CONTINUE return end integer function lnblnk1(string) character*(*) string integer i DO 13681 i=len(string),1,-1 j = ichar(string(i:i)) IF (( j .EQ. 0 )) THEN lnblnk1 = i-1 return END IF IF (( j .NE. 9 .AND. j .NE. 10 .AND. j .NE. 11 .AND. j .NE. 12 . * AND. j .NE. 13 .AND. j .NE. 32 )) THEN lnblnk1 = i return END IF13681 CONTINUE13682 CONTINUE lnblnk1 = 0 return end
![Page 276: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/276.jpg)
real*8 FUNCTION ERF1(X) implicit none real*8 x double precision A(0:22,2) double precision CONST, BN,BN1,BN2, Y,FAC integer*4 N, K, NLIM(2) DATA A/ 1.0954712997776232 , -0.2891754011269890 , 0.1104563986337 *951 , -0.0412531882278565 , 0.0140828380706516 , -0.00432929544743 *14 , 0.0011982719015923 , -0.0002999729623532 , 0.0000683258603789 * , -0.0000142469884549 , 0.0000027354087728 , -0.0000004861912872 *, 0.0000000803872762 , -0.0000000124184183 , 0.0000000017995326 , *-0.0000000002454795 , 0.0000000000316251 , -0.0000000000038590 , 0 *.0000000000004472 , -0.0000000000000493 , 0.0000000000000052 , -0. *0000000000000005 , 0.0000000000000001 , 0.9750834237085559 , -0.02 *40493938504146 , 0.0008204522408804 , -0.0000434293081303 , 0.0000 *030184470340 , -0.0000002544733193 , 0.0000000248583530 , -0.00000 *00027317201 , 0.0000000003308472 , 0.0000000000001464 , -0.0000000 *000000244 , 0.0000000000000042 , -0.0000000000000008 , 0.000000000 *0000001 , 9*0.0 / DATA NLIM/ 22,16 / DATA CONST/ 1.128379167095513 / IF (( x .GT. 3 )) THEN y = 3/x k = 2 ELSE y = x/3 k = 1 END IF FAC = 2.0 * ( 2.0 * Y*Y - 1.0 ) BN1 = 0.0 BN = 0.0 DO 13691 n=NLIM(K),0,-1 BN2 = BN1 BN1 = BN BN = FAC * BN1 - BN2 + A(N,K)13691 CONTINUE13692 CONTINUE IF (( k .EQ. 1 )) THEN erf1 = CONST * Y * ( BN - BN1 ) ELSE erf1 = 1 - CONST * EXP(-X**2) * ( BN - BN2 + A(0,K) )/(4.0 * X) END IF RETURN end real*8 FUNCTION ZERO() implicit none integer*4 i real*8 x, xtemp x = 1.E-20 DO 13701 i=1,100 IF ((x .EQ. 0.0)) THEN GO TO13702 ELSE xtemp = x END IF x = x/1.E513701 CONTINUE13702 CONTINUE
![Page 277: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/277.jpg)
x = xtemp DO 13711 i=1,5 IF ((x .NE. 0.0)) THEN xtemp = x ELSE GO TO13712 END IF x = x/1013711 CONTINUE13712 CONTINUE x = xtemp DO 13721 i=2,10 IF ((x .NE. 0.0)) THEN xtemp = x ELSE GO TO13722 END IF x = x/i13721 CONTINUE13722 CONTINUE zero = xtemp return end character*512 function toUpper(a_string) character*(*) a_string character*512 the_string integer*4 cursor, i, lnblnk1 toUpper = a_string the_string = a_string DO 13731 i=1,lnblnk1(the_string) cursor=ICHAR(the_string(i:i)) IF (((cursor.GE.97).AND.(cursor.LE.122))) THEN cursor=cursor-32 toUpper(i:i)=CHAR(cursor) END IF13731 CONTINUE13732 CONTINUE return end#ifdef HAVE_C_COMPILER integer*4 function egs_create_lockfile(flag) integer*4 flag common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch character*512 fname integer*4 i,lnblnk1,l,istat DO 13741 i=1,len(fname) fname(i:i) = ' '
![Page 278: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/278.jpg)
13741 CONTINUE13742 CONTINUE fname = egs_home(:lnblnk1(egs_home)) // user_code(:lnblnk1(user_co *de)) // '/' // output_file(:lnblnk1(output_file)) // '.lock' l = lnblnk1(fname)+1 fname(l:l) = char(0) call egs_create_control_file(fname,istat) IF (( istat .NE. 0 .AND. flag .EQ. 1 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'Failed to create a lock file named ',fname(:lnbl * nk1(fname)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF egs_create_lockfile = istat return end integer*4 function egs_open_lockfile(flag) integer*4 flag common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch character*512 fname integer*4 i,lnblnk1,l,istat DO 13751 i=1,len(fname) fname(i:i) = ' '13751 CONTINUE13752 CONTINUE fname = egs_home(:lnblnk1(egs_home)) // user_code(:lnblnk1(user_co *de)) // '/' // output_file(:lnblnk1(output_file)) // '.lock' l = lnblnk1(fname)+1 fname(l:l) = char(0) call egs_open_control_file(fname,istat) IF (( istat .NE. 0 .AND. flag .EQ. 1 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'Failed to open the lock file named ',fname(:lnbl * nk1(fname)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF egs_open_lockfile = istat return end subroutine egs_remove_lockfile(istat) integer*4 istat common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat
![Page 279: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/279.jpg)
*a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch character*512 fname integer*4 i,lnblnk1,l DO 13761 i=1,len(fname) fname(i:i) = ' '13761 CONTINUE13762 CONTINUE fname = egs_home(:lnblnk1(egs_home)) // user_code(:lnblnk1(user_co *de)) // '/' // output_file(:lnblnk1(output_file)) // '.lock' l = lnblnk1(fname)+1 fname(l:l) = char(0) call egs_remove_file(fname,istat) return end subroutine egs_pjob_control(ncase,n_run,n_left,n_tot,sum,sum2,res, *dres) implicit none integer*8 ncase,n_run,n_tot real*8 sum,sum2,res,dres common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch common/my_times/ t_elapsed, t_cpu, t_first real*8 t_elapsed, t_cpu integer t_first(8) real egs_tot_time,egs_etime integer*8 n_last,n_left,nn_tot integer t_dum(8) integer*4 i,lnblnk1,n_write,n_read,istat,n_job integer*4 egs_create_lockfile, egs_open_lockfile real*8 tmp,tmp2 logical first_time character control_string*256 data first_time/.true./ save first_time,n_last IF (( n_parallel .LE. 0 )) THEN n_run = ncase return END IF IF((first_time))n_last = 0 DO 13771 i=1,len(control_string) control_string(i:i) = ' '
![Page 280: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/280.jpg)
13771 CONTINUE13772 CONTINUE n_run = ncase/n_parallel/10 n_left = ncase IF (( first_time )) THEN IF((n_run .GT. n_left))n_run = n_left n_left = ncase - n_run IF (( i_parallel .EQ. first_parallel )) THEN istat = egs_create_lockfile(1) IF (( n_tot .GT. 1 )) THEN res = sum/n_tot dres = sum2/n_tot - res*res IF (( res .GT. 0 .AND. dres .GT. 0 )) THEN dres = sqrt(dres/(n_tot-1))/res*100 ELSE dres = 99.9 END IF ELSE res = 0 dres = 99.9 END IF write(control_string,'(2i15,i4,2(1pe16.8),1pe13.5,0pf7.2,2x,8i *5)') n_left,n_tot,1,sum,sum2,res,dres,(t_first(i),i=1,8) n_write = lnblnk1(control_string) + 1 call egs_write_control_file(control_string,n_write,istat) IF (( istat .NE. n_write )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'job 1: failed to write to lock file ',n_writ * e,istat write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF call egs_unlock_control_file(istat) IF (( istat .NE. 0 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'job 1: failed to unlock the file ',istat write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF first_time = .false. n_max_parallel = 1 n_last = n_run return END IF istat = egs_open_lockfile(1) END IF call egs_rewind_control_file(istat) IF (( istat .NE. 0 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'job ',i_parallel,': failed to rewind or lock the * control ', 'file', istat write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF n_read = len(control_string) call egs_read_control_file(control_string,n_read,istat) read(control_string,*,err=13780) n_left,nn_tot,n_job,tmp,tmp2, res *,dres,(t_dum(i),i=1,8)
![Page 281: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/281.jpg)
nn_tot = nn_tot + n_last tmp = tmp + sum tmp2 = tmp2 + sum2 IF (( first_time )) THEN first_time = .false. n_job = n_job + 1 nn_tot = nn_tot + n_tot END IF n_tot = nn_tot IF (( n_tot .GT. 1 )) THEN res = tmp/n_tot dres = tmp2/n_tot - res*res IF (( res .GT. 0 .AND. dres .GT. 0 )) THEN dres = sqrt(dres/(n_tot-1))/res*100 ELSE dres = 99.9 END IF ELSE res = 0 dres = 99.9 END IF IF (( n_run .GT. n_left )) THEN n_run = n_left n_left = 0 ELSE n_left = n_left - n_run END IF n_last = n_run DO 13791 i=1,len(control_string) control_string(i:i) = ' '13791 CONTINUE13792 CONTINUE write(control_string,'(2i15,i4,2(1pe16.8),1pe13.5,0pf7.2,2x,8i5)') * n_left,n_tot,n_job,tmp,tmp2,res,dres,(t_dum(i),i=1,8) call egs_rewind_control_file(istat) IF (( istat .NE. 0 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'job ',i_parallel,': failed to rewind or lock the * control ', 'file', istat write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF n_write = lnblnk1(control_string) + 1 call egs_write_control_file(control_string,n_write,istat) IF (( istat .NE. n_write )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'job ',i_parallel,': failed to write to lock file * ', n_write,istat write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF call egs_unlock_control_file(istat) IF (( istat .NE. 0 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'job ',i_parallel,': failed to unlock the file ', * istat write(i_log,'(/a)') '***************** Quiting now.' call exit(1)
![Page 282: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/282.jpg)
END IF IF((n_job .GT. n_max_parallel))n_max_parallel = n_job return13780 write(i_log,'(/a)') '***************** Error: ' write(i_log,'(a,/a)') 'Failed to read from job control file: got ' *, control_string(:lnblnk1(control_string)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1) return end subroutine egs_pjob_finish(n_job) implicit none integer*4 n_job common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch common/my_times/ t_elapsed, t_cpu, t_first real*8 t_elapsed, t_cpu integer t_first(8) real egs_tot_time,egs_etime integer*4 istat,i,lnblnk1,n_read,n_write integer*8 n_left,n_tot integer t_start(8),t_end(8) real*8 tmp,tmp2,res,dres,t_run real egs_time_diff character control_string*256 call egs_rewind_control_file(istat) IF (( istat .NE. 0 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'job ',i_parallel,': failed to rewind or lock the * control ', 'file', istat write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF n_read = len(control_string) call egs_read_control_file(control_string,n_read,istat) read(control_string,*,end=13800,err=13800) n_left,n_tot,n_job,tmp, *tmp2,res,dres,(t_start(i),i=1,8) n_job = n_job - 1 IF (( n_job .GT. 0 )) THEN DO 13811 i=1,len(control_string) control_string(i:i) = ' '13811 CONTINUE13812 CONTINUE write(control_string,'(2i15,i4,2(1pe16.8),1pe13.5,0pf7.2,2x,8i5) *') n_left,n_tot,n_job,tmp,tmp2,res,dres,(t_start(i),i=1,8) call egs_rewind_control_file(istat) IF (( istat .NE. 0 )) THEN write(i_log,'(/a)') '***************** Error: '
![Page 283: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/283.jpg)
write(i_log,*) 'job ',i_parallel,': failed to rewind or lock t *he ', 'control file, error was:', istat write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF n_write = lnblnk1(control_string) + 1 call egs_write_control_file(control_string,n_write,istat) IF (( istat .NE. n_write )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'job ',i_parallel,': failed to write to lock fi *le ', n_write,istat write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF call egs_unlock_control_file(istat) call egs_close_control_file(istat) return END IF call egs_close_control_file(istat) call egs_remove_lockfile(istat) i_parallel = 0 call egs_open_units(.false.) call egs_date_and_time(t_end) t_run = egs_time_diff(t_start,t_end) write(i_log,'(/a/,a,t55,i3/,a,t55,i3/,a,f9.1,a,f9.4,a/,a//)') '*** ************** finished parallel execution ******************', ' n *umber of parallel jobs requested: ',n_parallel, ' max. number of j *obs executing simultaneously: ',n_max_parallel, ' elapsed time sin *ce first job started: ',t_run,' s (',t_run/3600,' h)', '********** ******************************************************' return13800 CONTINUE write(i_log,'(/a)') '***************** Error: ' write(i_log,'(a,/a)') 'In egs_pjob_finish: failed to read from con *trol string ', control_string(:lnblnk1(control_string)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1) return end#endif ! Copyright National Research Council of Canada, 2000. ! All rights reserved. SUBROUTINE ANNIH ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none COMMON/QDEBUG/QDEBUG LOGICAL QDEBUG COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000 *),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold COMMON/UPHIOT/THETA,SINTHE,COSTHE,SINPHI, COSPHI,PI,TWOPI,PI5D2 real*8 THETA, SINTHE, COSTHE, SINPHI, COSPHI, PI,TWOPI,PI5D2 COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2
![Page 284: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/284.jpg)
real*8 RM integer*4 MEDIUM, MEDOLD common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 common/egs_vr/ e_max_rr, prob_RR, nbr_split, i_play_RR, i_ *survived_RR, * n_RR_warning, i_do_rr real*8 e_max_rr,prob_RR integer*4 nbr_split,i_play_RR,i_survived_RR,n_RR_warning integer*2 i_do_rr common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch DOUBLE PRECISION PAVIP, PESG1, PESG2 real*8 AVIP, A, G,T,P, POT, * * EP0, WSAMP, * RNNO01, * RNNO02, * EP, * REJF, ESG1, * ESG2, * aa,bb,cc,sinpsi,sindel,cosdel,us,vs,cphi,sphi integer*4 * ibr real*8 xphi,xphi2,yphi,yphi2,rhophi2 integer*4 ip NPold = NP IF (( nbr_split .LE. 0 )) THEN return END IF PAVIP=E(NP)+PRM AVIP=PAVIP A=AVIP/RM G=A-1.0 T=G-1.0 P=SQRT(A*T) POT=P/T EP0=1.0/(A+P) WSAMP=LOG((1.0-EP0)/EP0) aa = u(np) bb = v(np) cc = w(np) sinpsi = aa*aa + bb*bb IF (( sinpsi .GT. 1e-20 )) THEN sinpsi = sqrt(sinpsi)
![Page 285: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/285.jpg)
sindel = bb/sinpsi cosdel = aa/sinpsi END IF IF (( nbr_split .GT. 1 )) THEN wt(np) = wt(np)/nbr_split END IF DO 13821 ibr=1,nbr_split IF (( np+1 .GT. 10000 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(//a,i6,a//)') ' Stack overflow in ANNIH! np = ', * np+1, ' Increase $MXSTACK and try again' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF13831 CONTINUE IF((rng_seed .GT. 128))call ranmar_get RNNO01 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 EP=EP0*EXP(RNNO01*WSAMP) IF((rng_seed .GT. 128))call ranmar_get RNNO02 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 REJF = 1 - (EP*A-1)**2/(EP*(A*A-2)) IF(((RNNO02 .LE. REJF)))GO TO13832 GO TO 1383113832 CONTINUE ESG1=AVIP*EP PESG1=ESG1 E(NP)=PESG1 IQ(NP)=0 IF (( ibr .EQ. 1 )) THEN ip = npold ELSE ip = np-1 END IF X(np)=X(ip) Y(np)=Y(ip) Z(np)=Z(ip) IR(np)=IR(ip) WT(np)=WT(ip) DNEAR(np)=DNEAR(ip) LATCH(np)=LATCH(ip) COSTHE=MIN(1.0,(ESG1-RM)*POT/ESG1) SINTHE=SQRT(1.0-COSTHE*COSTHE)13841 CONTINUE IF((rng_seed .GT. 128))call ranmar_get xphi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 xphi = 2*xphi - 1 xphi2 = xphi*xphi IF((rng_seed .GT. 128))call ranmar_get yphi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 yphi2 = yphi*yphi rhophi2 = xphi2 + yphi2 IF(rhophi2.LE.1)GO TO13842 GO TO 1384113842 CONTINUE
![Page 286: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/286.jpg)
rhophi2 = 1/rhophi2 cphi = (xphi2 - yphi2)*rhophi2 sphi = 2*xphi*yphi*rhophi2 IF (( sinpsi .GE. 1e-10 )) THEN us = sinthe*cphi vs = sinthe*sphi u(np) = cc*cosdel*us - sindel*vs + aa*costhe v(np) = cc*sindel*us + cosdel*vs + bb*costhe w(np) = cc*costhe - sinpsi*us ELSE u(np) = sinthe*cphi v(np) = sinthe*sphi w(np) = cc*costhe END IF np = np + 1 PESG2=PAVIP-PESG1 esg2 = pesg2 e(np) = pesg2 iq(np) = 0 X(np)=X(np-1) Y(np)=Y(np-1) Z(np)=Z(np-1) IR(np)=IR(np-1) WT(np)=WT(np-1) DNEAR(np)=DNEAR(np-1) LATCH(np)=LATCH(np-1) COSTHE=MIN(1.0,(ESG2-RM)*POT/ESG2) SINTHE=-SQRT(1.0-COSTHE*COSTHE) IF (( sinpsi .GE. 1e-10 )) THEN us = sinthe*cphi vs = sinthe*sphi u(np) = cc*cosdel*us - sindel*vs + aa*costhe v(np) = cc*sindel*us + cosdel*vs + bb*costhe w(np) = cc*costhe - sinpsi*us ELSE u(np) = sinthe*cphi v(np) = sinthe*sphi w(np) = cc*costhe END IF np = np + 113821 CONTINUE13822 CONTINUE np = np-1 RETURN END SUBROUTINE ANNIH_AT_REST ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none COMMON/QDEBUG/QDEBUG LOGICAL QDEBUG COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000 *),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm,
![Page 287: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/287.jpg)
*i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD common/egs_vr/ e_max_rr, prob_RR, nbr_split, i_play_RR, i_ *survived_RR, * n_RR_warning, i_do_rr real*8 e_max_rr,prob_RR integer*4 nbr_split,i_play_RR,i_survived_RR,n_RR_warning integer*2 i_do_rr common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch real*8 costhe,sinthe,cphi,sphi integer*4 ibr,ip real*8 xphi,xphi2,yphi,yphi2,rhophi2 NPold = NP IF (( np+2*nbr_split-1 .GT. 10000 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(//,a,a,a,/,a,i6,a,i6,/,a)') ' In subroutine ','ANN *IH_AT_REST', ' stack size exceeded! ',' $MXSTACK = ',10000,' np = *',np+2*nbr_split-1, ' Increase $MXSTACK and try again ' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF IF (( nbr_split .GT. 1 )) THEN wt(np) = wt(np)/nbr_split END IF DO 13851 ibr=1,nbr_split IF((rng_seed .GT. 128))call ranmar_get costhe = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 costhe = 2*costhe-1 sinthe = sqrt(max(0.0,(1-costhe)*(1+costhe)))13861 CONTINUE IF((rng_seed .GT. 128))call ranmar_get xphi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 xphi = 2*xphi - 1 xphi2 = xphi*xphi IF((rng_seed .GT. 128))call ranmar_get yphi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 yphi2 = yphi*yphi rhophi2 = xphi2 + yphi2
![Page 288: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/288.jpg)
IF(rhophi2.LE.1)GO TO13862 GO TO 1386113862 CONTINUE rhophi2 = 1/rhophi2 cphi = (xphi2 - yphi2)*rhophi2 sphi = 2*xphi*yphi*rhophi2 e(np) = prm iq(np) = 0 IF (( ibr .EQ. 1 )) THEN ip = npold ELSE ip = np-1 END IF X(np)=X(ip) Y(np)=Y(ip) Z(np)=Z(ip) IR(np)=IR(ip) WT(np)=WT(ip) DNEAR(np)=DNEAR(ip) LATCH(np)=LATCH(ip) u(np) = sinthe*cphi v(np) = sinthe*sphi w(np) = costhe np = np+1 e(np) = prm iq(np) = 0 X(np)=X(np-1) Y(np)=Y(np-1) Z(np)=Z(np-1) IR(np)=IR(np-1) WT(np)=WT(np-1) DNEAR(np)=DNEAR(np-1) LATCH(np)=LATCH(np-1) u(np) = -u(np-1) v(np) = -v(np-1) w(np) = -w(np-1) np = np+113851 CONTINUE13852 CONTINUE np = np-1 return end SUBROUTINE BHABHA ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none COMMON/QDEBUG/QDEBUG LOGICAL QDEBUG COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000 *),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL COMMON/UPHIOT/THETA,SINTHE,COSTHE,SINPHI, COSPHI,PI,TWOPI,PI5D2 real*8 THETA, SINTHE, COSTHE, SINPHI, COSPHI, PI,TWOPI,PI5D2
![Page 289: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/289.jpg)
COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 common/egs_vr/ e_max_rr, prob_RR, nbr_split, i_play_RR, i_ *survived_RR, * n_RR_warning, i_do_rr real*8 e_max_rr,prob_RR integer*4 nbr_split,i_play_RR,i_survived_RR,n_RR_warning integer*2 i_do_rr common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch DOUBLE PRECISION PEIP, PEKIN, PEKSE2, PESE1, PESE2, H1, DCOS *TH real*8 EIP, EKIN, T0, E0, E02, YY, Y2,YP,YP2, BETA2, EP0, *EP0C, B1,B2,B3,B4, RNNO03,RNNO04, BR, REJF2, ESE1, ESE2 NPold = NP PEIP=E(NP) EIP=PEIP PEKIN=PEIP-PRM EKIN=PEKIN T0=EKIN/RM E0=T0+1. YY=1./(T0+2.) E02=E0*E0 BETA2=(E02-1.)/E02 EP0=TE(MEDIUM)/EKIN EP0C=1.-EP0 Y2=YY*YY YP=1.-2.*YY YP2=YP*YP B4=YP2*YP B3=B4+YP2 B2=YP*(3.+Y2) B1=2.-Y213871 CONTINUE IF((rng_seed .GT. 128))call ranmar_get RNNO03 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 BR=EP0/(1.-EP0C*RNNO03) IF((rng_seed .GT. 128))call ranmar_get RNNO04 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1
![Page 290: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/290.jpg)
REJF2=(1.0-BETA2*BR*(B1-BR*(B2-BR*(B3-BR*B4)))) IF((RNNO04.LE.REJF2))GO TO13872 GO TO 1387113872 CONTINUE IF (( np+1 .GT. 10000 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(//,a,a,a,/,a,i6,a,i6,/,a)') ' In subroutine ','BHA *BHA', ' stack size exceeded! ',' $MXSTACK = ',10000,' np = ',np+1, * ' Increase $MXSTACK and try again ' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF IF ((BR.LT.0.5)) THEN IQ(NP+1)=-1 ELSE IQ(NP)=-1 IQ(NP+1)=1 BR=1.-BR END IF BR=max(BR,0.0) PEKSE2=BR*EKIN PESE1=PEIP-PEKSE2 PESE2=PEKSE2+PRM ESE1=PESE1 ESE2=PESE2 E(NP)=PESE1 E(NP+1)=PESE2 H1=(PEIP+PRM)/PEKIN DCOSTH=MIN(1.0D0,H1*(PESE1-PRM)/(PESE1+PRM)) SINTHE=DSQRT(1.D0-DCOSTH) COSTHE=DSQRT(DCOSTH) CALL UPHI(2,1) NP=NP+1 DCOSTH=H1*(PESE2-PRM)/(PESE2+PRM) SINTHE=-DSQRT(1.D0-DCOSTH) COSTHE=DSQRT(DCOSTH) CALL UPHI(3,2) RETURN END SUBROUTINE BREMS ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none COMMON/QDEBUG/QDEBUG LOGICAL QDEBUG COMMON/BREMPR/ DL1(8,7),DL2(8,7),DL3(8,7),DL4(8,7),DL5(8,7),DL6(8, *7), ALPHI(2,7),BPAR(2,7),DELPOS(2,7), WA(7,50),PZ(7,50),ZELEM(7,50 *),RHOZ(7,50), PWR2I(50), DELCM(7),ZBRANG(7),LZBRANG(7),NNE(7), IBR *DST,IPRDST,ibr_nist,pair_nrc,itriplet, ASYM(7,50,2) CHARACTER*4 ASYM real*8 DL1,DL2,DL3,DL4,DL5,DL6, ALPHI, BPAR, DELPOS, WA, PZ, * ZELEM, RHOZ, PWR2I, DELCM, ZBRANG, LZBRANG integer*4 NNE, IBRDST, IPRDST, ibr_nist, itriplet, pair_nrc COMMON/EPCONT/EDEP,TSTEP,TUSTEP,USTEP,TVSTEP,VSTEP, RHOF,EOLD,ENEW *,EKE,ELKE,GLE,E_RANGE, x_final,y_final,z_final, u_final,v_final,w_ *final, IDISC,IROLD,IRNEW,IAUSFL(29) DOUBLE PRECISION EDEP real*8 TSTEP, TUSTEP, USTEP, VSTEP, TVSTEP, RHOF, EOLD, ENE
![Page 291: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/291.jpg)
*W, EKE, ELKE, GLE, E_RANGE, x_final,y_final,z_final, u_final, *v_final,w_final integer*4 IDISC, IROLD, IRNEW, IAUSFL common/nist_brems/ nb_fdata(0:50,100,7), nb_xdata(0:50,100,7), nb_ *wdata(50,100,7), nb_idata(50,100,7), nb_emin(7),nb_emax(7), nb_lem *in(7),nb_lemax(7), nb_dle(7),nb_dlei(7), log_ap(7) real*8 nb_fdata,nb_xdata,nb_wdata,nb_emin,nb_emax,nb_lemin,nb_lema *x, nb_dle,nb_dlei,log_ap integer*4 nb_idata COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000 *),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL COMMON/UPHIOT/THETA,SINTHE,COSTHE,SINPHI, COSPHI,PI,TWOPI,PI5D2 real*8 THETA, SINTHE, COSTHE, SINPHI, COSPHI, PI,TWOPI,PI5D2 COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 common/egs_vr/ e_max_rr, prob_RR, nbr_split, i_play_RR, i_ *survived_RR, * n_RR_warning, i_do_rr real*8 e_max_rr,prob_RR integer*4 nbr_split,i_play_RR,i_survived_RR,n_RR_warning integer*2 i_do_rr common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch DOUBLE PRECISION PEIE, PESG, PESE real*8 EIE, EKIN, brmin, waux, aux, r1, ajj, alias_sample1, * RNNO06, RNNO07, BR, ESG, ESE, DELTA, phi1, phi2, REJF real*8 a,b,c, sinpsi, sindel, cosdel *, us, vs, * ztarg, * tteie, beta, * y2max, * y2maxi, tt *ese, rjarg1,rjarg2,rjarg3,rej *min,rejmid,rejmax,rejtop,rejtst, * esedei, y2tst,
![Page 292: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/292.jpg)
* y2tst1, * rtest, * xphi,yphi,xphi2,yphi2,rhophi2,cphi,sph *i integer*4 * L,L1,ibr,jj,j real*8 z2max,z2maxi,aux1,aux3,aux4,aux5,aux2,weight IF((nbr_split .LT. 1))return NPold = NP PEIE=E(NP) EIE=PEIE weight = wt(np)/nbr_split IF ((EIE.LT.50.0)) THEN L=1 ELSE L=3 END IF L1 = L+1 ekin = peie-prm brmin = ap(medium)/ekin waux = elke - log_ap(medium) IF (( ibrdst .GE. 0 )) THEN a = u(np) b = v(np) c = w(np) sinpsi = a*a + b*b IF (( sinpsi .GT. 1e-20 )) THEN sinpsi = sqrt(sinpsi) sindel = b/sinpsi cosdel = a/sinpsi END IF ztarg = zbrang(medium) tteie = eie/rm beta = sqrt((tteie-1)*(tteie+1))/tteie y2max = 2*beta*(1+beta)*tteie*tteie y2maxi = 1/y2max IF (( ibrdst .EQ. 1 )) THEN z2max = y2max+1 z2maxi = sqrt(z2max) END IF END IF IF (( ibr_nist .GE. 1 )) THEN ajj = 1 + (waux + log_ap(medium) - nb_lemin(medium))*nb_dlei(med * ium) jj = ajj ajj = ajj - jj IF (( jj .GT. 100 )) THEN jj = 100 ajj = -1 END IF END IF DO 13881 ibr=1,nbr_split IF (( ibr_nist .GE. 1 )) THEN IF (( ekin .GT. nb_emin(medium) )) THEN IF((rng_seed .GT. 128))call ranmar_get r1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( r1 .LT. ajj )) THEN
![Page 293: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/293.jpg)
j = jj+1 ELSE j = jj END IF br = alias_sample1(50,nb_xdata(0,j,medium), nb_fdata(0,j,med * ium), nb_wdata(1,j,medium),nb_idata(1,j,medium)) ELSE IF((rng_seed .GT. 128))call ranmar_get br = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 END IF esg = ap(medium)*exp(br*waux) pesg = esg pese = peie - pesg ese = pese ELSE13891 CONTINUE IF((rng_seed .GT. 128))call ranmar_get rnno06 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get rnno07 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 br = brmin*exp(rnno06*waux) esg = ekin*br pesg = esg pese = peie - pesg ese = pese delta = esg/eie/ese*delcm(medium) aux = ese/eie IF (( delta .LT. 1 )) THEN phi1 = dl1(l,medium)+delta*(dl2(l,medium)+delta*dl3(l,medi * um)) phi2 = dl1(l1,medium)+delta*(dl2(l1,medium)+ delta*dl3(l1, * medium)) ELSE phi1 = dl4(l,medium)+dl5(l,medium)*log(delta+dl6(l,medium) * ) phi2 = phi1 END IF rejf = (1+aux*aux)*phi1 - 2*aux*phi2/3 IF(((rnno07 .LT. rejf)))GO TO13892 GO TO 1389113892 CONTINUE END IF np=np+1 IF (( np .GT. 10000 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(//a,i6,a//)') ' Stack overflow in BREMS! np = ', * np+1, ' Increase $MXSTACK and try again' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF e(np) = pesg iq(np) = 0 X(np)=X(np-1) Y(np)=Y(np-1) Z(np)=Z(np-1)
![Page 294: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/294.jpg)
IR(np)=IR(np-1) WT(np)=WT(np-1) DNEAR(np)=DNEAR(np-1) LATCH(np)=LATCH(np-1) wt(np) = weight IF (( ibrdst .LT. 0 )) THEN u(np) = u(npold) v(np) = v(npold) w(np) = w(npold) ELSE IF (( ibrdst .EQ. 1 )) THEN ttese = ese/rm esedei = ttese/tteie rjarg1 = 1+esedei*esedei rjarg2 = rjarg1 + 2*esedei aux = 2*ese*tteie/esg aux = aux*aux aux1 = aux*ztarg IF (( aux1 .GT. 10 )) THEN rjarg3 = lzbrang(medium) + (1-aux1)/aux1**2 ELSE rjarg3 = log(aux/(1+aux1)) END IF rejmax = rjarg1*rjarg3-rjarg213901 CONTINUE IF((rng_seed .GT. 128))call ranmar_get y2tst = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get rtest = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 aux3 = z2maxi/(y2tst+(1-y2tst)*z2maxi) rtest = rtest*aux3*rejmax y2tst = aux3**2-1 y2tst1 = esedei*y2tst/aux3**4 aux4 = 16*y2tst1-rjarg2 aux5 = rjarg1-4*y2tst1 IF((rtest .LT. aux4 + aux5*rjarg3))GO TO13902 aux2 = log(aux/(1+aux1/aux3**4)) rejtst = aux4+aux5*aux2 IF(((rtest .LT. rejtst )))GO TO13902 GO TO 1390113902 CONTINUE ELSE IF((rng_seed .GT. 128))call ranmar_get y2tst = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 y2tst = y2tst/(1-y2tst+y2maxi) END IF costhe = 1 - 2*y2tst*y2maxi sinthe = sqrt(max((1-costhe)*(1+costhe),0.0))13911 CONTINUE IF((rng_seed .GT. 128))call ranmar_get xphi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 xphi = 2*xphi - 1 xphi2 = xphi*xphi IF((rng_seed .GT. 128))call ranmar_get
![Page 295: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/295.jpg)
yphi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 yphi2 = yphi*yphi rhophi2 = xphi2 + yphi2 IF(rhophi2.LE.1)GO TO13912 GO TO 1391113912 CONTINUE rhophi2 = 1/rhophi2 cphi = (xphi2 - yphi2)*rhophi2 sphi = 2*xphi*yphi*rhophi2 IF (( sinpsi .GE. 1e-10 )) THEN us = sinthe*cphi vs = sinthe*sphi u(np) = c*cosdel*us - sindel*vs + a*costhe v(np) = c*sindel*us + cosdel*vs + b*costhe w(np) = c*costhe - sinpsi*us ELSE u(np) = sinthe*cphi v(np) = sinthe*sphi w(np) = c*costhe END IF END IF13881 CONTINUE13882 CONTINUE e(npold) = pese RETURN END SUBROUTINE COMPT ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none common/compton_data/ iz_array(1538), be_array(1538), Jo_array(15 *38), erfJo_array(1538), ne_array(1538), shn_array(1538), *shell_array(100,7), eno_array(100,7), eno_atbin_array(100,7), n_sh *ell(7), radc_flag, ibcmp integer*4 iz_array,ne_array,shn_array,eno_atbin_array, shell_array *,n_shell,radc_flag real*8 be_array,Jo_array,erfJo_array,eno_array integer*2 ibcmp COMMON/QDEBUG/QDEBUG LOGICAL QDEBUG COMMON/EPCONT/EDEP,TSTEP,TUSTEP,USTEP,TVSTEP,VSTEP, RHOF,EOLD,ENEW *,EKE,ELKE,GLE,E_RANGE, x_final,y_final,z_final, u_final,v_final,w_ *final, IDISC,IROLD,IRNEW,IAUSFL(29) DOUBLE PRECISION EDEP real*8 TSTEP, TUSTEP, USTEP, VSTEP, TVSTEP, RHOF, EOLD, ENE *W, EKE, ELKE, GLE, E_RANGE, x_final,y_final,z_final, u_final, *v_final,w_final integer*4 IDISC, IROLD, IRNEW, IAUSFL COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000 *),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL COMMON/UPHIOT/THETA,SINTHE,COSTHE,SINPHI, COSPHI,PI,TWOPI,PI5D2
![Page 296: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/296.jpg)
real*8 THETA, SINTHE, COSTHE, SINPHI, COSPHI, PI,TWOPI,PI5D2 COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 common/egs_vr/ e_max_rr, prob_RR, nbr_split, i_play_RR, i_ *survived_RR, * n_RR_warning, i_do_rr real*8 e_max_rr,prob_RR integer*4 nbr_split,i_play_RR,i_survived_RR,n_RR_warning integer*2 i_do_rr common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch DOUBLE PRECISION PEIG, PESG, PESE real*8 ko, broi, broi2, bro, bro1, alph1, alph2, alpha, rn *no15,rnno16,rnno17,rnno18,rnno19, br, temp, rejf3, rejmax, Uj *, Jo, br2, fpz,fpz1, qc, qc2, af, Fmax, frej, eta_incoh, e *ta, aux,aux1,aux2,aux3,aux4, pzmax, pz, pz2, rnno_RR integer*4 irl, i, j, iarg, ip logical first_time integer*4 ibcmpl NPold = NP peig=E(NP) ko = peig/rm broi = 1 + 2*ko irl = ir(np) first_time = .true. ibcmpl = ibcmp13920 CONTINUE IF (( ibcmpl .GT. 0 )) THEN IF((rng_seed .GT. 128))call ranmar_get rnno17 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 rnno17 = 1 + rnno17*n_shell(medium) i = int(rnno17) IF((rnno17 .GT. eno_array(i,medium)))i = eno_atbin_array(i,mediu * m) j = shell_array(i,medium) Uj = be_array(j) IF (( ko .LE. Uj )) THEN IF (( ibcmpl .EQ. 1 )) THEN goto 13930 ELSE
![Page 297: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/297.jpg)
goto 13920 END IF END IF Jo = Jo_array(j) END IF13940 CONTINUE IF (( ko .GT. 2 )) THEN IF (( first_time )) THEN broi2 = broi*broi alph1 = Log(broi) bro = 1/broi alph2 = ko*(broi+1)*bro*bro alpha = alph1+alph2 END IF13951 CONTINUE IF((rng_seed .GT. 128))call ranmar_get rnno15 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get rnno16 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( rnno15*alpha .LT. alph1 )) THEN br = Exp(alph1*rnno16)*bro ELSE br = Sqrt(rnno16*broi2 + (1-rnno16))*bro END IF temp = (1-br)/(ko*br) sinthe = Max(0.,temp*(2-temp)) aux = 1+br*br rejf3 = aux - br*sinthe IF((rng_seed .GT. 128))call ranmar_get rnno19 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rnno19*aux.le.rejf3))GO TO13952 GO TO 1395113952 CONTINUE ELSE IF (( first_time )) THEN bro = 1./broi bro1 = 1 - bro rejmax = broi + bro END IF13961 CONTINUE IF((rng_seed .GT. 128))call ranmar_get rnno15 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get rnno16 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 br = bro + bro1*rnno15 temp = (1-br)/(ko*br) sinthe = Max(0.,temp*(2-temp)) rejf3 = 1 + br*br - br*sinthe IF((rnno16*br*rejmax.le.rejf3))GO TO13962 GO TO 1396113962 CONTINUE END IF first_time = .false.
![Page 298: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/298.jpg)
IF ((br .LT. bro .OR. br .GT. 1)) THEN IF (( br .LT. 0.99999/broi .OR. br .GT. 1.00001 )) THEN write(i_log,'(/a)') '***************** Warning: ' write(i_log,*) ' sampled br outside of allowed range! ',ko,1./ * broi,br END IF goto 13940 END IF costhe = 1 - temp IF (( ibcmp .EQ. 0 )) THEN Uj = 0 goto 13970 END IF br2 = br*br aux = ko*(ko-Uj)*temp aux1 = 2*aux + Uj*Uj pzmax = aux - Uj IF (( pzmax .LT. 0 .AND. pzmax*pzmax .GE. aux1 )) THEN IF (( ibcmpl .EQ. 1 )) THEN goto 13930 ELSE goto 13920 END IF END IF pzmax = pzmax/sqrt(aux1) qc2 = 1 + br*br - 2*br*costhe qc = sqrt(qc2) IF (( pzmax .GT. 1 )) THEN pzmax = 1 af = 0 Fmax = 1 fpz = 1 goto 13980 END IF aux3 = 1 + 2*Jo*abs(pzmax) aux4 = 0.5*(1-aux3*aux3) fpz = 0.5*exp(aux4) af = qc*(1+br*(br-costhe)/qc2) IF (( af .LT. 0 )) THEN IF((pzmax .GT. 0))fpz = 1 - fpz IF((rng_seed .GT. 128))call ranmar_get eta_incoh = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( eta_incoh .GT. fpz )) THEN IF (( ibcmpl .EQ. 1 )) THEN goto 13930 ELSE goto 13920 END IF END IF af = 0 Fmax = 1 goto 13980 END IF IF (( pzmax .LT. -0.15 )) THEN Fmax = 1-af*0.15 fpz1 = fpz*Fmax*Jo ELSE IF(( pzmax .LT. 0.15 )) THEN
![Page 299: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/299.jpg)
Fmax = 1 + af*pzmax aux3 = 1/(1+0.33267252734*aux3) aux4 = fpz*aux3*(0.3480242+aux3*(-0.0958798+aux3*0.7478556)) + e * rfJo_array(j) IF (( pzmax .GT. 0 )) THEN fpz1 = (1 - Fmax*fpz)*Jo - 0.62665706866*af*aux4 fpz = 1 - fpz ELSE fpz1 = Fmax*fpz*Jo - 0.62665706866*af*aux4 END IF ELSE Fmax = 1 + af*0.15 fpz1 = (1 - Fmax*fpz)*Jo fpz = 1 - fpz END IF IF((rng_seed .GT. 128))call ranmar_get eta_incoh = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF ((eta_incoh*Jo .GT. fpz1 )) THEN IF (( ibcmpl .EQ. 1 )) THEN goto 13930 ELSE goto 13920 END IF END IF13980 CONTINUE IF (( ibcmpl .NE. 2 )) THEN IF((rng_seed .GT. 128))call ranmar_get rnno18 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 rnno18 = rnno18*fpz IF (( rnno18 .LT. 0.5 )) THEN rnno18 = Max(1e-30,2*rnno18) pz = 0.5*(1-Sqrt(1-2*Log(rnno18)))/Jo ELSE rnno18 = 2*(1-rnno18) pz = 0.5*(Sqrt(1-2*Log(rnno18))-1)/Jo END IF IF((abs(pz) .GT. 1))goto 13980 IF (( pz .LT. 0.15 )) THEN IF (( pz .LT. -0.15 )) THEN frej = 1 - af*0.15 ELSE frej = 1 + af*pz END IF IF((rng_seed .GT. 128))call ranmar_get eta = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((eta*Fmax .GT. frej))goto 13980 END IF ELSE pz = 0 Uj = 0 END IF pz2 = pz*pz IF (( abs(pz) .LT. 0.01 )) THEN br = br*(1 + pz*(qc + (br2-costhe)*pz)) ELSE
![Page 300: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/300.jpg)
aux = 1 - pz2*br*costhe aux1 = 1 - pz2*br2 aux2 = qc2 - br2*pz2*sinthe IF (( aux2 .GT. 1e-10 )) THEN br = br/aux1*(aux+pz*Sqrt(aux2)) END IF END IF Uj = Uj*prm13970 pesg = br*peig pese = peig - pesg - Uj + prm sinthe = Sqrt(sinthe) call uphi(2,1) e(np) = pesg aux = 1 + br*br - 2*br*costhe IF (( aux .GT. 1e-8 )) THEN costhe = (1-br*costhe)/Sqrt(aux) sinthe = (1-costhe)*(1+costhe) IF (( sinthe .GT. 0 )) THEN sinthe = -Sqrt(sinthe) ELSE sinthe = 0 END IF ELSE costhe = 0 sinthe = -1 END IF np = np + 1 IF (( np .GT. 10000 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(//,a,a,a,/,a,i6,a,i6,/,a)') ' In subroutine ','COM *PT', ' stack size exceeded! ',' $MXSTACK = ',10000,' np = ',np, ' *Increase $MXSTACK and try again ' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF call uphi(3,2) e(np) = pese iq(np) = -1 IF (( ibcmpl .EQ. 1 .OR. ibcmpl .EQ. 3 )) THEN IF (( Uj .GT. 1e-3 )) THEN edep = 0 call relax(Uj,shn_array(j),iz_array(j)) ELSE edep = Uj END IF IF (( edep .GT. 0 )) THEN IARG=4 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN END IF END IF i_survived_RR = 0 IF (( i_play_RR .EQ. 1 )) THEN IF (( prob_RR .LE. 0 )) THEN IF (( n_RR_warning .LT. 50 )) THEN n_RR_warning = n_RR_warning + 1
![Page 301: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/301.jpg)
WRITE(6,13990)prob_RR13990 FORMAT('**** Warning, attempt to play Roussian Roulette with * prob_RR<=0! ',g14.6) END IF ELSE ip = NPold+114001 CONTINUE IF (( iq(ip) .NE. 0 )) THEN IF((rng_seed .GT. 128))call ranmar_get rnno_RR = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( rnno_RR .LT. prob_RR )) THEN wt(ip) = wt(ip)/prob_RR ip = ip + 1 ELSE i_survived_RR = i_survived_RR + 1 IF ((ip .LT. np)) THEN e(ip) = e(np) iq(ip) = iq(np) wt(ip) = wt(np) u(ip) = u(np) v(ip) = v(np) w(ip) = w(np) END IF np = np-1 END IF ELSE ip = ip+1 END IF IF(((ip .GT. np)))GO TO14002 GO TO 1400114002 CONTINUE IF (( np .EQ. 0 )) THEN np = 1 e(np) = 0 iq(np) = 0 wt(np) = 0 END IF END IF END IF return13930 return end SUBROUTINE old_COMPT ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none common/compton_data/ iz_array(1538), be_array(1538), Jo_array(15 *38), erfJo_array(1538), ne_array(1538), shn_array(1538), *shell_array(100,7), eno_array(100,7), eno_atbin_array(100,7), n_sh *ell(7), radc_flag, ibcmp integer*4 iz_array,ne_array,shn_array,eno_atbin_array, shell_array *,n_shell,radc_flag real*8 be_array,Jo_array,erfJo_array,eno_array integer*2 ibcmp COMMON/QDEBUG/QDEBUG LOGICAL QDEBUG COMMON/EPCONT/EDEP,TSTEP,TUSTEP,USTEP,TVSTEP,VSTEP, RHOF,EOLD,ENEW
![Page 302: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/302.jpg)
*,EKE,ELKE,GLE,E_RANGE, x_final,y_final,z_final, u_final,v_final,w_ *final, IDISC,IROLD,IRNEW,IAUSFL(29) DOUBLE PRECISION EDEP real*8 TSTEP, TUSTEP, USTEP, VSTEP, TVSTEP, RHOF, EOLD, ENE *W, EKE, ELKE, GLE, E_RANGE, x_final,y_final,z_final, u_final, *v_final,w_final integer*4 IDISC, IROLD, IRNEW, IAUSFL COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000 *),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL COMMON/UPHIOT/THETA,SINTHE,COSTHE,SINPHI, COSPHI,PI,TWOPI,PI5D2 real*8 THETA, SINTHE, COSTHE, SINPHI, COSPHI, PI,TWOPI,PI5D2 COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 common/egs_vr/ e_max_rr, prob_RR, nbr_split, i_play_RR, i_ *survived_RR, * n_RR_warning, i_do_rr real*8 e_max_rr,prob_RR integer*4 nbr_split,i_play_RR,i_survived_RR,n_RR_warning integer*2 i_do_rr common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch DOUBLE PRECISION PEIG, PESG, PESE real*8 ko, broi, broi2, bro, bro1, alph1, alph2, alpha, rn *no15,rnno16,rnno17,rnno18,rnno19, br, temp, rejf3, rejmax, Uj *, br2, aux,aux1,aux2, pzmax2, pz, pz2, rnno_RR integer*4 irl, i, j, iarg, ip i_survived_RR = 0 NPold = NP peig=E(NP) ko = peig/rm broi = 1 + 2*ko irl = ir(np) IF (( ibcmp .EQ. 1 )) THEN IF((rng_seed .GT. 128))call ranmar_get rnno17 = rng_array(rng_seed)*twom24
![Page 303: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/303.jpg)
rng_seed = rng_seed + 1 DO 14011 i=1,n_shell(medium) rnno17 = rnno17 - eno_array(i,medium) IF((rnno17 .LE. 0))GO TO1401214011 CONTINUE14012 CONTINUE j = shell_array(i,medium) Uj = be_array(j) IF (( ko .LE. Uj )) THEN goto 14020 END IF END IF14030 CONTINUE IF (( ko .GT. 2 )) THEN broi2 = broi*broi alph1 = Log(broi) alph2 = ko*(broi+1)/broi2 alpha = alph1/(alph1+alph2)14041 CONTINUE IF((rng_seed .GT. 128))call ranmar_get rnno15 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get rnno16 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( rnno15 .LT. alpha )) THEN br = Exp(alph1*rnno16)/broi ELSE br = Sqrt(rnno16 + (1-rnno16)/broi2) END IF temp = (1-br)/ko/br sinthe = Max(0.,temp*(2-temp)) rejf3 = 1 - br*sinthe/(1+br*br) IF((rng_seed .GT. 128))call ranmar_get rnno19 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rnno19.le.rejf3))GO TO14042 GO TO 1404114042 CONTINUE ELSE bro = 1./broi bro1 = 1 - bro rejmax = broi + bro14051 CONTINUE IF((rng_seed .GT. 128))call ranmar_get rnno15 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get rnno16 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 br = bro + bro1*rnno15 temp = (1-br)/ko/br sinthe = Max(0.,temp*(2-temp)) rejf3 = (br + 1./br - sinthe)/rejmax IF((rnno16.le.rejf3))GO TO14052 GO TO 1405114052 CONTINUE END IF
![Page 304: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/304.jpg)
IF ((br .LT. 1./broi .OR. br .GT. 1)) THEN IF (( br .LT. 0.99999/broi .OR. br .GT. 1.00001 )) THEN write(i_log,'(/a)') '***************** Warning: ' write(i_log,*) ' sampled br outside of allowed range! ',ko,1./ * broi,br END IF goto 14030 END IF IF (( ibcmp .EQ. 0 )) THEN Uj = 0 costhe = 1 - temp goto 14060 END IF br2 = br*br costhe = 1 - temp aux = ko*(ko-Uj)*temp aux1 = aux-Uj pzmax2 = aux1*aux1/(2*aux+Uj*Uj)14070 CONTINUE IF((rng_seed .GT. 128))call ranmar_get rnno18 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( rnno18 .LT. 0.5 )) THEN rnno18 = Max(1e-30,2*rnno18) pz = 0.5*(1-Sqrt(1-2*Log(rnno18)))/Jo_array(j) pz2 = pz*pz IF (( (pz2 .LE. pzmax2) .AND. (aux1 .LT. 0) )) THEN goto 14020 END IF ELSE IF (( aux1 .LT. 0 )) THEN goto 14020 END IF rnno18 = 2*(1-rnno18) pz = 0.5*(Sqrt(1-2*Log(rnno18))-1)/Jo_array(j) pz2 = pz*pz IF (( pz2 .GE. pzmax2 )) THEN goto 14020 END IF END IF IF((abs(pz) .GT. 1))goto 14070 aux = 1 - pz2*br*costhe aux1 = 1 - pz2*br2 aux2 = 1-2*br*costhe+br2*(1-pz2*sinthe) IF (( aux2 .GT. 1e-10 )) THEN br = br/aux1*(aux+pz*Sqrt(aux2)) END IF Uj = Uj*prm14060 pesg = br*peig pese = peig - pesg - Uj + prm sinthe = Sqrt(sinthe) call uphi(2,1) e(np) = pesg aux = 1 + br*br - 2*br*costhe IF (( aux .GT. 1e-8 )) THEN costhe = (1-br*costhe)/Sqrt(aux) sinthe = (1-costhe)*(1+costhe) IF (( sinthe .GT. 0 )) THEN
![Page 305: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/305.jpg)
sinthe = -Sqrt(sinthe) ELSE sinthe = 0 END IF ELSE costhe = 0 sinthe = -1 END IF np = np + 1 IF (( np .GT. 10000 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(//,a,a,a,/,a,i6,a,i6,/,a)') ' In subroutine ','COM *PT', ' stack size exceeded! ',' $MXSTACK = ',10000,' np = ',np, ' *Increase $MXSTACK and try again ' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF call uphi(3,2) e(np) = pese iq(np) = -1 IF (( ibcmp .EQ. 1 )) THEN IF (( Uj .GT. 1e-3 )) THEN edep = 0 call relax(Uj,shn_array(j),iz_array(j)) ELSE edep = Uj END IF IF (( edep .GT. 0 )) THEN IARG=4 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN END IF END IF i_survived_RR = 0 IF (( i_play_RR .EQ. 1 )) THEN IF (( prob_RR .LE. 0 )) THEN IF (( n_RR_warning .LT. 50 )) THEN n_RR_warning = n_RR_warning + 1 WRITE(6,14080)prob_RR14080 FORMAT('**** Warning, attempt to play Roussian Roulette with * prob_RR<=0! ',g14.6) END IF ELSE ip = NPold+114091 CONTINUE IF (( iq(ip) .NE. 0 )) THEN IF((rng_seed .GT. 128))call ranmar_get rnno_RR = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( rnno_RR .LT. prob_RR )) THEN wt(ip) = wt(ip)/prob_RR ip = ip + 1 ELSE i_survived_RR = i_survived_RR + 1 IF ((ip .LT. np)) THEN e(ip) = e(np)
![Page 306: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/306.jpg)
iq(ip) = iq(np) wt(ip) = wt(np) u(ip) = u(np) v(ip) = v(np) w(ip) = w(np) END IF np = np-1 END IF ELSE ip = ip+1 END IF IF(((ip .GT. np)))GO TO14092 GO TO 1409114092 CONTINUE IF (( np .EQ. 0 )) THEN np = 1 e(np) = 0 iq(np) = 0 wt(np) = 0 END IF END IF END IF return14020 return end SUBROUTINE ELECTR(IRCODE) ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none integer*4 IRCODE COMMON/QDEBUG/QDEBUG LOGICAL QDEBUG COMMON/BOUNDS/ECUT,PCUT,VACDST real*8 ECUT, PCUT, VACDST COMMON/ELECIN/ esig_e(7),psig_e(7), esige_max, psige_max, range_ep *(0:1,150,7), E_array(150,7), etae_ms0(150,7),etae_ms1(150,7),etap_ *ms0(150,7),etap_ms1(150,7),q1ce_ms0(150,7),q1ce_ms1(150,7),q1cp_ms *0(150,7),q1cp_ms1(150,7),q2ce_ms0(150,7),q2ce_ms1(150,7),q2cp_ms0( *150,7),q2cp_ms1(150,7),blcce0(150,7),blcce1(150,7), EKE0(7),EKE1(7 *), XR0(7),TEFF0(7),BLCC(7),XCC(7), ESIG0(150,7),ESIG1(150,7),PSIG0 *(150,7),PSIG1(150,7),EDEDX0(150,7),EDEDX1(150,7),PDEDX0(150,7),PDE *DX1(150,7),EBR10(150,7),EBR11(150,7),PBR10(150,7),PBR11(150,7),PBR *20(150,7),PBR21(150,7),TMXS0(150,7),TMXS1(150,7), expeke1(7), IUNR *ST(7),EPSTFL(7),IAPRIM(7), sig_ismonotone(0:1,7) real*8 esig_e, psig_e, esige_max, psige_max, range_ep, E_ar *ray, etae_ms0,etae_ms1, etap_ms0,etap_ms1, q1ce_ms0,q1ce_ms1, *q1cp_ms0,q1cp_ms1, q2ce_ms0,q2ce_ms1, q2cp_ms0,q2cp_ms1, blcce0 *,blcce1, expeke1, EKE0,EKE1, XR0, TEFF0, BLCC, XCC, ESIG0,E *SIG1, PSIG0,PSIG1, EDEDX0,EDEDX1, PDEDX0,PDEDX1, EBR10,EBR11, * PBR10,PBR11, PBR20,PBR21, TMXS0,TMXS1 integer*4 IUNRST, EPSTFL, IAPRIM logical sig_ismonotone COMMON/EPCONT/EDEP,TSTEP,TUSTEP,USTEP,TVSTEP,VSTEP, RHOF,EOLD,ENEW *,EKE,ELKE,GLE,E_RANGE, x_final,y_final,z_final, u_final,v_final,w_ *final, IDISC,IROLD,IRNEW,IAUSFL(29) DOUBLE PRECISION EDEP real*8 TSTEP, TUSTEP, USTEP, VSTEP, TVSTEP, RHOF, EOLD, ENE *W, EKE, ELKE, GLE, E_RANGE, x_final,y_final,z_final, u_final,
![Page 307: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/307.jpg)
*v_final,w_final integer*4 IDISC, IROLD, IRNEW, IAUSFL COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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( 2097154),MED( 2097154),IRAYLR real*8 DUNIT, RHOR integer*4 KMPI, KMPO integer*2 MED, IRAYLR COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000 *),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL COMMON/UPHIIN/SINC0,SINC1,SIN0(1002),SIN1(1002) real*8 SINC0,SINC1,SIN0,SIN1 COMMON/UPHIOT/THETA,SINTHE,COSTHE,SINPHI, COSPHI,PI,TWOPI,PI5D2 real*8 THETA, SINTHE, COSTHE, SINPHI, COSPHI, PI,TWOPI,PI5D2 COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD COMMON/USERPS/n_split integer*4 n_split COMMON/USERRR/ESAVE_GLOBAL,RANGE_ECUTRR(7),IREJECT real*8 ESAVE_GLOBAL,RANGE_ECUTRR integer*4 IREJECT common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 common/ET_control/ SMAXIR,estepe,ximax, skindepth_for_bca,transpo *rt_algorithm, bca_algorithm,exact_bca,spin_effects real*8 smaxir, estepe, ximax, skindepth_for_bca integer*4 transport_algorithm, bca_algorithm logical exact_bca, spin_effects common/CH_steps/ count_pII_steps,count_all_steps,is_ch_step real*8 count_pII_steps,count_all_steps logical is_ch_step common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64
![Page 308: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/308.jpg)
integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch common/egs_vr/ e_max_rr, prob_RR, nbr_split, i_play_RR, i_ *survived_RR, * n_RR_warning, i_do_rr real*8 e_max_rr,prob_RR integer*4 nbr_split,i_play_RR,i_survived_RR,n_RR_warning integer*2 i_do_rr common/geom/ xbound(128+1), ybound(128+1), zbound(128+1), xboun *d_min, xbound_max, ybound_min, ybound_max, zbound_min, zbound *_max, medsur, dsurround(4), IMAX, JMAX, KMAX, ijmax, irmax, * howfarless real*4 xbound, ybound, zbound, xbound_min, xbound_max, ybound_min, * ybound_max, zbound_min, zbound_max,dsurround integer medsur,IMAX, JMAX, KMAX, ijmax,irmax logical howfarless common/eii_data/ eii_xsection_a( 10000), eii_xsection_b( 10000), * eii_cons(7), eii_a(40), eii_b(40), eii_z(40), eii_sh(40), eii *_nshells(100), eii_nsh(7), eii_first(7,50), eii_no(7,50), eii_ *flag real*8 eii_xsection_a,eii_xsection_b,eii_a,eii_b,eii_cons integer*4 eii_z,eii_sh,eii_nshells integer*4 eii_first,eii_no integer*4 eii_elements,eii_flag,eii_nsh real*8 lambda_max, sigratio, u_tmp, v_tmp, w_tmp LOGICAL random_tustep DOUBLE PRECISION demfp, peie, total_tstep, total_de real*8 ekems, elkems, chia2, etap, lambda, blccl, xccl, xi, * xi_corr, ms_corr, p2, beta2, de, save_de, dedx, dedx0, de *dxmid, ekei, elkei, aux, ebr1, eie, ekef, elkef, ekeold, *eketmp, elktmp, fedep, tuss, pbr1, pbr2, range, rfict, rnn *e1, rnno24, rnno25, rnnotu, rnnoss, sig, sig0, sigf, skind *epth, ssmfp, tmxs, tperp, ustep0, uscat, vscat, wscat, xtr *ans, ytrans, ztrans, cphi,sphi real*8 xphi,xphi2,yphi,yphi2,rhophi2 integer*4 iarg, idr, ierust, irl, lelec, qel, lelke, lelkem *s, lelkef, lelktmp, ibr logical callhowfar, domultiple, dosingle, callmsdist, * findindex, * spin_index, comput *e_tstep * data ierust/0/ save ierust ircode = 1 irold = ir(np) irl = irold medium = med(irl)14100 CONTINUE14101 CONTINUE lelec = iq(np) qel = (1+lelec)/2 peie = e(np) eie = peie IF ((eie .LE. ECUT)) THEN go to 14110
![Page 309: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/309.jpg)
END IF IF ((WT(NP) .EQ. 0.0)) THEN go to 14120 END IF14130 CONTINUE14131 CONTINUE compute_tstep = .true. eke = eie - rm IF ((medium .NE. 0)) THEN IF((rng_seed .GT. 128))call ranmar_get RNNE1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF ((RNNE1.EQ.0.0)) THEN RNNE1=1.E-30 END IF DEMFP=MAX(-LOG(RNNE1),1.E-5) elke = log(eke) Lelke=eke1(MEDIUM)*elke+eke0(MEDIUM) IF (( sig_ismonotone(qel,medium) )) THEN IF ((lelec .LT. 0)) THEN sigf=esig1(Lelke,MEDIUM)*elke+esig0(Lelke,MEDIUM) dedx0=ededx1(Lelke,MEDIUM)*elke+ededx0(Lelke,MEDIUM) sigf = sigf/dedx0 ELSE sigf=psig1(Lelke,MEDIUM)*elke+psig0(Lelke,MEDIUM) dedx0=pdedx1(Lelke,MEDIUM)*elke+pdedx0(Lelke,MEDIUM) sigf = sigf/dedx0 END IF sig0 = sigf ELSE IF (( lelec .LT. 0 )) THEN sig0 = esig_e(medium) ELSE sig0 = psig_e(medium) END IF END IF END IF14140 CONTINUE14141 CONTINUE IF ((medium .EQ. 0)) THEN tstep = vacdst ustep = tstep tustep = ustep callhowfar = .true. ELSE RHOF=RHOR(IRL)/RHO(MEDIUM) sig = sig0 IF ((sig .LE. 0)) THEN tstep = vacdst sig0 = 1.E-15 ELSE IF (( compute_tstep )) THEN total_de = demfp/sig fedep = total_de ekef = eke - fedep IF (( ekef .LE. E_array(1,medium) )) THEN tstep = vacdst ELSE
![Page 310: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/310.jpg)
elkef = Log(ekef) Lelkef=eke1(MEDIUM)*elkef+eke0(MEDIUM) IF (( lelkef .EQ. lelke )) THEN fedep = 1 - ekef/eke elktmp = 0.5*(elke+elkef+0.25*fedep*fedep*(1+fedep * *(1+0.875*fedep))) lelktmp = lelke IF ((lelec .LT. 0)) THEN dedxmid=ededx1(Lelktmp,MEDIUM)*elktmp+ededx0(Lel * ktmp,MEDIUM) dedxmid = 1/dedxmid aux = ededx1(lelktmp,medium)*dedxmid ELSE dedxmid=pdedx1(Lelktmp,MEDIUM)*elktmp+pdedx0(Lel * ktmp,MEDIUM) dedxmid = 1/dedxmid aux = pdedx1(lelktmp,medium)*dedxmid END IF aux = aux*(1+2*aux)*(fedep/(2-fedep))**2/6 tstep = fedep*eke*dedxmid*(1+aux) ELSE ekei = E_array(lelke,medium) elkei = (lelke - eke0(medium))/eke1(medium) fedep = 1 - ekei/eke elktmp = 0.5*(elke+elkei+0.25*fedep*fedep*(1+fedep * *(1+0.875*fedep))) lelktmp = lelke IF ((lelec .LT. 0)) THEN dedxmid=ededx1(Lelktmp,MEDIUM)*elktmp+ededx0(Lel * ktmp,MEDIUM) dedxmid = 1/dedxmid aux = ededx1(lelktmp,medium)*dedxmid ELSE dedxmid=pdedx1(Lelktmp,MEDIUM)*elktmp+pdedx0(Lel * ktmp,MEDIUM) dedxmid = 1/dedxmid aux = pdedx1(lelktmp,medium)*dedxmid END IF aux = aux*(1+2*aux)*(fedep/(2-fedep))**2/6 tuss = fedep*eke*dedxmid*(1+aux) ekei = E_array(lelkef+1,medium) elkei = (lelkef + 1 - eke0(medium))/eke1(medium) fedep = 1 - ekef/ekei elktmp = 0.5*(elkei+elkef+0.25*fedep*fedep*(1+fede * p*(1+0.875*fedep))) lelktmp = lelkef IF ((lelec .LT. 0)) THEN dedxmid=ededx1(Lelktmp,MEDIUM)*elktmp+ededx0(Lel * ktmp,MEDIUM) dedxmid = 1/dedxmid aux = ededx1(lelktmp,medium)*dedxmid ELSE dedxmid=pdedx1(Lelktmp,MEDIUM)*elktmp+pdedx0(Lel * ktmp,MEDIUM) dedxmid = 1/dedxmid aux = pdedx1(lelktmp,medium)*dedxmid END IF aux = aux*(1+2*aux)*(fedep/(2-fedep))**2/6
![Page 311: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/311.jpg)
tstep = fedep*ekei*dedxmid*(1+aux) tstep=tstep+tuss+ range_ep(qel,lelke,medium)-range * _ep(qel,lelkef+1,medium) END IF END IF total_tstep = tstep compute_tstep = .false. END IF tstep = total_tstep/rhof END IF IF ((lelec .LT. 0)) THEN dedx0=ededx1(Lelke,MEDIUM)*elke+ededx0(Lelke,MEDIUM) ELSE dedx0=pdedx1(Lelke,MEDIUM)*elke+pdedx0(Lelke,MEDIUM) END IF dedx = rhof*dedx0 tmxs=tmxs1(Lelke,MEDIUM)*elke+tmxs0(Lelke,MEDIUM) tmxs = tmxs/rhof ekei = E_array(lelke,medium) elkei = (lelke - eke0(medium))/eke1(medium) fedep = 1 - ekei/eke elktmp = 0.5*(elke+elkei+0.25*fedep*fedep*(1+fedep*(1+0.87 * 5*fedep))) lelktmp = lelke IF ((lelec .LT. 0)) THEN dedxmid=ededx1(Lelktmp,MEDIUM)*elktmp+ededx0(Lelktmp,MED * IUM) dedxmid = 1/dedxmid aux = ededx1(lelktmp,medium)*dedxmid ELSE dedxmid=pdedx1(Lelktmp,MEDIUM)*elktmp+pdedx0(Lelktmp,MED * IUM) dedxmid = 1/dedxmid aux = pdedx1(lelktmp,medium)*dedxmid END IF aux = aux*(1+2*aux)*(fedep/(2-fedep))**2/6 range = fedep*eke*dedxmid*(1+aux) range = (range + range_ep(qel,lelke,medium))/rhof random_tustep = .false. IF ((random_tustep)) THEN IF((rng_seed .GT. 128))call ranmar_get rnnotu = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 tmxs = rnnotu*min(tmxs,SMAXIR) ELSE tmxs = min(tmxs,SMAXIR) END IF tustep = min(tstep,tmxs,range) CALL HOWNEAR(tperp,X(NP),Y(NP),Z(NP),IR(NP)) dnear(np) = tperp IF (( i_do_rr .EQ. 1 .AND. e(np) .LT. e_max_rr .AND. (irl. * EQ.irmax+1.OR..NOT.howfarless))) THEN IF ((tperp .GE. range)) THEN idisc = 50 + 49*iq(np) go to 14120 END IF END IF IF (( IREJECT .EQ. 1 .AND. MED(IR(NP)) .NE. 0 .AND. E(NP)
![Page 312: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/312.jpg)
* .LT. ESAVE_GLOBAL .AND. DNEAR(NP) .GE. range-RANGE_ECUTRR( * MED(IR(NP)))*(RHO(MED(IR(NP)))/RHOR(IR(NP))) .AND. (IR(NP) * .EQ.irmax+1 .OR. .NOT.howfarless) )) THEN IF ((LELEC .EQ. -1)) THEN IDISC=1 ELSE IDISC=99 END IF GOTO 14120 END IF blccl = rhof*blcc(medium) xccl = rhof*xcc(medium) p2 = eke*(eke+rmt2) beta2 = p2/(p2 + rmsq) IF (( spin_effects )) THEN IF ((lelec .LT. 0)) THEN etap=etae_ms1(Lelke,MEDIUM)*elke+etae_ms0(Lelke,MEDIUM * ) ELSE etap=etap_ms1(Lelke,MEDIUM)*elke+etap_ms0(Lelke,MEDIUM * ) END IF ms_corr=blcce1(Lelke,MEDIUM)*elke+blcce0(Lelke,MEDIUM) blccl = blccl/etap/(1+0.25*etap*xccl/blccl/p2)*ms_corr END IF ssmfp=beta2/blccl skindepth = skindepth_for_bca*ssmfp tustep = min(tustep,max(tperp,skindepth)) count_all_steps = count_all_steps + 1 is_ch_step = .false. IF (((tustep .LE. tperp) .AND. ((.NOT.exact_bca) .OR. (tus * tep .GT. skindepth)))) THEN callhowfar = .false. domultiple = .false. dosingle = .false. callmsdist = .true. tuss = range - range_ep(qel,lelke,medium)/rhof IF (( tuss .GE. tustep )) THEN IF (( lelec .LT. 0 )) THEN dedxmid=ededx1(Lelke,MEDIUM)*elke+ededx0(Lelke,MEDIU * M) aux = ededx1(lelke,medium)/dedxmid ELSE dedxmid=pdedx1(Lelke,MEDIUM)*elke+pdedx0(Lelke,MEDIU * M) aux = pdedx1(lelke,medium)/dedxmid END IF de = dedxmid*tustep*rhof fedep = de/eke de = de*(1-0.5*fedep*aux*(1-0.333333*fedep*(aux-1- 0.2 * 5*fedep*(2-aux*(4-aux))))) ELSE lelktmp = lelke tuss = (range - tustep)*rhof IF (( tuss .LE. 0 )) THEN de = eke - TE(medium)*0.99 ELSE14151 IF(tuss.GE.range_ep(qel,lelktmp,medium))GO TO 14152
![Page 313: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/313.jpg)
lelktmp = lelktmp - 1 GO TO 1415114152 CONTINUE elktmp = (lelktmp+1-eke0(medium))/eke1(medium) eketmp = E_array(lelktmp+1,medium) tuss = (range_ep(qel,lelktmp+1,medium) - tuss)/rhof IF (( lelec .LT. 0 )) THEN dedxmid=ededx1(Lelktmp,MEDIUM)*elktmp+ededx0(Lelkt * mp,MEDIUM) aux = ededx1(lelktmp,medium)/dedxmid ELSE dedxmid=pdedx1(Lelktmp,MEDIUM)*elktmp+pdedx0(Lelkt * mp,MEDIUM) aux = pdedx1(lelktmp,medium)/dedxmid END IF de = dedxmid*tuss*rhof fedep = de/eketmp de = de*(1-0.5*fedep*aux*(1-0.333333*fedep*(aux-1- 0 * .25*fedep*(2-aux*(4-aux))))) de = de + eke - eketmp END IF END IF tvstep = tustep is_ch_step = .true. IF ((transport_algorithm .EQ. 0)) THEN call msdist_pII ( eke,de,tustep,rhof,medium,qel,spin_ * effects, u(np),v(np),w(np),x(np),y(np),z(np), uscat,v * scat,wscat,xtrans,ytrans,ztrans,ustep ) ELSE call msdist_pI ( eke,de,tustep,rhof,medium,qel,spin_e * ffects, u(np),v(np),w(np),x(np),y(np),z(np), uscat,vs * cat,wscat,xtrans,ytrans,ztrans,ustep ) END IF ELSE callmsdist = .false. IF ((exact_bca)) THEN domultiple = .false. IF((rng_seed .GT. 128))call ranmar_get rnnoss = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 lambda = - Log(1 - rnnoss) lambda_max = 0.5*blccl*rm/dedx*(eke/rm+1)**3 IF (( lambda .GE. 0 .AND. lambda_max .GT. 0 )) THEN IF (( lambda .LT. lambda_max )) THEN tuss=lambda*ssmfp*(1-0.5*lambda/lambda_max) ELSE tuss = 0.5 * lambda * ssmfp END IF IF ((tuss .LT. tustep)) THEN tustep = tuss dosingle = .true. ELSE dosingle = .false. END IF ELSE write(i_log,'(/a)') '***************** Warning: ' write(i_log,*) ' lambda > lambda_max: ', lambda,lamb * da_max,' eke dedx: ',eke,dedx, ' ir medium blcc: ',i
![Page 314: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/314.jpg)
* r(np),medium,blcc(medium), ' position = ',x(np),y(np * ),z(np) dosingle = .false. np=np-1 return END IF ustep = tustep ELSE dosingle = .false. domultiple = .true. ekems = eke - 0.5*tustep*dedx p2 = ekems*(ekems+rmt2) beta2 = p2/(p2 + rmsq) chia2 = xccl/(4*blccl*p2) xi = 0.5*xccl/p2/beta2*tustep IF (( spin_effects )) THEN elkems = Log(ekems) Lelkems=eke1(MEDIUM)*elkems+eke0(MEDIUM) IF ((lelec .LT. 0)) THEN etap=etae_ms1(Lelkems,MEDIUM)*elkems+etae_ms0(Lelk * ems,MEDIUM) xi_corr=q1ce_ms1(Lelkems,MEDIUM)*elkems+q1ce_ms0(L * elkems,MEDIUM) ELSE etap=etap_ms1(Lelkems,MEDIUM)*elkems+etap_ms0(Lelk * ems,MEDIUM) xi_corr=q1cp_ms1(Lelkems,MEDIUM)*elkems+q1cp_ms0(L * elkems,MEDIUM) END IF chia2 = chia2*etap xi = xi*xi_corr ms_corr=blcce1(Lelkems,MEDIUM)*elkems+blcce0(Lelkems * ,MEDIUM) blccl = blccl*ms_corr ELSE xi_corr = 1 etap = 1 END IF xi = xi*(Log(1+1./chia2)-1/(1+chia2)) IF (( xi .LT. 0.1 )) THEN ustep = tustep*(1 - xi*(0.5 - xi*0.166667)) ELSE ustep = tustep*(1 - Exp(-xi))/xi END IF END IF IF ((ustep .LT. tperp)) THEN callhowfar = .false. ELSE callhowfar = .true. END IF END IF END IF irnew = ir(np) idisc = 0 ustep0 = ustep IF ((callhowfar .OR. wt(np) .LE. 0)) THEN call howfar END IF
![Page 315: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/315.jpg)
IF ((idisc .GT. 0)) THEN go to 14120 END IF IF ((ustep .LE. 0)) THEN IF ((ustep .LT. -1e-4)) THEN ierust = ierust + 1 WRITE(6,14160)ierust,ustep,dedx,e(np)-prm, ir(np),irnew, * irold,x(np),y(np),z(np)14160 FORMAT(i4,' Negative ustep = ',e12.5,' dedx=',F8.4,' ke= *',F8.4, ' ir,irnew,irold =',3i4,' x,y,z =',4e10.3) IF ((ierust .GT. 1000)) THEN WRITE(6,14170)14170 FORMAT(////' Called exit---too many ustep errors'///) call exit(1) END IF END IF ustep = 0 END IF IF ((ustep .EQ. 0 .OR. medium .EQ. 0)) THEN IF ((ustep .NE. 0)) THEN vstep = ustep tvstep = vstep edep = pzero e_range = vacdst IARG=0 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN x(np) = x(np) + u(np)*vstep y(np) = y(np) + v(np)*vstep z(np) = z(np) + w(np)*vstep dnear(np) = dnear(np) - vstep irold = ir(np) END IF ir(np) = irnew irl = irnew medium = med(irl) IF ((ustep .NE. 0)) THEN IARG=5 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN END IF IF ((eie .LE. ECUT)) THEN go to 14110 END IF IF ((ustep .NE. 0 .AND. idisc .LT. 0)) THEN go to 14120 END IF GO TO 14131 END IF vstep = ustep IF ((callhowfar)) THEN IF ((exact_bca)) THEN tvstep = vstep IF ((tvstep .NE. tustep)) THEN
![Page 316: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/316.jpg)
dosingle = .false. END IF ELSE IF (( vstep .LT. ustep0 )) THEN ekems = eke - 0.5*tustep*vstep/ustep0*dedx p2 = ekems*(ekems+rmt2) beta2 = p2/(p2 + rmsq) chia2 = xccl/(4*blccl*p2) xi = 0.5*xccl/p2/beta2*vstep IF (( spin_effects )) THEN elkems = Log(ekems) Lelkems=eke1(MEDIUM)*elkems+eke0(MEDIUM) IF ((lelec .LT. 0)) THEN etap=etae_ms1(Lelkems,MEDIUM)*elkems+etae_ms0(Lelk * ems,MEDIUM) xi_corr=q1ce_ms1(Lelkems,MEDIUM)*elkems+q1ce_ms0(L * elkems,MEDIUM) ELSE etap=etap_ms1(Lelkems,MEDIUM)*elkems+etap_ms0(Lelk * ems,MEDIUM) xi_corr=q1cp_ms1(Lelkems,MEDIUM)*elkems+q1cp_ms0(L * elkems,MEDIUM) END IF chia2 = chia2*etap xi = xi*xi_corr ms_corr=blcce1(Lelkems,MEDIUM)*elkems+blcce0(Lelkems * ,MEDIUM) blccl = blccl*ms_corr ELSE xi_corr = 1 etap = 1 END IF xi = xi*(Log(1+1./chia2)-1/(1+chia2)) IF (( xi .LT. 0.1 )) THEN tvstep = vstep*(1 + xi*(0.5 + xi*0.333333)) ELSE IF (( xi .LT. 0.999999 )) THEN tvstep = -vstep*Log(1 - xi)/xi ELSE write(i_log,*) ' Stoped in SET-TVSTEP because xi > * 1! ' write(i_log,*) ' Medium: ',medium write(i_log,*) ' Initial energy: ',eke write(i_log,*) ' Average step energy: ',ekems write(i_log,*) ' tustep: ',tustep write(i_log,*) ' ustep0: ',ustep0 write(i_log,*) ' vstep: ',vstep write(i_log,*) ' ==> xi = ',xi write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'This is a fatal error condition' write(i_log,'(/a)') '***************** Quiting now *.' call exit(1) END IF END IF ELSE tvstep = tustep END IF
![Page 317: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/317.jpg)
END IF tuss = range - range_ep(qel,lelke,medium)/rhof IF (( tuss .GE. tvstep )) THEN IF (( lelec .LT. 0 )) THEN dedxmid=ededx1(Lelke,MEDIUM)*elke+ededx0(Lelke,MEDIUM) aux = ededx1(lelke,medium)/dedxmid ELSE dedxmid=pdedx1(Lelke,MEDIUM)*elke+pdedx0(Lelke,MEDIUM) aux = pdedx1(lelke,medium)/dedxmid END IF de = dedxmid*tvstep*rhof fedep = de/eke de = de*(1-0.5*fedep*aux*(1-0.333333*fedep*(aux-1- 0.25* * fedep*(2-aux*(4-aux))))) ELSE lelktmp = lelke tuss = (range - tvstep)*rhof IF (( tuss .LE. 0 )) THEN de = eke - TE(medium)*0.99 ELSE14181 IF(tuss.GE.range_ep(qel,lelktmp,medium))GO TO 14182 lelktmp = lelktmp - 1 GO TO 1418114182 CONTINUE elktmp = (lelktmp+1-eke0(medium))/eke1(medium) eketmp = E_array(lelktmp+1,medium) tuss = (range_ep(qel,lelktmp+1,medium) - tuss)/rhof IF (( lelec .LT. 0 )) THEN dedxmid=ededx1(Lelktmp,MEDIUM)*elktmp+ededx0(Lelktmp * ,MEDIUM) aux = ededx1(lelktmp,medium)/dedxmid ELSE dedxmid=pdedx1(Lelktmp,MEDIUM)*elktmp+pdedx0(Lelktmp * ,MEDIUM) aux = pdedx1(lelktmp,medium)/dedxmid END IF de = dedxmid*tuss*rhof fedep = de/eketmp de = de*(1-0.5*fedep*aux*(1-0.333333*fedep*(aux-1- 0.2 * 5*fedep*(2-aux*(4-aux))))) de = de + eke - eketmp END IF END IF ELSE tvstep = tustep IF (( .NOT.callmsdist )) THEN tuss = range - range_ep(qel,lelke,medium)/rhof IF (( tuss .GE. tvstep )) THEN IF (( lelec .LT. 0 )) THEN dedxmid=ededx1(Lelke,MEDIUM)*elke+ededx0(Lelke,MEDIU * M) aux = ededx1(lelke,medium)/dedxmid ELSE dedxmid=pdedx1(Lelke,MEDIUM)*elke+pdedx0(Lelke,MEDIU * M) aux = pdedx1(lelke,medium)/dedxmid END IF de = dedxmid*tvstep*rhof
![Page 318: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/318.jpg)
fedep = de/eke de = de*(1-0.5*fedep*aux*(1-0.333333*fedep*(aux-1- 0.2 * 5*fedep*(2-aux*(4-aux))))) ELSE lelktmp = lelke tuss = (range - tvstep)*rhof IF (( tuss .LE. 0 )) THEN de = eke - TE(medium)*0.99 ELSE14191 IF(tuss.GE.range_ep(qel,lelktmp,medium))GO TO 14192 lelktmp = lelktmp - 1 GO TO 1419114192 CONTINUE elktmp = (lelktmp+1-eke0(medium))/eke1(medium) eketmp = E_array(lelktmp+1,medium) tuss = (range_ep(qel,lelktmp+1,medium) - tuss)/rhof IF (( lelec .LT. 0 )) THEN dedxmid=ededx1(Lelktmp,MEDIUM)*elktmp+ededx0(Lelkt * mp,MEDIUM) aux = ededx1(lelktmp,medium)/dedxmid ELSE dedxmid=pdedx1(Lelktmp,MEDIUM)*elktmp+pdedx0(Lelkt * mp,MEDIUM) aux = pdedx1(lelktmp,medium)/dedxmid END IF de = dedxmid*tuss*rhof fedep = de/eketmp de = de*(1-0.5*fedep*aux*(1-0.333333*fedep*(aux-1- 0 * .25*fedep*(2-aux*(4-aux))))) de = de + eke - eketmp END IF END IF END IF END IF save_de = de edep = de ekef = eke - de eold = eie enew = eold - de IF (( .NOT.callmsdist )) THEN IF (( domultiple )) THEN lambda = blccl*tvstep/beta2/etap/(1+chia2) xi = xi/xi_corr findindex = .true. spin_index = .true. call mscat(lambda,chia2,xi,elkems,beta2,qel,medium, spin * _effects,findindex,spin_index, costhe,sinthe) ELSE IF ((dosingle)) THEN ekems = Max(ekef,ECUT-rm) p2 = ekems*(ekems + rmt2) beta2 = p2/(p2 + rmsq) chia2 = xcc(medium)/(4*blcc(medium)*p2) IF (( spin_effects )) THEN elkems = Log(ekems) Lelkems=eke1(MEDIUM)*elkems+eke0(MEDIUM) IF ((lelec .LT. 0)) THEN etap=etae_ms1(Lelkems,MEDIUM)*elkems+etae_ms0(Lelk
![Page 319: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/319.jpg)
* ems,MEDIUM) ELSE etap=etap_ms1(Lelkems,MEDIUM)*elkems+etap_ms0(Lelk * ems,MEDIUM) END IF chia2 = chia2*etap END IF call sscat(chia2,elkems,beta2,qel,medium, spin_effects * ,costhe,sinthe) ELSE theta = 0 sinthe = 0 costhe = 1 END IF END IF END IF e_range = range IF (( callmsdist )) THEN u_final = uscat v_final = vscat w_final = wscat x_final = xtrans y_final = ytrans z_final = ztrans ELSE x_final = x(np) + u(np)*vstep y_final = y(np) + v(np)*vstep z_final = z(np) + w(np)*vstep IF (( domultiple .OR. dosingle )) THEN u_tmp = u(np) v_tmp = v(np) w_tmp = w(np) call uphi(2,1) u_final = u(np) v_final = v(np) w_final = w(np) u(np) = u_tmp v(np) = v_tmp w(np) = w_tmp ELSE u_final = u(np) v_final = v(np) w_final = w(np) END IF END IF IARG=0 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN x(np) = x_final y(np) = y_final z(np) = z_final u(np) = u_final v(np) = v_final w(np) = w_final dnear(np) = dnear(np) - vstep irold = ir(np)
![Page 320: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/320.jpg)
peie = peie - edep eie = peie e(np) = peie IF (( irnew .EQ. irl .AND. eie .LE. ECUT)) THEN go to 14110 END IF medold = medium IF ((medium .NE. 0)) THEN ekeold = eke eke = eie - rm elke = log(eke) Lelke=eke1(MEDIUM)*elke+eke0(MEDIUM) END IF IF ((irnew .NE. irold)) THEN ir(np) = irnew irl = irnew medium = med(irl) END IF IARG=5 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN IF ((eie .LE. ECUT)) THEN go to 14110 END IF IF ((idisc .LT. 0)) THEN go to 14120 END IF IF((medium .NE. medold))GO TO 14131 demfp = demfp - save_de*sig total_de = total_de - save_de total_tstep = total_tstep - tvstep*rhof IF (( total_tstep .LT. 1e-9 )) THEN demfp = 0 END IF IF(((demfp .LT. 1.E-5)))GO TO14142 GO TO 1414114142 CONTINUE IF ((lelec .LT. 0)) THEN sigf=esig1(Lelke,MEDIUM)*elke+esig0(Lelke,MEDIUM) dedx0=ededx1(Lelke,MEDIUM)*elke+ededx0(Lelke,MEDIUM) sigf = sigf/dedx0 ELSE sigf=psig1(Lelke,MEDIUM)*elke+psig0(Lelke,MEDIUM) dedx0=pdedx1(Lelke,MEDIUM)*elke+pdedx0(Lelke,MEDIUM) sigf = sigf/dedx0 END IF sigratio = sigf/sig0 IF((rng_seed .GT. 128))call ranmar_get rfict = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF(((rfict .LE. sigratio)))GO TO14132 GO TO 1413114132 CONTINUE IF ((lelec .LT. 0)) THEN ebr1=ebr11(Lelke,MEDIUM)*elke+ebr10(Lelke,MEDIUM) IF((rng_seed .GT. 128))call ranmar_get
![Page 321: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/321.jpg)
rnno24 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF ((rnno24 .LE. ebr1)) THEN go to 14200 ELSE IF ((e(np) .LE. thmoll(medium) .AND. eii_flag .EQ. 0)) THEN IF ((ebr1 .LE. 0)) THEN go to 14100 END IF go to 14200 END IF IARG=8 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN call moller IARG=9 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN IF((iq(np) .EQ. 0))return END IF go to 14100 END IF pbr1=pbr11(Lelke,MEDIUM)*elke+pbr10(Lelke,MEDIUM) IF((rng_seed .GT. 128))call ranmar_get rnno25 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF ((rnno25 .LT. pbr1)) THEN go to 14200 END IF pbr2=pbr21(Lelke,MEDIUM)*elke+pbr20(Lelke,MEDIUM) IF ((rnno25 .LT. pbr2)) THEN IARG=10 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN call bhabha IARG=11 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN IF((iq(np) .EQ. 0))return ELSE IARG=12 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN call annih IARG=13 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF
![Page 322: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/322.jpg)
IF((IARG.LT.0))RETURN GO TO 14102 END IF GO TO 1410114102 CONTINUE return14200 IARG=6 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN call brems IARG=7 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN IF ((iq(np) .EQ. 0)) THEN return ELSE go to 14100 END IF14110 IF (( medium .GT. 0 )) THEN IF ((eie .GT. ae(medium))) THEN idr = 1 IF ((lelec .LT. 0)) THEN edep = e(np) - prm ELSE EDEP=PEIE-PRM END IF ELSE idr = 2 edep = e(np) - prm END IF ELSE idr = 1 edep = e(np) - prm END IF IARG=idr IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN14210 CONTINUE IF ((lelec .GT. 0)) THEN IF ((edep .LT. peie)) THEN IARG=28 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN call annih_at_rest IARG=14 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN return
![Page 323: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/323.jpg)
END IF END IF np = np - 1 ircode = 2 return14120 idisc = abs(idisc) IF (((lelec .LT. 0) .OR. (idisc .EQ. 99))) THEN edep = e(np) - prm ELSE edep = e(np) + prm END IF IARG=3 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN IF((idisc .EQ. 99))goto 14210 np = np - 1 ircode = 2 return end SUBROUTINE HATCH ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none character*512 toUpper COMMON/QDEBUG/QDEBUG LOGICAL QDEBUG COMMON/BOUNDS/ECUT,PCUT,VACDST real*8 ECUT, PCUT, VACDST COMMON/BREMPR/ DL1(8,7),DL2(8,7),DL3(8,7),DL4(8,7),DL5(8,7),DL6(8, *7), ALPHI(2,7),BPAR(2,7),DELPOS(2,7), WA(7,50),PZ(7,50),ZELEM(7,50 *),RHOZ(7,50), PWR2I(50), DELCM(7),ZBRANG(7),LZBRANG(7),NNE(7), IBR *DST,IPRDST,ibr_nist,pair_nrc,itriplet, ASYM(7,50,2) CHARACTER*4 ASYM real*8 DL1,DL2,DL3,DL4,DL5,DL6, ALPHI, BPAR, DELPOS, WA, PZ, * ZELEM, RHOZ, PWR2I, DELCM, ZBRANG, LZBRANG integer*4 NNE, IBRDST, IPRDST, ibr_nist, itriplet, pair_nrc COMMON/ELECIN/ esig_e(7),psig_e(7), esige_max, psige_max, range_ep *(0:1,150,7), E_array(150,7), etae_ms0(150,7),etae_ms1(150,7),etap_ *ms0(150,7),etap_ms1(150,7),q1ce_ms0(150,7),q1ce_ms1(150,7),q1cp_ms *0(150,7),q1cp_ms1(150,7),q2ce_ms0(150,7),q2ce_ms1(150,7),q2cp_ms0( *150,7),q2cp_ms1(150,7),blcce0(150,7),blcce1(150,7), EKE0(7),EKE1(7 *), XR0(7),TEFF0(7),BLCC(7),XCC(7), ESIG0(150,7),ESIG1(150,7),PSIG0 *(150,7),PSIG1(150,7),EDEDX0(150,7),EDEDX1(150,7),PDEDX0(150,7),PDE *DX1(150,7),EBR10(150,7),EBR11(150,7),PBR10(150,7),PBR11(150,7),PBR *20(150,7),PBR21(150,7),TMXS0(150,7),TMXS1(150,7), expeke1(7), IUNR *ST(7),EPSTFL(7),IAPRIM(7), sig_ismonotone(0:1,7) real*8 esig_e, psig_e, esige_max, psige_max, range_ep, E_ar *ray, etae_ms0,etae_ms1, etap_ms0,etap_ms1, q1ce_ms0,q1ce_ms1, *q1cp_ms0,q1cp_ms1, q2ce_ms0,q2ce_ms1, q2cp_ms0,q2cp_ms1, blcce0 *,blcce1, expeke1, EKE0,EKE1, XR0, TEFF0, BLCC, XCC, ESIG0,E *SIG1, PSIG0,PSIG1, EDEDX0,EDEDX1, PDEDX0,PDEDX1, EBR10,EBR11, * PBR10,PBR11, PBR20,PBR21, TMXS0,TMXS1 integer*4 IUNRST, EPSTFL, IAPRIM logical sig_ismonotone COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), photon_xsect
![Page 324: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/324.jpg)
*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( 2097154),MED( 2097154),IRAYLR real*8 DUNIT, RHOR integer*4 KMPI, KMPO integer*2 MED, IRAYLR COMMON/PHOTIN/ EBINDA(7), GE0(7),GE1(7), GMFP0(200,7),GMFP1(200,7) *,GBR10(200,7),GBR11(200,7),GBR20(200,7),GBR21(200,7), RCO0(7),RCO1 *(7), RSCT0(100,7),RSCT1(100,7), COHE0(200,7),COHE1(200,7), DPMFP, *MPGEM(1,7), NGR(7) real*8 EBINDA, GE0,GE1, GMFP0,GMFP1, GBR10,GBR11, GBR20,GBR21, * RCO0,RCO1, RSCT0,RSCT1, COHE0,COHE1, DPMFP integer*4 * MPGEM, * NGR COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000 *),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL COMMON/UPHIIN/SINC0,SINC1,SIN0(1002),SIN1(1002) real*8 SINC0,SINC1,SIN0,SIN1 COMMON/UPHIOT/THETA,SINTHE,COSTHE,SINPHI, COSPHI,PI,TWOPI,PI5D2 real*8 THETA, SINTHE, COSTHE, SINPHI, COSPHI, PI,TWOPI,PI5D2 COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD COMMON/USERPS/n_split integer*4 n_split COMMON/USERRR/ESAVE_GLOBAL,RANGE_ECUTRR(7),IREJECT real*8 ESAVE_GLOBAL,RANGE_ECUTRR integer*4 IREJECT common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 common/ET_control/ SMAXIR,estepe,ximax, skindepth_for_bca,transpo *rt_algorithm, bca_algorithm,exact_bca,spin_effects real*8 smaxir, estepe, ximax, skindepth_for_bca integer*4 transport_algorithm, bca_algorithm logical exact_bca, spin_effects common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext
![Page 325: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/325.jpg)
*ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch common/egs_vr/ e_max_rr, prob_RR, nbr_split, i_play_RR, i_ *survived_RR, * n_RR_warning, i_do_rr real*8 e_max_rr,prob_RR integer*4 nbr_split,i_play_RR,i_survived_RR,n_RR_warning integer*2 i_do_rr CHARACTER*4 MBUF(72),MDLABL(8) real*8 ACD , ADEV , ASD , COST , CTHET , DEL , DFACT , DFAC *TI, DUNITO, DUNITR, FNSSS , P , PZNORM, RDEV , S2C2 , S2C2 *MN, S2C2MX, SINT , SX , SXX , SXY , SY , WID , XS , XS0 * , XS1 , XSI , WSS , YS , ZEROS(3) integer*4 I , I1ST , IB , ID , IE , IL , IM , IRAYL , IRN *, ISTEST, ISUB , ISS , IZ , IZZ , J , JR , LCTHET, LMDL *, LMDN , LTHETA, MD , MXSINC, NCMFP , NEKE , NGE , NGRI *M , NISUB , NLEKE , NM , NRANGE, NRNA , NSEKE , NSGE , * NSINSS, LOK(7) character*256 tmp_string integer*4 lnblnk1 DATA MDLABL/' ','M','E','D','I','U','M','='/,LMDL/8/,LMDN/24/,DUNI *TO/1./ DATA I1ST/1/,NSINSS/37/,MXSINC/1002/,ISTEST/0/,NRNA/1000/14220 FORMAT(1X,14I5)14230 FORMAT(1X,1PE14.5,4E14.5)14240 FORMAT(72A1) IF ((I1ST.NE.0)) THEN I1ST=0 DO 14251 J=1, 2097154 IF ((SMAXIR.LE.0.0)) THEN SMAXIR=1E10 END IF14251 CONTINUE14252 CONTINUE PRM=RM PRMT2=2.D0*PRM PZERO=0.0D0 NISUB=MXSINC-2 FNSSS=NSINSS WID=PI5D2/FLOAT(NISUB) WSS=WID/(FNSSS-1.0) ZEROS(1)=0. ZEROS(2)=PI ZEROS(3)=TWOPI DO 14261 ISUB=1,MXSINC SX=0. SY=0. SXX=0. SXY=0. XS0=WID*FLOAT(ISUB-2) XS1=XS0+WID IZ=0 DO 14271 IZZ=1,3 IF (((XS0.LE.ZEROS(IZZ)).AND.(ZEROS(IZZ).LE.XS1))) THEN
![Page 326: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/326.jpg)
IZ=IZZ GO TO14272 END IF14271 CONTINUE14272 CONTINUE IF ((IZ.EQ.0)) THEN XSI=XS0 ELSE XSI=ZEROS(IZ) END IF DO 14281 ISS=1,NSINSS XS=WID*FLOAT(ISUB-2)+WSS*FLOAT(ISS-1)-XSI YS=SIN(XS+XSI) SX=SX+XS SY=SY+YS SXX=SXX+XS*XS SXY=SXY+XS*YS14281 CONTINUE14282 CONTINUE IF ((IZ.NE.0)) THEN SIN1(ISUB)=SXY/SXX SIN0(ISUB)=-SIN1(ISUB)*XSI ELSE DEL=FNSSS*SXX-SX*SX SIN1(ISUB)=(FNSSS*SXY-SY*SX)/DEL SIN0(ISUB)=(SY*SXX-SX*SXY)/DEL - SIN1(ISUB)*XSI END IF14261 CONTINUE14262 CONTINUE SINC0=2.0 SINC1=1.0/WID IF ((ISTEST.NE.0)) THEN ADEV=0. RDEV=0. S2C2MN=10. S2C2MX=0. DO 14291 ISUB=1,NISUB DO 14301 ISS=1,NSINSS THETA=WID*FLOAT(ISUB-1)+WSS*FLOAT(ISS-1) CTHET=PI5D2-THETA SINTHE=sin(THETA) COSTHE=sin(CTHET) SINT=SIN(THETA) COST=COS(THETA) ASD=ABS(SINTHE-SINT) ACD=ABS(COSTHE-COST) ADEV=max(ADEV,ASD,ACD) IF((SINT.NE.0.0))RDEV=max(RDEV,ASD/ABS(SINT)) IF((COST.NE.0.0))RDEV=max(RDEV,ACD/ABS(COST)) S2C2=SINTHE**2+COSTHE**2 S2C2MN=min(S2C2MN,S2C2) S2C2MX=max(S2C2MX,S2C2) IF ((ISUB.LT.11)) THEN write(i_log,'(1PE20.7,4E20.7)') THETA,SINTHE,SINT,COSTHE * ,COST END IF14301 CONTINUE14302 CONTINUE
![Page 327: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/327.jpg)
14291 CONTINUE14292 CONTINUE write(i_log,'(a,2i5)') ' SINE TESTS,MXSINC,NSINSS=',MXSINC,NSI * NSS write(i_log,'(a,1PE16.8,3e16.8)') ' ADEV,RDEV,S2C2(MN,MX) =', * ADEV,RDEV,S2C2MN,S2C2MX ADEV=0. RDEV=0. S2C2MN=10. S2C2MX=0. DO 14311 IRN=1,NRNA IF((rng_seed .GT. 128))call ranmar_get THETA = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 THETA=THETA*PI5D2 CTHET=PI5D2-THETA SINTHE=sin(THETA) COSTHE=sin(CTHET) SINT=SIN(THETA) COST=COS(THETA) ASD=ABS(SINTHE-SINT) ACD=ABS(COSTHE-COST) ADEV=max(ADEV,ASD,ACD) IF((SINT.NE.0.0))RDEV=max(RDEV,ASD/ABS(SINT)) IF((COST.NE.0.0))RDEV=max(RDEV,ACD/ABS(COST)) S2C2=SINTHE**2+COSTHE**2 S2C2MN=min(S2C2MN,S2C2) S2C2MX=max(S2C2MX,S2C2)14311 CONTINUE14312 CONTINUE write(i_log,'(a,i7,a)') ' TEST AT ',NRNA,' RANDOM ANGLES IN (0 *,5*PI/2)' write(i_log,'(1PE16.8,3E16.8)') ' ADEV,RDEV,S2C2(MN,MX) =', AD * EV,RDEV,S2C2MN,S2C2MX END IF P=1. DO 14321 I=1,50 PWR2I(I)=P P=P/2.14321 CONTINUE14322 CONTINUE END IF DO 14331 J=1,NMED14340 CONTINUE DO 14341 I=1, 2097154 IF ((IRAYLR.EQ.1.AND.MED(I).EQ.J)) THEN IRAYLM(J)=1 GO TO 14342 END IF14341 CONTINUE14342 CONTINUE14331 CONTINUE14332 CONTINUE REWIND KMPI NM=0 DO 14351 IM=1,NMED LOK(IM)=0 IF ((IRAYLM(IM).EQ.1)) THEN
![Page 328: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/328.jpg)
write(i_log,'(a,i3/)') ' RAYLEIGH OPTION REQUESTED FOR MEDIUM *NUMBER',IM END IF14351 CONTINUE14352 CONTINUE14360 CONTINUE14361 CONTINUE14370 CONTINUE14371 CONTINUE READ(KMPI,14240,END=14380)MBUF DO 14391 IB=1,LMDL IF((MBUF(IB).NE.MDLABL(IB)))GO TO 1437114391 CONTINUE14392 CONTINUE14400 CONTINUE DO 14401 IM=1,NMED DO 14411 IB=1,LMDN IL=LMDL+IB IF((MBUF(IL).NE.MEDIA(IB,IM)))GO TO 14401 IF((IB.EQ.LMDN))GO TO 1437214411 CONTINUE14412 CONTINUE14401 CONTINUE14402 CONTINUE GO TO 1437114372 CONTINUE IF((LOK(IM).NE.0))GO TO 14370 LOK(IM)=1 NM=NM+1 read(kmpi,'(a)',err=14420) tmp_string goto 1443014420 write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'Error while reading pegs4 file' write(i_log,'(/a)') '***************** Quiting now.' call exit(1)14430 CONTINUE read(tmp_string,1,ERR=14440) (MBUF(I),I=1,5),RHO(IM),NNE(IM),IU * NRST(IM),EPSTFL(IM),IAPRIM(IM)1 FORMAT(5A1,5X,F11.0,4X,I2,9X,I1,9X,I1,9X,I1) GO TO 1445014440 CONTINUE write(i_log,*) 'Found medium with gas pressure' read(tmp_string,2) (MBUF(I),I=1,5),RHO(IM),NNE(IM),IUNRST(IM),EP * STFL(IM), IAPRIM(IM)2 FORMAT(5A1,5X,F11.0,4X,I2,26X,I1,9X,I1,9X,I1)14450 CONTINUE DO 14451 IE=1,NNE(IM) READ(KMPI,14460)(MBUF(I),I=1,6),(ASYM(IM,IE,I),I=1,2), ZELEM(I * M,IE),WA(IM,IE),PZ(IM,IE),RHOZ(IM,IE)14460 FORMAT (6A1,2A1,3X,F3.0,3X,F9.0,4X,F12.0,6X,F12.0)14451 CONTINUE14452 CONTINUE READ(KMPI,14230) RLC(IM),AE(IM),AP(IM),UE(IM),UP(IM) TE(IM)=AE(IM)-RM THMOLL(IM)=TE(IM)*2. + RM READ(KMPI,14220) MSGE(IM),MGE(IM),MSEKE(IM),MEKE(IM),MLEKE(IM),M * CMFP(IM),MRANGE(IM),IRAYL NSGE=MSGE(IM)
![Page 329: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/329.jpg)
NGE=MGE(IM) NSEKE=MSEKE(IM) NEKE=MEKE(IM) NLEKE=MLEKE(IM) NCMFP=MCMFP(IM) NRANGE=MRANGE(IM) READ(KMPI,14230)(DL1(I,IM),DL2(I,IM),DL3(I,IM),DL4(I,IM),DL5(I,I * M),DL6(I,IM),I=1,6) READ(KMPI,14230)DELCM(IM),(ALPHI(I,IM),BPAR(I,IM),DELPOS(I,IM),I * =1,2) READ(KMPI,14230)XR0(IM),TEFF0(IM),BLCC(IM),XCC(IM) READ(KMPI,14230)EKE0(IM),EKE1(IM) READ(KMPI,14230) (ESIG0(I,IM),ESIG1(I,IM),PSIG0(I,IM),PSIG1(I,IM * ),EDEDX0(I,IM),EDEDX1(I,IM),PDEDX0(I,IM),PDEDX1(I,IM),EBR10(I,IM * ),EBR11(I,IM),PBR10(I,IM),PBR11(I,IM),PBR20(I,IM),PBR21(I,IM),TM * XS0(I,IM),TMXS1(I,IM),I=1,NEKE) READ(KMPI,14230)EBINDA(IM),GE0(IM),GE1(IM) READ(KMPI,14230)(GMFP0(I,IM),GMFP1(I,IM),GBR10(I,IM),GBR11(I,IM) * ,GBR20(I,IM),GBR21(I,IM),I=1,NGE) IF ((IRAYL.EQ.1)) THEN READ(KMPI,14220) NGR(IM) NGRIM=NGR(IM) READ(KMPI,14230)RCO0(IM),RCO1(IM) READ(KMPI,14230)(RSCT0(I,IM),RSCT1(I,IM),I=1,NGRIM) READ(KMPI,14230)(COHE0(I,IM),COHE1(I,IM),I=1,NGE) write(i_log,'(a,i3,a)') ' Rayleigh data available for medium', * IM, ' in PEGS4 data set.' END IF IF ((IRAYLM(IM).EQ.1)) THEN IF ((IRAYL.NE.1)) THEN IF ((toUpper(photon_xsections(:lnblnk1(photon_xsections))).E * Q.'PEGS4')) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(a,i3 /,a /,a)') ' IN HATCH: REQUESTED RAYLEI *GH OPTION FOR MEDIUM', IM,' BUT RAYLEIGH DATA NOT INCLUDED IN PEGS *4 FILE.', ' YOU WILL NOT BE ABLE TO USE THE PEGS4 DATA WITH RAYLEI *GH ON!' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) ELSE write(i_log,'(/a)') '***************** Warning: ' write(i_log,'(a,i3 /,a)') ' IN HATCH: REQUESTED RAYLEIGH O *PTION FOR MEDIUM', IM,' BUT RAYLEIGH DATA NOT INCLUDED IN PEGS4 FI *LE.' END IF ELSE IF ((toUpper(photon_xsections(:lnblnk1(photon_xsections))).E * Q.'PEGS4')) THEN call egs_init_rayleigh_sampling(IM) END IF END IF END IF IF((NM.GE.NMED))GO TO14362 GO TO 1436114362 CONTINUE DUNITR=DUNIT IF ((DUNIT.LT.0.0)) THEN ID=MAX0(1,MIN0(7,int(-DUNIT)))
![Page 330: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/330.jpg)
DUNIT=RLC(ID) END IF IF ((DUNIT.NE.1.0)) THEN write(i_log,'(a,1PE14.5,E14.5,a)') ' DUNIT REQUESTED&USED ARE: ' * , DUNITR,DUNIT,'(CM.)' END IF DO 14471 IM=1,NMED DFACT=RLC(IM)/DUNIT DFACTI=1.0/DFACT I=1 GO TO 1448314481 I=I+114483 IF(I-(MEKE(IM)).GT.0)GO TO 14482 ESIG0(I,IM)=ESIG0(I,IM)*DFACTI ESIG1(I,IM)=ESIG1(I,IM)*DFACTI PSIG0(I,IM)=PSIG0(I,IM)*DFACTI PSIG1(I,IM)=PSIG1(I,IM)*DFACTI EDEDX0(I,IM)=EDEDX0(I,IM)*DFACTI EDEDX1(I,IM)=EDEDX1(I,IM)*DFACTI PDEDX0(I,IM)=PDEDX0(I,IM)*DFACTI PDEDX1(I,IM)=PDEDX1(I,IM)*DFACTI TMXS0(I,IM)=TMXS0(I,IM)*DFACT TMXS1(I,IM)=TMXS1(I,IM)*DFACT GO TO 1448114482 CONTINUE TEFF0(IM)=TEFF0(IM)*DFACT BLCC(IM)=BLCC(IM)*DFACTI XCC(IM)=XCC(IM)*SQRT(DFACTI) RLDU(IM)=RLC(IM)/DUNIT I=1 GO TO 1449314491 I=I+114493 IF(I-(MGE(IM)).GT.0)GO TO 14492 GMFP0(I,IM)=GMFP0(I,IM)*DFACT GMFP1(I,IM)=GMFP1(I,IM)*DFACT GO TO 1449114492 CONTINUE14471 CONTINUE14472 CONTINUE VACDST=VACDST*DUNITO/DUNIT DUNITO=DUNIT DO 14501 JR=1, 2097154 MD=MED(JR) IF (((MD.GE.1).AND.(MD.LE.NMED))) THEN ECUT=max(ECUT,AE(MD)) PCUT=max(PCUT,AP(MD)) IF ((RHOR(JR).EQ.0.0)) THEN RHOR(JR)=RHO(MD) END IF END IF14501 CONTINUE14502 CONTINUE IF ((IBRDST.EQ.1)) THEN DO 14511 IM=1,NMED ZBRANG(IM)=0.0 PZNORM=0.0 DO 14521 IE=1,NNE(IM) ZBRANG(IM)= ZBRANG(IM)+PZ(IM,IE)*ZELEM(IM,IE)*(ZELEM(IM,IE)+
![Page 331: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/331.jpg)
* 1.0) PZNORM=PZNORM+PZ(IM,IE)14521 CONTINUE14522 CONTINUE ZBRANG(IM)=(8.116224E-05)*(ZBRANG(IM)/PZNORM)**(1./3.) LZBRANG(IM)=-log(ZBRANG(IM))14511 CONTINUE14512 CONTINUE END IF IF ((IPRDST.GT.0)) THEN DO 14531 IM=1,NMED ZBRANG(IM)=0.0 PZNORM=0.0 DO 14541 IE=1,NNE(IM) ZBRANG(IM)= ZBRANG(IM)+PZ(IM,IE)*ZELEM(IM,IE)*(ZELEM(IM,IE)+ * 1.0) PZNORM=PZNORM+PZ(IM,IE)14541 CONTINUE14542 CONTINUE ZBRANG(IM)=(8.116224E-05)*(ZBRANG(IM)/PZNORM)**(1./3.)14531 CONTINUE14532 CONTINUE END IF IF ((toUpper(photon_xsections(:lnblnk1(photon_xsections))) .EQ. 'P *EGS4')) THEN write(i_log,'(/a)') '***************** Warning: ' write(i_log,'(6(a/))') 'Using photon data from PEGS4 file!!!', ' *However, the new Rayleigh angular sampling will be used.', 'The or *iginal EGS4 angular sampling undersamples large scattering ', 'ang *les. This may have little impact as Rayleigh scattering ', 'is for *ward peaked.', '************************************************** ********' ELSE call egs_init_user_photon(photon_xsections,comp_xsections,xsec_o * ut) END IF call mscati call EDGSET(1,1) call init_compton call fix_brems IF (( ibr_nist .GE. 1 )) THEN call init_nist_brems END IF IF (( pair_nrc .EQ. 1 )) THEN call init_nrc_pair END IF call eii_init call init_triplet IF ((NMED.EQ.1)) THEN write(i_log,*) ' EGSnrc SUCCESSFULLY ''HATCHED'' FOR ONE MEDIUM. *' ELSE write(i_log,'(a,i5,a)') ' EGSnrc SUCCESSFULLY ''HATCHED'' FOR ', * NMED,' MEDIA.' END IF CLOSE (UNIT=KMPI) RETURN14380 write(i_log,'(a,i2//,a/,a/)') ' END OF FILE ON UNIT ',KMPI, ' PROG
![Page 332: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/332.jpg)
*RAM STOPPED IN HATCH BECAUSE THE', ' FOLLOWING NAMES WERE NOT RECO *GNIZED:' DO 14551 IM=1,NMED IF ((LOK(IM).NE.1)) THEN write(i_log,'(40x,a,24a1,a)') '''',(MEDIA(I,IM),I=1,LMDN),'''' END IF14551 CONTINUE14552 CONTINUE STOP END subroutine fix_brems ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none COMMON/BREMPR/ DL1(8,7),DL2(8,7),DL3(8,7),DL4(8,7),DL5(8,7),DL6(8, *7), ALPHI(2,7),BPAR(2,7),DELPOS(2,7), WA(7,50),PZ(7,50),ZELEM(7,50 *),RHOZ(7,50), PWR2I(50), DELCM(7),ZBRANG(7),LZBRANG(7),NNE(7), IBR *DST,IPRDST,ibr_nist,pair_nrc,itriplet, ASYM(7,50,2) CHARACTER*4 ASYM real*8 DL1,DL2,DL3,DL4,DL5,DL6, ALPHI, BPAR, DELPOS, WA, PZ, * ZELEM, RHOZ, PWR2I, DELCM, ZBRANG, LZBRANG integer*4 NNE, IBRDST, IPRDST, ibr_nist, itriplet, pair_nrc COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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/nist_brems/ nb_fdata(0:50,100,7), nb_xdata(0:50,100,7), nb_ *wdata(50,100,7), nb_idata(50,100,7), nb_emin(7),nb_emax(7), nb_lem *in(7),nb_lemax(7), nb_dle(7),nb_dlei(7), log_ap(7) real*8 nb_fdata,nb_xdata,nb_wdata,nb_emin,nb_emax,nb_lemin,nb_lema *x, nb_dle,nb_dlei,log_ap integer*4 nb_idata COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL integer*4 medium,i real*8 Zt,Zb,Zf,Zg,Zv,fmax1,fmax2,Zi,pi,fc,xi,aux, XSIF,FCOULC DO 14561 medium=1,nmed log_ap(medium) = log(ap(medium)) Zt = 0 Zb = 0 Zf = 0 DO 14571 i=1,NNE(medium) Zi = ZELEM(medium,i) pi = PZ(medium,i) fc = FCOULC(Zi) xi = XSIF(Zi) aux = pi*Zi*(Zi + xi) Zt = Zt + aux Zb = Zb - aux*Log(Zi)/3 Zf = Zf + aux*fc14571 CONTINUE14572 CONTINUE
![Page 333: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/333.jpg)
Zv = (Zb - Zf)/Zt Zg = Zb/Zt fmax1 = 2*(20.863 + 4*Zg) - 2*(20.029 + 4*Zg)/3 fmax2 = 2*(20.863 + 4*Zv) - 2*(20.029 + 4*Zv)/3 dl1(1,medium) = (20.863 + 4*Zg)/fmax1 dl2(1,medium) = -3.242/fmax1 dl3(1,medium) = 0.625/fmax1 dl4(1,medium) = (21.12+4*Zg)/fmax1 dl5(1,medium) = -4.184/fmax1 dl6(1,medium) = 0.952 dl1(2,medium) = (20.029+4*Zg)/fmax1 dl2(2,medium) = -1.93/fmax1 dl3(2,medium) = -0.086/fmax1 dl4(2,medium) = (21.12+4*Zg)/fmax1 dl5(2,medium) = -4.184/fmax1 dl6(2,medium) = 0.952 dl1(3,medium) = (20.863 + 4*Zv)/fmax2 dl2(3,medium) = -3.242/fmax2 dl3(3,medium) = 0.625/fmax2 dl4(3,medium) = (21.12+4*Zv)/fmax2 dl5(3,medium) = -4.184/fmax2 dl6(3,medium) = 0.952 dl1(4,medium) = (20.029+4*Zv)/fmax2 dl2(4,medium) = -1.93/fmax2 dl3(4,medium) = -0.086/fmax2 dl4(4,medium) = (21.12+4*Zv)/fmax2 dl5(4,medium) = -4.184/fmax2 dl6(4,medium) = 0.952 dl1(5,medium) = (3*(20.863 + 4*Zg) - (20.029 + 4*Zg)) dl2(5,medium) = (3*(-3.242) - (-1.930)) dl3(5,medium) = (3*(0.625)-(-0.086)) dl4(5,medium) = (2*21.12+8*Zg) dl5(5,medium) = (2*(-4.184)) dl6(5,medium) = 0.952 dl1(6,medium) = (3*(20.863 + 4*Zg) + (20.029 + 4*Zg)) dl2(6,medium) = (3*(-3.242) + (-1.930)) dl3(6,medium) = (3*0.625+(-0.086)) dl4(6,medium) = (4*21.12+16*Zg) dl5(6,medium) = (4*(-4.184)) dl6(6,medium) = 0.952 dl1(7,medium) = (3*(20.863 + 4*Zv) - (20.029 + 4*Zv)) dl2(7,medium) = (3*(-3.242) - (-1.930)) dl3(7,medium) = (3*(0.625)-(-0.086)) dl4(7,medium) = (2*21.12+8*Zv) dl5(7,medium) = (2*(-4.184)) dl6(7,medium) = 0.952 dl1(8,medium) = (3*(20.863 + 4*Zv) + (20.029 + 4*Zv)) dl2(8,medium) = (3*(-3.242) + (-1.930)) dl3(8,medium) = (3*0.625+(-0.086)) dl4(8,medium) = (4*21.12+16*Zv) dl5(8,medium) = (4*(-4.184)) dl6(8,medium) = 0.952 bpar(2,medium) = dl1(7,medium)/(3*dl1(8,medium) + dl1(7,medium)) bpar(1,medium) = 12*dl1(8,medium)/(3*dl1(8,medium) + dl1(7,mediu * m))14561 CONTINUE14562 CONTINUE return
![Page 334: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/334.jpg)
end real*8 function FCOULC(Z) ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none real*8 Z real*8 fine,asq data fine/137.03604/ asq = Z/fine asq = asq*asq FCOULC = asq*(1.0/(1.0+ASQ)+0.20206+ASQ*(-0.0369+ASQ*(0.0083+ASQ*( *-0.002)))) return end real*8 function XSIF(Z) ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none real*8 Z integer*4 iZ real*8 alrad(4),alradp(4),a1440,a183,FCOULC data alrad/5.31,4.79,4.74,4.71/ data alradp/6.144,5.621,5.805,5.924/ data a1440/1194.0/,A183/184.15/ IF (( Z .LE. 4 )) THEN iZ = Z xsif = alradp(iZ)/(alrad(iZ) - FCOULC(Z)) ELSE xsif = Log(A1440*Z**(-0.666667))/(Log(A183*Z**(-0.33333))-FCOULC * (Z)) END IF return end subroutine init_compton ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none common/compton_data/ iz_array(1538), be_array(1538), Jo_array(15 *38), erfJo_array(1538), ne_array(1538), shn_array(1538), *shell_array(100,7), eno_array(100,7), eno_atbin_array(100,7), n_sh *ell(7), radc_flag, ibcmp integer*4 iz_array,ne_array,shn_array,eno_atbin_array, shell_array *,n_shell,radc_flag real*8 be_array,Jo_array,erfJo_array,eno_array integer*2 ibcmp COMMON/BREMPR/ DL1(8,7),DL2(8,7),DL3(8,7),DL4(8,7),DL5(8,7),DL6(8, *7), ALPHI(2,7),BPAR(2,7),DELPOS(2,7), WA(7,50),PZ(7,50),ZELEM(7,50 *),RHOZ(7,50), PWR2I(50), DELCM(7),ZBRANG(7),LZBRANG(7),NNE(7), IBR *DST,IPRDST,ibr_nist,pair_nrc,itriplet, ASYM(7,50,2) CHARACTER*4 ASYM real*8 DL1,DL2,DL3,DL4,DL5,DL6, ALPHI, BPAR, DELPOS, WA, PZ, * ZELEM, RHOZ, PWR2I, DELCM, ZBRANG, LZBRANG integer*4 NNE, IBRDST, IPRDST, ibr_nist, itriplet, pair_nrc COMMON/EDGE/binding_energies(6,100), interaction_prob(6,100), rela *xation_prob(39,100), edge_energies(16,100), edge_number(100), edge *_a(16,100), edge_b(16,100), edge_c(16,100), edge_d(16,100), IEDGFL *,IPHTER real*8 binding_energies, interaction_prob, relaxation_prob, e
![Page 335: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/335.jpg)
*dge_energies, edge_a,edge_b,edge_c,edge_d integer*2 IEDGFL, IPHTER integer*4 edge_number COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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( 2097154),MED( 2097154),IRAYLR real*8 DUNIT, RHOR integer*4 KMPI, KMPO integer*2 MED, IRAYLR common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch integer*4 i,j,iz,medium,nsh,j_l,j_h real*8 aux,pztot,rm,atav parameter (rm=0.5110034) real*8 aux_erf,erf1 logical getd getd = .false. DO 14581 j=1, 2097154 medium = med(j) IF (( medium .GT. 0 .AND. medium .LE. nmed)) THEN IF (( ibcmp .GT. 0 )) THEN getd = .true. GO TO14582 END IF END IF14581 CONTINUE14582 CONTINUE IF (( .NOT.getd )) THEN write(i_log,'(a/)') ' Bound Compton scattering not requested! ' return END IF write(i_log,'(a$)') ' Bound Compton scattering requested, reading *data ......' rewind(i_incoh) DO 14591 j=1,18 read(i_incoh,*)14591 CONTINUE14592 CONTINUE DO 14601 j=1,1538 read(i_incoh,*) iz_array(j),shn_array(j),ne_array(j), Jo_array(j
![Page 336: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/336.jpg)
* ),be_array(j) Jo_array(j) = Jo_array(j)*137. be_array(j) = be_array(j)*1e-6/rm aux_erf = 0.70710678119*(1+0.3*Jo_array(j)) erfJo_array(j) = 0.82436063535*(erf1(aux_erf)-1)14601 CONTINUE14602 CONTINUE write(i_log,*) ' Done' write(i_log,'(/a)') ' Initializing Bound Compton scattering ...... *' DO 14611 medium=1,nmed pztot = 0 nsh = 0 DO 14621 i=1,nne(medium) iz = int(zelem(medium,i)) DO 14631 j=1,1538 IF (( iz .EQ. iz_array(j) )) THEN nsh = nsh + 1 IF (( nsh .GT. 100 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(/a,i3,a,i4,a/,a)') ' For medium ',medium, * ' the number of shells is > ',100,'!', ' Increase the pa *rameter $MXMDSH! ' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF shell_array(nsh,medium) = j aux = pz(medium,i)*ne_array(j) eno_array(nsh,medium) = aux pztot = pztot + aux END IF14631 CONTINUE14632 CONTINUE14621 CONTINUE14622 CONTINUE IF (( nsh .EQ. 0 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(a,i3,a)') ' Medium ',medium,' has zero shells! ' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF n_shell(medium) = nsh write(i_log,'(a,i3,a,i3,a)') ' Medium ',medium,' has ',nsh,' she *lls: ' DO 14641 i=1,nsh j = shell_array(i,medium) eno_array(i,medium) = eno_array(i,medium)/pztot write(i_log,'(i3,i4,i3,f9.5,e10.3,f10.3)') i,j,shn_array(j),en * o_array(i,medium), Jo_array(j),be_array(j)*rm*1000. eno_array(i,medium) = -eno_array(i,medium) eno_atbin_array(i,medium) = i14641 CONTINUE14642 CONTINUE atav = 1./nsh DO 14651 i=1,nsh-1 DO 14661 j_h=1,nsh-1 IF (( eno_array(j_h,medium) .LT. 0 )) THEN IF((abs(eno_array(j_h,medium)) .GT. atav))GO TO14662
![Page 337: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/337.jpg)
END IF14661 CONTINUE14662 CONTINUE DO 14671 j_l=1,nsh-1 IF (( eno_array(j_l,medium) .LT. 0 )) THEN IF((abs(eno_array(j_l,medium)) .LT. atav))GO TO14672 END IF14671 CONTINUE14672 CONTINUE aux = atav - abs(eno_array(j_l,medium)) eno_array(j_h,medium) = eno_array(j_h,medium) + aux eno_array(j_l,medium) = -eno_array(j_l,medium)/atav + j_l eno_atbin_array(j_l,medium) = j_h IF((i .EQ. nsh-1))eno_array(j_h,medium) = 1 + j_h14651 CONTINUE14652 CONTINUE DO 14681 i=1,nsh IF (( eno_array(i,medium) .LT. 0 )) THEN eno_array(i,medium) = 1 + i END IF14681 CONTINUE14682 CONTINUE14611 CONTINUE14612 CONTINUE write(i_log,'(a/)') '...... Done.' getd = .false. DO 14691 j=1, 2097154 IF (( IEDGFL .GT. 0 .AND. IEDGFL .LE. 100 )) THEN getd = .true. GO TO14692 END IF14691 CONTINUE14692 CONTINUE IF((getd))return write(i_log,'(a/,a/,a/,a//)') ' In subroutine init_compton: ', ' * fluorescence not set but relaxation data are required for ', ' *bound Compton scattering. ', ' calling EDGSET. ' IEDGFL = 1 call edgset(1,1) IEDGFL = 0 return end SUBROUTINE MOLLER ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none COMMON/QDEBUG/QDEBUG LOGICAL QDEBUG COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000 *),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL COMMON/UPHIOT/THETA,SINTHE,COSTHE,SINPHI, COSPHI,PI,TWOPI,PI5D2 real*8 THETA, SINTHE, COSTHE, SINPHI, COSPHI, PI,TWOPI,PI5D2
![Page 338: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/338.jpg)
COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch common/egs_vr/ e_max_rr, prob_RR, nbr_split, i_play_RR, i_ *survived_RR, * n_RR_warning, i_do_rr real*8 e_max_rr,prob_RR integer*4 nbr_split,i_play_RR,i_survived_RR,n_RR_warning integer*2 i_do_rr common/eii_data/ eii_xsection_a( 10000), eii_xsection_b( 10000), * eii_cons(7), eii_a(40), eii_b(40), eii_z(40), eii_sh(40), eii *_nshells(100), eii_nsh(7), eii_first(7,50), eii_no(7,50), eii_ *flag real*8 eii_xsection_a,eii_xsection_b,eii_a,eii_b,eii_cons integer*4 eii_z,eii_sh,eii_nshells integer*4 eii_first,eii_no integer*4 eii_elements,eii_flag,eii_nsh COMMON/ELECIN/ esig_e(7),psig_e(7), esige_max, psige_max, range_ep *(0:1,150,7), E_array(150,7), etae_ms0(150,7),etae_ms1(150,7),etap_ *ms0(150,7),etap_ms1(150,7),q1ce_ms0(150,7),q1ce_ms1(150,7),q1cp_ms *0(150,7),q1cp_ms1(150,7),q2ce_ms0(150,7),q2ce_ms1(150,7),q2cp_ms0( *150,7),q2cp_ms1(150,7),blcce0(150,7),blcce1(150,7), EKE0(7),EKE1(7 *), XR0(7),TEFF0(7),BLCC(7),XCC(7), ESIG0(150,7),ESIG1(150,7),PSIG0 *(150,7),PSIG1(150,7),EDEDX0(150,7),EDEDX1(150,7),PDEDX0(150,7),PDE *DX1(150,7),EBR10(150,7),EBR11(150,7),PBR10(150,7),PBR11(150,7),PBR *20(150,7),PBR21(150,7),TMXS0(150,7),TMXS1(150,7), expeke1(7), IUNR *ST(7),EPSTFL(7),IAPRIM(7), sig_ismonotone(0:1,7) real*8 esig_e, psig_e, esige_max, psige_max, range_ep, E_ar *ray, etae_ms0,etae_ms1, etap_ms0,etap_ms1, q1ce_ms0,q1ce_ms1, *q1cp_ms0,q1cp_ms1, q2ce_ms0,q2ce_ms1, q2cp_ms0,q2cp_ms1, blcce0 *,blcce1, expeke1, EKE0,EKE1, XR0, TEFF0, BLCC, XCC, ESIG0,E *SIG1, PSIG0,PSIG1, EDEDX0,EDEDX1, PDEDX0,PDEDX1, EBR10,EBR11, * PBR10,PBR11, PBR20,PBR21, TMXS0,TMXS1 integer*4 IUNRST, EPSTFL, IAPRIM logical sig_ismonotone COMMON/EPCONT/EDEP,TSTEP,TUSTEP,USTEP,TVSTEP,VSTEP, RHOF,EOLD,ENEW *,EKE,ELKE,GLE,E_RANGE, x_final,y_final,z_final, u_final,v_final,w_ *final, IDISC,IROLD,IRNEW,IAUSFL(29) DOUBLE PRECISION EDEP real*8 TSTEP, TUSTEP, USTEP, VSTEP, TVSTEP, RHOF, EOLD, ENE
![Page 339: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/339.jpg)
*W, EKE, ELKE, GLE, E_RANGE, x_final,y_final,z_final, u_final, *v_final,w_final integer*4 IDISC, IROLD, IRNEW, IAUSFL COMMON/EDGE/binding_energies(6,100), interaction_prob(6,100), rela *xation_prob(39,100), edge_energies(16,100), edge_number(100), edge *_a(16,100), edge_b(16,100), edge_c(16,100), edge_d(16,100), IEDGFL *,IPHTER real*8 binding_energies, interaction_prob, relaxation_prob, e *dge_energies, edge_a,edge_b,edge_c,edge_d integer*2 IEDGFL, IPHTER integer*4 edge_number COMMON/BREMPR/ DL1(8,7),DL2(8,7),DL3(8,7),DL4(8,7),DL5(8,7),DL6(8, *7), ALPHI(2,7),BPAR(2,7),DELPOS(2,7), WA(7,50),PZ(7,50),ZELEM(7,50 *),RHOZ(7,50), PWR2I(50), DELCM(7),ZBRANG(7),LZBRANG(7),NNE(7), IBR *DST,IPRDST,ibr_nist,pair_nrc,itriplet, ASYM(7,50,2) CHARACTER*4 ASYM real*8 DL1,DL2,DL3,DL4,DL5,DL6, ALPHI, BPAR, DELPOS, WA, PZ, * ZELEM, RHOZ, PWR2I, DELCM, ZBRANG, LZBRANG integer*4 NNE, IBRDST, IPRDST, ibr_nist, itriplet, pair_nrc DOUBLE PRECISION PEIE, PEKSE2, PESE1, PESE2, PEKIN, H1, DCOS *TH real*8 EIE, EKIN, T0, E0, EXTRAE, E02, EP0, G2,G3, GMAX, *BR, R, REJF4, RNNO27, RNNO28, ESE1, ESE2 real*8 sigm,pbrem,rsh,Uj,sig_j integer*4 lelke,iele,ish,nsh,ifirst,i,jj,iZ NPold = NP PEIE=E(NP) EIE=PEIE PEKIN=PEIE-PRM EKIN=PEKIN IF (( eii_flag .GT. 0 .AND. eii_nsh(medium) .GT. 0 )) THEN Lelke=eke1(MEDIUM)*elke+eke0(MEDIUM) sigm=esig1(Lelke,MEDIUM)*elke+esig0(Lelke,MEDIUM) pbrem=ebr11(Lelke,MEDIUM)*elke+ebr10(Lelke,MEDIUM) sigm = sigm*(1 - pbrem) IF((rng_seed .GT. 128))call ranmar_get rsh = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 rsh = sigm*rsh DO 14701 iele=1,nne(medium) iZ = int(zelem(medium,iele)+0.5) nsh = eii_no(medium,iele) IF (( nsh .GT. 0 )) THEN ifirst = eii_first(medium,iele) DO 14711 ish=1,nsh Uj = binding_energies(ish,iZ) IF (( ekin .GT. Uj .AND. (Uj .GT. te(medium) .OR. Uj .GT. * ap(medium)) )) THEN jj = ifirst + ish - 1 i = eii_a(jj)*elke + eii_b(jj) + (jj-1)*250 sig_j = eii_xsection_a(i)*elke + eii_xsection_b(i) sig_j = sig_j*pz(medium,iele)*eii_cons(medium) rsh = rsh - sig_j IF (( rsh .LT. 0 )) THEN call eii_sample(ish,iZ,Uj) return END IF END IF
![Page 340: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/340.jpg)
14711 CONTINUE14712 CONTINUE END IF14701 CONTINUE14702 CONTINUE END IF IF((ekin .LE. 2*te(medium)))return T0=EKIN/RM E0=T0+1.0 EXTRAE = EIE - THMOLL(MEDIUM) E02=E0*E0 EP0=TE(MEDIUM)/EKIN G2=T0*T0/E02 G3=(2.*T0+1.)/E02 GMAX=(1.+1.25*G2)14721 CONTINUE IF((rng_seed .GT. 128))call ranmar_get RNNO27 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 BR = TE(MEDIUM)/(EKIN-EXTRAE*RNNO27) R=BR/(1.-BR) IF((rng_seed .GT. 128))call ranmar_get RNNO28 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 REJF4=(1.+G2*BR*BR+R*(R-G3)) RNNO28=GMAX*RNNO28 IF((RNNO28.LE.REJF4))GO TO14722 GO TO 1472114722 CONTINUE PEKSE2=BR*EKIN PESE1=PEIE-PEKSE2 PESE2=PEKSE2+PRM ESE1=PESE1 ESE2=PESE2 E(NP)=PESE1 IF (( np+1 .GT. 10000 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(//,a,a,a,/,a,i6,a,i6,/,a)') ' In subroutine ','MOL *LER', ' stack size exceeded! ',' $MXSTACK = ',10000,' np = ',np+1, * ' Increase $MXSTACK and try again ' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF E(NP+1)=PESE2 H1=(PEIE+PRM)/PEKIN DCOSTH=H1*(PESE1-PRM)/(PESE1+PRM) SINTHE=DSQRT(1.D0-DCOSTH) COSTHE=DSQRT(DCOSTH) CALL UPHI(2,1) NP=NP+1 IQ(NP)=-1 DCOSTH=H1*(PESE2-PRM)/(PESE2+PRM) SINTHE=-DSQRT(1.D0-DCOSTH) COSTHE=DSQRT(DCOSTH) CALL UPHI(3,2) RETURN END subroutine mscati
![Page 341: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/341.jpg)
! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none real*8 ededx,ei,eil,eip1,eip1l,si,sip1,eke,elke,aux,ecutmn,tstbm,t *stbmn real*8 p2,beta2,rm,dedx0,ekef,elkef,estepx,ektmp,elktmp,chi_a2 integer*4 i,leil,leip1l,medium,neke,lelke,lelkef,lelktmp logical ise_monoton, isp_monoton real*8 sigee,sigep,sig,sige_old,sigp_old COMMON/BOUNDS/ECUT,PCUT,VACDST real*8 ECUT, PCUT, VACDST COMMON/ELECIN/ esig_e(7),psig_e(7), esige_max, psige_max, range_ep *(0:1,150,7), E_array(150,7), etae_ms0(150,7),etae_ms1(150,7),etap_ *ms0(150,7),etap_ms1(150,7),q1ce_ms0(150,7),q1ce_ms1(150,7),q1cp_ms *0(150,7),q1cp_ms1(150,7),q2ce_ms0(150,7),q2ce_ms1(150,7),q2cp_ms0( *150,7),q2cp_ms1(150,7),blcce0(150,7),blcce1(150,7), EKE0(7),EKE1(7 *), XR0(7),TEFF0(7),BLCC(7),XCC(7), ESIG0(150,7),ESIG1(150,7),PSIG0 *(150,7),PSIG1(150,7),EDEDX0(150,7),EDEDX1(150,7),PDEDX0(150,7),PDE *DX1(150,7),EBR10(150,7),EBR11(150,7),PBR10(150,7),PBR11(150,7),PBR *20(150,7),PBR21(150,7),TMXS0(150,7),TMXS1(150,7), expeke1(7), IUNR *ST(7),EPSTFL(7),IAPRIM(7), sig_ismonotone(0:1,7) real*8 esig_e, psig_e, esige_max, psige_max, range_ep, E_ar *ray, etae_ms0,etae_ms1, etap_ms0,etap_ms1, q1ce_ms0,q1ce_ms1, *q1cp_ms0,q1cp_ms1, q2ce_ms0,q2ce_ms1, q2cp_ms0,q2cp_ms1, blcce0 *,blcce1, expeke1, EKE0,EKE1, XR0, TEFF0, BLCC, XCC, ESIG0,E *SIG1, PSIG0,PSIG1, EDEDX0,EDEDX1, PDEDX0,PDEDX1, EBR10,EBR11, * PBR10,PBR11, PBR20,PBR21, TMXS0,TMXS1 integer*4 IUNRST, EPSTFL, IAPRIM logical sig_ismonotone COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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( 2097154),MED( 2097154),IRAYLR real*8 DUNIT, RHOR integer*4 KMPI, KMPO integer*2 MED, IRAYLR common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 common/ET_control/ SMAXIR,estepe,ximax, skindepth_for_bca,transpo *rt_algorithm, bca_algorithm,exact_bca,spin_effects real*8 smaxir, estepe, ximax, skindepth_for_bca integer*4 transport_algorithm, bca_algorithm logical exact_bca, spin_effects common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch
![Page 342: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/342.jpg)
character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch IF (( bca_algorithm .EQ. 0 )) THEN exact_bca = .true. ELSE exact_bca = .false. END IF IF (( estepe .LE. 0 .OR. estepe .GE. 1)) THEN estepe = 0.25 END IF IF (( ximax .LE. 0 .OR. ximax .GE. 1 )) THEN IF (( exact_bca )) THEN ximax = 0.5 ELSE ximax = 0.5 END IF END IF IF ((transport_algorithm .NE. 0 .AND. transport_algorithm .NE. 1 . *AND. transport_algorithm .NE. 2 )) THEN transport_algorithm = 0 END IF IF (( skindepth_for_bca .LE. 1e-4 )) THEN IF (( .NOT.exact_bca )) THEN write(i_log,*) ' old PRESTA calculates default min. step-size *for BCA: ' ecutmn = 1e30 DO 14731 i=1, 2097154 IF (( med(i) .GT. 0 .AND. med(i) .LE. nmed )) THEN ecutmn = Min(ecutmn,ECUT) END IF14731 CONTINUE14732 CONTINUE write(i_log,*) ' minimum ECUT found: ',ecutmn tstbmn = 1e30 DO 14741 medium=1,nmed tstbm = (ecutmn-0.5110034)*(ecutmn+0.5110034)/ecutmn**2 tstbm = blcc(medium)*tstbm*(ecutmn/xcc(medium))**2 aux = Log(tstbm) IF((aux .GT. 300))write(i_log,*) 'aux > 300 ? ',aux tstbm = Log(tstbm/aux) tstbmn = Min(tstbmn,tstbm)14741 CONTINUE14742 CONTINUE write(i_log,*) ' default BLCMIN is: ',tstbmn skindepth_for_bca = Exp(tstbmn) write(i_log,*) ' this corresponds to ',skindepth_for_bca, * ' elastic MFPs ' ELSE skindepth_for_bca = 3 END IF END IF call init_ms_SR DO 14751 medium=1,nmed
![Page 343: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/343.jpg)
blcc(medium) = 1.16699413758864573*blcc(medium) xcc(medium) = xcc(medium)**214751 CONTINUE14752 CONTINUE IF (( spin_effects )) THEN call init_spin END IF write(i_log,*) ' ' esige_max = 0 psige_max = 0 DO 14761 medium=1,nmed sigee = 1E-15 sigep = 1E-15 neke = meke(medium) ise_monoton = .true. isp_monoton = .true. sige_old = -1 sigp_old = -1 DO 14771 i=1,neke ei = exp((float(i) - eke0(medium))/eke1(medium)) eil = log(ei) leil = i ededx=ededx1(Leil,MEDIUM)*eil+ededx0(Leil,MEDIUM) sig=esig1(Leil,MEDIUM)*eil+esig0(Leil,MEDIUM) sig = sig/ededx IF((sig .GT. sigee))sigee = sig IF((sig .LT. sige_old))ise_monoton = .false. sige_old = sig ededx=pdedx1(Leil,MEDIUM)*eil+pdedx0(Leil,MEDIUM) sig=psig1(Leil,MEDIUM)*eil+psig0(Leil,MEDIUM) sig = sig/ededx IF((sig .GT. sigep))sigep = sig IF((sig .LT. sigp_old))isp_monoton = .false. sigp_old = sig14771 CONTINUE14772 CONTINUE write(i_log,*) ' Medium ',medium,' sige = ',sigee,sigep,' monoto *ne = ', ise_monoton,isp_monoton sig_ismonotone(0,medium) = ise_monoton sig_ismonotone(1,medium) = isp_monoton esig_e(medium) = sigee psig_e(medium) = sigep IF((sigee .GT. esige_max))esige_max = sigee IF((sigep .GT. psige_max))psige_max = sigep14761 CONTINUE14762 CONTINUE write(i_log,*) ' ' write(i_log,*) ' Initializing tmxs for estepe = ',estepe,' and xim *ax = ',ximax write(i_log,*) ' ' rm = 0.5110034 DO 14781 medium=1,nmed ei = exp((1 - eke0(medium))/eke1(medium)) eil = log(ei) leil = 1 E_array(1,medium) = ei expeke1(medium) = Exp(1./eke1(medium))-1 range_ep(0,1,medium) = 0
![Page 344: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/344.jpg)
range_ep(1,1,medium) = 0 neke = meke(medium) DO 14791 i=1,neke - 1 eip1 = exp((float(i + 1) - eke0(medium))/eke1(medium)) E_array(i+1,medium) = eip1 eke = 0.5*(eip1+ei) elke = Log(eke) Lelke=eke1(MEDIUM)*elke+eke0(MEDIUM) ededx=pdedx1(Lelke,MEDIUM)*elke+pdedx0(Lelke,MEDIUM) aux = pdedx1(i,medium)/ededx range_ep(1,i+1,medium) = range_ep(1,i,medium) + (eip1-ei)/eded * x*(1+aux*(1+2*aux)*((eip1-ei)/eke)**2/24) ededx=ededx1(Lelke,MEDIUM)*elke+ededx0(Lelke,MEDIUM) aux = ededx1(i,medium)/ededx range_ep(0,i+1,medium) = range_ep(0,i,medium) + (eip1-ei)/eded * x*(1+aux*(1+2*aux)*((eip1-ei)/eke)**2/24) ei = eip114791 CONTINUE14792 CONTINUE eil = (1 - eke0(medium))/eke1(medium) ei = Exp(eil) leil = 1 p2 = ei*(ei+2*rm) beta2 = p2/(p2+rm*rm) chi_a2 = Xcc(medium)/(4*p2*blcc(medium)) dedx0=ededx1(Leil,MEDIUM)*eil+ededx0(Leil,MEDIUM) estepx = 2*p2*beta2*dedx0/ei/Xcc(medium)/(Log(1+1./chi_a2)*(1+ch * i_a2)-1) estepx = estepx*ximax IF (( estepx .GT. estepe )) THEN estepx = estepe END IF si = estepx*ei/dedx0 DO 14801 i=1,neke - 1 elke = (i + 1 - eke0(medium))/eke1(medium) eke = Exp(elke) lelke = i+1 p2 = eke*(eke+2*rm) beta2 = p2/(p2+rm*rm) chi_a2 = Xcc(medium)/(4*p2*blcc(medium)) ededx=ededx1(Lelke,MEDIUM)*elke+ededx0(Lelke,MEDIUM) estepx = 2*p2*beta2*ededx/eke/ Xcc(medium)/(Log(1+1./chi_a2)*( * 1+chi_a2)-1) estepx = estepx*ximax IF (( estepx .GT. estepe )) THEN estepx = estepe END IF ekef = (1-estepx)*eke IF (( ekef .LE. E_array(1,medium) )) THEN sip1 = (E_array(1,medium) - ekef)/dedx0 ekef = E_array(1,medium) elkef = (1 - eke0(medium))/eke1(medium) lelkef = 1 ELSE elkef = Log(ekef) Lelkef=eke1(MEDIUM)*elkef+eke0(MEDIUM) leip1l = lelkef + 1 eip1l = (leip1l - eke0(medium))/eke1(medium)
![Page 345: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/345.jpg)
eip1 = E_array(leip1l,medium) aux = (eip1 - ekef)/eip1 elktmp = 0.5*(elkef+eip1l+0.25*aux*aux*(1+aux*(1+0.875*aux)) * ) ektmp = 0.5*(ekef+eip1) lelktmp = lelkef ededx=ededx1(Lelktmp,MEDIUM)*elktmp+ededx0(Lelktmp,MEDIUM) aux = ededx1(lelktmp,medium)/ededx sip1 = (eip1 - ekef)/ededx*( 1+aux*(1+2*aux)*((eip1-ekef)/ek * tmp)**2/24) END IF sip1 = sip1 + range_ep(0,lelke,medium) - range_ep(0,lelkef+1,m * edium) tmxs1(i,medium) = (sip1 - si)*eke1(medium) tmxs0(i,medium) = sip1 - tmxs1(i,medium)*elke si = sip114801 CONTINUE14802 CONTINUE tmxs0(neke,medium) = tmxs0(neke - 1,medium) tmxs1(neke,medium) = tmxs1(neke - 1,medium)14781 CONTINUE14782 CONTINUE return end subroutine mscat(lambda,chia2,q1,elke,beta2,qel,medium, spin_effec *ts,find_index,spin_index, cost,sint) ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none real*8 lambda, chia2,q1,elke,beta2,cost,sint integer*4 qel,medium logical spin_effects,find_index,spin_index common/ms_data/ ums_array(0:63,0:7,0:31), fms_array(0:63,0:7,0:31) *, wms_array(0:63,0:7,0:31), ims_array(0:63,0:7,0:31), llammin,llam *max,dllamb,dllambi,dqms,dqmsi real*4 ums_array,fms_array,wms_array, llammin,llammax,dllamb,dllam *bi,dqms,dqmsi integer*2 ims_array common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch real*8 sprob,explambda,wsum,wprob,xi,rejf,spin_rejection, cosz,sin *z,phi,omega2,llmbda,ai,aj,ak,a,u,du,x1,rnno integer*4 icount,i,j,k
![Page 346: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/346.jpg)
save i,j,omega2 IF ((lambda .LE. 13.8)) THEN IF((rng_seed .GT. 128))call ranmar_get sprob = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 explambda = Exp(-lambda) IF ((sprob .LT. explambda)) THEN cost = 1 sint = 0 return END IF wsum = (1+lambda)*explambda IF (( sprob .LT. wsum )) THEN14810 CONTINUE IF((rng_seed .GT. 128))call ranmar_get xi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 xi = 2*chia2*xi/(1 - xi + chia2) cost = 1 - xi IF (( spin_effects )) THEN rejf = spin_rejection(qel,medium,elke,beta2,q1,cost, spin_in * dex,.false.) IF((rng_seed .GT. 128))call ranmar_get rnno = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( rnno .GT. rejf )) THEN GOTO 14810 END IF END IF sint = sqrt(xi*(2 - xi)) return END IF IF (( lambda .LE. 1 )) THEN wprob = explambda wsum = explambda cost = 1 sint = 0 icount = 014821 CONTINUE icount = icount + 1 IF((icount .GT. 20))GO TO14822 wprob = wprob*lambda/icount wsum = wsum + wprob14830 CONTINUE IF((rng_seed .GT. 128))call ranmar_get xi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 xi = 2*chia2*xi/(1 - xi + chia2) cosz = 1 - xi IF (( spin_effects )) THEN rejf = spin_rejection(qel,medium,elke,beta2,q1,cosz, spin_ * index,.false.) IF((rng_seed .GT. 128))call ranmar_get rnno = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( rnno .GT. rejf )) THEN GOTO 14830 END IF
![Page 347: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/347.jpg)
END IF sinz = xi*(2 - xi) IF (( sinz .GT. 1.e-20 )) THEN sinz = Sqrt(sinz) IF((rng_seed .GT. 128))call ranmar_get xi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 phi = xi*6.2831853 cost = cost*cosz - sint*sinz*Cos(phi) sint = Sqrt(Max(0.0,(1-cost)*(1+cost))) END IF IF((( wsum .GT. sprob)))GO TO14822 GO TO 1482114822 CONTINUE return END IF END IF IF ((lambda .LE. 1e5 )) THEN IF ((find_index)) THEN llmbda = log(lambda) ai = llmbda*dllambi i = ai ai = ai - i IF((rng_seed .GT. 128))call ranmar_get xi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((xi .LT. ai))i = i + 1 IF (( q1 .LT. 1e-3 )) THEN j = 0 ELSE IF(( q1 .LT. 0.5 )) THEN aj = q1*dqmsi j = aj aj = aj - j IF((rng_seed .GT. 128))call ranmar_get xi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((xi .LT. aj))j = j + 1 ELSE j = 7 END IF IF ((llmbda .LT. 2.2299)) THEN omega2 = chia2*(lambda + 4)*(1.347006 + llmbda*( 0.209364 - * llmbda*(0.45525 - llmbda*(0.50142 - 0.081234*llmbda)))) ELSE omega2 = chia2*(lambda + 4)*(-2.77164 + llmbda*(2.94874 - ll * mbda*(0.1535754 - llmbda*0.00552888))) END IF find_index = .false. END IF14840 CONTINUE IF((rng_seed .GT. 128))call ranmar_get xi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 ak = xi*31 k = ak ak = ak - k IF((ak .GT. wms_array(i,j,k)))k = ims_array(i,j,k) a = fms_array(i,j,k)
![Page 348: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/348.jpg)
u = ums_array(i,j,k) du = ums_array(i,j,k+1) - u IF((rng_seed .GT. 128))call ranmar_get xi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( abs(a) .LT. 0.2 )) THEN x1 = 0.5*(1-xi)*a u = u + xi*du*(1+x1*(1-xi*a)) ELSE u = u - du/a*(1-Sqrt(1+xi*a*(2+a))) END IF xi = omega2*u/(1 + 0.5*omega2 - u) IF (( xi .GT. 1.99999 )) THEN xi = 1.99999 END IF cost = 1 - xi IF (( spin_effects )) THEN rejf=spin_rejection(qel,medium,elke,beta2,q1,cost,spin_index,. * false.) IF((rng_seed .GT. 128))call ranmar_get rnno = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( rnno .GT. rejf )) THEN GOTO 14840 END IF END IF sint = sqrt(xi*(2-xi)) return END IF write(i_log,*) ' ' write(i_log,*) ' *************************************' write(i_log,*) ' Maximum step size in mscat exceeded! ' write(i_log,*) ' Maximum step size initialized: 100000' write(i_log,*) ' Present lambda: ',lambda write(i_log,*) ' chia2: ',chia2 write(i_log,*) ' q1 elke beta2: ',q1,elke,beta2 write(i_log,*) ' medium: ',medium write(i_log,'(/a)') '***************** Error: ' write(i_log,*) ' Stopping execution' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) end real*8 function spin_rejection(qel,medium,elke,beta2,q1,cost, spin *_index,is_single) ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none real*8 elke,beta2,q1,cost integer*4 qel,medium logical spin_index,is_single common/spin_data/ spin_rej(7,0:1,0: 31,0:15,0:31), espin_min,espin *_max,espml,b2spin_min,b2spin_max, dbeta2,dbeta2i,dlener,dleneri,dq *q1,dqq1i, fool_intel_optimizer real*4 spin_rej,espin_min,espin_max,espml,b2spin_min,b2spin_max, d *beta2,dbeta2i,dlener,dleneri,dqq1,dqq1i logical fool_intel_optimizer common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed
![Page 349: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/349.jpg)
integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 real*8 rnno,ai,qq1,aj,xi,ak integer*4 i,j,k save i,j IF (( spin_index )) THEN spin_index = .false. IF (( beta2 .GE. b2spin_min )) THEN ai = (beta2 - b2spin_min)*dbeta2i i = ai ai = ai - i i = i + 15 + 1 ELSE IF(( elke .GT. espml )) THEN ai = (elke - espml)*dleneri i = ai ai = ai - i ELSE i = 0 ai = -1 END IF IF((rng_seed .GT. 128))call ranmar_get rnno = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rnno .LT. ai))i = i + 1 IF (( is_single )) THEN j = 0 ELSE qq1 = 2*q1 qq1 = qq1/(1 + qq1) aj = qq1*dqq1i j = aj IF (( j .GE. 15 )) THEN j = 15 ELSE aj = aj - j IF((rng_seed .GT. 128))call ranmar_get rnno = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rnno .LT. aj))j = j + 1 END IF END IF END IF xi = Sqrt(0.5*(1-cost)) ak = xi*31 k = ak ak = ak - k spin_rejection = (1-ak)*spin_rej(medium,qel,i,j,k) + ak*spin_rej(m *edium,qel,i,j,k+1) return end subroutine sscat(chia2,elke,beta2,qel,medium,spin_effects,cost,sin *t) ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none real*8 chia2,elke,beta2,cost,sint integer*4 qel,medium
![Page 350: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/350.jpg)
logical spin_effects common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 real*8 xi,rnno,rejf,spin_rejection,qzero logical spin_index spin_index = .true.14850 CONTINUE IF((rng_seed .GT. 128))call ranmar_get xi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 xi = 2*chia2*xi/(1 - xi + chia2) cost = 1 - xi IF (( spin_effects )) THEN qzero=0 rejf = spin_rejection(qel,medium,elke,beta2,qzero,cost,spin_inde * x,.true.) IF((rng_seed .GT. 128))call ranmar_get rnno = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rnno .GT. rejf))goto 14850 END IF sint = sqrt(xi*(2 - xi)) return end subroutine init_ms_SR ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none common/ms_data/ ums_array(0:63,0:7,0:31), fms_array(0:63,0:7,0:31) *, wms_array(0:63,0:7,0:31), ims_array(0:63,0:7,0:31), llammin,llam *max,dllamb,dllambi,dqms,dqmsi real*4 ums_array,fms_array,wms_array, llammin,llammax,dllamb,dllam *bi,dqms,dqmsi integer*2 ims_array common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch integer*4 i,j,k write(i_log,'(a,$)') ' Reading screened Rutherford MS data ...... *......... ' rewind(i_mscat) DO 14861 i=0,63 DO 14871 j=0,7 read(i_mscat,*) (ums_array(i,j,k),k=0,31) read(i_mscat,*) (fms_array(i,j,k),k=0,31) read(i_mscat,*) (wms_array(i,j,k),k=0,31-1)
![Page 351: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/351.jpg)
read(i_mscat,*) (ims_array(i,j,k),k=0,31-1) DO 14881 k=0,31-1 fms_array(i,j,k) = fms_array(i,j,k+1)/fms_array(i,j,k)-1 ims_array(i,j,k) = ims_array(i,j,k)-114881 CONTINUE14882 CONTINUE fms_array(i,j,31)=fms_array(i,j,31-1)14871 CONTINUE14872 CONTINUE14861 CONTINUE14862 CONTINUE write(i_log,'(a)') ' done ' llammin = Log(1.) llammax = Log(1e5) dllamb = (llammax-llammin)/63 dllambi = 1./dllamb dqms = 0.5/7 dqmsi = 1./dqms return end subroutine init_spin ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none common/spin_data/ spin_rej(7,0:1,0: 31,0:15,0:31), espin_min,espin *_max,espml,b2spin_min,b2spin_max, dbeta2,dbeta2i,dlener,dleneri,dq *q1,dqq1i, fool_intel_optimizer real*4 spin_rej,espin_min,espin_max,espml,b2spin_min,b2spin_max, d *beta2,dbeta2i,dlener,dleneri,dqq1,dqq1i logical fool_intel_optimizer COMMON/ELECIN/ esig_e(7),psig_e(7), esige_max, psige_max, range_ep *(0:1,150,7), E_array(150,7), etae_ms0(150,7),etae_ms1(150,7),etap_ *ms0(150,7),etap_ms1(150,7),q1ce_ms0(150,7),q1ce_ms1(150,7),q1cp_ms *0(150,7),q1cp_ms1(150,7),q2ce_ms0(150,7),q2ce_ms1(150,7),q2cp_ms0( *150,7),q2cp_ms1(150,7),blcce0(150,7),blcce1(150,7), EKE0(7),EKE1(7 *), XR0(7),TEFF0(7),BLCC(7),XCC(7), ESIG0(150,7),ESIG1(150,7),PSIG0 *(150,7),PSIG1(150,7),EDEDX0(150,7),EDEDX1(150,7),PDEDX0(150,7),PDE *DX1(150,7),EBR10(150,7),EBR11(150,7),PBR10(150,7),PBR11(150,7),PBR *20(150,7),PBR21(150,7),TMXS0(150,7),TMXS1(150,7), expeke1(7), IUNR *ST(7),EPSTFL(7),IAPRIM(7), sig_ismonotone(0:1,7) real*8 esig_e, psig_e, esige_max, psige_max, range_ep, E_ar *ray, etae_ms0,etae_ms1, etap_ms0,etap_ms1, q1ce_ms0,q1ce_ms1, *q1cp_ms0,q1cp_ms1, q2ce_ms0,q2ce_ms1, q2cp_ms0,q2cp_ms1, blcce0 *,blcce1, expeke1, EKE0,EKE1, XR0, TEFF0, BLCC, XCC, ESIG0,E *SIG1, PSIG0,PSIG1, EDEDX0,EDEDX1, PDEDX0,PDEDX1, EBR10,EBR11, * PBR10,PBR11, PBR20,PBR21, TMXS0,TMXS1 integer*4 IUNRST, EPSTFL, IAPRIM logical sig_ismonotone COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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
![Page 352: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/352.jpg)
COMMON/BREMPR/ DL1(8,7),DL2(8,7),DL3(8,7),DL4(8,7),DL5(8,7),DL6(8, *7), ALPHI(2,7),BPAR(2,7),DELPOS(2,7), WA(7,50),PZ(7,50),ZELEM(7,50 *),RHOZ(7,50), PWR2I(50), DELCM(7),ZBRANG(7),LZBRANG(7),NNE(7), IBR *DST,IPRDST,ibr_nist,pair_nrc,itriplet, ASYM(7,50,2) CHARACTER*4 ASYM real*8 DL1,DL2,DL3,DL4,DL5,DL6, ALPHI, BPAR, DELPOS, WA, PZ, * ZELEM, RHOZ, PWR2I, DELCM, ZBRANG, LZBRANG integer*4 NNE, IBRDST, IPRDST, ibr_nist, itriplet, pair_nrc COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch real*8 eta_array(0:1,0: 31), c_array(0:1,0: 31),g_array(0:1,0: 31) *, earray(0: 31),tmp_array(0: 31), sum_Z2,sum_Z,sum_A,sum_pz,Z,tmp, *Z23,g_m,g_r,sig,dedx, tau,tauc,beta2,eta,gamma,fmax, eil,e,si1e,si *2e,si1p,si2p,aae,etap, elarray(0: 31),farray(0: 31), af(0: 31),bf( *0: 31),cf(0: 31), df(0: 31),spline,dloge,eloge real*4 dum1,dum2,dum3,aux_o real*4 fmax_array(0:15) integer*2 i2_array(512),ii2 integer*4 medium,iq,i,j,k,i_ele,iii,iZ,iiZ,n_ener,n_q,n_point,je,n *eke, ndata,leil,length,ii4,irec character spin_file*256 character*6 string integer*4 lnblnk1 integer*4 spin_unit, rec_length, want_spin_unit integer egs_get_unit character data_version*32,endianess*4 logical swap real*8 fine,TF_constant parameter (fine=137.03604,TF_constant=0.88534138) real*4 tmp_4 character c_2(2), c_4(4) equivalence (ii2,c_2), (tmp_4,c_4) DO 14891 i=1,len(spin_file) spin_file(i:i) = ' '14891 CONTINUE14892 CONTINUE spin_file = hen_house(:lnblnk1(hen_house)) // 'data' // '/' // 'sp *inms.data' want_spin_unit = 61 spin_unit = egs_get_unit(want_spin_unit) IF (( spin_unit .LT. 1 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'init_spin: failed to get a free fortran unit' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF
![Page 353: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/353.jpg)
rec_length = 276*4 open(spin_unit,file=spin_file,form='unformatted',access='direct', *status='old',recl=rec_length,err=14900) read(spin_unit,rec=1,err=14910) data_version,endianess, espin_min, *espin_max,b2spin_min,b2spin_max swap = endianess.ne.'1234' IF (( swap )) THEN tmp_4 = espin_min call egs_swap_4(c_4) espin_min = tmp_4 tmp_4 = espin_max call egs_swap_4(c_4) espin_max = tmp_4 tmp_4 = b2spin_min call egs_swap_4(c_4) b2spin_min = tmp_4 tmp_4 = b2spin_max call egs_swap_4(c_4) b2spin_max = tmp_4 END IF write(i_log,'(//a,a)') 'Reading spin data base from ',spin_file(:l *nblnk1(spin_file)) write(i_log,'(a)') data_version write(i_log,'(a,a,a)') 'Data generated on a machine with ',endiane *ss, ' endianess' write(i_log,'(a,a)') 'The endianess of this CPU is ','1234' IF((swap))write(i_log,'(a)') '=> will need to do byte swaping' write(i_log,'(a,2f9.2,2f9.5,//)') 'Ranges: ',espin_min,espin_max, *b2spin_min,b2spin_max n_ener = 15 n_q = 15 n_point = 31 dloge = log(espin_max/espin_min)/n_ener eloge = log(espin_min) earray(0) = espin_min IF (( fool_intel_optimizer )) THEN write(25,*) 'Energy grid:' END IF DO 14921 i=1,n_ener eloge = eloge + dloge earray(i) = exp(eloge) IF (( fool_intel_optimizer )) THEN write(25,*) i,earray(i) END IF14921 CONTINUE14922 CONTINUE dbeta2 = (b2spin_max - b2spin_min)/n_ener beta2 = b2spin_min earray(n_ener+1) = espin_max DO 14931 i=n_ener+2,2*n_ener+1 beta2 = beta2 + dbeta2 IF (( beta2 .LT. 0.999 )) THEN earray(i) = 511.0034*(1/sqrt(1-beta2)-1) ELSE earray(i) = 50585.1 END IF IF (( fool_intel_optimizer )) THEN write(25,*) i,earray(i)
![Page 354: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/354.jpg)
END IF14931 CONTINUE14932 CONTINUE espin_min = espin_min/1000 espin_max = espin_max/1000 dlener = Log(espin_max/espin_min)/15 dleneri = 1/dlener espml = Log(espin_min) dbeta2 = (b2spin_max-b2spin_min)/15 dbeta2i = 1/dbeta2 dqq1 = 0.5/15 dqq1i = 1/dqq1 DO 14941 medium=1,NMED write(i_log,'(a,i4,a,$)') ' medium ',medium,' ................. *.... ' DO 14951 iq=0,1 DO 14961 i=0, 31 eta_array(iq,i)=0 c_array(iq,i)=0 g_array(iq,i)=0 DO 14971 j=0,15 DO 14981 k=0,31 spin_rej(medium,iq,i,j,k) = 014981 CONTINUE14982 CONTINUE14971 CONTINUE14972 CONTINUE14961 CONTINUE14962 CONTINUE14951 CONTINUE14952 CONTINUE sum_Z2=0 sum_A=0 sum_pz=0 sum_Z=0 DO 14991 i_ele=1,NNE(medium) Z = ZELEM(medium,i_ele) iZ = int(Z+0.5) IF (( fool_intel_optimizer )) THEN write(25,*) ' Z = ',iZ END IF tmp = PZ(medium,i_ele)*Z*(Z+1) sum_Z2 = sum_Z2 + tmp sum_Z = sum_Z + PZ(medium,i_ele)*Z sum_A = sum_A + PZ(medium,i_ele)*WA(medium,i_ele) sum_pz = sum_pz + PZ(medium,i_ele) Z23 = Z**0.6666667 DO 15001 iq=0,1 DO 15011 i=0, 31 irec = 1 + (iz-1)*4*(n_ener+1) + 2*iq*(n_ener+1) + i+1 IF (( fool_intel_optimizer )) THEN write(25,*) '**** energy ',i,earray(i),irec END IF read(spin_unit,rec=irec,err=14910) dum1,dum2,dum3,aux_o,fm * ax_array,i2_array IF (( swap )) THEN tmp_4 = dum1 call egs_swap_4(c_4)
![Page 355: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/355.jpg)
dum1 = tmp_4 tmp_4 = dum2 call egs_swap_4(c_4) dum2 = tmp_4 tmp_4 = dum3 call egs_swap_4(c_4) dum3 = tmp_4 tmp_4 = aux_o call egs_swap_4(c_4) aux_o = tmp_4 END IF eta_array(iq,i)=eta_array(iq,i)+tmp*Log(Z23*aux_o) tau = earray(i)/511.0034 beta2 = tau*(tau+2)/(tau+1)**2 eta = Z23/(fine*TF_constant)**2*aux_o/4/tau/(tau+2) c_array(iq,i)=c_array(iq,i)+ tmp*(Log(1+1/eta)-1/(1+eta))* * dum1*dum3 g_array(iq,i)=g_array(iq,i)+tmp*dum2 DO 15021 j=0,15 tmp_4 = fmax_array(j) IF((swap))call egs_swap_4(c_4) DO 15031 k=0,31 ii2 = i2_array((n_point+1)*j + k+1) IF((swap))call egs_swap_2(c_2) ii4 = ii2 IF((ii4 .LT. 0))ii4 = ii4 + 65536 dum1 = ii4 dum1 = dum1*tmp_4/65535 spin_rej(medium,iq,i,j,k) = spin_rej(medium,iq,i,j,k) * + tmp*dum115031 CONTINUE15032 CONTINUE15021 CONTINUE15022 CONTINUE15011 CONTINUE15012 CONTINUE15001 CONTINUE15002 CONTINUE14991 CONTINUE14992 CONTINUE DO 15041 iq=0,1 DO 15051 i=0, 31 DO 15061 j=0,15 fmax = 0 DO 15071 k=0,31 IF (( spin_rej(medium,iq,i,j,k) .GT. fmax )) THEN fmax = spin_rej(medium,iq,i,j,k) END IF15071 CONTINUE15072 CONTINUE DO 15081 k=0,31 spin_rej(medium,iq,i,j,k) = spin_rej(medium,iq,i,j,k)/fm * ax15081 CONTINUE15082 CONTINUE15061 CONTINUE15062 CONTINUE15051 CONTINUE
![Page 356: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/356.jpg)
15052 CONTINUE15041 CONTINUE15042 CONTINUE IF (( fool_intel_optimizer )) THEN write(25,*) 'Spin corrections as read in from file' END IF DO 15091 i=0, 31 tau = earray(i)/511.0034 beta2 = tau*(tau+2)/(tau+1)**2 DO 15101 iq=0,1 aux_o = Exp(eta_array(iq,i)/sum_Z2)/(fine*TF_constant)**2 eta_array(iq,i) = 0.26112447*aux_o*blcc(medium)/xcc(medium) eta = aux_o/4/tau/(tau+2) gamma = 3*(1+eta)*(Log(1+1/eta)*(1+2*eta)-2)/ (Log(1+1/eta)* * (1+eta)-1) g_array(iq,i) = g_array(iq,i)/sum_Z2/gamma c_array(iq,i) = c_array(iq,i)/sum_Z2/(Log(1+1/eta)-1/(1+eta) * )15101 CONTINUE15102 CONTINUE IF (( fool_intel_optimizer )) THEN write(25,*) i,earray(i),eta_array(0,i),eta_array(1,i), c_arr * ay(0,i),c_array(1,i),g_array(0,i),g_array(1,i) END IF15091 CONTINUE15092 CONTINUE eil = (1 - eke0(medium))/eke1(medium) e = Exp(eil) IF (( e .LE. espin_min )) THEN si1e = eta_array(0,0) si1p = eta_array(1,0) ELSE IF (( e .LE. espin_max )) THEN aae = (eil-espml)*dleneri je = aae aae = aae - je ELSE tau = e/0.5110034 beta2 = tau*(tau+2)/(tau+1)**2 aae = (beta2 - b2spin_min)*dbeta2i je = aae aae = aae - je je = je + 15 + 1 END IF si1e = (1-aae)*eta_array(0,je) + aae*eta_array(0,je+1) si1p = (1-aae)*eta_array(1,je) + aae*eta_array(1,je+1) END IF neke = meke(medium) IF (( fool_intel_optimizer )) THEN write(25,*) 'Interpolation table for eta correction' END IF DO 15111 i=1,neke - 1 eil = (i+1 - eke0(medium))/eke1(medium) e = Exp(eil) IF (( e .LE. espin_min )) THEN si2e = eta_array(0,0) si2p = eta_array(1,0) ELSE
![Page 357: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/357.jpg)
IF (( e .LE. espin_max )) THEN aae = (eil-espml)*dleneri je = aae aae = aae - je ELSE tau = e/0.5110034 beta2 = tau*(tau+2)/(tau+1)**2 aae = (beta2 - b2spin_min)*dbeta2i je = aae aae = aae - je je = je + 15 + 1 END IF si2e = (1-aae)*eta_array(0,je) + aae*eta_array(0,je+1) si2p = (1-aae)*eta_array(1,je) + aae*eta_array(1,je+1) END IF etae_ms1(i,medium) = (si2e - si1e)*eke1(medium) etae_ms0(i,medium) = si2e - etae_ms1(i,medium)*eil etap_ms1(i,medium) = (si2p - si1p)*eke1(medium) etap_ms0(i,medium) = si2p - etap_ms1(i,medium)*eil IF (( fool_intel_optimizer )) THEN write(25,*) i,e,si2e,si2p,etae_ms1(i,medium), etae_ms0(i,med * ium),etap_ms1(i,medium),etap_ms0(i,medium) END IF si1e = si2e si1p = si2p15111 CONTINUE15112 CONTINUE etae_ms1(neke,medium) = etae_ms1(neke-1,medium) etae_ms0(neke,medium) = etae_ms0(neke-1,medium) etap_ms1(neke,medium) = etap_ms1(neke-1,medium) etap_ms0(neke,medium) = etap_ms0(neke-1,medium) IF (( fool_intel_optimizer )) THEN write(25,*) 'elarray:' END IF DO 15121 i=0,15 elarray(i) = Log(earray(i)/1000) farray(i) = c_array(0,i) IF (( fool_intel_optimizer )) THEN write(25,*) elarray(i),earray(i) END IF15121 CONTINUE15122 CONTINUE DO 15131 i=15+1, 31-1 elarray(i) = Log(earray(i+1)/1000) farray(i) = c_array(0,i+1) IF (( fool_intel_optimizer )) THEN write(25,*) elarray(i),earray(i+1) END IF15131 CONTINUE15132 CONTINUE ndata = 31+1 IF (( ue(medium) .GT. 1e5 )) THEN elarray(ndata-1) = Log(ue(medium)) ELSE elarray(ndata-1) = Log(1e5) END IF farray(ndata-1) = 1 call set_spline(elarray,farray,af,bf,cf,df,ndata)
![Page 358: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/358.jpg)
eil = (1 - eke0(medium))/eke1(medium) si1e = spline(eil,elarray,af,bf,cf,df,ndata) IF (( fool_intel_optimizer )) THEN write(25,*) 'Interpolation table for q1 correction (e-)' END IF DO 15141 i=1,neke-1 eil = (i+1 - eke0(medium))/eke1(medium) si2e = spline(eil,elarray,af,bf,cf,df,ndata) q1ce_ms1(i,medium) = (si2e - si1e)*eke1(medium) q1ce_ms0(i,medium) = si2e - q1ce_ms1(i,medium)*eil IF (( fool_intel_optimizer )) THEN write(25,*) Exp(eil),si2e,q1ce_ms1(i,medium), q1ce_ms0(i,med * ium) END IF si1e = si2e15141 CONTINUE15142 CONTINUE q1ce_ms1(neke,medium) = q1ce_ms1(neke-1,medium) q1ce_ms0(neke,medium) = q1ce_ms0(neke-1,medium) IF (( fool_intel_optimizer )) THEN write(25,*) 'Postrons:' END IF DO 15151 i=0,15 farray(i) = c_array(1,i)15151 CONTINUE15152 CONTINUE DO 15161 i=15+1, 31-1 farray(i) = c_array(1,i+1)15161 CONTINUE15162 CONTINUE call set_spline(elarray,farray,af,bf,cf,df,ndata) eil = (1 - eke0(medium))/eke1(medium) si1e = spline(eil,elarray,af,bf,cf,df,ndata) IF (( fool_intel_optimizer )) THEN write(25,*) 'Interpolation table for q1 correction (e+)' END IF DO 15171 i=1,neke-1 eil = (i+1 - eke0(medium))/eke1(medium) si2e = spline(eil,elarray,af,bf,cf,df,ndata) q1cp_ms1(i,medium) = (si2e - si1e)*eke1(medium) q1cp_ms0(i,medium) = si2e - q1cp_ms1(i,medium)*eil IF (( fool_intel_optimizer )) THEN write(25,*) Exp(eil),si2e,q1cp_ms1(i,medium), q1cp_ms0(i,med * ium) END IF si1e = si2e15171 CONTINUE15172 CONTINUE q1cp_ms1(neke,medium) = q1cp_ms1(neke-1,medium) q1cp_ms0(neke,medium) = q1cp_ms0(neke-1,medium) DO 15181 i=0,15 farray(i) = g_array(0,i)15181 CONTINUE15182 CONTINUE DO 15191 i=15+1, 31-1 farray(i) = g_array(0,i+1)15191 CONTINUE15192 CONTINUE
![Page 359: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/359.jpg)
call set_spline(elarray,farray,af,bf,cf,df,ndata) eil = (1 - eke0(medium))/eke1(medium) si1e = spline(eil,elarray,af,bf,cf,df,ndata) IF (( fool_intel_optimizer )) THEN write(25,*) 'Interpolation table for q2 correction (e-)' END IF DO 15201 i=1,neke-1 eil = (i+1 - eke0(medium))/eke1(medium) si2e = spline(eil,elarray,af,bf,cf,df,ndata) q2ce_ms1(i,medium) = (si2e - si1e)*eke1(medium) q2ce_ms0(i,medium) = si2e - q2ce_ms1(i,medium)*eil IF (( fool_intel_optimizer )) THEN write(25,*) Exp(eil),si2e,q2ce_ms1(i,medium), q2ce_ms0(i,med * ium) END IF si1e = si2e15201 CONTINUE15202 CONTINUE q2ce_ms1(neke,medium) = q2ce_ms1(neke-1,medium) q2ce_ms0(neke,medium) = q2ce_ms0(neke-1,medium) DO 15211 i=0,15 farray(i) = g_array(1,i)15211 CONTINUE15212 CONTINUE DO 15221 i=15+1, 31-1 farray(i) = g_array(1,i+1)15221 CONTINUE15222 CONTINUE call set_spline(elarray,farray,af,bf,cf,df,ndata) eil = (1 - eke0(medium))/eke1(medium) si1e = spline(eil,elarray,af,bf,cf,df,ndata) IF (( fool_intel_optimizer )) THEN write(25,*) 'Interpolation table for q2 correction (e+)' END IF DO 15231 i=1,neke-1 eil = (i+1 - eke0(medium))/eke1(medium) si2e = spline(eil,elarray,af,bf,cf,df,ndata) q2cp_ms1(i,medium) = (si2e - si1e)*eke1(medium) q2cp_ms0(i,medium) = si2e - q2cp_ms1(i,medium)*eil IF (( fool_intel_optimizer )) THEN write(25,*) Exp(eil),si2e,q2cp_ms1(i,medium), q2cp_ms0(i,med * ium) END IF si1e = si2e15231 CONTINUE15232 CONTINUE q2cp_ms1(neke,medium) = q2cp_ms1(neke-1,medium) q2cp_ms0(neke,medium) = q2cp_ms0(neke-1,medium) tauc = te(medium)/0.5110034 si1e = 1 DO 15241 i=1,neke-1 eil = (i+1 - eke0(medium))/eke1(medium) e = Exp(eil) leil=i+1 tau=e/0.5110034 IF (( tau .GT. 2*tauc )) THEN sig=esig1(Leil,MEDIUM)*eil+esig0(Leil,MEDIUM) dedx=ededx1(Leil,MEDIUM)*eil+ededx0(Leil,MEDIUM)
![Page 360: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/360.jpg)
sig = sig/dedx IF (( sig .GT. 1e-6 )) THEN etap=etae_ms1(Leil,MEDIUM)*eil+etae_ms0(Leil,MEDIUM) eta = 0.25*etap*xcc(medium)/blcc(medium)/tau/(tau+2) g_r = (1+2*eta)*Log(1+1/eta)-2 g_m = Log(0.5*tau/tauc)+ (1+((tau+2)/(tau+1))**2)*Log(2*(t * au-tauc+2)/(tau+4))- 0.25*(tau+2)*(tau+2+2*(2*tau+1)/(tau+ * 1)**2)* Log((tau+4)*(tau-tauc)/tau/(tau-tauc+2))+ 0.5*(tau * -2*tauc)*(tau+2)*(1/(tau-tauc)-1/(tau+1)**2) IF (( g_m .LT. g_r )) THEN g_m = g_m/g_r ELSE g_m = 1 END IF si2e = 1 - g_m*sum_Z/sum_Z2 ELSE si2e = 1 END IF ELSE si2e = 1 END IF blcce1(i,medium) = (si2e - si1e)*eke1(medium) blcce0(i,medium) = si2e - blcce1(i,medium)*eil si1e = si2e15241 CONTINUE15242 CONTINUE blcce1(neke,medium) = blcce1(neke-1,medium) blcce0(neke,medium) = blcce0(neke-1,medium) write(i_log,'(a)') ' done'14941 CONTINUE14942 CONTINUE close(spin_unit) return14900 write(i_log,'(/a)') '***************** Error: ' write(i_log,'(a,a)') 'Failed to open spin data file ',spin_file(:l *nblnk1(spin_file)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1)14910 write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'Error while reading spin data file for element',iZ write(i_log,'(/a)') '***************** Quiting now.' call exit(1) return end subroutine init_spin_old ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none common/spin_data/ spin_rej(7,0:1,0: 31,0:15,0:31), espin_min,espin *_max,espml,b2spin_min,b2spin_max, dbeta2,dbeta2i,dlener,dleneri,dq *q1,dqq1i, fool_intel_optimizer real*4 spin_rej,espin_min,espin_max,espml,b2spin_min,b2spin_max, d *beta2,dbeta2i,dlener,dleneri,dqq1,dqq1i logical fool_intel_optimizer COMMON/ELECIN/ esig_e(7),psig_e(7), esige_max, psige_max, range_ep *(0:1,150,7), E_array(150,7), etae_ms0(150,7),etae_ms1(150,7),etap_ *ms0(150,7),etap_ms1(150,7),q1ce_ms0(150,7),q1ce_ms1(150,7),q1cp_ms *0(150,7),q1cp_ms1(150,7),q2ce_ms0(150,7),q2ce_ms1(150,7),q2cp_ms0(
![Page 361: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/361.jpg)
*150,7),q2cp_ms1(150,7),blcce0(150,7),blcce1(150,7), EKE0(7),EKE1(7 *), XR0(7),TEFF0(7),BLCC(7),XCC(7), ESIG0(150,7),ESIG1(150,7),PSIG0 *(150,7),PSIG1(150,7),EDEDX0(150,7),EDEDX1(150,7),PDEDX0(150,7),PDE *DX1(150,7),EBR10(150,7),EBR11(150,7),PBR10(150,7),PBR11(150,7),PBR *20(150,7),PBR21(150,7),TMXS0(150,7),TMXS1(150,7), expeke1(7), IUNR *ST(7),EPSTFL(7),IAPRIM(7), sig_ismonotone(0:1,7) real*8 esig_e, psig_e, esige_max, psige_max, range_ep, E_ar *ray, etae_ms0,etae_ms1, etap_ms0,etap_ms1, q1ce_ms0,q1ce_ms1, *q1cp_ms0,q1cp_ms1, q2ce_ms0,q2ce_ms1, q2cp_ms0,q2cp_ms1, blcce0 *,blcce1, expeke1, EKE0,EKE1, XR0, TEFF0, BLCC, XCC, ESIG0,E *SIG1, PSIG0,PSIG1, EDEDX0,EDEDX1, PDEDX0,PDEDX1, EBR10,EBR11, * PBR10,PBR11, PBR20,PBR21, TMXS0,TMXS1 integer*4 IUNRST, EPSTFL, IAPRIM logical sig_ismonotone COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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/BREMPR/ DL1(8,7),DL2(8,7),DL3(8,7),DL4(8,7),DL5(8,7),DL6(8, *7), ALPHI(2,7),BPAR(2,7),DELPOS(2,7), WA(7,50),PZ(7,50),ZELEM(7,50 *),RHOZ(7,50), PWR2I(50), DELCM(7),ZBRANG(7),LZBRANG(7),NNE(7), IBR *DST,IPRDST,ibr_nist,pair_nrc,itriplet, ASYM(7,50,2) CHARACTER*4 ASYM real*8 DL1,DL2,DL3,DL4,DL5,DL6, ALPHI, BPAR, DELPOS, WA, PZ, * ZELEM, RHOZ, PWR2I, DELCM, ZBRANG, LZBRANG integer*4 NNE, IBRDST, IPRDST, ibr_nist, itriplet, pair_nrc COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch real*8 eta_array(0:1,0: 31), c_array(0:1,0: 31),g_array(0:1,0: 31) *, earray(0: 31),tmp_array(0: 31), sum_Z2,sum_Z,sum_A,sum_pz,Z,tmp, *Z23,g_m,g_r,sig,dedx, dum1,dum2,dum3,aux_o,tau,tauc,beta2,eta,gamm *a,fmax, eil,e,si1e,si2e,si1p,si2p,aae,etap, elarray(0: 31),farray( *0: 31), af(0: 31),bf(0: 31),cf(0: 31), df(0: 31),spline integer*4 medium,iq,i,j,k,i_ele,iii,iZ,iiZ,n_ener,n_q,n_point,je,n *eke, ndata,leil,length,want_spin_unit,spin_unit,egs_get_unit character spin_file*256 character*6 string integer*4 lnblnk1 real*8 fine,TF_constant parameter (fine=137.03604,TF_constant=0.88534138)
![Page 362: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/362.jpg)
DO 15251 i=1,len(spin_file) spin_file(i:i) = ' '15251 CONTINUE15252 CONTINUE spin_file = hen_house(:lnblnk1(hen_house)) // 'data' // '/' // 'sp *inms' // '/' // 'z000' length = lnblnk1(spin_file) DO 15261 medium=1,NMED write(i_log,'(a,i4,a,$)') ' Initializing spin data for medium ' * ,medium, ' ..................... ' DO 15271 iq=0,1 DO 15281 i=0, 31 eta_array(iq,i)=0 c_array(iq,i)=0 g_array(iq,i)=0 DO 15291 j=0,15 DO 15301 k=0,31 spin_rej(medium,iq,i,j,k) = 015301 CONTINUE15302 CONTINUE15291 CONTINUE15292 CONTINUE15281 CONTINUE15282 CONTINUE15271 CONTINUE15272 CONTINUE sum_Z2=0 sum_A=0 sum_pz=0 sum_Z=0 DO 15311 i_ele=1,NNE(medium) Z = ZELEM(medium,i_ele) iZ = int(Z+0.5) tmp = PZ(medium,i_ele)*Z*(Z+1) iii = iZ/100 spin_file(length-2:length-2) = char(iii+48) iiZ = iZ - iii*100 iii = iiZ/10 spin_file(length-1:length-1) = char(iii+48) iiZ = iiZ - 10*iii spin_file(length:length) = char(iiZ+48) want_spin_unit = 61 spin_unit = egs_get_unit(want_spin_unit) IF (( spin_unit .LT. 1 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'init_spin: failed to get a free fortran unit *' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF open(spin_unit,file=spin_file,status='old',err=15320) read(spin_unit,*) espin_min,espin_max,b2spin_min,b2spin_max read(spin_unit,*) n_ener,n_q,n_point IF (( n_ener .NE. 15 .OR. n_q .NE. 15 .OR. n_point .NE. 31)) T * HEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) ' Wrong spin file for Z = ',iZ write(i_log,'(/a)') '***************** Quiting now.'
![Page 363: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/363.jpg)
call exit(1) END IF sum_Z2 = sum_Z2 + tmp sum_Z = sum_Z + PZ(medium,i_ele)*Z sum_A = sum_A + PZ(medium,i_ele)*WA(medium,i_ele) sum_pz = sum_pz + PZ(medium,i_ele) Z23 = Z**0.6666667 DO 15331 iq=0,1 read(spin_unit,*) read(spin_unit,*) DO 15341 i=0, 31 read(spin_unit,'(a,g14.6)') string,earray(i) read(spin_unit,*) dum1,dum2,dum3,aux_o eta_array(iq,i)=eta_array(iq,i)+tmp*Log(Z23*aux_o) tau = earray(i)/511.0034 beta2 = tau*(tau+2)/(tau+1)**2 eta = Z23/(fine*TF_constant)**2*aux_o/4/tau/(tau+2) c_array(iq,i)=c_array(iq,i)+ tmp*(Log(1+1/eta)-1/(1+eta))* * dum1*dum3 g_array(iq,i)=g_array(iq,i)+tmp*dum2 DO 15351 j=0,15 read(spin_unit,*) tmp_array DO 15361 k=0,31 spin_rej(medium,iq,i,j,k) = spin_rej(medium,iq,i,j,k) * + tmp*tmp_array(k)15361 CONTINUE15362 CONTINUE15351 CONTINUE15352 CONTINUE15341 CONTINUE15342 CONTINUE15331 CONTINUE15332 CONTINUE close(spin_unit)15311 CONTINUE15312 CONTINUE DO 15371 iq=0,1 DO 15381 i=0, 31 DO 15391 j=0,15 fmax = 0 DO 15401 k=0,31 IF (( spin_rej(medium,iq,i,j,k) .GT. fmax )) THEN fmax = spin_rej(medium,iq,i,j,k) END IF15401 CONTINUE15402 CONTINUE DO 15411 k=0,31 spin_rej(medium,iq,i,j,k) = spin_rej(medium,iq,i,j,k)/fm * ax15411 CONTINUE15412 CONTINUE15391 CONTINUE15392 CONTINUE15381 CONTINUE15382 CONTINUE15371 CONTINUE15372 CONTINUE DO 15421 i=0, 31
![Page 364: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/364.jpg)
tau = earray(i)/511.0034 beta2 = tau*(tau+2)/(tau+1)**2 DO 15431 iq=0,1 aux_o = Exp(eta_array(iq,i)/sum_Z2)/(fine*TF_constant)**2 eta_array(iq,i) = 0.26112447*aux_o*blcc(medium)/xcc(medium) eta = aux_o/4/tau/(tau+2) gamma = 3*(1+eta)*(Log(1+1/eta)*(1+2*eta)-2)/ (Log(1+1/eta)* * (1+eta)-1) g_array(iq,i) = g_array(iq,i)/sum_Z2/gamma c_array(iq,i) = c_array(iq,i)/sum_Z2/(Log(1+1/eta)-1/(1+eta) * )15431 CONTINUE15432 CONTINUE15421 CONTINUE15422 CONTINUE espin_min = espin_min/1000 espin_max = espin_max/1000 dlener = Log(espin_max/espin_min)/15 dleneri = 1/dlener espml = Log(espin_min) dbeta2 = (b2spin_max-b2spin_min)/15 dbeta2i = 1/dbeta2 dqq1 = 0.5/15 dqq1i = 1/dqq1 eil = (1 - eke0(medium))/eke1(medium) e = Exp(eil) IF (( e .LE. espin_min )) THEN si1e = eta_array(0,0) si1p = eta_array(1,0) ELSE IF (( e .LE. espin_max )) THEN aae = (eil-espml)*dleneri je = aae aae = aae - je ELSE tau = e/0.5110034 beta2 = tau*(tau+2)/(tau+1)**2 aae = (beta2 - b2spin_min)*dbeta2i je = aae aae = aae - je je = je + 15 + 1 END IF si1e = (1-aae)*eta_array(0,je) + aae*eta_array(0,je+1) si1p = (1-aae)*eta_array(1,je) + aae*eta_array(1,je+1) END IF neke = meke(medium) DO 15441 i=1,neke - 1 eil = (i+1 - eke0(medium))/eke1(medium) e = Exp(eil) IF (( e .LE. espin_min )) THEN si2e = eta_array(0,0) si2p = eta_array(1,0) ELSE IF (( e .LE. espin_max )) THEN aae = (eil-espml)*dleneri je = aae aae = aae - je ELSE
![Page 365: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/365.jpg)
tau = e/0.5110034 beta2 = tau*(tau+2)/(tau+1)**2 aae = (beta2 - b2spin_min)*dbeta2i je = aae aae = aae - je je = je + 15 + 1 END IF si2e = (1-aae)*eta_array(0,je) + aae*eta_array(0,je+1) si2p = (1-aae)*eta_array(1,je) + aae*eta_array(1,je+1) END IF etae_ms1(i,medium) = (si2e - si1e)*eke1(medium) etae_ms0(i,medium) = si2e - etae_ms1(i,medium)*eil etap_ms1(i,medium) = (si2p - si1p)*eke1(medium) etap_ms0(i,medium) = si2p - etap_ms1(i,medium)*eil si1e = si2e si1p = si2p15441 CONTINUE15442 CONTINUE etae_ms1(neke,medium) = etae_ms1(neke-1,medium) etae_ms0(neke,medium) = etae_ms0(neke-1,medium) etap_ms1(neke,medium) = etap_ms1(neke-1,medium) etap_ms0(neke,medium) = etap_ms0(neke-1,medium) DO 15451 i=0,15 elarray(i) = Log(earray(i)/1000) farray(i) = c_array(0,i)15451 CONTINUE15452 CONTINUE DO 15461 i=15+1, 31-1 elarray(i) = Log(earray(i+1)/1000) farray(i) = c_array(0,i+1)15461 CONTINUE15462 CONTINUE ndata = 31+1 IF (( ue(medium) .GT. 1e5 )) THEN elarray(ndata-1) = Log(ue(medium)) ELSE elarray(ndata-1) = Log(1e5) END IF farray(ndata-1) = 1 call set_spline(elarray,farray,af,bf,cf,df,ndata) eil = (1 - eke0(medium))/eke1(medium) si1e = spline(eil,elarray,af,bf,cf,df,ndata) DO 15471 i=1,neke-1 eil = (i+1 - eke0(medium))/eke1(medium) si2e = spline(eil,elarray,af,bf,cf,df,ndata) q1ce_ms1(i,medium) = (si2e - si1e)*eke1(medium) q1ce_ms0(i,medium) = si2e - q1ce_ms1(i,medium)*eil si1e = si2e15471 CONTINUE15472 CONTINUE q1ce_ms1(neke,medium) = q1ce_ms1(neke-1,medium) q1ce_ms0(neke,medium) = q1ce_ms0(neke-1,medium) DO 15481 i=0,15 farray(i) = c_array(1,i)15481 CONTINUE15482 CONTINUE DO 15491 i=15+1, 31-1 farray(i) = c_array(1,i+1)
![Page 366: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/366.jpg)
15491 CONTINUE15492 CONTINUE call set_spline(elarray,farray,af,bf,cf,df,ndata) eil = (1 - eke0(medium))/eke1(medium) si1e = spline(eil,elarray,af,bf,cf,df,ndata) DO 15501 i=1,neke-1 eil = (i+1 - eke0(medium))/eke1(medium) si2e = spline(eil,elarray,af,bf,cf,df,ndata) q1cp_ms1(i,medium) = (si2e - si1e)*eke1(medium) q1cp_ms0(i,medium) = si2e - q1cp_ms1(i,medium)*eil si1e = si2e15501 CONTINUE15502 CONTINUE q1cp_ms1(neke,medium) = q1cp_ms1(neke-1,medium) q1cp_ms0(neke,medium) = q1cp_ms0(neke-1,medium) DO 15511 i=0,15 farray(i) = g_array(0,i)15511 CONTINUE15512 CONTINUE DO 15521 i=15+1, 31-1 farray(i) = g_array(0,i+1)15521 CONTINUE15522 CONTINUE call set_spline(elarray,farray,af,bf,cf,df,ndata) eil = (1 - eke0(medium))/eke1(medium) si1e = spline(eil,elarray,af,bf,cf,df,ndata) DO 15531 i=1,neke-1 eil = (i+1 - eke0(medium))/eke1(medium) si2e = spline(eil,elarray,af,bf,cf,df,ndata) q2ce_ms1(i,medium) = (si2e - si1e)*eke1(medium) q2ce_ms0(i,medium) = si2e - q2ce_ms1(i,medium)*eil si1e = si2e15531 CONTINUE15532 CONTINUE q2ce_ms1(neke,medium) = q2ce_ms1(neke-1,medium) q2ce_ms0(neke,medium) = q2ce_ms0(neke-1,medium) DO 15541 i=0,15 farray(i) = g_array(1,i)15541 CONTINUE15542 CONTINUE DO 15551 i=15+1, 31-1 farray(i) = g_array(1,i+1)15551 CONTINUE15552 CONTINUE call set_spline(elarray,farray,af,bf,cf,df,ndata) eil = (1 - eke0(medium))/eke1(medium) si1e = spline(eil,elarray,af,bf,cf,df,ndata) DO 15561 i=1,neke-1 eil = (i+1 - eke0(medium))/eke1(medium) si2e = spline(eil,elarray,af,bf,cf,df,ndata) q2cp_ms1(i,medium) = (si2e - si1e)*eke1(medium) q2cp_ms0(i,medium) = si2e - q2cp_ms1(i,medium)*eil15561 CONTINUE15562 CONTINUE q2cp_ms1(neke,medium) = q2cp_ms1(neke-1,medium) q2cp_ms0(neke,medium) = q2cp_ms0(neke-1,medium) tauc = te(medium)/0.5110034 si1e = 1
![Page 367: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/367.jpg)
DO 15571 i=1,neke-1 eil = (i+1 - eke0(medium))/eke1(medium) e = Exp(eil) leil=i+1 tau=e/0.5110034 IF (( tau .GT. 2*tauc )) THEN sig=esig1(Leil,MEDIUM)*eil+esig0(Leil,MEDIUM) dedx=ededx1(Leil,MEDIUM)*eil+ededx0(Leil,MEDIUM) sig = sig/dedx IF (( sig .GT. 1e-6 )) THEN etap=etae_ms1(Leil,MEDIUM)*eil+etae_ms0(Leil,MEDIUM) eta = 0.25*etap*xcc(medium)/blcc(medium)/tau/(tau+2) g_r = (1+2*eta)*Log(1+1/eta)-2 g_m = Log(0.5*tau/tauc)+ (1+((tau+2)/(tau+1))**2)*Log(2*(t * au-tauc+2)/(tau+4))- 0.25*(tau+2)*(tau+2+2*(2*tau+1)/(tau+ * 1)**2)* Log((tau+4)*(tau-tauc)/tau/(tau-tauc+2))+ 0.5*(tau * -2*tauc)*(tau+2)*(1/(tau-tauc)-1/(tau+1)**2) IF (( g_m .LT. g_r )) THEN g_m = g_m/g_r ELSE g_m = 1 END IF si2e = 1 - g_m*sum_Z/sum_Z2 ELSE si2e = 1 END IF ELSE si2e = 1 END IF blcce1(i,medium) = (si2e - si1e)*eke1(medium) blcce0(i,medium) = si2e - blcce1(i,medium)*eil si1e = si2e15571 CONTINUE15572 CONTINUE blcce1(neke,medium) = blcce1(neke-1,medium) blcce0(neke,medium) = blcce0(neke-1,medium) write(i_log,'(a)') ' done'15261 CONTINUE15262 CONTINUE return15320 write(i_log,*) ' ******************** Error in init_spin ********* *********** ' write(i_log,'(a,a)') ' could not open file ',spin_file write(i_log,'(/a)') '***************** Error: ' write(i_log,*) ' terminating execution ' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) end subroutine msdist_pII ( e0,eloss,tustep,rhof,medium,qel,spin_effec *ts,u0,v0,w0,x0,y0,z0, us,vs,ws,xf,yf,zf,ustep ) ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none real*8 e0, eloss, rhof, tustep, u0, v0, w0, x0, y0, z0 integer*4 medium, qel logical spin_effects real*8 us, vs, ws, xf, yf, zf, ustep real*8 b, blccc, xcccc, c, eta,eta1, chia2, chilog, cphi0,
![Page 368: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/368.jpg)
* cphi1, cphi2, w1, w2, w1v2, delta, e, elke, beta2, etap *, xi_corr, ms_corr, tau, tau2, epsilon, epsilonp, temp,temp1 *, temp2, factor, gamma, lambda, p2, p2i, q1, rhophi2, sin *t0, sint02, sint0i, sint1, sint2, sphi0, sphi1, sphi2, u2 *p, u2, v2, ut, vt, wt, xi, xphi, xphi2, yphi, yphi2 logical find_index, spin_index integer*4 lelke COMMON/ELECIN/ esig_e(7),psig_e(7), esige_max, psige_max, range_ep *(0:1,150,7), E_array(150,7), etae_ms0(150,7),etae_ms1(150,7),etap_ *ms0(150,7),etap_ms1(150,7),q1ce_ms0(150,7),q1ce_ms1(150,7),q1cp_ms *0(150,7),q1cp_ms1(150,7),q2ce_ms0(150,7),q2ce_ms1(150,7),q2cp_ms0( *150,7),q2cp_ms1(150,7),blcce0(150,7),blcce1(150,7), EKE0(7),EKE1(7 *), XR0(7),TEFF0(7),BLCC(7),XCC(7), ESIG0(150,7),ESIG1(150,7),PSIG0 *(150,7),PSIG1(150,7),EDEDX0(150,7),EDEDX1(150,7),PDEDX0(150,7),PDE *DX1(150,7),EBR10(150,7),EBR11(150,7),PBR10(150,7),PBR11(150,7),PBR *20(150,7),PBR21(150,7),TMXS0(150,7),TMXS1(150,7), expeke1(7), IUNR *ST(7),EPSTFL(7),IAPRIM(7), sig_ismonotone(0:1,7) real*8 esig_e, psig_e, esige_max, psige_max, range_ep, E_ar *ray, etae_ms0,etae_ms1, etap_ms0,etap_ms1, q1ce_ms0,q1ce_ms1, *q1cp_ms0,q1cp_ms1, q2ce_ms0,q2ce_ms1, q2cp_ms0,q2cp_ms1, blcce0 *,blcce1, expeke1, EKE0,EKE1, XR0, TEFF0, BLCC, XCC, ESIG0,E *SIG1, PSIG0,PSIG1, EDEDX0,EDEDX1, PDEDX0,PDEDX1, EBR10,EBR11, * PBR10,PBR11, PBR20,PBR21, TMXS0,TMXS1 integer*4 IUNRST, EPSTFL, IAPRIM logical sig_ismonotone COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL COMMON/UPHIOT/THETA,SINTHE,COSTHE,SINPHI, COSPHI,PI,TWOPI,PI5D2 real*8 THETA, SINTHE, COSTHE, SINPHI, COSPHI, PI,TWOPI,PI5D2 common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 common/CH_steps/ count_pII_steps,count_all_steps,is_ch_step real*8 count_pII_steps,count_all_steps logical is_ch_step count_pII_steps = count_pII_steps + 1 blccc = blcc(medium) xcccc = xcc(medium) e = e0 - 0.5*eloss tau = e/0.5110034 tau2 = tau*tau epsilon = eloss/e0 epsilonp= eloss/e e = e * (1 - epsilonp*epsilonp*(6+10*tau+5*tau2)/(24*tau2+48*tau+7 *2)) p2 = e*(e + rmt2) beta2 = p2/(p2 + rmsq) chia2 = xcccc/(4*p2*blccc) lambda = 0.5*tustep*rhof*blccc/beta2 temp2 = 0.166666*(4+tau*(6+tau*(7+tau*(4+tau))))* (epsilonp/((tau+ *1)*(tau+2)))**2 lambda = lambda*(1 - temp2) IF (( spin_effects )) THEN elke = Log(e) Lelke=eke1(MEDIUM)*elke+eke0(MEDIUM) IF (( lelke .LT. 1 )) THEN
![Page 369: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/369.jpg)
lelke = 1 elke = (1 - eke0(medium))/eke1(medium) END IF IF (( qel .EQ. 0 )) THEN etap=etae_ms1(Lelke,MEDIUM)*elke+etae_ms0(Lelke,MEDIUM) xi_corr=q1ce_ms1(Lelke,MEDIUM)*elke+q1ce_ms0(Lelke,MEDIUM) gamma=q2ce_ms1(Lelke,MEDIUM)*elke+q2ce_ms0(Lelke,MEDIUM) ELSE etap=etap_ms1(Lelke,MEDIUM)*elke+etap_ms0(Lelke,MEDIUM) xi_corr=q1cp_ms1(Lelke,MEDIUM)*elke+q1cp_ms0(Lelke,MEDIUM) gamma=q2cp_ms1(Lelke,MEDIUM)*elke+q2cp_ms0(Lelke,MEDIUM) END IF ms_corr=blcce1(Lelke,MEDIUM)*elke+blcce0(Lelke,MEDIUM) ELSE etap = 1 xi_corr = 1 gamma = 1 ms_corr = 1 END IF chia2 = chia2*etap lambda = lambda/(etap*(1+chia2))*ms_corr chilog = Log(1 + 1/chia2) q1 = 2*chia2*(chilog*(1 + chia2) - 1) gamma = 6*chia2*(1 + chia2)*(chilog*(1 + 2*chia2) - 2)/q1*gamma xi = q1*lambda find_index = .true. spin_index = .true. call mscat(lambda,chia2,xi,elke,beta2,qel,medium, spin_effects,fin *d_index,spin_index, w1,sint1)15581 CONTINUE IF((rng_seed .GT. 128))call ranmar_get xphi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 xphi = 2*xphi - 1 xphi2 = xphi*xphi IF((rng_seed .GT. 128))call ranmar_get yphi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 yphi2 = yphi*yphi rhophi2 = xphi2 + yphi2 IF(rhophi2.LE.1)GO TO15582 GO TO 1558115582 CONTINUE rhophi2 = 1/rhophi2 cphi1 = (xphi2 - yphi2)*rhophi2 sphi1 = 2*xphi*yphi*rhophi2 call mscat(lambda,chia2,xi,elke,beta2,qel,medium, spin_effects,fin *d_index,spin_index, w2,sint2)15591 CONTINUE IF((rng_seed .GT. 128))call ranmar_get xphi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 xphi = 2*xphi - 1 xphi2 = xphi*xphi IF((rng_seed .GT. 128))call ranmar_get yphi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 yphi2 = yphi*yphi
![Page 370: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/370.jpg)
rhophi2 = xphi2 + yphi2 IF(rhophi2.LE.1)GO TO15592 GO TO 1559115592 CONTINUE rhophi2 = 1/rhophi2 cphi2 = (xphi2 - yphi2)*rhophi2 sphi2 = 2*xphi*yphi*rhophi2 u2 = sint2*cphi2 v2 = sint2*sphi2 u2p = w1*u2 + sint1*w2 us = u2p*cphi1 - v2*sphi1 vs = u2p*sphi1 + v2*cphi1 ws = w1*w2 - sint1*u2 xi = 2*xi*xi_corr IF((rng_seed .GT. 128))call ranmar_get eta = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 eta = Sqrt(eta) eta1 = 0.5*(1 - eta) delta = 0.9082483-(0.1020621-0.0263747*gamma)*xi temp1 = 2 + tau temp = (2+tau*temp1)/((tau+1)*temp1) temp = temp - (tau+1)/((tau+2)*(chilog*(1+chia2)-1)) temp = temp * epsilonp temp1 = 1 - temp delta = delta + 0.40824829*(epsilon*(tau+1)/((tau+2)* (chilog*(1+c *hia2)-1)*(chilog*(1+2*chia2)-2)) - 0.25*temp*temp) b = eta*delta c = eta*(1-delta) w1v2 = w1*v2 ut = b*sint1*cphi1 + c*(cphi1*u2 - sphi1*w1v2) + eta1*us*temp1 vt = b*sint1*sphi1 + c*(sphi1*u2 + cphi1*w1v2) + eta1*vs*temp1 wt = eta1*(1+temp) + b*w1 + c*w2 + eta1*ws*temp1 ustep = tustep*sqrt(ut*ut + vt*vt + wt*wt) sint02 = u0**2 + v0**2 IF ((sint02 .GT. 1e-20)) THEN sint0 = sqrt(sint02) sint0i = 1/sint0 cphi0 = sint0i*u0 sphi0 = sint0i*v0 u2p = w0*us + sint0*ws ws = w0*ws - sint0*us us = u2p*cphi0 - vs*sphi0 vs = u2p*sphi0 + vs*cphi0 u2p = w0*ut + sint0*wt wt = w0*wt - sint0*ut ut = u2p*cphi0 - vt*sphi0 vt = u2p*sphi0 + vt*cphi0 ELSE wt = w0*wt ws = w0*ws END IF xf = x0 + tustep*ut yf = y0 + tustep*vt zf = z0 + tustep*wt return end subroutine msdist_pI ( e0,eloss,tustep,rhof,medium,qel,spin_effect
![Page 371: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/371.jpg)
*s,u0,v0,w0,x0,y0,z0, us,vs,ws,xf,yf,zf,ustep ) ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none real*8 e0, eloss, rhof, tustep, u0, v0, w0, x0, y0, z0 integer*4 medium, qel logical spin_effects real*8 us, vs, ws, xf, yf, zf, ustep real*8 blccc, xcccc, z,r,z2,r2, r2max, chia2, chilog, cphi0, * cphi, sphi, e, elke, beta2, etap, xi_corr, ms_corr, epsil *on, temp, factor, lambda, p2, p2i, q1, rhophi2, sint, sin *t0, sint02, sint0i, sphi0, u2p, ut, vt, wt, xi, xphi, x *phi2, yphi, yphi2 logical find_index, spin_index integer*4 lelke COMMON/ELECIN/ esig_e(7),psig_e(7), esige_max, psige_max, range_ep *(0:1,150,7), E_array(150,7), etae_ms0(150,7),etae_ms1(150,7),etap_ *ms0(150,7),etap_ms1(150,7),q1ce_ms0(150,7),q1ce_ms1(150,7),q1cp_ms *0(150,7),q1cp_ms1(150,7),q2ce_ms0(150,7),q2ce_ms1(150,7),q2cp_ms0( *150,7),q2cp_ms1(150,7),blcce0(150,7),blcce1(150,7), EKE0(7),EKE1(7 *), XR0(7),TEFF0(7),BLCC(7),XCC(7), ESIG0(150,7),ESIG1(150,7),PSIG0 *(150,7),PSIG1(150,7),EDEDX0(150,7),EDEDX1(150,7),PDEDX0(150,7),PDE *DX1(150,7),EBR10(150,7),EBR11(150,7),PBR10(150,7),PBR11(150,7),PBR *20(150,7),PBR21(150,7),TMXS0(150,7),TMXS1(150,7), expeke1(7), IUNR *ST(7),EPSTFL(7),IAPRIM(7), sig_ismonotone(0:1,7) real*8 esig_e, psig_e, esige_max, psige_max, range_ep, E_ar *ray, etae_ms0,etae_ms1, etap_ms0,etap_ms1, q1ce_ms0,q1ce_ms1, *q1cp_ms0,q1cp_ms1, q2ce_ms0,q2ce_ms1, q2cp_ms0,q2cp_ms1, blcce0 *,blcce1, expeke1, EKE0,EKE1, XR0, TEFF0, BLCC, XCC, ESIG0,E *SIG1, PSIG0,PSIG1, EDEDX0,EDEDX1, PDEDX0,PDEDX1, EBR10,EBR11, * PBR10,PBR11, PBR20,PBR21, TMXS0,TMXS1 integer*4 IUNRST, EPSTFL, IAPRIM logical sig_ismonotone COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL COMMON/UPHIOT/THETA,SINTHE,COSTHE,SINPHI, COSPHI,PI,TWOPI,PI5D2 real*8 THETA, SINTHE, COSTHE, SINPHI, COSPHI, PI,TWOPI,PI5D2 common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 blccc = blcc(medium) xcccc = xcc(medium) e = e0 - 0.5*eloss p2 = e*(e + rmt2) p2i = 1/p2 chia2 = xcccc*p2i/(4*blccc) beta2 = p2/(p2 + rmsq) lambda = tustep*rhof*blccc/beta2 factor = 1/(1 + 0.9784671*e) epsilon= eloss/e0 epsilon= epsilon/(1-0.5*epsilon) temp = 0.25*(1 - factor*(1 - 0.333333*factor))*epsilon**2 lambda = lambda*(1 + temp) IF (( spin_effects )) THEN elke = Log(e) Lelke=eke1(MEDIUM)*elke+eke0(MEDIUM)
![Page 372: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/372.jpg)
IF (( lelke .LT. 1 )) THEN lelke = 1 elke = (1 - eke0(medium))/eke1(medium) END IF IF (( qel .EQ. 0 )) THEN etap=etae_ms1(Lelke,MEDIUM)*elke+etae_ms0(Lelke,MEDIUM) xi_corr=q1ce_ms1(Lelke,MEDIUM)*elke+q1ce_ms0(Lelke,MEDIUM) ELSE etap=etap_ms1(Lelke,MEDIUM)*elke+etap_ms0(Lelke,MEDIUM) xi_corr=q1cp_ms1(Lelke,MEDIUM)*elke+q1cp_ms0(Lelke,MEDIUM) END IF ms_corr=blcce1(Lelke,MEDIUM)*elke+blcce0(Lelke,MEDIUM) ELSE etap = 1 xi_corr = 1 ms_corr = 1 END IF chia2 = xcccc*p2i/(4*blccc)*etap lambda = lambda/etap/(1+chia2)*ms_corr chilog = Log(1 + 1/chia2) q1 = 2*chia2*(chilog*(1 + chia2) - 1) xi = q1*lambda find_index = .true. spin_index = .true. call mscat(lambda,chia2,xi,elke,beta2,qel,medium, spin_effects,fin *d_index,spin_index, ws,sint)15601 CONTINUE IF((rng_seed .GT. 128))call ranmar_get xphi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 xphi = 2*xphi - 1 xphi2 = xphi*xphi IF((rng_seed .GT. 128))call ranmar_get yphi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 yphi2 = yphi*yphi rhophi2 = xphi2 + yphi2 IF(rhophi2.LE.1)GO TO15602 GO TO 1560115602 CONTINUE rhophi2 = 1/rhophi2 cphi = (xphi2 - yphi2)*rhophi2 sphi = 2*xphi*yphi*rhophi2 us = sint*cphi vs = sint*sphi xi = xi*xi_corr IF (( xi .LT. 0.1 )) THEN z = 1 - xi*(0.5 - xi*(0.166666667 - 0.041666667*xi)) ELSE z = (1 - Exp(-xi))/xi END IF r = 0.5*sint r2 = r*r z2 = z*z r2max = 1 - z2 IF (( r2max .LT. r2 )) THEN r2 = r2max r = Sqrt(r2)
![Page 373: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/373.jpg)
END IF ut = r*cphi vt = r*sphi wt = z ustep = Sqrt(z2 + r2)*tustep sint02 = u0**2 + v0**2 IF ((sint02 .GT. 1e-20)) THEN sint0 = sqrt(sint02) sint0i = 1/sint0 cphi0 = sint0i*u0 sphi0 = sint0i*v0 u2p = w0*us + sint0*ws ws = w0*ws - sint0*us us = u2p*cphi0 - vs*sphi0 vs = u2p*sphi0 + vs*cphi0 u2p = w0*ut + sint0*wt wt = w0*wt - sint0*ut ut = u2p*cphi0 - vt*sphi0 vt = u2p*sphi0 + vt*cphi0 ELSE wt = w0*wt ws = w0*ws END IF xf = x0 + tustep*ut yf = y0 + tustep*vt zf = z0 + tustep*wt return end SUBROUTINE PAIR ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none COMMON/QDEBUG/QDEBUG LOGICAL QDEBUG COMMON/BREMPR/ DL1(8,7),DL2(8,7),DL3(8,7),DL4(8,7),DL5(8,7),DL6(8, *7), ALPHI(2,7),BPAR(2,7),DELPOS(2,7), WA(7,50),PZ(7,50),ZELEM(7,50 *),RHOZ(7,50), PWR2I(50), DELCM(7),ZBRANG(7),LZBRANG(7),NNE(7), IBR *DST,IPRDST,ibr_nist,pair_nrc,itriplet, ASYM(7,50,2) CHARACTER*4 ASYM real*8 DL1,DL2,DL3,DL4,DL5,DL6, ALPHI, BPAR, DELPOS, WA, PZ, * ZELEM, RHOZ, PWR2I, DELCM, ZBRANG, LZBRANG integer*4 NNE, IBRDST, IPRDST, ibr_nist, itriplet, pair_nrc common/nrc_pair/ nrcp_fdata(65,84,7), nrcp_wdata(65,84,7), nrcp_id *ata(65,84,7), nrcp_xdata(65), nrcp_emin, nrcp_emax, nrcp_dle, nrcp *_dlei real*8 nrcp_fdata,nrcp_wdata,nrcp_xdata, nrcp_emin, nrcp_emax, nrc *p_dle, nrcp_dlei integer*4 nrcp_idata COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000 *),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL COMMON/UPHIOT/THETA,SINTHE,COSTHE,SINPHI, COSPHI,PI,TWOPI,PI5D2 real*8 THETA, SINTHE, COSTHE, SINPHI, COSPHI, PI,TWOPI,PI5D2
![Page 374: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/374.jpg)
COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 COMMON/EPCONT/EDEP,TSTEP,TUSTEP,USTEP,TVSTEP,VSTEP, RHOF,EOLD,ENEW *,EKE,ELKE,GLE,E_RANGE, x_final,y_final,z_final, u_final,v_final,w_ *final, IDISC,IROLD,IRNEW,IAUSFL(29) DOUBLE PRECISION EDEP real*8 TSTEP, TUSTEP, USTEP, VSTEP, TVSTEP, RHOF, EOLD, ENE *W, EKE, ELKE, GLE, E_RANGE, x_final,y_final,z_final, u_final, *v_final,w_final integer*4 IDISC, IROLD, IRNEW, IAUSFL common/triplet_data/ a_triplet(250,7), b_triplet(250,7), dl_triple *t, dli_triplet, bli_triplet, log_4rm real*8 a_triplet,b_triplet,dl_triplet, dli_triplet, bli_triplet, l *og_4rm common/egs_vr/ e_max_rr, prob_RR, nbr_split, i_play_RR, i_ *survived_RR, * n_RR_warning, i_do_rr real*8 e_max_rr,prob_RR integer*4 nbr_split,i_play_RR,i_survived_RR,n_RR_warning integer*2 i_do_rr common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch DOUBLE PRECISION PEIG, PESE1, PESE2 real*8 EIG, ESE2, RNNO30,RNNO31,rnno32,rnno33,rnno34, DELTA, R *EJF, rejmax, aux1,aux2, Amax, Bmax, del0, br, * Eminus,Eplus,Eavail,rnno_RR integer*4 * L,L1 real*8 ESE, PSE, ZTARG, TTEIG, TTESE, TTPSE, ESEDEI, ESEDER, * XIMIN, XIMID, REJMIN, REJMID, REJTOP, YA,XITRY,GALPHA,GBETA, X *ITST, REJTST_on_REJTOP , REJTST, RTEST integer*4 ICHRG real*8 k,xx,abin,rbin,alias_sample1 integer*4 ibin, iq1, iq2, iprdst_use logical do_nrc_pair integer*4 itrip real*8 ftrip NPold = NP IF (( i_play_RR .EQ. 1 )) THEN i_survived_RR = 0 IF (( prob_RR .LE. 0 )) THEN
![Page 375: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/375.jpg)
IF (( n_RR_warning .LT. 50 )) THEN n_RR_warning = n_RR_warning + 1 write(i_log,'(/a)') '***************** Warning: ' write(i_log,'(a,g14.6)') 'Attempt to play Russian Roulette w *ith prob_RR<0! ' END IF ELSE IF((rng_seed .GT. 128))call ranmar_get rnno_RR = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( rnno_RR .GT. prob_RR )) THEN i_survived_RR =2 IF (( np .GT. 1 )) THEN np = np-1 ELSE wt(np) = 0 e(np) = 0 END IF return ELSE wt(np) = wt(np)/prob_RR END IF END IF END IF IF (( np+1 .GT. 10000 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(//,a,a,a,/,a,i6,a,i6,/,a)') ' In subroutine ','PAI *R', ' stack size exceeded! ',' $MXSTACK = ',10000,' np = ',np+1, ' * Increase $MXSTACK and try again ' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF PEIG=E(NP) EIG=PEIG do_nrc_pair = .false. IF (( itriplet .GT. 0 .AND. eig .GT. 4*rm )) THEN itrip = dli_triplet*gle + bli_triplet ftrip = a_triplet(itrip,medium)*gle + b_triplet(itrip,medium) IF((rng_seed .GT. 128))call ranmar_get rnno34 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( rnno34 .LT. ftrip )) THEN call sample_triplet return END IF END IF IF (( pair_nrc .EQ. 1 )) THEN k = eig/rm IF (( k .LT. nrcp_emax )) THEN do_nrc_pair = .true. IF (( k .LE. nrcp_emin )) THEN ibin = 1 ELSE abin = 1 + log((k-2)/(nrcp_emin-2))*nrcp_dlei ibin = abin abin = abin - ibin IF((rng_seed .GT. 128))call ranmar_get rbin = rng_array(rng_seed)*twom24
![Page 376: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/376.jpg)
rng_seed = rng_seed + 1 IF((rbin .LT. abin))ibin = ibin + 1 END IF xx = alias_sample1(64,nrcp_xdata, nrcp_fdata(1,ibin,medium),nr * cp_wdata(1,ibin,medium), nrcp_idata(1,ibin,medium)) IF (( xx .GT. 0.5 )) THEN pese1 = prm*(1 + xx*(k-2)) iq1 = 1 pese2 = peig - pese1 iq2 = -1 ELSE pese2 = prm*(1 + xx*(k-2)) iq2 = 1 pese1 = peig - pese2 iq1 = -1 END IF END IF END IF IF (( .NOT.do_nrc_pair )) THEN IF ((EIG.LE.2.1)) THEN IF((rng_seed .GT. 128))call ranmar_get RNNO30 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get rnno34 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 PESE2 = PRM + 0.5*RNNO30*(PEIG-2*PRM) PESE1 = PEIG - PESE2 IF (( rnno34 .LT. 0.5 )) THEN iq1 = -1 iq2 = 1 ELSE iq1 = 1 iq2 = -1 END IF ELSE IF ((EIG.LT.50.)) THEN L = 5 L1 = L + 1 delta = 4*delcm(medium)/eig IF (( delta .LT. 1 )) THEN Amax = dl1(l,medium)+delta*(dl2(l,medium)+delta*dl3(l,medi * um)) Bmax = dl1(l1,medium)+delta*(dl2(l1,medium)+delta*dl3(l1,m * edium)) ELSE aux2 = log(delta+dl6(l,medium)) Amax = dl4(l,medium)+dl5(l,medium)*aux2 Bmax = dl4(l1,medium)+dl5(l1,medium)*aux2 END IF aux1 = 1 - rmt2/eig aux1 = aux1*aux1 aux1 = aux1*Amax/3 aux1 = aux1/(Bmax+aux1) ELSE L = 7 Amax = dl1(l,medium) Bmax = dl1(l+1,medium)
![Page 377: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/377.jpg)
aux1 = bpar(2,medium)*(1-bpar(1,medium)*rm/eig) END IF del0 = eig*delcm(medium) Eavail = eig - rmt215611 CONTINUE IF((rng_seed .GT. 128))call ranmar_get RNNO30 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get RNNO31 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get RNNO34 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( rnno30 .GT. aux1 )) THEN br = 0.5*rnno31 rejmax = Bmax l1 = l+1 ELSE IF((rng_seed .GT. 128))call ranmar_get rnno32 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get rnno33 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 br = 0.5*(1-max(rnno31,rnno32,rnno33)) rejmax = Amax l1 = l END IF Eminus = br*Eavail + rm Eplus = eig - Eminus delta = del0/(Eminus*Eplus) IF (( delta .LT. 1 )) THEN rejf = dl1(l1,medium)+delta*(dl2(l1,medium)+delta*dl3(l1,m * edium)) ELSE rejf = dl4(l1,medium)+dl5(l1,medium)*log(delta+dl6(l1,medi * um)) END IF IF((( rnno34*rejmax .LE. rejf )))GO TO15612 GO TO 1561115612 CONTINUE pese2 = Eminus pese1 = peig - pese2 IF((rng_seed .GT. 128))call ranmar_get RNNO34 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( rnno34 .LT. 0.5 )) THEN iq1 = -1 iq2 = 1 ELSE iq1 = 1 iq2 = -1 END IF END IF END IF ESE2=PESE2 E(NP)=PESE1
![Page 378: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/378.jpg)
E(NP+1)=PESE2 IF (( iprdst .GT. 0 )) THEN IF (( iprdst .EQ. 4 )) THEN IF((rng_seed .GT. 128))call ranmar_get rtest = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 gbeta = PESE1/(PESE1+10) IF (( rtest .LT. gbeta )) THEN iprdst_use = 1 ELSE iprdst_use = 4 END IF ELSE IF(( iprdst .EQ. 2 .AND. eig .LT. 4.14 )) THEN iprdst_use = 1 ELSE iprdst_use = iprdst END IF DO 15621 ichrg=1,2 IF ((ICHRG.EQ.1)) THEN ESE=PESE1 ELSE ESE=ESE2 IF (( iprdst .EQ. 4 )) THEN gbeta = ESE/(ESE+10) IF((rng_seed .GT. 128))call ranmar_get rtest = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( rtest .LT. gbeta )) THEN iprdst_use = 1 ELSE iprdst_use = 4 END IF END IF END IF IF (( iprdst_use .EQ. 1 )) THEN PSE=SQRT(MAX(0.0,(ESE-RM)*(ESE+RM))) IF((rng_seed .GT. 128))call ranmar_get COSTHE = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 COSTHE=1.0-2.0*COSTHE SINTHE=RM*SQRT((1.0-COSTHE)*(1.0+COSTHE))/(PSE*COSTHE+ESE) COSTHE=(ESE*COSTHE+PSE)/(PSE*COSTHE+ESE) ELSE IF(( iprdst_use .EQ. 2 )) THEN ZTARG=ZBRANG(MEDIUM) TTEIG=EIG/RM TTESE=ESE/RM TTPSE=SQRT((TTESE-1.0)*(TTESE+1.0)) ESEDEI=TTESE/(TTEIG-TTESE) ESEDER=1.0/ESEDEI XIMIN=1.0/(1.0+(3.141593*TTESE)**2) REJMIN = 2.0+3.0*(ESEDEI+ESEDER) - 4.00*(ESEDEI+ESEDER+1.0-4 * .0*(XIMIN-0.5)**2)*( 1.0+0.25*LOG( ((1.0+ESEDER)*(1.0+ESEDEI * )/(2.*TTEIG))**2+ZTARG*XIMIN**2 ) ) YA=(2.0/TTEIG)**2 XITRY=MAX(0.01,MAX(XIMIN,MIN(0.5,SQRT(YA/ZTARG)))) GALPHA=1.0+0.25*LOG(YA+ZTARG*XITRY**2) GBETA=0.5*ZTARG*XITRY/(YA+ZTARG*XITRY**2) GALPHA=GALPHA-GBETA*(XITRY-0.5)
![Page 379: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/379.jpg)
XIMID=GALPHA/(3.0*GBETA) IF ((GALPHA.GE.0.0)) THEN XIMID=0.5-XIMID+SQRT(XIMID**2+0.25) ELSE XIMID=0.5-XIMID-SQRT(XIMID**2+0.25) END IF XIMID=MAX(0.01,MAX(XIMIN,MIN(0.5,XIMID))) REJMID = 2.0+3.0*(ESEDEI+ESEDER) - 4.00*(ESEDEI+ESEDER+1.0-4 * .0*(XIMID-0.5)**2)*( 1.0+0.25*LOG( ((1.0+ESEDER)*(1.0+ESEDEI * )/(2.*TTEIG))**2+ZTARG*XIMID**2 ) ) REJTOP=1.02*MAX(REJMIN,REJMID)15631 CONTINUE IF((rng_seed .GT. 128))call ranmar_get XITST = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 REJTST = 2.0+3.0*(ESEDEI+ESEDER) - 4.00*(ESEDEI+ESEDER+1.0 * -4.0*(XITST-0.5)**2)*( 1.0+0.25*LOG( ((1.0+ESEDER)*(1.0+ES * EDEI)/(2.*TTEIG))**2+ZTARG*XITST**2 ) ) IF((rng_seed .GT. 128))call ranmar_get RTEST = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 THETA=SQRT(1.0/XITST-1.0)/TTESE REJTST_on_REJTOP = REJTST/REJTOP IF((((RTEST .LE. REJTST_on_REJTOP) .AND. (THETA .LT. PI) ) * ))GO TO15632 GO TO 1563115632 CONTINUE SINTHE=SIN(THETA) COSTHE=COS(THETA) ELSE IF(( iprdst_use .EQ. 3 )) THEN IF((rng_seed .GT. 128))call ranmar_get COSTHE = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 COSTHE=1.0-2.0*COSTHE sinthe=(1-costhe)*(1+costhe) IF (( sinthe .GT. 0 )) THEN sinthe = sqrt(sinthe) ELSE sinthe = 0 END IF ELSE IF((rng_seed .GT. 128))call ranmar_get costhe = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 costhe=1-2*sqrt(costhe) sinthe=(1-costhe)*(1+costhe) IF (( sinthe .GT. 0 )) THEN sinthe=sqrt(sinthe) ELSE sinthe=0 END IF END IF IF (( ichrg .EQ. 1 )) THEN CALL UPHI(2,1) ELSE sinthe=-sinthe NP=NP+1 CALL UPHI(3,2)
![Page 380: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/380.jpg)
END IF15621 CONTINUE15622 CONTINUE iq(np) = iq2 iq(np-1) = iq1 return ELSE THETA=0 END IF CALL UPHI(1,1) NP=NP+1 SINTHE=-SINTHE CALL UPHI(3,2) IQ(NP)=iq2 IQ(NP-1)=iq1 RETURN END subroutine sample_triplet implicit none COMMON/EPCONT/EDEP,TSTEP,TUSTEP,USTEP,TVSTEP,VSTEP, RHOF,EOLD,ENEW *,EKE,ELKE,GLE,E_RANGE, x_final,y_final,z_final, u_final,v_final,w_ *final, IDISC,IROLD,IRNEW,IAUSFL(29) DOUBLE PRECISION EDEP real*8 TSTEP, TUSTEP, USTEP, VSTEP, TVSTEP, RHOF, EOLD, ENE *W, EKE, ELKE, GLE, E_RANGE, x_final,y_final,z_final, u_final, *v_final,w_final integer*4 IDISC, IROLD, IRNEW, IAUSFL COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000 *),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 COMMON/USERPS/n_split integer*4 n_split COMMON/USERRR/ESAVE_GLOBAL,RANGE_ECUTRR(7),IREJECT real*8 ESAVE_GLOBAL,RANGE_ECUTRR
![Page 381: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/381.jpg)
integer*4 IREJECT common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch real*8 fmax_array(250), eta_p_array(250), eta_Ep_array(250), eta_c *ostp_array(250), eta_costm_array(250), ebin_array(250), wp_array(2 *50), qmin_array(250) real*8 kmin, kmax, dlogki, alogkm, prmi, tiny_eta real*8 ai,rnno,k,qmin,qmax,aux,a1,a2,a3,D,px1,px2,pp_min,pp_max, E *p_min,Ep_max,k2p2,k2p2x,peig,b,aux1,aux12,D1,aux3,xmin,xmax, aux6, *aux7,uu,cphi,sphi,cphi_factor,aux5,phi,tmp real*8 Er,pr,pr2,eta_pr real*8 Ep,pp,pp2,wEp,cost_p,sint_p,eta_Ep,mup_min,wmup, eta_costp, *Epp,pp_sintp,pp_sntp2 real*8 Em,pm,pm2,cost_m,sint_m,Emm,wmum,pm_sintm, eta_costm real*8 k2,k3,s2,s3,k2k3i,k22,k32,q2,aux4,S_1,S_2,sigma real*8 ppx, ppy, ppz, pmx, pmy, pmz, prx, pry, prz, a,c,sindel,cos *del,sinpsi integer*4 i logical use_it integer*4 iscore logical is_initialized data is_initialized/.false./ save is_initialized,fmax_array,eta_p_array,eta_Ep_array,eta_costp_ *array, eta_costm_array,ebin_array,wp_array,qmin_array, kmin,kmax,d *logki,alogkm,prmi,tiny_eta IF (( .NOT.is_initialized )) THEN is_initialized = .true. tiny_eta = 1e-6 DO 15641 i=1,250 fmax_array(i) = -115641 CONTINUE15642 CONTINUE kmax = 0 kmin = 4.1*prm DO 15651 i=1,nmed IF((up(i) .GT. kmax))kmax = UP(i)15651 CONTINUE15652 CONTINUE IF((kmax .LE. kmin))return dlogki = 250 - 1 dlogki = dlogki/log(kmax/kmin) alogkm = 1 - dlogki*log(kmin) prmi = 1/prm DO 15661 i=1,250 k = 4.1*exp((i-1.)/dlogki) ebin_array(i) = k qmin = 4*k/(k*(k-1)+(k+1)*sqrt(k*(k-4))) qmax = (k*(k-1) + (k+1)*sqrt(k*(k-4)))/(2*k+1)
![Page 382: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/382.jpg)
qmin_array(i) = qmin wp_array(i) = log(qmax/qmin)15661 CONTINUE15662 CONTINUE END IF peig = e(np) IF((peig .LE. 4*prm))return IF (( np+2 .GT. 10000 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(//,a,a,a,/,a,i6,a,i6,/,a)') ' In subroutine ','sam *ple_triplet', ' stack size exceeded! ',' $MXSTACK = ',10000,' np = * ',np+2, ' Increase $MXSTACK and try again ' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF IF (( peig .LE. kmin )) THEN i = 1 ELSE IF(( peig .GE. kmax )) THEN i = 250 ELSE ai = alogkm + dlogki*gle i = ai ai = ai - i IF((rng_seed .GT. 128))call ranmar_get rnno = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( rnno .LT. ai )) THEN i = i+1 END IF END IF k = ebin_array(i)15670 CONTINUE IF((rng_seed .GT. 128))call ranmar_get eta_pr = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((eta_pr .LT. tiny_eta))eta_pr = tiny_eta pr = qmin_array(i)*exp(eta_pr*wp_array(i)) pr2 = pr*pr Er = sqrt(1+pr2) aux = Er-pr-1 a1=(k-pr)*(1-Er-k*aux) a2=1+k-Er a3=1/(aux*(pr+Er-2*k-1)) D = a2*sqrt(aux*(2*k*Er+k*k*aux-pr*(Er+pr+1)/2)) px1 = (a1 + D)*a3 px2 = (a1 - D)*a3 IF (( px1 .LT. px2 )) THEN pp_min = px1 pp_max = px2 ELSE pp_min = px2 pp_max = px1 END IF Ep_min = sqrt(1 + pp_min*pp_min) Ep_max = sqrt(1 + pp_max*pp_max) IF((rng_seed .GT. 128))call ranmar_get eta_Ep = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1
![Page 383: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/383.jpg)
IF((eta_Ep .LT. tiny_eta))eta_Ep = tiny_eta wEp = Ep_max - Ep_min Ep = Ep_min + eta_Ep*wEp pp2 = Ep*Ep - 1 pp = sqrt(pp2) k2p2 = k*k + pp2 Em = k + 1 - Er - Ep pm2 = Em*Em-1 pm = sqrt(pm2) mup_min = (k2p2 - (pr + pm)*(pr + pm))/(2*k*pp) IF((rng_seed .GT. 128))call ranmar_get eta_costp = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((eta_costp .LT. tiny_eta))eta_costp = tiny_eta Epp = Ep/pp wmup = log((Epp-1)/(Epp-mup_min)) cost_p = Epp - (Epp - mup_min)*exp(wmup*eta_costp) wmup = wmup*(cost_p - Epp) sint_p = 1-cost_p*cost_p IF (( sint_p .GT. 1e-20 )) THEN sint_p = sqrt(sint_p) ELSE sint_p = 1e-10 END IF k2p2x = k2p2 - 2*k*pp*cost_p b = pr2-k2p2x-pm2 aux1 = k - pp*cost_p aux12 = aux1*aux1 pp_sintp = pp*sint_p pp_sntp2 = pp_sintp*pp_sintp D1 = pm2*(aux12+pp_sntp2)-b*b/4 IF (( D1 .LE. 0 )) THEN goto 15670 END IF D = 2*pp_sintp*sqrt(D1) aux3 = 0.5/(aux12+pp_sntp2) xmin = (-b*aux1-D)*aux3 xmax = (-b*aux1+D)*aux3 IF((rng_seed .GT. 128))call ranmar_get eta_costm = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((eta_costm .LT. tiny_eta))eta_costm = tiny_eta aux6 = sqrt((Em-xmin)/(Em-xmax)) aux7 = aux6*tan(1.570796326794897*eta_costm) uu = (aux7-1)/(aux7+1) cost_m = 0.5*(xmax + xmin + 2*uu*(xmax-xmin)/(1+uu*uu)) wmum = sqrt((xmax-cost_m)*(cost_m-xmin)) wmum = wmum*aux6*(Em-cost_m)/(Em-xmin) cost_m = cost_m/pm sint_m = sqrt(1-cost_m*cost_m) pm_sintm = pm*sint_m cphi = (b + 2*pm*cost_m*aux1)/(2*pp_sintp*pm_sintm) IF (( abs(cphi) .GE. 1 )) THEN goto 15670 END IF sphi = sqrt(1-cphi*cphi) k3 = k*(pp*cost_p - Ep) k2 = k*(pm*cost_m - Em)
![Page 384: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/384.jpg)
k22 = k2*k2 k32 = k3*k3 k2k3i = 1/(k2*k3) s2 = pp*pm*(cost_p*cost_m + sint_p*sint_m*cphi) - Ep*Em s3 = k2 - Em + 1 - s2 q2 = 2*(Er-1) S_1 = k32+k22+(q2-2)*s2-(1-q2/2)*(k32+k22)*k2k3i aux4 = k3*Ep-k2*Em S_2 = -q2*(Ep*Ep+Em*Em) + 2*s2 - (2*aux4*aux4 - k22 - k32)*k2k3i sigma = abs(pp*pm2*pm*k2k3i/(q2*q2*(Em*s3+Er))*(S_1*(1-q2/4)+S_2*( *1+q2/4))) cphi_factor = abs(2*Er*pm2-Em*(k2p2x-pr2-pm2))/(2*pp_sintp*pm_sint *m*pm2*sphi) sigma = sigma*cphi_factor*wEp*wmup*wmum*wp_array(i)*pr2/Er IF (( sigma .LT. 0 )) THEN write(i_log,'(/a)') '***************** Warning: ' write(i_log,*) 'In triplet sigma < 0 ? ',sigma END IF use_it = .true. IF (( sigma .LT. fmax_array(i) )) THEN IF((rng_seed .GT. 128))call ranmar_get rnno = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( sigma .LT. fmax_array(i)*rnno )) THEN use_it = .false. END IF END IF IF (( use_it )) THEN fmax_array(i) = sigma eta_p_array(i) = eta_pr eta_Ep_array(i) = eta_Ep eta_costp_array(i) = eta_costp eta_costm_array(i) = eta_costm ELSE eta_pr = eta_p_array(i) eta_Ep = eta_Ep_array(i) eta_costp = eta_costp_array(i) eta_costm = eta_costm_array(i) END IF k = peig*prmi aux5 = k*(k-1)+(k+1)*sqrt(k*(k-4)) qmin = 4*k/aux5 qmax = aux5/(2*k+1) pr = qmin*exp(eta_pr*log(qmax/qmin)) pr2 = pr*pr Er = sqrt(1+pr2) aux = Er-pr-1 a1=(k-pr)*(1-Er-k*aux) a2=1+k-Er a3=1/(aux*(pr+Er-2*k-1)) D = a2*sqrt(aux*(2*k*Er+k*k*aux-pr*(Er+pr+1)/2)) px1 = (a1 + D)*a3 px2 = (a1 - D)*a3 IF (( px1 .LT. px2 )) THEN pp_min = px1 pp_max = px2 ELSE pp_min = px2
![Page 385: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/385.jpg)
pp_max = px1 END IF Ep_min = sqrt(1 + pp_min*pp_min) Ep_max = sqrt(1 + pp_max*pp_max) wEp = Ep_max - Ep_min Ep = Ep_min + eta_Ep*wEp pp2 = Ep*Ep - 1 pp = sqrt(pp2) k2p2 = k*k + pp2 Em = k + 1 - Er - Ep pm2 = Em*Em-1 pm = sqrt(pm2) mup_min = (k2p2 - (pr + pm)*(pr + pm))/(2*k*pp) Epp = Ep/pp wmup = log((Epp-1)/(Epp-mup_min)) cost_p = Epp - (Epp - mup_min)*exp(wmup*eta_costp) sint_p = sqrt(1-cost_p*cost_p) k2p2x = k2p2 - 2*k*pp*cost_p b = pr2-k2p2x-pm2 aux1 = k - pp*cost_p aux12 = aux1*aux1 pp_sintp = pp*sint_p pp_sntp2 = pp_sintp*pp_sintp D1 = pm2*(aux12+pp_sntp2)-b*b/4 IF (( D1 .LE. 0 )) THEN goto 15670 END IF D = 2*pp_sintp*sqrt(D1) aux3 = 0.5/(aux12+pp_sntp2) xmin = (-b*aux1-D)*aux3 xmax = (-b*aux1+D)*aux3 aux6 = sqrt((Em-xmin)/(Em-xmax)) aux7 = aux6*tan(1.570796326794897*eta_costm) uu = (aux7-1)/(aux7+1) cost_m = 0.5*(xmax + xmin + 2*uu*(xmax-xmin)/(1+uu*uu))/pm sint_m = sqrt(1-cost_m*cost_m) pm_sintm = pm*sint_m cphi = (b + 2*pm*cost_m*aux1)/(2*pp_sintp*pm_sintm) IF (( abs(cphi) .GE. 1 )) THEN goto 15670 END IF sphi = sqrt(1-cphi*cphi) IF((rng_seed .GT. 128))call ranmar_get phi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 phi = phi*6.283185307179586 ppx = pp*sint_p ppy = 0 pmx = pm*sint_m*cphi pmy = pm*sint_m*sphi cphi = cos(phi) sphi = sin(phi) tmp = ppx*sphi ppx = ppx*cphi - ppy*sphi ppy = tmp + ppy*cphi tmp = pmx*sphi pmx = pmx*cphi - pmy*sphi pmy = tmp + pmy*cphi
![Page 386: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/386.jpg)
ppz = pp*cost_p pmz = pm*cost_m prx = -ppx-pmx pry = -ppy-pmy prz = k - ppz - pmz NPold = np X(np)=X(np) Y(np)=Y(np) Z(np)=Z(np) IR(np)=IR(np) WT(np)=WT(np) DNEAR(np)=DNEAR(np) LATCH(np)=LATCH(np) X(np+1)=X(np) Y(np+1)=Y(np) Z(np+1)=Z(np) IR(np+1)=IR(np) WT(np+1)=WT(np) DNEAR(np+1)=DNEAR(np) LATCH(np+1)=LATCH(np) X(np+2)=X(np+1) Y(np+2)=Y(np+1) Z(np+2)=Z(np+1) IR(np+2)=IR(np+1) WT(np+2)=WT(np+1) DNEAR(np+2)=DNEAR(np+1) LATCH(np+2)=LATCH(np+1) pp = 1/pp pm = 1/pm pr = 1/pr a = u(np) b = v(np) c = w(np) sinpsi = a*a + b*b IF (( sinpsi .GT. 1e-20 )) THEN sinpsi = sqrt(sinpsi) sindel = b/sinpsi cosdel = a/sinpsi IF (( Ep .GT. Em )) THEN u(np) = pp*(c*cosdel*ppx - sindel*ppy + a*ppz) v(np) = pp*(c*sindel*ppx + cosdel*ppy + b*ppz) w(np) = pp*(c*ppz - sinpsi*ppx) iq(np) = 1 E(np) = Ep*prm u(np+1) = pm*(c*cosdel*pmx - sindel*pmy + a*pmz) v(np+1) = pm*(c*sindel*pmx + cosdel*pmy + b*pmz) w(np+1) = pm*(c*pmz - sinpsi*pmx) iq(np+1) = -1 E(np+1) = Em*prm ELSE u(np+1) = pp*(c*cosdel*ppx - sindel*ppy + a*ppz) v(np+1) = pp*(c*sindel*ppx + cosdel*ppy + b*ppz) w(np+1) = pp*(c*ppz - sinpsi*ppx) iq(np+1) = 1 E(np+1) = Ep*prm u(np) = pm*(c*cosdel*pmx - sindel*pmy + a*pmz) v(np) = pm*(c*sindel*pmx + cosdel*pmy + b*pmz) w(np) = pm*(c*pmz - sinpsi*pmx)
![Page 387: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/387.jpg)
iq(np) = -1 E(np) = Em*prm END IF np = np + 2 u(np) = pr*(c*cosdel*prx - sindel*pry + a*prz) v(np) = pr*(c*sindel*prx + cosdel*pry + b*prz) w(np) = pr*(c*prz - sinpsi*prx) iq(np) = -1 E(np) = Er*prm ELSE IF (( Ep .GT. Em )) THEN u(np) = pp*ppx v(np) = pp*ppy w(np) = c*pp*ppz iq(np) = 1 E(np) = Ep*prm u(np+1) = pm*pmx v(np+1) = pm*pmy w(np+1) = c*pm*pmz iq(np+1) = -1 E(np+1) = Em*prm ELSE u(np+1) = pp*ppx v(np+1) = pp*ppy w(np+1) = c*pp*ppz iq(np+1) = 1 E(np+1) = Ep*prm u(np) = pm*pmx v(np) = pm*pmy w(np) = c*pm*pmz iq(np) = -1 E(np) = Em*prm END IF np = np + 2 u(np) = pr*prx v(np) = pr*pry w(np) = c*pr*prz iq(np) = -1 E(np) = Er*prm END IF return end SUBROUTINE PHOTO ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none COMMON/BOUNDS/ECUT,PCUT,VACDST real*8 ECUT, PCUT, VACDST COMMON/BREMPR/ DL1(8,7),DL2(8,7),DL3(8,7),DL4(8,7),DL5(8,7),DL6(8, *7), ALPHI(2,7),BPAR(2,7),DELPOS(2,7), WA(7,50),PZ(7,50),ZELEM(7,50 *),RHOZ(7,50), PWR2I(50), DELCM(7),ZBRANG(7),LZBRANG(7),NNE(7), IBR *DST,IPRDST,ibr_nist,pair_nrc,itriplet, ASYM(7,50,2) CHARACTER*4 ASYM real*8 DL1,DL2,DL3,DL4,DL5,DL6, ALPHI, BPAR, DELPOS, WA, PZ, * ZELEM, RHOZ, PWR2I, DELCM, ZBRANG, LZBRANG integer*4 NNE, IBRDST, IPRDST, ibr_nist, itriplet, pair_nrc COMMON/QDEBUG/QDEBUG LOGICAL QDEBUG
![Page 388: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/388.jpg)
COMMON/EDGE/binding_energies(6,100), interaction_prob(6,100), rela *xation_prob(39,100), edge_energies(16,100), edge_number(100), edge *_a(16,100), edge_b(16,100), edge_c(16,100), edge_d(16,100), IEDGFL *,IPHTER real*8 binding_energies, interaction_prob, relaxation_prob, e *dge_energies, edge_a,edge_b,edge_c,edge_d integer*2 IEDGFL, IPHTER integer*4 edge_number COMMON/EPCONT/EDEP,TSTEP,TUSTEP,USTEP,TVSTEP,VSTEP, RHOF,EOLD,ENEW *,EKE,ELKE,GLE,E_RANGE, x_final,y_final,z_final, u_final,v_final,w_ *final, IDISC,IROLD,IRNEW,IAUSFL(29) DOUBLE PRECISION EDEP real*8 TSTEP, TUSTEP, USTEP, VSTEP, TVSTEP, RHOF, EOLD, ENE *W, EKE, ELKE, GLE, E_RANGE, x_final,y_final,z_final, u_final, *v_final,w_final integer*4 IDISC, IROLD, IRNEW, IAUSFL COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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/PHOTIN/ EBINDA(7), GE0(7),GE1(7), GMFP0(200,7),GMFP1(200,7) *,GBR10(200,7),GBR11(200,7),GBR20(200,7),GBR21(200,7), RCO0(7),RCO1 *(7), RSCT0(100,7),RSCT1(100,7), COHE0(200,7),COHE1(200,7), DPMFP, *MPGEM(1,7), NGR(7) real*8 EBINDA, GE0,GE1, GMFP0,GMFP1, GBR10,GBR11, GBR20,GBR21, * RCO0,RCO1, RSCT0,RSCT1, COHE0,COHE1, DPMFP integer*4 * MPGEM, * NGR common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000 *),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold COMMON/UPHIOT/THETA,SINTHE,COSTHE,SINPHI, COSPHI,PI,TWOPI,PI5D2 real*8 THETA, SINTHE, COSTHE, SINPHI, COSPHI, PI,TWOPI,PI5D2 COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext
![Page 389: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/389.jpg)
*ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch common/egs_vr/ e_max_rr, prob_RR, nbr_split, i_play_RR, i_ *survived_RR, * n_RR_warning, i_do_rr real*8 e_max_rr,prob_RR integer*4 nbr_split,i_play_RR,i_survived_RR,n_RR_warning integer*2 i_do_rr real*8 EELEC, BETA, GAMMA, ALPHA, RATIO, RNPHT, FKAPPA, XI, * SINTH2, RNPHT2 DOUBLE PRECISION PEIG real*8 BR, sigma, aux,aux1, probs(50), sigtot, e_vac, rnno_R *R integer*4 IARG, iZ, irl, ints(50), j,ip, n_warning, k logical do_relax save n_warning data n_warning/0/ NPold = NP PEIG=E(NP) irl = ir(np) IF (( peig .LT. edge_energies(2,1) )) THEN IF (( n_warning .LT. 100 )) THEN n_warning = n_warning + 1 write(i_log,*) ' Subroutine PHOTO called with E = ',peig, ' wh *ich is below the current min. energy of 1 keV! ' write(i_log,*) ' Converting now this photon to an electron, ' write(i_log,*) ' but you should check your code! ' END IF iq(np) = -1 e(np) = peig + prm return END IF iZ = IEDGFL do_relax = .false. edep = pzero IF (( IEDGFL .NE. 0 )) THEN IF (( nne(medium) .EQ. 1 )) THEN iZ = int( zelem(medium,1) + 0.5 ) DO 15681 j=1,edge_number(iZ) IF((peig .GE. edge_energies(j,iZ)))GO TO1568215681 CONTINUE15682 CONTINUE ELSE aux = peig*peig aux1 = aux*peig aux = aux*Sqrt(peig) sigtot = 0 DO 15691 k=1,nne(medium) iZ = int( zelem(medium,k) + 0.5 ) IF (( iZ .LT. 1 .OR. iZ .GT. 100 )) THEN write(i_log,*) ' Error in PHOTO: ' write(i_log,'(/a)') '***************** Error: ' write(i_log,*) ' Atomic number of element ',k, ' in medi *um ',medium,' is not between 1 and ',100
![Page 390: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/390.jpg)
write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF IF (( peig .GT. edge_energies(1,iZ) )) THEN j = 1 sigma = (edge_a(1,iZ) + edge_b(1,iZ)/peig + edge_c(1,iZ)/a * ux + edge_d(1,iZ)/aux1)/peig ELSE DO 15701 j=2,edge_number(iZ) IF((peig .GE. edge_energies(j,iZ)))GO TO1570215701 CONTINUE15702 CONTINUE sigma = edge_a(j,iZ) + gle*(edge_b(j,iZ) + gle*(edge_c(j,i * Z) + gle*edge_d(j,iZ) )) sigma = Exp(sigma) END IF sigma = sigma * pz(medium,k) sigtot = sigtot + sigma probs(k) = sigma ints(k) = j15691 CONTINUE15692 CONTINUE IF((rng_seed .GT. 128))call ranmar_get br = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 br = br*sigtot DO 15711 k=1,nne(medium) br = br - probs(k) IF((br .LE. 0))GO TO1571215711 CONTINUE15712 CONTINUE iZ = int( zelem(medium,k) + 0.5 ) j = ints(k) END IF IF (( peig .LE. binding_energies(6,iZ) )) THEN edep = peig e(np) = pzero wt(np) = 0 ELSE IF((rng_seed .GT. 128))call ranmar_get br = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 DO 15721 k=1,5 IF (( peig .GT. binding_energies(k,iZ) )) THEN IF((br .LT. interaction_prob(k,iZ)))GO TO15722 br = (br - interaction_prob(k,iZ))/(1-interaction_prob(k,i * Z)) END IF15721 CONTINUE15722 CONTINUE e_vac = binding_energies(k,iZ) e(np) = peig - e_vac + prm do_relax = .true. iq(np) = -1 END IF ELSE e(np) = peig + prm iq(np) = -1
![Page 391: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/391.jpg)
END IF IF (( iq(np) .EQ. -1 )) THEN IF ((IPHTER.EQ.1)) THEN EELEC=E(NP) IF ((EELEC.GT.ECUT)) THEN BETA=SQRT((EELEC-RM)*(EELEC+RM))/EELEC GAMMA=EELEC/RM ALPHA=0.5*GAMMA-0.5+1./GAMMA RATIO=BETA/ALPHA15731 CONTINUE IF((rng_seed .GT. 128))call ranmar_get RNPHT = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 RNPHT=2.*RNPHT-1. IF ((RATIO.LE.0.2)) THEN FKAPPA=RNPHT+0.5*RATIO*(1.-RNPHT)*(1.+RNPHT) IF (( gamma .LT. 100 )) THEN COSTHE=(BETA+FKAPPA)/(1.+BETA*FKAPPA) ELSE IF (( fkappa .GT. 0 )) THEN costhe = 1 - (1-fkappa)*(gamma-3)/(2*(1+fkappa)*(gam * ma-1)**3) ELSE COSTHE=(BETA+FKAPPA)/(1.+BETA*FKAPPA) END IF END IF xi = (1+beta*fkappa)*gamma*gamma ELSE XI=GAMMA*GAMMA*(1.+ALPHA*(SQRT(1.+RATIO*(2.*RNPHT+RATIO) * )-1.)) COSTHE=(1.-1./XI)/BETA END IF SINTH2=MAX(0.,(1.-COSTHE)*(1.+COSTHE)) IF((rng_seed .GT. 128))call ranmar_get RNPHT2 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF(RNPHT2.LE.0.5*(1.+GAMMA)*SINTH2*XI/GAMMA)GO TO15732 GO TO 1573115732 CONTINUE SINTHE=SQRT(SINTH2) CALL UPHI(2,1) END IF END IF END IF IF (( do_relax )) THEN call relax(e_vac,k,iZ) END IF IF (( EDEP .GT. 0 )) THEN IARG=4 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN END IF i_survived_RR = 0 IF (( i_play_RR .EQ. 1 )) THEN IF (( prob_RR .LE. 0 )) THEN IF (( n_RR_warning .LT. 50 )) THEN
![Page 392: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/392.jpg)
n_RR_warning = n_RR_warning + 1 WRITE(6,15740)prob_RR15740 FORMAT('**** Warning, attempt to play Roussian Roulette with * prob_RR<=0! ',g14.6) END IF ELSE ip = NPold15751 CONTINUE IF (( iq(ip) .NE. 0 )) THEN IF((rng_seed .GT. 128))call ranmar_get rnno_RR = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( rnno_RR .LT. prob_RR )) THEN wt(ip) = wt(ip)/prob_RR ip = ip + 1 ELSE i_survived_RR = i_survived_RR + 1 IF ((ip .LT. np)) THEN e(ip) = e(np) iq(ip) = iq(np) wt(ip) = wt(np) u(ip) = u(np) v(ip) = v(np) w(ip) = w(np) END IF np = np-1 END IF ELSE ip = ip+1 END IF IF(((ip .GT. np)))GO TO15752 GO TO 1575115752 CONTINUE IF (( np .EQ. 0 )) THEN np = 1 e(np) = 0 iq(np) = 0 wt(np) = 0 END IF END IF END IF return end SUBROUTINE RELAX(energy,n,iZ) ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none integer*4 n,iZ real*8 energy integer*4 vac_array(50), n_vac, shell integer*4 final,finala, final1,final2, iql, irl integer*4 first_transition(5), last_transition(5) integer*4 final_state(39) integer*4 k, np_old, ip, iarg real*8 e_array(50), Ei,Ef, Ex, eta, e_check, e_cut,ekcut,pkcu *t,elcut real*8 xphi,yphi,xphi2,yphi2,rhophi2, cphi,sphi COMMON/EPCONT/EDEP,TSTEP,TUSTEP,USTEP,TVSTEP,VSTEP, RHOF,EOLD,ENEW
![Page 393: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/393.jpg)
*,EKE,ELKE,GLE,E_RANGE, x_final,y_final,z_final, u_final,v_final,w_ *final, IDISC,IROLD,IRNEW,IAUSFL(29) DOUBLE PRECISION EDEP real*8 TSTEP, TUSTEP, USTEP, VSTEP, TVSTEP, RHOF, EOLD, ENE *W, EKE, ELKE, GLE, E_RANGE, x_final,y_final,z_final, u_final, *v_final,w_final integer*4 IDISC, IROLD, IRNEW, IAUSFL COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000 *),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold COMMON/BOUNDS/ECUT,PCUT,VACDST real*8 ECUT, PCUT, VACDST COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 COMMON/EDGE/binding_energies(6,100), interaction_prob(6,100), rela *xation_prob(39,100), edge_energies(16,100), edge_number(100), edge *_a(16,100), edge_b(16,100), edge_c(16,100), edge_d(16,100), IEDGFL *,IPHTER real*8 binding_energies, interaction_prob, relaxation_prob, e *dge_energies, edge_a,edge_b,edge_c,edge_d integer*2 IEDGFL, IPHTER integer*4 edge_number common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch common/user_relax/ u_relax,ish_relax,iZ_relax real*8 u_relax integer*4 ish_relax, iZ_relax data first_transition/1,20,27,33,38/ data last_transition/19,26,32,37,39/ data final_state/ 4,3,5,6, 202,302,402,404,403,303, 502,503,504, *602,603,604, 505,605,606, 13,14, 5,6, 505,605,606, 14, 5,6, * 505,605,606, 5,6, 505,605,606, 6, 606/ save first_transition,last_transition,final_state IF (( n .LT. 1 .OR. n .GT. 6 )) THEN return END IF iz_relax = iZ irl = ir(np)
![Page 394: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/394.jpg)
ekcut = ECUT-rm pkcut = PCUT e_cut = Min(ekcut,pkcut) e_cut = Max(0.001,e_cut) IF (( energy .LE. e_cut )) THEN edep = edep + energy return END IF n_vac = 1 vac_array(n_vac) = n np_old = np e_check = 0 e_array(n_vac) = energy15760 CONTINUE15761 CONTINUE shell = vac_array(n_vac) Ei = e_array(n_vac) n_vac = n_vac - 1 IF (( Ei .LE. e_cut )) THEN edep = edep + Ei IF((n_vac .GT. 0))goto 15760 GO TO15762 END IF ish_relax = shell u_relax = Ei IF (( shell .EQ. 6 )) THEN IF (( Ei .GT. e_cut )) THEN np = np + 1 IF (( np .GT. 10000 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(//,a,a,a,/,a,i6,a,i6,/,a)') ' In subroutine *','RELAX', ' stack size exceeded! ',' $MXSTACK = ',10000,' np = ', * np, ' Increase $MXSTACK and try again ' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF e(np) = Ei + prm iq(np) = -1 X(np)=X(np-1) Y(np)=Y(np-1) Z(np)=Z(np-1) IR(np)=IR(np-1) WT(np)=WT(np-1) DNEAR(np)=DNEAR(np-1) LATCH(np)=LATCH(np-1) IF((rng_seed .GT. 128))call ranmar_get eta = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 eta = 2*eta - 1 w(np) = eta eta = (1-eta)*(1+eta) IF (( eta .GT. 1e-20 )) THEN eta = Sqrt(eta)15771 CONTINUE IF((rng_seed .GT. 128))call ranmar_get xphi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 xphi = 2*xphi - 1
![Page 395: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/395.jpg)
xphi2 = xphi*xphi IF((rng_seed .GT. 128))call ranmar_get yphi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 yphi2 = yphi*yphi rhophi2 = xphi2 + yphi2 IF(rhophi2.LE.1)GO TO15772 GO TO 1577115772 CONTINUE rhophi2 = 1/rhophi2 cphi = (xphi2 - yphi2)*rhophi2 sphi = 2*xphi*yphi*rhophi2 u(np) = eta*cphi v(np) = eta*sphi ELSE u(np) = 0 v(np) = 0 w(np) = 1 END IF IARG=27 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN ELSE edep = edep + Ei END IF IF((n_vac .GT. 0))goto 15760 GO TO15762 END IF IF((rng_seed .GT. 128))call ranmar_get eta = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 DO 15781 k=first_transition(shell),last_transition(shell)-1 eta = eta - relaxation_prob(k,iZ) IF((eta .LE. 0))GO TO1578215781 CONTINUE15782 CONTINUE final = final_state(k) finala = final IF (( final .LT. 100 )) THEN IF (( final .LT. 10 )) THEN iql = 0 elcut = pkcut ELSE final = final - 10 iql = -1 elcut = ekcut END IF Ef = binding_energies(final,iZ) Ex = Ei - Ef n_vac = n_vac + 1 vac_array(n_vac) = final e_array(n_vac) = Ef ELSE final1 = final/100 final2 = final - final1*100 n_vac = n_vac + 1
![Page 396: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/396.jpg)
vac_array(n_vac) = final1 e_array(n_vac) = binding_energies(final1,iZ) n_vac = n_vac + 1 vac_array(n_vac) = final2 e_array(n_vac) = binding_energies(final2,iZ) iql = -1 Ex = Ei - e_array(n_vac) - e_array(n_vac-1) elcut = ekcut END IF IF (( Ex .LE. elcut )) THEN edep = edep + Ex ELSE np = np + 1 IF (( np .GT. 10000 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(//,a,a,a,/,a,i6,a,i6,/,a)') ' In subroutine ', * 'RELAX', ' stack size exceeded! ',' $MXSTACK = ',10000,' np *= ',np, ' Increase $MXSTACK and try again ' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF iq(np) = iql IF (( iql .EQ. 0 )) THEN e(np) = Ex ELSE e(np) = Ex + rm END IF X(np)=X(np-1) Y(np)=Y(np-1) Z(np)=Z(np-1) IR(np)=IR(np-1) WT(np)=WT(np-1) DNEAR(np)=DNEAR(np-1) LATCH(np)=LATCH(np-1) IF((rng_seed .GT. 128))call ranmar_get eta = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 eta = 2*eta - 1 w(np) = eta eta = (1-eta)*(1+eta) IF (( eta .GT. 1e-20 )) THEN eta = Sqrt(eta)15791 CONTINUE IF((rng_seed .GT. 128))call ranmar_get xphi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 xphi = 2*xphi - 1 xphi2 = xphi*xphi IF((rng_seed .GT. 128))call ranmar_get yphi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 yphi2 = yphi*yphi rhophi2 = xphi2 + yphi2 IF(rhophi2.LE.1)GO TO15792 GO TO 1579115792 CONTINUE rhophi2 = 1/rhophi2 cphi = (xphi2 - yphi2)*rhophi2
![Page 397: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/397.jpg)
sphi = 2*xphi*yphi*rhophi2 u(np) = eta*cphi v(np) = eta*sphi ELSE u(np) = 0 v(np) = 0 w(np) = 1 END IF IF (( finala .LT. 10 )) THEN IARG=25 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN ELSE IF(( finala .LT. 100 )) THEN IARG=26 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN ELSE IARG=27 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN END IF END IF GO TO 1576115762 CONTINUE return end subroutine init_triplet implicit none COMMON/BREMPR/ DL1(8,7),DL2(8,7),DL3(8,7),DL4(8,7),DL5(8,7),DL6(8, *7), ALPHI(2,7),BPAR(2,7),DELPOS(2,7), WA(7,50),PZ(7,50),ZELEM(7,50 *),RHOZ(7,50), PWR2I(50), DELCM(7),ZBRANG(7),LZBRANG(7),NNE(7), IBR *DST,IPRDST,ibr_nist,pair_nrc,itriplet, ASYM(7,50,2) CHARACTER*4 ASYM real*8 DL1,DL2,DL3,DL4,DL5,DL6, ALPHI, BPAR, DELPOS, WA, PZ, * ZELEM, RHOZ, PWR2I, DELCM, ZBRANG, LZBRANG integer*4 NNE, IBRDST, IPRDST, ibr_nist, itriplet, pair_nrc common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), photon_xsect *ions, comp_xsections, apx,upx, eii_xfile,NMED CHARACTER*4 MEDIA
![Page 398: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/398.jpg)
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/triplet_data/ a_triplet(250,7), b_triplet(250,7), dl_triple *t, dli_triplet, bli_triplet, log_4rm real*8 a_triplet,b_triplet,dl_triplet, dli_triplet, bli_triplet, l *og_4rm COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD real*8 energies(55), sig_pair(100,55), sig_triplet(100,55), f_trip *let(55), sigp(55), sigt(55), as(55), bs(55), cs(55), ds(55) character*128 triplet_data_file integer*4 want_triplet_unit, triplet_unit integer*4 i, iel, imed, lnblnk1, egs_get_unit, ntrip, iz1, izi, if *irst real*8 logE, f_new, f_old, spline IF((itriplet .EQ. 0))return DO 15801 i=1,len(triplet_data_file) triplet_data_file(i:i) = ' '15801 CONTINUE15802 CONTINUE triplet_data_file = hen_house(:lnblnk1(hen_house)) // 'data' // '/ *' // 'triplet.data' want_triplet_unit = 63 triplet_unit = egs_get_unit(want_triplet_unit) IF (( triplet_unit .LT. 1 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'init_triplet: failed to get a free Fortran I/O u *nit' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF open(triplet_unit,file=triplet_data_file,err=15810) write(i_log,'(a,$)') ' init_triplet: reading triplet data ... ' read(triplet_unit,*) ntrip IF (( ntrip .GT. 55 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'Max. number of data points per element is ',55 write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF read(triplet_unit,*,err=15820) (energies(i),i=1,ntrip) DO 15831 iel=1,100 read(triplet_unit,*) read(triplet_unit,*,err=15820) (sig_pair(iel,i),i=1,ntrip) read(triplet_unit,*,err=15820) (sig_triplet(iel,i),i=1,ntrip)15831 CONTINUE15832 CONTINUE write(i_log,*) 'OK' ifirst = 0 DO 15841 i=1,ntrip IF((ifirst .EQ. 0 .AND. energies(i) .GT. 4.01*rm))ifirst = i energies(i) = log(energies(i))
![Page 399: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/399.jpg)
15841 CONTINUE15842 CONTINUE log_4rm = log(4*rm) energies(ifirst-1) = log_4rm dl_triplet = (energies(ntrip) - log_4rm)/250 dli_triplet = 1/dl_triplet bli_triplet = 1 - log_4rm/dl_triplet DO 15851 imed=1,nmed write(i_log,'(a,i3,a,$)') ' Preparing triplet fraction data fo *r medium ',imed,' ... ' iz1 = zelem(imed,1) + 0.1 DO 15861 i=1,ntrip sigp(i) = pz(imed,1)*sig_pair(iz1,i) sigt(i) = pz(imed,1)*sig_triplet(iz1,i) DO 15871 iel=2,nne(imed) izi = zelem(imed,iel) + 0.1 sigp(i) = sigp(i) + pz(imed,iel)*sig_pair(izi,i) sigt(i) = sigt(i) + pz(imed,iel)*sig_triplet(izi,i)15871 CONTINUE15872 CONTINUE15861 CONTINUE15862 CONTINUE DO 15881 i=ifirst,ntrip f_triplet(i-ifirst+2) = sigt(i)/(sigp(i) + sigt(i))15881 CONTINUE15882 CONTINUE f_triplet(1) = 0 call set_spline(energies(ifirst-1),f_triplet,as,bs,cs,ds,ntrip-i * first+2) logE = log_4rm f_old = 0 DO 15891 i=1,250-1 logE = logE + dl_triplet f_new = spline(logE,energies(ifirst-1),as,bs,cs,ds,ntrip-ifirs * t+2) a_triplet(i,imed) = (f_new - f_old)*dli_triplet b_triplet(i,imed) = f_new - a_triplet(i,imed)*logE f_old = f_new15891 CONTINUE15892 CONTINUE write(i_log,*) 'OK'15851 CONTINUE15852 CONTINUE return15810 CONTINUE write(i_log,'(/a)') '***************** Error: ' write(i_log,'(a,a)') ' init_triplet: failed to open the data file *', triplet_data_file(:lnblnk1(triplet_data_file)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1)15820 CONTINUE write(i_log,'(/a)') '***************** Error: ' write(i_log,*) ' init_triplet: error while reading triplet data ' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) return end SUBROUTINE EDGSET(NREGLO,NREGHI)
![Page 400: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/400.jpg)
! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none COMMON/EDGE/binding_energies(6,100), interaction_prob(6,100), rela *xation_prob(39,100), edge_energies(16,100), edge_number(100), edge *_a(16,100), edge_b(16,100), edge_c(16,100), edge_d(16,100), IEDGFL *,IPHTER real*8 binding_energies, interaction_prob, relaxation_prob, e *dge_energies, edge_a,edge_b,edge_c,edge_d integer*2 IEDGFL, IPHTER integer*4 edge_number common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch integer NREGLO,NREGHI integer*4 i,j,k,jj,iz logical do_relax logical got_data save got_data data got_data/.false./ IF((got_data))return write(i_log,'(a/,a)') ' Output from subroutine EDGSET:', ' ======= *=======================' do_relax = .false. DO 15901 j=1, 2097154 IF (( IEDGFL .GT. 0 .AND. IEDGFL .LE. 100 )) THEN do_relax = .true. GO TO15902 END IF15901 CONTINUE15902 CONTINUE IF (( .NOT.do_relax )) THEN write(i_log,'(a/)') ' Atomic relaxations not requested! ' return END IF write(i_log,'(a/)') ' Atomic relaxations requested! ' write(i_log,'(/a$)') ' Reading photo-absorption data .....' got_data = .true. rewind(i_photo_relax) DO 15911 i=1,100 read(i_photo_relax,*) j,(binding_energies(k,i),k=1,6) DO 15921 k=1,6 binding_energies(k,i) = binding_energies(k,i)*1e-615921 CONTINUE15922 CONTINUE15911 CONTINUE15912 CONTINUE read(i_photo_relax,*) DO 15931 i=1,100
![Page 401: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/401.jpg)
read(i_photo_relax,*) j,(interaction_prob(k,i),k=1,5) interaction_prob(6,i)=1.0115931 CONTINUE15932 CONTINUE write(i_log,'(a)') ' Done' write(i_log,'(/a$)') ' Reading relaxation data .....' read(i_photo_relax,*) DO 15941 i=1,100 read(i_photo_relax,*) j,(relaxation_prob(k,i),k=1,19)15941 CONTINUE15942 CONTINUE read(i_photo_relax,*) DO 15951 i=1,100 read(i_photo_relax,*) j,(relaxation_prob(k,i),k=20,26)15951 CONTINUE15952 CONTINUE read(i_photo_relax,*) DO 15961 i=1,100 read(i_photo_relax,*) j,(relaxation_prob(k,i),k=27,32)15961 CONTINUE15962 CONTINUE read(i_photo_relax,*) DO 15971 i=1,100 read(i_photo_relax,*) j,(relaxation_prob(k,i),k=33,37)15971 CONTINUE15972 CONTINUE read(i_photo_relax,*) DO 15981 i=1,100 read(i_photo_relax,*) j,relaxation_prob(38,i)15981 CONTINUE15982 CONTINUE write(i_log,'(a)') ' Done' write(i_log,'(/a$)') ' Reading photo cross section data .....' rewind(i_photo_cs) DO 15991 i=1,100 read(i_photo_cs,*) j,edge_number(i) DO 16001 j=1,edge_number(i) read(i_photo_cs,*) edge_a(j,i),edge_b(j,i),edge_c(j,i), edge_d * (j,i),edge_energies(j,i)16001 CONTINUE16002 CONTINUE15991 CONTINUE15992 CONTINUE write(i_log,'(a/)') ' Done' RETURN END SUBROUTINE PHOTON(IRCODE) ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none integer*4 IRCODE COMMON/QDEBUG/QDEBUG LOGICAL QDEBUG COMMON/BOUNDS/ECUT,PCUT,VACDST real*8 ECUT, PCUT, VACDST COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), photon_xsect *ions, comp_xsections, apx,upx, eii_xfile,NMED
![Page 402: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/402.jpg)
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( 2097154),MED( 2097154),IRAYLR real*8 DUNIT, RHOR integer*4 KMPI, KMPO integer*2 MED, IRAYLR COMMON/EPCONT/EDEP,TSTEP,TUSTEP,USTEP,TVSTEP,VSTEP, RHOF,EOLD,ENEW *,EKE,ELKE,GLE,E_RANGE, x_final,y_final,z_final, u_final,v_final,w_ *final, IDISC,IROLD,IRNEW,IAUSFL(29) DOUBLE PRECISION EDEP real*8 TSTEP, TUSTEP, USTEP, VSTEP, TVSTEP, RHOF, EOLD, ENE *W, EKE, ELKE, GLE, E_RANGE, x_final,y_final,z_final, u_final, *v_final,w_final integer*4 IDISC, IROLD, IRNEW, IAUSFL COMMON/PHOTIN/ EBINDA(7), GE0(7),GE1(7), GMFP0(200,7),GMFP1(200,7) *,GBR10(200,7),GBR11(200,7),GBR20(200,7),GBR21(200,7), RCO0(7),RCO1 *(7), RSCT0(100,7),RSCT1(100,7), COHE0(200,7),COHE1(200,7), DPMFP, *MPGEM(1,7), NGR(7) real*8 EBINDA, GE0,GE1, GMFP0,GMFP1, GBR10,GBR11, GBR20,GBR21, * RCO0,RCO1, RSCT0,RSCT1, COHE0,COHE1, DPMFP integer*4 * MPGEM, * NGR COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000 *),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL COMMON/UPHIOT/THETA,SINTHE,COSTHE,SINPHI, COSPHI,PI,TWOPI,PI5D2 real*8 THETA, SINTHE, COSTHE, SINPHI, COSPHI, PI,TWOPI,PI5D2 COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD COMMON/USERPS/n_split integer*4 n_split COMMON/USERRR/ESAVE_GLOBAL,RANGE_ECUTRR(7),IREJECT real*8 ESAVE_GLOBAL,RANGE_ECUTRR integer*4 IREJECT common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 common/egs_vr/ e_max_rr, prob_RR, nbr_split, i_play_RR, i_ *survived_RR, * n_RR_warning, i_do_rr real*8 e_max_rr,prob_RR integer*4 nbr_split,i_play_RR,i_survived_RR,n_RR_warning integer*2 i_do_rr
![Page 403: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/403.jpg)
common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch common/score/IWATCH,mxnp, endep( 2097153), endep2( 2097153), temp2 *, planarefe, planarefp,planarfe,planarfp,nestep,endep_tmp( 2097153 *), endep_last( 2097153) integer IWATCH, mxnp real endep_tmp REAL*8 endep, endep2, temp2,planarefe, planarefp, planarfe, planar *fp integer*8 nestep integer*2 endep_last DOUBLE PRECISION PEIG real*8 EIG, RNNO35, GMFPR0, GMFP, COHFAC, RNNO37, XXX, X2, * Q2, CSQTHE, REJF, RNNORJ, RNNO36, GBR1, GBR2, T integer*4 IARG, IDR, IRL, LGLE, LXXX real*8 d_eta,eta_prime,dpmfp_old, x_save,y_save,z_save,u_save,v_sa *ve,w_save, e_save,wt_save,a_survive integer*4 ir_save,ip,i_split,latch_save,i_survive_s IRCODE=1 PEIG=E(NP) EIG=PEIG IRL=IR(NP) medium = med(irl) IF ((EIG .LE. PCUT)) THEN GO TO 16010 END IF16020 CONTINUE16021 CONTINUE IF ((WT(NP) .EQ. 0.0)) THEN go to 16030 END IF GLE=LOG(EIG) IF (( n_split .GT. 1 )) THEN16040 CONTINUE IF((rng_seed .GT. 128))call ranmar_get RNNO35 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 rnno35 = rnno35/n_split d_eta = 1./n_split x_save = x(np) y_save = y(np) z_save = z(np) u_save = u(np) v_save = v(np) w_save = w(np) e_save = e(np) wt_save = wt(np)/n_split ir_save = ir(np)
![Page 404: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/404.jpg)
latch_save = latch(np) np = np-1 IF((rng_seed .GT. 128))call ranmar_get xxx = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 a_survive = xxx*n_split i_survive_s = 1 + a_survive dpmfp_old = 0 eta_prime = 1 - rnno35 + d_eta IF ((IWATCH .NE.0 .AND. IWATCH.NE.4)) THEN WRITE(6,16050)n_split,wt_save16050 FORMAT(' Splitting photon into ',I4,' photons with weight ', *1PE10.3) END IF DO 16061 i_split=1,n_split eta_prime = eta_prime - d_eta IF((eta_prime .LE. 0))goto 16070 dpmfp = -log(eta_prime) - dpmfp_old dpmfp_old = dpmfp_old + dpmfp np = np+1 IF (( np .GT. 10000 )) THEN write(6,*) ' Stack overflow in $SELECT-PHOTON-MFP ' stop END IF x(np) = x_save y(np) = y_save z(np) = z_save u(np) = u_save v(np) = v_save w(np) = w_save wt(np) = wt_save e(np) = e_save iq(np) = 0 ir(np) = ir_save latch(np) = latch_save irl = ir(np) irold = irl medium = med(irl)16081 CONTINUE IF (( medium .NE. 0 )) THEN LGLE=GE1(MEDIUM)*GLE+GE0(MEDIUM) GMFPR0=GMFP1(LGLE,MEDIUM)*GLE+GMFP0(LGLE,MEDIUM) RHOF=RHOR(IRL)/RHO(MEDIUM) GMFP=GMFPR0/RHOF IF ((IRAYLR.EQ.1)) THEN COHFAC=COHE1(LGLE,MEDIUM)*GLE+COHE0(LGLE,MEDIUM) GMFP=GMFP*COHFAC END IF TSTEP=GMFP*DPMFP ELSE TSTEP=VACDST END IF irnew = irl idisc = 0 ustep = tstep tustep = ustep call howfar VSTEP=USTEP
![Page 405: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/405.jpg)
TVSTEP=VSTEP EDEP=PZERO IF((IWATCH.GT.0))CALL WATCH(0,IWATCH) x(np) = x(np) + u(np)*ustep y(np) = y(np) + v(np)*ustep z(np) = z(np) + w(np)*ustep IF (( idisc .GT. 0 )) THEN IF((IWATCH.GT.0))CALL WATCH(3,IWATCH) np = np-1 IF (( np .EQ. 0 )) THEN ircode = 2 return END IF goto 16070 END IF IF((medium .NE. 0))dpmfp = dpmfp - ustep/gmfp IF (( irnew .NE. irold )) THEN ir(np) = irnew irl = irnew irold = irnew medium = med(irl) END IF IF((IWATCH.GT.0))CALL WATCH(5,IWATCH) IF(((medium .NE. 0 .AND. dpmfp .LT. 1.E-5)))GO TO16082 GO TO 1608116082 CONTINUE x_save = x(np) y_save = y(np) z_save = z(np) ir_save = ir(np) IF ((IRAYLR.EQ.1)) THEN IF((rng_seed .GT. 128))call ranmar_get RNNO37 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF ((RNNO37.LE.(1.0-COHFAC))) THEN IF (( i_split .NE. i_survive_s )) THEN np = np-1 goto 16090 END IF IF((IWATCH.GT.0))CALL WATCH(23,IWATCH) IARG=23 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN wt(np) = wt(np)*n_split16100 CONTINUE16101 CONTINUE IF((rng_seed .GT. 128))call ranmar_get XXX = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 LXXX=RCO1(MEDIUM)*XXX+RCO0(MEDIUM) X2=RSCT1(LXXX,MEDIUM)*XXX+RSCT0(LXXX,MEDIUM) Q2=X2*RMSQ/(20.60744*20.60744) COSTHE=1.-Q2/(2.*E(NP)*E(NP)) IF((ABS(COSTHE).GT.1.0))GO TO 16100 CSQTHE=COSTHE*COSTHE REJF=(1.0+CSQTHE)/2.0
![Page 406: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/406.jpg)
IF((rng_seed .GT. 128))call ranmar_get RNNORJ = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF(((RNNORJ .LE. REJF)))GO TO16102 GO TO 1610116102 CONTINUE SINTHE=SQRT(1.0-CSQTHE) CALL UPHI(2,1) IF((IWATCH.GT.0))CALL WATCH(24,IWATCH) goto 16090 END IF END IF IF((rng_seed .GT. 128))call ranmar_get RNNO36 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 GBR1=GBR11(LGLE,MEDIUM)*GLE+GBR10(LGLE,MEDIUM) IF (((RNNO36.LE.GBR1).AND.(E(NP).GT.RMT2) )) THEN IF((IWATCH.GT.0))CALL WATCH(15,IWATCH) IARG=15 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN call pair IF((IWATCH.GT.0))CALL WATCH(16,IWATCH) ELSE GBR2=GBR21(LGLE,MEDIUM)*GLE+GBR20(LGLE,MEDIUM) IF ((RNNO36.LT.GBR2)) THEN IF((IWATCH.GT.0))CALL WATCH(17,IWATCH) IARG=17 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN call compt IF((IWATCH.GT.0))CALL WATCH(18,IWATCH) ELSE IF((IWATCH.GT.0))CALL WATCH(19,IWATCH) IARG=19 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN call photo IF((IWATCH.GT.0))CALL WATCH(20,IWATCH) END IF END IF ip = NPold16111 CONTINUE IF (( iq(ip) .EQ. 0 )) THEN IF (( i_split .NE. i_survive_s )) THEN IF (( ip .LT. np )) THEN IF ((IWATCH.NE.0 .AND. IWATCH.NE.4)) THEN WRITE(6,16120)ip,e(ip),iq(ip),ir(ip),x(ip),y(ip), * z(ip),u(ip),v(ip),w(ip),latch(ip),wt(ip)16120 FORMAT(' Eliminating scattered photon',T36,':', I5 *,F9.3,2I4,3F8.3,3F7.3,I10,1PE10.3) END IF
![Page 407: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/407.jpg)
e(ip) = e(np) iq(ip) = iq(np) u(ip) = u(np) v(ip) = v(np) w(ip) = w(np) wt(ip) = wt(np) latch(ip) = latch(np) END IF np = np-1 ELSE wt(ip) = wt(ip)*n_split ip = ip+1 END IF ELSE ip = ip+1 END IF IF(((ip .GT. np)))GO TO16112 GO TO 1611116112 CONTINUE16090 CONTINUE16061 CONTINUE16062 CONTINUE16070 CONTINUE IF (( np .LE. 0 )) THEN ircode = 2 return END IF IF (( iq(np) .EQ. 0 )) THEN peig = e(np) eig = peig irl = ir(np) medium = med(irl) IF ((EIG.LE.PCUT)) THEN GO TO 16010 END IF gle = log(eig) goto 16040 END IF return ELSE IF((rng_seed .GT. 128))call ranmar_get RNNO35 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF ((RNNO35 .EQ. 0.0)) THEN RNNO35=1.E-30 END IF DPMFP=-LOG(RNNO35) END IF IROLD=IR(NP)16130 CONTINUE16131 CONTINUE IF ((MEDIUM.NE.0)) THEN LGLE=GE1(MEDIUM)*GLE+GE0(MEDIUM) GMFPR0=GMFP1(LGLE,MEDIUM)*GLE+GMFP0(LGLE,MEDIUM) END IF16140 CONTINUE16141 CONTINUE IF ((MEDIUM.EQ.0)) THEN
![Page 408: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/408.jpg)
TSTEP=VACDST ELSE RHOF=RHOR(IRL)/RHO(MEDIUM) GMFP=GMFPR0/RHOF IF ((IRAYLR.EQ.1)) THEN COHFAC=COHE1(LGLE,MEDIUM)*GLE+COHE0(LGLE,MEDIUM) GMFP=GMFP*COHFAC END IF TSTEP=GMFP*DPMFP END IF IRNEW=IR(NP) IDISC=0 USTEP=TSTEP TUSTEP=USTEP IF (( ustep .GT. dnear(np) .OR. wt(np) .LE. 0 )) THEN call howfar END IF IF ((IDISC.GT.0)) THEN GO TO 16030 END IF VSTEP=USTEP TVSTEP=VSTEP EDEP=PZERO x_final = x(np) + u(np)*vstep y_final = y(np) + v(np)*vstep z_final = z(np) + w(np)*vstep IARG=0 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN x(np) = x_final y(np) = y_final z(np) = z_final DNEAR(NP)=DNEAR(NP)-USTEP IF ((MEDIUM.NE.0)) THEN DPMFP=MAX(0.,DPMFP-USTEP/GMFP) END IF IROLD=IR(NP) MEDOLD=MEDIUM IF ((IRNEW.NE.IROLD)) THEN ir(np) = irnew irl = irnew medium = med(irl) END IF IARG=5 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN IF ((EIG.LE.PCUT)) THEN GO TO 16010 END IF IF((IDISC.LT.0))GO TO 16030 IF((MEDIUM.NE.MEDOLD))GO TO 16142 IF ((MEDIUM.NE.0.AND.DPMFP.LE.1.E-5)) THEN GO TO 16132 END IF
![Page 409: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/409.jpg)
GO TO 1614116142 CONTINUE GO TO 1613116132 CONTINUE IF ((IRAYLR.EQ.1)) THEN IF((rng_seed .GT. 128))call ranmar_get RNNO37 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF ((RNNO37.LE.(1.0-COHFAC))) THEN IARG=23 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN NPold = NP call egs_rayleigh_sampling(MEDIUM,E(NP),GLE,LGLE,COSTHE,SINT * HE) CALL UPHI(2,1) IARG=24 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN GOTO 16020 END IF END IF IF((rng_seed .GT. 128))call ranmar_get RNNO36 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 GBR1=GBR11(LGLE,MEDIUM)*GLE+GBR10(LGLE,MEDIUM) IF (((RNNO36.LE.GBR1).AND.(E(NP).GT.RMT2) )) THEN IARG=15 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN CALL PAIR IARG=16 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN IF (( iq(np) .NE. 0 )) THEN GO TO 16022 ELSE goto 16150 END IF END IF GBR2=GBR21(LGLE,MEDIUM)*GLE+GBR20(LGLE,MEDIUM) IF ((RNNO36.LT.GBR2)) THEN IARG=17 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN CALL COMPT IARG=18 IF ((IAUSFL(IARG+1).NE.0)) THEN
![Page 410: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/410.jpg)
CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN IF((IQ(NP).NE.0))GO TO 16022 ELSE IARG=19 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN CALL PHOTO IF ((NP .EQ. 0 .OR. NP .LT. NPOLD )) THEN RETURN END IF IARG=20 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN IF((IQ(NP) .NE. 0))GO TO 16022 END IF16150 PEIG=E(NP) EIG=PEIG IF((EIG.LT.PCUT))GO TO 16010 GO TO 1602116022 CONTINUE RETURN16010 IF (( medium .GT. 0 )) THEN IF ((EIG.GT.AP(MEDIUM))) THEN IDR=1 ELSE IDR=2 END IF ELSE IDR=1 END IF EDEP=PEIG IARG=IDR IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN IRCODE=2 NP=NP-1 RETURN16030 EDEP=PEIG IARG=3 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN IRCODE=2 NP=NP-1 RETURN END SUBROUTINE SHOWER(IQI,EI,XI,YI,ZI,UI,VI,WI,IRI,WTI) ! Copyright National Research Council of Canada, 2000. ! All rights reserved.
![Page 411: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/411.jpg)
implicit none COMMON/QDEBUG/QDEBUG LOGICAL QDEBUG COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000 *),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold COMMON/UPHIOT/THETA,SINTHE,COSTHE,SINPHI, COSPHI,PI,TWOPI,PI5D2 real*8 THETA, SINTHE, COSTHE, SINPHI, COSPHI, PI,TWOPI,PI5D2 common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch real*8 EI, XI,YI,ZI, UI,VI,WI, WTI integer*4 IQI, IRI DOUBLE PRECISION DEG, DPGL, DEI, DPI, DCSTH, DCOSTH, PI0MSQ real*8 DNEARI, CSTH integer*4 IRCODE DATA PI0MSQ/1.8215416D4/ NP=1 NPold = NP DNEARI=0.0 IQ(1)=IQI E(1)=EI U(1)=UI V(1)=VI W(1)=WI X(1)=XI Y(1)=YI Z(1)=ZI IR(1)=IRI WT(1)=WTI DNEAR(1)=DNEARI LATCH(1)=LATCHI IF ((IQI .EQ. 2)) THEN IF ((EI**2 .LE. PI0MSQ)) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(//a/,a,g15.5,a)') ' Stopped in subroutine SHOWER *---PI-ZERO option invoked', ' but the total energy was too small ( *EI=',EI,' MeV)' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF
![Page 412: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/412.jpg)
IF((rng_seed .GT. 128))call ranmar_get CSTH = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 DCSTH=CSTH DEI=EI DPI=DSQRT(DEI*DEI-PI0MSQ) DEG=DEI+DPI*DCSTH DPGL=DPI+DEI*DCSTH DCOSTH=DPGL/DEG COSTHE=DCOSTH SINTHE=DSQRT(1.D0-DCOSTH*DCOSTH) IQ(1)=0 E(1)=DEG/2. CALL UPHI(2,1) NP=2 DEG=DEI-DPI*DCSTH DPGL=DPI-DEI*DCSTH DCOSTH=DPGL/DEG COSTHE=DCOSTH SINTHE=-DSQRT(1.D0-DCOSTH*DCOSTH) IQ(2)=0 E(2)=DEG/2. CALL UPHI(3,2) END IF16161 CONTINUE IF((np .LE. 0))GO TO16162 IF (( iq(np) .EQ. 0 )) THEN call photon(ircode) ELSE call electr(ircode) END IF GO TO 1616116162 CONTINUE RETURN END SUBROUTINE UPHI(IENTRY,LVL) ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none COMMON/QDEBUG/QDEBUG LOGICAL QDEBUG COMMON/EPCONT/EDEP,TSTEP,TUSTEP,USTEP,TVSTEP,VSTEP, RHOF,EOLD,ENEW *,EKE,ELKE,GLE,E_RANGE, x_final,y_final,z_final, u_final,v_final,w_ *final, IDISC,IROLD,IRNEW,IAUSFL(29) DOUBLE PRECISION EDEP real*8 TSTEP, TUSTEP, USTEP, VSTEP, TVSTEP, RHOF, EOLD, ENE *W, EKE, ELKE, GLE, E_RANGE, x_final,y_final,z_final, u_final, *v_final,w_final integer*4 IDISC, IROLD, IRNEW, IAUSFL COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000 *),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold COMMON/UPHIIN/SINC0,SINC1,SIN0(1002),SIN1(1002) real*8 SINC0,SINC1,SIN0,SIN1 COMMON/UPHIOT/THETA,SINTHE,COSTHE,SINPHI, COSPHI,PI,TWOPI,PI5D2
![Page 413: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/413.jpg)
real*8 THETA, SINTHE, COSTHE, SINPHI, COSPHI, PI,TWOPI,PI5D2 common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch integer IENTRY,LVL real*8 CTHET, RNNO38, PHI, CPHI, A,B,C, SINPS2, SINPSI, US, *VS, SINDEL,COSDEL integer*4 IARG, LPHI,LTHETA,LCTHET,LCPHI real*8 xphi,xphi2,yphi,yphi2,rhophi2 save CTHET,PHI,CPHI,A,B,C,SINPS2,SINPSI,US,VS,SINDEL,COSDEL IARG=21 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN GO TO (16170,16180,16190),IENTRY GO TO 1620016170 CONTINUE SINTHE=sin(THETA) CTHET=PI5D2-THETA COSTHE=sin(CTHET)16180 CONTINUE16211 CONTINUE IF((rng_seed .GT. 128))call ranmar_get xphi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 xphi = 2*xphi - 1 xphi2 = xphi*xphi IF((rng_seed .GT. 128))call ranmar_get yphi = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 yphi2 = yphi*yphi rhophi2 = xphi2 + yphi2 IF(rhophi2.LE.1)GO TO16212 GO TO 1621116212 CONTINUE rhophi2 = 1/rhophi2 cosphi = (xphi2 - yphi2)*rhophi2 sinphi = 2*xphi*yphi*rhophi216190 GO TO (16220,16230,16240),LVL GO TO 1620016220 A=U(NP) B=V(NP) C=W(NP)
![Page 414: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/414.jpg)
GO TO 1625016240 A=U(NP-1) B=V(NP-1) C=W(NP-1)16230 X(NP)=X(NP-1) Y(NP)=Y(NP-1) Z(NP)=Z(NP-1) IR(NP)=IR(NP-1) WT(NP)=WT(NP-1) DNEAR(NP)=DNEAR(NP-1) LATCH(NP)=LATCH(NP-1)16250 SINPS2=A*A+B*B IF ((SINPS2.LT.1.0E-20)) THEN U(NP)=SINTHE*COSPHI V(NP)=SINTHE*SINPHI W(NP)=C*COSTHE ELSE SINPSI=SQRT(SINPS2) US=SINTHE*COSPHI VS=SINTHE*SINPHI SINDEL=B/SINPSI COSDEL=A/SINPSI U(NP)=C*COSDEL*US-SINDEL*VS+A*COSTHE V(NP)=C*SINDEL*US+COSDEL*VS+B*COSTHE W(NP)=-SINPSI*US+C*COSTHE END IF IARG=22 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN RETURN16200 write(i_log,'(/a)') '***************** Error: ' write(i_log,'(a,2i6)') ' STOPPED IN UPHI WITH IENTRY,LVL=',IENTRY, *LVL write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END subroutine init_nist_brems ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none real*8 energy_array(57),x_array(54), cs_array(57,54,100) real*8 xi_array(54) real*8 x_gauss(64),w_gauss(64) integer*4 nmix,kmix,i,n,k,j,ii integer*4 ngauss,i_gauss integer*4 lnblnk1,egs_get_unit integer*4 ifirst,ilast,nener,neke,leil real*8 cs(57,54),ee(57),ele(57) real*8 csx(54),afx(54),bfx(54),cfx(54),dfx(54) real*8 cse(57),afe(57),bfe(57),cfe(57),dfe(57) real*8 Z,sumA real*8 emin,xi,res,spline,eil,ei,beta2,aux,sigb,sigt,ebr1,ebr2 real*8 sigee,sigep,sige,si_esig,si1_esig,si_ebr1,si1_ebr1,ededx, s *ig_bhabha,si_psig,si1_psig,si_pbr1,si1_pbr1,si_pbr2,si1_pbr2 integer*4 iz real*8 ple,qle,x,f,error,max_error,x_max_error,f_max_error
![Page 415: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/415.jpg)
integer*4 ndat,k_max_error character tmp_string*512, tmp1_string*512 integer itmp real*8 amu parameter (amu = 1660.5655) logical ex,is_opened COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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/BREMPR/ DL1(8,7),DL2(8,7),DL3(8,7),DL4(8,7),DL5(8,7),DL6(8, *7), ALPHI(2,7),BPAR(2,7),DELPOS(2,7), WA(7,50),PZ(7,50),ZELEM(7,50 *),RHOZ(7,50), PWR2I(50), DELCM(7),ZBRANG(7),LZBRANG(7),NNE(7), IBR *DST,IPRDST,ibr_nist,pair_nrc,itriplet, ASYM(7,50,2) CHARACTER*4 ASYM real*8 DL1,DL2,DL3,DL4,DL5,DL6, ALPHI, BPAR, DELPOS, WA, PZ, * ZELEM, RHOZ, PWR2I, DELCM, ZBRANG, LZBRANG integer*4 NNE, IBRDST, IPRDST, ibr_nist, itriplet, pair_nrc COMMON/ELECIN/ esig_e(7),psig_e(7), esige_max, psige_max, range_ep *(0:1,150,7), E_array(150,7), etae_ms0(150,7),etae_ms1(150,7),etap_ *ms0(150,7),etap_ms1(150,7),q1ce_ms0(150,7),q1ce_ms1(150,7),q1cp_ms *0(150,7),q1cp_ms1(150,7),q2ce_ms0(150,7),q2ce_ms1(150,7),q2cp_ms0( *150,7),q2cp_ms1(150,7),blcce0(150,7),blcce1(150,7), EKE0(7),EKE1(7 *), XR0(7),TEFF0(7),BLCC(7),XCC(7), ESIG0(150,7),ESIG1(150,7),PSIG0 *(150,7),PSIG1(150,7),EDEDX0(150,7),EDEDX1(150,7),PDEDX0(150,7),PDE *DX1(150,7),EBR10(150,7),EBR11(150,7),PBR10(150,7),PBR11(150,7),PBR *20(150,7),PBR21(150,7),TMXS0(150,7),TMXS1(150,7), expeke1(7), IUNR *ST(7),EPSTFL(7),IAPRIM(7), sig_ismonotone(0:1,7) real*8 esig_e, psig_e, esige_max, psige_max, range_ep, E_ar *ray, etae_ms0,etae_ms1, etap_ms0,etap_ms1, q1ce_ms0,q1ce_ms1, *q1cp_ms0,q1cp_ms1, q2ce_ms0,q2ce_ms1, q2cp_ms0,q2cp_ms1, blcce0 *,blcce1, expeke1, EKE0,EKE1, XR0, TEFF0, BLCC, XCC, ESIG0,E *SIG1, PSIG0,PSIG1, EDEDX0,EDEDX1, PDEDX0,PDEDX1, EBR10,EBR11, * PBR10,PBR11, PBR20,PBR21, TMXS0,TMXS1 integer*4 IUNRST, EPSTFL, IAPRIM logical sig_ismonotone COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD common/nist_brems/ nb_fdata(0:50,100,7), nb_xdata(0:50,100,7), nb_ *wdata(50,100,7), nb_idata(50,100,7), nb_emin(7),nb_emax(7), nb_lem *in(7),nb_lemax(7), nb_dle(7),nb_dlei(7), log_ap(7) real*8 nb_fdata,nb_xdata,nb_wdata,nb_emin,nb_emax,nb_lemin,nb_lema *x, nb_dle,nb_dlei,log_ap integer*4 nb_idata common/spin_data/ spin_rej(7,0:1,0: 31,0:15,0:31), espin_min,espin *_max,espml,b2spin_min,b2spin_max, dbeta2,dbeta2i,dlener,dleneri,dq *q1,dqq1i, fool_intel_optimizer real*4 spin_rej,espin_min,espin_max,espml,b2spin_min,b2spin_max, d
![Page 416: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/416.jpg)
*beta2,dbeta2i,dlener,dleneri,dqq1,dqq1i logical fool_intel_optimizer common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch DO 16261 i=1,len(tmp_string) tmp_string(i:i) = ' '16261 CONTINUE16262 CONTINUE tmp_string = hen_house(:lnblnk1(hen_house)) // 'data' // '/' IF (( ibr_nist .EQ. 1 )) THEN DO 16271 i=1,len(tmp1_string) tmp1_string(i:i) = ' '16271 CONTINUE16272 CONTINUE tmp1_string = tmp_string(:lnblnk1(tmp_string)) // 'nist_brems.da *ta' inquire(file=tmp1_string,exist=ex,opened=is_opened,number=itmp) IF (( .NOT.ex )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'EGSnrc data file ','nist_brems.data',' does no *t exist' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF IF (( .NOT.is_opened )) THEN i_nist_data=egs_get_unit(i_nist_data) IF ((i_nist_data.LT.0)) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'failed to get a free Fortran I/O unit for da *ta file ', tmp1_string(:lnblnk1(tmp1_string)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF open(i_nist_data,file=tmp1_string,status='old',err=12510) ELSE i_nist_data = itmp END IF ELSE IF((ibr_nist .EQ. 2)) THEN DO 16281 i=1,len(tmp1_string) tmp1_string(i:i) = ' '16281 CONTINUE16282 CONTINUE tmp1_string = tmp_string(:lnblnk1(tmp_string)) // 'nrc_brems.dat *a' inquire(file=tmp1_string,exist=ex,opened=is_opened,number=itmp) IF (( .NOT.ex )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'EGSnrc data file ','nrc_brems.data',' does not
![Page 417: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/417.jpg)
* exist' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF IF (( .NOT.is_opened )) THEN i_nist_data=egs_get_unit(i_nist_data) IF ((i_nist_data.LT.0)) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'failed to get a free Fortran I/O unit for da *ta file ', tmp1_string(:lnblnk1(tmp1_string)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF open(i_nist_data,file=tmp1_string,status='old',err=12510) ELSE i_nist_data = itmp END IF ELSE write(i_log,'(/a)') '***************** Error: ' write(i_log,*) ' init_nist_brems: unknown value of ibr_nist! * ibr_nist = ', ibr_nist write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF rewind(i_nist_data) read(i_nist_data,*) read(i_nist_data,*) nmix,kmix IF ((kmix .GT. 54)) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) ' init_nist_brems: to many k values in data file! *' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF IF ((nmix .GT. 57)) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) ' init_nist_brems: to many T values in data file! *' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF read(i_nist_data,*) (energy_array(n),n=1,nmix) DO 16291 n=1,nmix energy_array(n) = 1.0*energy_array(n)16291 CONTINUE16292 CONTINUE read(i_nist_data,*) (x_array(k),k=1,kmix) read(i_nist_data,*) DO 16301 i=1,100 read(i_nist_data,*) ((cs_array(n,k,i),n=1,nmix),k=1,kmix)16301 CONTINUE16302 CONTINUE close(i_nist_data) DO 16311 k=1,kmix xi_array(k)=Log(1-x_array(k)+1e-6) IF (( fool_intel_optimizer )) THEN write(i_log,*) 'xi_array(k): ',xi_array(k) END IF
![Page 418: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/418.jpg)
16311 CONTINUE16312 CONTINUE ngauss = 64 call gauss_legendre(0d0,1d0,x_gauss,w_gauss,ngauss) write(i_log,*) ' ' IF ((ibr_nist .EQ. 1)) THEN write(i_log,*) ' Using NIST brems cross sections! ' ELSE IF((ibr_nist .EQ. 2)) THEN write(i_log,*) ' Using NRC brems cross sections! ' END IF write(i_log,*) ' ' DO 16321 medium=1,nmed log_ap(medium) = log(ap(medium)) write(i_log,*) ' Initializing brems data for medium ',medium,'.. *.' emin = max(ae(medium) - rm, ap(medium)) DO 16331 i=1,nmix IF((energy_array(i) .GE. emin))GO TO1633216331 CONTINUE16332 CONTINUE ifirst = i DO 16341 i=nmix,1,-1 IF((energy_array(i) .LT. ue(medium) - rm))GO TO1634216341 CONTINUE16342 CONTINUE ilast = i+1 IF (( ifirst .LT. 1 .OR. ilast .GT. nmix )) THEN write(i_log,*) ' init_nist_brems: data available only for ' write(i_log,*) energy_array(1),' <= E <= ',energy_array(nmix) write(i_log,*) ' will use spline interpolations to get cross ' write(i_log,*) ' sections beyond the available data but this m *ay' write(i_log,*) ' produce nonsense!' IF((ifirst .LT. 1))ifirst=1 IF((ilast .GT. nmix))ilast = nmix END IF DO 16351 i=ifirst,ilast ii = i+1 - ifirst ee(ii) = energy_array(i) ele(ii) = log(ee(ii)) sumA = 0 DO 16361 j=1,NNE(medium) sumA = sumA + pz(medium,j)*wa(medium,j)16361 CONTINUE16362 CONTINUE sumA = sumA*amu DO 16371 k=1,kmix cs(ii,k) = 0 DO 16381 j=1,NNE(medium) Z = zelem(medium,j) iz = int(Z+0.1) Z = Z*Z/sumA cs(ii,k) = cs(ii,k) + pz(medium,j)*Z*cs_array(i,k,iz)16381 CONTINUE16382 CONTINUE csx(k) = Log(cs(ii,k))16371 CONTINUE16372 CONTINUE
![Page 419: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/419.jpg)
call set_spline(xi_array,csx,afx,bfx,cfx,dfx,kmix) cse(ii) = 0 aux = Log(ee(ii)/ap(medium)) DO 16391 i_gauss=1,ngauss xi = log(1 - ap(medium)/ee(ii)*exp(x_gauss(i_gauss)*aux)+1e- * 6) res = spline(xi,xi_array,afx,bfx,cfx,dfx,kmix) cse(ii) = cse(ii) + w_gauss(i_gauss)*exp(res)16391 CONTINUE16392 CONTINUE16351 CONTINUE16352 CONTINUE nener = ilast - ifirst + 1 call set_spline(ele,cse,afe,bfe,cfe,dfe,nener) neke = meke(medium) sigee = 1E-15 sigep = 1E-15 DO 16401 i=1,neke eil = (float(i) - eke0(medium))/eke1(medium) ei = exp(eil) leil = i beta2 = ei*(ei+2*rm)/(ei+rm)**2 IF (( ei .LE. ap(medium) )) THEN sigb = 1e-30 ELSE sigb = spline(eil,ele,afe,bfe,cfe,dfe,nener) sigb = sigb*log(ei/ap(medium))/beta2*rho(medium) END IF sigt=esig1(Leil,MEDIUM)*eil+esig0(Leil,MEDIUM) ebr1=ebr11(Leil,MEDIUM)*eil+ebr10(Leil,MEDIUM) IF((sigt .LT. 0))sigt = 0 IF((ebr1 .GT. 1))ebr1 = 1 IF((ebr1 .LT. 0))ebr1 = 0 IF (( i .GT. 1 )) THEN si_esig = si1_esig si_ebr1 = si1_ebr1 si1_esig = sigt*(1 - ebr1) + sigb si1_ebr1 = sigb/si1_esig esig1(i-1,medium) = (si1_esig - si_esig)*eke1(medium) esig0(i-1,medium) = si1_esig - esig1(i-1,medium)*eil ebr11(i-1,medium) = (si1_ebr1 - si_ebr1)*eke1(medium) ebr10(i-1,medium) = si1_ebr1 - ebr11(i-1,medium)*eil ELSE si1_esig = sigt*(1 - ebr1) + sigb si1_ebr1 = sigb/si1_esig END IF sigt=psig1(Leil,MEDIUM)*eil+psig0(Leil,MEDIUM) ebr1=pbr11(Leil,MEDIUM)*eil+pbr10(Leil,MEDIUM) ebr2=pbr21(Leil,MEDIUM)*eil+pbr20(Leil,MEDIUM) IF((sigt .LT. 0))sigt = 0 IF((ebr1 .GT. 1))ebr1 = 1 IF((ebr1 .LT. 0))ebr1 = 0 IF((ebr2 .GT. 1))ebr2 = 1 IF((ebr2 .LT. 0))ebr2 = 0 sig_bhabha = sigt*(ebr2 - ebr1) IF((sig_bhabha .LT. 0))sig_bhabha = 0 IF (( i .GT. 1 )) THEN si_psig = si1_psig
![Page 420: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/420.jpg)
si_pbr1 = si1_pbr1 si_pbr2 = si1_pbr2 si1_psig = sigt*(1 - ebr1) + sigb si1_pbr1 = sigb/si1_psig si1_pbr2 = (sigb + sig_bhabha)/si1_psig psig1(i-1,medium) = (si1_psig - si_psig)*eke1(medium) psig0(i-1,medium) = si1_psig - psig1(i-1,medium)*eil pbr11(i-1,medium) = (si1_pbr1 - si_pbr1)*eke1(medium) pbr10(i-1,medium) = si1_pbr1 - pbr11(i-1,medium)*eil pbr21(i-1,medium) = (si1_pbr2 - si_pbr2)*eke1(medium) pbr20(i-1,medium) = si1_pbr2 - pbr21(i-1,medium)*eil ELSE si1_psig = sigt*(1 - ebr1) + sigb si1_pbr1 = sigb/si1_psig si1_pbr2 = (sigb + sig_bhabha)/si1_psig END IF ededx=ededx1(Leil,MEDIUM)*eil+ededx0(Leil,MEDIUM) sige = si1_esig/ededx IF((sige .GT. sigee))sigee = sige ededx=pdedx1(Leil,MEDIUM)*eil+pdedx0(Leil,MEDIUM) sige = si1_psig/ededx IF((sige .GT. sigep))sigep = sige16401 CONTINUE16402 CONTINUE esig1(neke,medium) = esig1(neke-1,medium) esig0(neke,medium) = esig0(neke-1,medium) ebr11(neke,medium) = ebr11(neke-1,medium) ebr10(neke,medium) = ebr10(neke-1,medium) psig1(neke,medium) = psig1(neke-1,medium) psig0(neke,medium) = psig0(neke-1,medium) pbr11(neke,medium) = pbr11(neke-1,medium) pbr10(neke,medium) = pbr10(neke-1,medium) pbr21(neke,medium) = pbr21(neke-1,medium) pbr20(neke,medium) = pbr20(neke-1,medium) write(i_log,*) ' Max. new cross sections per energy loss: ',sige * e,sigep esig_e(medium) = sigee psig_e(medium) = sigep IF((sigee .GT. esige_max))esige_max = sigee IF((sigep .GT. psige_max))psige_max = sigep nb_emin(medium) = energy_array(ifirst) IF (( nb_emin(medium) .LE. ap(medium) )) THEN nb_emin(medium) = energy_array(ifirst+1) END IF nb_emax(medium) = energy_array(ilast) nb_lemin(medium) = log(nb_emin(medium)) nb_lemax(medium) = log(nb_emax(medium)) nb_dle(medium) = (nb_lemax(medium) - nb_lemin(medium))/(100-1) nb_dlei(medium) = 1/nb_dle(medium) eil = nb_lemin(medium) - nb_dle(medium) DO 16411 i=1,100 eil = eil + nb_dle(medium) ei = exp(eil) DO 16421 ii=1,nener IF((ei .LT. ee(ii)))GO TO1642216421 CONTINUE16422 CONTINUE ii = ii-1
![Page 421: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/421.jpg)
IF((ii .LT. 1))ii = 1 IF((ii .GT. nener-1))ii = nener-1 ple = (eil - ele(ii))/(ele(ii+1)-ele(ii)) qle = 1 - ple DO 16431 k=1,kmix csx(k) = log(qle*cs(ii,k) + ple*cs(ii+1,k))16431 CONTINUE16432 CONTINUE call set_spline(xi_array,csx,afx,bfx,cfx,dfx,kmix) x = ap(medium)/ei aux = -log(x) xi = log(1 - x+1e-6) res = spline(xi,xi_array,afx,bfx,cfx,dfx,kmix) nb_xdata(0,i,medium) = 0 nb_fdata(0,i,medium) = exp(res) DO 16441 k=1,kmix IF((x_array(k) .GT. x))GO TO1644216441 CONTINUE16442 CONTINUE IF((k .GT. kmix))k = kmix ndat = 0 DO 16451 j=k+1,kmix-1 ndat = ndat+1 nb_xdata(ndat,i,medium) = log(x_array(j)/x)/aux nb_fdata(ndat,i,medium) = exp(csx(j)) IF (( fool_intel_optimizer )) THEN write(i_log,*) 'nb_xdata(ndat,i,medium): ', nb_xdata(ndat, * i,medium) END IF16451 CONTINUE16452 CONTINUE ndat = ndat+1 nb_xdata(ndat,i,medium) = 1 nb_fdata(ndat,i,medium) = exp(csx(kmix)) IF((ndat .GE. 50))goto 1646016471 CONTINUE x_max_error = 0 f_max_error = 0 k_max_error = 0 max_error = 0 DO 16481 k=0,ndat-1 x = 0.5*(nb_xdata(k,i,medium) + nb_xdata(k+1,i,medium)) f = 0.5*(nb_fdata(k,i,medium) + nb_fdata(k+1,i,medium)) xi = log(1 - ap(medium)/ei*exp(x*aux)+1e-6) res = spline(xi,xi_array,afx,bfx,cfx,dfx,kmix) res = exp(res) error = abs(1-f/res) IF (( error .GT. max_error )) THEN x_max_error = x f_max_error = res max_error = error k_max_error = k END IF16481 CONTINUE16482 CONTINUE ndat = ndat+1 DO 16491 k=ndat,k_max_error+2,-1 nb_xdata(k,i,medium) = nb_xdata(k-1,i,medium)
![Page 422: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/422.jpg)
nb_fdata(k,i,medium) = nb_fdata(k-1,i,medium)16491 CONTINUE16492 CONTINUE nb_xdata(k_max_error+1,i,medium) = x_max_error nb_fdata(k_max_error+1,i,medium) = f_max_error IF(((ndat .EQ. 50)))GO TO16472 GO TO 1647116472 CONTINUE16460 call prepare_alias_table(50,nb_xdata(0,i,medium), nb_fdata(0,i * ,medium),nb_wdata(1,i,medium),nb_idata(1,i,medium))16411 CONTINUE16412 CONTINUE16321 CONTINUE16322 CONTINUE write(i_log,*) ' ' write(i_log,*) ' ' return12510 write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'failed to open EGSnrc data file ',tmp1_string(:lnb *lnk1(tmp1_string)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1) return end subroutine init_nrc_pair implicit none COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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/BREMPR/ DL1(8,7),DL2(8,7),DL3(8,7),DL4(8,7),DL5(8,7),DL6(8, *7), ALPHI(2,7),BPAR(2,7),DELPOS(2,7), WA(7,50),PZ(7,50),ZELEM(7,50 *),RHOZ(7,50), PWR2I(50), DELCM(7),ZBRANG(7),LZBRANG(7),NNE(7), IBR *DST,IPRDST,ibr_nist,pair_nrc,itriplet, ASYM(7,50,2) CHARACTER*4 ASYM real*8 DL1,DL2,DL3,DL4,DL5,DL6, ALPHI, BPAR, DELPOS, WA, PZ, * ZELEM, RHOZ, PWR2I, DELCM, ZBRANG, LZBRANG integer*4 NNE, IBRDST, IPRDST, ibr_nist, itriplet, pair_nrc COMMON/ELECIN/ esig_e(7),psig_e(7), esige_max, psige_max, range_ep *(0:1,150,7), E_array(150,7), etae_ms0(150,7),etae_ms1(150,7),etap_ *ms0(150,7),etap_ms1(150,7),q1ce_ms0(150,7),q1ce_ms1(150,7),q1cp_ms *0(150,7),q1cp_ms1(150,7),q2ce_ms0(150,7),q2ce_ms1(150,7),q2cp_ms0( *150,7),q2cp_ms1(150,7),blcce0(150,7),blcce1(150,7), EKE0(7),EKE1(7 *), XR0(7),TEFF0(7),BLCC(7),XCC(7), ESIG0(150,7),ESIG1(150,7),PSIG0 *(150,7),PSIG1(150,7),EDEDX0(150,7),EDEDX1(150,7),PDEDX0(150,7),PDE *DX1(150,7),EBR10(150,7),EBR11(150,7),PBR10(150,7),PBR11(150,7),PBR *20(150,7),PBR21(150,7),TMXS0(150,7),TMXS1(150,7), expeke1(7), IUNR *ST(7),EPSTFL(7),IAPRIM(7), sig_ismonotone(0:1,7) real*8 esig_e, psig_e, esige_max, psige_max, range_ep, E_ar *ray, etae_ms0,etae_ms1, etap_ms0,etap_ms1, q1ce_ms0,q1ce_ms1, *q1cp_ms0,q1cp_ms1, q2ce_ms0,q2ce_ms1, q2cp_ms0,q2cp_ms1, blcce0 *,blcce1, expeke1, EKE0,EKE1, XR0, TEFF0, BLCC, XCC, ESIG0,E
![Page 423: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/423.jpg)
*SIG1, PSIG0,PSIG1, EDEDX0,EDEDX1, PDEDX0,PDEDX1, EBR10,EBR11, * PBR10,PBR11, PBR20,PBR21, TMXS0,TMXS1 integer*4 IUNRST, EPSTFL, IAPRIM logical sig_ismonotone common/nrc_pair/ nrcp_fdata(65,84,7), nrcp_wdata(65,84,7), nrcp_id *ata(65,84,7), nrcp_xdata(65), nrcp_emin, nrcp_emax, nrcp_dle, nrcp *_dlei real*8 nrcp_fdata,nrcp_wdata,nrcp_xdata, nrcp_emin, nrcp_emax, nrc *p_dle, nrcp_dlei integer*4 nrcp_idata COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch character nrcp_file*256, endianess*4 integer egs_get_unit integer*4 nrcp_unit, want_nrcp_unit, rec_length integer*4 i, lnblnk1 real*8 tmp, ddx, xx, Z real*4 emin, emax integer*4 ne, nb, ix, ie, irec, i_ele, nbb, iz character endian, cdum( 243) logical swap real*4 tmp_4, tarray(65) integer*4 itmp_4 character c_4(4), ic_4(4) equivalence (tmp_4,c_4), (itmp_4, ic_4) DO 16501 i=1,len(nrcp_file) nrcp_file(i:i) = ' '16501 CONTINUE16502 CONTINUE nrcp_file = hen_house(:lnblnk1(hen_house)) // 'data' // '/' // 'pa *ir_nrc1.data' want_nrcp_unit = 62 nrcp_unit = egs_get_unit(want_nrcp_unit) IF (( nrcp_unit .LT. 1 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'init_nrc_pair: failed to get a free fortran unit *' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF rec_length = 65*4 open(nrcp_unit,file=nrcp_file,form='unformatted',access='direct',
![Page 424: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/424.jpg)
*status='old',recl=rec_length,err=16510) read(nrcp_unit,rec=1,err=16520) emin, emax, ne, nb, endian, cdum IF (( ichar(endian) .EQ. 0 )) THEN endianess = '1234' ELSE endianess = '4321' END IF swap = endianess.ne.'1234' IF (( swap )) THEN tmp_4 = emin call egs_swap_4(c_4) emin = tmp_4 tmp_4 = emax call egs_swap_4(c_4) emax = tmp_4 itmp_4 = ne call egs_swap_4(ic_4) ne = itmp_4 itmp_4 = nb call egs_swap_4(ic_4) nb = itmp_4 END IF write(i_log,'(//a,a)') 'Reading NRC pair data base from ',nrcp_fil *e(:lnblnk1(nrcp_file)) write(i_log,'(a,a,a)') 'Data generated on a machine with ',endiane *ss,' endianess' write(i_log,'(a,a)') 'The endianess of this CPU is ','1234' IF (( swap )) THEN write(i_log,'(a)') '=> will need to do byte swaping' END IF write(i_log,'(a,2f9.3)') 'Energy range of the data: ',emin,emax IF (( nb .NE. 65 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'Inconsistent x-grid size' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF IF (( ne .NE. 84 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'Inconsistent energy grid size' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF nrcp_emin = emin nrcp_emax = emax nrcp_dle = log((emax-2)/(emin-2))/(ne-1) nrcp_dlei = 1/nrcp_dle nbb = nb/2 ddx = sqrt(0.5)/nbb DO 16531 ix=0,nbb xx = ddx*ix nrcp_xdata(ix+1) = xx*xx16531 CONTINUE16532 CONTINUE do ix=nbb-1,0,-1 xx = ddx*ix nrcp_xdata(nb-ix) = 1 - xx*xx end do
![Page 425: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/425.jpg)
DO 16551 medium=1,NMED write(i_log,'(a,i4,a,$)') ' medium ',medium,' ................. *.... ' DO 16561 ie=1,84 DO 16571 ix=1,65 nrcp_fdata(ix,ie,medium) = 016571 CONTINUE16572 CONTINUE16561 CONTINUE16562 CONTINUE DO 16581 i_ele=1,NNE(medium) Z = ZELEM(medium,i_ele) iz = int(Z+0.5) tmp = PZ(medium,i_ele)*Z*Z irec = (iz-1)*ne + 2 DO 16591 ie=1,84 read(nrcp_unit,rec=irec,err=16520) tarray DO 16601 ix=1,65 tmp_4 = tarray(ix) IF (( swap )) THEN call egs_swap_4(c_4) END IF nrcp_fdata(ix,ie,medium)=nrcp_fdata(ix,ie,medium)+tmp*tmp_ * 416601 CONTINUE16602 CONTINUE irec = irec + 116591 CONTINUE16592 CONTINUE16581 CONTINUE16582 CONTINUE DO 16611 ie=1,84 call prepare_alias_table(nb-1,nrcp_xdata,nrcp_fdata(1,ie,mediu * m), nrcp_wdata(1,ie,medium),nrcp_idata(1,ie,medium))16611 CONTINUE16612 CONTINUE write(i_log,'(a)') ' done'16551 CONTINUE16552 CONTINUE write(i_log,*) ' ' return16510 CONTINUE write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'Failed to open NRC pair data file' write(i_log,'(/a)') '***************** Quiting now.' call exit(1)16520 CONTINUE write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'I/O error while reading NRC pair data file' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) end subroutine vmc_electron(ircode) ! Copyright National Research Council of Canada, 2000. ! All rights reserved. implicit none common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d
![Page 426: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/426.jpg)
*ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch integer*4 ircode write(i_log,'(/a)') '***************** Error: ' write(i_log,'(//a//)') ' ********* VMC Transport option not in thi *s distribution ****** ' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) end subroutine egs_init_default_rng common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 ixx=0 jxx=0 call init_ranmar return end subroutine egs_init_rng(arg1,arg2) integer*4 arg1,arg2 common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 ixx = arg1 jxx = arg2 call init_ranmar return end subroutine egs_get_rndm(ran) real*8 ran common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 IF((rng_seed .GT. 128))call ranmar_get ran = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 return end subroutine egs_get_rndm_array(n,rarray) integer*4 n real*8 rarray(*) common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti
![Page 427: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/427.jpg)
*mizer,rng_seed,rng_array real*4 twom24 real*8 rtmp integer*4 i IF((n .LT. 1))return DO 16621 i=1,n IF((rng_seed .GT. 128))call ranmar_get rtmp = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 rarray(i) = rtmp16621 CONTINUE16622 CONTINUE return end subroutine eii_init implicit none COMMON/BREMPR/ DL1(8,7),DL2(8,7),DL3(8,7),DL4(8,7),DL5(8,7),DL6(8, *7), ALPHI(2,7),BPAR(2,7),DELPOS(2,7), WA(7,50),PZ(7,50),ZELEM(7,50 *),RHOZ(7,50), PWR2I(50), DELCM(7),ZBRANG(7),LZBRANG(7),NNE(7), IBR *DST,IPRDST,ibr_nist,pair_nrc,itriplet, ASYM(7,50,2) CHARACTER*4 ASYM real*8 DL1,DL2,DL3,DL4,DL5,DL6, ALPHI, BPAR, DELPOS, WA, PZ, * ZELEM, RHOZ, PWR2I, DELCM, ZBRANG, LZBRANG integer*4 NNE, IBRDST, IPRDST, ibr_nist, itriplet, pair_nrc COMMON/EDGE/binding_energies(6,100), interaction_prob(6,100), rela *xation_prob(39,100), edge_energies(16,100), edge_number(100), edge *_a(16,100), edge_b(16,100), edge_c(16,100), edge_d(16,100), IEDGFL *,IPHTER real*8 binding_energies, interaction_prob, relaxation_prob, e *dge_energies, edge_a,edge_b,edge_c,edge_d integer*2 IEDGFL, IPHTER integer*4 edge_number common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch common/eii_data/ eii_xsection_a( 10000), eii_xsection_b( 10000), * eii_cons(7), eii_a(40), eii_b(40), eii_z(40), eii_sh(40), eii *_nshells(100), eii_nsh(7), eii_first(7,50), eii_no(7,50), eii_ *flag real*8 eii_xsection_a,eii_xsection_b,eii_a,eii_b,eii_cons integer*4 eii_z,eii_sh,eii_nshells integer*4 eii_first,eii_no integer*4 eii_elements,eii_flag,eii_nsh COMMON/ELECIN/ esig_e(7),psig_e(7), esige_max, psige_max, range_ep *(0:1,150,7), E_array(150,7), etae_ms0(150,7),etae_ms1(150,7),etap_ *ms0(150,7),etap_ms1(150,7),q1ce_ms0(150,7),q1ce_ms1(150,7),q1cp_ms *0(150,7),q1cp_ms1(150,7),q2ce_ms0(150,7),q2ce_ms1(150,7),q2cp_ms0( *150,7),q2cp_ms1(150,7),blcce0(150,7),blcce1(150,7), EKE0(7),EKE1(7 *), XR0(7),TEFF0(7),BLCC(7),XCC(7), ESIG0(150,7),ESIG1(150,7),PSIG0
![Page 428: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/428.jpg)
*(150,7),PSIG1(150,7),EDEDX0(150,7),EDEDX1(150,7),PDEDX0(150,7),PDE *DX1(150,7),EBR10(150,7),EBR11(150,7),PBR10(150,7),PBR11(150,7),PBR *20(150,7),PBR21(150,7),TMXS0(150,7),TMXS1(150,7), expeke1(7), IUNR *ST(7),EPSTFL(7),IAPRIM(7), sig_ismonotone(0:1,7) real*8 esig_e, psig_e, esige_max, psige_max, range_ep, E_ar *ray, etae_ms0,etae_ms1, etap_ms0,etap_ms1, q1ce_ms0,q1ce_ms1, *q1cp_ms0,q1cp_ms1, q2ce_ms0,q2ce_ms1, q2cp_ms0,q2cp_ms1, blcce0 *,blcce1, expeke1, EKE0,EKE1, XR0, TEFF0, BLCC, XCC, ESIG0,E *SIG1, PSIG0,PSIG1, EDEDX0,EDEDX1, PDEDX0,PDEDX1, EBR10,EBR11, * PBR10,PBR11, PBR20,PBR21, TMXS0,TMXS1 integer*4 IUNRST, EPSTFL, IAPRIM logical sig_ismonotone COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD integer*4 imed,iele,ish,nsh,iZ,j,i,itmp,nskip,nbin,ii,nsh_tot,iii, *k integer*4 jj,jjj integer*4 lnblnk1 integer*4 tmp_array(100) integer*4 want_eii_unit,eii_unit,eii_out,egs_open_file integer egs_get_unit real*8 e_eii_min,emax,fmax,aux_array(250) real*8 sigo,loge,tau,beta2,p2,uwm,Wmax real*8 ss_0, ss_1, sh_0, sh_1, aux, av_e, con_med, dedx_old, sigm_ *old real*8 dedx,e,sig,sigm,wbrem,sum_a,sum_z,sum_pz,sum_wa,Ec,Ecc real*8 sum_sh,sum_occn,U,sum_sigma,sum_dedx real*8 sigma,sigma_old,wbrem_old,sig_j,de integer*4 lloge logical check_it,is_monotone,getd real*8 sigma_max character eii_file*128 character*512 toUpper integer*4 occn_numbers(4) real*8 cons parameter (cons = 0.153536) data occn_numbers/2,2,2,4/ DO 16631 j=1,100 eii_nshells(j) = 016631 CONTINUE16632 CONTINUE DO 16641 j=1,7 eii_nsh(j) = 016641 CONTINUE
![Page 429: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/429.jpg)
16642 CONTINUE IF (( eii_flag .EQ. 0 )) THEN return END IF IF ((toUpper(photon_xsections(:lnblnk1(photon_xsections))) .EQ. 'P *EGS4')) THEN getd = .false. DO 16651 j=1, 2097154 IF (( IEDGFL .GT. 0 .AND. IEDGFL .LE. 100 )) THEN getd = .true. GO TO16652 END IF16651 CONTINUE16652 CONTINUE IF (( .NOT.getd )) THEN write(i_log,'(a/,a/,a/,a//)') ' In subroutine eii_init: ', ' * Fluorescence not set, but binding energies required for ', ' EI *I when using PEGS4 data. ', ' Verifying if binding energies avai *lable by calling EDGSET. ' itmp = IEDGFL IEDGFL = 1 call edgset(1,1) IEDGFL = itmp END IF END IF e_eii_min = 1e30 DO 16661 imed=1,nmed IF((ae(imed)-rm .LT. e_eii_min))e_eii_min = ae(imed) - rm IF((ap(imed) .LT. e_eii_min))e_eii_min = ap(imed)16661 CONTINUE16662 CONTINUE write(i_log,*) ' ' write(i_log,*) 'eii_init: minimum threshold energy found: ',e_eii_ *min DO 16671 imed=1,nmed DO 16681 iele=1,nne(imed) iZ = int(zelem(imed,iele)+0.5) IF (( eii_nshells(iZ) .EQ. 0 )) THEN nsh = 0 DO 16691 ish=1,4 IF((binding_energies(ish,iZ) .GT. e_eii_min))nsh = nsh+116691 CONTINUE16692 CONTINUE eii_nshells(iZ) = nsh END IF16681 CONTINUE16682 CONTINUE16671 CONTINUE16672 CONTINUE nsh = 0 DO 16701 iZ=1,100 nsh = nsh + eii_nshells(iZ)16701 CONTINUE16702 CONTINUE IF (( nsh .EQ. 0 )) THEN write(i_log,*) '*** EII requested but no shells with binding ene *rgies ' write(i_log,*) ' above the specified threshold found'
![Page 430: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/430.jpg)
write(i_log,*) ' => turning off EII' eii_flag = 0 END IF IF (( nsh .GT. 40 )) THEN write(i_log,*) '*** Number of shells with binding energies great *er than ' write(i_log,*) ' the specified thresholds is ',nsh write(i_log,*) ' This is more than the allocated arrays can h *old' write(i_log,'(/a)') '***************** Error: ' write(i_log,*) ' Increase the macro $MAX_EII_SHELLS and retry *' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF write(i_log,*) 'eii_init: number of shells to simulate EII: ',nsh nsh_tot = nsh tmp_array(1) = 0 DO 16711 j=2,100 tmp_array(j) = tmp_array(j-1) + eii_nshells(j-1)16711 CONTINUE16712 CONTINUE itmp = IEDGFL IEDGFL = 1 call edgset(1,1) IEDGFL = itmp DO 16721 imed=1,nmed nsh = 0 DO 16731 iele=1,nne(imed) iZ = int(zelem(imed,iele)+0.5) eii_no(imed,iele) = eii_nshells(iZ) nsh = nsh + eii_nshells(iZ) IF (( eii_nshells(iZ) .GT. 0 )) THEN eii_first(imed,iele) = tmp_array(iZ) + 1 ELSE eii_first(imed,iele) = 0 END IF16731 CONTINUE16732 CONTINUE eii_nsh(imed) = nsh16721 CONTINUE16722 CONTINUE DO 16741 i=1,len(eii_file) eii_file(i:i) = ' '16741 CONTINUE16742 CONTINUE eii_file = hen_house(:lnblnk1(hen_house)) // 'data' // '/' // 'eii *_'// eii_xfile(:lnblnk1(eii_xfile)) //'.data' want_eii_unit = 62 eii_unit = egs_get_unit(want_eii_unit) IF (( eii_unit .LT. 1 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'eii_init: failed to get a free Fortran I/O unit' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF open(eii_unit,file=eii_file(:lnblnk1(eii_file)),status='old',err=1 *6750)
![Page 431: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/431.jpg)
write(i_log,'(//a,a)') 'Opened EII data file ',eii_file(:lnblnk1(e *ii_file)) write(i_log,'(a,$)') ' eii_init: reading EII data ... ' read(eii_unit,*,err=16760,end=16760) nskip DO 16771 j=1,nskip read(eii_unit,*,err=16760,end=16760)16771 CONTINUE16772 CONTINUE read(eii_unit,*,err=16760,end=16760) emax,nbin IF (( nbin .NE. 250 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'Inconsistent EII data file' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF IF ((xsec_out .EQ. 1)) THEN eii_out = egs_open_file(93,0,1,'.eiixsec') END IF ii = 0 DO 16781 j=1,100 read(eii_unit,*,err=16760,end=16760) iZ,nsh IF ((xsec_out .EQ. 1 .AND. eii_nshells(iZ) .GT. 0)) THEN write(eii_out,*) '=================================' write(eii_out,'(a,i3)') 'EII xsections for element Z = ',iZ write(eii_out,*) '=================================' END IF IF (( nsh .LT. eii_nshells(iZ) )) THEN write(i_log,*) 'EII data file has data for ',nsh,' shells for *element ' write(i_log,*) iZ,' but according' write(i_log,*) 'to binding energies and thresholds ',eii_nshel * ls(iZ) write(i_log,*) 'shells are required' write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'This is a fatal error.' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF DO 16791 ish=1,nsh read(eii_unit,*,err=16760,end=16760) fmax read(eii_unit,*,err=16760,end=16760) aux_array IF (( ish .LE. eii_nshells(iZ) )) THEN IF ((xsec_out .EQ. 1)) THEN IF ((ish .EQ. 1)) THEN write(eii_out,'(a,f10.2,a)') 'K-shell sigma_max = ',fmax * ,' b/atom' ELSE IF((ish .EQ. 2)) THEN write(eii_out,'(a,10f9.2,a)') '=> LI-shell sigma_max = ' * ,fmax,' b/atom' ELSE IF((ish .EQ. 3)) THEN write(eii_out,'(a,f8.2,a)') '=> LII-shell sigma_max = ', * fmax,' b/atom' ELSE IF((ish .EQ. 4)) THEN write(eii_out,'(a,f8.2,a)') '=> LIII-shell sigma_max = ' * ,fmax,' b/atom' ELSE write(eii_out,*) '=> Wrong number of shells!' END IF
![Page 432: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/432.jpg)
write(eii_out,*) ' E/keV sigma/(b/atom)' write(eii_out,*) '---------------------------' END IF ii = ii+1 eii_z(ii) = iZ eii_sh(ii) = ish eii_a(ii) = nbin eii_a(ii) = eii_a(ii)/log(emax/binding_energies(ish,iZ)) eii_b(ii) = 1 - eii_a(ii)*log(binding_energies(ish,iZ)) DO 16801 k=1,nbin IF (( k .GT. 1 )) THEN sigo = fmax*aux_array(k-1) ELSE sigo = 0 END IF loge = (k - eii_b(ii))/eii_a(ii) iii = nbin*(ii-1)+k eii_xsection_a(iii) = (fmax*aux_array(k)-sigo)*eii_a(ii) eii_xsection_b(iii) = sigo - eii_xsection_a(iii)*loge IF ((xsec_out .EQ. 1)) THEN write(eii_out,'(f12.2,2X,10f9.2)') Exp((k+1-eii_b(ii))/e * ii_a(ii))*1000.0,fmax*aux_array(k) END IF16801 CONTINUE16802 CONTINUE END IF16791 CONTINUE16792 CONTINUE IF (( ii .EQ. nsh_tot )) THEN GO TO16782 END IF16781 CONTINUE16782 CONTINUE close(eii_unit) IF ((xsec_out .EQ. 1)) THEN close(eii_out) END IF write(i_log,*) ' OK ' write(i_log,*) ' ' DO 16811 imed=1,nmed Ec = ae(imed) - rm Ecc = min(Ec,ap(imed)) sum_z=0 sum_pz=0 sum_a=0 sum_wa=0 DO 16821 iele=1,nne(imed) sum_z = sum_z + pz(imed,iele)*zelem(imed,iele) sum_pz = sum_pz + pz(imed,iele) sum_wa = sum_wa + rhoz(imed,iele) sum_a = sum_a + pz(imed,iele)*wa(imed,iele)16821 CONTINUE16822 CONTINUE con_med = rho(imed)/1.6605655/sum_a eii_cons(imed) = con_med IF (( eii_nsh(imed) .GT. 0 )) THEN is_monotone = .true. sigma_max = 0
![Page 433: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/433.jpg)
DO 16831 j=1,meke(imed) loge = (j - eke0(imed))/eke1(imed) e = Exp(loge) tau = e/rm beta2 = tau*(tau+2)/(tau+1)**2 p2 = 2*rm*tau*(tau+2) lloge = j medium = imed dedx=ededx1(Lloge,MEDIUM)*loge+ededx0(Lloge,MEDIUM) IF (( e .GT. ap(medium) .OR. e .GT. 2*Ec )) THEN sig=esig1(Lloge,MEDIUM)*loge+esig0(Lloge,MEDIUM) ELSE sig = 0 END IF IF (( e .GT. 2*Ec )) THEN wbrem=ebr11(Lloge,MEDIUM)*loge+ebr10(Lloge,MEDIUM) sigm = sig*(1-wbrem) ELSE sigm = 0 wbrem = 1 END IF sum_occn=0 sum_sigma=0 sum_dedx=0 DO 16841 iele=1,nne(imed) iZ = int(zelem(imed,iele)+0.5) sum_sh = 0 DO 16851 ish=1,eii_no(imed,iele) jj = eii_first(imed,iele) + ish - 1 jjj = eii_sh(jj) U = binding_energies(jjj,iZ) Wmax = (e+U)/2 uwm = U/Wmax IF (( U .LT. e .AND. U .GT. Ecc )) THEN sum_sh = sum_sh + occn_numbers(jjj) ss_0 = 2*(log(p2/U)-uwm**3*log(p2/Wmax)- (beta2+0.8333 * 33)*(1-uwm**3))/3/U sh_0 = ((1-uwm)*(1+uwm/(2-uwm))+U*(Wmax-U)/(e+rm)**2 - * (2*tau+1)/(tau+1)**2*uwm/2*log((2-uwm)/uwm))/U ss_1 = log(p2/U)-uwm**2*log(p2/Wmax)- (beta2+1)*(1-uwm * **2) sh_1 = log(Wmax/U/(2-uwm))+2*(Wmax-U)/(2*Wmax-U) +(Wma * x**2-U**2)/(e+rm)**2/2 -(2*tau+1)/(tau+1)**2*log((2*Wm * ax-U)/Wmax) av_E = (ss_1 + sh_1)/(ss_0 + sh_0) i = eii_a(jjj)*loge + eii_b(jjj) i = (jj-1)*250 + i sig_j = eii_xsection_a(i)*loge + eii_xsection_b(i) sig_j = sig_j*pz(imed,iele)*con_med sum_sigma = sum_sigma + sig_j sum_dedx = sum_dedx + sig_j*av_E END IF16851 CONTINUE16852 CONTINUE sum_occn = sum_occn + sum_sh*pz(imed,iele)16841 CONTINUE16842 CONTINUE sigm = sigm + sum_sigma
![Page 434: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/434.jpg)
dedx = dedx - sum_dedx aux = Ec/e IF (( e .GT. 2*Ec )) THEN sigo = cons*sum_occn*rho(imed)/(beta2*Ec)*( (1-2*aux)*(1+a * ux/(1-aux)+(tau/(tau+1))**2*aux/2)- (2*tau+1)/(tau+1)**2*a * ux*log((1-aux)/aux))/sum_a de = cons*sum_occn*rho(imed)/beta2*( log(0.25/aux/(1-aux)) * +(1-2*aux)/(1-aux)+ (tau/(tau+1))**2*(1-4*aux*aux)/8- (2*t * au+1)/(tau+1)**2*log(2*(1-aux)))/sum_a sigm = sigm - sigo dedx = dedx + de END IF sigma = sigm + wbrem*sig IF((sigma/dedx .GT. sigma_max))sigma_max = sigma/dedx IF (( sigma .GT. 0 )) THEN wbrem = wbrem*sig/sigma ELSE wbrem = 1 END IF IF (( j .GT. 1 )) THEN ededx1(j-1,imed) = (dedx - dedx_old)*eke1(imed) ededx0(j-1,imed) = dedx - ededx1(j-1,imed)*loge esig1(j-1,imed) = (sigma - sigma_old)*eke1(imed) esig0(j-1,imed) = sigma - esig1(j-1,imed)*loge ebr11(j-1,imed) = (wbrem - wbrem_old)*eke1(imed) ebr10(j-1,imed) = wbrem - ebr11(j-1,imed)*loge IF((sigma/dedx .LT. sigma_old/dedx_old))is_monotone = .fal * se. END IF dedx_old = dedx sigm_old = sigm sigma_old = sigma wbrem_old = wbrem16831 CONTINUE16832 CONTINUE ededx1(meke(imed),imed) = ededx1(meke(imed)-1,imed) ededx0(meke(imed),imed) = ededx0(meke(imed)-1,imed) esig1(meke(imed),imed) = esig1(meke(imed)-1,imed) esig0(meke(imed),imed) = esig0(meke(imed)-1,imed) ebr11(meke(imed),imed) = ebr11(meke(imed)-1,imed) ebr10(meke(imed),imed) = ebr10(meke(imed)-1,imed) write(i_log,*) 'eii_init: for medium ',imed,' adjusted sige = *', sigma_max,' monotone = ',is_monotone sig_ismonotone(0,imed) = is_monotone esig_e(imed) = sigma_max END IF16811 CONTINUE16812 CONTINUE return16760 write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'I/O error while reading EII data' write(i_log,'(/a)') '***************** Quiting now.' call exit(1)16750 write(i_log,'(/a)') '***************** Error: ' write(i_log,'(//a,a,/a,/a/)') 'Failed to open EII data file ',eii_ *file(:lnblnk1(eii_file)), 'Make sure file exists in your $HEN_HOUS *E/data directory!', '****BEWARE of case sensitive file names!!!' write(i_log,'(/a)') '***************** Quiting now.'
![Page 435: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/435.jpg)
call exit(1) return end subroutine eii_sample(ish,iZ,Uj) implicit none integer*4 ish,iZ real*8 Uj COMMON/EPCONT/EDEP,TSTEP,TUSTEP,USTEP,TVSTEP,VSTEP, RHOF,EOLD,ENEW *,EKE,ELKE,GLE,E_RANGE, x_final,y_final,z_final, u_final,v_final,w_ *final, IDISC,IROLD,IRNEW,IAUSFL(29) DOUBLE PRECISION EDEP real*8 TSTEP, TUSTEP, USTEP, VSTEP, TVSTEP, RHOF, EOLD, ENE *W, EKE, ELKE, GLE, E_RANGE, x_final,y_final,z_final, u_final, *v_final,w_final integer*4 IDISC, IROLD, IRNEW, IAUSFL common/eii_data/ eii_xsection_a( 10000), eii_xsection_b( 10000), * eii_cons(7), eii_a(40), eii_b(40), eii_z(40), eii_sh(40), eii *_nshells(100), eii_nsh(7), eii_first(7,50), eii_no(7,50), eii_ *flag real*8 eii_xsection_a,eii_xsection_b,eii_a,eii_b,eii_cons integer*4 eii_z,eii_sh,eii_nshells integer*4 eii_first,eii_no integer*4 eii_elements,eii_flag,eii_nsh common/egs_vr/ e_max_rr, prob_RR, nbr_split, i_play_RR, i_ *survived_RR, * n_RR_warning, i_do_rr real*8 e_max_rr,prob_RR integer*4 nbr_split,i_play_RR,i_survived_RR,n_RR_warning integer*2 i_do_rr common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 COMMON/STACK/ E(10000),X(10000),Y(10000),Z(10000),U(10000),V(10000 *),W(10000),DNEAR(10000),WT(10000),IQ(10000),IR(10000),LATCH(10000) *, LATCHI,NP,NPold DOUBLE PRECISION E real*8 X,Y,Z, U,V,W, DNEAR, WT integer*4 IQ, IR, LATCH, LATCHI, NP, NPold COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL COMMON/UPHIOT/THETA,SINTHE,COSTHE,SINPHI, COSPHI,PI,TWOPI,PI5D2 real*8 THETA, SINTHE, COSTHE, SINPHI, COSPHI, PI,TWOPI,PI5D2 COMMON/USEFUL/PZERO,PRM,PRMT2,RM,MEDIUM,MEDOLD DOUBLE PRECISION PZERO, PRM, PRMT2 real*8 RM integer*4 MEDIUM, MEDOLD common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m
![Page 436: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/436.jpg)
*scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch real*8 T,tau,tau1,tau12,tau2,p2,beta2,c1,c2,Wmax,xmax,fm_s,fm_h,pr *ob_s,prob real*8 r1,r2,r3,wx,wxx,aux,frej real*8 peie,pese1,pese2,dcosth,h1 integer*4 iarg real*8 eta,cphi,sphi integer*4 np_save,ip,j real*8 xphi,xphi2,yphi,yphi2,rhophi2 peie = e(np) T = peie - rm tau = T/rm tau1 = tau+1 tau12 = tau1*tau1 tau2 = tau*tau p2 = tau2 + 2*tau beta2 = p2/tau12 Wmax = 0.5*(T+Uj) xmax = Uj/Wmax c1 = (Wmax/peie)**2 c2 = (2*tau+1)/tau12 fm_s = log(rmt2*p2/Uj) - beta2 - 0.5 prob_s = 0.66666667*fm_s*(1+xmax+xmax*xmax) fm_h = 2 + c1 - c2 IF((fm_h .LT. 1))fm_h = 1 prob = fm_h + prob_s16861 CONTINUE IF((rng_seed .GT. 128))call ranmar_get r1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get r2 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF((rng_seed .GT. 128))call ranmar_get r3 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 IF (( r1*prob .LT. fm_h )) THEN wx = 1/(r2*xmax+1-r2) wxx = wx*xmax aux = wxx/(2-wxx) frej = (1 + aux*(aux-c2)+c1*wxx*wxx)/fm_h ELSE wx = 1/(r2*xmax**3+1-r2)**0.333333333 frej = 1 - log(wx)/fm_s END IF IF((( r3 .LT. frej )))GO TO16862 GO TO 1686116862 CONTINUE wx = wx*Uj h1 = (peie + prm)/T pese1 = peie - wx e(np) = pese1 dcosth = h1*(pese1-prm)/(pese1+prm) sinthe = dsqrt(1-dcosth) costhe = dsqrt(dcosth) call uphi(2,1) pese2 = wx - Uj + prm
![Page 437: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/437.jpg)
IF (( pese2 .GT. ae(medium) )) THEN IF (( np+1 .GT. 10000 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(//,a,a,a,/,a,i6,a,i6,/,a)') ' In subroutine ','e *ii_sample', ' stack size exceeded! ',' $MXSTACK = ',10000,' np = ' * ,np+1, ' Increase $MXSTACK and try again ' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF np = np+1 e(np) = pese2 dcosth = h1*(pese2-prm)/(pese2+prm) sinthe = -dsqrt(1-dcosth) costhe = dsqrt(dcosth) iq(np) = -1 call uphi(3,2) edep = 0 ELSE edep = wx - Uj END IF call relax(Uj,ish,iZ) IF (( edep .GT. 0 )) THEN IARG=4 IF ((IAUSFL(IARG+1).NE.0)) THEN CALL AUSGAB(IARG) END IF IF((IARG.LT.0))RETURN END IF return end subroutine egs_scale_photon_xsection(imed,fac,which) implicit none integer*4 imed,which real*8 fac COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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/PHOTIN/ EBINDA(7), GE0(7),GE1(7), GMFP0(200,7),GMFP1(200,7) *,GBR10(200,7),GBR11(200,7),GBR20(200,7),GBR21(200,7), RCO0(7),RCO1 *(7), RSCT0(100,7),RSCT1(100,7), COHE0(200,7),COHE1(200,7), DPMFP, *MPGEM(1,7), NGR(7) real*8 EBINDA, GE0,GE1, GMFP0,GMFP1, GBR10,GBR11, GBR20,GBR21, * RCO0,RCO1, RSCT0,RSCT1, COHE0,COHE1, DPMFP integer*4 * MPGEM, * NGR common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch
![Page 438: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/438.jpg)
character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch integer*4 ifirst,ilast,medium,j logical has_r real*8 gle,gmfp,gbr1,gbr2,cohfac,aux,gmfp_old,gbr1_old,gbr2_old,co *hfac_old character*8 strings(5) data strings/'photon','Rayleigh','Compton','pair','photo'/ IF (( which .LT. 0 .OR. which .GT. 4 )) THEN return END IF IF (( imed .GT. 0 .AND. imed .LE. nmed )) THEN ifirst = imed ilast = imed ELSE ifirst = 1 ilast = nmed END IF IF (( which .EQ. 1 )) THEN has_r = .false. DO 16871 medium=ifirst,ilast IF (( iraylm(medium) .EQ. 1 )) THEN has_r = .true. END IF16871 CONTINUE16872 CONTINUE IF((.NOT.has_r))return END IF write(i_log,*) ' ' DO 16881 medium=ifirst,ilast write(i_log,'(a,a,a,i3,a,f9.5)') 'Scaling ',strings(which+1),' x *-section data for medium', medium,' with ',fac DO 16891 j=1,mge(medium) gle = (j - ge0(medium))/ge1(medium) gmfp = gmfp0(j,medium) + gmfp1(j,medium)*gle gbr1 = gbr10(j,medium) + gbr11(j,medium)*gle gbr2 = gbr20(j,medium) + gbr21(j,medium)*gle IF (( iraylm(medium) .EQ. 1 )) THEN cohfac = cohe0(j,medium) + cohe1(j,medium)*gle ELSE cohfac = 1 END IF IF (( which .EQ. 0 )) THEN gmfp = gmfp/fac ELSE IF(( which .EQ. 1 )) THEN cohfac = cohfac/(fac*(1-cohfac)+cohfac) ELSE IF (( which .EQ. 2 )) THEN aux = fac*(gbr2-gbr1) + gbr1 + 1 - gbr2 gbr2 = (gbr1 + fac*(gbr2-gbr1))/aux gbr1 = gbr1/aux ELSE IF(( which .EQ. 3 )) THEN aux = fac*gbr1 + 1 - gbr1
![Page 439: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/439.jpg)
gbr2 = (fac*gbr1 + gbr2-gbr1)/aux gbr1 = fac*gbr1/aux ELSE aux = gbr2 + fac*(1-gbr2) gbr1 = gbr1/aux gbr2 = gbr2/aux END IF gmfp = gmfp/aux cohfac = cohfac*aux/(aux*cohfac + 1 - cohfac) END IF IF (( j .GT. 1 )) THEN gmfp1(j-1,medium) = (gmfp - gmfp_old)*ge1(medium) gmfp0(j-1,medium) = gmfp - gmfp1(j-1,medium)*gle gbr11(j-1,medium) = (gbr1 - gbr1_old)*ge1(medium) gbr10(j-1,medium) = gbr1 - gbr11(j-1,medium)*gle gbr21(j-1,medium) = (gbr2 - gbr2_old)*ge1(medium) gbr20(j-1,medium) = gbr2 - gbr21(j-1,medium)*gle cohe1(j-1,medium) = (cohfac - cohfac_old)*ge1(medium) cohe0(j-1,medium) = cohfac - cohe1(j-1,medium)*gle END IF gmfp_old = gmfp gbr1_old = gbr1 gbr2_old = gbr2 cohfac_old = cohfac16891 CONTINUE16892 CONTINUE gmfp1(mge(medium),medium) = gmfp1(mge(medium)-1,medium) gmfp0(mge(medium),medium) = gmfp0(mge(medium)-1,medium) gbr11(mge(medium),medium) = gbr11(mge(medium)-1,medium) gbr10(mge(medium),medium) = gbr10(mge(medium)-1,medium) gbr21(mge(medium),medium) = gbr21(mge(medium)-1,medium) gbr20(mge(medium),medium) = gbr20(mge(medium)-1,medium) cohe1(mge(medium),medium) = cohe1(mge(medium)-1,medium) cohe0(mge(medium),medium) = cohe0(mge(medium)-1,medium)16881 CONTINUE16882 CONTINUE return end subroutine egs_init_user_photon(prefix,comp_prefix,out) implicit none character*(*) prefix, comp_prefix integer*4 out COMMON/BREMPR/ DL1(8,7),DL2(8,7),DL3(8,7),DL4(8,7),DL5(8,7),DL6(8, *7), ALPHI(2,7),BPAR(2,7),DELPOS(2,7), WA(7,50),PZ(7,50),ZELEM(7,50 *),RHOZ(7,50), PWR2I(50), DELCM(7),ZBRANG(7),LZBRANG(7),NNE(7), IBR *DST,IPRDST,ibr_nist,pair_nrc,itriplet, ASYM(7,50,2) CHARACTER*4 ASYM real*8 DL1,DL2,DL3,DL4,DL5,DL6, ALPHI, BPAR, DELPOS, WA, PZ, * ZELEM, RHOZ, PWR2I, DELCM, ZBRANG, LZBRANG integer*4 NNE, IBRDST, IPRDST, ibr_nist, itriplet, pair_nrc COMMON/EDGE/binding_energies(6,100), interaction_prob(6,100), rela *xation_prob(39,100), edge_energies(16,100), edge_number(100), edge *_a(16,100), edge_b(16,100), edge_c(16,100), edge_d(16,100), IEDGFL *,IPHTER real*8 binding_energies, interaction_prob, relaxation_prob, e *dge_energies, edge_a,edge_b,edge_c,edge_d integer*2 IEDGFL, IPHTER integer*4 edge_number
![Page 440: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/440.jpg)
common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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/PHOTIN/ EBINDA(7), GE0(7),GE1(7), GMFP0(200,7),GMFP1(200,7) *,GBR10(200,7),GBR11(200,7),GBR20(200,7),GBR21(200,7), RCO0(7),RCO1 *(7), RSCT0(100,7),RSCT1(100,7), COHE0(200,7),COHE1(200,7), DPMFP, *MPGEM(1,7), NGR(7) real*8 EBINDA, GE0,GE1, GMFP0,GMFP1, GBR10,GBR11, GBR20,GBR21, * RCO0,RCO1, RSCT0,RSCT1, COHE0,COHE1, DPMFP integer*4 * MPGEM, * NGR COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL common/compton_data/ iz_array(1538), be_array(1538), Jo_array(15 *38), erfJo_array(1538), ne_array(1538), shn_array(1538), *shell_array(100,7), eno_array(100,7), eno_atbin_array(100,7), n_sh *ell(7), radc_flag, ibcmp integer*4 iz_array,ne_array,shn_array,eno_atbin_array, shell_array *,n_shell,radc_flag real*8 be_array,Jo_array,erfJo_array,eno_array integer*2 ibcmp integer*4 lnblnk1,egs_get_unit,medium, photo_unit,pair_unit,raylei *gh_unit,triplet_unit, ounit,egs_open_file,compton_unit integer*4 nge,sorted(50),i,j,k,iz,iz_old,ndat real*8 z_sorted(50),pz_sorted(50) real*8 sig_photo(200),sig_pair(200),sig_triplet(200), sig_rayleigh *(200),sig_compton(200) real*8 sigma,cohe,gmfp,gbr1,gbr2,sig_KN,gle,e,sig_p real*8 cohe_old,gmfp_old,gbr1_old,gbr2_old real*8 etmp(2000),ftmp(2000) real*8 sumZ,sumA,con1,con2,egs_KN_sigma0 real*8 bc_emin,bc_emax,bc_dle,bc_data(183),bc_tmp(183),bcf,aj integer*4 bc_ne logical input_compton_data character data_dir*128,photo_file*140,pair_file*140,rayleigh_file* *144, triplet_file*142,tmp_string*144,compton_file*144 write(i_log,'(/a)') '(Re)-initializing photon cross section data' write(i_log,'(a,a/)') 'Using data files from the series ', prefix(
![Page 441: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/441.jpg)
*:lnblnk1(prefix)) write(i_log,'(a,a,a,a)') 'Photon cross sections: ',prefix(:lnblnk1 *(prefix)), ' Compton cross sections: ',comp_prefix(:lnblnk1(comp_p *refix)) input_compton_data = .false. IF (( ibcmp .GT. 1 .AND. lnblnk1(comp_prefix) .GT. 0 )) THEN IF((comp_prefix(1:7) .NE. 'default'))input_compton_data = .true. END IF data_dir = hen_house(:lnblnk1(hen_house)) // 'data' // '/' photo_file = data_dir(:lnblnk1(data_dir)) // prefix(:lnblnk1(prefi *x)) // '_photo.data' pair_file = data_dir(:lnblnk1(data_dir)) // prefix(:lnblnk1(prefix *)) // '_pair.data' triplet_file = data_dir(:lnblnk1(data_dir)) // prefix(:lnblnk1(pre *fix)) // '_triplet.data' rayleigh_file = data_dir(:lnblnk1(data_dir)) // prefix(:lnblnk1(pr *efix)) // '_rayleigh.data' IF (( input_compton_data )) THEN compton_file = data_dir(:lnblnk1(data_dir)) // comp_prefix(:lnbl * nk1(comp_prefix)) // '_compton.data' write(i_log,'(a,a)') 'Using Compton cross sections from ', compt * on_file(:lnblnk1(compton_file)) ELSE compton_file = data_dir(:lnblnk1(data_dir)) // 'compton_sigma.da *ta' END IF photo_unit = 83 photo_unit = egs_get_unit(photo_unit) IF (( photo_unit .LT. 1 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'egs_init_user_photon: failed to get a free Fortr *an I/O unit' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF tmp_string = photo_file open(photo_unit,file=photo_file,status='old',err=16900) pair_unit = 84 pair_unit = egs_get_unit(pair_unit) IF (( pair_unit .LT. 1 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'egs_init_user_photon: failed to get a free Fortr *an I/O unit' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF tmp_string = pair_file open(pair_unit,file=pair_file,status='old',err=16900) triplet_unit = 85 triplet_unit = egs_get_unit(triplet_unit) IF (( triplet_unit .LT. 1 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'egs_init_user_photon: failed to get a free Fortr *an I/O unit' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF tmp_string = triplet_file
![Page 442: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/442.jpg)
open(triplet_unit,file=triplet_file,status='old',err=16900) rayleigh_unit = 86 rayleigh_unit = egs_get_unit(rayleigh_unit) IF (( rayleigh_unit .LT. 1 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'egs_init_user_photon: failed to get a free Fortr *an I/O unit' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF tmp_string = rayleigh_file open(rayleigh_unit,file=rayleigh_file,status='old',err=16900) IF (( ibcmp .GT. 1 )) THEN compton_unit = 88 compton_unit = egs_get_unit(compton_unit) IF (( compton_unit .LT. 1 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'egs_init_user_photon: failed to get a free For *tran I/O unit' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF tmp_string = compton_file open(compton_unit,file=compton_file,status='old',err=16900) END IF IF (( out .EQ. 1 )) THEN ounit = egs_open_file(87,0,1,'.xsections') write(ounit,'(/a,a,a)') 'Photon cross sections initialized from *', prefix(:lnblnk1(prefix)),' data files' write(ounit,'(a,/)') '========================================== *==================================' write(ounit,'(a,/)') 'Grid energies and cross sections are outpu *t' write(ounit,'(5x,a,t19,a,t34,a,t49,a,t64,a)') 'Energy',' GMFP(cm *) ',' Pair ','Compton',' GMFP(cm) ' write(ounit,'(5x,a,t19,a,t34,a,t49,a,t64,a/)') '(MeV)','no Rayle *igh','(fraction)','(fraction)','with Rayleigh' END IF DO 16911 iz=1,100 read(photo_unit,*) ndat read(photo_unit,*) (etmp(k),ftmp(k),k=1,ndat) k = 0 DO 16921 j=ndat,2,-1 IF (( etmp(j)-etmp(j-1) .LT. 1e-5 )) THEN k = k+1 binding_energies(k,iz) = exp(etmp(j)) IF((k .GE. 4))GO TO16922 END IF16921 CONTINUE16922 CONTINUE16911 CONTINUE16912 CONTINUE DO 16931 medium=1,nmed mge(medium) = 200 nge = 200 ge1(medium) = nge-1 ge1(medium) = ge1(medium)/log(up(medium)/ap(medium)) ge0(medium) = 1 - ge1(medium)*log(ap(medium))
![Page 443: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/443.jpg)
write(i_log,'(a,i3,a,$)') 'Working on medium ',medium,' ... ' IF (( out .EQ. 1 )) THEN write(ounit,'(/,2x,a,i3,a,24a1/)') 'Medium ',medium,': ', (med * ia(k,medium),k=1,24) END IF sumZ=0 sumA=0 DO 16941 i=1,nne(medium) z_sorted(i) = zelem(medium,i) sumZ = sumZ + pz(medium,i)*zelem(medium,i) sumA = sumA + pz(medium,i)*wa(medium,i)16941 CONTINUE16942 CONTINUE con1 = sumZ*rho(medium)/(sumA*1.6605655) con2 = rho(medium)/(sumA*1.6605655) call egs_heap_sort(nne(medium),z_sorted,sorted) DO 16951 i=1,nne(medium) pz_sorted(i) = pz(medium,sorted(i))16951 CONTINUE16952 CONTINUE call egsi_get_data(0,photo_unit,nge,nne(medium),z_sorted,pz_sort * ed, ge1(medium),ge0(medium),sig_photo) call egsi_get_data(0,rayleigh_unit,nge,nne(medium),z_sorted,pz_s * orted, ge1(medium),ge0(medium),sig_rayleigh) call egsi_get_data(1,pair_unit,nge,nne(medium),z_sorted,pz_sorte * d, ge1(medium),ge0(medium),sig_pair) call egsi_get_data(2,triplet_unit,nge,nne(medium),z_sorted,pz_so * rted, ge1(medium),ge0(medium),sig_triplet) IF (( ibcmp .GT. 1 )) THEN IF (( input_compton_data )) THEN call egsi_get_data(0,compton_unit,nge,nne(medium), z_sorted, * pz_sorted,ge1(medium),ge0(medium), sig_compton) ELSE rewind(compton_unit) read(compton_unit,*) bc_emin,bc_emax,bc_ne IF (( bc_ne .GT. 183 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'Number of input Compton data exceeds array * size' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF bc_dle = log(bc_emax/bc_emin)/(bc_ne-1) DO 16961 j=1,bc_ne bc_data(j) = 016961 CONTINUE16962 CONTINUE iz_old = 1 DO 16971 i=1,nne(medium) iz = int(z_sorted(i)+0.5) DO 16981 j=iz_old,iz read(compton_unit,*) (bc_tmp(k),k=1,bc_ne)16981 CONTINUE16982 CONTINUE DO 16991 j=1,bc_ne bc_data(j)=bc_data(j)+pz_sorted(i)*z_sorted(i)*bc_tmp(j)16991 CONTINUE16992 CONTINUE
![Page 444: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/444.jpg)
iz_old = iz+116971 CONTINUE16972 CONTINUE DO 17001 j=1,bc_ne bc_data(j)=log(bc_data(j)/sumZ)17001 CONTINUE17002 CONTINUE END IF END IF call egs_init_rayleigh(medium,sig_rayleigh) DO 17011 i=1,nge gle = (i - ge0(medium))/ge1(medium) e = exp(gle) sig_KN = sumZ*egs_KN_sigma0(e) IF (( ibcmp .GT. 1 )) THEN IF (( input_compton_data )) THEN sig_KN = sig_compton(i) ELSE IF (( e .LE. bc_emin )) THEN bcf = exp(bc_data(1)) ELSE IF(( e .LT. bc_emax )) THEN aj = 1 + log(e/bc_emin)/bc_dle j = int(aj) aj = aj - j bcf = exp(bc_data(j)*(1-aj) + bc_data(j+1)*aj) ELSE bcf = 1 END IF sig_KN = sig_KN*bcf END IF END IF sig_p = sig_pair(i) + sig_triplet(i) sigma = sig_KN + sig_p + sig_photo(i) gmfp = 1/(sigma*con2) gbr1 = sig_p/sigma gbr2 = gbr1 + sig_KN/sigma cohe = sigma/(sig_rayleigh(i) + sigma) IF (( out .EQ. 1 )) THEN write(ounit,'(5(1pe15.6))') e,gmfp,gbr1,gbr2-gbr1,gmfp*cohe END IF IF (( i .GT. 1 )) THEN gmfp1(i-1,medium) = (gmfp - gmfp_old)*ge1(medium) gmfp0(i-1,medium) = gmfp - gmfp1(i-1,medium)*gle gbr11(i-1,medium) = (gbr1 - gbr1_old)*ge1(medium) gbr10(i-1,medium) = gbr1 - gbr11(i-1,medium)*gle gbr21(i-1,medium) = (gbr2 - gbr2_old)*ge1(medium) gbr20(i-1,medium) = gbr2 - gbr21(i-1,medium)*gle cohe1(i-1,medium) = (cohe - cohe_old)*ge1(medium) cohe0(i-1,medium) = cohe - cohe1(i-1,medium)*gle END IF gmfp_old = gmfp gbr1_old = gbr1 gbr2_old = gbr2 cohe_old = cohe17011 CONTINUE17012 CONTINUE gmfp1(nge,medium) = gmfp1(nge-1,medium) gmfp0(nge,medium) = gmfp - gmfp1(nge,medium)*gle
![Page 445: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/445.jpg)
gbr11(nge,medium) = gbr11(nge-1,medium) gbr10(nge,medium) = gbr1 - gbr11(nge,medium)*gle gbr21(nge,medium) = gbr21(nge-1,medium) gbr20(nge,medium) = gbr2 - gbr21(nge,medium)*gle cohe1(nge,medium) = cohe1(nge-1,medium) cohe0(nge,medium) = cohe - cohe1(nge,medium)*gle write(i_log,'(a)') 'OK'16931 CONTINUE16932 CONTINUE close(photo_unit) close(pair_unit) close(triplet_unit) close(rayleigh_unit) IF (( ibcmp .GT. 1 )) THEN close(compton_unit) END IF IF (( out .EQ. 1 )) THEN close(ounit) END IF return16900 CONTINUE write(i_log,'(/a)') '***************** Error: ' write(i_log,'(//a,a)') 'Failed to open data file ',tmp_string(:lnb *lnk1(tmp_string)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1) return end subroutine egs_init_rayleigh(medium,sig_rayleigh) implicit none COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), 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( 2097154),MED( 2097154),IRAYLR real*8 DUNIT, RHOR integer*4 KMPI, KMPO integer*2 MED, IRAYLR
![Page 446: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/446.jpg)
COMMON/PHOTIN/ EBINDA(7), GE0(7),GE1(7), GMFP0(200,7),GMFP1(200,7) *,GBR10(200,7),GBR11(200,7),GBR20(200,7),GBR21(200,7), RCO0(7),RCO1 *(7), RSCT0(100,7),RSCT1(100,7), COHE0(200,7),COHE1(200,7), DPMFP, *MPGEM(1,7), NGR(7) real*8 EBINDA, GE0,GE1, GMFP0,GMFP1, GBR10,GBR11, GBR20,GBR21, * RCO0,RCO1, RSCT0,RSCT1, COHE0,COHE1, DPMFP integer*4 * MPGEM, * NGR COMMON/BREMPR/ DL1(8,7),DL2(8,7),DL3(8,7),DL4(8,7),DL5(8,7),DL6(8, *7), ALPHI(2,7),BPAR(2,7),DELPOS(2,7), WA(7,50),PZ(7,50),ZELEM(7,50 *),RHOZ(7,50), PWR2I(50), DELCM(7),ZBRANG(7),LZBRANG(7),NNE(7), IBR *DST,IPRDST,ibr_nist,pair_nrc,itriplet, ASYM(7,50,2) CHARACTER*4 ASYM real*8 DL1,DL2,DL3,DL4,DL5,DL6, ALPHI, BPAR, DELPOS, WA, PZ, * ZELEM, RHOZ, PWR2I, DELCM, ZBRANG, LZBRANG integer*4 NNE, IBRDST, IPRDST, ibr_nist, itriplet, pair_nrc COMMON/rayleigh_inputs/iray_ff_media(7),iray_ff_file(7) character*24 iray_ff_media character*128 iray_ff_file COMMON/rayleigh_sampling/xgrid(100,7), fcum(100,7), b_array(100,7) *, c_array(100,7), i_array(100,7), pmax0(200,7),pmax1(200,7) real*8 xgrid, fcum, b_array, c_array,pmax0, pmax1 integer*4 i_array real*8 xval(100),aff(100,100),ff(100,7) real*8 xsc, fsc real*8 sig_rayleigh(200), pe_array(200,7) real*8 e,egs_rayleigh_sigma,gmfp,gle,conv,dle,dlei,sumA real*8 totRayleigh2,pzmin real*8 emin, emax integer*4 i,j,k,ff_unit, egs_get_unit, ne integer*4 lnblnk1, EOF, nff, medium, ncustom character dummy*24, afac_file*128, ff_file*128 IF ((iraylm(medium).EQ.0)) THEN return END IF ncustom=0 write(dummy,'(24a1)')(media(j,medium),j=1,24) ff_file=' ' DO 17021 i=1,7 IF ((lnblnk1(iray_ff_file(i)).NE.0)) THEN ncustom = ncustom + 1 END IF17021 CONTINUE17022 CONTINUE DO 17031 i=1,ncustom IF ((dummy(:lnblnk1(dummy)) .EQ. iray_ff_media(i))) THEN ff_file = iray_ff_file(i) END IF17031 CONTINUE17032 CONTINUE ff_unit = egs_get_unit(0) IF (( ff_unit .LT. 1 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'egs_init_rayleigh: failed to get a free Fortran *I/O unit' write(i_log,'(/a)') '***************** Quiting now.' call exit(1)
![Page 447: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/447.jpg)
END IF IF (( lnblnk1(ff_file) .GT. 0)) THEN open(ff_unit,file=ff_file(:lnblnk1(ff_file)), status='old',err=1 * 7040) GOTO 1705017040 write(i_log,'(/a)') '***************** Error: ' write(i_log,'(2a)') 'egs_init_rayleigh: failed to open custom ff * file ', ff_file(:lnblnk1(ff_file)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1)17050 write(i_log,'(/2a)') 'Opened custom ff file ',ff_file(:lnblnk1(f * f_file)) j = 017061 CONTINUE j = j + 1 read(ff_unit,*,IOSTAT=EOF) xsc, fsc IF((EOF .LT. 0))GO TO17062 IF ((j .LE. 100)) THEN xgrid(j,medium)=xsc ff(j,medium)=fsc END IF GO TO 1706117062 CONTINUE nff = j-1 IF ((nff .GT. 100)) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,'(a,/,a,i5,a,i5,/,a)') 'subroutine egs_init_raylei *gh: form factors size too small!!', '$XRAYFF = ', 100,', and need * to be ',nff, ' and try again!!!' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF IF((xgrid(1,medium) .LT. 1e-6))xgrid(1,medium) = 1e-4 write(*,*) '\n -> ', nff, ' values of mol. ff read!' sumA = 0.0 DO 17071 j=1,nne(medium) sumA=sumA+PZ(medium,j)*WA(medium,j)17071 CONTINUE17072 CONTINUE DO 17081 j=1,MGE(medium) gle=(j-GE0(medium))/GE1(medium) e=exp(gle) sig_rayleigh(j)=egs_rayleigh_sigma(medium,e,nff, xgrid(1,mediu * m),ff(1,medium))*sumA17081 CONTINUE17082 CONTINUE ELSE DO 17091 i=1,len(afac_file) afac_file(i:i) = ' '17091 CONTINUE17092 CONTINUE afac_file = hen_house(:lnblnk1(hen_house))//'pegs4'//'/'//'pgs4f *orm.dat' open(ff_unit,file=afac_file(:lnblnk1(afac_file)), status='old',e * rr=17100) GOTO 1711017100 write(i_log,'(/a)') '***************** Error: ' write(i_log,'(2a)') 'egs_init_rayleigh: failed to open atomic ff
![Page 448: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/448.jpg)
* file', afac_file(:lnblnk1(afac_file)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1)17110 read(ff_unit,*) xval, aff DO 17121 i=1,100 ff(i,medium) = 0.0 xgrid(i,medium)=xval(i) DO 17131 j=1,nne(medium) ff(i,medium)=ff(i,medium)+PZ(medium,j)*aff(i,int(zelem(mediu * m,j)))**217131 CONTINUE17132 CONTINUE ff(i,medium) = sqrt(ff(i,medium))17121 CONTINUE17122 CONTINUE nff = 100 IF((xgrid(1,medium) .LT. 1e-6))xgrid(1,medium) = 1e-4 write(*,*) '\n -> ', nff, ' atomic ff values computed!' END IF close(ff_unit) emin = exp((1 - ge0(medium))/ge1(medium)) emax = exp((mge(medium) - ge0(medium))/ge1(medium)) call prepare_rayleigh_data(nff,xgrid(1,medium),ff(1,medium), mge(m *edium),emin,emax, pe_array(1,medium),100, fcum(1,medium),i_array(1 *,medium), b_array(1,medium),c_array(1,medium)) ne=MGE(medium) dle=log(up(medium)/ap(medium))/(ne-1) dlei=1/dle DO 17141 i=1,ne-1 gle = (i - ge0(medium))/ge1(medium) pmax1(i,medium)=(pe_array(i+1,medium)-pe_array(i,medium))*ge1(me * dium) pmax0(i,medium)=pe_array(i,medium)-pmax1(i,medium)*gle17141 CONTINUE17142 CONTINUE pmax0(ne,medium)=pmax0(ne-1,medium) pmax1(ne,medium)=pmax1(ne-1,medium) return end subroutine egs_init_rayleigh_sampling(medium) implicit none COMMON/THRESH/RMT2,RMSQ, AP(7),AE(7),UP(7),UE(7),TE(7),THMOLL(7) real*8 RMT2, RMSQ, AP, AE, UP, UE, TE, THMOLL common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch COMMON/MEDIA/ RLC(7),RLDU(7),RHO(7),MSGE(7),MGE(7),MSEKE(7),MEKE(7 *),MLEKE(7),MCMFP(7),MRANGE(7),IRAYLM(7), MEDIA(24,7), photon_xsect *ions, comp_xsections, apx,upx, eii_xfile,NMED
![Page 449: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/449.jpg)
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( 2097154),MED( 2097154),IRAYLR real*8 DUNIT, RHOR integer*4 KMPI, KMPO integer*2 MED, IRAYLR COMMON/PHOTIN/ EBINDA(7), GE0(7),GE1(7), GMFP0(200,7),GMFP1(200,7) *,GBR10(200,7),GBR11(200,7),GBR20(200,7),GBR21(200,7), RCO0(7),RCO1 *(7), RSCT0(100,7),RSCT1(100,7), COHE0(200,7),COHE1(200,7), DPMFP, *MPGEM(1,7), NGR(7) real*8 EBINDA, GE0,GE1, GMFP0,GMFP1, GBR10,GBR11, GBR20,GBR21, * RCO0,RCO1, RSCT0,RSCT1, COHE0,COHE1, DPMFP integer*4 * MPGEM, * NGR COMMON/BREMPR/ DL1(8,7),DL2(8,7),DL3(8,7),DL4(8,7),DL5(8,7),DL6(8, *7), ALPHI(2,7),BPAR(2,7),DELPOS(2,7), WA(7,50),PZ(7,50),ZELEM(7,50 *),RHOZ(7,50), PWR2I(50), DELCM(7),ZBRANG(7),LZBRANG(7),NNE(7), IBR *DST,IPRDST,ibr_nist,pair_nrc,itriplet, ASYM(7,50,2) CHARACTER*4 ASYM real*8 DL1,DL2,DL3,DL4,DL5,DL6, ALPHI, BPAR, DELPOS, WA, PZ, * ZELEM, RHOZ, PWR2I, DELCM, ZBRANG, LZBRANG integer*4 NNE, IBRDST, IPRDST, ibr_nist, itriplet, pair_nrc COMMON/rayleigh_inputs/iray_ff_media(7),iray_ff_file(7) character*24 iray_ff_media character*128 iray_ff_file COMMON/rayleigh_sampling/xgrid(100,7), fcum(100,7), b_array(100,7) *, c_array(100,7), i_array(100,7), pmax0(200,7),pmax1(200,7) real*8 xgrid, fcum, b_array, c_array,pmax0, pmax1 integer*4 i_array real*8 xval(100),aff(100,100),ff(100,7) real*8 xsc, fsc real*8 sig_rayleigh(200), pe_array(200,7) real*8 e,egs_rayleigh_sigma,gmfp,gle,conv,dle,dlei,sumA real*8 totRayleigh2,pzmin real*8 emin, emax integer*4 i,j,k,ff_unit, egs_get_unit, ne integer*4 lnblnk1, EOF, nff, medium, ncustom character dummy*24, afac_file*128, ff_file*128 IF ((iraylm(medium).EQ.0)) THEN return END IF ff_unit = egs_get_unit(0) IF (( ff_unit .LT. 1 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'egs_init_rayleigh: failed to get a free Fortran *I/O unit' write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF DO 17151 i=1,len(afac_file) afac_file(i:i) = ' '17151 CONTINUE
![Page 450: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/450.jpg)
17152 CONTINUE afac_file = hen_house(:lnblnk1(hen_house))//'pegs4'//'/'//'pgs4for *m.dat' open(ff_unit,file=afac_file(:lnblnk1(afac_file)),status='old',err= *17100) GOTO 1711017100 write(i_log,'(/a)') '***************** Error: ' write(i_log,'(2a)') 'egs_init_rayleigh_sampling: failed to open at *omic ff file ', afac_file(:lnblnk1(afac_file)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1)17110 read(ff_unit,*) xval, aff DO 17161 i=1,100 ff(i,medium) = 0.0 xgrid(i,medium)=xval(i) DO 17171 j=1,nne(medium) ff(i,medium)=ff(i,medium)+PZ(medium,j)*aff(i,int(zelem(medium, * j)))**217171 CONTINUE17172 CONTINUE ff(i,medium) = sqrt(ff(i,medium))17161 CONTINUE17162 CONTINUE nff = 100 IF((xgrid(1,medium) .LT. 1e-6))xgrid(1,medium) = 1e-4 write(*,*) '\n -> ', nff, ' atomic ff values computed!' close(ff_unit) emin = exp((1 - ge0(medium))/ge1(medium)) emax = exp((mge(medium) - ge0(medium))/ge1(medium)) call prepare_rayleigh_data(nff,xgrid(1,medium),ff(1,medium), mge(m *edium),emin,emax, pe_array(1,medium),100, fcum(1,medium),i_array(1 *,medium), b_array(1,medium),c_array(1,medium)) ne=MGE(medium) DO 17181 i=1,ne-1 gle = (i - ge0(medium))/ge1(medium) pmax1(i,medium)=(pe_array(i+1,medium)-pe_array(i,medium))*ge1(me * dium) pmax0(i,medium)=pe_array(i,medium)-pmax1(i,medium)*gle17181 CONTINUE17182 CONTINUE pmax0(ne,medium)=pmax0(ne-1,medium) pmax1(ne,medium)=pmax1(ne-1,medium) return end real*8 function egs_rayleigh_sigma(imed,E,ndat,x,f) implicit none integer*4 i, j, k,imed, ndat real*8 hc2,conv,b,hc parameter (hc = 0.0123984768438,hc2=0.0001537222280) real*8 x(100), f(100), zero, E, xmax real*8 x1,x2,pow_x1,pow_x2,raysig,C,C2,f1,f2 C=2.*hc2/(E*E) C2=C*C xmax=E/hc egs_rayleigh_sigma = 0.0 DO 17191 i=1,ndat-1 IF((x(i) .EQ. 0.0))x(i) = zero() IF((x(i+1) .EQ. 0.0))x(i+1) = zero()
![Page 451: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/451.jpg)
IF((f(i) .EQ. 0.0))f(i) = zero() IF((f(i+1) .EQ. 0.0))f(i+1) = zero() b = log(f(i+1)/f(i))/log(x(i+1)/x(i)) x1=x(i) x2=x(i+1) IF ((x2 .GT. xmax)) THEN x2=xmax END IF pow_x1=x1**(2*b) pow_x2=x2**(2*b) raysig = pow_x2*(x2**2/(b+1)-(C*x2**4)/(b+2)+(C2*x2**6)/(2*b+6)) raysig = raysig - pow_x1*(x1**2/(b+1)-(C*x1**4)/(b+2)+(C2*x1**6) * /(2*b+6)) raysig = raysig*f(i)*f(i)/pow_x1 egs_rayleigh_sigma = egs_rayleigh_sigma + raysig IF ((x(i+1).GT.xmax)) THEN GO TO17192 END IF17191 CONTINUE17192 CONTINUE egs_rayleigh_sigma = 0.49893439187842413747*C*egs_rayleigh_sigma return end subroutine egs_rayleigh_sampling(medium,e,gle,lgle,costhe,sinthe) implicit none real*8 e real*8 gle,costhe,sinthe,pmax,xv,xmax,csqthe real*8 rnnray1,rnnray0,hc_i,twice_hc2,dwi parameter(hc_i=80.65506856998,twice_hc2=0.000307444456) integer*4 lgle,ib,ibin,medium, trials common/randomm/ rng_array(128), urndm(97), crndm, cdrndm, cmrndm, *i4opt, ixx, jxx, fool_optimizer, twom24, rng_seed integer*4 urndm, crndm, cdrndm, cmrndm, i4opt, ixx, jxx, fool_opti *mizer,rng_seed,rng_array real*4 twom24 COMMON/rayleigh_sampling/xgrid(100,7), fcum(100,7), b_array(100,7) *, c_array(100,7), i_array(100,7), pmax0(200,7),pmax1(200,7) real*8 xgrid, fcum, b_array, c_array,pmax0, pmax1 integer*4 i_array dwi = 100-1 pmax=pmax1(Lgle,MEDIUM)*gle+pmax0(Lgle,MEDIUM) xmax = hc_i*e17201 CONTINUE IF((rng_seed .GT. 128))call ranmar_get rnnray1 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 117211 CONTINUE IF((rng_seed .GT. 128))call ranmar_get rnnray0 = rng_array(rng_seed)*twom24 rng_seed = rng_seed + 1 rnnray0 = rnnray0*pmax ibin = 1 + rnnray0*dwi ib = i_array(ibin,medium) IF (( i_array(ibin+1,medium) .GT. ib )) THEN17221 CONTINUE IF((rnnray0.LT.fcum(ib+1,medium)))GO TO17222 ib=ib+1 GO TO 17221
![Page 452: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/452.jpg)
17222 CONTINUE END IF rnnray0 = (rnnray0 - fcum(ib,medium))*c_array(ib,medium) xv = xgrid(ib,medium)*exp(log(1+rnnray0)*b_array(ib,medium)) IF(((xv .LT. xmax)))GO TO17212 GO TO 1721117212 CONTINUE xv = xv/e costhe = 1 - twice_hc2*xv*xv csqthe=costhe*costhe IF((( 2*rnnray1 .LT. 1 + csqthe )))GO TO17202 GO TO 1720117202 CONTINUE sinthe=sqrt(1.0-csqthe) return end subroutine prepare_rayleigh_data(ndat,x,f, ne,emin,emax,pe_array, *ncbin,fcum,i_array, b_array,c_array) implicit none integer*4 ndat real*8 x(ndat), f(ndat) integer*4 ne real*8 emin, emax, pe_array(ne) integer*4 ncbin real*8 fcum(ndat) integer*4 i_array(ncbin) real*8 b_array(ndat), c_array(ndat) real*8 zero real*8 sum0,a,b,x1,x2,pow_x1,pow_x2,dle,e,xmax, anorm,anorm1,anorm *2,w,dw,xold,t,aux integer*4 i,j,k,ibin write(*,'(a$)') ' preparing data for Rayleigh sampling ... ' DO 17231 i=1,ndat IF((f(i) .EQ. 0.0))f(i) = zero()17231 CONTINUE17232 CONTINUE sum0=0 fcum(1)=0 DO 17241 i=1,ndat-1 b = log(f(i+1)/f(i))/log(x(i+1)/x(i)) b_array(i) = b x1 = x(i) x2 = x(i+1) pow_x1 = x1**(2*b) pow_x2 = x2**(2*b) sum0=sum0+f(i)*f(i)*(x2*x2*pow_x2-x1*x1*pow_x1)/((1+b)*pow_x1) fcum(i+1) = sum017241 CONTINUE17242 CONTINUE dle = log(emax/emin)/(ne-1) i = 1 DO 17251 j=1,ne e = emin*exp(dle*(j-1)) xmax = 20.607544d0*2*e/0.5110034d0 DO 17261 k=i,ndat-1 IF((xmax .GE. x(k) .AND. xmax .LT. x(k+1)))GO TO1726217261 CONTINUE17262 CONTINUE
![Page 453: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/453.jpg)
i = k b = b_array(i) x1 = x(i) x2 = xmax pow_x1 = x1**(2*b) pow_x2 = x2**(2*b) pe_array(j) = fcum(i) + f(i)*f(i)*(x2*x2*pow_x2-x1*x1*pow_x1)/(( * 1+b)*pow_x1)17251 CONTINUE17252 CONTINUE i_array(ncbin) = i anorm = 1d0/sqrt(pe_array(ne)) anorm1 = 1.005d0/pe_array(ne) anorm2 = 1d0/pe_array(ne) DO 17271 j=1,ne pe_array(j) = pe_array(j)*anorm1 IF((pe_array(j) .GT. 1))pe_array(j) = 117271 CONTINUE17272 CONTINUE DO 17281 j=1,ndat f(j) = f(j)*anorm fcum(j) = fcum(j)*anorm2 c_array(j) = (1+b_array(j))/(x(j)*f(j))**217281 CONTINUE17282 CONTINUE dw = 1d0/(ncbin-1) xold = x(1) ibin = 1 b = b_array(1) pow_x1 = x(1)**(2*b) i_array(1) = 1 DO 17291 i=2,ncbin-1 w = dw17301 CONTINUE x1 = xold x2 = x(ibin+1) t = x1*x1*x1**(2*b) pow_x2 = x2**(2*b) aux=f(ibin)*f(ibin)*(x2*x2*pow_x2-t)/((1+b)*pow_x1) IF (( aux .GT. w )) THEN xold = exp(log(t+w*(1+b)*pow_x1/f(ibin)/f(ibin))/(2+2*b)) i_array(i) = ibin GO TO17302 END IF w = w - aux xold = x2 ibin = ibin+1 b = b_array(ibin) pow_x1 = xold**(2*b) GO TO 1730117302 CONTINUE17291 CONTINUE17292 CONTINUE DO 17311 j=1,ndat b_array(j) = 0.5/(1 + b_array(j))17311 CONTINUE17312 CONTINUE write(*,'(a /)') 'done'
![Page 454: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/454.jpg)
return end real*8 function egs_KN_sigma0(e) implicit none real*8 e real*8 rm,con,ko,c1,c2,c3,eps1,eps2 data rm/0.5110034/,con/0.1274783851/ ko = e/rm IF (( ko .LT. 0.01 )) THEN egs_KN_sigma0 = 8.*con/3.*(1-ko*(2-ko*(5.2-13.3*ko)))/rm return END IF c1 = 1./(ko*ko) c2 = 1. - 2*(1+ko)*c1 c3 = (1+2*ko)*c1 eps2 = 1 eps1 = 1./(1+2*ko) egs_KN_sigma0 = (c1*(1./eps1-1./eps2)+c2*log(eps2/eps1)+eps2*(c3+0 *.5*eps2)- eps1*(c3+0.5*eps1))/e*con return end real*8 function egs_KN_sigma1(e) implicit none real*8 e real*8 rm,con,ko,c1,c2,c3,eps1,eps2 data rm/0.5110034/,con/0.1274783851/ ko = e/rm c1 = 1./(ko*ko) c2 = 1. - 2*(1+ko)*c1 c3 = (1+2*ko)*c1 eps2 = 1 eps1 = 1./(1+2*ko) egs_KN_sigma1 = c1*(1./eps1-1./eps2) egs_KN_sigma1 = egs_KN_sigma1 + log(eps2/eps1)*(c2 - c1) - c2*(eps *2-eps1) egs_KN_sigma1 = egs_KN_sigma1 + c3*(eps2-eps1)*(1-0.5*(eps1+eps2)) egs_KN_sigma1 = egs_KN_sigma1 + (eps2-eps1)*(0.5*(eps1+eps2)-(eps1 **eps1+eps2*eps2+eps1*eps2)/3) egs_KN_sigma1 = egs_KN_sigma1*con return end subroutine egsi_get_data(flag,iunit,n,ne,zsorted,pz_sorted,ge1,ge0 *,data) implicit none common /egs_io/ file_extensions(20), file_units(20), user_code, i *nput_file, output_file, pegs_file, hen_house, egs_home, work_d *ir, host_name, n_parallel, i_parallel, first_parallel, n_max_p *arallel, n_chunk, n_files, i_input, i_log, i_incoh, i_nist_dat *a, i_mscat, i_photo_cs, i_photo_relax, xsec_out, is_batch character input_file*256, output_file*256, pegs_file*256, file_ext *ensions*10, hen_house*128, egs_home*128, work_dir*128, user_code*6 *4, host_name*64 integer*4 n_parallel, i_parallel, first_parallel,n_max_parallel, n *_chunk, file_units, n_files,i_input,i_log,i_incoh, i_nist_data,i_m *scat,i_photo_cs,i_photo_relax, xsec_out logical is_batch real*8 rm,eth integer*4 flag,iunit,n,ne
![Page 455: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/455.jpg)
real*8 ge1,ge0,zsorted(*),pz_sorted(*),data(*) real*8 etmp(2000),ftmp(2000) real*8 gle,sig,p,e integer*4 i,j,k,kk,iz,iz_old,ndat,iiz data rm/0.5110034/ rewind(iunit) iz_old = 0 DO 17321 k=1,n data(k) = 017321 CONTINUE17322 CONTINUE DO 17331 i=1,ne iiz = int(zsorted(i)+0.5) DO 17341 iz=iz_old+1,iiz read(iunit,*,err=17350) ndat IF (( ndat .GT. 2000 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'Too many input data points. Max. is ',2000 write(i_log,'(/a)') '***************** Quiting now.' call exit(1) END IF IF (( flag .EQ. 0 )) THEN read(iunit,*,err=17350) (etmp(k),ftmp(k),k=1,ndat) ELSE read(iunit,*,err=17350) (etmp(k+1),ftmp(k+1), k=1,ndat) IF (( flag .EQ. 1 )) THEN eth = 2*rm ELSE eth = 4*rm END IF ndat = ndat + 1 DO 17361 k=2,ndat ftmp(k) = ftmp(k) - 3*log(1-eth/exp(etmp(k)))17361 CONTINUE17362 CONTINUE ftmp(1) = ftmp(2) etmp(1) = log(eth) END IF17341 CONTINUE17342 CONTINUE iz_old = iiz DO 17371 k=1,n gle = (k - ge0)/ge1 e = exp(gle) IF (( gle .LT. etmp(1) .OR. gle .GE. etmp(ndat) )) THEN IF (( flag .EQ. 0 )) THEN write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'Energy ',exp(gle), ' is outside the availa *ble data range of ', exp(etmp(1)),exp(etmp(ndat)) write(i_log,'(/a)') '***************** Quiting now.' call exit(1) ELSE IF (( gle .LT. etmp(1) )) THEN sig = 0 ELSE sig = exp(ftmp(ndat)) END IF END IF
![Page 456: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/456.jpg)
ELSE DO 17381 kk=1,ndat-1 IF((gle .GE. etmp(kk) .AND. gle .LT. etmp(kk+1)))GO TO1738 * 217381 CONTINUE17382 CONTINUE p = (gle - etmp(kk))/(etmp(kk+1) - etmp(kk)) sig = exp(p*ftmp(kk+1) + (1-p)*ftmp(kk)) END IF IF((flag .NE. 0 .AND. e .GT. eth))sig = sig*(1-eth/e)**3 data(k) = data(k) + pz_sorted(i)*sig17371 CONTINUE17372 CONTINUE17331 CONTINUE17332 CONTINUE return17350 CONTINUE write(i_log,'(/a)') '***************** Error: ' write(i_log,*) 'Error while reading user photon cross sections fro *m unit ', iunit write(i_log,'(/a)') '***************** Quiting now.' call exit(1) return end subroutine egs_heap_sort(n,rarray,jarray) implicit none integer*4 n,jarray(*) real*8 rarray(*) integer*4 i,ir,j,l,ira real*8 rra DO 17391 i=1,n jarray(i)=i17391 CONTINUE17392 CONTINUE IF((n .LT. 2))return l=n/2+1 ir=n17401 CONTINUE IF ((l .GT. 1)) THEN l=l-1 rra=rarray(l) ira=l ELSE rra=rarray(ir) ira=jarray(ir) rarray(ir)=rarray(1) jarray(ir)=jarray(1) ir=ir-1 IF ((ir .EQ. 1)) THEN rarray(1)=rra jarray(1)=ira return END IF END IF i=l j=l+l17411 CONTINUE IF((j .GT. ir))GO TO17412
![Page 457: f01.justanswer.com · Web view2013/03/27 · Copyright National Research Council of Canada, 2000.! All rights reserved.! Copyright National Research Council of Canada, Ottawa,! BEAM](https://reader033.vdocument.in/reader033/viewer/2022052309/5b0273da7f8b9ad85d8f91d4/html5/thumbnails/457.jpg)
IF ((j .LT. ir)) THEN IF((rarray(j) .LT. rarray(j+1)))j=j+1 END IF IF ((rra .LT. rarray(j))) THEN rarray(i)=rarray(j) jarray(i)=jarray(j) i=j j=j+j ELSE j=ir+1 END IF GO TO 1741117412 CONTINUE rarray(i)=rra jarray(i)=ira GO TO 1740117402 CONTINUE return end ! Copyright National Research Council of Canada, 2000. ! All rights reserved.