dis_sta_cur.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\telemac2d\dis_sta_cur.f
00002 !
00040                      DOUBLE PRECISION FUNCTION DIS_STA_CUR
00041 !                    *************************************
00042 !
00043      &(IFRLIQ,PTS,QZ,NFRLIQ,ZN)
00044 !
00045 !***********************************************************************
00046 ! TELEMAC2D   V7P0                                   21/08/2010
00047 !***********************************************************************
00048 !
00049 !
00050 !
00051 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00052 !| IFRLIQ         |-->| LIQUID BOUNDARY NUMBER
00053 !| NFRLIQ         |-->| NUMBER OF LIQUID BOUNDARIES
00054 !| PTS            |-->| NUMBER OF POINTS IN THE STAGE-DISCHARGE CURVE
00055 !| QZ             |-->| ARRAY WITH STAGE-DISCHARGE CURVES
00056 !| ZN             |-->| ELEVATION
00057 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00058 !
00059       USE BIEF
00060 !
00061       IMPLICIT NONE
00062       INTEGER LNG,LU
00063       COMMON/INFO/LNG,LU
00064 !
00065 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00066 !
00067       INTEGER, INTENT(IN) :: IFRLIQ,NFRLIQ,PTS
00068       DOUBLE PRECISION, INTENT(IN) :: ZN,QZ(2,NFRLIQ,PTS)
00069 !                                                    PTS AT LEAST
00070 !
00071 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00072 !
00073       INTEGER I
00074       DOUBLE PRECISION GOAL,TETA,Z1,Z2
00075 !
00076 !-----------------------------------------------------------------------
00077 !
00078       Z1=QZ(2,IFRLIQ,1)
00079       Z2=QZ(2,IFRLIQ,PTS)
00080       IF(ZN.LE.Z1) THEN
00081 !       OUTSIDE THE CURVE WITH LOWER ELEVATION
00082         GOAL=QZ(1,IFRLIQ,1)
00083       ELSEIF(ZN.GE.Z2) THEN
00084 !       OUTSIDE THE CURVE WITH HIGHER ELEVATION
00085         GOAL=QZ(1,IFRLIQ,PTS)
00086       ELSE
00087 !       IN BETWEEN: CASE WITH INTERPOLATION
00088         I=1
00089 1       CONTINUE
00090         Z2=QZ(2,IFRLIQ,I+1)
00091         IF(ZN.GE.Z1.AND.ZN.LE.Z2) THEN
00092           TETA=(ZN-Z1)/MAX(Z2-Z1,1.D-8)
00093           GOAL=QZ(1,IFRLIQ,I)+TETA*(QZ(1,IFRLIQ,I+1)-QZ(1,IFRLIQ,I))
00094         ELSE
00095           I=I+1
00096           Z1=Z2
00097           GO TO 1
00098         ENDIF
00099       ENDIF
00100 !
00101 !-----------------------------------------------------------------------
00102 !
00103       DIS_STA_CUR=GOAL
00104 !
00105 !-----------------------------------------------------------------------
00106 !
00107       RETURN
00108       END

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