leclim.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\utils\bief\leclim.f
00002 !
00068                      SUBROUTINE LECLIM
00069 !                    *****************
00070 !
00071      &(LIHBOR,LIUBOR,LIVBOR,LITBOR,HBOR,UBOR,VBOR,TBOR,
00072      & CHBORD,ATBOR,BTBOR,NPTFR,STDGEO,TRAC,NLIM,
00073      & KENT,KENTU,KSORT,KADH,KLOG,KINC,NUMLIQ,MESH,BOUNDARY_COLOUR,
00074      & NPTFR2)
00075 !
00076 !***********************************************************************
00077 ! BIEF   V6P1                                   21/08/2010
00078 !***********************************************************************
00079 !
00080 !
00081 !
00082 !
00083 !
00084 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00085 !| ATBOR,BTBOR    |<--| THERMAL EXCHANGE COEFFICIENTS.
00086 !| BOUNDARY_COLOUR|<--| COLOUR OF BOUNDARY POINT (DEFAULT: ITS RANK)
00087 !| CHBORD         |<--| FRICTION COEFFICIENT AT BOUNDARY
00088 !| HBOR           |<--| PRESCRIBED BOUNDARY CONDITION ON DEPTH
00089 !| KADH           |-->| CONVENTION FOR NO SLIP BOUNDARY CONDITION
00090 !| KENT           |-->| CONVENTION FOR LIQUID INPUT WITH PRESCRIBED VALUE
00091 !| KENTU          |-->| CONVENTION FOR LIQUID INPUT WITH PRESCRIBED VELOCITY
00092 !| KINC           |-->| CONVENTION FOR INCIDENT WAVE BOUNDARY CONDITION
00093 !| KLOG           |-->| CONVENTION FOR SOLID BOUNDARY
00094 !| KSORT          |-->| CONVENTION FOR FREE OUTPUT
00095 !| LIHBOR         |-->| TYPE OF BOUNDARY CONDITIONS ON DEPTH
00096 !| LITBOR         |-->| PHYSICAL BOUNDARY CONDITIONS FOR TRACERS
00097 !| LIUBOR         |-->| TYPE OF BOUNDARY CONDITIONS ON U
00098 !| LIVBOR         |-->| TYPE OF BOUNDARY CONDITIONS ON V
00099 !| MESH           |-->| MESH STRUCTURE
00100 !| NLIM           |-->| LOGICAL UNIT OF BOUNDARY CONDITIONS FILE
00101 !| NPTFR          |-->| NUMBER OF BOUNDARY POINTS
00102 !| NPTFR2         |-->| NUMBER OF QUADRATIC BOUNDARY POINTS
00103 !| NUMLIQ         |-->| LIQUID BOUNDARY NUMBER OF BOUNDARY POINTS
00104 !| STDGEO         |-->| STANDARD OF GEOMETRY FILE.
00105 !| TBOR           |<--| PRESCRIBED BOUNDARY CONDITION ON TRACER
00106 !| TRAC           |-->| IF YES, THERE ARE TRACERS
00107 !| UBOR           |<--| PRESCRIBED BOUNDARY CONDITION ON VELOCITY U
00108 !| VBOR           |<--| PRESCRIBED BOUNDARY CONDITION ON VELOCITY V
00109 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00110 !
00111       USE BIEF, EX_LECLIM => LECLIM
00112 !
00113       IMPLICIT NONE
00114       INTEGER LNG,LU
00115       COMMON/INFO/LNG,LU
00116 !
00117 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00118 !
00119       INTEGER, INTENT(IN)    :: NLIM,KENT,KSORT,KADH,KLOG,KINC,KENTU
00120       INTEGER, INTENT(IN)    :: STDGEO,NPTFR
00121       LOGICAL, INTENT(IN)    :: TRAC
00122       INTEGER, INTENT(INOUT) :: NUMLIQ(*)
00123       INTEGER, INTENT(INOUT) :: LIUBOR(NPTFR),LIVBOR(NPTFR)
00124       INTEGER, INTENT(INOUT) :: LIHBOR(NPTFR),LITBOR(NPTFR)
00125       DOUBLE PRECISION,  INTENT(INOUT) :: UBOR(*),VBOR(*)
00126       DOUBLE PRECISION,  INTENT(INOUT) :: HBOR(NPTFR),CHBORD(NPTFR)
00127       DOUBLE PRECISION,  INTENT(INOUT) :: TBOR(NPTFR),ATBOR(NPTFR)
00128       DOUBLE PRECISION,  INTENT(INOUT) :: BTBOR(NPTFR)
00129       TYPE(BIEF_MESH),   INTENT(INOUT) :: MESH
00130       INTEGER, OPTIONAL, INTENT(INOUT) :: BOUNDARY_COLOUR(NPTFR)
00131       INTEGER, OPTIONAL, INTENT(IN)    :: NPTFR2
00132 !
00133 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00134 !
00135       INTEGER PTIR,I,IBID,KFICH,K,NLIG,IF1,IF2,IF3,IF4,IF5,IF6,IF7
00136       INTEGER DIMUBOR
00137 !
00138       DOUBLE PRECISION BID
00139 !
00140 !-----------------------------------------------------------------------
00141 !
00142       DIMUBOR=NPTFR
00143       IF(PRESENT(NPTFR2)) DIMUBOR=NPTFR2
00144 !
00145 !-----------------------------------------------------------------------
00146 !
00147       REWIND NLIM
00148 !
00149 !-----------------------------------------------------------------------
00150 !
00151 ! READS EACH LINE OF FILE DYNAM
00152 !
00153 !
00154 ! 1) WITHOUT TRACER
00155 !
00156       NLIG=1
00157       IF(.NOT.TRAC) THEN
00158 !
00159         DO K=1,NPTFR
00160 !
00161         IF(STDGEO.EQ.3.AND.NCSIZE.LE.1) THEN
00162 !
00163         READ(NLIM,*,ERR=900) LIHBOR(K),LIUBOR(K),LIVBOR(K),
00164      &                       HBOR(K)  ,UBOR(K)  ,VBOR(K)  ,
00165      &                       CHBORD(K) ,IBID,BID,BID,BID,
00166      &                       MESH%NBOR%I(K)  ,KFICH
00167         NLIG=NLIG+1
00168 !
00169         ELSEIF(STDGEO.EQ.3.AND.NCSIZE.GT.1) THEN
00170 !
00171         READ(NLIM,*,ERR=900) LIHBOR(K),LIUBOR(K),LIVBOR(K),
00172      &                       HBOR(K)  ,UBOR(K)  ,VBOR(K)  ,
00173      &                       CHBORD(K),IBID,BID,BID,BID,
00174      &                       MESH%NBOR%I(K),KFICH,
00175      &                       MESH%ISEG%I(K),
00176      &                       MESH%XSEG%R(K),MESH%YSEG%R(K),
00177      &                       NUMLIQ(K)
00178         NLIG=NLIG+1
00179 !
00180         ELSE
00181           IF(LNG.EQ.1) WRITE(LU,21) STDGEO
00182           IF(LNG.EQ.2) WRITE(LU,22) STDGEO
00183 21        FORMAT(1X,'LECLIM : STANDARD DU FICHIER DE GEOMETRIE : ',1I6,/
00184      &           1X,'         CETTE VALEUR EST INCONNUE ET       ',    /
00185      &           1X,'         LE FICHIER DES CONDITIONS LIMITES  ',    /
00186      &           1X,'         EN DEPEND |')
00187 22        FORMAT(1X,'LECLIM : GEOMETRY FILE STANDARD : ',I6   ,/
00188      &           1X,'         UNKNOWN PARAMETER AND BOUNDARY ',/
00189      &           1X,'         CONDITIONS FILE DEPENDS ON IT !')
00190           CALL PLANTE(1)
00191           STOP
00192         ENDIF
00193 !
00194         IF(PRESENT(BOUNDARY_COLOUR)) THEN
00195           BOUNDARY_COLOUR(K)=KFICH
00196         ENDIF
00197 !
00198         ENDDO
00199 !
00200       ENDIF
00201 !
00202 ! 2) WITH TRACER
00203 !
00204       IF(TRAC) THEN
00205 !
00206         DO K=1,NPTFR
00207 !
00208         IF(STDGEO.EQ.3.AND.NCSIZE.LE.1) THEN
00209 !
00210         READ(NLIM,*,ERR=900) LIHBOR(K),LIUBOR(K),LIVBOR(K),
00211      &                       HBOR(K)  ,UBOR(K)  ,VBOR(K),
00212      &                       CHBORD(K) ,LITBOR(K),TBOR(K),
00213      &                       ATBOR(K),BTBOR(K),
00214      &                       MESH%NBOR%I(K),KFICH
00215         NLIG=NLIG+1
00216 !
00217         ELSEIF(STDGEO.EQ.3.AND.NCSIZE.GT.1) THEN
00218 !
00219         READ(NLIM,*,ERR=900) LIHBOR(K),LIUBOR(K),LIVBOR(K),
00220      &                       HBOR(K)  ,UBOR(K)  ,VBOR(K),
00221      &                       CHBORD(K) ,LITBOR(K),TBOR(K),
00222      &                       ATBOR(K) ,BTBOR(K) ,MESH%NBOR%I(K),
00223      &                       KFICH,
00224      &                       MESH%ISEG%I(K),
00225      &                       MESH%XSEG%R(K),MESH%YSEG%R(K),
00226      &                       NUMLIQ(K)
00227         NLIG=NLIG+1
00228 !
00229         ELSE
00230           IF(LNG.EQ.1) WRITE(LU,21) STDGEO
00231           IF(LNG.EQ.2) WRITE(LU,22) STDGEO
00232           CALL PLANTE(1)
00233           STOP
00234         ENDIF
00235 !
00236         IF(PRESENT(BOUNDARY_COLOUR)) THEN
00237           BOUNDARY_COLOUR(K)=KFICH
00238         ENDIF
00239 !
00240         ENDDO
00241 !
00242       ENDIF
00243 !
00244 !-----------------------------------------------------------------------
00245 !
00246 !  CHECKS, CORRECTS AND STORES:
00247 !
00248       IF(NLIG.NE.NPTFR+1) THEN
00249         IF(LNG.EQ.1) WRITE(LU,23) NLIG-1,NPTFR
00250         IF(LNG.EQ.2) WRITE(LU,24) NLIG-1,NPTFR
00251 23      FORMAT(1X,'LECLIM : ERREUR DANS LE FICHIER DES',
00252      &       /,1X,'         CONDITIONS AUX LIMITES, ',1I5,' LIGNES',
00253      &       /,1X,'         AU LIEU DE ',I5)
00254 24      FORMAT(1X,'LECLIM: ERROR IN THE BOUNDARY CONDITIONS FILE,',
00255      &       /,9X,1I5,' LINES INSTEAD OF ',I5,' REQUESTED')
00256         CALL PLANTE(1)
00257         STOP
00258       ENDIF
00259 !
00260       DO K=1,NPTFR
00261 !
00262 !     CHECKING FRICTION COEFFICIENT
00263 !
00264 !     IF(CHBORD(K).LT.0.D0) THEN
00265 !        IF(LNG.EQ.1) WRITE(LU,48) K
00266 !        IF(LNG.EQ.2) WRITE(LU,49) K
00267 !48      FORMAT(1X,'LECLIM : CHBORD DOIT ETRE POSITIF OU NUL',/,1X,
00268 !     &            '         IL VAUT ',F10.3,' AU POINT DE BORD ',1I6)
00269 !49      FORMAT(1X,'LECLIM : CHBORD MUST BE POSITIVE OR ZERO',/,1X,
00270 !     &            '         IT IS ',F10.3,' AT BOUNDARY POINT ',1I6)
00271 !        CALL PLANTE(1)
00272 !        STOP
00273 !      ENDIF
00274 !
00275 !     ADHERENCE FOR H CHANGED AT THE WALL
00276 !
00277       IF(LIHBOR(K).EQ.KADH) THEN
00278         LIHBOR(K)=KLOG
00279         IF(LNG.EQ.1) WRITE(LU,51) K
00280         IF(LNG.EQ.2) WRITE(LU,52) K
00281 51      FORMAT(1X,'LECLIM : ADHERENCE SUR LA HAUTEUR AU POINT ',1I6,
00282      &            '         CHANGEE EN CONDITION DE PAROI')
00283 52      FORMAT(1X,'LECLIM : ADHERENCE SUR LA HAUTEUR AU POINT ',1I6,
00284      &            '         CHANGEE EN CONDITION DE PAROI')
00285       ENDIF
00286 !
00287 !     INCIDENT WAVE FOR H TREATED LIKE A FREE EXIT
00288 !
00289       IF(LIHBOR(K).EQ.KINC) THEN
00290         LIHBOR(K)=KSORT
00291       ENDIF
00292 !
00293 !     CANCELS DIRICHLET VALUES WHEN THE POINT IS NOT DIRICHLET
00294 !     FOR POINTS WITH ADHERENCE, NEEDS UBOR OR VBOR =0
00295 !
00296 !     IF(LIHBOR(K).NE.KENT) HBOR(K)=0.D0
00297       IF(LIUBOR(K).NE.KENT.AND.LIUBOR(K).NE.KENTU) UBOR(K)=0.D0
00298       IF(LIVBOR(K).NE.KENT.AND.LIVBOR(K).NE.KENTU) VBOR(K)=0.D0
00299 !
00300 !     BACKS UP UBOR AND VBOR ON THEIR SECOND DIMENSION
00301 !
00302       UBOR(K+DIMUBOR) = UBOR(K)
00303       VBOR(K+DIMUBOR) = VBOR(K)
00304 !
00305       ENDDO ! K
00306 !
00307       IF(TRAC) THEN
00308         DO K=1,NPTFR
00309           IF(LITBOR(K).NE.KENT) TBOR(K)=0.D0
00310         ENDDO
00311       ENDIF
00312 !
00313 !-----------------------------------------------------------------------
00314 !
00315 !  PARALLEL MODE : READS NPTIR AND NACHB
00316 !
00317 !  NOTE: NACHB IS HERE IN LOCAL NUMBERING OF POINTS
00318 !
00319       IF(NCSIZE.GT.1) THEN
00320         READ(NLIM,*,ERR=900) PTIR
00321         NLIG=NLIG+1
00322         IF(NPTIR.NE.PTIR) THEN
00323           IF(LNG.EQ.1) WRITE(LU,151) NPTIR,PTIR
00324           IF(LNG.EQ.2) WRITE(LU,152) NPTIR,PTIR
00325 151       FORMAT(1X,'LECLIM : INCOHERENCE ENTRE GEOMETRIE ',/,1X,
00326      &              '         ET CONDITIONS AUX LIMITES'   ,/,1X,I6,
00327      &    ' POINTS INTERFACE DANS LA GEOMETRIE',/,1X,I6,
00328      &    ' POINTS INTERFACE DANS LE FICHIER CONLIM')
00329 152       FORMAT(1X,'LECLIM : DIFFERENCE BETWEEN GEOMETRY ',/,1X,
00330      &              '         AND BOUNDARY CONDITIONS'   ,/,1X,I6,
00331      &    ' INTERFACE POINTS IN GEOMETRY',/,1X,I6,
00332      &    ' INTERFACE POINTS IN CONLIM FILE')
00333         ENDIF
00334 !       NACHB(NBMAXNSHARE,NPTIR), HERE NACHB(I,K)
00335 !       HERE NACHB IS IN LOCAL NUMBERING
00336         DO K=1,NPTIR
00337           READ(NLIM,*,ERR=900) (MESH%NACHB%I((K-1)*NBMAXNSHARE+I),
00338      &                          I=1,NBMAXNSHARE)
00339           NLIG=NLIG+1
00340         ENDDO
00341 !
00342 !      JAJ //// READS THE NEIGHBOURHOODS FOR HALO CELLS ALONG THE INTERFACES
00343 !      FILLING PATTERN: IFAPAR(1:7,K), K=1:NHALO
00344 !                       -> NHALO: NUMBER OF HALO CELLS IN THIS PARTITION
00345 !
00346 !      IFAPAR(1,K)   : HALO ELEMENT -LOCAL- NUMBER IN THIS PARTITION
00347 !      IFAPAR(2:4,K) : PROCESSOR NUMBERS BEHIND THE 3 ELEMENT EDGES
00348 !                      NUMBER FROM 0 TO NCSIZE-1
00349 !      IFAPAR(5:7,K) : -LOCAL- ELEMENT NUMBERS BEHIND THE 3 EDGES
00350 !                      IN THE NUMBERING OF PARTITIONS THEY BELONG TO
00351 !      ACTUALLY, NOT ALL OF THAT IS REQUIRED AND CAN BE OPTIMISED
00352 !      AFTER THE DEVELOPMENT STAGE IS OVER
00353 !
00354 !      IN TELEMAC, IFAPAR IS REORGANISED IN IFAPAR(6,NELEM2)
00355 !                  AND INITIALISED TO 0 IN ALMESH
00356 !
00357 !
00358         READ(NLIM,*,ERR=901) NHALO
00359         IF(NHALO.GT.2*NPTIR) THEN ! SEE BIEF LIB, SUBROUTINE ALMESH
00360           WRITE(LU,*) ' => NHALO>2*NPTIR DETECTED IN BC FILE'
00361           CALL PLANTE(1)
00362           STOP
00363         ENDIF
00364         DO K=1,NHALO
00365 !         READ(NLIM,*,ERR=901) (MESH%IFAPAR%I(7*(K-1)+I),I=1,7)
00366           READ(NLIM,*,ERR=901) IF1,IF2,IF3,IF4,IF5,IF6,IF7
00367 !
00368 !         CORRECTS A BUG (IN IFAPAR THERE IS A CONFUSION BETWEEN PROCESSOR 0
00369 !                         AND LIQUID BOUNDARY BUT
00370 !                         IN CASE OF LIQUID BOUNDARY, THE ELEMENT BEHIND
00371 !                         IS GIVEN AS 0, SO BOTH CASES MAY BE DISTINGUISHED
00372 !                         HERE ALL BOUNDARIES (LIQUID OR SOLID) ARE SET AT -1
00373 !
00374           IF(IF5.EQ.0) IF2=-1
00375           IF(IF6.EQ.0) IF3=-1
00376           IF(IF7.EQ.0) IF4=-1
00377 !
00378           MESH%IFAPAR%I(6*(IF1-1)+1)=IF2
00379           MESH%IFAPAR%I(6*(IF1-1)+2)=IF3
00380           MESH%IFAPAR%I(6*(IF1-1)+3)=IF4
00381           MESH%IFAPAR%I(6*(IF1-1)+4)=IF5
00382           MESH%IFAPAR%I(6*(IF1-1)+5)=IF6
00383           MESH%IFAPAR%I(6*(IF1-1)+6)=IF7
00384         ENDDO
00385 !
00386       ENDIF
00387 !
00388       GO TO 1000
00389 !
00390 !-----------------------------------------------------------------------
00391 !
00392 900   CONTINUE
00393 !
00394 !     READS ERRORS
00395 !
00396       IF(LNG.EQ.1) WRITE(LU,251) NLIG
00397       IF(LNG.EQ.2) WRITE(LU,252) NLIG
00398 251   FORMAT(1X,'LECLIM : ERREUR DE LECTURE DANS LE FICHIER',/,1X,
00399      &          '         DES CONDITIONS AUX LIMITES'   ,/,1X,
00400      &          '         A LA LIGNE '   ,I6,//,1X,
00401      &          'CAUSES POSSIBLES :',//,1X,
00402      &          '1) RETOURS CHARRIOTS WINDOWS SUR UNIX ?',/,1X,
00403      &          '2) INFORMATIONS POUR LE PARALLELISME MANQUANTES ?')
00404 252   FORMAT(1X,'LECLIM : READING ERROR IN THE BOUNDARY',/,1X,
00405      &          '         CONDITIONS FILE'   ,/,1X,
00406      &          '         AT LINE '   ,I6,//,1X,
00407      &          'POSSIBLE CAUSES:',//,1X,
00408      &          '1) WINDOWS CARRIAGE RETURN ON UNIX ?',/,1X,
00409      &          '2) INFORMATIONS ON PARALLELISM MISSING ?')
00410       CALL PLANTE(1)
00411       STOP
00412 !JAJ //// BE PRECISE IN THE CASE OF THE BC FILE APPENDIX
00413 901   CONTINUE
00414       WRITE (LU,*) 'LECLIM: ',
00415      &             'ERROR IN READING IFAPAR IN THE BC CONDITIONS FILE'
00416       CALL PLANTE(1)
00417       STOP
00418 !
00419 !-----------------------------------------------------------------------
00420 !
00421 1000  CONTINUE
00422 !
00423 !-----------------------------------------------------------------------
00424 !
00425       RETURN
00426       END

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