Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

init_atmosphere can't open grid file


New member
I have tried to follow the Tutorial instructions in the lower part of MPAS Tutorial — Practice Session Guide

init_atmosphere and atmosphere are successfully built as executables.

However, when I try to make the static file, I get this error in the
CRITICAL ERROR: Could not open input file '' to read mesh fields

By using print statements, I have traced this error to lines 325-330 of mpas_io.F
         pio_ierr = PIO_openfile(ioContext % pio_iosystem, MPAS_io_open % pio_file, pio_iotype, trim(filename), PIO_nowrite)
      if (pio_ierr /= PIO_noerr) then
         if (present(ierr)) ierr = MPAS_IO_ERR_PIO
      end if
I am using version 11.2 (also tried 12.2) of the GNU compilers, NetCDF-C 4.8.1, NetCDF-Fortran 4.5.4 (also tried 4.6.0), PNetCDF 1.12.3, and PIO 2.5.10.
I have tried changing the iotype in namelist.init_atmosphere, set DEBUG=true, tried double precision etc.

The one thing I have not managed to do is install PIO 2.6, because I can't manage to do it within my current environment.

If anyone has:
1. An idea of what might be going wrong.
2. Tips for testing PIO in a conda environment (beyond the test in the MPAS-A makefile), please let me know.
I am in the process of debugging this with gdb. The issue seems to be that the mesh_iotype setting of 4 results in some sort of problem. Changing to a mesh_iotype of 3 allows some reading of the file, but it is not yet a complete fix.
The root issue appears to be that my PNETCDF library does not work. Therefore, the application was trying to open things with PNETCDF and failing. Specifying io_type as something else in the streams file would have evaded this problem, but I kept writing iotype...
Hello,sorry to bother you.i have a similar problem though i use MPAS-Ocean.I have netcdf(4.1.3),pnetcdf(1.4.0),pio(1.6.3).The version may be old,but i once ran the model successfully on another server.I tried the mesh made by myself and the mesh provided by MPAS,i think that the mesh is intact.Could you share the method you used to handle the problem? thanks!
So with the wisdom of experience, let me explain this problem in more detail. I had installed pnetcdf (1.12.3) and pio (2.5.10) using conda. The conda install of pio at the time defaulted to lacking PnetCDF support. (You can check this by looking for libpio.settings on your machine.) I got around this problem by adding io_type="netcdf" to declarations within streams.init_atmosphere.

As in:

<immutable_stream name="input"




input_interval="initial_only" />

I don't recommend doing this. I experienced significant performance issues with the speed and reliability of file writing. The immediate problem could have been fixed by installing a version of pio with PnetCDF support, but...

The best way is to upgrade to version 8 of MPAS-A and use the Simple MPAS Input/Output Layer (SMIOL) and bypass the need for PIO. You do this by simply setting the PIO environment variable to empty prior to compilation.