pfio_open_close.F90 Source File


This file depends on

sourcefile~~pfio_open_close.f90~~EfferentGraph sourcefile~pfio_open_close.f90 pfio_open_close.F90 sourcefile~mapl_exceptionhandling.f90 MAPL_ExceptionHandling.F90 sourcefile~pfio_open_close.f90->sourcefile~mapl_exceptionhandling.f90 sourcefile~pfio.f90 pFIO.F90 sourcefile~pfio_open_close.f90->sourcefile~pfio.f90

Source Code

#define I_AM_MAIN
#include "MAPL_ErrLog.h"
#include "unused_dummy.H"

program main
  use MAPL_ExceptionHandling
  use pFIO
  implicit none

  type (FileMetadata) :: file_metadata
  type (NetCDF4_FileFormatter) :: formatter
  integer :: status

  call formatter%open('test_in.nc4', pFIO_READ, rc=status)
  _ASSERT(status==0, "Failed to open 'test_in.nc4'")
  file_metadata = formatter%read(rc=status)
  _ASSERT(status==0, "Failed while reading 'test_in.nc4'")
  call formatter%close(rc=status)
  _ASSERT(status==0, "Wrong in closing test_in.nc4")
  print*, "Successfully opened, read and closed 'test_in.nc4'."
end program