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

  use, intrinsic :: iso_c_binding

  use IcGrid_ncReader_mod, only: &
    & IcGrid_ncReader, IcGrid_ncReader_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_ncReader), pointer :: ptr
  type(IcGrid2D_FVM), pointer :: ptr_icgrid2D

  allocate(ptr)
  call c_f_pointer(cptr_icgrid2D, ptr_icgrid2D)
  call IcGrid_ncReader_Init(ptr, ptr_icgrid2D, c_f_logical(parallel_IO_flag))

  cptr = c_loc(ptr)

end subroutine IcGrid2D_ncReader_new1

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

  use, intrinsic :: iso_c_binding

  use IcGrid_ncReader_mod, only: &
    & IcGrid_ncReader, IcGrid_ncReader_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_ncReader), pointer :: ptr
  type(IcGrid3D_FVM), pointer :: ptr_icgrid3D

  allocate(ptr)
  call c_f_pointer(cptr_icgrid3D, ptr_icgrid3D)
  call IcGrid_ncReader_Init(ptr, ptr_icgrid3D, c_f_logical(parallel_IO_flag))

  cptr = c_loc(ptr)


end subroutine IcGrid3D_ncReader_new1

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

  use, intrinsic :: iso_c_binding

  use IcGrid_ncReader_mod, only: &
    & IcGrid_ncReader, IcGrid_ncReader_Final

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

  type(IcGrid_ncReader), pointer :: ptr

  call c_f_pointer(cptr, ptr)
  call IcGrid_ncReader_Final(ptr)
  deallocate(ptr)

  cptr = c_null_ptr

end subroutine IcGrid_ncReader_del

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

  use, intrinsic :: iso_c_binding

  use dc_types, only: &
    & STRING

  use IcGrid_ncReader_mod, only: &
    & IcGrid_ncReader, open_ncFile

  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_ncReader), 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_ncReader_open_ncFile

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

  use, intrinsic :: iso_c_binding

  use IcGrid_ncReader_mod, only: &
    & IcGrid_ncReader, read_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_ncReader), pointer :: ptr

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

end subroutine IcGrid_ncReader_read_Simulation_Parameter

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

  use, intrinsic :: iso_c_binding

  use IcGrid_ncReader_mod, only: &
    & IcGrid_ncReader, read_GridData

  implicit none
  type(c_ptr), value :: cptr

  type(IcGrid_ncReader), pointer :: ptr

  call c_f_pointer(cptr, ptr)
  call read_GridData(ptr)

end subroutine IcGrid_ncReader_read_GridData

subroutine IcGrid_ncReader_read_Field2D_Data( &
  & cptr, cname, cptr_field, time_level &
  & )  bind(C, name='IcGrid_ncReader_read_Field2D_Data')

  use, intrinsic :: iso_c_binding

  use dc_types, only: &
    & TOKEN

  use IcGrid_ncReader_mod, only: &
    & IcGrid_ncReader, read_FieldData

  use Field_IcGrid2D_Manager, only: &
    & Field_IcGrid2D

  use CBinding_utility, only: &
    & c_f_string

  implicit none
  type(c_ptr), value :: cptr
  character(len=1, kind=c_char), intent(in) :: cname(*)
  type(c_ptr), value :: cptr_field
  integer, intent(in) :: time_level

  type(IcGrid_ncReader), pointer :: ptr
  type(Field_IcGrid2D), pointer :: ptr_field
  character(TOKEN) :: name

  call c_f_pointer(cptr, ptr)
  call c_f_pointer(cptr_field, ptr_field)
  call c_f_string(cname, name)

  call read_FieldData(ptr, name, ptr_field, time_level)

end subroutine IcGrid_ncReader_read_Field2D_Data

subroutine IcGrid_ncReader_read_Field3D_Data( &
  & cptr, cname, cptr_field, time_level &
  & )  bind(C, name='IcGrid_ncReader_read_Field3D_Data')

  use, intrinsic :: iso_c_binding

  use dc_types, only: &
    & TOKEN

  use IcGrid_ncReader_mod, only: &
    & IcGrid_ncReader, read_FieldData

  use Field_IcGrid3D_Manager, only: &
    & Field_IcGrid3D

  use CBinding_utility, only: &
    & c_f_string

  implicit none
  type(c_ptr), value :: cptr
  character(len=1, kind=c_char), intent(in) :: cname(*)
  type(c_ptr), value :: cptr_field
  integer, intent(in) :: time_level

  type(IcGrid_ncReader), pointer :: ptr
  type(Field_IcGrid3D), pointer :: ptr_field
  character(TOKEN) :: name

  call c_f_pointer(cptr, ptr)
  call c_f_pointer(cptr_field, ptr_field)
  call c_f_string(cname, name)

  call read_FieldData(ptr, name, ptr_field, time_level)

end subroutine IcGrid_ncReader_read_Field3D_Data

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

  use, intrinsic :: iso_c_binding

  use IcGrid_ncReader_mod, only: &
    & IcGrid_ncReader, close_ncFile

  implicit none
  type(c_ptr), value :: cptr

  type(IcGrid_ncReader), pointer :: ptr

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

end subroutine IcGrid_ncReader_close_ncFile
