Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: How to use the block of private vector 'PRIVE' ?

How to use the block of private vector 'PRIVE' ? 13 years 4 months ago #1817

  • laroche
  • laroche's Avatar
Hello,

I ‘m trying to use the vector PRIVE1 in my fortran file to save a new variable in the result file.
In my fortran file, I have copied the subroutines « NOM_VAR_TELEMAC2D » and « PRERES_TELEMAC2D ». In the "cas file" I have selected de variable N and set the variable "number of private arrays" to 1.
In « PRERES_TELEMAC2D » I use the BIEF library (CPSTVC) to call the vector PRIVE1 and I calculate my new variable (TAU).

I have written :
IF((LEO.AND.SORLEO(23)).OR.(IMP.AND.SORIMP(23))) THEN
CALL CPSTVC(ZF,PRIVE1)
DO I=1,NPOIN
CHEZY%R(I)=CHESTR%R(I)* H%R(I)**(1/6)
TAU%R(I)=(1000*9.81*T6%R(I)**2)/(CHEZY%R(I)**2)
PRIVE%ADR(1)%P%R(I)=TAU%R(I)
ENDDO
ENDIF

An error is detected during the compilation :
CALL CPSTVC(ZF,PRIVE1)
1
Error: Type mismatch in argument 'y' at (1); passed REAL(8) to TYPE(bief_obj)
ERREUR A LA COMPILATION

The special declaration in PRERES_TELEMAC2D  subroutine is :
TYPE(BIEF_OBJ), POINTER :: CHEZY, TAU

Thank for your help !!!

christophe
The administrator has disabled public write access.

Re:How to use the block of private vector 'PRIVE' ? 13 years 4 months ago #1835

  • sebourban
  • sebourban's Avatar
  • OFFLINE
  • Administrator
  • Principal Scientist
  • Posts: 814
  • Thank you received: 219
Can you share your PRINCI file with us ? Although you have put a lot of details in your message, I would like to have a look at the whole file.

Thanks.
The administrator has disabled public write access.

Re:How to use the block of private vector 'PRIVE' ? 13 years 4 months ago #1839

  • Chris Cawthorn
  • Chris Cawthorn's Avatar
Hi Christophe,

PRIVE1 is a pointer to a DOUBLE array, specifically
PRIVE%ADR(I)%P%R. This link is set in POINT_TELEMAC2D.

When you call CPSTVC, it should get two arguments that are both BIEF_OBJ objects. Because PRIVE1 is a double array, you got that error message during compilation.

If you replace
CALL CPSTVC(ZF,PRIVE1)
with
CALL CPSTVC(ZF,PRIVE%ADR(1)%P)
then you should hopefully have more success.

Hope that helps!
Chris
The administrator has disabled public write access.

Re:How to use the block of private vector 'PRIVE' ? 13 years 3 months ago #2113

  • jmhervouet
  • jmhervouet's Avatar
Hello,

That's it Chris !

I'll add that it is very curious that ZF is seen by the compiler as real*8, because it should there of type(bief_obj).

An other problem is that TAU and CHEZY are not really useful, and should be allocated by a call to BIEF_ALLVEC before using their %R part.

I would just suggest that TAU and CHEZY are declared as double precision, they need not be an array because they are just intermediate variables aren't they ?

With best regards,

Jean-Michel Hervouet
The administrator has disabled public write access.

Re: How to use the block of private vector 'PRIVE' ? 13 years 3 months ago #2108

  • laroche
  • laroche's Avatar
Hi,

I just come back from holidays.

Sebastien, here is it the fortran file.

fortran_T2D_v2.f


Chris with your solution, the compilation is Ok, but these is an error in the first iteration.

The message is :
=======================================================================
ITERATION 0 TEMPS : 0.0000 S
PRERES : NOMBRE DE COURANT MAXIMUM : 0.000000
0.08user 5.54system 0:09.23elapsed 61%CPU (0avgtext+0avgdata 148672maxresident)k
696inputs+0outputs (3major+9676minor)pagefaults 0swaps
## Erreur : Fin anormale : time ./out2276_gFortran.exe :2816
## Error : System command failed for /home/sysadm/sharepoint/Test1_T_E/cas.txt2276_tmp/telemac2d.bat :6400
________________________________________________________
Execution terminee: telemac2d.bat
________________________________________________________
No compilation/linking/file errors detected.
Execution errors detected.
Please see messages in stdout above or study stderr output.

Working directory: /home/sysadm/sharepoint/Test1_T_E/cas.txt2276_tmp
can be manually deleted with: /home/sysadm/sharepoint/Test1_T_E/delete_cas.txt2276

Returning exit status 1

===================================================================

Thank for your help.
The administrator has disabled public write access.

Re: How to use the block of private vector 'PRIVE' ? 13 years 3 months ago #2109

  • laroche
  • laroche's Avatar
with the file...


File Attachment:

File Name: fortran_T2D_v2.txt
File Size: 25 KB



Thank you !
The administrator has disabled public write access.

Re: How to use the block of private vector 'PRIVE' ? 13 years 3 months ago #2112

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi
In your code, you use T6.
I'm not sure but if in your result file you don't ask for the Scalar Velocity (M in your steering file) I think T6 was not compute. That could generate a crash when you try to use it.
Try to replace T6 by the Velocity.

Hope this helps
Christophe
The administrator has disabled public write access.

Re: How to use the block of private vector 'PRIVE' ? 13 years 3 months ago #2110

  • sebourban
  • sebourban's Avatar
  • OFFLINE
  • Administrator
  • Principal Scientist
  • Posts: 814
  • Thank you received: 219
Nice to see you back !

Just a thought -- did you add the keyword NUMBER OF PRIVATE ARRAY = 1 in your CAS file ?

Sébastien.
The administrator has disabled public write access.

Re: How to use the block of private vector 'PRIVE' ? 13 years 3 months ago #2111

  • laroche
  • laroche's Avatar
yes I did !!
The administrator has disabled public write access.

Re: How to use the block of private vector 'PRIVE' ? 13 years 3 months ago #2115

  • Chris Cawthorn
  • Chris Cawthorn's Avatar
I agree with Jean-Michel - the crash looks to be coming from trying to use the unallocated double arrays TAU%R and CHEZY%R. I also don't see why you need these to be arrays for your current calculation - a simple double precision variable would suffice.

If for some reason you do want TAU and CHEZY to be arrays, then inserting the lines
TAU   => T12
CHEZY => T13
after your variable declarations in PRERES_TELEMAC2D should reference TAU and CHEZY to temporary BIEF vectors (with dimension NPOIN). Your existing code should then work without further modification.

Good luck,
Chris
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: pham

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.