dredgesim_interface.F

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\sisyphe\dredgesim_interface.F
00002 !
00070                         SUBROUTINE DREDGESIM_INTERFACE
00071 !                       ******************************
00072 !
00073      &(OPTION)
00074 !
00075 !***********************************************************************
00076 ! SISYPHE VERSION 6.0      02/02/2009 J-M HERVOUET (LNHE) 01 30 87 80 18
00077 !
00078 ! COPYRIGHT EDF
00079 !***********************************************************************
00080 !
00081 !  FUNCTION: THIS IS THE INTERFACE TO DREDGESIM, CONTAINING ALL
00082 !            DEPENDENCIES TO DREDGESIM LIBRARIES
00083 !
00084 !  FOR REAL INTERFACING WITH DREDGESIM, COMMENTS "!" MUST BE REMOVED
00085 !
00086 !-----------------------------------------------------------------------
00087 !                             ARGUMENTS
00088 ! .________________.____.______________________________________________
00089 ! |      NOM       |MODE|                   ROLE
00090 ! |________________|____|______________________________________________
00091 ! |   OPTION       | -->| 1 : INITIALISATION (CALLED IN SISYPHE)
00092 ! |                |    | 2 : CALLED EVERY TIME STEP (FROM
00093 ! |                |    |     BEDLOAD_POSTTREATMENT)
00094 ! |                |    | 3 : END  (CALLED IN SISYPHE)
00095 ! |________________|____|______________________________________________
00096 ! MODE : -->(DONNEE NON MODIFIEE), <--(RESULTAT), <-->(DONNEE MODIFIEE)
00097 !-----------------------------------------------------------------------
00098 ! PROGRAMME APPELANT : SISYPHE, BEDLOAD_POSTTREATMENT
00099 ! PROGRAMMES APPELES :
00100 !***********************************************************************
00101 !
00102       USE BIEF
00103       USE DECLARATIONS_SISYPHE, ONLY : DREDGESIM,DT,NPOIN,NSICLA,DZF_GF,
00104      &                                 ZFCL_C,AVAIL,MESH,SIS_FILES,
00105      &                                 SISMAF,SISGEO,ZF, MSK, MASKEL,
00106      &                                 MESH,T13,T14,IELMH_SIS,NELEM,
00107      &                                 NLAYER,E,ZR,HN,FDM,LEOPR,
00108      &                                 PTINIG,LT,MARDAT,MARTIM,XKV,XMVS
00109 #if defined (HAVE_DREDGESIM)
00110       USE P_SISYPHE_UI, ONLY : INIT_AND_SETUP_DS,CLEAR_SISYDREDGE
00111       USE P_DREDGESIM_UI, ONLY : STOP_DREDGESIM,CLEAR_DREDGESIM
00112       USE P_DREDGESIM_UI, ONLY : RUN_DREDGESIM
00113       USE M_DREDGESIM_DATA, ONLY: NODE_SEDIMENT_FRACTION
00114 #endif
00115 
00116 !
00117       IMPLICIT NONE
00118 !
00119 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00120 !
00121       INTEGER, INTENT(IN) :: OPTION
00122 !
00123 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00124 !
00125       INTEGER LNG,LU
00126       COMMON/INFO/LNG,LU
00127 !
00128 #if defined (HAVE_DREDGESIM)
00129       CHARACTER(LEN=250) :: DREDGEINP,SEDGEO
00130       INTEGER IPOIN,ISICLA
00131       DOUBLE PRECISION,ALLOCATABLE :: AVAI_GF(:,:)
00132       INTEGER I,J
00133       CHARACTER(LEN=11) EXTENS
00134       EXTERNAL          EXTENS
00135       !LEO new variable for node_Depth of sisyphe
00136       DOUBLE PRECISION, DIMENSION (:), ALLOCATABLE,
00137      &          SAVE,TARGET :: TDS_SIS_NODE_DEPTH
00138       DOUBLE PRECISION, DIMENSION (:,:), ALLOCATABLE,
00139      &          SAVE,TARGET :: TDS_NODE_SEDIMENT_FRACTION
00140       DOUBLE PRECISION, DIMENSION (:), ALLOCATABLE,
00141      &          SAVE,TARGET :: TDS_HN
00142 #endif
00143 !
00144 !-----------------------------------------------------------------------
00145 !
00146 #if defined (HAVE_DREDGESIM)
00147 
00148       IF(OPTION.EQ.1) THEN
00149 !
00150 !     INITIALISATION
00151 !
00152         !LEO
00153         ALLOCATE(TDS_SIS_NODE_DEPTH(NPOIN))
00154         ALLOCATE(TDS_HN(NPOIN))
00155         ALLOCATE(TDS_NODE_SEDIMENT_FRACTION(NPOIN,NSICLA))
00156 
00157         DREDGEINP = ''
00158         SEDGEO = ''
00159         IF(NCSIZE.GT.1) THEN
00160 !         INPUT FILE FOR DREDGESIM
00161           DREDGEINP = TRIM('SISMAF'//EXTENS(NCSIZE-1,IPID))
00162           SEDGEO = TRIM('SISGEO'//EXTENS(NCSIZE-1,IPID))
00163         ELSE
00164           DREDGEINP = 'SISMAF'
00165           SEDGEO = 'SISGEO'
00166         ENDIF
00167 ! CALCULATION OF NODE AREA IN T13
00168         CALL VECTOR(T13,'=','MASBAS          ',
00169      &    IELMH_SIS,1.D0,T14,T14,T14,T14,T14,T14,MESH,MSK,MASKEL)
00170         IF(NCSIZE.GT.1) THEN
00171           CALL PARCOM(T13,2,MESH)
00172         ENDIF
00173 ! NO QUASI BUBBLE SUPPORTED
00174         IF(IELMH_SIS.NE.11) THEN
00175           WRITE(*,*)'ONLY LINEAR 2D ELEMENTS ARE SUPPORTED'
00176           WRITE(*,*)'DREDGESIM -STOP, PLEASE START WITHOUT'
00177           WRITE(*,*)'DREDGESIM OR USE ANOTHER ELEMENT TYPE'
00178           WRITE(*,*)'ACTUAL ELEMENT TYPE OF ZF: ',IELMH_SIS
00179           CALL PLANTE(1)
00180           STOP
00181         ENDIF
00182 
00183 !LEODEBUG output COMPUTE MESH AREA
00184 !      WRITE(*,*)""
00185 !      WRITE(*,*) "LEODEBUG ELEMENT and SIZES"
00186 !      DO i = 1,NELEM
00187 !         WRITE(*,*), i, MESH%SURFAC%R(i)
00188 !      END DO
00189 !      WRITE(*,*) "LEODEBUG Node and Node Area SIZES"
00190 !      DO i = 1,NPOIN
00191 !         WRITE(*,*), i, T13%R(i)
00192 !      END DO
00193 !      WRITE(*,*)""
00194 !
00195       OPEN (120, FILE = "nodearea.dat")
00196       DO I = 1,NPOIN
00197         WRITE(120,*) I, T13%R(I)
00198       END DO
00199 
00200       CLOSE(120)
00201 !LEODEBUG output END COMUTE MESH AREA
00202 
00203 
00204 
00205 !L.S. removed debug commented out
00206       CALL INIT_AND_SETUP_DS(SIS_FILES(SISMAF)%LU,DREDGEINP,
00207      &                        SIS_FILES(SISGEO)%LU,SEDGEO,
00208      &                         NCSIZE,IPID,
00209      &    NELEM, NSICLA, NPOIN, NLAYER, MESH, T13, ZF, E, ZR, HN,
00210      &    FDM,AVAIL, LEOPR, PTINIG, DT,LT,
00211      &    MARDAT, MARTIM, XKV, XMVS)
00212 
00213 
00214 !
00215       !#########################################
00216       !
00217       ! Run dredgesim
00218       !
00219       !#########################################
00220       ELSEIF(OPTION.EQ.2) THEN
00221 !
00222 !     CALL FROM WITHIN BEDLOAD_POSTTREATMENT
00223 !
00224         !---------------- do some preprocessing -----
00225 !       allocating avai_gf
00226         ALLOCATE(AVAI_GF(NPOIN,NSICLA))
00227 !       INITIALIZATION OF THE ELEVATION TO ADD
00228         CALL OS('X=0     ',X=DZF_GF)
00229 
00230         !LEO MAKE A STUPID COPY OF TDS_SIS_NODE_DEPTH, AND WATER DEPTH HN
00231         DO I = 1,NPOIN
00232           TDS_SIS_NODE_DEPTH(I) = ZF%R(I)
00233           TDS_HN(I) = HN%R(I)
00234         END DO
00235 
00236         !LEO COPY SEDIMENT FRATIONS TO TDS_NODE_SEDIMENT_FRACTION
00237         DO IPOIN=1,NPOIN !GET_NOF_NODES()
00238            DO ISICLA=1,NSICLA !SIZE(NODE_SEDIMENT_FRACTION,2)
00239               TDS_NODE_SEDIMENT_FRACTION(IPOIN,ISICLA) =
00240      &                        AVAIL(IPOIN,1,ISICLA)
00241            END DO
00242         END DO
00243 
00244         !-----------------RUN DREDGESIM -------------
00245         CALL RUN_DREDGESIM(DT,TDS_SIS_NODE_DEPTH,TDS_HN,AVAIL,NPOIN,
00246      &                         NSICLA,TDS_NODE_SEDIMENT_FRACTION)
00247 
00248         !---------------- do some postprocessing -----
00249 
00250         !LEO OLD DEFAULT
00251         !DZF_GF%R = node_depth - ZF%R
00252 
00253         DZF_GF%R =  TDS_SIS_NODE_DEPTH - ZF%R
00254         !LEO DZF_GF%R = NODE_DEPTH - TDS_SIS_NODE_DEPTH
00255 
00256         !LEO RESET ZF%R WITH TDS_SIS_NODE_DEPTH
00257         !LEO NOT LONGER NEEDED ZF%R = TDS_SIS_NODE_DEPTH
00258 
00259 
00260         AVAI_GF = NODE_SEDIMENT_FRACTION
00261 !
00262         DO J = 1, NPOIN
00263           IF(DZF_GF%R(J).GT.0.D0) THEN
00264             DO I = 1, NSICLA
00265               ZFCL_C%ADR(I)%P%R(J) = ZFCL_C%ADR(I)%P%R(J) +
00266      &                               DZF_GF%R(J)*AVAI_GF(J,I)
00267             ENDDO
00268           ELSE
00269             DO I = 1, NSICLA
00270               ZFCL_C%ADR(I)%P%R(J) = ZFCL_C%ADR(I)%P%R(J) +
00271      &                               DZF_GF%R(J)*AVAIL(J,1,I)
00272             ENDDO
00273           ENDIF
00274         ENDDO
00275         DEALLOCATE(AVAI_GF)
00276 !
00277       ELSEIF(OPTION.EQ.3) THEN
00278 !
00279 !       CLOSING
00280 !
00281         CALL STOP_DREDGESIM()
00282         CALL CLEAR_DREDGESIM()
00283         CALL CLEAR_SISYDREDGE()
00284 
00285         !LEO DEALLOCATE MY VARIABLES
00286         DEALLOCATE(TDS_SIS_NODE_DEPTH)
00287         DEALLOCATE(TDS_NODE_SEDIMENT_FRACTION)
00288         DEALLOCATE(TDS_HN)
00289 !
00290       ELSE
00291 !
00292 !     ERROR
00293 !
00294         IF(LNG.EQ.1) WRITE(LU,*) 'MAUVAISE OPTION POUR DREDGESIM'
00295         IF(LNG.EQ.2) WRITE(LU,*) 'BAD OPTION FOR DREDGESIM'
00296         CALL PLANTE(1)
00297         STOP
00298 !
00299       ENDIF
00300 #else
00301       IF(LNG.EQ.1) WRITE(LU,*) 'DREDESIM NON INSTALLE'//
00302      &                         ' COMPILE AVEC -DHAVE_DREDGESIM'
00303       IF(LNG.EQ.2) WRITE(LU,*) 'DREDGESIM NOT INSTALLED'//
00304      &                         ' COMPILE WITH -DHAVE_DREDGESIM'
00305       CALL PLANTE(1)
00306       STOP
00307 
00308 #endif
00309 !
00310 !-----------------------------------------------------------------------
00311 !
00312       RETURN
00313       END

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