Hello,
In your case I would advise to take subroutine utimp (from library telemac3d) in your FORTRAN FILE and implement it, it is called at every time step. There you can build the average velocities in private arrays.
For example for averaging U and V, you ask for 2 private arrays in the parameter file:
NUMBER OF PRIVATE ARRAYS : 2
then in UTIMP you can average in time double precision arrays U%R and V%R, using arguments LT or TIME, and put the average into :
PRIVE%ADR(1)%P%R and PRIVE%ADR(2)%P%R
Then you will get these values in your results file by adding P1 and P2 in the list of variables for graphic printouts.
Here is a tentative short code for an averaging over 10 time steps, to be put in UTIMP:
! Initialising to 0 for time steps 1, 11, 21, etc.
IF(LT-1.EQ.10*((LT-1)/10)) THEN
CALL OS('X=0 ',X=PRIVE%ADR(1)%P)
CALL OS('X=0 ',X=PRIVE%ADR(2)%P)
ENDIF
! adding during 10 time steps
CALL OS('X=X+Y ',X=PRIVE%ADR(1)%P,Y=U)
CALL OS('X=X+Y ',X=PRIVE%ADR(2)%P,Y=V)
! averaging after 10, 20, 30 time steps, etc.
IF(LT.EQ.10*(LT/10)) THEN
CALL OS('X=CX ',X=PRIVE%ADR(1)%P,C=0.1D0)
CALL OS('X=CX ',X=PRIVE%ADR(2)%P,C=0.1D0)
ENDIF
You can refer to the guide for programming in the Telemac system which is available on this website, to understand what is OS, what is %ADR and %R.
With best regards,
Jean-Michel Hervouet
P.S. sometimes the spaces are not clear in the posts, so:
'X=CX ' we have into quotes X=CX followed by 4 spaces.