# jobcomp Error: Rank mismatch

Hello everybody! I hope they are fine!

I have a problem compiling my simulation. I'm just running a simulation of physical parameters for the Gulf of California inlet area. Previously it ran without any problem, but lately, I get the following error:

% =================================================================================================== /usr/local/netcdf-f/include/netcdf.inc:1277:38: warning: missing terminating ' character [-Winvalid-pp-token] integer nf_ecantread ! Can't read. ^ /usr/local/netcdf-f/include/netcdf.inc:1279:38: warning: missing terminating ' character [-Winvalid-pp-token] integer nf_ecantwrite ! Can't write. ^ /usr/local/netcdf-f/include/netcdf.inc:1281:38: warning: missing terminating ' character [-Winvalid-pp-token] integer nf_ecantcreate ! Can't create. ^ 3 warnings generated. gfortran -c -O3 -fdefault-real-8 -fdefault-double-8 put_global_atts_.f -o put_global_atts.o put_global_atts_.f:1235:64:

1218 | & 1, theta_s) | 2
...... 1235 | & sc_w) | 1 Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1) put_global_atts_.f:1239:64:

1218 | & 1, theta_s) | 2
...... 1239 | & Cs_w) | 1 Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1) put_global_atts_.f:1242:62:

1218 | & 1, theta_s) | 2
...... 1242 | ierr=nf_put_att_double(ncid,nf_global,'sc_r',nf_ftype,N,sc_r) | 1 Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1) put_global_atts_.f:1245:62:

1218 | & 1, theta_s) | 2
...... 1245 | ierr=nf_put_att_double(ncid,nf_global,'Cs_r',nf_ftype,N,Cs_r) | 1 Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1) gmake: * [Makedefs:14: put_global_atts.o] Error 1

% =================================================================================================== The parameters I have been using are:

% Vertical grid parameters % theta_s = 7; theta_b = 0.3; hc = 10.; vtransform = 2.;

I don't know why right now I have this error. Someone can help me o guide me with my problem!?

edit retag close merge delete

Sort by » oldest newest most voted

Hi:

I am having this problem, too, with a fresh download of v1.1. It seems to be a new feature of the latest gfortran:

https://gcc.gnu.org/gcc-10/porting_to...

You can add this option to the compiler options on line 145 of jobcomp:

-fallow-argument-mismatch

and be careful to preserve the ending whitespace there.

-Ed

more

Hi, Thank you so much for your help Ed. I followed your recommendation, but I have the same error. Maybe I didn't add it in the right place. These are my lines in jobcomp file: # # compiler options # FC=gfortran -fallow-argument-mismatch # Can you check if is it correct? please! Thanks again!

( 2021-08-09 22:17:50 +0200 )edit

I can't tell from your message. It looks as if the "FC=" statement is inside a comment block. Can you post your entire file as an attachment here? Alternately, you can email it to me directly at edwarddzaron@oregonstate.edu, and I will compare it with mine.

( 2021-08-09 22:41:54 +0200 )edit

Thanks Ed, if you don't mind I'll email it to you because I don't know how to attach it here!

( 2021-08-09 22:46:41 +0200 )edit

And here for MPI (mpif90)

    FFLAGS1="$FFLAGS1$MPIINC -fallow-argument-mismatch"

more

Seems it is needed here (now compiles serial and openmp)

    elif [[ \$FC == gfortran ]] ; then