nc_vflux Subroutine

public subroutine nc_vflux(file_id, nout, vflux, vmflux, vbflux, mom_fluxes, mmom_fluxes, bmom_fluxes, vflux_tot, vflux_par, vflux_perp, vflux0, vflux1)

Uses

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: file_id

NetCDF ID of the file to write to

integer, intent(in) :: nout

Current timestep

real, intent(in), dimension (:,:,:) :: vflux
real, intent(in), dimension (:,:,:) :: vmflux
real, intent(in), dimension (:,:,:) :: vbflux
real, intent(in), dimension(:) :: mom_fluxes
real, intent(in), dimension(:) :: mmom_fluxes
real, intent(in), dimension(:) :: bmom_fluxes
real, intent(in) :: vflux_tot
real, intent(in), dimension (:,:,:) :: vflux_par
real, intent(in), dimension (:,:,:) :: vflux_perp
real, intent(in), dimension (:,:,:) :: vflux0
real, intent(in), dimension (:,:,:) :: vflux1

Contents

Source Code


Source Code

  subroutine nc_vflux (file_id, nout, vflux, vmflux, vbflux, &
       mom_fluxes, mmom_fluxes, bmom_fluxes, vflux_tot, &
       vflux_par, vflux_perp, vflux0, vflux1)
# ifdef NETCDF
    use run_parameters, only: has_phi, has_apar, has_bpar
    use neasyf, only: neasyf_write
# endif
    implicit none
    !> NetCDF ID of the file to write to
    integer, intent(in) :: file_id
    !> Current timestep
    integer, intent (in) :: nout
    real, dimension (:,:,:), intent (in) :: vflux, vmflux, vbflux
    real, dimension (:,:,:), intent (in) :: vflux_par, vflux_perp
    real, dimension (:,:,:), intent (in) :: vflux0, vflux1
    real, dimension(:), intent (in) :: mom_fluxes, mmom_fluxes, bmom_fluxes
    real, intent (in) :: vflux_tot
# ifdef NETCDF

    if (has_phi) then
       call neasyf_write(file_id, "es_mom_flux", mom_fluxes, dim_names=flux_dims, start=starts(2, nout))
       call neasyf_write(file_id, "es_mom_by_k", vflux, dim_names=fluxk_dims, start=starts(4, nout))
       call neasyf_write(file_id, "es_parmom_by_k", vflux_par, dim_names=fluxk_dims, start=starts(4, nout))
       call neasyf_write(file_id, "es_perpmom_by_k", vflux_perp, dim_names=fluxk_dims, start=starts(4, nout))
       call neasyf_write(file_id, "es_mom0_by_k", vflux0, dim_names=fluxk_dims, start=starts(4, nout))
       call neasyf_write(file_id, "es_mom1_by_k", vflux1, dim_names=fluxk_dims, start=starts(4, nout))
    end if

    if (has_apar) then
       call neasyf_write(file_id, "apar_mom_flux", mmom_fluxes, dim_names=flux_dims, start=starts(2, nout))
       call neasyf_write(file_id, "apar_mom_by_k", vmflux, dim_names=fluxk_dims, start=starts(4, nout))
    end if

    if (has_bpar) then
       call neasyf_write(file_id, "bpar_mom_flux", bmom_fluxes, dim_names=flux_dims, start=starts(2, nout))
       call neasyf_write(file_id, "bpar_mom_by_k", vbflux, dim_names=fluxk_dims, start=starts(4, nout))
    end if
    
    call neasyf_write(file_id, "vflux_tot", vflux_tot, dim_names=[time_dim], start=[nout])
# endif
  end subroutine nc_vflux