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

make convert_mpas error with gfortran

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.

maggiezj

New member
Hi MPAS Community,
I tried to install convert_mpas on IBM HPC, follow the README.md, I typed 'make', then the error arised as follow,
Which type should 'nf90_inq_varids' be implicted? Or, any other ideas?
Thanks!

Code:
jshu@login01 convert_mpas]$ make
( cd src; make FC="gfortran" FFLAGS="-O2 -ffree-form -Wall -DHAVE_NF90_INQ_VARIDS" FCINCLUDES="-g -O2 -I/data/home/jshu/Build_WRF/LIBRARIES/netcdf/include" FCLIBS="-L/data/home/jshu/Build_WRF/LIBRARIES/netcdf/lib -lnetcdff -lnetcdf -lm" )
make[1]: Entering directory `/data/home/jshu/MPAS/MPAS_tools/convert_mpas/src'
rm -f scan_input.o scan_input.mod
gfortran -O2 -ffree-form -Wall -DHAVE_NF90_INQ_VARIDS -c scan_input.F -g -O2 -I/data/home/jshu/Build_WRF/LIBRARIES/netcdf/include
scan_input.F:80.15:

        stat = nf90_inq_varids(handle % ncid, handle % num_vars, handle % varid
               1
Error: Function 'nf90_inq_varids' at (1) has no IMPLICIT type
make[1]: *** [scan_input.o] Error 1
make[1]: Leaving directory `/data/home/jshu/MPAS/MPAS_tools/convert_mpas/src'
make: *** [all] Error 2
---------------------------------------------------------------------------------------------------------------------------------------------------
the gfortran version is
Code:
$ gfortran --version
GNU Fortran (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)
Copyright (C) 2015 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING
--------------------------------------------------------------------------------------------------------------------
 
gfortran 4.8.5 is quite an old version of GCC. The version you are using is also the default Red Hat version hence the: (Red Hat 4.8.5-36) from the --version command. I recommend using a more recent version of GCC, at least any version past 7. For reference the default on Cheyenne is GCC 8.3.0, which we use most often.

In order to compile the convert_mpas utility, you'll also have to ensure that you have the `nc-config` exectuable in your PATH. It should reside in the `/bin` directory of the NetCDF installation if you've installed it yourself. If the NetCDF library was installed by an administrator and the machine has the `module` program installed then it can most often be loaded by running `module load netcdf`.
 
The issue may simply be that the netCDF library is an older version that doesn't provide the nf90_inq_varids routine. In the scan_input.F file beginning around line 79, we have some alternative code to try to accommodate older netCDF library versions.

It may be worth trying to recompile after removing the definition of the HAVE_NF90_INQ_VARIDS macro from line 2 in the top-level Makefile.

We probably should document this work-around in the README file.
 
Top