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

Compilation error

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.

alang44_gmail

New member
I have upgraded my Mac to Mojave, which forced me to wipe the hard disc. Thus I am recompiling MPAS again from scratch.
I compiled with --disable netcdf4 and followed the ppt from the summer Boulder course.

I have a compile error (for init_atmosphere and atmosphere). It looks like I am missing a library, or a path incorrectly set.
Could anyone point me in the right direction. Details of the error are below.

Thanks
Alan Gadian
alan@env.leeds.ac.uk or alang44@gmail.com

- - - -

mpif90 -D_MPI -DUNDERSCORE -DCORE_INIT_ATMOSPHERE -DMPAS_NAMELIST_SUFFIX=init_atmosphere -DMPAS_EXE_NAME=init_atmosphere_model -DMPAS_NATIVE_TIMERS -DMPAS_GIT_VERSION=v6.1 -O3 -m64 -ffree-line-length-none -fconvert=big-endian -ffree-form -fdefault-real-8 -fdefault-double-8 -c mpas_io.F -I/Users/lecag/MPAS-Model/ParallelIO-pio1_7_1/pio/include -I/Users/lecag/MPAS-Model/parallel-netcdf-1.8.1/include -I/Users/lecag/MPAS-Model/ParallelIO-pio1_7_1/pio/include -I/Users/lecag/MPAS-Model/parallel-netcdf-1.8.1/include -I../external/esmf_time_f90
mpas_io.F:30:43:

integer, parameter :: MPAS_INT_FILLVAL = NF_FILL_INT
1
Error: Parameter 'nf_fill_int' at (1) has not been declared or is a variable, which does not reduce to a constant expression
mpas_io.F:31:53:

character, parameter :: MPAS_CHAR_FILLVAL = achar(NF_FILL_CHAR)
1
Error: Parameter 'nf_fill_char' at (1) has not been declared or is a variable, which does not reduce to a constant expression
mpas_io.F:44:54:

real (kind=RKIND), parameter :: MPAS_REAL_FILLVAL = NF_FILL_DOUBLE
1
Error: Parameter 'nf_fill_double' at (1) has not been declared or is a variable, which does not reduce to a constant expression
mpas_io.F:566:79:

pio_ierr = PIO_def_dim(handle % pio_file, trim(dimname), PIO_unlimited, new_dimlist_node % dimhandle % dimid)
1
Error: Symbol 'pio_unlimited' at (1) has no IMPLICIT type
mpas_io.F:278:37:

pio_mode = PIO_64BIT_DATA
1
Error: Symbol 'pio_64bit_data' at (1) has no IMPLICIT type
make[3]: *** [mpas_io.o] Error 1
make[2]: *** [frame] Error 2
make[1]: *** [mpas_main] Error 2
make: *** [gfortran] Error 2

- - - -
 
Alan...

Older versions of NETCDF contain interfaces for Fortran and C. Newer versions contain
only the C interface. I suspect you are using one of these. You need NETCDFF which is
the Fortran version. You will still need the standard version. The Fortran version will make
C calls.
 
Kevin,
Thanks. I thought I was using an older netcdf. I will check again. Do you have any suggestion for which versions are recommended?
Thanks
Alan
 
For what it's worth, I've been using the following library versions with generally good results:
  • zlib 1.2.11
  • HDF5 1.8.20
  • parallel-netCDF 1.9.0
  • netCDF C 4.6.1
  • netCDF Fortran 4.4.4
  • PIO2 master
Attached is a script that I follow (with some variation depending on compiler) to build these libraries assuming a working MPI installation.
With the current (v6.x) MPAS build system it will also be necessary to set the environment variables MPAS_EXTERNAL_LIBS and MPAS_EXTERNAL_INCLUDES as mentioned at the bottom of the script.

Hopefully this helps!
 

Attachments

  • iolib_installation.txt
    3.3 KB · Views: 133
Micheal &Kevin

Thanks for your comments
I think the script has worked now. Can't be sure, but the libraries seem to have compiled. I have put everything in the bin and lib.
I now get an error when I try to compile on the Mac. I used the old command

make gfortran CORE=init_atmosphere

I need to sort out my variables and paths, but a quick question .. (a) are there any other env variables other than

export PIO=$LIBBASE
########################################
# Other environment vars needed by MPAS
########################################
export MPAS_EXTERNAL_LIBS="-L${LIBBASE}/lib -lhdf5_hl -lhdf5 -ldl -lz"
export MPAS_EXTERNAL_INCLUDES="-I${LIBBASE}/include"

or (b)

any options needed to compile on MAC Mojave (i.e.where I can find info)

Thanks again
Alan

p.s. error is (which implies can't find pio)

> mpas_derived_types.F:30:7:
>
> use pio
> 1
> Fatal Error: Can't open module file 'pio.mod' for reading at (1): No such file or directory
> compilation terminated.
 
`pio.mod` need you use `--enable-fortran` when you use `autoreconf` to build it. Or try using cmake.

Good luck.
 
Top