prenl2.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\tomawac\prenl2.f
00002 !
00052                         SUBROUTINE PRENL2
00053 !                       *****************
00054 !
00055      &( IANGNL, COEFNL, NPLAN , NF    , RAISF , XLAMD , XMU   )
00056 !
00057 !***********************************************************************
00058 ! TOMAWAC   V6P1                                   22/06/2011
00059 !***********************************************************************
00060 !
00061 !
00062 !+note    THIS SUBROUTINE IS TO BE USED IN CONJONCT
00063 !+          SUBROUTINE QNLIN2, WHICH IT OPTIMISES.
00064 !
00065 !reference   TOLMAN H.L. (2004):
00066 !+             "INVERSE MODELING OF DISCRETE INTERACTION APPROXIMATIONS
00067 !+             FOR NONLINEAR INTERACTIONS IN WIND WAVES". OCEAN
00068 !+             MODELLING, 6, 405-422
00069 !
00070 !
00071 !
00072 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00073 !| COEFNL         |<--| COEFFICIENTS USED FOR DIA METHOD
00074 !| IANGNL         |<--| ANGUAR INDICES TABLE
00075 !| NF             |-->| NUNMBER OF FREQUENCIES
00076 !| NPLAN          |-->| NUMBER OF DIRECTIONS
00077 !| RAISF          |-->| FREQUENTIAL RATIO
00078 !| XLAMD          |-->| DIA STANDARD CONFIGURATION LAMBDA COEFFICIENT
00079 !| XMU            |-->| COEFFICIENTS FOR MDIA METHOD
00080 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00081 !                                                                     !
00082 !  APPELS :    - PROGRAMME(S) APPELANT  :  WAC                        !
00083 !  ********    - PROGRAMME(S) APPELE(S) :  ANGLES, INTANG             !
00084 !                                                                     !
00085 !
00086       IMPLICIT NONE
00087 !
00088 !.....VARIABLES IN ARGUMENT
00089 !     """""""""""""""""""""
00090       INTEGER  NPLAN , NF
00091       INTEGER  IANGNL(NPLAN,16)
00092       DOUBLE PRECISION RAISF , XLAMD , XMU
00093       DOUBLE PRECISION COEFNL(32)
00094 !
00095 !.....LOCAL VARIABLES
00096 !     """"""""""""""""""
00097       INTEGER  JP
00098       DOUBLE PRECISION DELTA1, DELTA2, DTMOIN, DTPLUS, DTETAD, XXXX
00099       DOUBLE PRECISION APLUS , AMOIN , BPLUS , BMOIN , FPLUS , FMOIN
00100 !
00101 !
00102 !
00103 !     ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00104 !     ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00105 !     ++++      COMPUTATION FOR K1 AND K2 WITH THE MU VALUE     ++++
00106 !     ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00107 !     ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00108       XXXX=XMU
00109 !
00110 !=====!---------------------------------------------------!
00111 !  1  ! COMPUTATIONS RELATED TO ANGULAR INTERPOLATION     !
00112 !=====!---------------------------------------------------!
00113 !
00114 !.....1.1 DETERMINES RESONANT DIRECTIONS
00115 !         (WITH THE CONVENTION  0 < DTPLUS < DTMOIN)
00116 !     """""""""""""""""""""""""""""""""""""""""""""
00117       CALL  ANGLES( XXXX  , DTPLUS, DTMOIN)
00118 !
00119 !.....1.2 DETERMINES ANGULAR INDICES FOR THE 'STANDARD' CONFIGURATION
00120 !         (CORRESPONDING TO (-DTPLUS,DTMOIN))
00121 !     """"""""""""""""""""""""""""""""""""""""""""""""""""""""
00122       IF (XXXX.GT.1.D-6) THEN
00123         DELTA1=-DTPLUS
00124         DELTA2= DTMOIN
00125         DO JP=1,NPLAN
00126           CALL INTANG(IANGNL(JP, 2), IANGNL(JP, 1), JP , NPLAN , DELTA1)
00127           CALL INTANG(IANGNL(JP, 3), IANGNL(JP, 4), JP , NPLAN , DELTA2)
00128         ENDDO
00129       ELSE
00130         DO JP=1,NPLAN
00131           IANGNL(JP, 1)=JP
00132           IANGNL(JP, 2)=JP-1
00133           IF (JP.EQ.1) IANGNL(JP, 2)=NPLAN
00134           IANGNL(JP, 3)=JP
00135           IANGNL(JP, 4)=JP+1
00136           IF (JP.EQ.NPLAN) IANGNL(JP, 4)=1
00137         ENDDO
00138       ENDIF
00139 !
00140 !.....1.3 DETERMINES ANGULAR INDICES FOR THE 'IMAGE' CONFIGURATION
00141 !         (CORRESPONDING TO (DTPLUS,-DTMOIN))
00142 !     """""""""""""""""""""""""""""""""""""""""""""""""""""
00143       IF (XXXX.GT.1.D-6) THEN
00144         DELTA1= DTPLUS
00145         DELTA2=-DTMOIN
00146         DO JP=1,NPLAN
00147         CALL INTANG( IANGNL(JP, 5), IANGNL(JP, 6), JP , NPLAN , DELTA1)
00148         CALL INTANG( IANGNL(JP, 8), IANGNL(JP, 7), JP , NPLAN , DELTA2)
00149         ENDDO
00150       ELSE
00151         DO JP=1,NPLAN
00152           IANGNL(JP, 5)=JP
00153           IANGNL(JP, 6)=JP+1
00154           IF (JP.EQ.NPLAN) IANGNL(JP, 6)=1
00155           IANGNL(JP, 7)=JP
00156           IANGNL(JP, 8)=JP-1
00157           IF (JP.EQ.1) IANGNL(JP, 8)=NPLAN
00158         ENDDO
00159       ENDIF
00160 !
00161 !.....1.4 DETERMINES COEFFICIENTS OF ANGULAR INTERPOLATION
00162 !     """""""""""""""""""""""""""""""""""""""""""
00163       DTETAD=360.D0/DBLE(NPLAN)
00164       APLUS=DTPLUS/DTETAD-DBLE(INT(DTPLUS/DTETAD))
00165       AMOIN=DTMOIN/DTETAD-DBLE(INT(DTMOIN/DTETAD))
00166 !
00167 !
00168 !=====!---------------------------------------------------!
00169 !  2  ! COMPUTATIONS RELATED TO FREQUENCY INTERPOLATION   !
00170 !=====!---------------------------------------------------!
00171       FPLUS=DLOG(1.D0+XXXX)/DLOG(RAISF)
00172       FMOIN=DLOG(1.D0-XXXX)/DLOG(RAISF)
00173       BPLUS=(RAISF**(FPLUS-IDINT(FPLUS)     )-1.D0)/(RAISF-1.D0)
00174       BMOIN=(RAISF**(FMOIN-IDINT(FMOIN)+1.D0)-1.D0)/(RAISF-1.D0)
00175 !
00176 !
00177 !=====!---------------------------------------------------!
00178 !  3  ! ASSIGNS THE COEFFICIENTS FOR QNLIN2               !
00179 !=====!---------------------------------------------------!
00180       COEFNL( 1)=(1.D0-APLUS) * (1.D0-BPLUS)
00181       COEFNL( 2)=      APLUS  * (1.D0-BPLUS)
00182       COEFNL( 3)=(1.D0-APLUS) *       BPLUS
00183       COEFNL( 4)=      APLUS  *       BPLUS
00184       COEFNL( 5)=(1.D0-AMOIN) * (1.D0-BMOIN)
00185       COEFNL( 6)=      AMOIN  * (1.D0-BMOIN)
00186       COEFNL( 7)=(1.D0-AMOIN) *       BMOIN
00187       COEFNL( 8)=      AMOIN  *       BMOIN
00188       COEFNL( 9)=FPLUS
00189       COEFNL(10)=FMOIN
00190       COEFNL(11)=1.D0/(1.D0+XXXX)**4
00191       COEFNL(12)=1.D0/(1.D0-XXXX)**4
00192       COEFNL(13)=DBLE(1)
00193       COEFNL(14)=DBLE(NF+IDINT(1.D0-FMOIN))
00194 !
00195 !
00196 !
00197 !     ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00198 !     ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00199 !     ++++    COMPUTATION FOR K1 AND K2 WITH THE LAMDA VALUE    ++++
00200 !     ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00201 !     ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00202       XXXX=XLAMD
00203 !
00204 !=====!---------------------------------------------------!
00205 !  1  ! COMPUTATIONS RELATED TO ANGULAR INTERPOLATION     !
00206 !=====!---------------------------------------------------!
00207 !
00208 !.....1.1 DETERMINES RESONANT DIRECTIONS
00209 !         (WITH THE CONVENTION  0 < DTPLUS < DTMOIN)
00210 !     """""""""""""""""""""""""""""""""""""""""""""
00211       CALL  ANGLES( XXXX  , DTPLUS, DTMOIN)
00212 !
00213 !.....1.2 DETERMINES ANGULAR INDICES FOR THE 'STANDARD' CONFIGURATION
00214 !         (CORRESPONDING TO (-DTPLUS,DTMOIN))
00215 !     """"""""""""""""""""""""""""""""""""""""""""""""""""""""
00216       IF (XXXX.GT.1.D-6) THEN
00217         DELTA1=-DTPLUS
00218         DELTA2= DTMOIN
00219         DO JP=1,NPLAN
00220           CALL INTANG(IANGNL(JP,10), IANGNL(JP, 9), JP , NPLAN , DELTA1)
00221           CALL INTANG(IANGNL(JP,11), IANGNL(JP,12), JP , NPLAN , DELTA2)
00222         ENDDO
00223       ELSE
00224         DO JP=1,NPLAN
00225           IANGNL(JP, 9)=JP
00226           IANGNL(JP,10)=JP-1
00227           IF (JP.EQ.1) IANGNL(JP,10)=NPLAN
00228           IANGNL(JP,11)=JP
00229           IANGNL(JP,12)=JP+1
00230           IF (JP.EQ.NPLAN) IANGNL(JP,12)=1
00231         ENDDO
00232       ENDIF
00233 !
00234 !.....1.3 DETERMINES ANGULAR INDICES FOR THE 'IMAGE' CONFIGURATION
00235 !         (CORRESPONDING TO (DTPLUS,-DTMOIN))
00236 !     """""""""""""""""""""""""""""""""""""""""""""""""""""
00237       IF (XXXX.GT.1.D-6) THEN
00238         DELTA1= DTPLUS
00239         DELTA2=-DTMOIN
00240         DO JP=1,NPLAN
00241           CALL INTANG(IANGNL(JP,13), IANGNL(JP,14), JP , NPLAN , DELTA1)
00242           CALL INTANG(IANGNL(JP,16), IANGNL(JP,15), JP , NPLAN , DELTA2)
00243         ENDDO
00244       ELSE
00245         DO JP=1,NPLAN
00246           IANGNL(JP,13)=JP
00247           IANGNL(JP,14)=JP+1
00248           IF (JP.EQ.NPLAN) IANGNL(JP,14)=1
00249           IANGNL(JP,15)=JP
00250           IANGNL(JP,16)=JP-1
00251           IF (JP.EQ.1) IANGNL(JP,16)=NPLAN
00252         ENDDO
00253       ENDIF
00254 !
00255 !.....1.4 DETERMINES COEFFICIENTS OF ANGULAR INTERPOLATION
00256 !     """""""""""""""""""""""""""""""""""""""""""
00257       DTETAD=360.D0/DBLE(NPLAN)
00258       APLUS=DTPLUS/DTETAD-DBLE(INT(DTPLUS/DTETAD))
00259       AMOIN=DTMOIN/DTETAD-DBLE(INT(DTMOIN/DTETAD))
00260 !
00261 !
00262 !=====!---------------------------------------------------!
00263 !  2  ! COMPUTATIONS RELATED TO FREQUENCY INTERPOLATION   !
00264 !=====!---------------------------------------------------!
00265       FPLUS=DLOG(1.D0+XXXX)/DLOG(RAISF)
00266       FMOIN=DLOG(1.D0-XXXX)/DLOG(RAISF)
00267       BPLUS=(RAISF**(FPLUS-IDINT(FPLUS)     )-1.D0)/(RAISF-1.D0)
00268       BMOIN=(RAISF**(FMOIN-IDINT(FMOIN)+1.D0)-1.D0)/(RAISF-1.D0)
00269 !
00270 !
00271 !=====!---------------------------------------------------!
00272 !  3  ! ASSIGNS THE COEFFICIENTS FOR QNLIN2               !
00273 !=====!---------------------------------------------------!
00274       COEFNL(17)=(1.D0-APLUS) * (1.D0-BPLUS)
00275       COEFNL(18)=      APLUS  * (1.D0-BPLUS)
00276       COEFNL(19)=(1.D0-APLUS) *       BPLUS
00277       COEFNL(20)=      APLUS  *       BPLUS
00278       COEFNL(21)=(1.D0-AMOIN) * (1.D0-BMOIN)
00279       COEFNL(22)=      AMOIN  * (1.D0-BMOIN)
00280       COEFNL(23)=(1.D0-AMOIN) *       BMOIN
00281       COEFNL(24)=      AMOIN  *       BMOIN
00282       COEFNL(25)=FPLUS
00283       COEFNL(26)=FMOIN
00284       COEFNL(27)=1.D0/(1.D0+XXXX)**4
00285       COEFNL(28)=1.D0/(1.D0-XXXX)**4
00286       COEFNL(29)=DBLE(1)
00287       COEFNL(30)=DBLE(NF+IDINT(1.D0-FMOIN))
00288 !
00289 !
00290       RETURN
00291       END

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