nodalf_pugh.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\telemac2d\nodalf_pugh.f
00002 !
00039                         SUBROUTINE NODALF_PUGH
00040 !                       **********************
00041 !
00042      &(FFMN2,FFM4,NODALCORR,TEMPS,DEJA,MARDAT,MARTIM)
00043 !
00044 !***********************************************************************
00045 ! TELEMAC2D   V6P2                                   23/03/2011
00046 !***********************************************************************
00047 !
00048 !
00049 !
00050 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00051 !| FFMN2          |<--| NODAL FACTOR FOR WAVES M2 AND N2
00052 !| FFM4           |<--| NODAL FACTOR FOR WAVE  M4
00053 !| MARDAT         |-->| DATE (YEAR,MONTH,DAY)
00054 !| MARTIM         |-->| TIME (HOUR,MINUTE,SECOND)
00055 !| NODALCORR      |-->| OPTION FOR CALCULATION OF NODAL FACTOR CORRECTION
00056 !| TEMPS          |-->| TIME
00057 !| DEJA           |-->| LOGICAL FOR 1ST TIME STEP
00058 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00059 !
00060       USE INTERFACE_TELEMAC2D, EX_NODALF_PUGH => NODALF_PUGH
00061 !
00062       IMPLICIT NONE
00063 !
00064 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00065 !
00066       INTEGER, INTENT(IN)           :: NODALCORR,MARDAT(3),MARTIM(3)
00067       DOUBLE PRECISION, INTENT(OUT) :: FFMN2,FFM4
00068       DOUBLE PRECISION, INTENT(IN)  :: TEMPS
00069       LOGICAL, INTENT(IN)           :: DEJA
00070 !
00071 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00072 !
00073       DOUBLE PRECISION PI,DTR,NLUNPUGH,TJ,TJMIL,NMIL
00074 !
00075       INTEGER YEAR,MONTH,DAY,NDAY,HOUR,MINUTE,SECOND,I
00076 !
00077       SAVE YEAR,HOUR,MINUTE,SECOND,NDAY
00078 !
00079       INTRINSIC INT,MOD,DBLE,COS,ATAN
00080 !
00081 !-----------------------------------------------------------------------
00082 !
00083       PI  = 4.D0*ATAN(1.D0)
00084       DTR = PI/180.D0
00085 !
00086       IF(.NOT.DEJA) THEN
00087         YEAR  = MARDAT(1)
00088         MONTH = MARDAT(2)
00089         DAY   = MARDAT(3)
00090 !
00091         HOUR   = MARTIM(1)
00092         MINUTE = MARTIM(2)
00093         SECOND = MARTIM(3)
00094 !       NUMBER OF THE DAY IN YEAR YEAR
00095         NDAY = DAY
00096 !
00097         DO I=MONTH-1,1,-1
00098           IF((I.EQ.1).OR.(I.EQ.3).OR.(I.EQ.5).OR.(I.EQ.7).OR.(I.EQ.8)
00099      &    .OR.(I.EQ.10)) THEN
00100             NDAY = NDAY + 31
00101           ELSEIF((I.EQ.4).OR.(I.EQ.6).OR.(I.EQ.9).OR.(I.EQ.11)) THEN
00102             NDAY = NDAY + 30
00103           ELSEIF(I.EQ.2) THEN
00104             IF((MOD(YEAR,4).NE.0)
00105      &      .OR.((MOD(YEAR,100).EQ.0).AND.(MOD(YEAR,400).NE.0))) THEN
00106               NDAY = NDAY + 28
00107             ELSE
00108               NDAY = NDAY + 29
00109             ENDIF
00110           ENDIF
00111         ENDDO
00112       ENDIF
00113 !
00114       TJ = DBLE(365*(YEAR-1900)+(NDAY-1)
00115      &         +DBLE(INT(DBLE(YEAR-1901)/4.D0)))/36525.D0
00116      &   +(DBLE(HOUR)+DBLE(MINUTE)/60.D0+DBLE(SECOND)/3600.D0)/876600.D0
00117      &   +TEMPS/3.15576D9
00118 !
00119       NLUNPUGH = MOD(259.16D0-1934.14D0*TJ+0.0021D0*TJ**2,360.D0)
00120 !
00121       IF(NODALCORR.EQ.2) THEN
00122         TJMIL = DBLE(365*(YEAR-1900)+(183-1)
00123      &              +DBLE(INT(DBLE(YEAR-1901)/4.D0)))/36525.D0
00124         NMIL  = MOD(259.16D0-1934.14D0*TJMIL+0.0021D0*TJMIL**2,360.D0)
00125         FFMN2 = 1.D0-0.037D0*COS(NMIL*DTR)
00126       ELSE
00127         FFMN2 = 1.D0-0.037D0*COS(NLUNPUGH*DTR)
00128       ENDIF
00129 !
00130       FFM4  = FFMN2**2
00131 !
00132 !-----------------------------------------------------------------------
00133 !
00134       RETURN
00135       END

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