m_coupling_estel3d.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\telemac2d\m_coupling_estel3d.f
00002 !
00041                      MODULE M_COUPLING_ESTEL3D
00042 !                    *************************
00043 !
00044 !
00045 !***********************************************************************
00046 ! TELEMAC2D  V6P1
00047 !***********************************************************************
00048 !
00049 !
00050 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00051 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00052 !
00053       IMPLICIT NONE
00054       PRIVATE
00055       PUBLIC :: INFILTRATION_INIT
00056       PUBLIC :: INFILTRATION_FINISH
00057       PUBLIC :: INFILTRATION_FILL
00058       PUBLIC :: INFILTRATION_GET
00059       PUBLIC :: DEPTH_FILL
00060       PUBLIC :: DEPTH_GET
00061       INTEGER :: NPOIN2D
00062       LOGICAL :: DOINFILTRATION
00063       DOUBLE PRECISION, ALLOCATABLE :: FLUX_FROM_ESTEL3D(:)
00064       DOUBLE PRECISION, ALLOCATABLE :: DEPTH_FROM_T2D(:)
00065 !-----------------------------------------------------------------------
00066       CONTAINS
00067 !-----------------------------------------------------------------------
00068       SUBROUTINE INFILTRATION_INIT(NPOIN,ACTIVATE)
00069 !-----------------------------------------------------------------------
00070 ! ALLOCATES THE COUPLING ARRAYS IF REQUIRED AND FILLS THEM UP WITH ZEROS
00071 !-----------------------------------------------------------------------
00072       IMPLICIT NONE
00073 !-----------------------------------------------------------------------
00074       INTEGER, INTENT(IN) :: NPOIN
00075       LOGICAL, INTENT(IN) :: ACTIVATE
00076 !-----------------------------------------------------------------------
00077 !
00078       LOGICAL DEJA
00079       DATA DEJA/.FALSE./
00080 !
00081 !-----------------------------------------------------------------------
00082 !
00083       NPOIN2D = 1
00084       IF(ACTIVATE) THEN
00085         NPOIN2D        = NPOIN
00086         DOINFILTRATION = .TRUE.
00087       ENDIF
00088       IF(.NOT.DEJA) THEN
00089         ALLOCATE( FLUX_FROM_ESTEL3D( NPOIN2D ) )
00090         ALLOCATE( DEPTH_FROM_T2D( NPOIN2D ) )
00091         DEJA=.TRUE.
00092       ENDIF
00093       FLUX_FROM_ESTEL3D(:) = 0.D0
00094       DEPTH_FROM_T2D(:)    = 0.D0
00095 !-----------------------------------------------------------------------
00096       RETURN
00097       END SUBROUTINE INFILTRATION_INIT
00098 !
00099       SUBROUTINE INFILTRATION_FINISH()
00100 !-----------------------------------------------------------------------
00101 ! DE-ALLOCATES THE COUPLING ARRAYS
00102 !-----------------------------------------------------------------------
00103       IMPLICIT NONE
00104 !-----------------------------------------------------------------------
00105 !
00106       DEALLOCATE( FLUX_FROM_ESTEL3D )
00107       DEALLOCATE( DEPTH_FROM_T2D )
00108 !
00109 !-----------------------------------------------------------------------
00110       RETURN
00111       END SUBROUTINE INFILTRATION_FINISH
00112 !
00113       SUBROUTINE INFILTRATION_FILL(ARRAY1,ARRAY2,COEFF)
00114 !-----------------------------------------------------------------------
00115 ! FILLS THE ARRAY FLUX_FROM_ESTEL3D WITH THE VALUES FROM THE ARGUMENTS
00116 !
00117 ! THIS SUBROUTINE IS CALLED FROM ESTEL-3D
00118 !-----------------------------------------------------------------------
00119       IMPLICIT NONE
00120 !-----------------------------------------------------------------------
00121       DOUBLE PRECISION, INTENT(IN) :: ARRAY1(NPOIN2D)
00122       DOUBLE PRECISION, INTENT(IN) :: ARRAY2(NPOIN2D)
00123       DOUBLE PRECISION, INTENT(IN) :: COEFF
00124 !-----------------------------------------------------------------------
00125               FLUX_FROM_ESTEL3D(:) = COEFF       * ARRAY1(:)
00126      &                             + (1 - COEFF) * ARRAY2(:)
00127 !-----------------------------------------------------------------------
00128       RETURN
00129       END SUBROUTINE INFILTRATION_FILL
00130 !
00131       SUBROUTINE DEPTH_FILL(ARRAY_FROM_T2D)
00132 !-----------------------------------------------------------------------
00133 ! FILLS THE ARRAY DEPTH_FROM_T2D WITH THE VALUES FROM THE ARGUMENT
00134 !
00135 ! THIS SUBROUTINE IS CALLED FROM TELEMAC-2D
00136 !-----------------------------------------------------------------------
00137       IMPLICIT NONE
00138 !-----------------------------------------------------------------------
00139       DOUBLE PRECISION, INTENT(INOUT) :: ARRAY_FROM_T2D(NPOIN2D)
00140 !-----------------------------------------------------------------------
00141       DEPTH_FROM_T2D(:) = ARRAY_FROM_T2D(:)
00142 !-----------------------------------------------------------------------
00143       RETURN
00144       END SUBROUTINE DEPTH_FILL
00145 !
00146       SUBROUTINE DEPTH_GET(ARRAY_FROM_ESTEL3D)
00147 !-----------------------------------------------------------------------
00148 ! BASICALLY READS THE ARRAY DEPTH_FROM_T2D SO THAT ESTEL-3D CAN
00149 !  USE IT FOR ITS BOUNDARY CONDITIONS
00150 !
00151 ! THIS SUBROUTINE IS CALLED FROM ESTEL-3D
00152 !-----------------------------------------------------------------------
00153       IMPLICIT NONE
00154 !-----------------------------------------------------------------------
00155       DOUBLE PRECISION, INTENT(INOUT) :: ARRAY_FROM_ESTEL3D(NPOIN2D)
00156 !-----------------------------------------------------------------------
00157       ARRAY_FROM_ESTEL3D(:) = DEPTH_FROM_T2D(:)
00158 !-----------------------------------------------------------------------
00159       RETURN
00160       END SUBROUTINE DEPTH_GET
00161 !
00162       SUBROUTINE INFILTRATION_GET(SMH,UNSV2D,YASMH)
00163 !-----------------------------------------------------------------------
00164 ! ADDS THE INFILTRATION TERM TO THE SOURCE TERM SMH AND SWITCHES YASMH TO
00165 ! TRUE. NOTE THAT A MASS VECTOR IS REQUIRED AS ARGUMENT BECAUSE THE FLUX
00166 ! CALCULATED WITHIN ESTEL-3D IS MULTIPLIED BY A MASS VECTOR AND THE
00167 ! DIVISION IS EASIER TO DO FROM WITHIN TELEMAC-2D FOR MESH REASONS.
00168 !
00169 ! THIS SUBROUTINE IS CALLED FROM TELEMAC-2D
00170 !-----------------------------------------------------------------------
00171       IMPLICIT NONE
00172 !-----------------------------------------------------------------------
00173       DOUBLE PRECISION, INTENT(INOUT) :: SMH(NPOIN2D)
00174       DOUBLE PRECISION, INTENT(IN)    :: UNSV2D(NPOIN2D)
00175       LOGICAL, INTENT(INOUT)          :: YASMH
00176 !-----------------------------------------------------------------------
00177       IF(DOINFILTRATION) THEN
00178         YASMH  = .TRUE.
00179         SMH(:) = SMH(:) + FLUX_FROM_ESTEL3D(:)*UNSV2D(:)
00180       ENDIF
00181 !-----------------------------------------------------------------------
00182       RETURN
00183       END SUBROUTINE INFILTRATION_GET
00184 !
00185 !-----------------------------------------------------------------------
00186       END MODULE M_COUPLING_ESTEL3D

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