Write the correlation function over the extended domain to netCDF
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | file_id |
NetCDF ID of the file to write to |
||
integer, | intent(in) | :: | nout_big |
The current output timestep for "large" diagnostics |
||
real, | intent(in) | :: | time |
Current simulation time |
||
complex, | intent(in), | dimension (:,:,:) | :: | phi_corr | ||
real, | intent(in), | dimension (:,:,:) | :: | phi2_extend |
subroutine nc_loop_corr_extend (file_id, nout_big, time, phi_corr, phi2_extend)
# ifdef NETCDF
use run_parameters, only: has_phi
use neasyf, only: neasyf_write
# endif
implicit none
!> NetCDF ID of the file to write to
integer, intent(in) :: file_id
!> The current output timestep for "large" diagnostics
integer, intent (in) :: nout_big
!> Current simulation time
real, intent(in) :: time
real, dimension (:,:,:), intent (in) :: phi2_extend
complex, dimension (:,:,:), intent (in) :: phi_corr
# ifdef NETCDF
character(*), dimension(*), parameter :: phi_corr_dims = &
[complex_dim, theta_extended_dim, kx_dim, ky_dim, time_big_dim]
character(*), dimension(*), parameter :: phi2_extend_dims = &
[theta_extended_dim, kx_dim, ky_dim, time_big_dim]
if (has_phi) then
call neasyf_write(file_id, trim(time_big_dim), time, dim_names=[time_big_dim], start=[nout_big])
call netcdf_write_complex(file_id, "phi_corr", phi_corr, &
dim_names=phi_corr_dims, start=starts(5, nout_big), &
long_name="2 point correlation function calculated from the electric potential, time averaged")
call neasyf_write(file_id, "phi2_extend", phi2_extend, &
dim_names=phi2_extend_dims, start=starts(4, nout_big))
end if
# else
UNUSED_DUMMY(file_id); UNUSED_DUMMY(nout_big); UNUSED_DUMMY(time); UNUSED_DUMMY(phi_corr)
UNUSED_DUMMY(phi2_extend)
# endif
end subroutine nc_loop_corr_extend