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

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
AHIC
Posts: 12
Joined: Thu Sep 27, 2018 10:31 am

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

Post 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 ?
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

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

Post by Yvan Fournier »

Hello,

Are you using user subroutines ?

Regards,

Yvan
AHIC
Posts: 12
Joined: Thu Sep 27, 2018 10:31 am

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

Post 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)
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

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

Post by Yvan Fournier »

Hello,

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

Regards,

Yvan
AHIC
Posts: 12
Joined: Thu Sep 27, 2018 10:31 am

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

Post by AHIC »

It's seems to be correct:

double precision, dimension(:,:), pointer :: cvar_vel
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

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

Post 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
AHIC
Posts: 12
Joined: Thu Sep 27, 2018 10:31 am

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

Post 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.
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

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

Post by Yvan Fournier »

Hello,

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

Regards,

Yvan
AHIC
Posts: 12
Joined: Thu Sep 27, 2018 10:31 am

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

Post 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,
Attachments
error.txt
(781 Bytes) Downloaded 159 times
compile.log
(21.56 KiB) Downloaded 159 times
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

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

Post by Yvan Fournier »

Hello,

This is still not sufficient information to work with.

Regards,

Yvan
Post Reply