Welcome, Guest
Username: Password: Remember me

TOPIC: wave series at different boundaries with LIMWAC

wave series at different boundaries with LIMWAC 8 years 3 months ago #23372

  • j.dasilva
  • j.dasilva's Avatar
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
The administrator has disabled public write access.

wave series at different boundaries with LIMWAC 8 years 3 months ago #23417

  • jmhervouet
  • jmhervouet's Avatar
Hello,

I see no obvious mistake but you do not show the declarations of your arrays. Did you put a command SAVE at the end of your declarations? This is necessary to keep your allocated arrays, otherwise they are forgotten between two calls of the subroutine.

With best regards,

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

wave series at different boundaries with LIMWAC 8 years 2 months ago #23672

  • j.dasilva
  • j.dasilva's Avatar
Hi Mister Hervouet

Sorry for the delay . Thank you for have checked my code.
I have found the problem. i have just multiplied by DEUPI/360 the wave direction during the interpolation phase. And all work correctly.
regards,
Julien
The administrator has disabled public write access.
Moderators: tfouquet

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