Page 1 of 1

Fortran pointer of rank 1 requested for values of field "velocity", which have rank 2

Posted: Mon Mar 04, 2019 5:57 pm
by AHIC
hello,

I got the error message:


../../../../src/code_saturne-4.0.8/src/base/cs_field.c:987: Fatal error.

Fortran pointer of rank 1 requested for values of field "velocity",
which have rank 2.


How can i fix it please ?

Re: Fortran pointer of rank 1 requested for values of field "velocity", which have rank 2

Posted: Tue Mar 05, 2019 1:26 am
by Yvan Fournier
Hello,

Are you using user subroutines ?

Regards,

Yvan

Re: Fortran pointer of rank 1 requested for values of field "velocity", which have rank 2

Posted: Tue Mar 05, 2019 4:14 am
by AHIC
Yes, and i have already check if i have the good syntax for the call of the velocity field in my subroutine file.
If i have understood correctly:
field_get_val_s for scalar
field_get_val_v for vector
are there an conflict between the id fields ?

subroutine 1:

call field_get_val_s(ivarfl(isca(1)), x_var) ! champ X
call field_get_val_s(ivarfl(isca(2)), y_var) ! champ Y
call field_get_val_s(ivarfl(isca(3)), z_var) ! champ Z
call field_get_val_v(ivarfl(iu), cvar_vel)

subroutine 2:
call field_get_val_s(icrom, crom) ! champ w
call field_get_val_s(ivarfl(ivart), cvar_vart)
call field_get_val_s(ivarfl(isca(1)), x_var) ! champ x
call field_get_val_s(ivarfl(isca(2)), y_var) ! champ y
call field_get_val_s(ivarfl(isca(3)), z_var) ! champ z
call field_get_val_s(iprpfl(itempc), pro_tempc)

Re: Fortran pointer of rank 1 requested for values of field "velocity", which have rank 2

Posted: Tue Mar 05, 2019 2:55 pm
by Yvan Fournier
Hello,

Did you check the definition/declaration of cvar_vel ? It should have dimension(:,:) and not dimension(:).

Regards,

Yvan

Re: Fortran pointer of rank 1 requested for values of field "velocity", which have rank 2

Posted: Tue Mar 05, 2019 4:57 pm
by AHIC
It's seems to be correct:

double precision, dimension(:,:), pointer :: cvar_vel

Re: Fortran pointer of rank 1 requested for values of field "velocity", which have rank 2

Posted: Tue Mar 05, 2019 5:31 pm
by Yvan Fournier
Hello,

Do you have a backtrace ? The error is probably due to some wrong value of ivarfl(j) where j might match an array not used here.

Using the "get_by_name" varients of the field access functions would be safer here (but I am not sure they were present in Code_Saturne v4.0).

Regards,

Yvan

Re: Fortran pointer of rank 1 requested for values of field "velocity", which have rank 2

Posted: Tue Mar 05, 2019 6:04 pm
by AHIC
When i try to remove this line, i always have the same error.

../../../../src/code_saturne-4.0.8/src/base/cs_field.c:987: Fatal error.

Fortran pointer of rank 1 requested for values of field "velocity",
which have rank 2.

Re: Fortran pointer of rank 1 requested for values of field "velocity", which have rank 2

Posted: Wed Mar 06, 2019 12:52 am
by Yvan Fournier
Hello,

I do not have enough information to work with to provide relevant suggestions.

Regards,

Yvan

Re: Fortran pointer of rank 1 requested for values of field "velocity", which have rank 2

Posted: Thu Mar 07, 2019 4:53 pm
by AHIC
In attachements file: compile and error log file.
When i remove the problematic subroutine file (cs user extra operation),
the compilation works.

best regards,

Re: Fortran pointer of rank 1 requested for values of field "velocity", which have rank 2

Posted: Thu Mar 07, 2019 8:25 pm
by Yvan Fournier
Hello,

This is still not sufficient information to work with.

Regards,

Yvan