subroutine data_out
integer :: i, iic, idata
idata = iout
if (diag) then
if (tnow >= tdia) then
ienout = ienout + 1
call Envar(ienout)
tdia = tdia + dtdia
if (pe0) then
write (6, '(a10,i3,a10,e11.4)') ' rms data ', ienout, &
' at time =', tnow
write (6, *) '=========================='
endif
end if
end if
if (tnow >= tout) then
call create_timestep_folder(iout)
tout = tout + dtout
if (diag) then
if (pe0) call en_data(ienout, iter, idata)
end if
!==================
if (nvout > 0) then
if (mod_ord == 2) then
if (L_env_modulus) then
i = 0
call env_fields_out(env, i)
if (Two_color) call env_fields_out(env1, -1) !EXIT |A|
else
if (Two_color) then
do i = 1, 2
call env_two_fields_out(env, env1, i)
end do
else
do i = 1, 2
call env_fields_out(env, i) !EXIT [Ar,Ai]
end do
end if
end if
end if
do i = 1, nvout
if (l_force_singlefile_output) then
call fields_out(ebf, i, i) !i to label field name
else
call fields_out_new(ebf, i, i)
end if
end do
end if
if (nden > 0) then
do i = 1, nsp
call prl_den_energy_interp(i, nden)
do iic = 1, min(2, nden)
call den_energy_out(i, iic, iic)
end do
end do
end if
if (hybrid) then
do i = 1, nfcomp
call fluid_den_mom_out(up, i, nfcomp)
end do
end if
if (ionization) call part_ionz_out(tnow)
if (gam_min > 1.) call part_high_gamma_out(gam_min, tnow)
if (npout > 0) then
iic = npout
if (iic <= nsp) then
call part_pdata_out(tnow, xp0_out, xp1_out, yp_out, iic, pjump)
else
do i = 1, nsp
call part_pdata_out(tnow, xp0_out, xp1_out, yp_out, i, pjump)
end do
end if
end if
call CPU_TIME(unix_time_now)
if (pe0) then
write (6, '(a10,i6,a10,e11.4,a10,e11.4)') 'iter = ', iter, ' t = ', &
tnow, ' dt = ', dt_loc
write (6, *) ' END DATA WRITE'
write (6, '(a16,f12.3)') ' Time elapsed = ', &
unix_time_now - unix_time_begin
end if
if (dump > 0 .and. time_interval_dumps < 0.0) then
if (iter > 0) call dump_data(iter, tnow)
endif
iout = iout + 1
end if
call CPU_TIME(unix_time_now)
!if((unix_time_now - unix_time_last_dump) > time_interval_dumps .and. time_interval_dumps > 0.0) then
! call dump_data(iter,tnow)
!endif
end subroutine data_out