lecdon_telemac2d.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\telemac2d\lecdon_telemac2d.f
00002 !
00473                      SUBROUTINE LECDON_TELEMAC2D
00474 !                    ***************************
00475 !
00476      &(MOTCAR,WMOTCAR,FILE_DESC,WFILE_DESC,PATH,NCAR)
00477 !
00478 !***********************************************************************
00479 ! TELEMAC2D   V7P0                                   21/08/2010
00480 !***********************************************************************
00481 !
00482 !
00483 !
00484 !
00485 !
00486 !
00487 !
00488 !
00489 !
00490 !
00491 !
00492 !
00493 !
00494 !
00495 !
00496 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00497 !| FILE_DESC      |<--| STORES STRINGS 'SUBMIT' OF DICTIONARY
00498 !| MOTCAR         |<--| VALUES OF KEY-WORDS OF TYPE CHARACTER
00499 !| NCAR           |-->| NUMBER OF LETTERS IN STRING PATH
00500 !| PATH           |-->| FULL PATH TO CODE DICTIONARY
00501 !| WFILE_DESC     |<--| STORES STRINGS 'SUBMIT' OF DICTIONARY FOR WAQ
00502 !| WMOTCAR        |<--| VALUES OF KEY-WORDS OF TYPE CHARACTER FOR WAQ
00503 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00504 !
00505       USE BIEF
00506       USE DECLARATIONS_TELEMAC
00507       USE DECLARATIONS_TELEMAC2D
00508       USE DECLARATIONS_WAQTEL
00509 !
00510       USE INTERFACE_TELEMAC2D, EX_LECDON_TELEMAC2D => LECDON_TELEMAC2D
00511 !
00512       IMPLICIT NONE
00513       INTEGER LNG,LU
00514       COMMON/INFO/LNG,LU
00515 !
00516 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00517 !
00518       INTEGER, INTENT(IN)               :: NCAR
00519       CHARACTER(LEN=250), INTENT(IN)    :: PATH
00520       CHARACTER(LEN=144), INTENT(INOUT) :: FILE_DESC(4,MAXKEY)
00521       CHARACTER(LEN=144), INTENT(INOUT) :: MOTCAR(MAXKEY)
00522 !     WAQ
00523       CHARACTER(LEN=144), INTENT(INOUT) :: WFILE_DESC(4,MAXKEY)
00524       CHARACTER(LEN=144), INTENT(INOUT) :: WMOTCAR(MAXKEY)
00525 !
00526 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00527 !
00528       INTEGER I,K,ERR,ITRAC,NTRTOT
00529       INTEGER NREJEX,NREJEY,NCOSUP,NREJEV,NCRITE
00530 !
00531       CHARACTER*8 MNEMO(MAXVAR)
00532       CHARACTER(LEN=250) NOM_CAS,NOM_DIC
00533       CHARACTER(LEN=250) NOM_CAS_WAQ,NOM_DIC_WAQ
00534 !
00535 !-----------------------------------------------------------------------
00536 !
00537       CHARACTER(LEN=2) I_IN_2_LETTERS(34)
00538       DATA I_IN_2_LETTERS /'1 ','2 ','3 ','4 ','5 ','6 ','7 ','8 ','9 ',
00539      &                     '10','11','12','13','14','15','16','17','18',
00540      &                     '19','20','21','22','23','24','25','26','27',
00541      &                     '28','29','30','31','32','33','34'/
00542 !
00543       CHARACTER(LEN=24), PARAMETER :: CODE1='TELEMAC2D               '
00544 !      CHARACTER(LEN=24), PARAMETER :: CODE2='WAQTEL                  '
00545 !
00546 !-----------------------------------------------------------------------
00547 !
00548 !     ARRAYS USED IN THE DAMOCLES CALL
00549 !
00550       INTEGER              ADRESS(4,MAXKEY),DIMEN(4,MAXKEY)
00551       DOUBLE PRECISION     MOTREA(MAXKEY)
00552       INTEGER              MOTINT(MAXKEY)
00553       LOGICAL              MOTLOG(MAXKEY)
00554       CHARACTER*72         MOTCLE(4,MAXKEY,2)
00555       INTEGER              TROUVE(4,MAXKEY)
00556       LOGICAL DOC
00557 !     ARRAYS USED IN THE DAMOCLES CALL FOR WAQ
00558 !
00559       INTEGER              WADRESS(4,MAXKEY),WDIMEN(4,MAXKEY)
00560       DOUBLE PRECISION     WMOTREA(MAXKEY)
00561       INTEGER              WMOTINT(MAXKEY)
00562       LOGICAL              WMOTLOG(MAXKEY)
00563       CHARACTER*72         WMOTCLE(4,MAXKEY,2)
00564       INTEGER              WTROUVE(4,MAXKEY)
00565 !
00566 !     END OF DECLARATIONS FOR DAMOCLES CALL :
00567 !
00568 !-----------------------------------------------------------------------
00569 !
00570       INTRINSIC MAX,INT,MOD
00571 !
00572 !-----------------------------------------------------------------------
00573 !
00574 ! INITIALISES THE ARRAYS TO DEFAULT VALUES (NOT DONE IN DAMOCLES)
00575 !
00576       ICONVF(1) = ADV_CAR
00577 !     NO ADVECTION IS CONSIDERED ON H
00578       ICONVF(2) = 5
00579       ICONVF(3) = ADV_CAR
00580       ICONVF(4) = ADV_CAR
00581 !
00582       DISCRE(1) = 11
00583       DISCRE(2) = 11
00584       DISCRE(3) = 11
00585       DISCRE(4) = 11
00586 !
00587       COSUPG(1) = 1.D0
00588       COSUPG(2) = 1.D0
00589       COSUPG(3) = 1.D0
00590       COSUPG(4) = 1.D0
00591 !
00592       OPTSUP(1) = 2
00593       OPTSUP(2) = 2
00594       OPTSUP(3) = 2
00595       OPTSUP(4) = 2
00596 !
00597       BORNES(1) = -1000.D0
00598       BORNES(2) = +9000.D0
00599       BORNES(3) = -1000.D0
00600       BORNES(4) = +1000.D0
00601       BORNES(5) = -1000.D0
00602       BORNES(6) = +1000.D0
00603       BORNES(7) = -1000.D0
00604       BORNES(8) = +1000.D0
00605 !
00606       CRIPER(1) = 1.D-4
00607       CRIPER(2) = 1.D-4
00608       CRIPER(3) = 1.D-4
00609 !
00610       DO K=1,MAXFRO
00611         FRTYPE(K)=1
00612         PROVEL(K)=1
00613         STA_DIS_CURVES(K)=0
00614       ENDDO ! K
00615 !
00616 !-----------------------------------------------------------------------
00617 !
00618 ! INITIALISES THE VARIABLES FOR DAMOCLES CALL :
00619 !
00620       DO K=1,MAXKEY
00621 !       A FILENAME NOT GIVEN BY DAMOCLES WILL BE RECOGNIZED AS A WHITE SPACE
00622 !       (IT MAY BE THAT NOT ALL COMPILERS WILL INITIALISE LIKE THAT)
00623         MOTCAR(K)(1:1)=' '
00624 !
00625         DIMEN(1,K) = 0
00626         DIMEN(2,K) = 0
00627         DIMEN(3,K) = 0
00628         DIMEN(4,K) = 0
00629 !
00630         WMOTCAR(K)(1:1)=' '
00631 !
00632         WDIMEN(1,K) = 0
00633         WDIMEN(2,K) = 0
00634         WDIMEN(3,K) = 0
00635         WDIMEN(4,K) = 0
00636       ENDDO ! K
00637 !     WRITES OUT INFO
00638       DOC = .FALSE.
00639       ADDTR = 0
00640 !
00641 !-----------------------------------------------------------------------
00642 !     OPENS DICTIONNARY AND STEERING FILES
00643 !-----------------------------------------------------------------------
00644 !
00645       IF(NCAR.GT.0) THEN
00646 !
00647         NOM_DIC=PATH(1:NCAR)//'T2DDICO'
00648         NOM_CAS=PATH(1:NCAR)//'T2DCAS'
00649 !       WAQTEL
00650         NOM_DIC_WAQ=PATH(1:NCAR)//'T2DWQD'
00651         NOM_CAS_WAQ=PATH(1:NCAR)//'T2DWAQ'
00652 !
00653       ELSE
00654 !
00655         NOM_DIC='T2DDICO'
00656         NOM_CAS='T2DCAS'
00657 !       WAQTEL
00658         NOM_DIC_WAQ='T2DWQD'
00659         NOM_CAS_WAQ='T2DWAQ'
00660 !
00661       ENDIF
00662 !
00663       OPEN(2,FILE=NOM_DIC,FORM='FORMATTED',ACTION='READ')
00664       OPEN(3,FILE=NOM_CAS,FORM='FORMATTED',ACTION='READ')
00665 !
00666 !-----------------------------------------------------------------------
00667 !
00668       CALL DAMOCLE( ADRESS , DIMEN  , MAXKEY , DOC     , LNG    , LU ,
00669      &              MOTINT , MOTREA , MOTLOG , MOTCAR  , MOTCLE ,
00670      &              TROUVE , 2      , 3      , .FALSE. , FILE_DESC )
00671 !
00672 !-----------------------------------------------------------------------
00673 !     CLOSES DICTIONNARY AND STEERING FILES
00674 !-----------------------------------------------------------------------
00675       CLOSE(2)
00676       CLOSE(3)
00677 !
00678 !     FIRST VERIFY IF WE CALL WAQ OR NOT
00679 !
00680       WATQUA    = MOTLOG( ADRESS(3, 48) )
00681 !     SECONDARY CURRENT ALSO
00682       SECCURRENTS = MOTLOG(ADRESS(3,49))
00683       IF(WATQUA)THEN
00684 !
00685         OPEN(2,FILE=NOM_DIC_WAQ,FORM='FORMATTED',ACTION='READ',ERR=9000)
00686         OPEN(3,FILE=NOM_CAS_WAQ,FORM='FORMATTED',ACTION='READ',ERR=9000)
00687 !
00688 !       CALLING DAMCOCLE FOR WAQTEL
00689 !
00690         CALL DAMOCLE( WADRESS, WDIMEN, MAXKEY , DOC     , LNG    , LU ,
00691      &                WMOTINT , WMOTREA , WMOTLOG , WMOTCAR  , WMOTCLE,
00692      &                WTROUVE , 2       , 3    , .FALSE. , WFILE_DESC )
00693 !
00694 !-----------------------------------------------------------------------
00695 !     CLOSES DICTIONNARY AND STEERING FILES
00696 !-----------------------------------------------------------------------
00697 !
00698         CLOSE(2)
00699         CLOSE(3)
00700       ENDIF
00701 !
00702 !     ANALYSIS OF 'SUBMIT' CHAINS
00703 !
00704       CALL READ_SUBMIT(T2D_FILES,   MAXLU_T2D,   CODE1,FILE_DESC, 300)
00705 !
00706 !      NOT NECESSAY SO FAR, TO ACTIVATE WHEN WORKING IN STANDALONE
00707 !      IF(WATQUA) CALL
00708 !     &     READ_SUBMIT(WAQTEL_FILES,MAXLU_WAQTEL,CODE1,WFILE_DESC,300)
00709 
00710 !-----------------------------------------------------------------------
00711 !
00712 !     RETRIEVES FILES NUMBERS IN TELEMAC-2D FORTRAN PARAMETERS
00713 !     HERE LOGICAL UNITS EQUAL TO THE FILE NUMBER
00714 !
00715       DO I=1,MAXLU_T2D
00716         IF(T2D_FILES(I)%TELNAME.EQ.'T2DGEO') THEN
00717 !         T2DGEO=T2D_FILES(I)%LU  (IS EQUIVALENT)
00718           T2DGEO=I
00719         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DCLI') THEN
00720           T2DCLI=I
00721         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DPRE') THEN
00722           T2DPRE=I
00723         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DRES') THEN
00724           T2DRES=I
00725         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DFON') THEN
00726           T2DFON=I
00727         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DBI1') THEN
00728           T2DBI1=I
00729         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DBI2') THEN
00730           T2DBI2=I
00731         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DFO1') THEN
00732           T2DFO1=I
00733         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DFO2') THEN
00734           T2DFO2=I
00735         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DRBI') THEN
00736           T2DRBI=I
00737         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DRFO') THEN
00738           T2DRFO=I
00739         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DREF') THEN
00740           T2DREF=I
00741         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DIMP') THEN
00742           T2DIMP=I
00743         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DCOF') THEN
00744           T2DCOF=I
00745         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DDL1') THEN
00746           T2DDL1=I
00747         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DDL2') THEN
00748           T2DDL2=I
00749         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DDL3') THEN
00750           T2DDL3=I
00751         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DDL4') THEN
00752           T2DDL4=I
00753         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DDL5') THEN
00754           T2DDL5=I
00755         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DDL6') THEN
00756           T2DDL6=I
00757         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DDL7') THEN
00758           T2DDL7=I
00759         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DDL8') THEN
00760           T2DDL8=I
00761         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DDL9') THEN
00762           T2DDL9=I
00763         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DL10') THEN
00764           T2DL10=I
00765         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DL11') THEN
00766           T2DL11=I
00767         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DMAB') THEN
00768           T2DMAB=I
00769         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DVEF') THEN
00770           T2DVEF=I
00771         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DSEC') THEN
00772           T2DSEC=I
00773         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DSEO') THEN
00774           T2DSEO=I
00775         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DMIG') THEN
00776           T2DMIG=I
00777         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DHAR') THEN
00778           T2DHAR=I
00779         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DTID') THEN
00780           T2DTID=I
00781         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DBDD') THEN
00782           T2DBDD=I
00783         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DBB1') THEN
00784           T2DBB1=I
00785         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DBB2') THEN
00786           T2DBB2=I
00787         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DSEU') THEN
00788           T2DSEU=I
00789         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DSIP') THEN
00790           T2DSIP=I
00791         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DBUS') THEN
00792           T2DBUS=I
00793         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DBRC') THEN
00794           T2DBRC=I
00795         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DFLO') THEN
00796           T2DFLO=I
00797         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DZFI') THEN
00798           T2DZFI=I
00799         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DWAQ') THEN
00800           T2DWAQ=I
00801         ELSEIF(T2D_FILES(I)%TELNAME.EQ.'T2DWQD') THEN
00802           T2DWQD=I
00803         ELSEIF(I.NE.02.AND.I.NE.03.AND.I.NE.05.AND.I.NE.06)THEN
00804 !         ONE FILE THAT SHOULD HAVE A STRING 'SUBMIT' IN DICTIONARY
00805 !         HAS RECEIVED NO NAME
00806           IF(LNG.EQ.1) THEN
00807             WRITE(LU,*) 'LECDON_TELEMAC2D: ERREUR POUR LE FICHIER'
00808             WRITE(LU,*) 'I=',I,' NOM=',T2D_FILES(I)%TELNAME
00809             WRITE(LU,*) 'IL MANQUE UNE CHAINE SUBMIT DANS LE'
00810             WRITE(LU,*) 'DICTIONNAIRE'
00811             WRITE(LU,*) 'OU INSTALLATION DEFECTUEUSE.'
00812           ELSEIF(LNG.EQ.2) THEN
00813             WRITE(LU,*) 'LECDON_TELEMAC2D: ERROR FOR FILE NUMBER'
00814             WRITE(LU,*) 'I=',I,' NAME=',T2D_FILES(I)%TELNAME
00815             WRITE(LU,*) 'THIS FILE SHOULD HAVE A STRING SUBMIT'
00816             WRITE(LU,*) 'IN DICTIONARY'
00817             WRITE(LU,*) 'OR INSTALLATION PROBLEM.'
00818           ENDIF
00819           CALL PLANTE(1)
00820           STOP
00821         ENDIF
00822       ENDDO
00823 !
00824       IF(WATQUA)THEN
00825 !
00826 !     RETRIEVES FILES NUMBERS IN WAQTEL PARAMETERS
00827 !
00828         DO I=1,MAXLU_WAQTEL
00829           IF    (WAQTEL_FILES(I)%TELNAME.EQ.'WAQCAS') THEN
00830             WAQCAS=I
00831           ELSEIF(WAQTEL_FILES(I)%TELNAME.EQ.'WAQGEO') THEN
00832             WAQGEO=I
00833           ELSEIF(WAQTEL_FILES(I)%TELNAME.EQ.'WAQRES') THEN
00834             WAQRES=I
00835           ELSEIF(WAQTEL_FILES(I)%TELNAME.EQ.'WAQREF') THEN
00836             WAQREF=I
00837           ENDIF
00838         ENDDO
00839 !
00840 !     ASSIGNS THE WAQ STEERING FILE VALUES TO THE PARAMETER FORTRAN NAME
00841 !
00842 !-----------------------------------------------------------------------
00843 !*******************************
00844 !   WAQ  INTEGER KEYWORDS      *
00845 !*******************************
00846 !
00847 !       PRINTOUT WAQ PERIOD
00848 !       WLEOPRD    = WMOTINT( ADRESS(1,  1) )
00849 !       WAQ PROCESS
00850         WAQPROCESS = WMOTINT( WADRESS(1,  2) )
00851 !       K2 FORMULA
00852         FORMK2     = WMOTINT( WADRESS(1,  3) )
00853 !       CS FORMULA
00854         FORMCS     = WMOTINT( WADRESS(1,  5) )
00855 !       DEBUG KEYWORD
00856         DEBUG      = WMOTINT( WADRESS(1, 11) )
00857 !
00858 !*******************************
00859 !       WAQ REAL KEYWORDS        *
00860 !*******************************
00861 !
00862         ROO    = WMOTREA( WADRESS(2,  2) )
00863         GRAV   = WMOTREA( WADRESS(2,  5) )
00864         VCE    = WMOTREA( WADRESS(2,  8) )
00865         LDISP  = WMOTREA( WADRESS(2, 11) )
00866         TDISP  = WMOTREA( WADRESS(2, 12) )
00867         K120   = WMOTREA( WADRESS(2, 21) )
00868         K520   = WMOTREA( WADRESS(2, 22) )
00869         O2PHOTO= WMOTREA( WADRESS(2, 25) )
00870         O2NITRI= WMOTREA( WADRESS(2, 26) )
00871         DEMBEN = WMOTREA( WADRESS(2, 29) )
00872         K22    = WMOTREA( WADRESS(2, 31) )
00873         O2SATU = WMOTREA( WADRESS(2, 33) )
00874         WPOR   = WMOTREA( WADRESS(2, 36) )
00875         WNOR   = WMOTREA( WADRESS(2, 39) )
00876         CMAX   = WMOTREA( WADRESS(2, 42) )
00877         PS     = WMOTREA( WADRESS(2, 45) )
00878         KPE    = WMOTREA( WADRESS(2, 48) )
00879         BETA   = WMOTREA( WADRESS(2, 51) )
00880         IK     = WMOTREA( WADRESS(2, 54) )
00881         KP     = WMOTREA( WADRESS(2, 57) )
00882         KN     = WMOTREA( WADRESS(2, 60) )
00883         CTOXIC = WMOTREA( WADRESS(2, 63) )
00884         TRESPIR= WMOTREA( WADRESS(2, 66) )
00885         PROPHOC= WMOTREA( WADRESS(2, 69) )
00886         DTP    = WMOTREA( WADRESS(2, 71) )
00887         K320   = WMOTREA( WADRESS(2, 73) )
00888         PRONITC= WMOTREA( WADRESS(2, 75) )
00889         PERNITS= WMOTREA( WADRESS(2, 77) )
00890         K360   = WMOTREA( WADRESS(2, 79) )
00891         CMORALG(1)= WMOTREA(WADRESS(2,81))
00892         CMORALG(2)= WMOTREA(WADRESS(2,81)+1)
00893         WLOR   = WMOTREA( WADRESS(2, 85) )
00894         K1     = WMOTREA( WADRESS(2, 90) )
00895         K44    = WMOTREA( WADRESS(2, 93) )
00896         PHOTO  = WMOTREA( WADRESS(2, 95) )
00897         RESP   = WMOTREA( WADRESS(2, 97) )
00898         WATTEMP= WMOTREA( WADRESS(2, 99) )
00899         ERO    = WMOTREA( WADRESS(2,104) )
00900         TAUR   = WMOTREA( WADRESS(2,106) )
00901         TAUS   = WMOTREA( WADRESS(2,109) )
00902         VITCHU = WMOTREA( WADRESS(2,111) )
00903         CCSEDIM= WMOTREA( WADRESS(2,113) )
00904         CDISTRIB= WMOTREA(WADRESS(2,115) )
00905         KDESORP= WMOTREA (WADRESS(2,117) )
00906         CP_EAU = WMOTREA( WADRESS(2,119) )
00907         CP_AIR = WMOTREA( WADRESS(2,121) )
00908         CFAER(1)=WMOTREA( WADRESS(2,125) )
00909         CFAER(2)=WMOTREA( WADRESS(2,125)+1)
00910         COEF_K = WMOTREA( WADRESS(2,127) )
00911         EMA    = WMOTREA( WADRESS(2,129) )
00912         EMI_EAU= WMOTREA( WADRESS(2,131) )
00913 !       INITIALIZE K2 DONE IN CALCS_O2
00914 !        IF(WAQPROCESS.EQ.1.AND.FORMK2.EQ.0)THEN
00915 !          CALL OS('X=C     ',K2,K2,K2,K22)
00916 !        ENDIF
00917 !
00918 !*******************************
00919 !       LOGICAL KEYWORDS         *
00920 !*******************************
00921 !
00922         WQBILMAS= WMOTLOG( WADRESS(3,  1) )
00923         WQVALID = WMOTLOG( WADRESS(3,  3) )
00924 !
00925 !*******************************
00926 !       STRING KEYWORDS          *
00927 !*******************************
00928 !
00929         TITWAQCAS = WMOTCAR( WADRESS(4, 2) ) (1:72)
00930 !       SORTWAQ   = WMOTCAR( WADRESS(4, 3) ) (1:72)
00931 !
00932 !       FILES IN THE STEERING FILE (TO ACTIVATE FOR STANALONE RUN)
00933 !
00934 !       WAQTEL_FILES(WAQRES)%NAME=WMOTCAR( WADRESS(4,6 ) )
00935 !       WAQTEL_FILES(WAQGEO)%NAME=WMOTCAR( WADRESS(4,8 ) )
00936 !       WAQTEL_FILES(WAQREF)%NAME=WMOTCAR( WADRESS(4,12) )
00937 !       WAQTEL_FILES(WAQHYD)%NAME=WMOTCAR( WADRESS(4,14) )
00938 !
00939       ENDIF
00940 !     JUMP HERE IF NO WAQ
00941 !
00942 !     LOOKS FOR THE NUMBER OF TRACERS TO BE INCREASED
00943 !     DEPENDING ON THE WAQ PROCESS
00944 !
00945       IF(WATQUA.OR.SECCURRENTS)THEN
00946 !
00947         CALL INCREASE_NTRAC(ADDTR,WATQUA,WAQPROCESS,SECCURRENTS,
00948      &                      MOTCAR,                    ! HERE ARE NAMETRAC
00949      &                      DIMEN(4,74),
00950      &                      MOTINT( ADRESS(1,67)   ))  ! HERE IS NTRAC
00951       ENDIF
00952 !
00953 !
00954 !-----------------------------------------------------------------------
00955 !
00956 ! ASSIGNS THE STEERING FILE VALUES TO THE PARAMETER FORTRAN NAME :
00957 !
00958 !-----------------------------------------------------------------------
00959 !
00960 ! INTEGER KEYWORDS:
00961 !
00962       LEOPRD           = MOTINT( ADRESS(1, 1) )
00963 !
00964 !     LISTING PRINTOUT PERIOD
00965 !
00966       LISPRD           = MOTINT( ADRESS(1, 2) )
00967       IF(TROUVE(1,64).EQ.2) THEN
00968         LISPRD = MOTINT( ADRESS(1,64) )
00969       ENDIF
00970 !
00971       NIT              = MOTINT( ADRESS(1, 3) )
00972 !     PSI SCHEME OPTION
00973       OPTPSI           = MOTINT( ADRESS(1, 4) )
00974 !     TYPE OF ADVECTION (TO BE REMOVED IN FUTURE VERSIONS)
00975       IF(DIMEN(1,5).NE.0) THEN
00976         DO K=1,DIMEN(1,5)
00977           ICONVF(K)     = MOTINT( ADRESS(1,5) + K-1 )
00978         ENDDO
00979       ENDIF
00980 !     INDEX 6, SEE AFTER 46 (NBUSE)
00981       ITURB            = MOTINT( ADRESS(1, 7) )
00982       KFROT            = MOTINT( ADRESS(1, 8) )
00983       SLVPRO%NITMAX    = MOTINT( ADRESS(1,10) )
00984       OPTPRO           = MOTINT( ADRESS(1,12) )
00985       SLVK%NITMAX      = MOTINT( ADRESS(1,13) )
00986       SLVEP%NITMAX     = SLVK%NITMAX
00987       SLVPRO%PRECON    = MOTINT( ADRESS(1,14) )
00988       IORDRH    = MOTINT( ADRESS(1,15) )
00989       IF(DIMEN(1,16).NE.0) THEN
00990         DO K=1,DIMEN(1,16)
00991           DISCRE(K) = MOTINT( ADRESS(1,16) + K-1 )
00992         ENDDO ! K
00993       ENDIF
00994 !     STDGEO    = MOTINT( ADRESS(1,17) )
00995 !     STDRES    = MOTINT( ADRESS(1,18) )
00996       SLVPRO%SLV = MOTINT( ADRESS(1,19) )
00997 !     STDPRE    = MOTINT( ADRESS(1,20) )
00998       NSOUSI    = MOTINT( ADRESS(1,21) )
00999       PTINIG    = MOTINT( ADRESS(1,22) )
01000       PTINIL    = MOTINT( ADRESS(1,23) )
01001       SLVK%SLV = MOTINT( ADRESS(1,25) )
01002       SLVEP%SLV = SLVK%SLV
01003       SLVK%PRECON    = MOTINT( ADRESS(1,26) )
01004       SLVEP%PRECON = SLVK%PRECON
01005       LISRUG    = MOTINT( ADRESS(1,27) )
01006       NFLOT_MAX = MOTINT( ADRESS(1,28) )
01007       FLOPRD    = MOTINT( ADRESS(1,29) )
01008       NLAG      = MOTINT( ADRESS(1,30) )
01009       LISFON    = MOTINT( ADRESS(1,31) )
01010       SLVPRO%KRYLOV = MOTINT( ADRESS(1,33) )
01011       SLVK%KRYLOV = MOTINT( ADRESS(1,34) )
01012       SLVEP%KRYLOV = SLVK%KRYLOV
01013       OPTBAN    = MOTINT( ADRESS(1,35) )
01014       LVMAC     = MOTINT( ADRESS(1,36) )
01015       IF(DIMEN(1,37).NE.0) THEN
01016         DO K=1,DIMEN(1,37)
01017           OPTSUP(K) = MOTINT( ADRESS(1,37) + K-1 )
01018         ENDDO ! K
01019       ENDIF
01020       IORDRU       = MOTINT( ADRESS(1,38) )
01021       START_RECORD = MOTINT( ADRESS(1,39) )
01022       OPTASS       = MOTINT( ADRESS(1,40) )
01023       MARDAT(1)    = MOTINT( ADRESS(1,41) )
01024       MARDAT(2)    = MOTINT( ADRESS(1,41) + 1 )
01025       MARDAT(3)    = MOTINT( ADRESS(1,41) + 2 )
01026       MARTIM(1)    = MOTINT( ADRESS(1,42) )
01027       MARTIM(2)    = MOTINT( ADRESS(1,42) + 1 )
01028       MARTIM(3)    = MOTINT( ADRESS(1,42) + 2 )
01029       PRODUC       = MOTINT( ADRESS(1,43) )
01030       NCP=DIMEN(1,44)
01031       ALLOCATE(CTRLSC(NCP),STAT=ERR)
01032 !
01033       IF(ERR.NE.0) THEN
01034         IF(LNG.EQ.1) WRITE(LU,1039) ERR
01035         IF(LNG.EQ.2) WRITE(LU,2039) ERR
01036 1039    FORMAT(1X,'LECDON : ERREUR A L''ALLOCATION DE CTRLSC : ',/,1X,
01037      &            'CODE D''ERREUR : ',1I6)
01038 2039    FORMAT(1X,'LECDON: ERROR DURING ALLOCATION OF CTRLSC: ',/,1X,
01039      &            'ERROR CODE: ',1I6)
01040       ENDIF
01041       IF(NCP.NE.0) THEN
01042         DO K=1,NCP
01043           CTRLSC(K) = MOTINT( ADRESS(1,44) + K-1 )
01044         ENDDO
01045       ENDIF
01046       NWEIRS    = MOTINT( ADRESS(1,45) )
01047       NSIPH     = MOTINT( ADRESS(1,46) )
01048       NBUSE     = MOTINT( ADRESS(1, 6) )
01049       NTYPFR = DIMEN(1,47)
01050       THOMFR=.FALSE.
01051       IF(NTYPFR.NE.0) THEN
01052         DO K=1,NTYPFR
01053           FRTYPE(K) = MOTINT( ADRESS(1,47) + K-1 )
01054           IF(FRTYPE(K).EQ.2) THOMFR=.TRUE.
01055         ENDDO
01056       ENDIF
01057       SOLSYS    = MOTINT( ADRESS(1,48) )
01058 !
01059 !     NUMBER OF PROCESSORS (ALREADY IN INIT_FILES2; MUST BE THE
01060 !     SAME, BUT IT CAN (ERRONEOUSLY) BE DIFFERENT WHEN COUPLING).
01061       IF(NCSIZE.NE.MOTINT(ADRESS(1,49))) THEN
01062         IF(LNG.EQ.1) THEN
01063           WRITE(LU,*) 'NOMBRE DE PROCESSEURS PARALLELES DIFFERENT :'
01064           WRITE(LU,*) 'DEJA DECLARE (CAS DE COUPLAGE ?) :',NCSIZE
01065           WRITE(LU,*) 'TELEMAC-2D :',MOTINT(ADRESS(1,49))
01066           WRITE(LU,*) 'LA VALEUR ',NCSIZE,' EST GARDEE'
01067         ENDIF
01068         IF(LNG.EQ.2) THEN
01069           WRITE(LU,*) 'DIFFERENT NUMBER OF PARALLEL PROCESSORS:'
01070           WRITE(LU,*) 'DECLARED BEFORE (CASE OF COUPLING ?):',NCSIZE
01071           WRITE(LU,*) 'TELEMAC-2D :',MOTINT(ADRESS(1,49))
01072           WRITE(LU,*) 'VALUE ',NCSIZE,' IS KEPT'
01073         ENDIF
01074       ENDIF
01075       IF(DIMEN(1,50).NE.0) THEN
01076         DO K=1,DIMEN(1,50)
01077           PROVEL(K) = MOTINT( ADRESS(1,50) + K-1 )
01078         ENDDO
01079       ENDIF
01080       OPDTRA    = MOTINT( ADRESS(1,51) )
01081       OPDVIT    = MOTINT( ADRESS(1,52) )
01082       OPTSOU    = MOTINT( ADRESS(1,53) )
01083       NPRIV     = MOTINT( ADRESS(1,54) )
01084 !     CHANGE OF LANGUAGE: DOES NOT WORK IN THE EVENT OF CONTINUATION, INVESTIGATE
01085 !     LNG       = MOTINT (ADRESS (1,55))
01086       NPTH      = MOTINT( ADRESS(1,56) )
01087 !     OPTION FOR THE IDENTIFICATION OF PARAMETERS
01088       OPTID     = MOTINT( ADRESS(1,57) )
01089       NPTS      = DIMEN(1,58)
01090       IF(NPTS.GT.0) THEN
01091         DO K=1,NPTS
01092           LIST_PTS(K) = MOTINT( ADRESS(1,58) + K-1 )
01093           NAME_PTS(K)=' '
01094         ENDDO
01095       ENDIF
01096       OPTCOST= MOTINT( ADRESS(1,59) )
01097       MAXEST = MOTINT( ADRESS(1,60) )
01098 !     COUPLING PERIOD
01099       PERCOU = MOTINT( ADRESS(1,61) )
01100 !     FINITE VOLUME SCHEME
01101       OPTVF  = MOTINT( ADRESS(1,62) )
01102 !     MAX NUMBER OF ZONES TO DEFINE FRICTION COEFF.
01103       NZONMX = MOTINT( ADRESS(1,63) )
01104 !     COORDINATES OF THE ORIGIN
01105       I_ORIG = MOTINT( ADRESS(1,65)   )
01106       J_ORIG = MOTINT( ADRESS(1,65)+1 )
01107 !     DELWAQ PRINTOUT PERIOD
01108       WAQPRD = MOTINT( ADRESS(1,66)   )
01109 !     NUMBER OF TRACERS
01110       NTRAC  = MOTINT( ADRESS(1,67)   )
01111 !     ADD THE TRACERS OF WAQ  AND SECONDARY CURRENT
01112       NTRAC = NTRAC + ADDTR
01113 !
01114 !     PREVIOUS KEYWORDS DEPENDING ON NTRAC
01115 !
01116       IF(NTRAC.GT.0) THEN
01117 !       FIRST ASSUMING A SINGLE VALUE
01118         DO ITRAC=1,NTRAC
01119           SLVTRA(ITRAC)%NITMAX = MOTINT( ADRESS(1, 9) )
01120           SLVTRA(ITRAC)%SLV    = MOTINT( ADRESS(1,11) )
01121           SLVTRA(ITRAC)%PRECON = MOTINT( ADRESS(1,24) )
01122           SLVTRA(ITRAC)%KRYLOV = MOTINT( ADRESS(1,32) )
01123         ENDDO
01124 !       MULTIPLE VALUES MAY BE GIVEN (AND A FEW LAST MAY BE FORGOTTEN)
01125         DO ITRAC=1,DIMEN(1,9)
01126           SLVTRA(ITRAC)%NITMAX = MOTINT( ADRESS(1,9)+ITRAC-1 )
01127         ENDDO
01128         DO ITRAC=1,DIMEN(1,11)
01129           SLVTRA(ITRAC)%SLV    = MOTINT( ADRESS(1,11)+ITRAC-1 )
01130         ENDDO
01131         DO ITRAC=1,DIMEN(1,24)
01132           SLVTRA(ITRAC)%PRECON = MOTINT( ADRESS(1,24)+ITRAC-1 )
01133         ENDDO
01134         DO ITRAC=1,DIMEN(1,32)
01135           SLVTRA(ITRAC)%KRYLOV = MOTINT( ADRESS(1,32)+ITRAC-1 )
01136         ENDDO
01137       ENDIF
01138 !
01139 !     END OF PREVIOUS KEYWORDS DEPENDING ON NTRAC
01140 !
01141 !     STAGE-DISCHARGE CURVES
01142       IF(DIMEN(1,68).NE.0) THEN
01143         DO K=1,DIMEN(1,68)
01144           STA_DIS_CURVES(K) = MOTINT( ADRESS(1,68) + K-1 )
01145         ENDDO
01146       ENDIF
01147 !     DEBUGGER KEYWORD
01148       DEBUG  = MOTINT(ADRESS(1,69))
01149 !     NEGATIVE DEPTHS OPTION
01150       OPT_HNEG = MOTINT(ADRESS(1,70))
01151 !     DEPTH IN FRICTION TERMS
01152       HFROT = MOTINT(ADRESS(1,71))
01153 !     LAW OF FRICTION ON LATERAL BOUNDARIES
01154       KFROTL     = MOTINT(ADRESS(1,72))
01155 !     COUPLING PERIOD FOR TOMAWAC
01156       PERCOU_WAC = MOTINT(ADRESS(1,73))
01157 !     TREATMENT OF FLUXES AT THE BOUNDARIES
01158       DIRFLU     = MOTINT(ADRESS(1,74))
01159 !     OPTION FOR TIDAL BOUNDARY CONDITIONS
01160       TIDALTYPE  = MOTINT(ADRESS(1,75))
01161 !     OPTION FOR TSUNAMI GENERATION
01162       OPTTSUNAMI = MOTINT(ADRESS(1,76))
01163 !     INPUT TIDAL DATA BASE
01164       TIDALDB = MOTINT(ADRESS(1,77))
01165 !     GEOGRAPHIC SYSTEM IN WHICH THE NUMERICAL MODEL IS BUILT (TIDAL MODEL)
01166       GEOSYST = MOTINT(ADRESS(1,78))
01167 !     ZONE NUMBER WHEN USING A PLANE PROJECTION,
01168 !     ASSOCIATED TO GEOGRAPHIC SYSTEM (TIDAL MODEL)
01169       NUMZONE = MOTINT(ADRESS(1,79))
01170 !     LAW OF TRACERS DEGRADATION
01171       IF(NTRAC.GT.0) THEN
01172         DO I=1,NTRAC
01173           LOITRAC(I) = 0
01174         ENDDO
01175         IF(TROUVE(1,80).EQ.2) THEN
01176           DO I=1,DIMEN(1,80)
01177             LOITRAC(I) = MOTINT(ADRESS(1,80)+I-1)
01178           ENDDO
01179         ENDIF
01180       ENDIF
01181 !     SPATIAL PROJECTION TYPE
01182       PROTYP = MOTINT(ADRESS(1,81))
01183 !     ALGAE TYPE
01184       ALGTYP = MOTINT(ADRESS(1,82))
01185 !     OPTION FOR CHARACTERISTICS
01186       OPTCHA = MOTINT(ADRESS(1,83))
01187 !     MAXIMUM NUMBER OF ITERATIONS FOR ADVECTION SCHEMES
01188       MAXADV = MOTINT(ADRESS(1,84))
01189 !     STOCHASTIC DIFFUSION MODEL
01190       STOCHA = MOTINT(ADRESS(1,85))
01191 !     NUMBER OF GAUSS POINTS FOR CHARACTERISTICS
01192       NGAUSS = MOTINT(ADRESS(1,86))
01193 !
01194 !     OPTION FOR WEIR TREATMENT
01195       TYPSEUIL = MOTINT(ADRESS(1,87))
01196 !
01197 !     NEW KEYWORDS REPLACING TYPE OF ADVECTION
01198 !
01199       IF(TROUVE(1,88).EQ.2) THEN
01200         ICONVF(1) = MOTINT(ADRESS(1,88))
01201       ENDIF
01202       IF(NTRAC.GT.0) THEN
01203         DO ITRAC=1,NTRAC
01204           ICONVFT(ITRAC)=ICONVF(3)
01205         ENDDO
01206         IF(TROUVE(1,89).EQ.2) THEN
01207           DO ITRAC=1,DIMEN(1,89)
01208             ICONVFT(ITRAC)=MOTINT(ADRESS(1,89)+ITRAC-1)
01209           ENDDO
01210         ENDIF
01211       ENDIF
01212       IF(TROUVE(1,90).EQ.2) THEN
01213         ICONVF(4) = MOTINT(ADRESS(1,90))
01214       ENDIF
01215 !
01216 !     OPTION FOR WIND MANAGEMENT
01217       OPTWIND = MOTINT(ADRESS(1,94))
01218 !     AVOID NON LOGICAL CASE (WIND=YES AND OPTWIND=0)
01219       IF(VENT.AND.OPTWIND.EQ.0)THEN
01220         IF(LNG.EQ.1) THEN
01221           WRITE(LU,*) ' INCONSISTANCE DANS LA GESTION DU VENT'
01222           WRITE(LU,*) ' VENT ACTIVE ET OPTION DU VENT = 0'
01223         ENDIF
01224         IF(LNG.EQ.2) THEN
01225           WRITE(LU,*) ' UNCOHERENT CHOICES FOR WIND MANAGEMENT'
01226           WRITE(LU,*) ' WIND ACTIVATED AND OPTION FOR WIND = 0'
01227         ENDIF
01228         CALL PLANTE(1)
01229         STOP
01230       ENDIF
01231 !
01232 ! REAL KEYWORDS:
01233 !
01234       DT           = MOTREA( ADRESS(2, 1) )
01235       GRAV         = MOTREA( ADRESS(2, 2) )
01236       SLVPRO%ZERO  = MOTREA( ADRESS(2, 3) )
01237       SLVK%ZERO    = SLVPRO%ZERO
01238       SLVEP%ZERO   = SLVPRO%ZERO
01239       FFON      = MOTREA( ADRESS(2, 4) )
01240       FCOR      = MOTREA( ADRESS(2, 5) )
01241       FAIR      = MOTREA( ADRESS(2, 6) )
01242       FUAIR     = MOTREA( ADRESS(2, 7) )
01243       FVAIR     = MOTREA( ADRESS(2, 8) )
01244       IF(NTRAC.GT.0) THEN
01245         DO K=1,NTRAC
01246           TRAC0(K)=0.D0
01247           IF(DIMEN(2,9).GE.K) THEN
01248             TRAC0(K) = MOTREA( ADRESS(2, 9) +K-1)
01249           ELSE
01250             IF(LNG.EQ.1) THEN
01251               WRITE(LU,*) 'LA VALEUR INITIALE DU TRACEUR ',K
01252               WRITE(LU,*) 'N''EST PAS DONNEE, ELLE EST MISE A 0.D0'
01253             ENDIF
01254             IF(LNG.EQ.1) THEN
01255               WRITE(LU,*) 'THE INITIAL VALUE OF TRACER ',K
01256               WRITE(LU,*) 'IS NOT GIVEN, IT IS SET TO 0.D0'
01257             ENDIF
01258           ENDIF
01259         ENDDO
01260       ENDIF
01261       DIFNU     = MOTREA( ADRESS(2,10) )
01262       IF(NTRAC.GT.0) THEN
01263         DO ITRAC=1,NTRAC
01264           SLVTRA(ITRAC)%ZERO = SLVPRO%ZERO
01265           SLVTRA(ITRAC)%EPS  = MOTREA( ADRESS(2,11) )
01266         ENDDO
01267       ENDIF
01268       TETAT     = MOTREA( ADRESS(2,12) )
01269       PROPNU    = MOTREA( ADRESS(2,13) )
01270       SLVPRO%EPS= MOTREA( ADRESS(2,14) )
01271       IF(DIMEN(2,15).NE.0) THEN
01272         DO K=1,DIMEN(2,15)
01273           BORNES(K) = MOTREA( ADRESS(2,15) + K-1 )
01274         ENDDO
01275       ENDIF
01276       HREC      = MOTREA( ADRESS(2,16) )
01277       TETAC     = MOTREA( ADRESS(2,17) )
01278       TETAU     = MOTREA( ADRESS(2,18) )
01279       TETAD     = MOTREA( ADRESS(2,19) )
01280       AGGLOC    = MOTREA( ADRESS(2,20) )
01281       AGGLOU    = MOTREA( ADRESS(2,21) )
01282       HMIN      = MOTREA( ADRESS(2,22) )
01283       REDUC     = MOTREA( ADRESS(2,23) )
01284       SLVK%EPS  = MOTREA( ADRESS(2,24) )
01285       SLVEP%EPS = MOTREA( ADRESS(2,25) )
01286       HAULIN    = MOTREA( ADRESS(2,26) )
01287       ROEAU     = MOTREA( ADRESS(2,27) )
01288       LAMBD0    = MOTREA( ADRESS(2,28) )
01289       SB        = MOTREA( ADRESS(2,29) )
01290       COTINI    = MOTREA( ADRESS(2,33) )
01291       HAUTIN    = MOTREA( ADRESS(2,34) )
01292 !
01293 !  ARRAYS OF REALS
01294 !
01295       NDEBIT = DIMEN(2,30)
01296       IF(NDEBIT.NE.0) THEN
01297         DO K=1,NDEBIT
01298           DEBIT(K) = MOTREA( ADRESS(2,30) + K-1 )
01299         ENDDO
01300       ENDIF
01301       NCOTE  = DIMEN(2,31)
01302       IF(NCOTE.NE.0) THEN
01303         DO K=1,NCOTE
01304           COTE(K) = MOTREA( ADRESS(2,31) + K-1 )
01305         ENDDO
01306       ENDIF
01307       NVITES = DIMEN(2,32)
01308       IF(NVITES.NE.0) THEN
01309         DO K=1,NVITES
01310           VITES(K) = MOTREA( ADRESS(2,32) + K-1 )
01311         ENDDO
01312       ENDIF
01313       NTRACE = DIMEN(2,35)
01314       IF(NTRACE.NE.0) THEN
01315         DO K=1,NTRACE
01316           TRACER(K)=MOTREA(ADRESS(2,35)+K-1)
01317         ENDDO
01318       ENDIF
01319       NREJET = DIMEN(2,38)
01320       IF(NREJET.NE.0) THEN
01321         DO K=1,NREJET
01322           DSCE(K) = MOTREA( ADRESS(2,38) + K-1 )
01323         ENDDO
01324       ENDIF
01325       NREJEX = DIMEN(2,36)
01326       IF(NREJEX.EQ.NREJET) THEN
01327         DO K=1,NREJEX
01328           XSCE(K) = MOTREA( ADRESS(2,36) + K-1 )
01329         ENDDO
01330       ELSE
01331         IF(LNG.EQ.1) THEN
01332           WRITE(LU,*) NREJET,' ABSCISSES DES SOURCES ATTENDUES'
01333           WRITE(LU,*) NREJEX,' TROUVEES'
01334         ENDIF
01335         IF(LNG.EQ.2) THEN
01336           WRITE(LU,*) NREJET,' ABSCISSAE OF SOURCES EXPECTED'
01337           WRITE(LU,*) NREJEX,' FOUND'
01338         ENDIF
01339         CALL PLANTE(1)
01340         STOP
01341       ENDIF
01342       NREJEY = DIMEN(2,37)
01343       IF(NREJEY.EQ.NREJET) THEN
01344         DO K=1,NREJEY
01345           YSCE(K) = MOTREA( ADRESS(2,37) + K-1 )
01346         ENDDO
01347       ELSE
01348         IF(LNG.EQ.1) THEN
01349           WRITE(LU,*) NREJET,' ABSCISSES DES SOURCES ATTENDUES'
01350           WRITE(LU,*) NREJEY,' TROUVEES'
01351         ENDIF
01352         IF(LNG.EQ.2) THEN
01353           WRITE(LU,*) NREJET,' ABSCISSAE OF SOURCES EXPECTED'
01354           WRITE(LU,*) NREJEY,' FOUND'
01355         ENDIF
01356         CALL PLANTE(1)
01357         STOP
01358       ENDIF
01359       NREJTR = DIMEN(2,39)
01360       IF(NREJTR.EQ.NTRAC*NREJET) THEN
01361         IF(NTRAC.GT.0) THEN
01362           DO ITRAC=1,NTRAC
01363           DO K=1,NREJET
01364             TSCE(K,ITRAC)=MOTREA(ADRESS(2,39)+(K-1)*NTRAC+ITRAC-1)
01365           ENDDO
01366           ENDDO
01367         ENDIF
01368       ELSE
01369         IF(LNG.EQ.1) THEN
01370           WRITE(LU,*) NREJET*NTRAC,
01371      &    ' VALEURS DES TRACEURS DES SOURCES ATTENDUES'
01372           WRITE(LU,*) NREJTR,' TROUVEES'
01373         ENDIF
01374         IF(LNG.EQ.2) THEN
01375           WRITE(LU,*) NREJET*NTRAC,
01376      &    ' VALUES OF THE TRACERS AT THE SOURCES EXPECTED'
01377           WRITE(LU,*) NREJTR,' FOUND'
01378         ENDIF
01379         CALL PLANTE(1)
01380         STOP
01381       ENDIF
01382       NCOSUP = DIMEN(2,40)
01383       IF(NCOSUP.NE.0) THEN
01384         DO K=1,NCOSUP
01385           COSUPG(K) = MOTREA( ADRESS(2,40) + K-1 )
01386         ENDDO
01387       ENDIF
01388       NCRITE = DIMEN(2,41)
01389       IF(NCRITE.NE.0) THEN
01390         DO K=1,NCRITE
01391           CRIPER(K) = MOTREA( ADRESS(2,41) + K-1 )
01392         ENDDO
01393       ENDIF
01394       TMOY = MOTREA( ADRESS(2,42) )
01395       NREJEU = DIMEN(2,43)
01396       IF(NREJEU.NE.0) THEN
01397         DO K=1,NREJEU
01398           USCE(K) = MOTREA( ADRESS(2,43) + K-1 )
01399         ENDDO
01400       ENDIF
01401       NREJEV = DIMEN(2,44)
01402       IF(NREJEV.NE.0) THEN
01403         DO K=1,NREJEV
01404           VSCE(K) = MOTREA( ADRESS(2,44) + K-1 )
01405         ENDDO
01406       ENDIF
01407       DUREE = MOTREA( ADRESS(2,45) )
01408       NORD  = MOTREA( ADRESS(2,46) )
01409       ELDER(1) = MOTREA( ADRESS(2,47)     )
01410       ELDER(2) = MOTREA( ADRESS(2,47) + 1 )
01411       PHI0     = MOTREA( ADRESS(2,48) )
01412 !     TRACER MASS CONSERVATION WANTS AGGLOT=AGGLOC
01413 !     AGGLOT   = MOTREA( ADRESS(2,49) )
01414       AGGLOT   = AGGLOC
01415       CFLWTD   = MOTREA( ADRESS(2,50) )
01416       NPERIAF   = DIMEN(2,51)
01417       IF(NPERIAF.GT.0) THEN
01418         DO K=1,MAX(NPERIAF,50)
01419           PERIAF(K) = MOTREA( ADRESS(2,51) + K-1 )
01420         ENDDO
01421       ENDIF
01422       DO K=1,4
01423         TOLEST(K) = MOTREA( ADRESS(2,52) + K-1 )
01424       ENDDO
01425       NDEF     = MOTREA( ADRESS(2,53) )
01426       DP       = MOTREA( ADRESS(2,54) )
01427       SP       = MOTREA( ADRESS(2,55) )
01428       HWIND    = MOTREA( ADRESS(2,56) )
01429       HNEG     = MOTREA( ADRESS(2,57) )
01430       TETAZCOMP= MOTREA( ADRESS(2,58) )
01431       TAFBGN   = MOTREA( ADRESS(2,59) )
01432       TAFEND   = MOTREA( ADRESS(2,59)+1 )
01433       GAMMA    = MOTREA( ADRESS(2,60) )
01434       RAIN_MMPD= MOTREA( ADRESS(2,61) )
01435 !     PHYSICAL CHARACTERISTICS OF THE TSUNAMI
01436       DO K = 1,10
01437         COETSUNAMI(K) = MOTREA( ADRESS(2,62) + K-1 )
01438       ENDDO
01439 !
01440 !     VALUES OF TRACERS IN THE RAIN
01441 !
01442       IF(NTRAC.GT.0) THEN
01443         DO I=1,NTRAC
01444           TRAIN(I) = 0.D0
01445         ENDDO
01446         IF(TROUVE(2,63).EQ.2) THEN
01447           DO I=1,DIMEN(2,63)
01448             TRAIN(I) = MOTREA(ADRESS(2,63)+I-1)
01449           ENDDO
01450         ENDIF
01451       ENDIF
01452 !     COEFFICIENT TO CALIBRATE TIDAL RANGE
01453       CTIDE    = MOTREA( ADRESS(2,64) )
01454 !     COEFFICIENT TO CALIBRATE TIDAL VELOCITIES
01455       CTIDEV   = MOTREA( ADRESS(2,65) )
01456 !     COEFFICIENT TO CALIBRATE SEA LEVEL (TIDAL MODEL)
01457       MSL      = MOTREA( ADRESS(2,66) )
01458 !     COEFFICIENT 1 FOR LAW OF TRACERS DEGRADATION
01459       IF(NTRAC.GT.0) THEN
01460         DO I=1,NTRAC
01461           COEF1TRAC(I) = 0.D0
01462         ENDDO
01463         IF(TROUVE(2,67).EQ.2) THEN
01464           DO I=1,DIMEN(2,67)
01465             COEF1TRAC(I) = MOTREA(ADRESS(2,67)+I-1)
01466           ENDDO
01467         ENDIF
01468       ENDIF
01469 !     DIAMETRE OF ALGAE
01470       DALGAE   = MOTREA( ADRESS(2,68) )
01471 !     DENSITY OF ALGAE
01472       RALGAE   = MOTREA( ADRESS(2,69) )
01473 !     THICKNESS OF ALGAE
01474       EALGAE   = MOTREA( ADRESS(2,70) )
01475 !     MASS-LUMPING FOR WEAK CHARACTERISTICS
01476       AGGLOW   = MOTREA( ADRESS(2,71) )
01477 !     SPEED AND DIRECTION OF WIND
01478       WIND_SPD(1)   = MOTREA( ADRESS(2,72)   )
01479       WIND_SPD(2)   = MOTREA( ADRESS(2,72)+1 )
01480 !
01481 !     VALUE OF THE ATMOSPHERIC PRESSURE
01482       PATMOS_VALUE  = MOTREA( ADRESS(2,73)   )
01483 !     FOR SECONDARY CURRENTS
01484       SEC_AS     = MOTREA( ADRESS(2, 74) )
01485       SEC_DS     = MOTREA( ADRESS(2, 75) )
01486 !
01487 ! LOGICAL KEYWORDS:
01488 !
01489       IF(MOTLOG( ADRESS(3,1) )) THEN
01490         DEBU = .FALSE.
01491       ELSE
01492         DEBU = .TRUE.
01493       ENDIF
01494 !     BREACHES
01495       BRECHE    = MOTLOG( ADRESS(3, 2) )
01496       LISTIN    = MOTLOG( ADRESS(3, 3) )
01497       DIFVIT    = MOTLOG( ADRESS(3, 4) )
01498       ATMOS     = MOTLOG( ADRESS(3, 5) )
01499       CONV      = MOTLOG( ADRESS(3, 6) )
01500       CONVV(1)  = MOTLOG( ADRESS(3, 7) )
01501       CONVV(2)  = MOTLOG( ADRESS(3, 8) )
01502       CONVV(3)  = MOTLOG( ADRESS(3, 9) )
01503       CONVV(4)  = MOTLOG( ADRESS(3,10) )
01504       DIFT      = MOTLOG( ADRESS(3,11) )
01505       PROPA     = MOTLOG( ADRESS(3,12) )
01506       CORIOL    = MOTLOG( ADRESS(3,13) )
01507       VENT      = MOTLOG( ADRESS(3,14) )
01508       INFOGR    = MOTLOG( ADRESS(3,15) )
01509       BILMAS    = MOTLOG( ADRESS(3,16) )
01510       CLIPH     = MOTLOG( ADRESS(3,17) )
01511       SPHERI    = MOTLOG( ADRESS(3,18) )
01512       RAIN      = MOTLOG( ADRESS(3,19) )
01513       PROLIN    = MOTLOG( ADRESS(3,20) )
01514       VALID     = MOTLOG( ADRESS(3,21) )
01515       INFOKE    = MOTLOG( ADRESS(3,22) )
01516       VERLIM    = MOTLOG( ADRESS(3,23) )
01517       BANDEC    = MOTLOG( ADRESS(3,24) )
01518       STOPER    = MOTLOG( ADRESS(3,25) )
01519       MSKUSE    = MOTLOG( ADRESS(3,26) )
01520       ROVAR     = MOTLOG( ADRESS(3,27) )
01521       MAREE     = MOTLOG( ADRESS(3,28) )
01522       CORCON    = MOTLOG( ADRESS(3,29) )
01523       RAZTIM    = MOTLOG( ADRESS(3,30) )
01524       PRECCU    = MOTLOG( ADRESS(3,31) )
01525       DTVARI    = MOTLOG( ADRESS(3,32) )
01526       COUROU    = MOTLOG( ADRESS(3,33) )
01527       VERTIC    = MOTLOG( ADRESS(3,34) )
01528       OUTINI    = MOTLOG( ADRESS(3,35) )
01529       DEFZON    = MOTLOG( ADRESS(3,36) )
01530       FRICTB    = MOTLOG( ADRESS(3,37) )
01531       LINDNER   = MOTLOG( ADRESS(3,38) )
01532       CUMFLO    = MOTLOG( ADRESS(3,39) )
01533       COMFLU    = MOTLOG( ADRESS(3,40) )
01534 !     SALINITY AND TEMPERATURE OUTPUT FOR DELWAQ
01535       SALI_DEL  = MOTLOG( ADRESS(3,41) )
01536       TEMP_DEL  = MOTLOG( ADRESS(3,42) )
01537       VELO_DEL  = MOTLOG( ADRESS(3,43) )
01538       DIFF_DEL  = MOTLOG( ADRESS(3,44) )
01539 !     OIL SPILL MODEL
01540       SPILL_MODEL  = MOTLOG( ADRESS(3,45) )
01541 !     INFERENCE OF MINOR CONSTITUENTS OF TPXO TIDAL DATABASE
01542       INTMICON  = MOTLOG( ADRESS(3,46) )
01543 !     ALGAE TRANSPORT MODEL
01544       ALGAE     = MOTLOG( ADRESS(3,47) )
01545 !     SECONDARY CURRENTS (DONE IN THE UPPER PART OR LECDON)
01546 !     SECCURRENTS = MOTLOG(ADRESS(3,49))
01547 !     WAVE ENHANCED FRICTION
01548       FRICOU    = MOTLOG( ADRESS(3,50) )
01549 !
01550       IF(.NOT.DEFZON) NZONE=0
01551 !
01552 !     CHARACTER STRING KEYWORDS : SOME ARE USED BY THE LAUNCHING
01553 !                             PROCEDURE
01554 !
01555       TITCAS    = MOTCAR( ADRESS(4, 1) )(1:72)
01556       VARDES    = MOTCAR( ADRESS(4, 2) )(1:72)
01557       CALL MAJUS(VARDES)
01558       VARIMP    = MOTCAR( ADRESS(4, 3) )(1:72)
01559       CALL MAJUS(VARIMP)
01560 !     FROM 4 TO 5 : READ AND USED BY THE LAUNCHING PROCEDURE
01561 !     NOMGEO    = MOTCAR( ADRESS(4, 6) )
01562       T2D_FILES(T2DGEO)%NAME=MOTCAR( ADRESS(4, 6) )
01563 !     NOMFOR    = MOTCAR( ADRESS(4, 7) )
01564 !     NOMCAS    = MOTCAR( ADRESS(4, 8) )
01565       T2D_FILES(T2DCLI)%NAME=MOTCAR( ADRESS(4, 9) )
01566       T2D_FILES(T2DPRE)%NAME=MOTCAR( ADRESS(4,10) )
01567       T2D_FILES(T2DRES)%NAME=MOTCAR( ADRESS(4,11) )
01568 !     FROM 12 TO 14 : READ AND USED BY THE LAUNCHING PROCEDURE
01569       T2D_FILES(T2DFON)%NAME=MOTCAR( ADRESS(4,15) )
01570 !     16 : ACCOUNT NUMBER (NOT KEPT)
01571       T2D_FILES(T2DBI1)%NAME=MOTCAR( ADRESS(4,17) )
01572       T2D_FILES(T2DBI2)%NAME=MOTCAR( ADRESS(4,18) )
01573       T2D_FILES(T2DFO1)%NAME=MOTCAR( ADRESS(4,19) )
01574       T2D_FILES(T2DFO2)%NAME=MOTCAR( ADRESS(4,20) )
01575 !     FROM 21 TO 22 : READ AND USED BY THE LAUNCHING PROCEDURE
01576       NVARCL = DIMEN(4,23)
01577       IF(NVARCL.NE.0) THEN
01578         DO K=1,NVARCL
01579           VARCLA(K) = MOTCAR( ADRESS(4,23) + K-1 )(1:32)
01580           CALL MAJUS(VARCLA(K))
01581         ENDDO
01582       ENDIF
01583 !     NOMRBI    = MOTCAR( ADRESS(4,24) )
01584       T2D_FILES(T2DRBI)%NAME=MOTCAR( ADRESS(4,24) )
01585 !     NOMRFO    = MOTCAR( ADRESS(4,25) )
01586       T2D_FILES(T2DRFO)%NAME=MOTCAR( ADRESS(4,25) )
01587       CDTINI    = MOTCAR( ADRESS(4,26) )(1:72)
01588       CALL MAJUS(CDTINI)
01589 !     GEOMETRY FILE FORMAT
01590       T2D_FILES(T2DGEO)%FMT = MOTCAR( ADRESS(4,27) )(1:8)
01591       CALL MAJUS(T2D_FILES(T2DGEO)%FMT)
01592 !     RESULTS FILE FORMAT
01593       T2D_FILES(T2DRES)%FMT = MOTCAR( ADRESS(4,28) )(1:8)
01594       CALL MAJUS(T2D_FILES(T2DRES)%FMT)
01595 !     PREVIOUS COMPUTATION FILE FORMAT
01596       T2D_FILES(T2DPRE)%FMT = MOTCAR( ADRESS(4,29) )(1:8)
01597       CALL MAJUS(T2D_FILES(T2DPRE)%FMT)
01598 !     FROM 30 TO 33 : READ AND USED BY THE LAUNCHING PROCEDURE
01599 !                30 : LIBRARIES
01600 !                31 : PRIORITY
01601 !                32 : PVM LIBRARY
01602 !                33 : CALCIUM 1 LIBRARY
01603 !                34 : CALCIUM 2 LIBRARY
01604 !                35 : CRAY NAME
01605       EQUA      = MOTCAR( ADRESS(4,36) )(1:20)
01606       CALL MAJUS(EQUA)
01607 !     NOMREF    = MOTCAR( ADRESS(4,37) )
01608       T2D_FILES(T2DREF)%NAME=MOTCAR( ADRESS(4,37) )
01609 !     NOMIMP    = MOTCAR( ADRESS(4,38) )
01610       T2D_FILES(T2DIMP)%NAME=MOTCAR( ADRESS(4,38) )
01611 !     DOSSIER_COUPLAGE = MOTCAR( ADRESS(4,39) )
01612       COUPLING  = MOTCAR( ADRESS(4,40) )
01613       CALL MAJUS(COUPLING)
01614 !
01615 !     FROM 41 TO 58 : "DESCRIPTION OF" KEYWORDS
01616 !
01617 !     ZONES FILE
01618       T2D_FILES(T2DZFI)%NAME=MOTCAR( ADRESS(4,59) )
01619 !
01620       ESTIME  = MOTCAR( ADRESS(4,60) )(1:72)
01621       CALL MAJUS(ESTIME)
01622       IF(ESTIME.EQ.' ') ADJO=.FALSE.
01623       I         = DIMEN(4,61)
01624       IF(I.GT.0) THEN
01625         DO K=1,I
01626           NAME_PTS(K)=MOTCAR(ADRESS(4,61)+K-1)(1:32)
01627         ENDDO
01628       ENDIF
01629 !     62 : SISYPHE STEERING FILE (READ BY PERL SCRIPTS)
01630 !
01631 !     63 : FRICTION DATA FILE
01632 !     NOMCOF=MOTCAR( ADRESS(4,63))
01633       T2D_FILES(T2DCOF)%NAME=MOTCAR( ADRESS(4,63) )
01634 !     64-72 : DELWAQ FILES
01635 !     NOMSOU=MOTCAR( ADRESS(4,64) )
01636       T2D_FILES(T2DDL1)%NAME=MOTCAR( ADRESS(4,64) )
01637 !     NOSUIS=MOTCAR( ADRESS(4,65) )
01638       T2D_FILES(T2DDL2)%NAME=MOTCAR( ADRESS(4,65) )
01639 !     NOMCOU=MOTCAR( ADRESS(4,66) )
01640       T2D_FILES(T2DDL3)%NAME=MOTCAR( ADRESS(4,66) )
01641 !     NOMFRC=MOTCAR( ADRESS(4,67) )
01642       T2D_FILES(T2DDL4)%NAME=MOTCAR( ADRESS(4,67) )
01643 !     NOMINI=MOTCAR( ADRESS(4,68) )
01644       T2D_FILES(T2DDL5)%NAME=MOTCAR( ADRESS(4,68) )
01645 !     NOMVEB=MOTCAR( ADRESS(4,69) )
01646       T2D_FILES(T2DDL6)%NAME=MOTCAR( ADRESS(4,69) )
01647 !     NORSED=MOTCAR( ADRESS(4,70) )
01648       T2D_FILES(T2DDL7)%NAME=MOTCAR( ADRESS(4,70) )
01649 !     NOMCOB=MOTCAR( ADRESS(4,71) )
01650       T2D_FILES(T2DL11)%NAME=MOTCAR( ADRESS(4,71) )
01651 !     NOMSCO=MOTCAR( ADRESS(4,72) )
01652       T2D_FILES(T2DDL8)%NAME=MOTCAR( ADRESS(4,72) )
01653 !     NOMPAR=MOTCAR( ADRESS(4,76) )
01654       T2D_FILES(T2DDL9)%NAME=MOTCAR( ADRESS(4,76) )
01655 !     NOMPRI=MOTCAR( ADRESS(4,77) )
01656       T2D_FILES(T2DL10)%NAME=MOTCAR( ADRESS(4,77) )
01657 !     STAGE-DISCHARGE CURVES FILE
01658 !     NOMMAB=MOTCAR( ADRESS(4,73) )
01659       T2D_FILES(T2DMAB)%NAME=MOTCAR( ADRESS(4,73) )
01660 !     INITIALISES AND READS THE NAMES OF TRACERS
01661       IF(NTRAC.GT.0) THEN
01662         DO I=1,NTRAC
01663           IF(LNG.EQ.1) THEN
01664            NAMETRAC(I) =  'TRACEUR '//I_IN_2_LETTERS(I)//'      '
01665      &                   // '??              '
01666           ELSEIF(LNG.EQ.2) THEN
01667            NAMETRAC(I) =  'TRACER '//I_IN_2_LETTERS(I)//'       '
01668      &                   // '??              '
01669           ENDIF
01670         ENDDO
01671       ENDIF
01672       NTRTOT=DIMEN(4,74)
01673       IF(NTRTOT.GT.0.AND.NTRAC.GT.0) THEN
01674         DO I=1,NTRTOT
01675           NAMETRAC(I) = MOTCAR(ADRESS(4,74)+I-1)(1:32)
01676         ENDDO
01677       ENDIF
01678 !     CHANES DUE TO WAQ
01679       IF(WATQUA.OR.SECCURRENTS)THEN
01680 !       GIVE THEM THEIR NAMES
01681         CALL NAMETRAC_WAQ(NAMETRAC,WATQUA,SECCURRENTS,
01682      &                    WAQPROCESS,NTRAC-ADDTR,IND_SEC)
01683       ENDIF
01684 !     SOURCES FILE
01685       T2D_FILES(T2DVEF)%NAME=MOTCAR( ADRESS(4,75) )
01686 !     76 AND 77 IN DELWAQ FILES ABOVE
01687 !     REFERENCE FILE FORMAT
01688       T2D_FILES(T2DREF)%FMT = MOTCAR( ADRESS(4,78) )(1:8)
01689       CALL MAJUS(T2D_FILES(T2DREF)%FMT)
01690 !     SECTIONS INPUT FILE
01691       T2D_FILES(T2DSEC)%NAME=MOTCAR( ADRESS(4,79) )
01692 !     SECTIONS OUTPUT FILE
01693       T2D_FILES(T2DSEO)%NAME=MOTCAR( ADRESS(4,80) )
01694 !     MIGRHYCAR STEERING FILE
01695       T2D_FILES(T2DMIG)%NAME=MOTCAR( ADRESS(4,81) )
01696 !     82 : TOMAWAC STEERING FILE (READ BY PERL SCRIPTS)
01697 !
01698 !     HARMONIC CONSTANTS FILE
01699       T2D_FILES(T2DHAR)%NAME=MOTCAR( ADRESS(4,83) )
01700 !     TIDAL MODEL FILE
01701       T2D_FILES(T2DTID)%NAME=MOTCAR( ADRESS(4,84) )
01702 !     TIDE DATA BASE FILE
01703       T2D_FILES(T2DBDD)%NAME=MOTCAR( ADRESS(4,85) )
01704 !     BINARY TIDE DATABASE FILE 1 (FOR SATELLITE ALTIMETRY)
01705       T2D_FILES(T2DBB1)%NAME=MOTCAR( ADRESS(4,86) )
01706 !     BINARY TIDE DATABASE FILE 2 (FOR SATELLITE ALTIMETRY)
01707       T2D_FILES(T2DBB2)%NAME=MOTCAR( ADRESS(4,87) )
01708 !     WEIRS DATA FILE
01709       T2D_FILES(T2DSEU)%NAME=MOTCAR( ADRESS(4,88) )
01710 !     CULVERT DATA FILE
01711       T2D_FILES(T2DSIP)%NAME=MOTCAR( ADRESS(4,89) )
01712 !     BUSES/BRIDGES DATA FILE
01713       T2D_FILES(T2DBUS)%NAME=MOTCAR( ADRESS(4,90) )
01714 !     BREACHES DATA FILE
01715       T2D_FILES(T2DBRC)%NAME=MOTCAR( ADRESS(4,91) )
01716 !     DROGUES FILE
01717       T2D_FILES(T2DFLO)%NAME=MOTCAR( ADRESS(4,92) )
01718 !     WATER QUALITY
01719 !
01720 !     WAQ STEERING FILE
01721       T2D_FILES(T2DWAQ)%NAME=MOTCAR( ADRESS(4,93) )
01722 !     WAQ DICTIONARY
01723       T2D_FILES(T2DWQD)%NAME=MOTCAR( ADRESS(4,94) )
01724 
01725       IF(LISTIN) THEN
01726         IF(LNG.EQ.1) WRITE(LU,1000)
01727         IF(LNG.EQ.2) WRITE(LU,1001)
01728       ENDIF
01729 1000  FORMAT(1X,/,19X, '********************************************',/,
01730      &            19X, '*               LECDON:                    *',/,
01731      &            19X, '*        APRES APPEL DE DAMOCLES           *',/,
01732      &            19X, '*     VERIFICATION DES DONNEES LUES        *',/,
01733      &            19X, '*     SUR LE FICHIER DES PARAMETRES        *',/,
01734      &            19X, '********************************************',/)
01735 1001  FORMAT(1X,/,19X, '********************************************',/,
01736      &            19X, '*               LECDON:                    *',/,
01737      &            19X, '*        AFTER CALLING DAMOCLES            *',/,
01738      &            19X, '*        CHECKING OF DATA  READ            *',/,
01739      &            19X, '*         IN THE STEERING FILE             *',/,
01740      &            19X, '********************************************',/)
01741 !
01742 !-----------------------------------------------------------------------
01743 !  CORRECTS AND COMPUTES OTHER VARIABLES THAT CAN BE DEDUCTED
01744 !  FROM THE ONES JUST READ
01745 !-----------------------------------------------------------------------
01746 !
01747 !  ADVECTION VARIABLES :
01748 !
01749       IF (.NOT.CONV) THEN
01750         CONVV(1)  =  .FALSE.
01751         CONVV(2)  =  .FALSE.
01752         CONVV(3)  =  .FALSE.
01753         CONVV(4)  =  .FALSE.
01754       ENDIF
01755 !
01756 !-----------------------------------------------------------------------
01757 !  IF NO TRACER, THERE SHOULD BE NO TRACER DIFFUSION:
01758 !-----------------------------------------------------------------------
01759 !
01760       IF(NTRAC.EQ.0) THEN
01761         DIFT = .FALSE.
01762       ENDIF
01763 !
01764 !-----------------------------------------------------------------------
01765 !  POSSIBLE ERROR OF ENGLISH USERS
01766 !-----------------------------------------------------------------------
01767 !
01768       IF (EQUA(1:15).EQ.'SAINT-VENANT FE') EQUA(14:15)='EF'
01769       IF (EQUA(1:15).EQ.'SAINT-VENANT FV') EQUA(14:15)='VF'
01770 !
01771 !-----------------------------------------------------------------------
01772 !  NO PARALLELISME YET FOR FV
01773 !-----------------------------------------------------------------------
01774 !
01775       IF(EQUA(1:15).EQ.'SAINT-VENANT VF'.AND.NCSIZE.GT.1) THEN
01776         IF(OPTVF.EQ.6) THEN
01777           WRITE(LU,*) REPEAT('+',50)
01778           IF(LNG.EQ.1) WRITE(LU,1)
01779           IF(LNG.EQ.2) WRITE(LU,2)
01780 1         FORMAT(1X,'PARALLELISME NON DISPONIBLE POUR LE SCHEMA WAF')
01781 2         FORMAT(1X,'PARALLEL OPTION NOT AVAILABLE FOR WAF SCHEME')
01782           WRITE(LU,*) REPEAT('+',50)
01783           CALL PLANTE(1)
01784           STOP
01785         ENDIF
01786       ENDIF
01787 !
01788 !-----------------------------------------------------------------------
01789 !  NAME OF THE VARIABLES FOR THE RESULTS AND GEOMETRY FILES:
01790 !-----------------------------------------------------------------------
01791 !
01792 ! ARRAY OF LOGICALS FOR OUTPUT
01793 !
01794       CALL NOMVAR_TELEMAC2D(TEXTE,TEXTPR,MNEMO,NPERIAF,NTRAC,NAMETRAC)
01795       CALL SORTIE(VARDES , MNEMO , MAXVAR , SORLEO )
01796       CALL SORTIE(VARIMP , MNEMO , MAXVAR , SORIMP )
01797 !
01798 !     OVERWRITES FOR PARAMETER ESTIMATION DEVELOPPERS
01799 !     CHECKS FILES
01800 !
01801       IF(ESTIME.NE.' ') THEN
01802         TEXTE (20) = 'CV1                             '
01803         TEXTE (21) = 'CV2                             '
01804         TEXTE (22) = 'CV3                             '
01805         TEXTE (23) = 'ADJOINT H                       '
01806         TEXTE (24) = 'ADJOINT U                       '
01807         TEXTE (25) = 'ADJOINT V                       '
01808         IF(T2D_FILES(T2DRBI)%NAME.EQ.' ') THEN
01809           IF(LNG.EQ.1) THEN
01810             WRITE(LU,*) 'FICHIER DE RESULTATS BINAIRE NECESSAIRE'
01811             WRITE(LU,*) 'POUR L''ESTIMATION DE PARAMETRES'
01812           ENDIF
01813           IF(LNG.EQ.2) THEN
01814             WRITE(LU,*) 'BINARY RESULTS FILE NECESSARY'
01815             WRITE(LU,*) 'FOR PARAMETER ESTIMATION'
01816           ENDIF
01817           CALL PLANTE(1)
01818           STOP
01819         ENDIF
01820       ENDIF
01821 !
01822 !-----------------------------------------------------------------------
01823 !
01824 ! CORRECTS A POTENTIAL ERROR IN THE DATA (THERE SHOULD BE NO TRACER
01825 ! WIND, ETC OUTPUT IF THE COMPUTATION WAS WITHOUT TRACER, WIND, ETC).
01826 !
01827       IF(.NOT.ATMOS) THEN
01828         SORLEO(18)  = .FALSE.
01829         SORIMP(18)  = .FALSE.
01830       ENDIF
01831       IF(.NOT.VENT) THEN
01832         SORLEO(16)  = .FALSE.
01833         SORIMP(16)  = .FALSE.
01834         SORLEO(17)  = .FALSE.
01835         SORIMP(17)  = .FALSE.
01836       ENDIF
01837       IF(NTRAC.EQ.0) THEN
01838         SORLEO(9)  = .FALSE.
01839         SORIMP(9)  = .FALSE.
01840       ENDIF
01841       IF(ITURB.NE.3) THEN
01842         SORLEO(10) = .FALSE.
01843         SORIMP(10) = .FALSE.
01844         SORLEO(11) = .FALSE.
01845         SORIMP(11) = .FALSE.
01846       ENDIF
01847 !
01848 !-----------------------------------------------------------------------
01849 !
01850 ! IN CASE OF A CONTINUATION RUN, A PREVIOUS COMPUTATION FILE NEEDS TO BE GIVEN
01851 !
01852       IF(.NOT.DEBU.AND.T2D_FILES(T2DPRE)%NAME(1:1).EQ.' ') THEN
01853         IF(LISTIN) THEN
01854           IF(LNG.EQ.1) WRITE(LU,1002)
01855           IF(LNG.EQ.2) WRITE(LU,1003)
01856         ENDIF
01857 1002    FORMAT(1X,'LECDON : UNE SUITE DE CALCUL EST DEMANDEE',/,10X,
01858      &  'IL FAUT DONNER UN FICHIER DE RESULTATS DU CALCUL PRECEDENT',/)
01859 1003    FORMAT(1X,'LECDON : COMPUTATION CONTINUED, SO A PREVIOUS',/,
01860      &         1X,'         RESULTS FILE IS NECESSARY',/)
01861         CALL PLANTE(1)
01862         STOP
01863       ENDIF
01864 !
01865 !-----------------------------------------------------------------------
01866 !
01867 ! IN CASE OF A VALIDATION, A REFERENCE FILE SHOULD BE GIVEN
01868 !
01869       IF(VALID.AND.T2D_FILES(T2DREF)%NAME(1:1).EQ.' ') THEN
01870         IF(LISTIN) THEN
01871           IF(LNG.EQ.1) WRITE(LU,1004)
01872           IF(LNG.EQ.2) WRITE(LU,1005)
01873         ENDIF
01874 1004    FORMAT(1X,'LECDON : UNE VALIDATION EST DEMANDEE',/,10X,
01875      &  'IL FAUT DONNER UN FICHIER DE REFERENCE',/,10X,
01876      &  '(MOT-CLE : FICHIER DE REFERENCE)',/,10X,
01877      &  'QUI SERVIRA POUR LA COMPARAISON. ARRET DU PROGRAMME',
01878      &  ////)
01879 1005    FORMAT(1X,'LECDON: A VALIDATION IS ASKED, SO A',/,
01880      &         9X,'REFERENCE FILE IS NECESSARY',/,
01881      &         9X,'(KEY-WORD: REFERENCE FILE)',/,
01882      &         9X,'FOR COMPARISON. INTERRUPTION OF PROGRAM',
01883      &  ////)
01884         CALL PLANTE(1)
01885         STOP
01886       ENDIF
01887 !
01888 !-----------------------------------------------------------------------
01889 !
01890 !  COHERENCE OF THE DISCHARGE POINTS
01891 !
01892       IF(NREJEU.NE.NREJEV) THEN
01893         IF(LNG.EQ.1) WRITE(LU,1016) NREJEU,NREJEV
01894         IF(LNG.EQ.2) WRITE(LU,1017) NREJEU,NREJEV
01895 1016    FORMAT(1X,
01896      &  'VITESSES DES SOURCES SELON X ET SELON Y EN NOMBRE DIFFERENT :',
01897      &  I6,1X,I6)
01898 1017    FORMAT(1X,'DIFFERENT NUMBERS OF VELOCITIES OF SOURCES ',/,1X,
01899      &  'ALONG X AND ALONG Y: ',I6,1X,I6)
01900       ENDIF
01901 !
01902 !-----------------------------------------------------------------------
01903 !
01904 !  OPTBAN REPLACES BANDEC
01905 !  FOR REASONS OF COMPATIBILITY, BANDEC IS KEPT
01906 !  OPTBAN IS HERE MODIFIED ACCORDING TO BANDEC
01907 !
01908       IF(.NOT.BANDEC) OPTBAN =0
01909       MSK = .FALSE.
01910       IF(OPTBAN.EQ.2.OR.MSKUSE) MSK = .TRUE.
01911       IF(EQUA(1:15).EQ.'SAINT-VENANT VF') THEN
01912         IF(BANDEC.OR.OPTBAN.NE.0) THEN
01913           BANDEC = .FALSE.
01914           OPTBAN = 0
01915           IF(LNG.EQ.1) WRITE(LU,1020)
01916           IF(LNG.EQ.2) WRITE(LU,1021)
01917 1020      FORMAT(1X,'PAS DE TRAITEMENT DES BANCS DECOUVRANTS',/,1X,
01918      &              ' EN VOLUMES FINIS')
01919 1021      FORMAT(1X,'NO SPECIFIC TREATMENT OF DRY ZONES',/,1X,
01920      &              ' IN FINITE VOLUMES')
01921         ENDIF
01922       ENDIF
01923 !
01924 !-----------------------------------------------------------------------
01925 !
01926 !  PRECONDITIONING OF TYPE CROUT WITH GMRES: NOT FOR VECTOR COMPUTERS
01927 !
01928       IF(LVMAC.NE.1) THEN
01929         IF((SLVPRO%SLV.EQ.7.AND.
01930      &      MOD(SLVPRO%PRECON, 7).EQ.0).OR.
01931      &     (SLVPRO%SLV.EQ.7.AND.
01932      &      MOD(SLVPRO%PRECON,11).EQ.0).OR.
01933      &     (SLVPRO%SLV.EQ.7.AND.
01934      &      MOD(SLVPRO%PRECON,13).EQ.0).OR.
01935      &     (SLVK%SLV.EQ.7.AND.
01936      &      MOD(SLVK%PRECON, 7).EQ.0).OR.
01937      &     (SLVK%SLV.EQ.7.AND.
01938      &      MOD(SLVK%PRECON,11).EQ.0).OR.
01939      &     (SLVK%SLV.EQ.7.AND.
01940      &      MOD(SLVK%PRECON,13).EQ.0)) THEN
01941           IF(LNG.EQ.1) WRITE(LU,2000)
01942           IF(LNG.EQ.2) WRITE(LU,2001)
01943 2000      FORMAT(1X,'MOT-CLES SOLVEURS ET PRECONDITIONNEMENTS :',/,1X,
01944      &              'SUR MACHINE VECTORIELLE,',/,1X,
01945      &              'NE PAS UTILISER GMRES + CROUT',///)
01946 2001      FORMAT(1X,'KEY-WORDS SOLVERS AND PRECONDITONING:',/,1X,
01947      &              'ON VECTOR MACHINES,',/,1X,
01948      &              'DO NOT USE GMRES + CROUT',///)
01949           CALL PLANTE(1)
01950           STOP
01951         ENDIF
01952         IF(NTRAC.GT.0) THEN
01953           DO ITRAC=1,NTRAC
01954             IF((SLVTRA(ITRAC)%SLV.EQ.7.AND.
01955      &          MOD(SLVTRA(ITRAC)%PRECON, 7).EQ.0).OR.
01956      &         (SLVTRA(ITRAC)%SLV.EQ.7.AND.
01957      &          MOD(SLVTRA(ITRAC)%PRECON,11).EQ.0).OR.
01958      &         (SLVTRA(ITRAC)%SLV.EQ.7.AND.
01959      &          MOD(SLVTRA(ITRAC)%PRECON,13).EQ.0)) THEN
01960               IF(LNG.EQ.1) WRITE(LU,2000)
01961               IF(LNG.EQ.2) WRITE(LU,2001)
01962               CALL PLANTE(1)
01963               STOP
01964             ENDIF
01965           ENDDO
01966         ENDIF
01967       ENDIF
01968 !
01969 !  PRECONDITIONING OF TYPE CROUT WITH PARALLELISM IMPOSSIBLE
01970 !  DIRECT SOLVER WITH IMPOSSIBLE PARALLELISM
01971 !
01972       IF(NCSIZE.GT.1) THEN
01973         IF((MOD(SLVPRO%PRECON, 7).EQ.0.AND.
01974      &      SLVPRO%PRECON.NE.0).OR.
01975      &     (MOD(SLVPRO%PRECON,11).EQ.0.AND.
01976      &      SLVPRO%PRECON.NE.0).OR.
01977      &     (MOD(SLVPRO%PRECON,13).EQ.0.AND.
01978      &      SLVPRO%PRECON.NE.0).OR.
01979      &     (MOD(SLVTRA(1)%PRECON, 7).EQ.0.AND.
01980      &      SLVTRA(1)%PRECON.NE.0).OR.
01981      &     (MOD(SLVTRA(1)%PRECON,11).EQ.0.AND.
01982      &      SLVTRA(1)%PRECON.NE.0).OR.
01983      &     (MOD(SLVTRA(1)%PRECON,13).EQ.0.AND.
01984      &      SLVTRA(1)%PRECON.NE.0).OR.
01985      &     (MOD(SLVK%PRECON, 7).EQ.0.AND.
01986      &      SLVK%PRECON.NE.0).OR.
01987      &     (MOD(SLVK%PRECON,11).EQ.0.AND.
01988      &      SLVK%PRECON.NE.0).OR.
01989      &     (MOD(SLVK%PRECON,13).EQ.0.AND.
01990      &      SLVK%PRECON.NE.0) ) THEN
01991           IF(LNG.EQ.1) WRITE(LU,2014)
01992           IF(LNG.EQ.2) WRITE(LU,2015)
01993 2014      FORMAT(1X,'AVEC PARALLELISME,',/,1X,
01994      &           'PAS DE PRECONDITIONNEMENT DE TYPE CROUT',///)
01995 2015      FORMAT(1X,'WITH PARALLELISM,',/,1X,
01996      &           'NO CROUT-TYPE PRECONDITIONNING',///)
01997           CALL PLANTE(1)
01998           STOP
01999         ENDIF
02000         IF(SLVPRO%SLV.EQ.8.OR.SLVK%SLV.EQ.8) THEN
02001           IF(LNG.EQ.1) WRITE(LU,2018)
02002           IF(LNG.EQ.2) WRITE(LU,2019)
02003 2018      FORMAT(1X,'AVEC PARALLELISME,',/,1X,
02004      &             'PAS DE SOLVEUR DIRECT',///)
02005 2019      FORMAT(1X,'WITH PARALLELISM,',/,1X,
02006      &             'NO DIRECT SYSTEM SOLVER',///)
02007           CALL PLANTE(1)
02008           STOP
02009         ENDIF
02010         IF(NTRAC.GT.0) THEN
02011           DO ITRAC=1,NTRAC
02012             IF(SLVTRA(ITRAC)%SLV.EQ.8) THEN
02013               IF(LNG.EQ.1) WRITE(LU,2018)
02014               IF(LNG.EQ.2) WRITE(LU,2019)
02015               CALL PLANTE(1)
02016               STOP
02017             ENDIF
02018           ENDDO
02019         ENDIF
02020       ENDIF
02021 !
02022 !-----------------------------------------------------------------------
02023 !
02024       IF(OPTASS.NE.3) THEN
02025         IF(SLVPRO%SLV.EQ.8.OR.SLVK%SLV.EQ.8) THEN
02026           IF(LNG.EQ.1) WRITE(LU,2022)
02027           IF(LNG.EQ.2) WRITE(LU,2023)
02028 2022      FORMAT(1X,'AVEC SOLVEUR DIRECT, STOCKAGE PAR SEGMENT',/,1X,
02029      &             'OBLIGATOIRE',///)
02030 2023      FORMAT(1X,'WITH DIRECT SYSTEM SOLVER, EDGE-BASED STORAGE',/,
02031      &           1X,'IS MANDATORY',///)
02032           CALL PLANTE(1)
02033           STOP
02034         ENDIF
02035         IF(NTRAC.GT.0) THEN
02036           DO ITRAC=1,NTRAC
02037             IF(SLVTRA(ITRAC)%SLV.EQ.8) THEN
02038               IF(LNG.EQ.1) WRITE(LU,2022)
02039               IF(LNG.EQ.2) WRITE(LU,2023)
02040               CALL PLANTE(1)
02041               STOP
02042             ENDIF
02043           ENDDO
02044         ENDIF
02045       ENDIF
02046 !
02047 !-----------------------------------------------------------------------
02048 !
02049       IF(INCLUS(COUPLING,'DELWAQ').AND.OPTASS.NE.3) THEN
02050         IF(LNG.EQ.1) WRITE(LU,2024)
02051         IF(LNG.EQ.2) WRITE(LU,2025)
02052 2024    FORMAT(1X,'AVEC COUPLAGE DELWAQ, STOCKAGE PAR SEGMENT',/,1X,
02053      &            'OBLIGATOIRE',///)
02054 2025    FORMAT(1X,'WITH COUPLING WITH DELWAQ, EDGE-BASED STORAGE',/,1X,
02055      &            'IS MANDATORY',///)
02056         CALL PLANTE(1)
02057         STOP
02058       ENDIF
02059       IF(INCLUS(COUPLING,'DELWAQ').AND.DISCRE(1).EQ.12) THEN
02060         IF(LNG.EQ.1) WRITE(LU,2026)
02061         IF(LNG.EQ.2) WRITE(LU,2027)
02062 2026    FORMAT(1X,'AVEC COUPLAGE DELWAQ, VITESSE QUASI-BULLE',/,1X,
02063      &            'INTERDITE',///)
02064 2027    FORMAT(1X,'WITH COUPLING WITH DELWAQ, QUASI-BUBBLE VELOCITIES',
02065      &       /,1X,'IS NOT ALLOWED',///)
02066         CALL PLANTE(1)
02067         STOP
02068       ENDIF
02069 !
02070 !-----------------------------------------------------------------------
02071 !
02072       IF(INCLUS(COUPLING,'DELWAQ').AND.OPTSUP(2).NE.0) THEN
02073         IF(LNG.EQ.1) WRITE(LU,2028)
02074         IF(LNG.EQ.2) WRITE(LU,2029)
02075 2028    FORMAT(1X,'AVEC COUPLAGE DELWAQ, DECENTREMENT SUPG SUR H',/,1X,
02076      &            'IMPOSSIBLE, MODIFIER LE MOT-CLE : OPTION DE SUPG',//)
02077 2029    FORMAT(1X,'WITH COUPLING WITH DELWAQ, SUPG UPWINDING ON H',/,1X,
02078      &            'IS FORBIDDEN, CHECK KEY-WORD: SUPG OPTION',//)
02079         CALL PLANTE(1)
02080         STOP
02081       ENDIF
02082 !
02083 !-----------------------------------------------------------------------
02084 !
02085 !     CHECKS ADVECTION SOLVERS ON VELOCITY
02086 !
02087       IF(ICONVF(1).NE.ADV_CAR.AND.ICONVF(1).NE.ADV_SUP.AND.
02088      &   ICONVF(1).NE.ADV_LPO.AND.ICONVF(1).NE.ADV_NSC.AND.
02089      &   ICONVF(1).NE.ADV_PSI.AND.ICONVF(1).NE.ADV_NSC_NC.AND.
02090      &   ICONVF(1).NE.ADV_PSI_NC.AND.
02091      &   ICONVF(1).NE.ADV_LPO_TF.AND.ICONVF(1).NE.ADV_NSC_TF) THEN
02092         IF(LNG.EQ.1) WRITE(LU,72) ICONVF(1)
02093         IF(LNG.EQ.2) WRITE(LU,73) ICONVF(1)
02094 72      FORMAT(1X,'FORME DE LA CONVECTION POUR LA VITESSE : ',I3,/,1X,
02095      &            'INCONNUE OU NON PROGRAMMEE')
02096 73      FORMAT(1X,'TYPE OF AVECTION FOR VELOCITY: ',I3,/,1X,
02097      &            'UNKNOWN OR NOT IMPLEMENTED')
02098         IF(ICONVF(1).EQ.8.AND.LNG.EQ.1) THEN
02099           WRITE(LU,*) 'LE SCHEMA VOLUMES FINIS 8 EST MAINTENANT'
02100           WRITE(LU,*) 'LE SCHEMA N CONSERVATIF, AVEC LE NUMERO ',
02101      &                                                          ADV_NSC
02102         ENDIF
02103         IF(ICONVF(1).EQ.8.AND.LNG.EQ.2) THEN
02104           WRITE(LU,*) 'THE FINITE VOLUMES SCHEME 8 IS NOW'
02105           WRITE(LU,*) 'THE CONSERVATIVE N-SCHEME, WITH NUMBER ',ADV_NSC
02106         ENDIF
02107         CALL PLANTE(1)
02108         STOP
02109       ENDIF
02110 !
02111 !-----------------------------------------------------------------------
02112 !
02113 !     CHECKS ADVECTION SOLVERS ON TRACERS
02114 !
02115       IF(NTRAC.GT.0) THEN
02116         DO ITRAC=1,NTRAC
02117           IF(ICONVFT(ITRAC).NE.ADV_CAR.AND.
02118      &       ICONVFT(ITRAC).NE.ADV_SUP.AND.
02119      &       ICONVFT(ITRAC).NE.ADV_LPO.AND.
02120      &       ICONVFT(ITRAC).NE.ADV_NSC.AND.
02121      &       ICONVFT(ITRAC).NE.ADV_PSI.AND.
02122      &       ICONVFT(ITRAC).NE.ADV_NSC_NC.AND.
02123      &       ICONVFT(ITRAC).NE.ADV_PSI_NC.AND.
02124      &       ICONVFT(ITRAC).NE.ADV_LPO_TF.AND.
02125      &       ICONVFT(ITRAC).NE.ADV_NSC_TF) THEN
02126             IF(LNG.EQ.1) WRITE(LU,74) ICONVFT(ITRAC)
02127             IF(LNG.EQ.2) WRITE(LU,75) ICONVFT(ITRAC)
02128 74          FORMAT(1X,'FORME DE LA CONVECTION DES TRACEURS : ',I3,/,1X,
02129      &                'INCONNUE OU NON PROGRAMMEE')
02130 75          FORMAT(1X,'TYPE OF AVECTION FOR TRACERS: ',I3,/,1X,
02131      &                'UNKNOWN OR NOT IMPLEMENTED')
02132             IF(ICONVFT(ITRAC).EQ.8.AND.LNG.EQ.1) THEN
02133               WRITE(LU,*) 'LE SCHEMA VOLUMES FINIS 8 EST MAINTENANT'
02134               WRITE(LU,*) 'LE SCHEMA N CONSERVATIF, AVEC LE NUMERO ',
02135      &                                                    ADV_NSC
02136             ENDIF
02137             IF(ICONVFT(ITRAC).EQ.8.AND.LNG.EQ.2) THEN
02138               WRITE(LU,*) 'THE FINITE VOLUMES SCHEME 8 IS NOW'
02139               WRITE(LU,*) 'THE CONSERVATIVE N-SCHEME, WITH NUMBER ',
02140      &                                                    ADV_NSC
02141             ENDIF
02142             CALL PLANTE(1)
02143             STOP
02144           ENDIF
02145           IF(ICONVFT(ITRAC).EQ.ADV_LPO.OR.
02146      &       ICONVFT(ITRAC).EQ.ADV_LPO_TF.OR.
02147      &       ICONVFT(ITRAC).EQ.ADV_NSC.OR.
02148      &       ICONVFT(ITRAC).EQ.ADV_NSC_TF.OR.
02149      &       ICONVFT(ITRAC).EQ.ADV_PSI.OR.
02150      &       ICONVFT(ITRAC).EQ.ADV_PSI_TF     ) THEN
02151             TETAT = 0.D0
02152             IF(LNG.EQ.1) WRITE(LU,6000) ITRAC
02153             IF(LNG.EQ.2) WRITE(LU,6001) ITRAC
02154 6000        FORMAT(1X,'LECDON : SCHEMA VOLUMES FINIS SUR LE TRACEUR ',
02155      &      1I6,/,1X,'VALEUR FORCEE : IMPLICITATION = 0.')
02156 6001        FORMAT(1X,'LECDON: FINITE VOLUME SCHEME ON THE TRACER ',
02157      &      1I6,/,1X,'IMPOSED VALUE: IMPLICITATION = 0.')
02158             OPTSUP(2)=0
02159             IF(LNG.EQ.1) WRITE(LU,8000)
02160             IF(LNG.EQ.2) WRITE(LU,8001)
02161 8000        FORMAT(1X,'LECDON : SCHEMA VOLUMES FINIS SUR LE TRACEUR ',
02162      &      1I6,/,1X,
02163      &      'VALEUR FORCEE : OPTION DE SUPG = 0 POUR H')
02164 8001        FORMAT(1X,'LECDON : FINITE VOLUME SCHEME ON THE TRACER ',
02165      &      1I6,/,1X,
02166      &      'IMPOSED VALUE: SUPG OPTION = 0 FOR DEPTH')
02167             IF(OPTASS.NE.3) THEN
02168               IF(LNG.EQ.1) WRITE(LU,2216)
02169               IF(LNG.EQ.2) WRITE(LU,2217)
02170 2216          FORMAT(1X,'STOCKAGE DES MATRICES = 3',/,1X,
02171      &                  'IMPOSE AVEC CONVECTEUR VOLUME FINIS')
02172 2217          FORMAT(1X,'MATRIX STORAGE = 3',/,1X,
02173      &                  'MANDATORY WITH FINITE VOLUME ADVECTION')
02174               CALL PLANTE(1)
02175               STOP
02176             ENDIF
02177           ENDIF
02178         ENDDO
02179       ENDIF
02180 !
02181 !-----------------------------------------------------------------------
02182 !
02183 !     CASE WHERE ADVECTION IS DONE IN FINITE VOLUME
02184 !
02185       IF(ICONVF(1).EQ.ADV_LPO.OR.ICONVF(1).EQ.ADV_LPO_TF.OR.
02186      &   ICONVF(1).EQ.ADV_NSC.OR.ICONVF(1).EQ.ADV_NSC_TF.OR.
02187      &   ICONVF(1).EQ.ADV_PSI.OR.ICONVF(1).EQ.ADV_PSI_TF     ) THEN
02188         IF(OPTASS.NE.3) THEN
02189           IF(LNG.EQ.1) WRITE(LU,2216)
02190           IF(LNG.EQ.2) WRITE(LU,2217)
02191           CALL PLANTE(1)
02192           STOP
02193         ENDIF
02194       ENDIF
02195 !
02196       IF(ITURB.EQ.3) THEN
02197       IF(ICONVF(4).NE.ADV_CAR.AND.ICONVF(4).NE.ADV_SUP.AND.
02198      &   ICONVF(4).NE.ADV_LPO.AND.ICONVF(4).NE.ADV_NSC.AND.
02199      &   ICONVF(4).NE.ADV_PSI.AND.ICONVF(4).NE.ADV_NSC_NC.AND.
02200      &   ICONVF(4).NE.ADV_PSI_NC.AND.
02201      &   ICONVF(4).NE.ADV_LPO_TF.AND.ICONVF(4).NE.ADV_NSC_TF) THEN
02202         IF(LNG.EQ.1) WRITE(LU,76) ICONVF(4)
02203         IF(LNG.EQ.2) WRITE(LU,77) ICONVF(4)
02204 76      FORMAT(1X,'FORME DE LA CONVECTION DE K ET EPSILON : ',I3,/,1X,
02205      &            'INCONNUE OU NON PROGRAMMEE')
02206 77      FORMAT(1X,'TYPE OF AVECTION FOR K AND EPSILON: ',I3,/,1X,
02207      &            'UNKNOWN OR NOT IMPLEMENTED')
02208         IF(ICONVF(4).EQ.8.AND.LNG.EQ.1) THEN
02209           WRITE(LU,*) 'LE SCHEMA VOLUMES FINIS 8 EST MAINTENANT'
02210           WRITE(LU,*) 'LE SCHEMA N CONSERVATIF, AVEC LE NUMERO ',
02211      &                                                          ADV_NSC
02212         ENDIF
02213         IF(ICONVF(4).EQ.8.AND.LNG.EQ.2) THEN
02214           WRITE(LU,*) 'THE FINITE VOLUMES SCHEME 8 IS NOW'
02215           WRITE(LU,*) 'THE CONSERVATIVE N-SCHEME, WITH NUMBER ',ADV_NSC
02216         ENDIF
02217         CALL PLANTE(1)
02218         STOP
02219       ENDIF
02220       IF(ICONVF(4).EQ.ADV_LPO.OR.ICONVF(4).EQ.ADV_LPO_TF.OR.
02221      &   ICONVF(4).EQ.ADV_NSC.OR.ICONVF(4).EQ.ADV_NSC_TF.OR.
02222      &   ICONVF(4).EQ.ADV_PSI.OR.ICONVF(4).EQ.ADV_PSI_TF     ) THEN
02223         IF(OPTASS.NE.3) THEN
02224           IF(LNG.EQ.1) WRITE(LU,2216)
02225           IF(LNG.EQ.2) WRITE(LU,2217)
02226           CALL PLANTE(1)
02227           STOP
02228         ENDIF
02229       ENDIF
02230       ENDIF
02231 !
02232 !-----------------------------------------------------------------------
02233 !
02234 !  CROUT PRECONDITIONING WITH DIFFERENT DISCRETISATION FOR H AND U
02235 !  NOT PROGRAMMED FOR THE TIME BEING
02236 !
02237       IF(DISCRE(1).NE.DISCRE(2).AND.SLVPRO%PRECON.NE.0) THEN
02238         IF((MOD(SLVPRO%PRECON, 7).EQ.0).OR.
02239      &     (MOD(SLVPRO%PRECON,11).EQ.0).OR.
02240      &     (MOD(SLVPRO%PRECON,13).EQ.0)     ) THEN
02241            IF(LNG.EQ.1) WRITE(LU,5002)
02242            IF(LNG.EQ.2) WRITE(LU,5003)
02243 5002       FORMAT(1X,'AVEC DISCRETISATION DIFFERENTE DE H ET DE U',/,1X,
02244      &               'PAS DE PRECONDITIONNEMENT DE TYPE CROUT',///)
02245 5003       FORMAT(1X,'WITH A DIFFERENT DISCRETIZATION OF H AND U',/,1X,
02246      &               'NO CROUT-TYPE PRECONDITIONNING',///)
02247            CALL PLANTE(1)
02248            STOP
02249         ENDIF
02250       ENDIF
02251 !
02252 !-----------------------------------------------------------------------
02253 !
02254 !  COHERENCE FOR THE EFFECTS OF DENSITY
02255 !
02256       IF(ROVAR) THEN
02257 !
02258         IF(NTRAC.EQ.0) THEN
02259           IF(LNG.EQ.1) WRITE(LU,2004)
02260           IF(LNG.EQ.2) WRITE(LU,2005)
02261 2004      FORMAT(1X,'AVEC DES EFFETS DE DENSITE, IL FAUT UN ',/,1X,
02262      &              'TRACEUR EGAL A LA SALINITE')
02263 2005      FORMAT(1X,'WITH DENSITY EFFECTS, A TRACER EQUAL TO',/,1X,
02264      &              'THE SALINITY IS NEEDED')
02265           CALL PLANTE(1)
02266           STOP
02267         ENDIF
02268 !
02269         ROEAU = 999.972D0 * ( 1.D0 -7.D-6 *(TMOY-4.D0)**2 )
02270 !
02271       ENDIF
02272 !
02273 !-----------------------------------------------------------------------
02274 !
02275 ! COHERENCE FOR THE GENERATING FORCE OF THE TIDE
02276 !
02277       IF (MAREE) THEN
02278 !
02279         IF (SPHERI) THEN
02280           CORIOL = .TRUE.
02281           IF(LNG.EQ.1) WRITE(LU,5000)
02282           IF(LNG.EQ.2) WRITE(LU,5001)
02283 5000      FORMAT(1X,'LECDON : PRISE EN COMPTE DE LA FORCE ',
02284      &    'GENERATRICE DE LA MAREE ET DE LA FORCE DE CORIOLIS')
02285 5001      FORMAT(1X,
02286 'LECDON : COMPUTATION WITH THE TIDE-GENERATING FORCE     & AND THE CORIOLIS FORCE')
02287         ELSE
02288           IF(LNG.EQ.1) WRITE(LU,4002)
02289           IF(LNG.EQ.2) WRITE(LU,4003)
02290 4002      FORMAT(1X,'LECDON : LA PRISE EN COMPTE DE LA FORCE ',
02291      &            'GENERATRICE DE LA MAREE',/,10X,'N''EST PAS POSSIBLE',
02292      &            ' EN COORDONNEES CARTESIENNES')
02293 4003      FORMAT(1X,'LECDON : COMPUTATION WITH TIDE-GENERATING FORCE',/,
02294      &      10X,'IMPOSSIBLE IN CARTESIAN COORDINATES')
02295           CALL PLANTE(1)
02296           STOP
02297         ENDIF
02298 !
02299       ENDIF
02300 !
02301 !-----------------------------------------------------------------------
02302 !
02303 !     DISCRETISES THE VARIABLES
02304 !
02305       IELMU = DISCRE(1)
02306       IELMH = DISCRE(2)
02307       IELMT = DISCRE(3)
02308       IELMK = DISCRE(4)
02309       IELME = DISCRE(4)
02310       IELM0 = 10*(IELMH/10)
02311       IELM1 = IELM0 + 1
02312 !
02313       IF(IELMH.EQ.12) THEN
02314         IF(LNG.EQ.1) WRITE(LU,4102)
02315         IF(LNG.EQ.2) WRITE(LU,4103)
02316 4102    FORMAT(/,1X,'PAS DE DISCRETISATION QUASI-BULLE SUR LA HAUTEUR')
02317 4103    FORMAT(/,1X,'NO QUASI-BUBBLE DISCRETISATION FOR DEPTH')
02318         CALL PLANTE(1)
02319         STOP
02320       ENDIF
02321 !
02322       IF((IELMU.EQ.12.OR.IELMT.EQ.12).AND.PRODUC.EQ.2)
02323      & THEN
02324         IF(LNG.EQ.1) WRITE(LU,4000)
02325         IF(LNG.EQ.2) WRITE(LU,4001)
02326 4000    FORMAT(/1X,'PRODUIT FRONTAL NON PROGRAMME AVEC QUASI-BULLE')
02327 4001    FORMAT(/1X,'FRONTAL PRODUCT NOT IMPLEMENTED FOR QUASI-BUBBLE')
02328         CALL PLANTE(1)
02329         STOP
02330       ENDIF
02331 !
02332       IF(EQUA(1:15).EQ.'SAINT-VENANT VF') THEN
02333         IF(IELMU.EQ.12.OR.IELMH.EQ.12) THEN
02334           IELMU = 11
02335           IELMH = 11
02336           IF(LNG.EQ.1) WRITE(LU,2020)
02337           IF(LNG.EQ.2) WRITE(LU,2021)
02338 2020      FORMAT(1X,'PAS DE QUASI-BULLE EN VOLUMES FINIS')
02339 2021      FORMAT(1X,'NO QUASI-BUBBLE IN FINITE VOLUMES')
02340         ENDIF
02341       ENDIF
02342 !
02343 !-----------------------------------------------------------------------
02344 !
02345 !  NUMBER OF TIMESTEPS ACCORDING TO THE PARAMETER CHOSEN BY THE USER
02346 !
02347       NIT = MAX(NIT,INT(DUREE/DT +0.5D0))
02348 !
02349 !-----------------------------------------------------------------------
02350 !
02351 !  NPRIV MOFIFIED FOR OUTPUT OF USER-BUILT VARIABLES
02352 !
02353       DO I=1,4
02354         IF ((SORLEO(22+I).OR.SORIMP(22+I)).AND.(NPRIV.LT.I)) THEN
02355           NPRIV=MAX(NPRIV,I)
02356         ENDIF
02357       ENDDO
02358 !
02359 !-----------------------------------------------------------------------
02360 !
02361 !  STORAGE 2 OPTION HAS BEEN REMOVED FROM RELEASE 5.1
02362 !
02363       IF(OPTASS.EQ.2) THEN
02364         IF(LNG.EQ.1) WRITE(LU,2016)
02365         IF(LNG.EQ.2) WRITE(LU,2017)
02366 2016    FORMAT(1X,'STOCKAGE DES MATRICES = 2',/,1X,
02367      &            'SUPPRIME DEPUIS LA VERSION 5.1',/,1X,
02368      &            'ESSAYER LE STOCKAGE PAR SEGMENTS (3) A LA PLACE')
02369 2017    FORMAT(1X,'MATRIX STORAGE = 2',/,1X,
02370      &            'SUPPRESSED SINCE VERSION 5.1',/,1X,
02371      &            'TRY EDGE-BASED STORAGE (3) INSTEAD')
02372         CALL PLANTE(1)
02373         STOP
02374       ENDIF
02375 !
02376 !-----------------------------------------------------------------------
02377 !
02378 !  CHECKS NON-PROGRAMMED OPTIONS IN PARALLEL MODE
02379 !
02380       IF(NCSIZE.GT.1) THEN
02381         IF(PRODUC.EQ.2) THEN
02382           IF(LNG.EQ.1) WRITE(LU,2714)
02383           IF(LNG.EQ.2) WRITE(LU,2715)
02384 2714      FORMAT(1X,'PRODUIT FRONTAL',/,1X,
02385      &           'NON PROGRAMME EN PARALLELISME',/,1X,
02386      &           'L''OPTION 1 EST CHOISIE A LA PLACE')
02387 2715      FORMAT(1X,'FRONTAL PRODUCT',/,1X,
02388      &           'NOT IMPLEMENTED WITH PARALLELISM',/,1X,
02389      &           'OPTION 1 IS TAKEN INSTEAD')
02390           PRODUC = 1
02391         ENDIF
02392       ENDIF
02393 !
02394 !-----------------------------------------------------------------------
02395 !
02396 !     CHECKS FRICTION COEFFICIENT
02397 !
02398       IF(FRICTB.AND.ESTIME.NE.' ') THEN
02399         IF(LNG.EQ.1) THEN
02400           WRITE(LU,*) 'LES MOTS CLES :'
02401           WRITE(LU,*) 'DONNEES POUR LE FROTTEMENT ET '
02402           WRITE(LU,*) 'ESTIMATION DE PARAMETRE'
02403           WRITE(LU,*) 'NE PEUVENT ETRE UTILISES SIMULTANEMENT'
02404         ENDIF
02405         IF(LNG.EQ.2) THEN
02406           WRITE(LU,*) 'THE KEYWORDS :'
02407           WRITE(LU,*) 'FRICTION DATA FILE AND PARAMETER ESTIMATION'
02408           WRITE(LU,*) 'CANNOT BE USED TOGETHER'
02409         ENDIF
02410         CALL PLANTE(1)
02411         STOP
02412       ENDIF
02413 !
02414       IF(FRICTB) KFROT = 0 !ELSE THE NEXT TEST CAN BE FALSE
02415       IF(KFROT.NE.0.AND.TROUVE(2,4).NE.2) THEN
02416         IF(LNG.EQ.1) WRITE(LU,2716) KFROT
02417         IF(LNG.EQ.2) WRITE(LU,2717) KFROT
02418 2716    FORMAT(1X,'LA LOI DE FROTTEMENT ',1I2,' EST DEMANDEE',/,1X,
02419      &            'DONNER LE COEFFICIENT DE FROTTEMENT CORRESPONDANT')
02420 2717    FORMAT(1X,'THE LAW OF BOTTOM FRICTION ',1I2,' IS ASKED',/,1X,
02421      &            'GIVE THE CORRESPONDING FRICTION COEFICIENT')
02422         CALL PLANTE(1)
02423         STOP
02424       ELSEIF(TROUVE(1,8).NE.2) THEN
02425         IF(LNG.EQ.1) WRITE(LU,2718)
02426         IF(LNG.EQ.2) WRITE(LU,2719)
02427 2718    FORMAT(1X,'AUCUNE LOI DE FROTTEMENT N''EST DONNEE !')
02428 2719    FORMAT(1X,'NO FRICTION LAW IS PRESCRIBED!')
02429         CALL PLANTE(1)
02430         STOP
02431       ENDIF
02432 !
02433 !-----------------------------------------------------------------------
02434 !
02435       IF(SOLSYS.EQ.2.AND.ESTIME.NE.' ') THEN
02436         IF(LNG.EQ.1) THEN
02437           WRITE(LU,*) 'TRAITEMENT DU SYSTEME LINEAIRE OBLIGATOIREMENT 1'
02438           WRITE(LU,*) 'EN MODE ESTIMATION DE PARAMETRES                '
02439         ENDIF
02440         IF(LNG.EQ.2) THEN
02441           WRITE(LU,*) 'TREATMENT OF THE LINEAR SYSTEM MUST BE 1'
02442           WRITE(LU,*) 'IN PARAMETER ESTIMATION MODE            '
02443         ENDIF
02444         CALL PLANTE(1)
02445         STOP
02446       ENDIF
02447 !
02448 !-----------------------------------------------------------------------
02449 !
02450       IF(SOLSYS.EQ.2.AND.EQUA(1:10).EQ.'BOUSSINESQ') THEN
02451         IF(LNG.EQ.1) THEN
02452           WRITE(LU,*) 'TRAITEMENT DU SYSTEME LINEAIRE 2'
02453           WRITE(LU,*) 'ET BOUSSINESQ SONT INCOMPATIBLES'
02454         ENDIF
02455         IF(LNG.EQ.2) THEN
02456           WRITE(LU,*) 'TREATMENT OF THE LINEAR SYSTEM 2'
02457           WRITE(LU,*) 'AND BOUSSINESQ ARE NOT COMPATIBLE'
02458         ENDIF
02459         CALL PLANTE(1)
02460         STOP
02461       ENDIF
02462 !
02463 !-----------------------------------------------------------------------
02464 !
02465       IF(ESTIME.NE.' '.AND.BANDEC) THEN
02466         IF(OPTCOST.EQ.2.AND.LNG.EQ.1) THEN
02467           WRITE(LU,*) 'MOT-CLE FONCTION COUT OBLIGATOIREMENT EGAL A 1'
02468           WRITE(LU,*) 'AVEC DES BANCS DECOUVRANTS'
02469           CALL PLANTE(1)
02470           STOP
02471         ENDIF
02472         IF(OPTCOST.EQ.2.AND.LNG.EQ.2) THEN
02473           WRITE(LU,*) 'KEY-WORD COST FUNCTION MUST BE 1'
02474           WRITE(LU,*) 'WITH TIDAL FLATS'
02475           CALL PLANTE(1)
02476           STOP
02477         ENDIF
02478       ENDIF
02479 !
02480 !-----------------------------------------------------------------------
02481 !
02482 !     REQUIRED OPTIONS OR BETTER OPTIONS FOR THE WAVE EQUATION
02483 !
02484       IF(SOLSYS.EQ.2) THEN
02485 !
02486 !       DIAGONAL PRECONDITIONING WITH ABSOLUTE VALUES
02487         IF(2*(SLVPRO%PRECON/2).EQ.SLVPRO%PRECON) THEN
02488           SLVPRO%PRECON=SLVPRO%PRECON/2
02489           SLVPRO%PRECON=SLVPRO%PRECON*5
02490         ENDIF
02491 !       NO C-U PRECONDITIONING
02492         PRECCU = .FALSE.
02493 !       EXPLICIT DIFFUSION
02494 !       TETAD  = 0.D0
02495 !       IMPLICIT VELOCITY AND DEPTH (NOT COMPULSORY BUT MORE STABLE)
02496 !       FOLLOWING LINE COMMENTED OUT AFTER USER CLUB 2010 (REMARK BY ALAN COOPER)
02497 !       TETAU = 1.D0
02498 !       FOLLOWING LINE COMMENTED OUT ON 16/09/2011 (NOT MANDATORY)
02499 !       TETAC = 1.D0
02500 !       MASS-LUMPING COMPLETE ON U
02501         AGGLOU = 1.D0
02502         IF(ICONVF(1).NE.ADV_CAR.AND.ICONVF(1).NE.ADV_PSI_NC.AND.
02503      &     ICONVF(1).NE.ADV_LPO.AND.ICONVF(1).NE.ADV_LPO_TF.AND.
02504      &     ICONVF(1).NE.ADV_NSC.AND.ICONVF(1).NE.ADV_NSC_TF.AND.
02505      &     ICONVF(1).NE.ADV_PSI.AND.ICONVF(1).NE.ADV_PSI_TF     ) THEN
02506           IF(LNG.EQ.1) WRITE(LU,3002)
02507           IF(LNG.EQ.2) WRITE(LU,3003)
02508 3002      FORMAT(/1X,'AVEC LE TRAITEMENT DU SYSTEME LINEAIRE 2',/,
02509      &            1X,'LA FORME DE LA CONVECTION DOIT ETRE EXPLICITE',/,
02510      &            1X,'POUR LA VITESSE')
02511 3003      FORMAT(/1X,'WITH THE TREATMENT OF THE LINEAR SYSTEM NUMBER 2',
02512      &            1X,'THE ADVECTION TYPE MUST BE EXPLICIT',/,
02513      &            1X,'FOR THE VELOCITY')
02514           CALL PLANTE(1)
02515           STOP
02516         ENDIF
02517         IF(IELMU.EQ.13) THEN
02518           IF(LNG.EQ.1) WRITE(LU,3006)
02519           IF(LNG.EQ.2) WRITE(LU,3007)
02520 3006      FORMAT(/1X,'AVEC L''EQUATION D''ONDE',/,
02521      &            1X,'VITESSE QUADRATIQUE NON PROGRAMMEE')
02522 3007      FORMAT(/1X,'WITH THE WAVE EQUATION',
02523      &            1X,'QUADRATIC VELOCITY IS NOT IMPLEMENTED')
02524           CALL PLANTE(1)
02525           STOP
02526         ENDIF
02527       ELSEIF(SOLSYS.NE.1) THEN
02528         IF(LNG.EQ.1) WRITE(LU,3004) SOLSYS
02529         IF(LNG.EQ.2) WRITE(LU,3005) SOLSYS
02530 3004    FORMAT(/,1X,'LE TRAITEMENT DU SYSTEME LINEAIRE :',1I6,1X,/,
02531      &             'DOIT ETRE EGAL A 1 OU 2')
02532 3005    FORMAT(/,1X,'THE TREATMENT OF THE LINEAR SYSTEM:',1I6,1X,/,
02533      &             'MUST BE EQUAL TO 1 OR 2')
02534         CALL PLANTE(1)
02535         STOP
02536       ENDIF
02537 !
02538       IF(TETAC.LT.0.5D0) THEN
02539         IF(LNG.EQ.1) WRITE(LU,3008) TETAC
02540         IF(LNG.EQ.2) WRITE(LU,3009) TETAC
02541 3008    FORMAT(/,1X,'L''IMPLICITATION POUR LA HAUTEUR :',G16.7,1X,/,
02542      &             'DOIT ETRE SUPERIEURE A 0.5')
02543 3009    FORMAT(/,1X,'IMPLICITATION FOR DEPTH:',1I6,1X,/,
02544      &             'MUST BE GREATER THAN 0.5')
02545         CALL PLANTE(1)
02546         STOP
02547       ENDIF
02548       IF(TETAU.LT.0.5D0) THEN
02549         IF(LNG.EQ.1) WRITE(LU,3010) TETAU
02550         IF(LNG.EQ.2) WRITE(LU,3011) TETAU
02551 3010    FORMAT(/,1X,'L''IMPLICITATION POUR LA VITESSE :',G16.7,1X,/,
02552      &             'DOIT ETRE SUPERIEURE A 0.5')
02553 3011    FORMAT(/,1X,'IMPLICITATION FOR VELOCITY:',1I6,1X,/,
02554      &             'MUST BE GREATER THAN 0.5')
02555         CALL PLANTE(1)
02556         STOP
02557       ENDIF
02558 !
02559 !  LOOKS FOR TEMPERATURE AND SALINITY IN THE TRACERS
02560 !
02561       IF(.NOT.WATQUA)IND_T=0
02562 !     IF WATQUA, IND_T IS OBTAINED IN SUBROUTINE INCREASE_NTRAC
02563       IND_S=0
02564       IF(NTRAC.GE.1) THEN
02565         DO I=1,NTRAC
02566           IF(NAMETRAC(I)(1:11).EQ.'TEMPERATURE') IND_T = I
02567           IF(NAMETRAC(I)(1: 7).EQ.'SALINIT')     IND_S = I
02568         ENDDO
02569       ENDIF
02570 !
02571 !  CHECKS THE EXISTENCE OF RELEVANT TRACERS FOR DELWAQ
02572 !
02573       IF(IND_T.EQ.0.AND.TEMP_DEL) THEN
02574         IF(LNG.EQ.1) THEN
02575           WRITE(LU,*) 'POUR DELWAQ IL MANQUE LA TEMPERATURE'
02576         ENDIF
02577         IF(LNG.EQ.2) THEN
02578           WRITE(LU,*) 'TEMPERATURE MISSING FOR DELWAQ'
02579         ENDIF
02580         CALL PLANTE(1)
02581         STOP
02582       ENDIF
02583       IF(IND_S.EQ.0.AND.SALI_DEL) THEN
02584         IF(LNG.EQ.1) THEN
02585           WRITE(LU,*) 'POUR DELWAQ IL MANQUE LA SALINITE'
02586         ENDIF
02587         IF(LNG.EQ.2) THEN
02588           WRITE(LU,*) 'SALINITY MISSING FOR DELWAQ'
02589         ENDIF
02590         CALL PLANTE(1)
02591         STOP
02592       ENDIF
02593 !
02594       IF(OPTBAN.EQ.1.AND.OPT_HNEG.EQ.2) THEN
02595         IF(ABS(AGGLOC-1.D0).GT.0.01D0) THEN
02596           IF(LNG.EQ.1) THEN
02597             WRITE(LU,*) 'TRAITEMENT DES HAUTEURS NEGATIVES=2'
02598             WRITE(LU,*) 'MASS-LUMPING SUR H DOIT ETRE EGAL A 1.'
02599           ENDIF
02600           IF(LNG.EQ.2) THEN
02601             WRITE(LU,*) 'TREATMENT OF NEGATIVE DEPTHS=2'
02602             WRITE(LU,*) 'MASS-LUMPING ON H MUST BE EQUAL TO 1.'
02603           ENDIF
02604           CALL PLANTE(1)
02605           STOP
02606         ENDIF
02607         IF(.NOT.CORCON) THEN
02608           IF(LNG.EQ.1) THEN
02609             WRITE(LU,*) 'TRAITEMENT DES HAUTEURS NEGATIVES=2'
02610             WRITE(LU,*) 'CORRECTION DE CONTINUITE=OUI OBLIGATOIRE'
02611           ENDIF
02612           IF(LNG.EQ.2) THEN
02613             WRITE(LU,*) 'TREATMENT OF NEGATIVE DEPTHS=2'
02614             WRITE(LU,*) 'CONTINUITY CORRECTION=YES MANDATORY'
02615           ENDIF
02616           CALL PLANTE(1)
02617           STOP
02618         ENDIF
02619         IF(OPTSUP(2).NE.0) THEN
02620           IF(LNG.EQ.1) THEN
02621             WRITE(LU,*) 'TRAITEMENT DES HAUTEURS NEGATIVES=2'
02622             WRITE(LU,*) 'PAS DE DECENTREMENT SUPG SUR LA HAUTEUR'
02623             WRITE(LU,*) 'METTRE OPTION DE SUPG=..;0;...'
02624           ENDIF
02625           IF(LNG.EQ.2) THEN
02626             WRITE(LU,*) 'TREATMENT OF NEGATIVE DEPTHS=2'
02627             WRITE(LU,*) 'NO SUPG UPWINDING ON DEPTH'
02628             WRITE(LU,*) 'CHOOSE SUPG OPTION=...;0;...'
02629           ENDIF
02630           CALL PLANTE(1)
02631           STOP
02632         ENDIF
02633       ENDIF
02634 !
02635 !     TIDAL FLATS VERSIONS OF FINITE VOLUME ADVECTION SCHEMES
02636 !     REQUEST POSITIVE DEPTHS
02637 !
02638       IF(BANDEC.AND.OPTBAN.EQ.1.AND.OPT_HNEG.NE.2) THEN
02639         IF(ICONVF(1).EQ.ADV_NSC_TF.OR.ICONVF(4).EQ.ADV_NSC_TF
02640      & .OR.ICONVF(1).EQ.ADV_LPO_TF.OR.ICONVF(4).EQ.ADV_LPO_TF
02641      & .OR.ICONVF(1).EQ.ADV_PSI_TF.OR.ICONVF(4).EQ.ADV_PSI_TF) THEN
02642           IF(LNG.EQ.1) THEN
02643             WRITE(LU,*) 'AVEC LES SCHEMAS DE CONVECTION'
02644             WRITE(LU,*) ADV_LPO_TF,ADV_NSC_TF,' OU ',ADV_PSI_TF
02645             WRITE(LU,*) 'TRAITEMENT DES HAUTEURS NEGATIVES'
02646             WRITE(LU,*) 'DOIT ETRE EGAL A 2'
02647           ENDIF
02648           IF(LNG.EQ.2) THEN
02649             WRITE(LU,*) 'WITH ADVECTION SCHEMES'
02650             WRITE(LU,*) ADV_LPO_TF,ADV_NSC_TF,' OR ',ADV_PSI_TF
02651             WRITE(LU,*) 'TREATMENT OF NEGATIVE DEPTHS'
02652             WRITE(LU,*) 'MUST BE EQUAL TO 2'
02653           ENDIF
02654           CALL PLANTE(1)
02655           STOP
02656         ENDIF
02657       ENDIF
02658 !
02659       IF(NTRAC.GT.0.AND.BANDEC.AND.OPTBAN.EQ.1.AND.OPT_HNEG.NE.2) THEN
02660         DO ITRAC=1,NTRAC
02661           IF(    ICONVFT(ITRAC).EQ.ADV_NSC_TF
02662      &       .OR.ICONVFT(ITRAC).EQ.ADV_LPO_TF
02663      &       .OR.ICONVFT(ITRAC).EQ.ADV_PSI_TF ) THEN
02664             IF(LNG.EQ.1) THEN
02665               WRITE(LU,*) 'AVEC LES SCHEMAS DE CONVECTION'
02666               WRITE(LU,*) ADV_LPO_TF,ADV_NSC_TF,' OU ',ADV_PSI_TF
02667               WRITE(LU,*) 'TRAITEMENT DES HAUTEURS NEGATIVES'
02668               WRITE(LU,*) 'DOIT ETRE EGAL A 2'
02669             ENDIF
02670             IF(LNG.EQ.2) THEN
02671               WRITE(LU,*) 'WITH ADVECTION SCHEMES'
02672               WRITE(LU,*) ADV_LPO_TF,ADV_NSC_TF,' OR ',ADV_PSI_TF
02673               WRITE(LU,*) 'TREATMENT OF NEGATIVE DEPTHS'
02674               WRITE(LU,*) 'MUST BE EQUAL TO 2'
02675             ENDIF
02676             CALL PLANTE(1)
02677             STOP
02678           ENDIF
02679         ENDDO
02680       ENDIF
02681 !
02682 !-----------------------------------------------------------------------
02683 !
02684 !  CHECKS THE EXISTENCE OF A MIGRHYCAR STEERING FILE
02685 !
02686       IF(SPILL_MODEL.AND.T2D_FILES(T2DMIG)%NAME(1:1).EQ.' ') THEN
02687         IF(LNG.EQ.1) THEN
02688           WRITE(LU,*) ' '
02689           WRITE(LU,*) 'POUR LE MODELE DE DERIVES DE NAPPES'
02690           WRITE(LU,*) 'DONNER UN FICHIER DE COMMANDES MIGRHYCAR'
02691           WRITE(LU,*) ' '
02692         ENDIF
02693         IF(LNG.EQ.2) THEN
02694           WRITE(LU,*) ' '
02695           WRITE(LU,*) 'FOR THE OIL SPILL MODEL'
02696           WRITE(LU,*) 'PLEASE GIVE A MIGRHYCAR STEERING FILE'
02697           WRITE(LU,*) ' '
02698         ENDIF
02699         CALL PLANTE(1)
02700         STOP
02701       ENDIF
02702 !
02703 !-----------------------------------------------------------------------
02704 !
02705 !     WAVE DRIVEN CURRENTS MANDATORY IF COUPLING TO TOMAWAC
02706 !
02707 !     COMMENTED ON 24/12/2013
02708 !     IF(INCLUS(COUPLING,'TOMAWAC')) COUROU=.TRUE.
02709 !
02710 !-----------------------------------------------------------------------
02711 !
02712 !  CHOICE FOR TIDAL DATA BASE TO DO BY THE USER
02713 !
02714       IF(TIDALTYPE.NE.0.AND.TIDALDB.EQ.-1) THEN
02715         IF(LNG.EQ.1) THEN
02716           WRITE(LU,*) 'CHOISIR LA BASE DE DONNEES DE MAREE'
02717           WRITE(LU,*) 'PARMI LES CHOIX POSSIBLES :'
02718           WRITE(LU,*) '  -1 : JMJ ;'
02719           WRITE(LU,*) '  -2 : TPXO ;'
02720           WRITE(LU,*) '  -3 : LEGOS-NEA.'
02721         ENDIF
02722         IF(LNG.EQ.2) THEN
02723           WRITE(LU,*) 'CHOOSE THE TIDAL DATA BASE'
02724           WRITE(LU,*) 'AMONG THE POSSIBLE CHOICES:'
02725           WRITE(LU,*) '  -1: JMJ,'
02726           WRITE(LU,*) '  -2: TPXO,'
02727           WRITE(LU,*) '  -3: LEGOS-NEA.'
02728         ENDIF
02729         CALL PLANTE(1)
02730         STOP
02731       ENDIF
02732 !
02733 !-----------------------------------------------------------------------
02734 !
02735 !  CHECKS THE EXISTENCE OF TIDAL DATA BASE FILES WHEN USING TPXO
02736 !
02737       IF(TIDALTYPE.NE.0.AND.TIDALDB.EQ.2
02738      &   .AND.T2D_FILES(T2DBB1)%NAME(1:1).EQ.' ') THEN
02739         IF(LNG.EQ.1) THEN
02740           WRITE(LU,*) 'POUR UTILISER LA BASE DE DONNEES DE MAREE TPXO'
02741           WRITE(LU,*) 'DONNER LE FICHIER'
02742           WRITE(LU,*) 'BASE BINAIRE 1 DE DONNEES DE MAREE'
02743         ENDIF
02744         IF(LNG.EQ.2) THEN
02745           WRITE(LU,*) 'TO USE TPXO TIDAL DATA BASE'
02746           WRITE(LU,*) 'PLEASE GIVE A BINARY DATABASE 1 FOR TIDE FILE'
02747         ENDIF
02748         CALL PLANTE(1)
02749         STOP
02750       ELSEIF(TIDALTYPE.NE.0.AND.TIDALDB.EQ.2
02751      &       .AND.T2D_FILES(T2DBB2)%NAME(1:1).EQ.' ') THEN
02752         IF(LNG.EQ.1) THEN
02753           WRITE(LU,*) 'POUR UTILISER LA BASE DE DONNEES DE MAREE TPXO'
02754           WRITE(LU,*) 'DONNER LE FICHIER'
02755           WRITE(LU,*) 'BASE BINAIRE 2 DE DONNEES DE MAREE'
02756         ENDIF
02757         IF(LNG.EQ.2) THEN
02758           WRITE(LU,*) 'TO USE TPXO TIDAL DATA BASE'
02759           WRITE(LU,*) 'PLEASE GIVE A BINARY DATABASE 2 FOR TIDE FILE'
02760         ENDIF
02761         CALL PLANTE(1)
02762         STOP
02763       ENDIF
02764 !
02765 !-----------------------------------------------------------------------
02766 !
02767 !  POSITIVE COEFFICIENT TO CALIBRATE TIDAL RANGE EXPECTED
02768 !
02769       IF(CTIDE.LT.0) THEN
02770         IF(LNG.EQ.1) THEN
02771           WRITE(LU,*) 'LE COEFFICIENT DE CALAGE DU MARNAGE'
02772           WRITE(LU,*) 'DOIT ETRE POSITIF OU NUL'
02773         ENDIF
02774         IF(LNG.EQ.2) THEN
02775           WRITE(LU,*) 'COEFFICIENT TO CALIBRATE TIDAL RANGE'
02776           WRITE(LU,*) 'HAVE TO BE GREATER OR EQUAL 0'
02777         ENDIF
02778         CALL PLANTE(1)
02779         STOP
02780       ENDIF
02781 !
02782 !-----------------------------------------------------------------------
02783 !
02784 !  POSITIVE COEFFICIENT TO CALIBRATE TIDAL VELOCITIES EXPECTED
02785 !
02786       IF(CTIDEV.LT.0) THEN
02787         IF(LNG.EQ.1) THEN
02788           WRITE(LU,*) 'LE COEFFICIENT DE CALAGE DES VITESSES DE COURANT'
02789           WRITE(LU,*) 'DOIT ETRE POSITIF OU NUL'
02790         ENDIF
02791         IF(LNG.EQ.2) THEN
02792           WRITE(LU,*) 'COEFFICIENT TO CALIBRATE TIDAL VELOCITIES'
02793           WRITE(LU,*) 'HAVE TO BE GREATER OR EQUAL 0'
02794         ENDIF
02795         CALL PLANTE(1)
02796         STOP
02797       ENDIF
02798 !
02799 !-----------------------------------------------------------------------
02800 !
02801 !  SPATIAL PROJECTION TYPE CHECKED IF SPHERICAL COORDINATES ASKED
02802 !
02803       IF(SPHERI) THEN
02804         IF(PROTYP.NE.2.AND.PROTYP.NE.3) THEN
02805           IF(LNG.EQ.1) THEN
02806             WRITE(LU,*) 'TYPE DE PROJECTION SPATIALE : ',PROTYP
02807             WRITE(LU,*) 'IMPOSSIBLE AVEC DES COORDONNEES SPHERIQUES'
02808           ENDIF
02809           IF(LNG.EQ.2) THEN
02810             WRITE(LU,*) 'SPATIAL PROJECTION TYPE: ',PROTYP
02811             WRITE(LU,*) 'IMPOSSIBLE WITH SPHERICAL COORDINATES'
02812           ENDIF
02813           CALL PLANTE(1)
02814           STOP
02815         ENDIF
02816       ENDIF
02817 !
02818 !-----------------------------------------------------------------------
02819 !
02820 !     BUIDING THE OPTIONS OF THE ADVECTION SCHEMES
02821 !
02822 !     VELOCITY
02823 !
02824       OPTADV_VI=1
02825       IF(ICONVF(1).EQ.1) THEN
02826 !       CHARACTERISTICS
02827         OPTADV_VI=OPTCHA
02828       ELSEIF(ICONVF(1).EQ.2) THEN
02829 !       SUPG
02830         OPTADV_VI=OPTSUP(1)
02831       ELSEIF(ICONVF(1).EQ.5) THEN
02832 !       PSI SCHEME
02833         OPTADV_VI=OPTPSI
02834       ENDIF
02835 !     SCHEME OPTION FOR ADVECTION OF VELOCITIES
02836 !     HAS PRIORITY WHEN PRESENT
02837       IF(TROUVE(1,92).EQ.2) THEN
02838         OPTADV_VI = MOTINT(ADRESS(1,92))
02839 !       WEAK CHARACTERISTICS MEMORY ALLOCATIONS ARE TRIGGERED BY OPTCHA
02840         IF(ICONVF(1).EQ.1.AND.OPTADV_VI.EQ.2) OPTCHA=2
02841       ENDIF
02842 !
02843 !     K-EPSILON
02844 !
02845       OPTADV_KE=1
02846       IF(ICONVF(4).EQ.1) THEN
02847 !       CHARACTERISTICS
02848         OPTADV_KE=OPTCHA
02849       ELSEIF(ICONVF(4).EQ.2) THEN
02850 !       SUPG
02851         OPTADV_KE=OPTSUP(4)
02852       ELSEIF(ICONVF(4).EQ.5) THEN
02853 !       PSI SCHEME
02854         OPTADV_KE=OPTPSI
02855       ENDIF
02856 !     SCHEME OPTION FOR ADVECTION OF K-EPSILON
02857 !     HAS PRIORITY WHEN PRESENT
02858       IF(TROUVE(1,93).EQ.2) THEN
02859         OPTADV_KE = MOTINT(ADRESS(1,93))
02860 !       WEAK CHARACTERISTICS MEMORY ALLOCATIONS ARE TRIGGERED BY OPTCHA
02861         IF(ICONVF(4).EQ.1.AND.OPTADV_KE.EQ.2) OPTCHA=2
02862       ENDIF
02863 !
02864 !     TRACERS
02865 !
02866       IF(NTRAC.GT.0) THEN
02867         DO ITRAC=1,NTRAC
02868           OPTADV_TR(ITRAC)=1
02869           IF(ICONVFT(ITRAC).EQ.1) THEN
02870 !           CHARACTERISTICS
02871             OPTADV_TR(ITRAC)=OPTCHA
02872           ELSEIF(ICONVFT(ITRAC).EQ.2) THEN
02873 !           SUPG
02874             OPTADV_TR(ITRAC)=OPTSUP(3)
02875           ELSEIF(ICONVFT(ITRAC).EQ.5) THEN
02876 !           PSI SCHEME
02877             OPTADV_TR(ITRAC)=OPTPSI
02878           ENDIF
02879         ENDDO
02880 !       SCHEME OPTION FOR ADVECTION OF TRACERS
02881 !       HAS PRIORITY WHEN PRESENT
02882         IF(TROUVE(1,91).EQ.2) THEN
02883           DO ITRAC=1,MIN(NTRAC,DIMEN(1,91))
02884             OPTADV_TR(ITRAC) = MOTINT(ADRESS(1,91)+ITRAC-1)
02885 !           WEAK CHARACTERISTICS MEMORY ALLOCATIONS TRIGGERED BY OPTCHA
02886             IF(ICONVFT(ITRAC).EQ.1.AND.OPTADV_TR(ITRAC).EQ.2) OPTCHA=2
02887           ENDDO
02888         ENDIF
02889       ENDIF
02890 !
02891 !-----------------------------------------------------------------------
02892 !
02893 !  WRITES OUT THE TITLE
02894 !
02895       IF(LISTIN) THEN
02896         IF(LNG.EQ.1) WRITE(LU,3000) TITCAS
02897         IF(LNG.EQ.2) WRITE(LU,3001) TITCAS
02898 3000    FORMAT(/1X,'SORTIE DE LECDON. TITRE DE L''ETUDE :',/,1X,A72,/)
02899 3001    FORMAT(/1X,'EXITING LECDON. NAME OF THE STUDY:',/,1X,A72,/)
02900       ENDIF
02901 !
02902 !-----------------------------------------------------------------------
02903 !
02904       RETURN
02905 9000  CONTINUE
02906       IF(LNG.EQ.1)WRITE(LU,9001)NOM_CAS_WAQ,NOM_DIC_WAQ
02907       IF(LNG.EQ.2)WRITE(LU,9002)NOM_CAS_WAQ,NOM_DIC_WAQ
02908 9001  FORMAT(/1X,'ERREUR DANS L OUVERTURE DU FICHIER WAQ OU DU DICO :',
02909      &       /,1X,A172,1X/A172)
02910 9002  FORMAT(/1X,'PROBLEM IN OPENING WAQ STEERING FILE OR DICO :',
02911      &       /,1X,A172,1X/A172)
02912       CALL PLANTE(1)
02913       STOP
02914       END

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