Hi,
For my research project, i try to impose different wave characteristics according to my boundaries. I make a test case before my study case. In the test case i have just made a basic rectangular grid with the option "KENT" for the north and the south of my grid. KSORT for the Est and West.
IF(SPEULI) THEN
IF(LT.EQ.1) THEN
AT_OLD = 0.0
AT_NEW = 0.0
READ(WAC_FILES(WACFO1)%LU,*,ERR=993) K_NPTFR
ALLOCATE(K_NBOR(K_NPTFR))
ALLOCATE(K_INDEX(K_NPTFR))
ALLOCATE(HS_NEW(K_NPTFR))
ALLOCATE(FQ_NEW(K_NPTFR))
ALLOCATE(DP_NEW(K_NPTFR))
ALLOCATE(HS_OLD(K_NPTFR))
ALLOCATE(FQ_OLD(K_NPTFR))
ALLOCATE(DP_OLD(K_NPTFR))
!
K_NBOR = 0
K_INDEX = 0
HS_NEW = 0.0
FQ_NEW = 0.0
DP_NEW = 0.0
HS_OLD = 0.0
FQ_OLD = 0.0
DP_OLD = 0.0
!
READ(WAC_FILES(WACFO1)%LU,*,ERR=993) K_NBOR
READ(WAC_FILES(WACFO1)%LU,*,ERR=993) AT_OLD
READ(WAC_FILES(WACFO1)%LU,*,ERR=993) HS_OLD
READ(WAC_FILES(WACFO1)%LU,*,ERR=993) FQ_OLD
READ(WAC_FILES(WACFO1)%LU,*,ERR=993) DP_OLD
READ(WAC_FILES(WACFO1)%LU,*,ERR=993) AT_NEW
READ(WAC_FILES(WACFO1)%LU,*,ERR=993) HS_NEW
READ(WAC_FILES(WACFO1)%LU,*,ERR=993) FQ_NEW
READ(WAC_FILES(WACFO1)%LU,*,ERR=993) DP_NEW
DEALLOCATE(K_NBOR)
ENDIF
IF (AT_NEW.LT.AT) THEN
READNEXT = .TRUE.
ENDIF
!
DO WHILE (READNEXT)
AT_OLD = AT_NEW
HS_OLD = HS_NEW
FQ_OLD = FQ_NEW
DP_OLD = DP_NEW
!
READ(WAC_FILES(WACFO1)%LU,*,ERR=993) AT_NEW
READ(WAC_FILES(WACFO1)%LU,*,ERR=993) HS_NEW
READ(WAC_FILES(WACFO1)%LU,*,ERR=993) FQ_NEW
READ(WAC_FILES(WACFO1)%LU,*,ERR=993) DP_NEW
!
IF (AT_NEW.GT.AT) THEN
READNEXT = .FALSE.
ENDIF
ENDDO
AT_FACT = (AT-AT_OLD)/(AT_NEW-AT_OLD)
DO R=1,K_NPTFR
! INTERPOLATION IN TIME
HM0L = HS_OLD(R) + AT_FACT *
& (HS_NEW(R) - HS_OLD(R))
FPICL = FQ_OLD(R) + AT_FACT *
& (FQ_NEW(R) - FQ_OLD(R))
TETA1L = DP_OLD(R)
ENDDO
!WRITE(LU,*) 'HM0L', HM0L
IF(LT.EQ.NIT) THEN
DEALLOCATE(HS_OLD,HS_NEW)
DEALLOCATE(FQ_OLD,FQ_NEW)
DEALLOCATE(DP_OLD,DP_NEW)
DEALLOCATE(K_INDEX)
ENDIF
ENDIF
!
! ===========================================================
! END OF USER MODIFICATIONS
! ===========================================================
!
ENDIF
The results are not correct. i have tried to index each node with the wave series imposed and apply the characteristics.
DO N=1,K_NPTFR
DO R=1,NPTFR
IF (K_NBOR(N).EQ.NBOR(R)) THEN
K_INDEX(N) = R
ENDIF
ENDDO
ENDDO
DO R=1,K_NPTFR
N=K_INDEX(R)
! INTERPOLATION IN TIME
HM0L(NBOR(N)) = HS_OLD(R) + AT_FACT *
& (HS_NEW(R) - HS_OLD(R))
FPICL(NBOR(N)) = FQ_OLD(R) + AT_FACT *
& (FQ_NEW(R) - FQ_OLD(R))
! TETA1L(NBOR(N)) = DP_OLD(R)
ENDDO
but the code still isn't correct.
If somebody could help me, I really need some advices
regards