subroutine initialize ( ) !***************************************************************************** !! INITIALIZE is the initialization procedure. !***************************************************************************** use simulation use scattering use particles implicit none ! Read the input sample containing the initial particle coordinates and parameters. integer :: nAlBin call read_sample() do nAlBin = 1, num_BinsForAl+1 call sc_table(nAlBin) enddo call initial_printout() ! Phonon Simulation if (PhononSim.ne.0) then ! PhononSim. 3 ... three steps.. call initial_PhononSimulation() if (PhononSim.ne.3) then call initial_PhononTdis() endif endif if (Use_prerun.ne.0) then call PRInitialDist(num_BinsForAl+1) call PreRunBulk(num_BinsForAl+1) if (num_BinsForAl.ne.0) then call PRInitialDist(num_BinsForAl) call PreRunBulk(num_BinsForAl) ! Prerun Bulk 0615 endif endif call initial_distribution() ! Print information on the run on the standard output file. return end subroutine read_sample () ! parameter setting use simulation use scattering use particles implicit none real ( kind = 8 ) :: int_temp, TempAddEneY character ( len = 80 ) :: temp character ( len = 80 ) :: Jobname integer :: i, j, p, q !, notrough ! Now that we know the system size, we can dynamically allocate the arrays containing atomic informations open ( unit = 1, file = 'input.txt', status = 'old', action = 'read', err = 600 ) read(1,*,end=800,err=900) temp read(1,*,end=800,err=900) PrintoutPhonon, PrintoutPartProp, PrintoutXYZ, PrintoutHist, PrintoutScatRate read(1,*,end=600,err=900) num_EnergyLevel, num_Carriers, num_maxCarriers, step_output1, step_output2, Algo_bcCheck, BothSideCheck, num_bcCheckBin, num_CheckFreq, PropertyNode read(1,*,end=600,err=900) num_InjLB, num_InjRB, BCPos_factor, BCEne_factor, num_InitBin, num_InitNode, PoissonSetting, Algo_AssignCharge, Algo_PoiFieldAssign, UpdatePoiField, Step_FreqFieldUpdate, time_Poisson read(1,*,end=600,err=900) BarrierCLM, PhononSim, LOmodeOccPhonSim, BCoption, Use_prerun, PRParNum, PRtime_max, PRtime_early, TimePreLMax read(1,*,end=600,err=900) QuasiSdotMode, QuasiBoundConsid, GivenQsupply, PreLoopSpeed,QuasiTimeStep,QuasiTimeMax,MaxTempChange, HotPhononFactor read(1,*,end=600,err=900) TempUpdateFreq, qsupply, TpA_Hot, TpA_Cold, TpO_Hot, TpO_Cold, k_pA, k_pO, MatElement, RepresentEpLO,ExternalResAP,ExternalResOP ! add 11/2012 read(1,*,end=600,err=900) num_boundBin,BoundQSetting, T_room, APTableTempLow, APTableTempHigh, num_APTable, num_APmidCheck, APParaCapRT, APParaCapZ, APParaBeta ! add more read(1,*,end=600,err=900) PolarOpticalTest,polar_L,polar_X,IonImpurity_Scat_G,IonImpurity_Scat_L,IonImpurity_Scat_X,Alloy_Scat_G,Alloy_Scat_L,Alloy_Scat_X read(1,*,end=600,err=900) acoustic_G,acoustic_L,acoustic_X,intervalley_G_L,intervalley_G_X,intervalley_L_G,intervalley_L_L,intervalley_L_X,intervalley_X_G,intervalley_X_L,intervalley_X_X read(1,*,end=600,err=900) Te, Tp, Tsys, time_max, time_step, time_early, time_fave, MaxE_eV, StepE_eV, ParCharge read(1,*,end=600,err=900) EFieldBg(1:3), vel_InitBias, n_d, n_i read(1,*,end=600,err=900) acou_sigma_G,acou_sigma_L,acou_sigma_X,AlloyPotDiff,eq_valleys_G,eq_valleys_L,eq_valleys_X read(1,*,end=600,err=900) DefPot_G_L,DefPot_G_X,DefPot_L_G,DefPot_L_L,DefPot_L_X,DefPot_X_G,DefPot_X_L,DefPot_X_X read(1,*,end=600,err=900) polar_Ep_G, polar_Ep_L, polar_Ep_X, IntVal_Ep_G_L, IntVal_Ep_G_X, IntVal_Ep_L_G, IntVal_Ep_L_L, IntVal_Ep_L_X, IntVal_Ep_X_G, IntVal_Ep_X_L, IntVal_Ep_X_X read(1,*,end=800,err=900) temp read(1,*,end=600,err=900) box_coor(1:2,1),box_coor(1:2,2),box_coor(1:2,3),box_len(1:DIM) read(1,*,end=600,err=900) InitialPosDist,num_Nodes,num_Bins,num_BarTros,num_FieldSec,PotentialGain !Tro_Depth, allocate ( loc_Bar(num_BarTros) ) ! allocate ( loc_Tro(num_BarTros) ) allocate ( Bar_Height(num_BarTros) ) allocate ( loc_Start_Field(num_FieldSec) ) allocate ( loc_End_Field(num_FieldSec) ) allocate ( Field_Sec(num_FieldSec) ) allocate ( loc_Node(num_Nodes+1) ) allocate ( pot_Node(num_Nodes+1) ) allocate ( charge_Node(num_Nodes+1) ) allocate ( num_Node(num_Nodes+1) ) allocate ( field_Node(num_Nodes+1) ) allocate ( InitPot_Node(num_Nodes+1) ) allocate ( TA_Node_Potential(num_Nodes+1) ) allocate ( TA_Node_PoiPot(num_Nodes+1) ) allocate ( TA_Node_Charge(num_Nodes+1) ) allocate ( TA_Node_EField(num_Nodes+1) ) if (PropertyNode.eq.1) then ! properties Node center or Bin setting num_Bins = num_Nodes+1 endif allocate ( loc_bin(num_Bins) ) allocate ( bin_ParNumDen(num_Bins) ) allocate ( bin_ParNumber(num_Bins) ) allocate ( bin_ParAveEne(num_Bins) ) allocate ( bin_ParAveEneV(num_Bins) ) allocate ( bin_ParDrftVel(num_Bins) ) allocate ( bin_ParVal(num_Valley,num_Bins) ) allocate ( initbin_ParAveEne(num_Bins) ) allocate ( TA_bin_ParNumDen(num_Bins) ) allocate ( TA_bin_ParNumber(num_Bins) ) allocate ( TA_bin_ParAveEne(num_Bins) ) allocate ( TA_bin_ParDrftVel(num_Bins) ) allocate ( TA_bin_ParVal(num_Valley,num_Bins) ) allocate ( binhist_ParNumber(num_Bins,num_EnergyLevel) ) allocate ( TA_binhist_ParNumber(num_Bins,num_EnergyLevel) ) allocate ( binhist_ParNumDen(num_Bins,num_EnergyLevel) ) allocate ( TA_binhist_ParNumDen(num_Bins,num_EnergyLevel) ) if (BothSideCheck.lt.3) then allocate ( Deficiency_bin(num_bcCheckBin) ) ! bc check... else allocate ( Deficiency_bin(2*num_bcCheckBin) ) ! bc check... endif box_coor(1:2,1:DIM)= box_coor(1:2,1:DIM)*1.0d-9 box_len(1:DIM)= box_len(1:DIM)*1.0d-9 FieldAppRegion(1:2) = FieldAppRegion(1:2)*1.0d-9 if (num_BarTros.ge.1) then do i = 1, num_BarTros read(1,*,end=800,err=900) loc_Bar(i), Bar_Height(i) loc_Bar(i) = loc_Bar(i)*1.0d-9 ! loc_Tro(i) = loc_Tro(i)*1.0d-9 enddo endif if (num_FieldSec.ge.1) then do i = 1, num_FieldSec read(1,*,end=800,err=900) loc_Start_Field(i), loc_End_Field(i), Field_Sec(i) loc_Start_Field(i) = loc_Start_Field(i)*1.0d-9 loc_End_Field(i) = loc_End_Field(i)*1.0d-9 ! enddo endif ! Al Content Variation 08/16/2013 read(1,*,end=600,err=900) AlContVary,num_BinsForAl,BinLengthForAl,loc_Start_Al,loc_End_Al,DefaultAlContent,Default_rho_GaAs,Default_eps_high,Default_eps_low read(1,*,end=600,err=900) Default_split_L_G,Default_split_X_G,rel_eff_mass(1:num_Valley),nonParaParameter(1:num_Valley),Default_u_sound,Default_primV if (AlContVary.ne.1) then num_BinsForAl = 0 endif allocate ( Al_Dist_Content(num_BinsForAl+1) ) allocate ( Al_rho_GaAs(num_BinsForAl+1) ) allocate ( Al_eps_high(num_BinsForAl+1) ) allocate ( Al_eps_low(num_BinsForAl+1) ) allocate ( Al_split_L_G(num_BinsForAl+1) ) allocate ( Al_split_X_G(num_BinsForAl+1) ) allocate ( Al_rel_eff_massG(num_BinsForAl+1) ) allocate ( Al_rel_eff_massL(num_BinsForAl+1) ) allocate ( Al_rel_eff_massX(num_BinsForAl+1) ) allocate ( Al_nonPara_G(num_BinsForAl+1) ) ! if (AlContVary.eq.1) then allocate ( Al_u_sound(num_BinsForAl+1) ) allocate ( Al_primV(num_BinsForAl+1) ) do i = 1, num_BinsForAl+1 read(1,*,end=800,err=900) Al_Dist_Content(i),Al_rho_GaAs(i),Al_eps_high(i),Al_eps_low(i),Al_split_L_G(i),Al_split_X_G(i), Al_rel_eff_massG(i),Al_rel_eff_massL(i),Al_rel_eff_massX(i),Al_nonPara_G(i),Al_u_sound(i),Al_primV(i) enddo echbar = e_c/hbar ! if (AlContVary.ne.1) then ! Add 08/2013 for Al Content Var num_BinsForAl = 0 endif allocate ( nBin_eps_high(num_BinsForAl+1) ) allocate ( nBin_eps_low(num_BinsForAl+1) ) allocate ( eff_mass(num_BinsForAl+1,num_Valley) ) allocate ( nonParabolPara(num_BinsForAl+1,num_Valley) ) allocate ( nonParabolPara2(num_BinsForAl+1,num_Valley) ) allocate ( nonParabolPara4(num_BinsForAl+1,num_Valley) ) allocate ( semh(num_BinsForAl+1,num_Valley) ) allocate ( hhem(num_BinsForAl+1,num_Valley) ) allocate ( tau_max(num_BinsForAl+1,num_Valley) ) allocate ( Debye_length(num_BinsForAl+1) ) allocate ( Energy_debye(num_BinsForAl+1,num_Valley) ) allocate ( DebyeEps(num_BinsForAl+1,num_Valley) ) Te_eV = Te*kB/e_c Tp_eV = Tp*kB/e_c Tsys_eV = Tsys*kB/e_c do i = 1, num_BinsForAl+1 ! if (AlContVary.eq.1) then nBin_eps_high(i) = Al_eps_high(i)*eps_o ! Add 08/2013 for Al Content Var nBin_eps_low(i) = Al_eps_low(i)*eps_o eff_mass(i,1) = m_e*Al_rel_eff_massG(i) eff_mass(i,2) = m_e*Al_rel_eff_massL(i) eff_mass(i,3) = m_e*Al_rel_eff_massX(i) nonParabolPara(i,1) = Al_nonPara_G(i) nonParabolPara2(i,1) = 2.*Al_nonPara_G(i) nonParabolPara4(i,1) = 4.*Al_nonPara_G(i) Debye_length(i) = sqrt(nBin_eps_high(i)*Te_eV/e_c/n_d) ! Add 10/2013 do j = 1,num_Valley semh(i,j)=sqrt(2.*eff_mass(i,j))*sqrt(e_c)/hbar hhem(i,j)=hbar/eff_mass(i,j)/e_c*hbar/2. ! hbar*hbar/(eff_mass(i)*e_c*2.) ! ImpurityConst(j) = N_d*e_c*e_c*e_c*e_c/(16*sqrt(2.*eff_mass(j))*pi*eps_high*eps_high); ! Energy_debye(i,j) = hhem(i,j)/Debye_length(i)/Debye_length(i) ! Add 10/2013 Energy_debye(i,j) = n_d*e_c*e_c*e_c*e_c/(16*sqrt(2.*eff_mass(i,j))*pi*nBin_eps_high(i)*nBin_eps_high(i)) DebyeEps(i,j) = hhem(i,j)/Debye_length(i)/Debye_length(i) ! Add 10/2013 enddo enddo ! endif do i = 1, (num_BinsForAl+1) do j = 2,num_Valley nonParabolPara(i,j) = nonParaParameter(j) nonParabolPara2(i,j) = 2.*nonParaParameter(j) nonParabolPara4(i,j) = 4.*nonParaParameter(j) enddo enddo ! For Poisson NodeSize = box_len(1)/real(num_Nodes,kind = 8) ! Node size num_Nodes = num_Nodes+1 TempAddEneY = 0 do i = 1, num_Nodes loc_Node(i) = box_coor(1,1) + real(i,kind = 8)*NodeSize - NodeSize ! bin center position pot_Node(i) = 0.0d0 ! additional Charge charge_Node(i) = 0.0d0 ! initial .. doping concentration field_Node(i) = 0.0d0 num_Node(i) = real(num_InitNode,kind = 8) if (num_BarTros.ge.1) then do j = 1, num_BarTros if (loc_Node(i).ge.loc_Bar(j)) then TempAddEneY = TempAddEneY + Bar_Height(j) endif enddo endif if (num_FieldSec.ge.1) then if (loc_Node(i).lt.loc_Start_Field(1)) then TempAddEneY = TempAddEneY + (loc_Node(i)-box_coor(1,1))*EFieldBg(1) else TempAddEneY = TempAddEneY + (loc_Start_Field(1)-box_coor(1,1))*EFieldBg(1) do j = 1, num_FieldSec if (loc_Node(i).ge.loc_Start_Field(j)) then if (loc_Node(i).ge.loc_End_Field(j)) then TempAddEneY = TempAddEneY + (loc_End_Field(j)-loc_Start_Field(j))*Field_Sec(j) else TempAddEneY = TempAddEneY + (loc_Node(i)-loc_Start_Field(j))*Field_Sec(j) endif endif enddo if (loc_Node(i).gt.loc_End_Field(num_FieldSec)) then TempAddEneY = TempAddEneY + (loc_Node(i)-loc_End_Field(num_FieldSec))*EFieldBg(1) endif endif else TempAddEneY = TempAddEneY + (loc_Node(i)-box_coor(1,1))*EFieldBg(1) endif InitPot_Node(i) = TempAddEneY enddo ! loc_Node, pot_Node, charge_Node ChargeForPoisson = n_d/real(num_InitNode,kind = 8) if (PropertyNode.eq.1) then ! Use the node positions for the centers of property bins BinSize = NodeSize num_InitBin = num_InitNode do i = 1, num_Nodes loc_bin(i) = loc_Node(i) enddo ! loc_Node, pot_Node, charge_Node else BinSize = box_len(1)/real(num_Bins,kind = 8) ! BinSize ! num_InitBin = int(num_Carriers/num_Bins) ! initial particle number do i = 1, num_Bins loc_bin(i) = box_coor(1,1) + real(i,kind = 8)*BinSize - BinSize*0.5d0 ! bin center position enddo endif allocate ( scatt_table(num_BinsForAl+1,num_EnergyLevel,num_ScatMech,num_Valley) ) ! Al Content Variation Add 08/2013 allocate ( ren_scatt_table(num_BinsForAl+1,num_EnergyLevel,num_ScatMech,num_Valley) ) allocate ( Par_wvk(num_maxCarriers,DIM) ) allocate ( Par_pos(num_maxCarriers,DIM) ) allocate ( Par_vel(num_maxCarriers,DIM) ) allocate ( Par_use(num_maxCarriers) ) allocate ( Par_valley(num_maxCarriers) ) allocate ( Par_ene(num_maxCarriers) ) allocate ( Par_tau(num_maxCarriers) ) allocate ( Par_Al(num_maxCarriers) ) allocate ( RelCumFreqDist(num_BinsForAl+1,num_EnergyLevel) ) allocate ( FreqDist(num_BinsForAl+1,num_EnergyLevel) ) allocate ( CumFreqDist(num_BinsForAl+1,num_EnergyLevel) ) allocate ( TotEneValley(num_Valley) ) allocate ( AveEneValley(num_Valley) ) allocate ( TimeAveEneValley(num_Valley) ) allocate ( FreqValley(num_Valley) ) allocate ( RelFreqValley(num_Valley) ) allocate ( TimeFreqValley(num_Valley) ) allocate ( TimeRelFreqValley(num_Valley) ) allocate ( AveParValleyVel(num_Valley,DIM) ) allocate ( TimeAveParValleyVel(num_Valley,DIM) ) allocate ( EneLevelHist(num_EnergyLevel) ) allocate ( RelEneLevelHist(num_EnergyLevel) ) allocate ( TimeRelEneLevelHist(num_EnergyLevel) ) allocate ( EneLevelValleyHist(num_Valley,num_EnergyLevel) ) allocate ( RelEneLevelValleyHist(num_Valley,num_EnergyLevel) ) allocate ( TimeRelEneLevelValleyHist(num_Valley,num_EnergyLevel) ) ! Prerun Bulk 0615 allocate ( PreRun_Par_wvk(PRParNum,DIM) ) allocate ( PreRun_Par_vel(PRParNum,DIM) ) allocate ( PreRun_Par_valley(PRParNum) ) allocate ( PreRun_Par_ene(PRParNum) ) allocate ( PreRun_Par_tau(PRParNum) ) allocate ( PRValley(num_Valley) ) PreRun_Par_wvk(:,:) = 0.0d0 PreRun_Par_vel(:,:) = 0.0d0 PreRun_Par_valley(:) = 0 PreRun_Par_ene(:) = 0.0D+00 PreRun_Par_tau(:) = 0.0D+00 PRValley(:) = 0.0 ! phonon absorption emission 0709 allocate ( BinScatCount(num_Bins,num_ScatMech,num_Valley) ) allocate ( TA_bin_PhononEne(num_Bins) ) allocate ( TA_bin_PhononEneWm(num_Bins) ) allocate ( TA_bin_PhononNum(num_Bins) ) ! Phonon Simulation 11/2012 allocate ( TempVar_BinScatCount(num_Bins,num_ScatMech,num_Valley) ) allocate ( Bin_TemperAP(num_Bins) ) allocate ( Bin_TemperOP(num_Bins) ) allocate ( Bin_OccupOP(num_Bins) ) allocate ( BinQsupA(num_Bins) ) allocate ( BinQsupO(num_Bins) ) allocate ( BinQsupTotal(num_Bins) ) allocate ( BinOPEne(num_Bins) ) allocate ( BinAPEne(num_Bins) ) allocate ( epInterEneWm2(num_Bins) ) allocate ( ppInterEneWm2(num_Bins) ) ! Preloop And Quasi ,,,,, allocate ( PreLoop_Bin_OccupAP(num_Bins) ) allocate ( PreLoop_Bin_OccupOP(num_Bins) ) allocate ( PreLoop_A_Bin_vel(num_Bins) ) allocate ( PreLoop_A_Bin_eNum(num_Bins) ) allocate ( PreLoop_Bin_EpLO(num_Bins) ) allocate ( PreLoop_Bin_EpLOWm2(num_Bins) ) allocate ( PreLoop_Bin_EpLOWm3(num_Bins) ) allocate ( PreLoop_Bin_EpTO(num_Bins) ) allocate ( PreLoop_Bin_EpTOWm2(num_Bins) ) allocate ( PreLoop_Bin_EpTOWm3(num_Bins) ) allocate ( PreLoop_Bin_EpO(num_Bins) ) allocate ( PreLoop_Bin_EpOWm2(num_Bins) ) allocate ( PreLoop_Bin_EpOWm3(num_Bins) ) allocate ( Quasi_peLOWm2(num_Bins) ) allocate ( Quasi_peTOWm2(num_Bins) ) allocate ( Quasi_peOWm2(num_Bins) ) allocate ( Quasi_ppUpWm2(num_Bins) ) allocate ( TABin_TemperAP(num_Bins) ) allocate ( TABin_TemperOP(num_Bins) ) allocate ( TABinQsupA(num_Bins) ) allocate ( TABinQsupO(num_Bins) ) allocate ( TABinQsupTotal(num_Bins) ) allocate ( TAepInterEneWm2(num_Bins) ) allocate ( TAppInterEneWm2(num_Bins) ) allocate ( fave_bin_TpA(num_Bins) ) allocate ( fave_bin_TpO(num_Bins) ) allocate ( fave_bin_qsupA(num_Bins) ) allocate ( fave_bin_qsupO(num_Bins) ) allocate ( fave_bin_qsupT(num_Bins) ) allocate ( fave_bin_epWm2(num_Bins) ) allocate ( fave_bin_ppWm2(num_Bins) ) allocate ( Tfave_bin_TpA(num_Bins) ) allocate ( Tfave_bin_TpO(num_Bins) ) allocate ( Tfave_bin_qsupA(num_Bins) ) allocate ( Tfave_bin_qsupO(num_Bins) ) allocate ( Tfave_bin_qsupT(num_Bins) ) allocate ( Tfave_bin_epWm2(num_Bins) ) allocate ( Tfave_bin_ppWm2(num_Bins) ) Bin_TemperAP(:) = 0.0d0 Bin_TemperOP(:) = 0.0d0 Bin_OccupOP(:) = 0.0d0 BinQsupA(:) = 0.0d0 BinQsupO(:) = 0.0d0 BinQsupTotal(:) = 0.0d0 BinAPEne(:) = 0.0d0 BinOPEne(:) = 0.0d0 epInterEneWm2(:) = 0.0d0 ppInterEneWm2(:) = 0.0d0 TABin_TemperAP(:) = 0.0d0 TABin_TemperOP(:) = 0.0d0 TABinQsupA(:) = 0.0d0 TABinQsupO(:) = 0.0d0 TABinQsupTotal(:) = 0.0d0 TAepInterEneWm2(:) = 0.0d0 TAppInterEneWm2(:) = 0.0d0 fave_bin_TpA(:) = 0.0d0 fave_bin_TpO(:) = 0.0d0 fave_bin_qsupA(:) = 0.0d0 fave_bin_qsupO(:) = 0.0d0 fave_bin_qsupT(:) = 0.0d0 fave_bin_epWm2(:) = 0.0d0 fave_bin_ppWm2(:) = 0.0d0 Tfave_bin_TpA(:) = 0.0d0 Tfave_bin_TpO(:) = 0.0d0 Tfave_bin_qsupA(:) = 0.0d0 Tfave_bin_qsupO(:) = 0.0d0 Tfave_bin_qsupT(:) = 0.0d0 Tfave_bin_epWm2(:) = 0.0d0 Tfave_bin_ppWm2(:) = 0.0d0 allocate ( CombBin(num_BinsForAl+1,num_Bins) ) ! CombBin call CombBinAssign() allocate ( TempVar_tau_max(num_BinsComb,num_Valley) ) allocate ( acou_constTemp(num_BinsForAl+1,num_Valley,num_EnergyLevel) ) allocate ( alloy_constTemp(num_BinsForAl+1,num_Valley,num_EnergyLevel) ) allocate ( impurity_constTemp(num_BinsForAl+1,num_Valley,num_EnergyLevel) ) allocate ( polarAb_constTemp(num_BinsForAl+1,num_Valley,num_EnergyLevel) ) allocate ( polarEm_constTemp(num_BinsForAl+1,num_Valley,num_EnergyLevel) ) allocate ( ivAb_constTemp(num_BinsForAl+1,num_Valley,num_Valley,num_EnergyLevel) ) allocate ( ivEm_constTemp(num_BinsForAl+1,num_Valley,num_Valley,num_EnergyLevel) ) allocate ( TempVar_scat_table(num_BinsComb,num_EnergyLevel,num_ScatMech,num_Valley) ) allocate ( TempVar_renscat_table(num_BinsComb,num_EnergyLevel,num_ScatMech,num_Valley) ) TempVar_tau_max(:,:) = 0 acou_constTemp(:,:,:) = 0 alloy_constTemp(:,:,:) = 0 impurity_constTemp(:,:,:) = 0 polarAb_constTemp(:,:,:) = 0 polarEm_constTemp(:,:,:) = 0 ivAb_constTemp(:,:,:,:) = 0 ivEm_constTemp(:,:,:,:) = 0 TempVar_scat_table(:,:,:,:) = 0 TempVar_renscat_table(:,:,:,:) = 0 ! 0720 Initial_je = n_d*vel_InitBias*e_c*0.0001 DerivedCellV = num_Carriers/n_d allocate ( fave_bin_eNum(num_Bins) ) allocate ( fave_bin_vel(num_Bins) ) allocate ( fave_bin_PhonEWm(num_Bins) ) allocate ( fave_bin_PoiPot(num_Bins) ) allocate ( fave_bin_AllPot(num_Bins) ) allocate ( fave_bin_Eneev(num_Bins) ) allocate ( Tfave_bin_eNum(num_Bins) ) allocate ( Tfave_bin_vel(num_Bins) ) allocate ( Tfave_bin_PhonEWm(num_Bins) ) allocate ( Tfave_bin_PoiPot(num_Bins) ) allocate ( Tfave_bin_AllPot(num_Bins) ) allocate ( Tfave_bin_Eneev(num_Bins) ) time_fave_period = 0.0 Tfave_InOut_B = 0.0 Tfave_InOut_LB = 0.0 Tfave_InOut_RB = 0.0 Tfave_G_ratio = 0.0 Tfave_bin_eNum(:) = 0.0 Tfave_bin_vel(:) = 0.0 Tfave_bin_PhonEWm(:) = 0.0 Tfave_bin_PoiPot(:) = 0.0 Tfave_bin_AllPot(:) = 0.0 Tfave_bin_Eneev(:) = 0.0 ! initialize max_scat = 0.0 flag_mech(:,:) = 0 Par_wvk(:,:) = 0.0d0 Par_pos(:,:) = 0.0d0 Par_vel(:,:) = 0.0d0 Par_valley(:) = 0 Par_use(:) = 0 Par_Al(:) = 0 Par_ene(:) = 0.0D+00 Par_tau(:) = 0.0D+00 scatt_table(:,:,:,:) = 0.0D+00 ren_scatt_table(:,:,:,:) = 0.0D+00 flag_mech(:,:) = 0 E_change(:,:) = 0.0d0 i_valley(:,:) = 0 ScatMechFreq(:,:) = 0 tau_max(:,:) = 0.0d0 max_scat = 0.0d0 ! Temp_pos(:) = 0.0d0 ParCharge = 1.0 ! Fermilevel calculation E_F = kB*Te*log(n_d/n_i)/e_c-0.674 InjParPerStep = vel_InitBias*time_step*real(num_Carriers,kind = 8)/box_len(1) ! BinSize = box_len(1) Initialnum_Carriers = num_Carriers call RandomNumGen() ! Random.. ! Compute volume and density ! do i = 1, DIM ! box_len(i) = box_coor(2,i) - box_coor(1,i) ! end do ! volume = product(box_len(:)) ! density = real ( NTYPE(4), kind = 8 ) / volume ! Temp_o = ep_o/kB close ( unit = 1 ) return ! Handling of various kinds of errors 600 continue print*,'Read_Sample: FATAL: input.txt is empty?' stop 700 continue print*,'Read_Sample: FATAL: input.txt not found.' stop 800 continue print*,'Read_Sample: FATAL: premature end-of-file at atom ',i close(unit=1) stop 900 continue print*,'Read_Sample: FATAL: read error in input.txt' close(unit=1) stop end subroutine initial_printout ( ) use simulation use scattering use particles implicit none integer :: i open ( unit = 2, file = 'TimePointEneFreq.txt', status = 'replace', action = 'write', err = 610 ) open ( unit = 3, file = 'TimeAveEneFreq.txt', status = 'replace', action = 'write', err = 610 ) open ( unit = 4, file = 'TimePointVel.txt', status = 'replace', action = 'write', err = 610 ) open ( unit = 5, file = 'TimeAveVel.txt', status = 'replace', action = 'write', err = 610 ) if (PrintoutPartProp.eq.1) then ! 0709 open ( unit = 6, file = 'ParticlesForTime.txt', status = 'replace', action = 'write', err = 620 ) endif open ( unit = 7, file = 'PointEnergyHist.txt', status = 'replace', action = 'write', err = 620 ) open ( unit = 15, file = 'TimeAveEnergyHist.txt', status = 'replace', action = 'write', err = 620 ) open ( unit = 17, file = 'TimeEneCurrInOut.txt', status = 'replace', action = 'write' ) open ( unit = 18, file = 'TimeParInOut.txt', status = 'replace', action = 'write' ) if (PrintoutHist.eq.1) then ! 0709 open ( unit = 19, file = 'TimeBinDenHist.txt', status = 'replace', action = 'write' ) open ( unit = 20, file = 'TimeBinNumHist.txt', status = 'replace', action = 'write' ) endif open ( unit = 23, file = 'TimeBinNum.txt', status = 'replace', action = 'write' ) open ( unit = 24, file = 'TimeBinDen.txt', status = 'replace', action = 'write' ) open ( unit = 25, file = 'TimeBinEne.txt', status = 'replace', action = 'write' ) open ( unit = 26, file = 'TimeBinValG.txt', status = 'replace', action = 'write' ) open ( unit = 27, file = 'TimeBinValL.txt', status = 'replace', action = 'write' ) open ( unit = 28, file = 'TimeBinValX.txt', status = 'replace', action = 'write' ) open ( unit = 34, file = 'TimeBinDrftVel.txt', status = 'replace', action = 'write' ) if (PrintoutXYZ.eq.1) then ! 0709 open ( unit = 35, file = 'TimeSimulation.xyz', status = 'replace', action = 'write' ) endif if (PrintoutPhonon.eq.1) then ! 0709 open ( unit = 36, file = 'TimeBinPhononE.txt', status = 'replace', action = 'write' ) open ( unit = 37, file = 'TimeBinPhononN.txt', status = 'replace', action = 'write' ) open ( unit = 40, file = 'TimeBinPhononEWm.txt', status = 'replace', action = 'write' ) open ( unit = 38, file = 'TimeAllPhononEne.txt', status = 'replace', action = 'write' ) open ( unit = 39, file = 'TimeAllPhononNum.txt', status = 'replace', action = 'write' ) endif if (PoissonSetting.eq.1) then open ( unit = 12, file = 'TimeNodePotential.txt', status = 'replace', action = 'write' ) open ( unit = 13, file = 'TimeNodePoiPot.txt', status = 'replace', action = 'write' ) open ( unit = 14, file = 'TimeNodeCharge.txt', status = 'replace', action = 'write' ) open ( unit = 30, file = 'TimeNodeField.txt', status = 'replace', action = 'write' ) endif if (PhononSim.ne.0) then ! Phonon simulation 11/2012 open ( unit = 46, file = 'TimeBinTpA.txt', status = 'replace', action = 'write' ) open ( unit = 47, file = 'TimeBinTpO.txt', status = 'replace', action = 'write' ) open ( unit = 48, file = 'TimeBinqpA.txt', status = 'replace', action = 'write' ) open ( unit = 49, file = 'TimeBinqpO.txt', status = 'replace', action = 'write' ) open ( unit = 50, file = 'TimeBinqpT.txt', status = 'replace', action = 'write' ) open ( unit = 51, file = 'TimeBinEP.txt', status = 'replace', action = 'write' ) open ( unit = 52, file = 'TimeBinPP.txt', status = 'replace', action = 'write' ) endif return ! Handling of various kinds of errors 610 continue print*,'FATAL: Error in Output.xyz.' stop 620 continue print*,'FATAL: Error in ParticlesForTime.txt' stop 630 continue print*,'Read_Sample: FATAL: premature end-of-file at atom ',i stop 640 continue print*,'Read_Sample: FATAL: read error in input.txt' stop end ! nBin_eps_high(num_BinsForAl+1) = Default_eps_high*eps_o ! nBin_eps_low(num_BinsForAl+1) = Default_eps_low*eps_o ! eff_mass(num_BinsForAl+1,1) = m_e*Default_rel_eff_massG ! eff_mass(num_BinsForAl+1,2) = m_e*Default_rel_eff_massL ! eff_mass(num_BinsForAl+1,3) = m_e*Default_rel_eff_massX ! nonParabolPara(num_BinsForAl+1,1) = Default_nonPara_G ! nonParabolPara2(num_BinsForAl+1,1) = 2.*Default_nonPara_G ! nonParabolPara4(num_BinsForAl+1,1) = 4.*Default_nonPara_G ! do i = 1,num_Valley ! semh(num_BinsForAl+1,i)=sqrt(2.*eff_mass(num_BinsForAl+1,i))*sqrt(e_c)/hbar ! hhem(num_BinsForAl+1,i)=hbar/eff_mass(num_BinsForAl+1,i)/e_c*hbar/2. ! hbar*hbar/(eff_mass(i)*e_c*2.) ! enddo