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

Reading MPAS output with NetCDF Fortran


New member
Hi all,

I am aware that there is the convert_mpas utility and I have been using that just fine, but I would like to take it to the next level and actually read the native MPAS grid and process that. I am using the NetCDF Fortran library, and I am able to see all the variables with the nf90_inquire_variable and read the dimensions with nf90_inquire_dimension, but when I actually call the nf90_get_var on one of the 3d variables (in this case, pressure), I get this message:

NetCDF: Start+count exceeds dimension bound

Has anyone been able to successfully read MPAS output with this utility? This code works on the converted latlon grid just fine so I'm not really doing anything differently. I realize this might be a limitation of the NetCDF Fortran library. Maybe I'm just looking for confirmation on this.

Actually, the convert_mpas program uses the Fortran90 interface to the NetCDF library for reading the native MPAS output, so there shouldn't be any limitations in the Fortran NetCDF library interface.

In the past, I've found it helpful in debugging these sorts of errors to add write statements just before the call to nf90_get_var to print out the start and count values that are being used.