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

Errors when creating init_atmosphere

FLUIDDYNAMICS2

New member
Greetings,

When I try to compile the MPAS program I keep getting the errors below. I followed the instruction from MPAS tutorial provided by Index of /people/duda/files/mpas/sources.

91 | type(c_ptr) :: rarray_ptr


| 1


Error:
Type name 'c_ptr' at (1) is ambiguous


mpas_init_atm_static.F:288:11:





288 | rarray_ptr = c_loc(rarray)


| 1


Error:
Symbol 'rarray_ptr' at (1) has no IMPLICIT type; did you mean 'rarray'?


make[3]: *** [mpas_init_atm_static.o] Error 1


make: *** [gfortran] Error 2
 

Attachments

  • compile.log
    13.4 KB · Views: 2
Which version of the gfortran compiler are you using? Have you made any modifications to the code (Registry.xml, Fortran code, etc.)?
 
I am using gcc (Homebrew GCC 12.2.0) 12.2.0 and I have not modified the code. When I type
man -k fortran I get the fortran info below.

MPI_File_c2f(3) - Translates a C file handle to a Fortran file handle


MPI_File_f2c(3) - Translates a Fortran file handle to a C file handle


gfortran-12(1), gfortran(1) - GNU Fortran compiler


gfortran-13(1), gfortran(1) - GNU Fortran compiler

# Where to find sources for libraries


export LIBSRC=/Users/traviswashington/MPAS/sources/





# Where to install libraries


export LIBBASE=/Users/traviswashington/MPAS/mpas-libs-gnu8.3.0
 
From inside your top-level MPAS-Model source directory, can you run 'git status'? I'm asking about code modifications, because in your compilation log we've got "-DMPAS_GIT_VERSION=v7.3-dirty", with the "-dirty" part indicating local modifications.

Also, can you run 'mpif90 --version'? Perhaps the MPI compiler wrappers are pulling a different version of the compilers.

For what it's worth, I've just compiled the init_atmosphere core on a machine in my office with the GNU 12.2.0 compilers without any issue.
 
It says fatal: not a git repository (or any of the parent directories): .git. The mpif90 --version command says GNU Fortran (Homebrew GCC 13.1.0) 13.1.0. It seems to be using GCC-13 version instead of the GCC-12.
 
It may be worth seeing whether you can get mpif90 and mpicc to use the GNU 12.2.0 compilers. Unfortunately, I don't have the GNU 13.1.0 compilers available here, so I couldn't say whether there's any issues when building MPAS with those.

From which directory are you running 'git status'? If you've obtained the MPAS-Model source code with a 'git clone ...' command, and if you're running 'git status' from within that MPAS-Model directory, you should see some information about which (if any) files have been modified.
 
Yes. I don't loaded MPAS from git.

On branch master

Your branch is up to date with 'origin/master'.



Changes not staged for commit:

(use "git add <file>..." to update what will be committed)

(use "git restore <file>..." to discard changes in working directory)

modified: Makefile



Untracked files:

(use "git add <file>..." to include in what will be committed)

.DS_Store

.compile.log.swp

compile.log

mpas.log

pio2.out.dSYM/

src/iolib_installation.sh



no changes added to commit (use "git add" and/or "git commit -a")
 
Searching around a bit, it appears that the original compilation error that you're seeing
mpas_init_atm_static.F:91:13:

91 | type(c_ptr) :: rarray_ptr
| 1
Error: Type name 'c_ptr' at (1) is ambiguous
may be due to a bug in the 'gfortran' compiler; see, e.g., 103931 – Type name "c_ptr" is ambiguous when iso_c_binding is imported both directly and indirectly .

As I mentioned, the GNU 12.2.0 compilers seem to have no problem, so ensuring that you're using the 12.2.0 compilers on your system (as gcc, gfortran, mpicc, and mpif90) may be the best approach for now.
 
Greetings,

I changed my GNU version from 13.0 to 12.3 and I am still coming up with errors when I compile MPAS.
 

Attachments

  • compile.log
    8.3 KB · Views: 1
  • Screenshot 2023-05-20 at 3.21.53 PM.png
    Screenshot 2023-05-20 at 3.21.53 PM.png
    92.2 KB · Views: 3
Top