nc_loop_corr_extend Subroutine

public subroutine nc_loop_corr_extend(file_id, nout_big, time, phi_corr, phi2_extend)

Uses

Write the correlation function over the extended domain to netCDF

Arguments

Type IntentOptional 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

Contents

Source Code


Source Code

  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

# endif
  end subroutine nc_loop_corr_extend