subroutine IcGrid2D_ncWriter_new1( &
  & cptr, cptr_icgrid2D, parallel_IO_flag &
  & ) bind(C, name='IcGrid2D_ncWriter_new1')

  use, intrinsic :: iso_c_binding

  use IcGrid_ncWriter_mod, only: &
    & IcGrid_ncWriter, IcGrid_ncWriter_Init

  use IcGrid2D_FVM_Manager, only: &
    & IcGrid2D_FVM

  use CBinding_Utility, only: c_f_logical

  implicit none
  type(c_ptr), intent(out) :: cptr
  type(c_ptr), value :: cptr_icgrid2D
  logical(c_bool), value :: parallel_IO_flag

  type(IcGrid_ncWriter), pointer :: ptr
  type(IcGrid2D_FVM), pointer :: ptr_icgrid2D

  call c_f_pointer(cptr_icgrid2D, ptr_icgrid2D)

  allocate(ptr)
  call IcGrid_ncWriter_Init(ptr, ptr_icgrid2D, c_f_logical(parallel_IO_flag))

  cptr = c_loc(ptr)

end subroutine IcGrid2D_ncWriter_new1

subroutine IcGrid3D_ncWriter_new1( &
  & cptr, cptr_icgrid3D, parallel_IO_flag &
  & ) bind(C, name='IcGrid3D_ncWriter_new1')

  use, intrinsic :: iso_c_binding

  use IcGrid_ncWriter_mod, only: &
    & IcGrid_ncWriter, IcGrid_ncWriter_Init

  use IcGrid3D_FVM_Manager, only: &
    & IcGrid3D_FVM

  use CBinding_Utility, only: c_f_logical

  implicit none
  type(c_ptr), intent(out) :: cptr
  type(c_ptr), value :: cptr_icgrid3D
  logical(c_bool), value :: parallel_IO_flag

  type(IcGrid_ncWriter), pointer :: ptr
  type(IcGrid3D_FVM), pointer :: ptr_icgrid3D

  call c_f_pointer(cptr_icgrid3D, ptr_icgrid3D)

  allocate(ptr)
  call IcGrid_ncWriter_Init(ptr, ptr_icgrid3D, c_f_logical(parallel_IO_flag))

  cptr = c_loc(ptr)

end subroutine IcGrid3D_ncWriter_new1

subroutine IcGrid_ncWriter_del( &
  & cptr &
  & ) bind(C, name='IcGrid_ncWriter_del')

  use, intrinsic :: iso_c_binding

  use IcGrid_ncWriter_mod, only: &
    & IcGrid_ncWriter, IcGrid_ncWriter_Final

  use dc_types, only: DP

  implicit none
  type(c_ptr), intent(inout) :: cptr

  type(IcGrid_ncWriter), pointer :: ptr

  call c_f_pointer(cptr, ptr)
  call IcGrid_ncWriter_Final(ptr)

  deallocate(ptr)

  cptr = c_null_ptr

end subroutine IcGrid_ncWriter_del

subroutine IcGrid_ncWriter_open_ncFile( &
  & cptr, cfile_name &
  & ) bind(C, name='IcGrid_ncWriter_open_ncFile')

  use, intrinsic :: iso_c_binding

  use IcGrid_ncWriter_mod, only: &
    & IcGrid_ncWriter, open_ncFile

  use dc_types, only: &
    & STRING

  use CBinding_Utility, only: &
    & c_f_string

  implicit none
  type(c_ptr), value :: cptr
  character(len=1, kind=c_char), intent(in) :: cfile_name(*)

  type(IcGrid_ncWriter), pointer :: ptr
  character(STRING) :: file_name

  call c_f_pointer(cptr, ptr)
  call c_f_string(cfile_name, file_name)

  call open_ncFile(ptr, file_name)

end subroutine IcGrid_ncWriter_open_ncFile

subroutine IcGrid_ncWriter_ncdef_GridData( &
  & cptr &
  & ) bind(C, name='IcGrid_ncWriter_ncdef_GridData')

  use, intrinsic :: iso_c_binding

  use IcGrid_ncWriter_mod, only: &
    & IcGrid_ncWriter, ncdef_GridData

  implicit none
  type(c_ptr), value :: cptr

  type(IcGrid_ncWriter), pointer :: ptr

  call c_f_pointer(cptr, ptr)
  call ncdef_GridData(ptr)

end subroutine IcGrid_ncWriter_ncdef_GridData

function IcGrid_ncWriter_ncdef_Field2D_Data( &
  & cptr , cptr_field &
  & ) result(varid) bind(C, name='IcGrid_ncWriter_ncdef_Field2D_Data')

  use, intrinsic :: iso_c_binding

  use IcGrid_ncWriter_mod, only: &
    & IcGrid_ncWriter, ncdef_FieldData

  use Field_IcGrid2D_Manager, only: &
    & Field_IcGrid2D

  implicit none
  type(c_ptr), value :: cptr
  type(c_ptr), value :: cptr_field
  integer(c_int) :: varid

  type(IcGrid_ncWriter), pointer :: ptr
  type(Field_IcGrid2D), pointer :: ptr_field

  call c_f_pointer(cptr, ptr)
  call c_f_pointer(cptr_field, ptr_field)

  varid = ncdef_FieldData(ptr, ptr_field)

end function IcGrid_ncWriter_ncdef_Field2D_Data

function IcGrid_ncWriter_ncdef_Field3D_Data( &
  & cptr, cptr_field &
  & ) result(varid) bind(C, name='IcGrid_ncWriter_ncdef_Field3D_Data')

  use, intrinsic :: iso_c_binding

  use IcGrid_ncWriter_mod, only: &
    & IcGrid_ncWriter, ncdef_FieldData

  use Field_IcGrid3D_Manager, only: &
    & Field_IcGrid3D

  implicit none
  type(c_ptr), value :: cptr
  type(c_ptr), value :: cptr_field
  integer(c_int) :: varid

  type(IcGrid_ncWriter), pointer :: ptr
  type(Field_IcGrid3D), pointer :: ptr_field

  call c_f_pointer(cptr, ptr)
  call c_f_pointer(cptr_field, ptr_field)

  varid = ncdef_FieldData(ptr, ptr_field)

end function IcGrid_ncWriter_ncdef_Field3D_Data

subroutine IcGrid_ncWriter_end_ncdef( &
  & cptr &
  & ) bind(C, name='IcGrid_ncWriter_end_ncdef')

  use, intrinsic :: iso_c_binding

  use IcGrid_ncWriter_mod, only: &
    & IcGrid_ncWriter, end_ncdef

  implicit none
  type(c_ptr), value :: cptr

  type(IcGrid_ncWriter), pointer :: ptr

  call c_f_pointer(cptr, ptr)
  call end_ncdef(ptr)

end subroutine IcGrid_ncWriter_end_ncdef

subroutine IcGrid_ncWriter_ncdef_Simulation_Parameter( &
  & cptr,                                    &
  & integration_time, time_step, output_tick &
  & ) bind(C, name='IcGrid_ncWriter_ncdef_Simulation_Parameter')

  use, intrinsic :: iso_c_binding

  use IcGrid_ncWriter_mod, only: &
    & IcGrid_ncWriter, ncdef_Simulation_Parameter

  use dc_types, only: DP

  implicit none
  type(c_ptr), value :: cptr
  real(DP), value :: integration_time
  real(DP), value :: time_step
  real(DP), value :: output_tick

  type(IcGrid_ncWriter), pointer :: ptr

  call c_f_pointer(cptr, ptr)
  call ncdef_Simulation_Parameter( &
    & ptr, integration_time, time_step, output_tick &
    & )

end subroutine IcGrid_ncWriter_ncdef_Simulation_Parameter

subroutine IcGrid_ncWriter_write_GridData( &
  & cptr &
  & ) bind(C, name='IcGrid_ncWriter_write_GridData')

  use, intrinsic :: iso_c_binding

  use IcGrid_ncWriter_mod, only: &
    & IcGrid_ncWriter, write_GridData

  implicit none
  type(c_ptr), value :: cptr

  type(IcGrid_ncWriter), pointer :: ptr

  call c_f_pointer(cptr, ptr)
  call write_GridData(ptr)

end subroutine IcGrid_ncWriter_write_GridData

subroutine IcGrid_ncWriter_write_Field2D_Data( &
  & cptr, varid, cptr_field &
  & ) bind(C, name='IcGrid_ncWriter_write_Field2D_Data')

  use, intrinsic :: iso_c_binding

  use IcGrid_ncWriter_mod, only: &
    & IcGrid_ncWriter, write_FieldData

  use Field_IcGrid2D_Manager, only: &
    & Field_IcGrid2D

  implicit none
  type(c_ptr), value :: cptr
  integer(c_int), value :: varid
  type(c_ptr), value :: cptr_field


  type(IcGrid_ncWriter), pointer :: ptr
  type(Field_IcGrid2D), pointer :: ptr_field

  call c_f_pointer(cptr, ptr)
  call c_f_pointer(cptr_field, ptr_field)

  call write_FieldData(ptr, varid, ptr_field)

end subroutine IcGrid_ncWriter_write_Field2D_Data

subroutine IcGrid_ncWriter_write_Field3D_Data( &
  & cptr, varid, cptr_field &
  & ) bind(C, name='IcGrid_ncWriter_write_Field3D_Data')

  use, intrinsic :: iso_c_binding

  use IcGrid_ncWriter_mod, only: &
    & IcGrid_ncWriter, write_FieldData

  use Field_IcGrid3D_Manager, only: &
    & Field_IcGrid3D

  implicit none
  type(c_ptr), value :: cptr
  integer(c_int), value :: varid
  type(c_ptr), value :: cptr_field


  type(IcGrid_ncWriter), pointer :: ptr
  type(Field_IcGrid3D), pointer :: ptr_field

  call c_f_pointer(cptr, ptr)
  call c_f_pointer(cptr_field, ptr_field)

  call write_FieldData(ptr, varid, ptr_field)

end subroutine IcGrid_ncWriter_write_Field3D_Data

subroutine IcGrid_ncWriter_increase_recorde_counter( &
  & cptr &
  & ) bind(C, name='IcGrid_ncWriter_increase_recorde_counter')

  use, intrinsic :: iso_c_binding

  use IcGrid_ncWriter_mod, only: &
    & IcGrid_ncWriter, increase_recorde_counter

  implicit none
  type(c_ptr), value :: cptr

  type(IcGrid_ncWriter), pointer :: ptr

  call c_f_pointer(cptr, ptr)
  call increase_recorde_counter(ptr)

end subroutine IcGrid_ncWriter_increase_recorde_counter

subroutine IcGrid_ncWriter_close_ncFile( &
  & cptr &
  & ) bind(C, name='IcGrid_ncWriter_close_ncFile')

  use, intrinsic :: iso_c_binding

  use IcGrid_ncWriter_mod, only: &
    & IcGrid_ncWriter, close_ncFile

  implicit none
  type(c_ptr), value :: cptr

  type(IcGrid_ncWriter), pointer :: ptr

  call c_f_pointer(cptr, ptr)
  call close_ncFile(ptr)

end subroutine IcGrid_ncWriter_close_ncFile
