write_omega Subroutine

public subroutine write_omega(gnostics)

Write omega, omega_average as functions of kx, ky and time to the new netcdf file

Arguments

Type IntentOptional Attributes Name
type(diagnostics_type), intent(in) :: gnostics

Contents

Source Code


Source Code

  subroutine write_omega(gnostics)
    use gs2_time, only: woutunits
    use kt_grids, only: ntheta0, naky
    use diagnostics_config, only: diagnostics_type
    use gs2_io, only: nc_write_omega
    implicit none
    type(diagnostics_type), intent(in) :: gnostics
    integer :: ik !, it
    complex, dimension(0:gnostics%navg-1,ntheta0,naky) :: omegahist_woutunits
    complex, dimension(ntheta0, naky) :: omega_average_woutunits

    if (.not. gnostics%writing) return

    do ik=1,naky
       omegahist_woutunits(:,:,ik) = omegahist(:,:,ik) * woutunits(ik)
       omega_average_woutunits(:,ik) = omega_average(:,ik) * woutunits(ik)
    end do
    
    call nc_write_omega(gnostics%file_id, gnostics%nout, &
         omegahist(mod(gnostics%istep, gnostics%navg), :, :), omega_average, woutunits)

  end subroutine write_omega