22 character(len=30) :: form =
''
24 character(len=200) :: datafile =
''
27 logical :: is_vecpot = .false.
30 real(
dp) :: intensity_wcm2 = 0.d0
32 real(
dp) :: lambda_nm = 0.d0
34 real(
dp) :: peak_time_as = 0.d0
42 real(
dp) :: duration_as = 0.d0
44 real(
dp) :: rampon_as = 0.d0
46 real(
dp) :: phase_pi = 0.d0
48 real(
dp) :: form_exponent = 1.d0
54 real(
dp) :: linear_chirp_rate_w0as = 0.d0
60 real(
dp) :: omega = 0.d0
64 real(
dp) :: peak_time = 0.d0
66 real(
dp) :: duration = 0.d0
68 real(
dp) :: rampon = 0.d0
73 real(
dp),
dimension(:),
allocatable :: tt, ee, aa, zz
83 module procedure make_laserfield_params
84 module procedure make_laserfield_datafile
86 private :: make_laserfield_params, make_laserfield_datafile
90 module procedure laserfields_get_el
91 module procedure lf_get_el
93 private :: laserfields_get_el, lf_get_el
97 module procedure laserfields_get_al
98 module procedure lf_get_al
100 private :: laserfields_get_al, lf_get_al
105 module procedure laserfields_get_el_posfreq
106 module procedure lf_get_el_posfreq
108 private :: laserfields_get_el_posfreq, lf_get_el_posfreq
113 module procedure laserfields_get_al_posfreq
114 module procedure lf_get_al_posfreq
116 private :: laserfields_get_al_posfreq, lf_get_al_posfreq
120 module procedure laserfields_get_zl
121 module procedure lf_get_zl
123 private :: laserfields_get_zl, lf_get_zl
127 module procedure laserfields_get_el_fourier_transform
128 module procedure lf_get_el_fourier_transform
130 private :: laserfields_get_el_fourier_transform, lf_get_el_fourier_transform
134 module procedure laserfields_get_al_fourier_transform
135 module procedure lf_get_al_fourier_transform
137 private :: laserfields_get_al_fourier_transform, lf_get_al_fourier_transform
142 module procedure laserfields_get_el_fourier_transform_string
143 module procedure lf_get_el_fourier_transform_string
145 private :: laserfields_get_el_fourier_transform_string, lf_get_el_fourier_transform_string
158 type(
laserfield) function make_laserfield_params(form,intensity_wcm2,lambda_nm,peak_time_as,&
159 duration_as,rampon_as,form_exponent,phase_pi,is_vecpot,linear_chirp_rate_w0as) result(lf)
160 character(len=*),
intent(in) :: form
161 real(
dp),
intent(in) :: intensity_wcm2
162 real(
dp),
intent(in) :: lambda_nm
163 real(
dp),
intent(in) :: peak_time_as
164 real(
dp),
intent(in) :: duration_as
165 real(
dp),
intent(in),
optional :: rampon_as, phase_pi, form_exponent, linear_chirp_rate_w0as
166 logical,
intent(in),
optional :: is_vecpot
169 lf%intensity_Wcm2 = intensity_wcm2
170 lf%lambda_nm = lambda_nm
171 lf%peak_time_as = peak_time_as
172 lf%duration_as = duration_as
173 if (
present(form_exponent)) lf%form_exponent = form_exponent
174 if (
present(rampon_as)) lf%rampon_as = rampon_as
175 if (
present(phase_pi)) lf%phase_pi = phase_pi
176 if (
present(is_vecpot)) lf%is_vecpot = is_vecpot
177 if (
present(linear_chirp_rate_w0as)) lf%linear_chirp_rate_w0as = linear_chirp_rate_w0as
180 end function make_laserfield_params
182 type(
laserfield) function make_laserfield_datafile(datafile,is_vecpot) result(lf)
183 character(len=*),
intent(in) :: datafile
184 logical,
intent(in),
optional :: is_vecpot
187 lf%datafile = datafile
188 if (
present(is_vecpot)) lf%is_vecpot = is_vecpot
190 end function make_laserfield_datafile
197 select case (lf%form)
198 case(
'gaussianF',
'gaussianI',
'linear',
'linear2',
'sin2',
'sin_exp',
'readin')
201 write(0,
'(2A)')
'ERROR! laser field form unknown, form = ', trim(lf%form)
207 if (lf%form ==
'readin')
then
214 lf%omega = twopi / lf%TX
218 lf%peak_time = lf%peak_time_as *
au_as
219 lf%duration = lf%duration_as *
au_as
220 lf%rampon = lf%rampon_as *
au_as
223 if (lf%is_vecpot)
then
224 select case (lf%form)
226 write(0,*)
'ERROR: envelope ''linear'' cannot be used with is_vecpot=true, as the E-field would be discontinuous.'
229 if (lf%form_exponent <= 1.d0)
then
230 write(0,*)
'ERROR: envelope ''sin_exp'' with is_vecpot=true requires form_exponent > 1 for continuous E-field.'
231 write(0,*)
' form_exponent = ', lf%form_exponent
237 select case (lf%form)
238 case(
'linear',
'linear2')
239 if (lf%linear_chirp_rate_w0as /= 0.d0)
then
240 write(0,
'(3A)')
'WARNING: be careful with chirped laser pulses with ', trim(lf%form), &
241 &
' envelopes! Check that E(t) and A(t) are really as you expect them!'
245 if (lf%omega==0 .and. lf%linear_chirp_rate_w0as/=0)
then
246 write(0,
'(A)')
'WARNING: laserfield has lambda=0, i.e. no oscillation, but chirp/=0. chirp will be ignored!'
249 if (lf%omega==0 .and. lf%is_vecpot)
then
250 write(0,
'(2A)')
'WARNING: laserfield has lambda=0, i.e. no oscillation, but is_vecpot is true. ', &
251 &
'The peak intensity is currently not treated correctly!'
260 integer :: ii, io_error, unit, npoints
261 character(len=200) :: tmpstr
262 real(dp),
dimension(:),
allocatable :: tmptt, tmpvals
263 real(dp) :: dt, lastzerocrossing, starttime, endtime
265 write(6,*)
'# Reading laserfield from file: ', trim(lf%datafile)
268 open(unit,file=trim(lf%datafile),status=
'old',action=
'read',iostat=io_error)
269 if (io_error /= 0)
then
270 write(0,*)
'ERROR opening file for laserfield, filename =', trim(lf%datafile)
276 do while (io_error==0)
277 read(unit,
'(a200)',iostat=io_error) tmpstr
278 tmpstr = adjustl(tmpstr)
280 if (tmpstr(1:1)==
'#' .or. tmpstr==
'' .or. io_error/=0) cycle
285 if (npoints == 0)
then
286 write(0,*)
'ERROR: No data points found in file for laserfield. Stop.'
290 write(6,*)
'# Number of data points found:', npoints
291 allocate(tmptt(npoints), tmpvals(npoints))
295 rewind(unit, iostat=io_error)
296 do while (io_error==0)
297 read(unit,
'(a200)',iostat=io_error) tmpstr
298 tmpstr = adjustl(tmpstr)
299 if (tmpstr(1:1)==
'#' .or. tmpstr==
'' .or. io_error/=0) cycle
302 read(tmpstr,*) tmptt(ii), tmpvals(ii)
309 endtime = tmptt(npoints)
313 lastzerocrossing = starttime
315 if (tmptt(ii)<=tmptt(ii-1))
then
316 write(0,*)
'ERROR: times in data file for laser field must be monotonously increasing! filename =', trim(lf%datafile)
320 dt = min(dt,tmptt(ii)-tmptt(ii-1))
321 if (sign(1.d0,tmpvals(ii))/=sign(1.d0,tmpvals(ii-1)))
then
323 lf%TX = min(lf%TX,2*(tmptt(ii)-lastzerocrossing))
324 lastzerocrossing = tmptt(ii)
331 dt = min(dt,lf%TX/200)
336 npoints = nint((endtime - starttime) / dt) + 1
338 dt = (endtime - starttime) / (npoints-1)
339 allocate(lf%tt(npoints), lf%EE(npoints), lf%AA(npoints), lf%ZZ(npoints))
341 lf%tt(ii) = starttime + (ii-1) * dt
345 if (lf%is_vecpot)
then
346 lf%AA(:) =
interpolate(tmptt,tmpvals,lf%tt,degree=6)
349 lf%EE(:) =
interpolate(tmptt,tmpvals,lf%tt,degree=6)
355 lf%E0 = maxval(abs(lf%EE))
357 lf%omega = twopi / lf%TX
359 lf%peak_time = (starttime + endtime) / 2
360 lf%peak_time_as = lf%peak_time /
au_as
361 lf%duration = endtime - starttime
362 lf%duration_as = lf%duration /
au_as
374 dt = (lf%tt(2) - lf%tt(1))/50
376 do ii = 1,
size(lf%tt)
379 lf%EE(ii) = -(
get_al(lf,zeit+dt) -
get_al(lf,zeit-dt)) / (2*dt)
386 integer :: ii, jj, nsteps, simpson_fac
397 do ii = 2,
size(lf%AA)
408 zeit = (lf%tt(ii-1) * (nsteps-jj) + lf%tt(ii) * (jj-1)) / (nsteps-1)
413 lf%AA(ii) = lf%AA(ii) - simpson_fac * el
415 simpson_fac = 6 - simpson_fac
420 lf%AA(ii) = lf%AA(ii) - el
422 lf%AA(ii) = lf%AA(ii) * (lf%tt(ii)-lf%tt(ii-1))/(3*(nsteps-1))
424 lf%AA(ii) = lf%AA(ii) + lf%AA(ii-1)
431 integer :: ii, jj, nsteps, simpson_fac
442 do ii = 2,
size(lf%ZZ)
453 zeit = (lf%tt(ii-1) * (nsteps-jj) + lf%tt(ii) * (jj-1)) / (nsteps-1)
458 lf%ZZ(ii) = lf%ZZ(ii) - simpson_fac * al
460 simpson_fac = 6 - simpson_fac
465 lf%ZZ(ii) = lf%ZZ(ii) - al
467 lf%ZZ(ii) = lf%ZZ(ii) * (lf%tt(ii)-lf%tt(ii-1))/(3*(nsteps-1))
469 lf%ZZ(ii) = lf%ZZ(ii) + lf%ZZ(ii-1)
476 integer :: ii, npoints
477 real(dp) :: starttime, endtime, dt
488 dt = (endtime-starttime) / 500
492 npoints = nint((endtime-starttime) / dt + 1)
493 allocate(lf%tt(npoints), lf%AA(npoints))
498 lf%tt(ii) = (starttime * (npoints-ii) + endtime * (ii-1)) / (npoints-1)
507 integer :: ii, npoints
508 real(dp) :: starttime, endtime, dt
519 dt = (endtime-starttime) / 500
523 npoints = nint((endtime-starttime) / dt + 1)
524 if (.not.
allocated(lf%tt))
then
525 allocate(lf%tt(npoints))
526 else if (
size(lf%tt)/=npoints)
then
527 write(0,*)
'ERROR: size(lf%tt)/=npoints in lf_setup_ZZ_interpolation!'
531 allocate(lf%ZZ(npoints))
536 lf%tt(ii) = (starttime * (npoints-ii) + endtime * (ii-1)) / (npoints-1)
548 real(dp),
intent(in) :: zeit
549 real(dp),
intent(out) :: env, envpr
550 real(dp) :: trel, ttmp
552 trel = zeit - lf%peak_time
554 select case (lf%form)
556 env = exp(-trel**2*log(16.d0)/lf%duration**2)
557 envpr = -2*trel*log(16.d0)/lf%duration**2 * env
559 env = exp(-trel**2*log( 4.d0)/lf%duration**2)
560 envpr = -2*trel*log( 4.d0)/lf%duration**2 * env
563 if (abs(trel) < lf%duration/2)
then
566 else if (abs(trel) < lf%duration/2 + lf%rampon)
then
567 env = 1.d0 - (abs(trel)-lf%duration/2) / lf%rampon
568 envpr = -sign(1.d0,trel) / lf%rampon
575 if (abs(trel) < lf%duration/2)
then
578 else if (abs(trel) < lf%duration/2 + lf%rampon)
then
579 ttmp = 1.d0 - (abs(trel)-lf%duration/2) / lf%rampon
580 env = sin(pio2*ttmp)**2
581 envpr = -sign(1.d0,trel) * sin(pi*trel) * pio2/lf%rampon
587 if (abs(trel) < lf%duration/2)
then
588 env = cos(pi*trel/lf%duration)**2
590 envpr = -sin(twopi*trel/lf%duration) * pi/lf%duration
596 if (abs(trel) < lf%duration/2)
then
597 env = cos(pi*trel/lf%duration)**lf%form_exponent
598 envpr = -sin(pi*trel/lf%duration) * lf%form_exponent * &
599 & cos(pi*trel/lf%duration)**(lf%form_exponent-1) * pi/lf%duration
605 write(0,
'(2A)')
'ERROR! laser field form unknown, form = ', trim(lf%form)
610 envpr = lf%E0 * envpr
623 real(dp),
intent(in) :: omega
631 chirp = lf%omega * lf%linear_chirp_rate_w0as /
au_as
634 select case (lf%form)
637 z = log(16.d0)/lf%duration**2 - iu * chirp
638 val = exp(-omega**2/(4*z)) / sqrt(2*z)
640 z = log( 4.d0)/lf%duration**2 - iu * chirp
641 val = exp(-omega**2/(4*z)) / sqrt(2*z)
643 if (chirp /= 0.d0)
then
644 write(0,
'(A)')
'ERROR! fourier transform of "linear" envelope with chirp not implemented!'
647 val = sqrt(8.d0/pi) * sin(omega*lf%rampon/2) * sin(omega*(lf%rampon+lf%duration)/2) / (lf%rampon * omega**2)
649 if (chirp /= 0.d0)
then
650 write(0,
'(A)')
'ERROR! linear2 fourier transform with chirp not implemented!'
653 val = sqrt(2*pi**3) * cos(omega*lf%rampon/2) * sin(omega*(lf%rampon+lf%duration)/2) / (pi**2*omega - lf%rampon**2*omega**3)
655 if (chirp == 0.d0)
then
656 val = sqrt(8.d0*pi**3) * sin(omega*lf%duration/2)/(twopi**2*omega - omega**3*lf%duration**2)
662 & +
expiatbt2_intt(-twopi/lf%duration - omega, chirp, lf%duration)/4 &
663 & +
expiatbt2_intt( twopi/lf%duration - omega, chirp, lf%duration)/4
666 stop
'ERROR! sin_exp fourier transform too complicated to implement'
668 stop
'ERROR! unknown laser field form'
678 real(dp),
intent(in) :: a, b, t
682 if (abs(b*t**2) <= 1e-5)
then
685 if (abs(at) < 1e-8)
then
687 res = (1 + iu/12 * b*t**2 - b*t**2/160) * t / sqrt(twopi)
690 res = x1 * cos(at / 2) + (2 - 2*x1 + 0.5*iu * b*t**2) * sin(at / 2) / at
691 res = res * t / sqrt(twopi)
693 res =
erf((a-b*t)/sqrt(4*iu*b)) -
erf((a+b*t)/sqrt(4*iu*b))
694 res = res * (-iu/sqrt(8*iu*b)) * exp(-iu*a**2/(4*b))
709 character(*),
intent(in) :: omegastr
710 character(1000) :: tmpstr
718 chirp = lf%omega * lf%linear_chirp_rate_w0as /
au_as
722 select case (lf%form)
725 z = log(16.d0)/lf%duration**2 - iu * chirp
728 z = log( 4.d0)/lf%duration**2 - iu * chirp
731 if (chirp /= 0.d0)
then
732 write(0,
'(A)')
'ERROR! fourier transform of "linear" envelope with chirp not implemented!'
735 write(tmpstr,
'(SP,999(ES15.8,A))') 8.d0/(pi*lf%rampon),
' * sin(', lf%rampon/2,
'*('//omegastr//
')) * sin(', &
736 & (lf%rampon+lf%duration)/2,
'*('//omegastr//
')) / ('//omegastr//
')**2'
738 if (chirp /= 0.d0)
then
739 write(0,
'(A)')
'ERROR! linear2 fourier transform with chirp not implemented!'
742 write(tmpstr,
'(SP,999(ES15.8,A))') sqrt(2*pi**3),
' * cos(', lf%rampon/2,
'*('//omegastr//
')) * sin(', &
743 & (lf%rampon+lf%duration)/2,
'*('//omegastr//
')) / (',pi**2,
'*('//omegastr//
') - ',lf%rampon**2,
'*('//omegastr//
')**3)'
745 if (chirp == 0.d0)
then
746 write(tmpstr,
'(SP,999(ES15.8,A))') sqrt(8*pi**3),
' * sin(',lf%duration/2,
'*('//omegastr//
')) / (', &
747 & twopi**2,
'*('//omegastr//
') - ',lf%duration**2,
'*('//omegastr//
')**3)'
749 write(0,
'(A)')
'ERROR! sin2 fourier transform function string with chirp not implemented!'
753 write(0,
'(2A)')
'ERROR! sin_exp fourier transform too complicated to implement'
756 write(0,
'(2A)')
'ERROR! laser field form unknown, form = ', trim(lf%form)
764 write(val,
'(SP,A,ES15.8,3A)')
'(',lf%E0,
' * ',trim(tmpstr),
')'
774 real(dp),
intent(in) :: zeit
775 real(dp),
intent(out) :: omega
776 real(dp),
intent(inout),
optional :: env
779 omega = lf%omega * (1.d0 + lf%linear_chirp_rate_w0as/
au_as * (zeit-lf%peak_time))
781 if (omega >= 0.d0)
return
784 if (
present(env))
then
785 if (env <= epsilon(1.d0))
then
794 write(0,
'(a)')
' ERROR: Field chirp is too large, omega(t) <= zero!'
795 write(0,
'(a,9g15.5)')
' t, omega = ', zeit, omega
796 if (
present(env))
write(0,
'(a,9g15.5)')
' envelope > epsilon, env, epsilon =', env, epsilon(1.d0)
797 write(0,*)
'STOPPING!'
802 real(dp) function lf_get_el(lf,zeit,env_out) result(el)
805 real(dp),
intent(in) :: zeit
806 real(dp),
intent(out),
optional :: env_out
807 real(dp) :: env, envpr, osc, oscpr
810 if (lf%form ==
'readin')
then
811 if (zeit < lf%tt(1) .or. zeit > lf%tt(
size(lf%tt)))
then
822 if (lf%omega==0)
then
823 if (lf%is_vecpot)
then
830 osc = sin(omega * (zeit-lf%peak_time) + pi*lf%phase_pi)
832 oscpr = (2.d0*omega-lf%omega)*cos(omega*(zeit-lf%peak_time)+pi*lf%phase_pi)
834 if (lf%is_vecpot)
then
837 el = -(env * oscpr + envpr * osc) / lf%omega
844 if (
present(env_out)) env_out = env
846 end function lf_get_el
848 real(dp) function lf_get_al(lf,zeit,env_out) result(al)
851 real(dp),
intent(in) :: zeit
852 real(dp),
intent(out),
optional :: env_out
853 real(dp) :: env, envpr, osc
856 if (lf%form ==
'readin' .or. (.not.lf%is_vecpot))
then
860 if (zeit < lf%tt(1))
then
862 else if (zeit > lf%tt(
size(lf%tt)))
then
864 al = lf%AA(
size(lf%AA))
875 if (lf%omega==0)
then
879 osc = sin(omega * (zeit-lf%peak_time) + pi*lf%phase_pi)
881 al = env*osc / lf%omega
884 if (
present(env_out)) env_out = env
885 end function lf_get_al
887 complex(dpc) function lf_get_el_posfreq(lf,zeit,env_out)
result(ELp)
890 real(dp),
intent(in) :: zeit
891 real(dp),
intent(out),
optional :: env_out
892 real(dp) :: env, envpr
894 complex(dpc) :: osc, oscpr
896 if (lf%form ==
'readin')
then
897 stop
'ERROR: positive-frequency decomposition not implemented for readin laser fields'
901 if (lf%omega==0)
then
905 osc = iu/2 * exp(-iu * (omega*(zeit-lf%peak_time) + pi*lf%phase_pi))
907 if (lf%is_vecpot)
then
909 oscpr = (2.d0*omega-lf%omega) * (-iu * osc)
910 elp = -(env * oscpr + envpr * osc) / lf%omega
917 if (
present(env_out)) env_out = env
918 end function lf_get_el_posfreq
920 complex(dpc) function lf_get_al_posfreq(lf,zeit,env_out)
result(ALp)
922 real(dp),
intent(in) :: zeit
923 real(dp),
intent(out),
optional :: env_out
924 real(dp) :: env, envpr
928 if (lf%form ==
'readin')
then
929 stop
'ERROR: positive-frequency decomposition not implemented for readin laser fields'
931 if (.not.lf%is_vecpot)
then
932 stop
'ERROR: laser field is not given as a vector potential, cannot get positive-frequency A(t) analytically!'
937 if (lf%omega==0)
then
941 osc = iu/2 * exp(-iu * (omega*(zeit-lf%peak_time) + pi*lf%phase_pi))
943 alp = env * osc / lf%omega
946 if (
present(env_out)) env_out = env
947 end function lf_get_al_posfreq
949 real(dp) function lf_get_zl(lf,zeit) result(zl)
952 real(dp),
intent(in) :: zeit
956 if (zeit < lf%tt(1))
then
958 else if (zeit > lf%tt(np))
then
960 zl = lf%ZZ(np) - (zeit - lf%tt(np)) *
get_al(lf,lf%tt(np))
965 end function lf_get_zl
967 real(dp) function laserfields_get_el(zeit,envarr,partarr) result(el)
968 real(dp),
intent(in) :: zeit
969 real(dp),
dimension(n_laserfields),
intent(out),
optional :: envarr, partarr
971 real(dp) :: env, part
974 if (
present(envarr)) envarr = 0.d0
975 if (
present(partarr)) partarr = 0.d0
980 if (
present(envarr)) envarr(i_field) = env
981 if (
present(partarr)) partarr(i_field) = part
984 end function laserfields_get_el
986 real(dp) function laserfields_get_al(zeit,envarr,partarr) result(al)
987 real(dp),
intent(in) :: zeit
988 real(dp),
dimension(n_laserfields),
intent(out),
optional :: envarr, partarr
990 real(dp) :: env, part
996 if (
present(envarr)) envarr(i_field) = env
997 if (
present(partarr)) partarr(i_field) = part
999 end function laserfields_get_al
1001 complex(dpc) function laserfields_get_el_posfreq(zeit)
result(ELp)
1002 real(dp),
intent(in) :: zeit
1010 end function laserfields_get_el_posfreq
1012 complex(dpc) function laserfields_get_al_posfreq(zeit)
result(ALp)
1013 real(dp),
intent(in) :: zeit
1020 end function laserfields_get_al_posfreq
1022 real(dp) function laserfields_get_zl(zeit) result(zl)
1023 real(dp),
intent(in) :: zeit
1029 end function laserfields_get_zl
1033 select case (lf%form)
1040 case(
'linear',
'linear2')
1041 tt = lf%duration * 0.5d0 + lf%rampon
1042 case (
'sin2',
'sin_exp')
1043 tt = lf%duration * 0.5d0
1045 write(0,*)
'ERROR: laser field form unknown, form = ',lf%form
1052 if (lf%form==
'readin')
then
1061 if (lf%form==
'readin')
then
1062 tt = lf%tt(
size(lf%tt))
1096 real(dp),
intent(in) :: zeit
1097 real(dp),
intent(in),
optional :: endzeit
1098 real(dp) :: tstart, tend, omega, tx
1100 logical,
intent(in),
optional :: global
1103 if (
present(endzeit))
then
1104 if (endzeit <= zeit)
then
1107 dt = nearest(zeit,1.d0)-zeit
1118 if (
present(global))
then
1131 if (zeit < tend)
then
1132 if (zeit >= tstart)
then
1142 else if (zeit+dt > tstart)
then
1153 integer,
intent(in) :: unit
1154 real(dp),
intent(in),
optional :: timestep
1155 real(dp) :: tt, endtime
1156 real(dp) :: EL, AL, ZL
1157 real(dp),
dimension(n_laserfields) :: env, part
1159 write(unit,
'(A)')
'# t E(t) A(t) Z(t) I(t) [E_ii(t)] [envelope_ii(t)]'
1164 el =
get_el(tt, env, part)
1167 write(unit,
'(9999(1x,g22.14e3))') tt, el, al, zl, el**2/
au_wcm2toel2, part(:), env(:)
1168 if (tt >= endtime)
exit
1170 if (
present(timestep))
then
1180 integer,
intent(in) :: n_photon
1185 select case (lf%form)
1189 teff = lf%duration * sqrt(pio2/(n_photon*log(16.d0)))
1192 teff = lf%duration * sqrt(pio2/(n_photon*log(4.d0)))
1194 teff = lf%duration * gamma(0.5d0+n_photon*2) / (sqrt(pi)*gamma(1.d0+n_photon*2))
1196 teff = lf%duration * gamma(0.5d0+n_photon*lf%form_exponent) / (sqrt(pi)*gamma(1.d0+n_photon*lf%form_exponent))
1198 teff = lf%duration + 2*lf%rampon / (1+2.d0*n_photon)
1201 teff = lf%duration + 2*lf%rampon * gamma(0.5d0+n_photon*2) / (sqrt(pi)*gamma(1.d0+n_photon*2))
1203 write(0,*)
'ERROR: effective duration not implemented for laser field form ', lf%form
1211 integer,
intent(in) :: n_photon
1219 integer,
intent(in) :: n_photon
1220 if (n_photon < 1 .or. n_photon > 2) stop
'ERROR: Only n_photon = {1,2} allowed for tdcs_factor in laserfields module'
1226 real(dp),
parameter :: csunit(2) = (/ 1.d21/(
au_cm)**2, 1.d52/((
au_cm)**4*
au_as*1.d18) /)
1228 integer,
intent(in) :: n_photon
1229 if (n_photon < 1 .or. n_photon > 2) stop
'ERROR: Only n_photon = {1,2} allowed for CS_factor in laserfields module'
1244 select case (lf%form)
1245 case(
'gaussianF',
'gaussianI',
'sin2')
1247 case(
'sin_exp',
'readin')
1248 write(0,
'(9a)')
'WARNING: can not get analytical fourier transform for ', trim(lf%form),
' fields!'
1249 yes_we_can = .false.
1250 case(
'linear',
'linear2')
1251 if (lf%linear_chirp_rate_w0as /= 0.d0)
then
1252 write(0,
'(9a)')
'WARNING: can not get analytical fourier transform for chirped ', trim(lf%form),
' fields!'
1253 yes_we_can = .false.
1258 complex(dpc) function lf_get_el_fourier_transform(lf,omega)
result(ELFT)
1263 real(dp),
intent(in) :: omega
1266 write(0,
'(A,I2,A)')
'ERROR! can not get analytic fourier transform for this laser field! stopping!'
1270 if (lf%omega==0)
then
1284 & - conjg(
lf_envelope_fourier(lf, -omega - lf%omega)) * exp(-iu*pi*lf%phase_pi) ) / (2*iu)
1289 elft = elft * exp(-iu*omega*lf%peak_time)
1291 if (lf%is_vecpot)
then
1294 elft = -iu * omega * elft
1296 if (lf%omega/=0) elft = elft / lf%omega
1299 end function lf_get_el_fourier_transform
1301 character(4000) function lf_get_el_fourier_transform_string(lf)
result(Ff)
1309 write(0,
'(A,I2,A)')
'ERROR! can not get analytic fourier transform for this laser field! stopping!'
1313 if (lf%omega==0)
then
1328 & //
') * '//
gnuplotstring(exp(-iu*pi*lf%phase_pi))//
') / {0,2}'
1333 ff = trim(ff) //
' * exp('//
gnuplotstring(-iu*lf%peak_time)//
'*w)'
1335 if (lf%is_vecpot)
then
1339 ff =
'('//trim(ff)//
' * '//
gnuplotstring(-iu/lf%omega)//
'*w)'
1341 end function lf_get_el_fourier_transform_string
1343 complex(dpc) function lf_get_al_fourier_transform(lf,omega)
result(ALFT)
1351 real(dp),
intent(in) :: omega
1355 end function lf_get_al_fourier_transform
1357 complex(dpc) function laserfields_get_el_fourier_transform(omega)
result(ELFT)
1358 real(dp),
intent(in) :: omega
1364 end function laserfields_get_el_fourier_transform
1366 character(4000) function laserfields_get_el_fourier_transform_string()
result(Ff)
1372 end function laserfields_get_el_fourier_transform_string
1374 complex(dpc) function laserfields_get_al_fourier_transform(omega)
result(ALFT)
1375 real(dp),
intent(in) :: omega
1381 end function laserfields_get_al_fourier_transform
convert real or complex numbers to strings that can be used in gnuplot
1-dimensional polynomial interpolation
Return the positive-frequency part of the vector potential A^(+)(t). if called with a type(laserfield...
Return the vector potential A(t). if called with a type(laserfield) argument, gets A(t) for just that...
Return the positive-frequency part of the electric field E^(+)(t). if called with a type(laserfield) ...
Return the electric field E(t). if called with a type(laserfield) argument, gets E(t) for just that o...
Return the free-space displacement Z(t) of an electron. if called with a type(laserfield) argument,...
Make a new type(laserfield), either from parameters or reading from a datafile.
conversion factors for various units to/from atomic units based on the 2012-10-28 CODATA values from ...
real(dp), parameter au_wcm2toel2
EF [a.u.] = sqrt(I [W/cm2] * au_Wcm2toEL2),.
real(dp), parameter au_wcm2
I [a.u.] = I [W/cm2] * au_Wcm2.
real(dp), parameter au_nm
x [a.u.] = x [nm] * au_nm
real(dp), parameter au_c
speed of light in a.u. == 1/alpha
real(dp), parameter au_ev
E [a.u.] = E [eV] * au_eV (in Hartree atomic units).
real(dp), parameter au_cm
x [a.u.] = x [cm] * au_cm
real(dp), parameter au_as
t [a.u.] = t [attoseconds] * au_as
integer function get_unused_unit()
real(dp) function lf_get_endtime(lf)
subroutine write_laserfields(unit, timestep)
real(dp) function laserfield_int(lf, n_photon)
integer n_laserfields
Number of laserfields in the global array all_laserfields.
complex(dpc) function expiatbt2_intt(a, b, t)
subroutine add_laserfield(lf)
add a type(laserfield) to the global list all_laserfields
real(dp) function cs_factor(lf, n_photon)
real(dp) function laserfields_endtime()
subroutine read_laserfield_from_file(lf)
integer, parameter minimum_steps_per_laser_period
character(1000) function lf_envelope_fourier_string(lf, omegastr)
real(dp) function lf_get_halftotaltime(lf)
logical function lf_can_get_fourier(lf)
logical function laserfields_can_get_fourier()
type(laserfield), dimension(100) all_laserfields
Global array saving the laserfields read from parameter files and added with add_laserfield.
subroutine lf_get_omega(lf, zeit, omega, env)
real(dp) function laserfields_smallest_tx()
subroutine lf_setup_aa_interpolation(lf)
subroutine laserfield_set_dependent(lf)
real(dp) function lf_get_starttime(lf)
subroutine lf_setup_zz_interpolation(lf)
real(dp) function laserfield_teff(lf, n_photon)
subroutine laserfield_numerical_integration_a_from_e(lf)
complex(dpc) function lf_envelope_fourier(lf, omega)
real(dp) function laserfields_largest_possible_dt(zeit, endzeit, global)
This function gives the maximum timestep that resolves the current oscillation well....
subroutine laserfield_numerical_derivation_e_from_a(lf)
real(dp) function tdcs_factor(lf, n_photon)
real(dp) function laserfields_starttime()
real(dp), parameter gaussian_time_cutoff_fwhm
subroutine lf_get_envelope(lf, zeit, env, envpr)
subroutine laserfield_numerical_integration_z_from_a(lf)
Datatype describing a single laserfield, should usually be created through make_laserfield routine.