derlag.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\utils\bief\derlag.f
00002 !
00074                      SUBROUTINE DERLAG
00075 !                    *****************
00076 !
00077      &(U,V,DT,X,Y,LT,IELM,IELMU,NDP,NPOIN,NELEM,NELMAX,XLAG,YLAG,DX,DY,
00078      & NSP,SHPLAG,DEBLAG,FINLAG,ELTLAG,NLAG,RESUX,RESUY,ISPDONE,MESH)
00079 !
00080 !***********************************************************************
00081 ! BIEF   V6P2                                   21/08/2010
00082 !***********************************************************************
00083 !
00084 !
00085 !
00086 !
00087 !
00088 !
00089 !
00090 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00091 !| DEBLAG         |-->| TIME STEP FOR STARTING THE COMPUTATION
00092 !| DT             |-->| TIME STEP
00093 !| DX             |<->| WORK ARRAY
00094 !| DY             |<->| WORK ARRAY
00095 !| ELTLAG         |<->| ELEMENT NUMBERS OF FLOATS
00096 !| FINLAG         |-->| TIME STEP FOR ENDING THE COMPUTATION
00097 !| IELM           |-->| TYPE OF ELEMENT IN THE MESH
00098 !| IELMU          |-->| TYPE OF ELEMENT FOR THE VELOCITIES
00099 !| LT             |-->| TIME STEP NUMBER.
00100 !| MASKEL         |-->| MASKING OF ELEMENTS.
00101 !|                |   | =1. : NORMAL   =0. : MASKED ELEMENT
00102 !| MASKPT         |-->| MASKING PER POINT.
00103 !| MESH           |-->| MESH STRUCTURE
00104 !| NDP            |-->| NUMBER OF POINTS PER ELEMENT
00105 !| NELEM          |-->| NUMBER OF ELEMENTS.
00106 !| NELMAX         |-->| MAXIMUM NUMBER OF ELEMENTS.
00107 !| NLAG           |-->| NOMBER OF FLOATS.
00108 !| NPOIN          |-->| NUMBER OF POINTS
00109 !| NSP            |-->| NUMBER OF SUB-STEPS IN THE RUNGE-KUTTA METHOD
00110 !| RESUX          |<--| ARRAY WITH SUCCESSIVE ABSCISSAE OF FLOATS
00111 !| RESUY          |<--| ARRAY WITH SUCCESSIVE ORDINATES OF FLOATS
00112 !| SHPLAG         |<->| BARYCENTRIC COORDINATES OF FLOATS
00113 !|                |   | IN THEIR ELEMENTS.
00114 !| T8             |-->| BLOCK OF WORK BIEF_OBJ STRUCTURES.
00115 !| U              |-->| X-COMPONENT OF VELOCITY
00116 !| V              |-->| Y-COMPONENT OF VELOCITY
00117 !| X              |-->| ABSCISSAE OF POINTS IN THE MESH
00118 !| XLAG           |<->| INSTANTANEOUS X POSITIONS OF FLOATS
00119 !| Y              |-->| ORDINATES OF POINTS IN THE MESH
00120 !| YLAG           |<->| INSTANTANEOUS Y POSITIONS OF FLOATS
00121 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00122 !
00123       USE BIEF, EX_DERLAG => DERLAG
00124       USE STREAMLINE
00125 !
00126       IMPLICIT NONE
00127       INTEGER LNG,LU
00128       COMMON/INFO/LNG,LU
00129 !
00130 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00131 !
00132       INTEGER         , INTENT(IN)    :: NPOIN,LT,IELM,NDP,NELEM,NLAG
00133       INTEGER         , INTENT(IN)    :: NELMAX,IELMU
00134       DOUBLE PRECISION, INTENT(IN)    :: U(NPOIN),V(NPOIN),DT
00135       DOUBLE PRECISION, INTENT(IN)    :: X(NPOIN),Y(NPOIN)
00136       DOUBLE PRECISION, INTENT(INOUT) :: XLAG(NPOIN,NLAG)
00137       DOUBLE PRECISION, INTENT(INOUT) :: YLAG(NPOIN,NLAG)
00138       INTEGER         , INTENT(INOUT) :: DEBLAG(NLAG),FINLAG(NLAG)
00139       INTEGER         , INTENT(INOUT) :: ELTLAG(NPOIN,NLAG)
00140       INTEGER         , INTENT(INOUT) :: ISPDONE(NPOIN)
00141       DOUBLE PRECISION, INTENT(INOUT) :: DX(NPOIN),DY(NPOIN)
00142       INTEGER         , INTENT(INOUT) :: NSP(NPOIN)
00143       DOUBLE PRECISION, INTENT(INOUT) :: RESUX(NPOIN),RESUY(NPOIN)
00144       DOUBLE PRECISION, INTENT(INOUT) :: SHPLAG(NDP,NPOIN,NLAG)
00145       TYPE(BIEF_MESH) , INTENT(INOUT) :: MESH
00146 !
00147 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00148 !
00149       INTEGER ILAG,JLAG,LTT,IPOIN,ETA(1),SENS,NPLAN,FRE(1),FREBUF(1)
00150       TYPE(BIEF_OBJ) :: SVOID
00151 !
00152       DOUBLE PRECISION ZSTAR(1),ZCONV(1),SHZ(1),Z(1),C,SHF(1)
00153       DOUBLE PRECISION SHPBUF(3,1),SHZBUF(1)
00154 !
00155 !-----------------------------------------------------------------------
00156 !
00157       IF(NCSIZE.GT.1) THEN
00158         IF(LNG.EQ.1) THEN
00159         WRITE(LU,*) 'DERIVES LAGRANGIENNES NON PROGRAMMEES EN PARALLELE'
00160         ENDIF
00161         IF(LNG.EQ.2) THEN
00162         WRITE(LU,*) 'LAGRANGIAN DRIFTS NOT PROGRAMMED IN PARALLEL'
00163         ENDIF
00164         CALL PLANTE(1)
00165         STOP
00166       ENDIF
00167 !
00168 !-----------------------------------------------------------------------
00169 !
00170 !     2D HERE
00171 !
00172       NPLAN=1
00173 !
00174 !     FORWARD CHARACTERISTICS
00175 !
00176       SENS=1
00177 !
00178       DO ILAG=1,NLAG
00179 !
00180         IF(LT.EQ.DEBLAG(ILAG)) THEN
00181 !
00182 !-----------------------------------------------------------------------
00183 !
00184 !   - SETS THE BARYCENTRIC COORDINATES IN THE MESH , AT THE START
00185 !     OF COMPUTATION FOR EACH FLOAT
00186 !
00187 !-----------------------------------------------------------------------
00188 !
00189           IF(IELM.EQ.11) THEN
00190 !
00191 !  P1 TRIANGLES
00192 !  ============
00193 !
00194 !      FILLS THE SHP AND ELT (OPTIMISED)
00195 !
00196             CALL GTSH11(SHPLAG(1,1,ILAG),ELTLAG(1,ILAG),MESH%IKLE%I,
00197      &                  MESH%ELTCAR%I,
00198      &                  NPOIN,NELEM,NELMAX,1,.FALSE.,.FALSE.)
00199 !                                          1=NSEG, WRONG VALUE, NOT USED
00200 !
00201           ELSE
00202 !
00203             IF(LNG.EQ.1) THEN
00204               WRITE(LU,*) IELM,' : ELEMENT NON PREVU DANS DERLAG'
00205             ENDIF
00206             IF(LNG.EQ.2) THEN
00207               WRITE(LU,*) IELM,': ELEMENT NOT IMPLEMENTED IN DERLAG'
00208             ENDIF
00209             CALL PLANTE(1)
00210             STOP
00211 !
00212           ENDIF
00213 !
00214           CALL OV( 'X=Y     ' , XLAG(1,ILAG) , X , Z , C , NPOIN )
00215           CALL OV( 'X=Y     ' , YLAG(1,ILAG) , Y , Z , C , NPOIN )
00216 !
00217         ELSEIF(LT.GT.DEBLAG(ILAG).AND.LT.LE.FINLAG(ILAG)) THEN
00218 !
00219 !-----------------------------------------------------------------------
00220 !
00221 !     COMPUTES THE SUCCESSIVE POSITIONS OF THIS FLOAT
00222 !     (SUBSEQUENT TIMESTEPS)
00223 !
00224 !-----------------------------------------------------------------------
00225 !
00226           CALL SCARACT(SVOID,SVOID,U,V,V,V,X,Y,
00227      &                 ZSTAR,ZSTAR,XLAG(1,ILAG),YLAG(1,ILAG),
00228      &                 ZCONV,ZCONV,
00229      &                 DX,DY,DY,DY,Z,SHPLAG(1,1,ILAG),SHZ,SHF,
00230      &                 MESH%SURDET%R,
00231      &                 DT,MESH%IKLE%I,MESH%IFABOR%I,ELTLAG(1,ILAG),
00232      &                 ETA,FRE,NSP,ISPDONE,IELM,IELMU,NELEM,NELMAX,
00233      &                 0,NPOIN,NPOIN,NDP,NPLAN,1,
00234      &                 MESH,NPOIN,BIEF_NBPTS(IELMU,MESH),SENS,
00235 !                      PROVISIONAL, THIS WILL NOT WORK IN PARALLEL
00236      &                 SHPBUF,SHZBUF,SHZBUF,FREBUF,1,
00237      &                 .TRUE.)
00238 !                       POST : DATA KEPT FOR A POSTERIORI INTERPOLATION
00239 !                              HERE FOR NEXT STEP
00240 !
00241 !-----------------------------------------------------------------------
00242 !
00243 !       STOPPING THE FLOATS THAT LEFT THE DOMAIN
00244 !
00245 !-----------------------------------------------------------------------
00246 !
00247           DO IPOIN=1,NPOIN
00248             IF(ELTLAG(IPOIN,ILAG).LT.0) THEN
00249 !             THIS POINT WILL NO LONGER BE TREATED
00250               ELTLAG(IPOIN,ILAG) = 0
00251 !             NEXT TWO LINES IN PREVIOUS VERSIONS
00252 !             BUT WHY NOT KEEPING THE LAST POSITION AT THE EXIT?
00253 !             XLAG(IPOIN,ILAG) = X(IPOIN)
00254 !             YLAG(IPOIN,ILAG) = Y(IPOIN)
00255             ENDIF
00256           ENDDO
00257 !
00258 !-----------------------------------------------------------------------
00259 !
00260         ENDIF
00261 !
00262       ENDDO ! ILAG
00263 !
00264 !-----------------------------------------------------------------------
00265 !
00266 !   - STORAGE FOR RESULTS OUTPUT OF THE LAST COMPUTED FLOAT
00267 !
00268 !-----------------------------------------------------------------------
00269 !
00270       CALL OV( 'X=C     ' , RESUX , Y , Z , 0.D0 , NPOIN )
00271       CALL OV( 'X=C     ' , RESUY , Y , Z , 0.D0 , NPOIN )
00272       LTT=0
00273       JLAG=1
00274       DO ILAG=1,NLAG
00275         IF(FINLAG(ILAG).GT.LTT.AND.FINLAG(ILAG).LE.LT) THEN
00276           LTT=FINLAG(ILAG)
00277           JLAG=ILAG
00278         ENDIF
00279       ENDDO
00280       IF(LTT.NE.0) THEN
00281         CALL OV( 'X=Y-Z   ' , RESUX , XLAG(1,JLAG) , X , C , NPOIN )
00282         CALL OV( 'X=Y-Z   ' , RESUY , YLAG(1,JLAG) , Y , C , NPOIN )
00283       ENDIF
00284 !
00285 !-----------------------------------------------------------------------
00286 !
00287       RETURN
00288       END

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