bord_tide.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\telemac2d\bord_tide.f
00002 !
00061                      SUBROUTINE BORD_TIDE
00062 !                    ********************
00063 !
00064      &(ZF,NBOR,LIHBOR,LIUBOR,NPOIN,NPTFR,TEMPS,DT,NCOTE,NVITES,
00065      & NUMLIQ,KENT,KENTU,NOMIMP,TIDALTYPE,CTIDE,MSL,CTIDEV,NODALCORR,
00066      & NFOT,BOUNDARY_COLOUR,HBTIDE,UBTIDE,VBTIDE,NUMTIDE,ICALHW,
00067      & MARDAT,MARTIM,TM2S2N2EQUAL)
00068 !
00069 !***********************************************************************
00070 ! TELEMAC2D   V6P3                                   28/10/2010
00071 !***********************************************************************
00072 !
00073 !
00074 !
00075 !
00076 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00077 !| BOUNDARY_COLOUR|-->| AN INTEGER LINKED TO BOUNDARY POINTS
00078 !|                |   | BY DEFAULT THE LAST LINE OF BOUNDARY CONDITIONS
00079 !|                |   | FILE, HENCE THE GLOBAL BOUNDARY NUMBER, BUT CAN
00080 !|                |   | BE CHANGED BY USER.
00081 !| CTIDE          |-->| COEFFICIENT TO CALIBRATE THE TIDAL RANGE
00082 !| CTIDEV         |-->| COEFFICIENT TO CALIBRATE THE VELOCITIES
00083 !| DT             |-->| TIME STEP
00084 !| HBTIDE         |<->| WATER DEPTH ON TIDAL BOUNDARY CONDITIONS
00085 !| ICALHW         |<->| NUMBER THAT MAY BE CHOSEN BY THE USER
00086 !|                |   | TO CALIBRATE HIGH WATER OR AUTOMATICALLY CHOSEN
00087 !|                |   | IN CASE OF THE MODELLING OF A SCHEMATIC TIDE
00088 !| KENT           |-->| CONVENTION FOR LIQUID INPUT WITH PRESCRIBED VALUE
00089 !| KENTU          |-->| CONVENTION FOR LIQUID INPUT WITH PRESCRIBED VELOCITY
00090 !| LIHBOR         |-->| TYPE OF BOUNDARY CONDITIONS ON DEPTH
00091 !| LIUBOR         |-->| TYPE OF BOUNDARY CONDITIONS ON VELOCITY
00092 !| MARDAT         |-->| DATE (YEAR,MONTH,DAY)
00093 !| MARTIM         |-->| TIME (HOUR,MINUTE,SECOND)
00094 !| MSL            |-->| COEFFICIENT TO CALIBRATE THE SEA LEVEL
00095 !| NBOR           |-->| GLOBAL NUMBER OF BOUNDARY POINTS
00096 !| NCOTE          |-->| NUMBER OF BOUNDARIES WITH PRESCRIBED ELEVATION
00097 !|                |   | AS GIVEN IN THE PARAMETER FILE
00098 !| NFOT           |-->| LOGICAL UNIT OF HARMONIC CONSTANTS FILE
00099 !| NODALCORR      |-->| OPTION FOR CALCULATION OF NODAL FACTOR CORRECTION F
00100 !| NOMIMP         |-->| NAME OF LIQUID BOUNDARIES FILE
00101 !| NPOIN          |-->| NUMBER OF POINTS
00102 !| NPTFR          |-->| NUMBER OF BOUNDARY POINTS
00103 !| NUMLIQ         |-->| LIQUID BOUNDARY NUMBER OF BOUNDARY POINTS
00104 !| NUMTIDE        |<->| NUMBER OF THE TIDAL BOUNDARY
00105 !|                |   | ASSOCIATED TO EACH POINT OF THE BOUNDARY
00106 !| NVITES         |-->| NUMBER OF BOUNDARIES WITH VELOCITY PRESCRIBED
00107 !|                |   | AS GIVEN IN THE PARAMETER FILE
00108 !| TEMPS          |-->| TIME IN SECONDS
00109 !| TIDALTYPE      |-->| TYPE OF TIDE TO MODEL
00110 !| TM2S2N2EQUAL   |-->| LOGICAL TO IMPOSE THE PERIODS OF S2 AND N2 WAVES
00111 !|                |   | TO BE EQUAL TO THE PERIOD OF M2 WAVE
00112 !| UBTIDE         |<->| VELOCITY ON TIDAL BOUNDARY CONDITIONS
00113 !| VBTIDE         |<->| VELOCITY ON TIDAL BOUNDARY CONDITIONS
00114 !| ZF             |-->| BOTTOM TOPOGRAPHY
00115 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00116 !
00117       USE BIEF
00118       USE INTERFACE_TELEMAC2D, EX_BORD_TIDE => BORD_TIDE
00119 !
00120       IMPLICIT NONE
00121       INTEGER LNG,LU
00122       COMMON/INFO/LNG,LU
00123 !
00124 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00125 !
00126       INTEGER, INTENT(IN)             :: NPOIN,NPTFR,NCOTE,NVITES,NFOT
00127       INTEGER, INTENT(IN)             :: KENT,KENTU,NODALCORR
00128       INTEGER, INTENT(IN)             :: LIHBOR(NPTFR),LIUBOR(NPTFR)
00129       INTEGER, INTENT(IN)             :: NUMLIQ(NPTFR),NBOR(NPTFR)
00130       INTEGER, INTENT(IN)             :: TIDALTYPE,MARDAT(3),MARTIM(3)
00131       INTEGER, INTENT(INOUT)          :: ICALHW
00132       DOUBLE PRECISION, INTENT(IN)    :: TEMPS,CTIDE,MSL,CTIDEV,DT
00133       DOUBLE PRECISION, INTENT(IN)    :: ZF(NPOIN)
00134       LOGICAL, INTENT(IN)             :: TM2S2N2EQUAL
00135       TYPE(BIEF_OBJ), INTENT(IN)      :: BOUNDARY_COLOUR
00136       TYPE(BIEF_OBJ), INTENT(INOUT)   :: NUMTIDE,UBTIDE,VBTIDE,HBTIDE
00137       CHARACTER(LEN=144), INTENT(IN)  :: NOMIMP
00138 !
00139 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00140 !
00141       INTEGER K,IERR,I
00142 !
00143 !-----------------------------------------------------------------------
00144 !
00145       INTEGER IPTFR,IPTFRL,NPTFRL,NTIDE
00146       INTEGER, ALLOCATABLE :: FIRSTTIDE(:),LASTTIDE(:),SHIFTTIDE(:)
00147 !
00148       DOUBLE PRECISION, PARAMETER :: TM2 = 44714.D0
00149       DOUBLE PRECISION, PARAMETER :: TM4 = 22357.D0
00150 !
00151       DOUBLE PRECISION PI,TWOPI
00152       DOUBLE PRECISION TS2,TN2
00153       DOUBLE PRECISION HM2,HS2,HN2,HM4
00154       DOUBLE PRECISION UM2,US2,UN2,UM4,VM2,VS2,VN2,VM4
00155       DOUBLE PRECISION UPVM2,UPVN2,UPVS2,FFMN2,FFM4
00156       DOUBLE PRECISION PHM2CALHW,PHS2CALHW,PHN2CALHW,PHM4CALHW
00157       DOUBLE PRECISION FM2,FS2,FN2,FM4
00158       DOUBLE PRECISION, ALLOCATABLE :: AHM2(:),PHM2(:)
00159       DOUBLE PRECISION, ALLOCATABLE :: AHS2(:),PHS2(:)
00160       DOUBLE PRECISION, ALLOCATABLE :: AHN2(:),PHN2(:)
00161       DOUBLE PRECISION, ALLOCATABLE :: AHM4(:),PHM4(:)
00162       DOUBLE PRECISION, ALLOCATABLE :: AUM2(:),PUM2(:)
00163       DOUBLE PRECISION, ALLOCATABLE :: AUS2(:),PUS2(:)
00164       DOUBLE PRECISION, ALLOCATABLE :: AUN2(:),PUN2(:)
00165       DOUBLE PRECISION, ALLOCATABLE :: AUM4(:),PUM4(:)
00166       DOUBLE PRECISION, ALLOCATABLE :: AVM2(:),PVM2(:)
00167       DOUBLE PRECISION, ALLOCATABLE :: AVS2(:),PVS2(:)
00168       DOUBLE PRECISION, ALLOCATABLE :: AVN2(:),PVN2(:)
00169       DOUBLE PRECISION, ALLOCATABLE :: AVM4(:),PVM4(:)
00170       DOUBLE PRECISION, ALLOCATABLE :: FHXM2(:),FHYM2(:)
00171       DOUBLE PRECISION, ALLOCATABLE :: FHXS2(:),FHYS2(:)
00172       DOUBLE PRECISION, ALLOCATABLE :: FHXN2(:),FHYN2(:)
00173       DOUBLE PRECISION, ALLOCATABLE :: FHXM4(:),FHYM4(:)
00174       DOUBLE PRECISION, ALLOCATABLE :: FUXM2(:),FUYM2(:)
00175       DOUBLE PRECISION, ALLOCATABLE :: FUXS2(:),FUYS2(:)
00176       DOUBLE PRECISION, ALLOCATABLE :: FUXN2(:),FUYN2(:)
00177       DOUBLE PRECISION, ALLOCATABLE :: FUXM4(:),FUYM4(:)
00178       DOUBLE PRECISION, ALLOCATABLE :: FVXM2(:),FVYM2(:)
00179       DOUBLE PRECISION, ALLOCATABLE :: FVXS2(:),FVYS2(:)
00180       DOUBLE PRECISION, ALLOCATABLE :: FVXN2(:),FVYN2(:)
00181       DOUBLE PRECISION, ALLOCATABLE :: FVXM4(:),FVYM4(:)
00182 !
00183       LOGICAL DEJA
00184       DATA    DEJA /.FALSE./
00185 !
00186       SAVE
00187 !
00188 !-----------------------------------------------------------------------
00189 !
00190       PI = ATAN(1.D0)*4.D0
00191       TWOPI = 2.D0*PI
00192 !
00193 !  WAVE PERIODES (SEE p.61 JMJ REPORT)
00194 !  JANIN J.-M., BLANCHARD X. (1992).
00195 !  SIMULATION DES COURANTS DE MAREE EN MANCHE ET PROCHE ATLANTIQUE
00196 !  EDF REPORT HE-42/92.58
00197 !
00198       IF(TM2S2N2EQUAL.AND.TIDALTYPE.GE.2.AND.TIDALTYPE.LE.6) THEN
00199         TS2 = TM2
00200         TN2 = TM2
00201       ELSE
00202         TS2 = 43200.D0
00203         TN2 = 45570.D0
00204       ENDIF
00205 !
00206 !  TEST TO CHECK CORRECT VALUES FOR TIDALTYPE
00207 !
00208       IF(.NOT.DEJA) THEN
00209         IF(TIDALTYPE.LT.0.OR.TIDALTYPE.GT.7) THEN
00210           IF(LNG.EQ.1) THEN
00211             WRITE(LU,*) 'MAUVAISE VALEUR POUR TIDALTYPE =',TIDALTYPE
00212             WRITE(LU,*) 'ELLE DOIT ETRE COMPRISE ENTRE 0 ET 7'
00213           ENDIF
00214           IF(LNG.EQ.2) THEN
00215             WRITE(LU,*) 'UNEXPECTED VALUE FOR TIDALTYPE=',TIDALTYPE
00216             WRITE(LU,*) 'IT MUST BE CHOSEN BETWEEN 0 AND 7'
00217           ENDIF
00218           CALL PLANTE(1)
00219           STOP
00220         ENDIF
00221       ENDIF
00222 !
00223 !  MAGNITUDES AND PHASES ARE READ IN TIDAL FILE
00224 !  CANAL NFOT = 26 CORRESPONDS TO FORMATTED FILE 1
00225 !  TIDAL FILE IS OBTAINED BY APPLYING BORD_TIDAL_BC SUBROUTINE
00226 !  WHICH INTERPOLATES JMJ MODEL RESULTS ON THE CURRENT MESH
00227 !
00228 !  NTIDE:  NUMBER OF THE TIDAL BOUNDARIES
00229 !  NPTFRL: NUMBERS OF BOUNDARY POINTS WHERE TIDE IS PRESCRIBED
00230 !
00231       IF(.NOT.DEJA) THEN
00232 !
00233         REWIND NFOT
00234 !
00235         NPTFRL = 0
00236 !
00237         READ(NFOT,*,END=2) NTIDE
00238         DO K=1,NTIDE
00239           READ(NFOT,*,END=2)
00240         ENDDO
00241 !
00242 1       CONTINUE
00243         READ(NFOT,*,END=2,ERR=3)
00244         READ(NFOT,*,END=2,ERR=3)
00245         READ(NFOT,*,END=2,ERR=3)
00246         READ(NFOT,*,END=2,ERR=3)
00247         READ(NFOT,*,END=2,ERR=3)
00248         NPTFRL = NPTFRL + 1
00249         GOTO 1
00250 3       CONTINUE
00251         IF(LNG.EQ.1) THEN
00252           WRITE(LU,*) 'BORD_TIDE: FICHIER DES CONSTANTES HARMONIQUES'
00253           WRITE(LU,*) 'ERREUR DE LECTURE AU POINT',NPTFRL+1
00254         ENDIF
00255         IF(LNG.EQ.2) THEN
00256           WRITE(LU,*) 'BORD_TIDE: HARMONIC CONSTANTS FILE'
00257           WRITE(LU,*) 'READ ERROR AT POINT',NPTFRL+1
00258         ENDIF
00259         CALL PLANTE(1)
00260         STOP
00261       ENDIF
00262 !
00263 2     CONTINUE
00264 !
00265       IF(.NOT.DEJA) THEN
00266         ALLOCATE(FIRSTTIDE(NTIDE),STAT=IERR)
00267         ALLOCATE(LASTTIDE(NTIDE), STAT=IERR)
00268         ALLOCATE(SHIFTTIDE(NTIDE),STAT=IERR)
00269 !
00270         IF(TIDALTYPE.GE.1.AND.TIDALTYPE.LE.6) THEN
00271           ALLOCATE(AHM2(NPTFRL),STAT=IERR)
00272           ALLOCATE(PHM2(NPTFRL),STAT=IERR)
00273           ALLOCATE(AHS2(NPTFRL),STAT=IERR)
00274           ALLOCATE(PHS2(NPTFRL),STAT=IERR)
00275           ALLOCATE(AHN2(NPTFRL),STAT=IERR)
00276           ALLOCATE(PHN2(NPTFRL),STAT=IERR)
00277           ALLOCATE(AHM4(NPTFRL),STAT=IERR)
00278           ALLOCATE(PHM4(NPTFRL),STAT=IERR)
00279           ALLOCATE(AUM2(NPTFRL),STAT=IERR)
00280           ALLOCATE(PUM2(NPTFRL),STAT=IERR)
00281           ALLOCATE(AUS2(NPTFRL),STAT=IERR)
00282           ALLOCATE(PUS2(NPTFRL),STAT=IERR)
00283           ALLOCATE(AUN2(NPTFRL),STAT=IERR)
00284           ALLOCATE(PUN2(NPTFRL),STAT=IERR)
00285           ALLOCATE(AUM4(NPTFRL),STAT=IERR)
00286           ALLOCATE(PUM4(NPTFRL),STAT=IERR)
00287           ALLOCATE(AVM2(NPTFRL),STAT=IERR)
00288           ALLOCATE(PVM2(NPTFRL),STAT=IERR)
00289           ALLOCATE(AVS2(NPTFRL),STAT=IERR)
00290           ALLOCATE(PVS2(NPTFRL),STAT=IERR)
00291           ALLOCATE(AVN2(NPTFRL),STAT=IERR)
00292           ALLOCATE(PVN2(NPTFRL),STAT=IERR)
00293           ALLOCATE(AVM4(NPTFRL),STAT=IERR)
00294           ALLOCATE(PVM4(NPTFRL),STAT=IERR)
00295         ELSEIF(TIDALTYPE.EQ.7) THEN
00296           ALLOCATE(FHXM2(NPTFRL),STAT=IERR)
00297           ALLOCATE(FHYM2(NPTFRL),STAT=IERR)
00298           ALLOCATE(FHXS2(NPTFRL),STAT=IERR)
00299           ALLOCATE(FHYS2(NPTFRL),STAT=IERR)
00300           ALLOCATE(FHXN2(NPTFRL),STAT=IERR)
00301           ALLOCATE(FHYN2(NPTFRL),STAT=IERR)
00302           ALLOCATE(FHXM4(NPTFRL),STAT=IERR)
00303           ALLOCATE(FHYM4(NPTFRL),STAT=IERR)
00304           ALLOCATE(FUXM2(NPTFRL),STAT=IERR)
00305           ALLOCATE(FUYM2(NPTFRL),STAT=IERR)
00306           ALLOCATE(FUXS2(NPTFRL),STAT=IERR)
00307           ALLOCATE(FUYS2(NPTFRL),STAT=IERR)
00308           ALLOCATE(FUXN2(NPTFRL),STAT=IERR)
00309           ALLOCATE(FUYN2(NPTFRL),STAT=IERR)
00310           ALLOCATE(FUXM4(NPTFRL),STAT=IERR)
00311           ALLOCATE(FUYM4(NPTFRL),STAT=IERR)
00312           ALLOCATE(FVXM2(NPTFRL),STAT=IERR)
00313           ALLOCATE(FVYM2(NPTFRL),STAT=IERR)
00314           ALLOCATE(FVXS2(NPTFRL),STAT=IERR)
00315           ALLOCATE(FVYS2(NPTFRL),STAT=IERR)
00316           ALLOCATE(FVXN2(NPTFRL),STAT=IERR)
00317           ALLOCATE(FVYN2(NPTFRL),STAT=IERR)
00318           ALLOCATE(FVXM4(NPTFRL),STAT=IERR)
00319           ALLOCATE(FVYM4(NPTFRL),STAT=IERR)
00320         ENDIF
00321       ENDIF
00322 !
00323 !  COMPUTE THE FIRST AND LAST INDICES OF THE OPEN LIQUID BOUNDARY WITH TIDE TO PRESCRIBE
00324 !
00325       IF(.NOT.DEJA) THEN
00326         REWIND NFOT
00327 !
00328         READ(NFOT,*)
00329         DO I=1,NTIDE
00330           READ(NFOT,*,END=4) FIRSTTIDE(I),LASTTIDE(I)
00331         ENDDO
00332 4       CONTINUE
00333 !
00334 !  SHIFTS WHEN CHANGING TIDAL BOUNDARY
00335 !
00336         SHIFTTIDE(1) = 0
00337 !
00338         DO I=2,NTIDE
00339           SHIFTTIDE(I) = LASTTIDE(I-1) - FIRSTTIDE(I-1) + 1
00340      &                 + SHIFTTIDE(I-1)
00341         ENDDO
00342 !
00343 !  READING OF TIDAL DATA AT THE FIRST TIME STEP
00344 !
00345         IF(TIDALTYPE.GE.1.AND.TIDALTYPE.LE.6) THEN
00346           DO IPTFRL = 1,NPTFRL
00347             READ(NFOT,*)
00348             READ(NFOT,*) AHM2(IPTFRL),PHM2(IPTFRL),
00349      &                   AUM2(IPTFRL),PUM2(IPTFRL),
00350      &                   AVM2(IPTFRL),PVM2(IPTFRL)
00351             READ(NFOT,*) AHS2(IPTFRL),PHS2(IPTFRL),
00352      &                   AUS2(IPTFRL),PUS2(IPTFRL),
00353      &                   AVS2(IPTFRL),PVS2(IPTFRL)
00354             READ(NFOT,*) AHN2(IPTFRL),PHN2(IPTFRL),
00355      &                   AUN2(IPTFRL),PUN2(IPTFRL),
00356      &                   AVN2(IPTFRL),PVN2(IPTFRL)
00357             READ(NFOT,*) AHM4(IPTFRL),PHM4(IPTFRL),
00358      &                   AUM4(IPTFRL),PUM4(IPTFRL),
00359      &                   AVM4(IPTFRL),PVM4(IPTFRL)
00360           ENDDO
00361         ELSEIF(TIDALTYPE.EQ.7) THEN
00362           DO IPTFRL = 1,NPTFRL
00363             READ(NFOT,*)
00364             READ(NFOT,*) FHXM2(IPTFRL),FHYM2(IPTFRL),
00365      &                   FUXM2(IPTFRL),FUYM2(IPTFRL),
00366      &                   FVXM2(IPTFRL),FVYM2(IPTFRL)
00367             READ(NFOT,*) FHXS2(IPTFRL),FHYS2(IPTFRL),
00368      &                   FUXS2(IPTFRL),FUYS2(IPTFRL),
00369      &                   FVXS2(IPTFRL),FVYS2(IPTFRL)
00370             READ(NFOT,*) FHXN2(IPTFRL),FHYN2(IPTFRL),
00371      &                   FUXN2(IPTFRL),FUYN2(IPTFRL),
00372      &                   FVXN2(IPTFRL),FVYN2(IPTFRL)
00373             READ(NFOT,*) FHXM4(IPTFRL),FHYM4(IPTFRL),
00374      &                   FUXM4(IPTFRL),FUYM4(IPTFRL),
00375      &                   FVXM4(IPTFRL),FVYM4(IPTFRL)
00376           ENDDO
00377         ENDIF
00378 !
00379 !       POTENTIAL SPECIFIC TREATMENTS
00380 !
00381         IF(TIDALTYPE.EQ.1) THEN
00382 !
00383 !         DEGREES TO RADIANS CONVERSIONS
00384           DO IPTFRL = 1,NPTFRL
00385             PHM2(IPTFRL) = PHM2(IPTFRL) / 180.D0 * PI
00386             PUM2(IPTFRL) = PUM2(IPTFRL) / 180.D0 * PI
00387             PVM2(IPTFRL) = PVM2(IPTFRL) / 180.D0 * PI
00388 !
00389             PHS2(IPTFRL) = PHS2(IPTFRL) / 180.D0 * PI
00390             PUS2(IPTFRL) = PUS2(IPTFRL) / 180.D0 * PI
00391             PVS2(IPTFRL) = PVS2(IPTFRL) / 180.D0 * PI
00392 !
00393             PHN2(IPTFRL) = PHN2(IPTFRL) / 180.D0 * PI
00394             PUN2(IPTFRL) = PUN2(IPTFRL) / 180.D0 * PI
00395             PVN2(IPTFRL) = PVN2(IPTFRL) / 180.D0 * PI
00396 !
00397             PHM4(IPTFRL) = PHM4(IPTFRL) / 180.D0 * PI
00398             PUM4(IPTFRL) = PUM4(IPTFRL) / 180.D0 * PI
00399             PVM4(IPTFRL) = PVM4(IPTFRL) / 180.D0 * PI
00400           ENDDO
00401 !
00402         ELSEIF(TIDALTYPE.GE.2.AND.TIDALTYPE.LE.6) THEN
00403 !
00404 !         ARBITRARY CHOICE
00405           IF(ICALHW.EQ.0) ICALHW = NPTFRL/2
00406 !
00407 !  CALIBRATION WITH RESPECT TO HIGH WATER!!!
00408 !  PHASES FOR HEIGHTS ARE READ IN JMJ TIDAL FILE
00409 !  EXCEPT M4: 2*PHM2 MOD 360 IS APPLIED
00410 ! --------------------------------------------------
00411 !
00412           PHM2CALHW = PHM2(ICALHW)
00413           PHS2CALHW = PHS2(ICALHW)
00414           PHN2CALHW = PHN2(ICALHW)
00415           PHM4CALHW = MOD(2.D0*PHM2(ICALHW),360.D0)
00416 !
00417           DO IPTFRL = 1,NPTFRL
00418             PHM2(IPTFRL) = (PHM2(IPTFRL) - PHM2CALHW) / 180.D0 * PI
00419             PUM2(IPTFRL) = (PUM2(IPTFRL) - PHM2CALHW) / 180.D0 * PI
00420             PVM2(IPTFRL) = (PVM2(IPTFRL) - PHM2CALHW) / 180.D0 * PI
00421 !
00422             PHS2(IPTFRL) = (PHS2(IPTFRL) - PHS2CALHW) / 180.D0 * PI
00423             PUS2(IPTFRL) = (PUS2(IPTFRL) - PHS2CALHW) / 180.D0 * PI
00424             PVS2(IPTFRL) = (PVS2(IPTFRL) - PHS2CALHW) / 180.D0 * PI
00425 !
00426             PHN2(IPTFRL) = (PHN2(IPTFRL) - PHN2CALHW) / 180.D0 * PI
00427             PUN2(IPTFRL) = (PUN2(IPTFRL) - PHN2CALHW) / 180.D0 * PI
00428             PVN2(IPTFRL) = (PVN2(IPTFRL) - PHN2CALHW) / 180.D0 * PI
00429 !
00430             PHM4(IPTFRL) = (PHM4(IPTFRL) - PHM4CALHW) / 180.D0 * PI
00431             PUM4(IPTFRL) = (PUM4(IPTFRL) - PHM4CALHW) / 180.D0 * PI
00432             PVM4(IPTFRL) = (PVM4(IPTFRL) - PHM4CALHW) / 180.D0 * PI
00433           ENDDO
00434         ENDIF
00435 !
00436 !  NUMBER OF THE TIDAL BOUNDARY ASSOCIATED TO EACH POINT OF THE BOUNDARY
00437 !  REMAINS 0 IF POINT IS NOT ON AN OPEN BOUNDARY WITH TIDE
00438 !
00439         DO K=1,NPTFR
00440           NUMTIDE%I(K) = 0
00441           IPTFR=BOUNDARY_COLOUR%I(K)
00442           DO I=1,NTIDE
00443             IF(IPTFR.GE.FIRSTTIDE(I).AND.IPTFR.LE.LASTTIDE(I)) THEN
00444               NUMTIDE%I(K) = I
00445             ENDIF
00446           ENDDO
00447         ENDDO
00448 !
00449 !  FOR THE SIMULATION OF REAL TIDES, NODAL FACTOR CORRECTIONS ARE COMPUTED WITH PUGH FORMULAE
00450 !  PUGH D. (1987). TIDES, SURGES AND MEAN SEA LEVEL.
00451 !
00452         IF(TIDALTYPE.EQ.1.OR.TIDALTYPE.EQ.7) THEN
00453           CALL NODALUPV_PUGH(UPVM2,UPVN2,UPVS2,MARDAT,MARTIM)
00454 !  TEMPS-DT RATHER THAN TEMPS BECAUSE THE FIRST CALL TO BORD_TIDE
00455 !  IS AT THE FIRST TIME STEP
00456           CALL NODALF_PUGH(FFMN2,FFM4,NODALCORR,TEMPS-DT,DEJA,
00457      &                     MARDAT,MARTIM)
00458         ENDIF
00459 !
00460         DEJA = .TRUE.
00461 !
00462       ENDIF
00463 !
00464       IF((TIDALTYPE.EQ.1.OR.TIDALTYPE.EQ.7).AND.NODALCORR.EQ.0) THEN
00465         CALL NODALF_PUGH(FFMN2,FFM4,NODALCORR,TEMPS,DEJA,MARDAT,MARTIM)
00466       ENDIF
00467 !
00468       IF(TIDALTYPE.EQ.7) THEN
00469 !       PHASES COMPUTATION
00470         FM2=DMOD( UPVM2  + TWOPI/TM2*TEMPS, TWOPI)
00471         FN2=DMOD( UPVN2  + TWOPI/TN2*TEMPS, TWOPI)
00472         FS2=DMOD( UPVS2  + TWOPI/TS2*TEMPS, TWOPI)
00473         FM4=DMOD(2.D0*FM2                 , TWOPI)
00474       ENDIF
00475 !
00476 !  LOOP ON ALL BOUNDARY POINTS
00477 !
00478       DO K=1,NPTFR
00479 !
00480         IPTFR=BOUNDARY_COLOUR%I(K)
00481 !
00482 !     LEVEL IMPOSED WITH VALUE GIVEN IN THE CAS FILE (NCOTE0)
00483 !
00484         IF(LIHBOR(K).EQ.KENT) THEN
00485 !         BEGINNING OF PRESCRIBED DEPTHS
00486           IF(NUMTIDE%I(K).GT.0) THEN
00487             IPTFRL=IPTFR-FIRSTTIDE(NUMTIDE%I(K))+1
00488      &                  +SHIFTTIDE(NUMTIDE%I(K))
00489 !
00490 !  TYPE OF TIDE TO MODEL
00491 !  1: REAL TIDE (RECOMMENDED METHODOLOGY)
00492 !  2: ASTRONOMICAL TIDE      (COEF. NEARLY 120)
00493 !  3: MEAN SPRING TIDE       (COEF. NEARLY 95)
00494 !  4: MEAN TIDE              (COEF. NEARLY 70)
00495 !  5: MEAN NEAP TIDE         (COEF. NEARLY 45)
00496 !  6: ASTRONOMICAL NEAP TIDE (COEF. NEARLY 20)
00497 !  7: REAL TIDE (METHODOLOGY BEFORE 2010)
00498 !
00499             IF(TIDALTYPE.EQ.1) THEN
00500               HM2 = FFMN2*AHM2(IPTFRL)
00501      &                   *COS(TWOPI*TEMPS/TM2-PHM2(IPTFRL)+UPVM2)
00502             ELSEIF(TIDALTYPE.GE.2.AND.TIDALTYPE.LE.6) THEN
00503               HM2 = AHM2(IPTFRL)*COS(TWOPI*TEMPS/TM2-PHM2(IPTFRL))
00504             ELSEIF(TIDALTYPE.EQ.7) THEN
00505               HM2 = FFMN2*(FHXM2(IPTFRL)*COS(FM2)
00506      &                    +FHYM2(IPTFRL)*SIN(FM2))
00507             ENDIF
00508 !
00509 !  S2 WAVE is not ACCOUNTED FOR MEAN TIDES
00510 !
00511             IF(TIDALTYPE.EQ.1) THEN
00512               HS2 = AHS2(IPTFRL)*COS(TWOPI*TEMPS/TS2-PHS2(IPTFRL)+UPVS2)
00513             ELSEIF(TIDALTYPE.EQ.2.OR.TIDALTYPE.EQ.3) THEN
00514               HS2 = AHS2(IPTFRL)*COS(TWOPI*TEMPS/TS2-PHS2(IPTFRL))
00515             ELSEIF(TIDALTYPE.EQ.5.OR.TIDALTYPE.EQ.6) THEN
00516               HS2 = AHS2(IPTFRL)*COS(TWOPI*TEMPS/TS2-PHS2(IPTFRL)-PI)
00517             ELSEIF(TIDALTYPE.EQ.7) THEN
00518               HS2 = FHXS2(IPTFRL)*COS(FS2) + FHYS2(IPTFRL)*SIN(FS2)
00519             ENDIF
00520 !
00521 !  N2 WAVE is not ACCOUNTED FOR MEAN SPRING, MEAN AND MEAN NEAP TIDES
00522 !
00523             IF(TIDALTYPE.EQ.1) THEN
00524               HN2 = FFMN2*AHN2(IPTFRL)
00525      &                   *COS(TWOPI*TEMPS/TN2-PHN2(IPTFRL)+UPVN2)
00526             ELSEIF(TIDALTYPE.EQ.2) THEN
00527               HN2 = AHN2(IPTFRL)*COS(TWOPI*TEMPS/TN2-PHN2(IPTFRL))
00528             ELSEIF(TIDALTYPE.EQ.6) THEN
00529               HN2 = AHN2(IPTFRL)*COS(TWOPI*TEMPS/TN2-PHN2(IPTFRL)-PI)
00530             ELSEIF(TIDALTYPE.EQ.7) THEN
00531               HN2 = FFMN2*(FHXN2(IPTFRL)*COS(FN2)
00532      &                    +FHYN2(IPTFRL)*SIN(FN2))
00533             ENDIF
00534 !
00535             IF(TIDALTYPE.EQ.1) THEN
00536               HM4 = FFM4*AHM4(IPTFRL)
00537      &                  *COS(TWOPI*TEMPS/TM4-PHM4(IPTFRL)+2.D0*UPVM2)
00538             ELSEIF(TIDALTYPE.GE.2.AND.TIDALTYPE.LE.6) THEN
00539               HM4 = AHM4(IPTFRL)*COS(TWOPI*TEMPS/TM4-PHM4(IPTFRL))
00540             ELSEIF(TIDALTYPE.EQ.7) THEN
00541               HM4 = FFM4*(FHXM4(IPTFRL)*COS(FM4)
00542      &                   +FHYM4(IPTFRL)*SIN(FM4))
00543             ENDIF
00544 !
00545             IF(TIDALTYPE.EQ.1.OR.TIDALTYPE.EQ.7) THEN
00546 !              HBTIDE%R(K) = -ZF(NBOR(K)) + HM2+HS2+HN2+HM4 + MSL
00547               HBTIDE%R(K) = -ZF(NBOR(K)) + CTIDE*(HM2+HS2+HN2+HM4) + MSL
00548             ELSEIF(TIDALTYPE.EQ.2.OR.TIDALTYPE.EQ.6) THEN
00549               HBTIDE%R(K) = -ZF(NBOR(K)) + CTIDE*(HM2+HS2+HN2+HM4) + MSL
00550             ELSEIF(TIDALTYPE.EQ.3.OR.TIDALTYPE.EQ.5) THEN
00551               HBTIDE%R(K) = -ZF(NBOR(K)) + CTIDE*(HM2+HS2+HM4) + MSL
00552             ELSEIF(TIDALTYPE.EQ.4) THEN
00553               HBTIDE%R(K) = -ZF(NBOR(K)) + CTIDE*(HM2+HM4) + MSL
00554             ENDIF
00555 !
00556           ENDIF
00557 !         ELSE HBOR TAKEN IN BOUNDARY CONDITIONS FILE
00558         ENDIF
00559 !
00560 !  VELOCITY IMPOSED: ONE USES THE OUTGOING DIRECTION
00561 !                    PROVIDED BY THE USER.
00562 !
00563       IF(LIUBOR(K).EQ.KENTU) THEN
00564 !
00565 !       POINTS ON WEIRS HAVE NUMLIQ(K)=0
00566         IF(NUMLIQ(K).GT.0) THEN
00567 !
00568 !         BEGINNING OF PRESCRIBED VELOCITIES
00569 !
00570           IF(NUMTIDE%I(K).GT.0) THEN
00571             IPTFRL=IPTFR-FIRSTTIDE(NUMTIDE%I(K))+1
00572      &                  +SHIFTTIDE(NUMTIDE%I(K))
00573 !
00574 !  TYPE OF TIDE TO MODEL
00575 !  1: REAL TIDE (RECOMMENDED METHODOLOGY)
00576 !  2: ASTRONOMICAL TIDE      (COEF. NEARLY 120)
00577 !  3: MEAN SPRING TIDE       (COEF. NEARLY 95)
00578 !  4: MEAN TIDE              (COEF. NEARLY 70)
00579 !  5: MEAN NEAP TIDE         (COEF. NEARLY 45)
00580 !  6: ASTRONOMICAL NEAP TIDE (COEF. NEARLY 20)
00581 !  7: REAL TIDE (METHODOLOGY BEFORE 2010)
00582 !
00583             IF(TIDALTYPE.EQ.1) THEN
00584               UM2 = FFMN2*AUM2(IPTFRL)
00585      &                   *COS(TWOPI*TEMPS/TM2-PUM2(IPTFRL)+UPVM2)
00586               VM2 = FFMN2*AVM2(IPTFRL)
00587      &                   *COS(TWOPI*TEMPS/TM2-PVM2(IPTFRL)+UPVM2)
00588             ELSEIF(TIDALTYPE.GE.2.AND.TIDALTYPE.LE.6) THEN
00589               UM2 = AUM2(IPTFRL)*COS(TWOPI*TEMPS/TM2-PUM2(IPTFRL))
00590               VM2 = AVM2(IPTFRL)*COS(TWOPI*TEMPS/TM2-PVM2(IPTFRL))
00591             ELSEIF(TIDALTYPE.EQ.7) THEN
00592               UM2 = FUXM2(IPTFRL)*COS(FM2) + FUYM2(IPTFRL)*SIN(FM2)
00593               VM2 = FVXM2(IPTFRL)*COS(FM2) + FVYM2(IPTFRL)*SIN(FM2)
00594             ENDIF
00595 !
00596 !  S2 WAVE is not ACCOUNTED FOR MEAN TIDES
00597 !
00598             IF(TIDALTYPE.EQ.1) THEN
00599               US2 = AUS2(IPTFRL)*COS(TWOPI*TEMPS/TS2-PUS2(IPTFRL)+UPVS2)
00600               VS2 = AVS2(IPTFRL)*COS(TWOPI*TEMPS/TS2-PVS2(IPTFRL)+UPVS2)
00601             ELSEIF(TIDALTYPE.EQ.2.OR.TIDALTYPE.EQ.3) THEN
00602               US2 = AUS2(IPTFRL)*COS(TWOPI*TEMPS/TS2-PUS2(IPTFRL))
00603               VS2 = AVS2(IPTFRL)*COS(TWOPI*TEMPS/TS2-PVS2(IPTFRL))
00604             ELSEIF(TIDALTYPE.EQ.5.OR.TIDALTYPE.EQ.6) THEN
00605               US2 = AUS2(IPTFRL)*COS(TWOPI*TEMPS/TS2-PUS2(IPTFRL)-PI)
00606               VS2 = AVS2(IPTFRL)*COS(TWOPI*TEMPS/TS2-PVS2(IPTFRL)-PI)
00607             ELSEIF(TIDALTYPE.EQ.7) THEN
00608               US2 = FUXS2(IPTFRL)*COS(FS2) + FUYS2(IPTFRL)*SIN(FS2)
00609               VS2 = FVXS2(IPTFRL)*COS(FS2) + FVYS2(IPTFRL)*SIN(FS2)
00610             ENDIF
00611 !
00612 !  N2 WAVE is not ACCOUNTED FOR MEAN SPRING, MEAN AND MEAN NEAP TIDES
00613 !
00614             IF(TIDALTYPE.EQ.1) THEN
00615               UN2 = FFMN2*AUN2(IPTFRL)
00616      &                   *COS(TWOPI*TEMPS/TN2-PUN2(IPTFRL)+UPVN2)
00617               VN2 = FFMN2*AVN2(IPTFRL)
00618      &                   *COS(TWOPI*TEMPS/TN2-PVN2(IPTFRL)+UPVN2)
00619             ELSEIF(TIDALTYPE.EQ.2) THEN
00620               UN2 = AUN2(IPTFRL)*COS(TWOPI*TEMPS/TN2-PUN2(IPTFRL))
00621               VN2 = AVN2(IPTFRL)*COS(TWOPI*TEMPS/TN2-PVN2(IPTFRL))
00622             ELSEIF(TIDALTYPE.EQ.6) THEN
00623               UN2 = AUN2(IPTFRL)*COS(TWOPI*TEMPS/TN2-PUN2(IPTFRL)-PI)
00624               VN2 = AVN2(IPTFRL)*COS(TWOPI*TEMPS/TN2-PVN2(IPTFRL)-PI)
00625             ELSEIF(TIDALTYPE.EQ.7) THEN
00626               UN2 = FUXN2(IPTFRL)*COS(FN2) + FUYN2(IPTFRL)*SIN(FN2)
00627               VN2 = FVXN2(IPTFRL)*COS(FN2) + FVYN2(IPTFRL)*SIN(FN2)
00628             ENDIF
00629 !
00630             IF(TIDALTYPE.EQ.1) THEN
00631               UM4 = FFM4*AUM4(IPTFRL)
00632      &                  *COS(TWOPI*TEMPS/TM4-PUM4(IPTFRL)+2.D0*UPVM2)
00633               VM4 = FFM4*AVM4(IPTFRL)
00634      &                  *COS(TWOPI*TEMPS/TM4-PVM4(IPTFRL)+2.D0*UPVM2)
00635             ELSEIF(TIDALTYPE.GE.2.AND.TIDALTYPE.LE.6) THEN
00636               UM4 = AUM4(IPTFRL)*COS(TWOPI*TEMPS/TM4-PUM4(IPTFRL))
00637               VM4 = AVM4(IPTFRL)*COS(TWOPI*TEMPS/TM4-PVM4(IPTFRL))
00638             ELSEIF(TIDALTYPE.EQ.7) THEN
00639               UM4 = FUXM4(IPTFRL)*COS(FM4) + FUYM4(IPTFRL)*SIN(FM4)
00640               VM4 = FVXM4(IPTFRL)*COS(FM4) + FVYM4(IPTFRL)*SIN(FM4)
00641             ENDIF
00642 !
00643 !  ACCORDING TO DV, IF A CORRECTION COEFFICIENT IS APPLIED FOR WATER DEPTHS,
00644 !  ANOTHER MUST BE APPLIED FOR VELOCITIES
00645 !
00646             IF(TIDALTYPE.EQ.1.OR.TIDALTYPE.EQ.7) THEN
00647 !              UBTIDE%R(K) = UM2+US2+UN2+UM4
00648 !              VBTIDE%R(K) = VM2+VS2+VN2+VM4
00649               UBTIDE%R(K) = CTIDEV*(UM2+US2+UN2+UM4)
00650               VBTIDE%R(K) = CTIDEV*(VM2+VS2+VN2+VM4)
00651             ELSEIF(TIDALTYPE.EQ.2.OR.TIDALTYPE.EQ.6) THEN
00652               UBTIDE%R(K) = CTIDEV*(UM2+US2+UN2+UM4)
00653               VBTIDE%R(K) = CTIDEV*(VM2+VS2+VN2+VM4)
00654             ELSEIF(TIDALTYPE.EQ.3.OR.TIDALTYPE.EQ.5) THEN
00655               UBTIDE%R(K) = CTIDEV*(UM2+US2+UM4)
00656               VBTIDE%R(K) = CTIDEV*(VM2+VS2+VM4)
00657             ELSEIF(TIDALTYPE.EQ.4) THEN
00658               UBTIDE%R(K) = CTIDEV*(UM2+UM4)
00659               VBTIDE%R(K) = CTIDEV*(VM2+VM4)
00660             ENDIF
00661 !
00662           ENDIF
00663         ENDIF
00664       ENDIF
00665 !
00666       ENDDO
00667 !
00668 !-----------------------------------------------------------------------
00669 !
00670       RETURN
00671       END

Generated on Fri Aug 31 2013 18:12:58 by S.E.Bourban (HRW) using doxygen 1.7.0