Dear JMH,
Your remark did solve the problem regarding the calculation of water depth. However, the problem regarding limwac still persists.
This is my addition to limwac.f:
IF(SPEULI) THEN
!
! EXEMPLE DE MODIFICATION DE FRA - A MODIFIER SUIVANT VOTRE CAS
! EXAMPLE OF MODIFICATION OF FRA - TO BE MODIFIED DEPENDING
! ON YOUR CASE
!
IF(AT.EQ.0) THEN
! JUMPING TWO LINES OF COMMENTS
READ(WAC_FILES(WACFO1)%LU,*,ERR=100,END=200)
READ(WAC_FILES(WACFO1)%LU,*,ERR=100,END=200)
! READING THE FIRST TWO LINES OF DATA
READ(WAC_FILES(WACFO1)%LU,*,ERR=100,END=200) AT1,HM1,FP1,THETA1
READ(WAC_FILES(WACFO1)%LU,*,ERR=100,END=200) AT2,HM2,FP2,THETA2
ENDIF
!
!-----------------------------------------------------------------------
!
10 CONTINUE
IF(AT.GE.AT1.AND.AT.LT.AT2) THEN
IF(AT2-AT1.GT.1.D-6) THEN
COEF=(AT-AT1)/(AT2-AT1)
ELSE
COEF=0.D0
ENDIF
HM=HM1+COEF*(HM2-HM1)
FP=FP1+COEF*(FP2-FP1)
THETA=THETA1+COEF*(THETA2-THETA1)
!
LTT=(LT/LISPRD)*LISPRD
IF(LT.EQ.LTT) THEN
IF(LNG.EQ.1) WRITE(LU,11), 'VAGUE CONDIT AUX LIMIT:',
& ' HM0=',HM,', DIRN=',THETA,', FPI=',FP,
& ''
IF(LNG.EQ.2) WRITE(LU,11), ' BOUNDARY WAVE CONDIT:',
& ' HM0=',HM,', DIRN=',THETA,', FPI=',FP,
& ''
11 FORMAT(A30,A,F5.2,A,F6.1,A,F6.3)
ENDIF
!
ELSE
AT1=AT2
HM1=HM2
FP1=FP2
THETA1=THETA2
READ(WAC_FILES(WACFO1)%LU,*,ERR=100,END=200) AT2,HM2,FP2,THETA2
GO TO 10
ENDIF
I believe that the problem lies in this test of my limwac coding that in works nice if the computation begins at 0:
If I continue a computation, then AT is greater than 0, and the test fails. Is there a 'clean' way to tell limwac to read the closest entry to the current AT, or should a write a successive loop from the beginning?
Costas