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

Could not open to read mesh fields

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.



This is the most basic of errors but I am stuck so here goes. (note: I did search for this topic and I didn't see it)

I am getting the error seen in the subject line when I run:

mpirun -np 1 init_atmosphere_model

I have tried using the full path to the file ( and just the filename itself. Where I run the command above, I can do "more' and confirmed the file is accessible so not sure why it is complaining.

thanks for any ideas --

Hi Steve,

More perhaps is not the best program to use to determine if a NetCDF file has been corrupted or not. As you suggest (On the user message board), the output is unreadable. This is because more will read whatever kind of file you give it, regardless of the contents; it has no 'idea' on the structure of a NetCDF file.

When I run more on a valid NetCDF file, it lists the strings it find within it, starting with CDF (which is the file format). However, as a proof of concept I took a copy of a mesh file and deliberately corrupted it by editing it with a text editor and inserting random characters. Running it through more produced the same output: CDF and the list of other strings.

A better application to determine if your file is corrupt or not would be the ncdump utility provided in the NetCDF install. Since you were able to compile the model successfully, than you should have this application at the bin directory of the path that you set for the $NETCDF environment variable. If you use ncdump on your file:

ncdump -h

It will dump the header information of the netcdf file to your screen. On my corrupted file, I get a message such as (another message may be shown):

ncdump: Argument list too long

I'd first check that the file looks valid. The meshes from are all valid and are used quite regularly and if you downloaded your mesh from here it makes me wonder if another issue is at fault.

Before diving too deeply in, can you confirm that the permissions on the file are correct? You'll need to have at least read permissions on the file.
Hi - thanks for the great information you provide. I have to apologize for this question. It turned out I had not compiled PIO correctly. Went back and rebuilt that and now it is reading the file ok. I am now on to running atmosphere_model and have hit a glitch, but will post a question with a different