title: Parallel read/write of NetCDF file using Fortran and mpi
body: <p>I'm trying to implement parallel read and write of NetCDF-4 files.</p>
  
  <p>For this purpose I have installed netcdf-fortran and mpi. 
  I have also installed pnetcdf (I don't know if I need it).
  All the installation were done via package manager (I am using Debian 10).</p>
  
  <p>When I try to read normally (without parallelization) the NetCDF files everything is going well.
  However, when I try to use mpi I receive the following message: 
  "NetCDF: Parallel operation on file opened for non-parallel access"
  I tried to run the following example (because probably my program was erroneous).
  <a href="https://github.com/Unidata/netcdf-fortran/blob/master/examples/F90/simple_xy_par_rd.f90" rel="nofollow noreferrer">https://github.com/Unidata/netcdf-fortran/blob/master/examples/F90/simple_xy_par_rd.f90</a>
  and I received the same message ...
  What does it means?</p>
  
  <p>I am using gfortran, and in order to compile the program I type the following:</p>
  
  <p><code>mpif90  -o executablename -I/usr/include/  mycode.f90 -lnetcdff -lnetcdf -lpnetcdf</code></p>
  
  <p>and after:</p>
  
  <p><code>mpirun ./executablename</code></p>
  
  <p>Am I doing something wrong?</p>
  
  <p>I have never used mpi before, so maybe I have messed up the installation.</p>
  
  <p>Is there another way to parallel read/write netcdf files using Fortran?</p>