laserfields
Fortran95 library to describe time-dependent laser pulses
Loading...
Searching...
No Matches
plotlaserfourier.f90
Go to the documentation of this file.
1! Copyright (c) 2012, Johannes Feist
2! licensed under the MIT open source license, see LICENSE file
3
6 implicit none
7 real(dp), parameter :: twopi = 6.283185307179586476925286766559005768394_dp
8 integer :: ii, i_field, nsteps
9 real(dp) :: omega, de, emax
10 complex(dpc), dimension(:), allocatable :: lf_ft
11 complex(dpc) :: alft
12 character(len=200) :: parfile
13
14 parfile = 'laserfields.in'
15 if (command_argument_count() >= 1) then
16 call get_command_argument(1,parfile)
17 end if
18 call laserfields_read_parameters(trim(parfile))
19
20 if (.not.laserfields_can_get_fourier()) then
21 write(0,*) 'ERROR: can not get analytical fourier transform for these laser fields. Stopping!'
22 stop 733
23 end if
24
25 allocate(lf_ft(0:n_laserfields))
26
27 ! determine energy resolution by estimating fourier bandwidth
28 de = 1.d0
29 emax = 0.d0
30 do i_field = 1, n_laserfields
31 de = min(de,twopi/(100*all_laserfields(i_field)%duration))
32 ! go up to twice the maximum frequency - for really broadband pulses, this might not actually be enough
33 emax = max(emax,all_laserfields(i_field)%omega*2.01) ! use 2.01 here so we do not get omega==lf%omega as an argument, where some of the routines have problems
34 end do
35 nsteps = nint(emax/de)
36 de = emax/(nsteps+1)
37
38 do ii = 1, nsteps
39 omega = ii * de
40 do i_field = 1, n_laserfields
41 lf_ft(i_field) = get_el_fourier_transform(all_laserfields(i_field), omega)
42 end do
43 lf_ft(0) = sum(lf_ft(1:))
44 alft = get_al_fourier_transform(omega)
45
46 ! we are not unrolling the phases here (i.e. removing phase jumps by 2 pi)
47 ! neither are we shifting in time to get a flatter phase overall
48 write(6,'(9999(1x,g22.14e3))') omega, lf_ft(0), alft, lf_ft(1:)
49 end do
50
51end program plotlaserfourier
program plotlaserfourier