write_cross_phase Subroutine

public subroutine write_cross_phase(gnostics)

FIXME : Add documentation

Arguments

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

Contents

Source Code


Source Code

  subroutine write_cross_phase(gnostics)
    use mp, only: proc0
    use diagnostics_config, only: diagnostics_type
    use neasyf, only: neasyf_write
    use gs2_io, only: time_dim
    implicit none
    type(diagnostics_type), intent(in) :: gnostics
    real :: phase_tot, phase_theta
    real :: t
    
    t = gnostics%user_time
    
    call get_cross_phase (gnostics, phase_tot, phase_theta)
    
    if (.not. gnostics%writing) return

    call neasyf_write(gnostics%file_id, "electron_cross_phase_theta", phase_theta, &
         dim_names=[time_dim], start=[gnostics%nout], &
         long_name="Cross phase between electron density and perpendicular electron temperature, &
         &  given at the outboard midplane and averaged across x and y", units="radians")
    call neasyf_write(gnostics%file_id, "electron_cross_phase_tot", phase_tot, &
         dim_names=[time_dim], start=[gnostics%nout], &
         long_name="Cross phase between electron density and perpendicular electron temperature, &
         & averaged across all space", units="radians")
    
    if (proc0 .and. gnostics%ascii_files%write_to_phase .and. (.not. gnostics%create)) write (unit=gnostics%ascii_files%phase, &
         fmt="('t= ',e17.10,' phase_tot= ',e11.4,' phase_theta= ',e11.4)") &
         & t, phase_tot, phase_theta
  end subroutine write_cross_phase