anchor.diff:      end do
     end function laserfields_smallest_TX
     !---------------------------------------------------------------------------
  +  !> This function gives the maximum timestep that resolves the current oscillation well.
  +  !> the global parameter minimum_steps_per_laser_period determines how large the timestep here is allowed to be.
     real(dp) function laserfields_largest_possible_dt(zeit,endzeit,global) result(dt)
       real(dp), intent(in) :: zeit
       real(dp), intent(in), optional :: endzeit
  
positive.code:        if (zeit < tend) then
            if (zeit >= tstart) then
               if (all_laserfields(ii)%omega==0) then
                  dt = min(dt,(all_laserfields(ii)%duration+2*all_laserfields(ii)%rampon)/500)
               else
                  ! if it's currently active, dt has to be at most TX(zeit)/minimum_steps_per_laser_period, where TX depends on zeit for chirped pulses
  
negative.code:                 dt = min(dt,TX/minimum_steps_per_laser_period)
               end if
            else if (zeit+dt > tstart) then
               ! if we would go beyond the starttime, decrease dt to go only there
               dt = tstart - zeit
            end if
         end if
  