dismoy.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\artemis\dismoy.f
00002 !
00062                      SUBROUTINE DISMOY
00063 !                    *****************
00064 !
00065      &(NPOIN,NELEM,X,Y,IKLE,K,LISHHO)
00066 !
00067 !***********************************************************************
00068 ! ARTEMIS   V6P1                                   21/08/2010
00069 !***********************************************************************
00070 !
00071 !
00072 !
00073 !
00074 !
00075 !
00076 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00077 !| IKLE           |---| CONNECTIVITY TABLE
00078 !| K              |-->| WAVE NUMBER
00079 !| LISHHO         |<--| NUMBER OF SMOOTHING FOR HHO
00080 !| NELEM          |-->| NUMBER OF ELEMENTS
00081 !| NPOIN          |-->| NUMBER OF POINT
00082 !| X,Y            |-->| MESH COORDINATES
00083 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00084 !
00085       USE INTERFACE_ARTEMIS, EX_DISMOY => DISMOY
00086 !
00087       IMPLICIT NONE
00088       INTEGER LNG,LU
00089       COMMON/INFO/LNG,LU
00090 !
00091 !
00092 ! VARIABLES FOR THE COMPUTATION OF AVERAGE DISTANCES
00093 !
00094       INTEGER NG, ISOM, IELEM
00095       DOUBLE PRECISION SOM, D1, D2, DMOY, PI, SOMD
00096 !
00097 !
00098       INTEGER NPOIN,NELEM,LISHHO
00099       INTEGER IKLE(NELEM,*)
00100 !
00101       DOUBLE PRECISION X(NPOIN),Y(NPOIN),K(NPOIN)
00102 !
00103 !-----------------------------------------------------------------------
00104 !
00105       PI = 3.1415926535897932384626433D0
00106 !
00107 !     COMPUTES THE AVERAGE DISTANCE BETWEEN A NODE AND ITS NEIGHBOURS
00108 !     -----------------------------------------------------------
00109 !
00110       SOMD = 0.D0
00111       DO NG=1,NPOIN
00112         ISOM = 0
00113         SOM = 0.D0
00114 !
00115         DO IELEM=1,NELEM
00116 !
00117           IF (IKLE(IELEM,1).EQ.NG) THEN
00118 !         --                       ---
00119 !
00120 !           PT 1 IS COMMON, COMPUTES THE DISTANCE TO PTS 2 AND 3
00121             D1 = SQRT ( (X(NG)-X(IKLE(IELEM,2))) **2.D0 +
00122      &                  (Y(NG)-Y(IKLE(IELEM,2))) **2.D0 )
00123             D2 = SQRT ( (X(NG)-X(IKLE(IELEM,3))) **2.D0 +
00124      &                  (Y(NG)-Y(IKLE(IELEM,3))) **2.D0 )
00125             SOM = SOM + D1 + D2
00126             ISOM = ISOM + 2
00127 !
00128           ELSEIF (IKLE(IELEM,2).EQ.NG) THEN
00129 !         ------                       ----
00130 !
00131 !           PT 2 IS COMMON, COMPUTES THE DISTANCE TO PTS 1 AND 3
00132             D1 = SQRT ( (X(NG)-X(IKLE(IELEM,1))) **2.D0 +
00133      &                  (Y(NG)-Y(IKLE(IELEM,1))) **2.D0 )
00134             D2 = SQRT ( (X(NG)-X(IKLE(IELEM,3))) **2.D0 +
00135      &                  (Y(NG)-Y(IKLE(IELEM,3))) **2.D0 )
00136             SOM = SOM + D1 + D2
00137             ISOM = ISOM + 2
00138 !
00139           ELSEIF (IKLE(IELEM,3).EQ.NG) THEN
00140 !         ------                       ----
00141 !
00142 !           PT 3 IS COMMON, COMPUTES THE DISTANCE TO PTS 1 AND 2
00143             D1 = SQRT ( (X(NG)-X(IKLE(IELEM,1))) **2.D0 +
00144      &                  (Y(NG)-Y(IKLE(IELEM,1))) **2.D0 )
00145             D2 = SQRT ( (X(NG)-X(IKLE(IELEM,2))) **2.D0 +
00146      &                  (Y(NG)-Y(IKLE(IELEM,2))) **2.D0 )
00147             SOM = SOM + D1 + D2
00148             ISOM = ISOM + 2
00149 !
00150           ENDIF
00151 !         -----
00152 !
00153         ENDDO ! IELEM
00154 !
00155         DMOY = SOM / FLOAT(ISOM)
00156         SOMD = SOMD + (PI / (K(NG)*DMOY))
00157 !
00158       ENDDO ! NG
00159 !
00160 !     ESTIMATES THE NUMBER OF SMOOTHINGS FROM THE AVERAGE DISTANCE
00161 !     -------------------------------------------------------------------
00162 !
00163       LISHHO = INT((SOMD/FLOAT(NPOIN))) * 10
00164 !
00165       RETURN
00166       END

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