condiw.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\tomawac\condiw.f
00002 !
00159                      SUBROUTINE CONDIW
00160 !                    *****************
00161 !
00162      &( AT, LT , TC1, TC2, TV1, TV2, TM1, TM2 ,
00163      &  NVHMA,NVCOU,NVWIN, PART , U_TEL, V_TEL , H_TEL )
00164 !
00165 !***********************************************************************
00166 ! TOMAWAC   V6P3                                   10/06/2011
00167 !***********************************************************************
00168 !
00169 !
00170 !
00171 !
00172 !
00173 !
00174 !
00175 !
00176 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00177 !| AT             |<--| COMPUTATION TIME
00178 !| H_TEL          |-->| TELEMAC WATER DEPTH
00179 !| LT             |-->| NUMBER OF THE TIME STEP CURRENTLY SOLVED
00180 !| NVCOU          |---| NUMBER OF VARIABLES OF THE CURRENT FILE
00181 !| NVHMA          |<--| N.OF VARIABLES OF THE WATER LEVEL FILE
00182 !| NVWIN          |<--| N.OF VARIABLES OF THE WIND FILE
00183 !| PART           |-->| FLAG FOR DIRECT COUPLING WITH TELEMAC
00184 !| TC1            |<--| TIME T1 IN THE CURRENT FILE
00185 !| TC2            |<--| TIME T2 IN THE CURRENT FILE
00186 !| TM1            |<--| TIME T1 IN THE WATER LEVEL FILE
00187 !| TM2            |<--| TIME T2 IN THE WATER LEVEL FILE
00188 !| TV1            |<--| TIME T1 IN THE WIND FILE
00189 !| TV2            |<--| TIME T2 IN THE WIND FILE
00190 !| U_TEL          |-->| X-AXIS TELEMAC CURRENT SPEED
00191 !| V_TEL          |-->| Y-AXIS TELEMAC CURRENT SPEED
00192 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00193 !
00194       USE DECLARATIONS_TELEMAC
00195       USE DECLARATIONS_TOMAWAC
00196       USE INTERFACE_TOMAWAC, EX_CONDIW=> CONDIW
00197       USE BIEF
00198 !
00199       IMPLICIT NONE
00200 !
00201       INTEGER LNG,LU
00202       COMMON/INFO/ LNG,LU
00203 !
00204 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00205 !
00206       INTEGER, INTENT(IN)             :: PART,LT
00207       INTEGER, INTENT(INOUT)          :: NVHMA,NVCOU,NVWIN
00208       DOUBLE PRECISION, INTENT(INOUT) :: AT,TC1,TC2,TV1,TV2,TM1,TM2
00209       TYPE(BIEF_OBJ), INTENT(IN)      :: U_TEL,V_TEL,H_TEL
00210 !
00211 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00212 !
00213       INTEGER UL
00214       LOGICAL TROUVE(3)
00215 !
00216 !-----------------------------------------------------------------------
00217 !
00218       AT = 0.D0
00219 !
00220 !-----------------------------------------------------------------------
00221 !
00222 !     INITIALISES THE TIDAL CURRENT AND WATER LEVEL
00223 !
00224       TROUVE(1)=.FALSE.
00225       TROUVE(2)=.FALSE.
00226       TROUVE(3)=.FALSE.
00227 !
00228       IF(MAREE) THEN
00229 !
00230 !       READS IN THE TIDAL CURRRENT AND (OPTIONAL) DEPTH
00231 !
00232 !       JMH 16/11/2012 : formatted file suppressed
00233 !
00234         IF(WAC_FILES(WACCOB)%NAME(1:1).EQ.' ') THEN
00235           WRITE(LU,*) ' '
00236           IF(LNG.EQ.1) THEN
00237             WRITE(LU,*)'PRISE EN COMPTE D''UN COURANT DE MAREE'
00238             WRITE(LU,*)
00239      &      'MAIS PAS DE FICHIER DES COURANTS (OU DONNEES TELEMAC)'
00240             WRITE(LU,*)
00241      &      '==> LE COURANT DE MAREE EST INITIALISE DANS ANAMAR'
00242           ELSEIF(LNG.EQ.2) THEN
00243             WRITE(LU,*)'USE OF TIDAL CURRENT VELOCITIES'
00244             WRITE(LU,*)'BUT NO CURRENT FILE (NEITHER TELEMAC DATA FILE)'
00245             WRITE(LU,*)
00246      &      '==> INITIALISATION OF TIDAL CURRENT VELOCITIES IN ANAMAR'
00247           ENDIF
00248           WRITE(LU,*) ' '
00249           CALL ANAMAR(SUC%R,SVC%R,STRA31%R,SZM1%R,
00250      &                SZM2%R,SDZHDT%R,MESH%X%R,MESH%Y%R ,
00251      &                NPOIN2,AT,DDC,LT)
00252         ELSE
00253 !
00254 !         READS IN THE CURRENTS FROM BINARY FILE, AND POSSIBLY THE DEPTH
00255 !
00256           CALL LECDOI(SUC%R,NAMEU,
00257      &                      'VELOCITY U      M/S             ',2,
00258      &                SVC%R,NAMEV,
00259      &                      'VELOCITY V      M/S             ',2,
00260      &                SDEPTH%R,NAMEH,
00261      &                         'WATER DEPTH     M               ',1,
00262      &                MESH%X%R,MESH%Y%R,
00263      &                NPOIN2,WAC_FILES(WACCOB)%LU,BINCOU,NBOR,NPTFR,
00264      &                AT,DDC,TC1,TC2,SUC1%R,SUC2%R,SVC1%R,SVC2%R,
00265      &                SZM1%R,SZM2%R,INDIC,'COURANT',NVCOU,TEXCOB,TROUVE,
00266      &                UNITCOB,PHASCOB)
00267 !         IF DEPTH READ
00268           IF(TROUVE(3)) THEN
00269             CALL OV('X=Y-Z   ',DZHDT,SZM2%R,SZM1%R,0.D0,NPOIN2)
00270             CALL OV('X=CX    ',DZHDT,DZHDT,DZHDT,1.D0/(TC2-TC1),NPOIN2)
00271           ELSE
00272             CALL OV('X=C     ',DZHDT,DZHDT,DZHDT,0.D0,NPOIN2)
00273           ENDIF
00274 !
00275         ENDIF
00276 !
00277 !       READS IN THE TIDAL WATER LEVEL IF NOT FOUND IN CURRENT FILE
00278 !
00279         IF(.NOT.TROUVE(3)) THEN
00280         IF(WAC_FILES(WACMAF)%NAME(1:1).EQ.' '.AND.
00281      &     WAC_FILES(WACMAB)%NAME(1:1).EQ.' ') THEN
00282           IF(WAC_FILES(WACCOF)%NAME.NE.' '.OR.
00283      &       WAC_FILES(WACCOB)%NAME.NE.' ') THEN
00284             CALL ANAMAR
00285      &    ( SUC%R  , SVC%R   , STRA31%R, SZM1%R   ,
00286      &      SZM2%R , SDZHDT%R, MESH%X%R, MESH%Y%R ,
00287      &      NPOIN2,   AT  , DDC , LT    )
00288           ENDIF
00289           IF(LNG.EQ.1) THEN
00290             WRITE(LU,*)
00291      &      '==> LA HAUTEUR DE LA MAREE EST INITIALISEE DANS ANAMAR'
00292           ELSE
00293             WRITE(LU,*)
00294      &      '==> INITIALISATION OF TIDAL WATER LEVEL IN ANAMAR'
00295           ENDIF
00296         ELSE
00297           IF(WAC_FILES(WACMAF)%NAME(1:1).NE.' ') THEN
00298             IF(LNG.EQ.1) WRITE(LU,*) 'LECTURE HAUTEUR DANS FICHIER MAF'
00299             IF(LNG.EQ.2) WRITE(LU,*) 'READING DEPTH IN FILE MAF'
00300             UL=WAC_FILES(WACMAF)%LU
00301           ELSE
00302             IF(LNG.EQ.1) WRITE(LU,*) 'LECTURE HAUTEUR DANS FICHIER MAB'
00303             IF(LNG.EQ.1) WRITE(LU,*) 'READING DEPTH IN FILE MAB'
00304             UL=WAC_FILES(WACMAB)%LU
00305           ENDIF
00306           CALL LECDOI(SUC%R,NAMEU,
00307      &                      'VELOCITY U      M/S             ',0,
00308      &                SVC%R,NAMEV,
00309      &                      'VELOCITY V      M/S             ',0,
00310      &                SDEPTH%R,NAMEH,
00311      &                         'WATER DEPTH     M               ',2,
00312      &                MESH%X%R,MESH%Y%R,NPOIN2,UL,BINMAR,NBOR,NPTFR,
00313      &                AT,DDC,TM1,TM2,SUC1%R,SUC2%R,SVC1%R,SVC2%R,
00314      &                SZM1%R,SZM2%R,INDIM,'HAUTEUR',NVHMA,TEXMAB,TROUVE,
00315      &                UNITMAB,PHASMAB)
00316           CALL OV('X=Y-Z   ',DZHDT,SZM2%R,SZM1%R,0.D0,NPOIN2)
00317           CALL OV('X=CX    ',DZHDT,DZHDT,DZHDT,1.D0/(TM2-TM1),NPOIN2)
00318         ENDIF
00319 !
00320       ENDIF
00321       ENDIF
00322 !
00323 !     INITIALISES THE CONSTANT CURRENT
00324 !
00325       IF(COUSTA) THEN
00326         IF(WAC_FILES(WACCOF)%NAME(1:1).EQ.' '.AND.
00327      &     WAC_FILES(WACCOB)%NAME(1:1).EQ.' ') THEN
00328           IF(COUSTA) THEN
00329             CALL ANACOS(SUC%R,SVC%R,MESH%X%R,MESH%Y%R,NPOIN2)
00330             WRITE(LU,*)' '
00331             IF(LNG.EQ.1) THEN
00332               WRITE(LU,*)'PRISE EN COMPTE D''UN COURANT'
00333               WRITE(LU,*)
00334      &        'MAIS PAS DE FICHIER DES COURANTS (OU DONNEES TELEMAC)'
00335               WRITE(LU,*)'==> LE COURANT EST INITIALISE DANS ANACOS'
00336             ELSEIF(LNG.EQ.2) THEN
00337               WRITE(LU,*)'USE OF CURRENT VELOCITIES'
00338               WRITE(LU,*)
00339      &        'BUT NO CURRENT FILE (NEITHER TELEMAC DATA FILE)'
00340               WRITE(LU,*)
00341      &        '==> INITIALISATION OF CURRENT VELOCITIES IN ANACOS'
00342             ENDIF
00343           ELSE
00344             IF(LNG.EQ.1) THEN
00345               WRITE(LU,*)'RELECTURE D''UNE VARIABLE TELEMAC IMPOSSIBLE'
00346             ELSE
00347               WRITE(LU,*)' READING OF A TELEMAC DATA IMPOSSIBLE '
00348             ENDIF
00349             CALL PLANTE(1)
00350             STOP
00351           ENDIF
00352         ELSE
00353           IF(WAC_FILES(WACCOF)%NAME(1:1).NE.' ') THEN
00354             UL=WAC_FILES(WACCOF)%LU
00355           ELSE
00356             UL=WAC_FILES(WACCOB)%LU
00357           ENDIF
00358 !         HERE DEPTH POSSIBLY READ AS THIRD VARIABLE
00359           CALL LECDON(SUC%R,NAMEU,
00360      &                      'VELOCITY U      M/S             ',2,
00361      &                SVC%R,NAMEV,
00362      &                      'VELOCITY V      M/S             ',2,
00363      &                SDEPTH%R,NAMEH,
00364      &                         'WATER DEPTH     M               ',1,
00365      &                MESH%X%R,MESH%Y%R,NPOIN2,UL,BINCOU,NBOR,NPTFR,
00366      &                NPTT,INDIC,'COURANT',TEXCOB,TROUVE)
00367         ENDIF
00368         CALL OV('X=C     ',DZHDT,DZHDT,DZHDT,0.D0,NPOIN2)
00369       ENDIF
00370 !
00371       IF(PART.EQ.0) THEN
00372         CALL OS('X=Y     ',X=SDEPTH,Y=H_TEL)
00373         CALL OV('X=Y     ',SUC%R,U_TEL%R,U_TEL%R,0.D0,NPOIN2)
00374         CALL OV('X=Y     ',SVC%R,V_TEL%R,V_TEL%R,0.D0,NPOIN2)
00375       ENDIF
00376 !
00377 !-----------------------------------------------------------------------
00378 !
00379 !   INITIALISES THE WIND
00380 !
00381       IF(VENT) THEN
00382 !
00383         IF(WAC_FILES(WACVEF)%NAME(1:1).EQ.' '.AND.
00384      &     WAC_FILES(WACVEB)%NAME(1:1).EQ.' '     ) THEN
00385           WRITE(LU,*) ' '
00386           IF(LNG.EQ.1) THEN
00387             WRITE(LU,*)'PRISE EN COMPTE D''UN VENT'
00388             WRITE(LU,*)'MAIS PAS DE FICHIER DE VENT'
00389             WRITE(LU,*)'==> LE VENT EST INITIALISE DANS ANAVEN'
00390           ELSEIF(LNG.EQ.2) THEN
00391             WRITE(LU,*)'USE OF WIND VELOCITIES'
00392             WRITE(LU,*)'BUT NO WIND FILE '
00393             WRITE(LU,*)'==> INITIALISATION OF WIND VELOCITIES IN ANAVEN'
00394           ENDIF
00395           WRITE(LU,*) ' '
00396           CALL ANAVEN(SUV%R,SVV%R,MESH%X%R,MESH%Y%R,
00397      &                NPOIN2,AT,DDC,VX_CTE,VY_CTE)
00398         ELSE
00399           IF(WAC_FILES(WACVEF)%NAME(1:1).NE.' ') THEN
00400             UL=WAC_FILES(WACVEF)%LU
00401           ELSE
00402             UL=WAC_FILES(WACVEB)%LU
00403           ENDIF
00404           IF(VENSTA) THEN
00405             CALL LECDON(SUV%R,NAMEWX,
00406      &                        'WIND ALONG X    M/S             ',2,
00407      &                  SVV%R,NAMEWY,
00408      &                        'WIND ALONG Y    M/S             ',2,
00409      &                  SVV%R,'????????????????????????????????',
00410      &                        '????????????????????????????????',0,
00411      &                  MESH%X%R,MESH%Y%R,NPOIN2,UL,BINVEN,NBOR,NPTFR,
00412      &                  NPTT,INDIV,'WIND   ',TEXVEB,TROUVE)
00413           ELSE
00414             CALL LECDOI(SUV%R,NAMEWX,
00415      &                        'WIND ALONG X    M/S             ',2,
00416      &                  SVV%R,NAMEWY,
00417      &                        'WIND ALONG Y    M/S             ',2,
00418      &                  SVV%R,'????????????????????????????????',
00419      &                        '????????????????????????????????',0,
00420      &                  MESH%X%R,MESH%Y%R,
00421      &                  NPOIN2,UL,BINVEN,NBOR,NPTFR,
00422      &                  AT,DDC,TV1,TV2,SUV1%R,SUV2%R,SVV1%R,SVV2%R,
00423      &                  SVV1%R,SVV2%R,INDIV,'VENT   ',NVWIN,TEXVEB,
00424      &                  TROUVE,UNITVEB,PHASVEB)
00425           ENDIF
00426         ENDIF
00427       ENDIF
00428 !
00429 !-----------------------------------------------------------------------
00430 !
00431 !     INITIALISES F
00432 !
00433       CALL SPEINI(SF%R,TRA01(1:NF),TRA01(NF+1:NF+NPLAN),
00434      &            SUV%R,SVV%R,SFR%R,STETA%R,GRAVIT,
00435      &            FREMAX,FETCH,SIGMAA,SIGMAB,GAMMA,FPIC,HM0,
00436      &            ALPHIL,TETA1,SPRED1,TETA2,SPRED2,XLAMDA,NPOIN2,
00437      &            NPLAN,NF,INISPE,E2FMIN,DEPTH,FRABI)
00438 !
00439 !-----------------------------------------------------------------------
00440 !
00441       RETURN
00442       END

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