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

Compiling MPAS 7.0 init_atmosphere

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.

chris_riedel

New member
Hello,

I am trying to compile the newest version of MPAS 7.0. When I try to compile the init_atmosphere (make gfortran CORE=init_atmosphere) I get the following errors....

mpas_init_atm_static.F:288.20:

rarray_ptr = c_loc(rarray)
1
Error: Argument 'rarray' to 'c_loc' at (1) must be an associated scalar POINTER
mpas_init_atm_static.F:402.20:

rarray_ptr = c_loc(rarray)
1
Error: Argument 'rarray' to 'c_loc' at (1) must be an associated scalar POINTER
mpas_init_atm_static.F:490.20:

rarray_ptr = c_loc(rarray)
1
Error: Argument 'rarray' to 'c_loc' at (1) must be an associated scalar POINTER
mpas_init_atm_static.F:605.20:

rarray_ptr = c_loc(rarray)
1
Error: Argument 'rarray' to 'c_loc' at (1) must be an associated scalar POINTER
mpas_init_atm_static.F:692.23:

rarray_ptr = c_loc(rarray)
1
Error: Argument 'rarray' to 'c_loc' at (1) must be an associated scalar POINTER
mpas_init_atm_static.F:789.23:

rarray_ptr = c_loc(rarray)
1
Error: Argument 'rarray' to 'c_loc' at (1) must be an associated scalar POINTER
mpas_init_atm_static.F:886.23:

rarray_ptr = c_loc(rarray)
1
Error: Argument 'rarray' to 'c_loc' at (1) must be an associated scalar POINTER
mpas_init_atm_static.F:985.23:

rarray_ptr = c_loc(rarray)
1
Error: Argument 'rarray' to 'c_loc' at (1) must be an associated scalar POINTER
mpas_init_atm_static.F:1082.23:

rarray_ptr = c_loc(rarray)
1
Error: Argument 'rarray' to 'c_loc' at (1) must be an associated scalar POINTER
mpas_init_atm_static.F:1185.23:

rarray_ptr = c_loc(rarray)

I have not updated any of my compilers or libs. I am trying to compile MPAS with the following compilers and libs...

gfortran/gcc 4.8
PIO 1.7
Any thoughts on what could be causing these errors??

Chris Riedel
 
Hi Chris,

Its most likely do to your version of gcc. MPAS 7.0 updated some of the way we handled calling C code via the Fortran 2003 ISO_C_BINDING module and it appears that 4.8 contained a bug within the C_LOC function (see GCC Bug #50269). GCC 4.X looks like it contained most of Fortran 2003's standards, but it still looks like it contained a few bugs.

We recommend installing a newer version of GCC and using that. Any version of GCC 8 would work well. That's what we use here and its been thoroughly tested. We also know that GCC 5.3 works well.
 
Top