make convert_mpas error with gfortran

Questions, issues, or suggestions related to post-processing of model output.
Post Reply
Posts: 3
Joined: Sat Dec 29, 2018 2:58 pm

make convert_mpas error with gfortran

Post by maggiezj » Tue May 12, 2020 6:07 am

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

Code: Select all

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

        stat = nf90_inq_varids(handle % ncid, handle % num_vars, handle % varid
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: Select all

$ 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

Posts: 78
Joined: Mon Oct 29, 2018 5:33 pm
Location: Boulder, Co

Re: make convert_mpas error with gfortran

Post by mcurry » Tue May 12, 2020 8:09 pm

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`.

Posts: 466
Joined: Mon Feb 26, 2018 7:35 pm

Re: make convert_mpas error with gfortran

Post by mgduda » Tue May 12, 2020 8:53 pm

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.

Posts: 3
Joined: Sat Dec 29, 2018 2:58 pm

Re: make convert_mpas error with gfortran

Post by maggiezj » Tue May 12, 2020 9:00 pm

Thank you for your suggestions! I installed new version of netcdf, then it worked well.

Post Reply

Return to “Post-processing”