From d3baf54249e252100f2c98dc78909ef609de93c3 Mon Sep 17 00:00:00 2001 From: Jessica Meixner Date: Fri, 3 Jan 2025 15:20:50 +0000 Subject: [PATCH] fixing additional indents --- model/src/w3iogomd.F90 | 591 ++++++++++++++++++----------------------- 1 file changed, 265 insertions(+), 326 deletions(-) diff --git a/model/src/w3iogomd.F90 b/model/src/w3iogomd.F90 index de660ded4..7a9fca02a 100644 --- a/model/src/w3iogomd.F90 +++ b/model/src/w3iogomd.F90 @@ -4663,295 +4663,248 @@ END SUBROUTINE CALC_WBT !> !> @author P. Janssen @date 29-Mar-2024 !> - SUBROUTINE SECONDHH(NKHF,FAC0,FAC1,FAC2,FAC3) -!---------------------------------------------------------------- - -!**** *SECONDHH* - COMPUTATION OF SECOND ORDER HARMONICS AND -! RELEVANT TABLES FOR THE ALTIMETER CORRECTIONS. - -! P.A.E.M. JANSSEN - -! PURPOSE. -! --------- - -! COMPUTE SECOND HARMONICS - -!** INTERFACE. -! ---------- - -! *CALL* *SECONDHH* - -! METHOD. -! ------- - -! SEE REFERENCE. - -! EXTERNALS. -! ---------- - -! VMIN_D -! VPLUS_D - -! REFERENCES. -! ----------- - -! V E ZAKHAROV(1967) - -!------------------------------------------------------------------- - -!------------------------------------------------------------------- -USE CONSTANTS, ONLY: GRAV, TPI -USE W3GDATMD, ONLY: NK, NTH, XFR, SIG, TH, DTH, ECOS, ESIN - IMPLICIT NONE - ! REAL(KIND=4) :: VMIN_D,VPLUS_D - - - - INTEGER, INTENT(IN) :: NKHF - REAL(KIND=4), DIMENSION(NTH,NTH,NKHF,NKHF), INTENT(OUT) :: FAC0, FAC1, FAC2, FAC3 - REAL(KIND=4), PARAMETER :: FRATIO = 1.1 - - - INTEGER :: M, K1, M1, K2, M2 - - REAL(KIND=4), PARAMETER :: DEL1=1.0E-8 - REAL(KIND=4), PARAMETER :: ZCONST = 0.0281349 - - !REAL(KIND=4) :: VMIN_D, VPLUS_D - REAL(KIND=4) :: CO1 - REAL(KIND=4) :: XK1, XK1SQ, XK2, XK2SQ, XK3 - REAL(KIND=4) :: COSDIFF - REAL(KIND=4) :: X12, X13, X32, OM1, OM2, OM3, F1, F2, F3 - REAL(KIND=4) :: VM, VP - REAL(KIND=4) :: DELOM1, DELOM2 - REAL(KIND=4) :: DELOM321, DELOM312 - REAL(KIND=4) :: C22, S22 - - REAL(KIND=4), DIMENSION(NTH,NTH,NKHF,NKHF) :: B - REAL(KIND=4), DIMENSION(:), ALLOCATABLE:: FAK, SIGHF, DFIMHF - - - - -!----------------------------------------------------------------------- - - - - -!* 1. INITIALISE RELEVANT QUANTITIES. - - ALLOCATE(FAK(NKHF)) - ALLOCATE(SIGHF(NKHF)) - ALLOCATE(DFIMHF(NKHF)) - - SIGHF(1) = SIG(1) - DO M=2,NKHF - SIGHF(M) = XFR*SIGHF(M-1) - ENDDO - - DO M=1,NKHF - FAK(M) = (SIGHF(M))**2/GRAV - ENDDO - - CO1 = 0.5*(XFR-1.)*DTH - DFIMHF(1) = CO1*SIGHF(1) - DO M=2,NKHF-1 - DFIMHF(M)=CO1*(SIGHF(M)+SIGHF(M-1)) - ENDDO - DFIMHF(NKHF)=CO1*SIGHF(NKHF-1) + SUBROUTINE SECONDHH(NKHF,FAC0,FAC1,FAC2,FAC3) + !---------------------------------------------------------------- + !**** *SECONDHH* - COMPUTATION OF SECOND ORDER HARMONICS AND + ! RELEVANT TABLES FOR THE ALTIMETER CORRECTIONS. + ! P.A.E.M. JANSSEN + ! PURPOSE. + ! --------- + ! COMPUTE SECOND HARMONICS + !** INTERFACE. + ! ---------- + ! *CALL* *SECONDHH* + ! METHOD. + ! ------- + ! SEE REFERENCE. + ! EXTERNALS. + ! ---------- + ! VMIN_D + ! VPLUS_D + ! REFERENCES. + ! ----------- + ! V E ZAKHAROV(1967) + !------------------------------------------------------------------- + USE CONSTANTS, ONLY: GRAV, TPI + USE W3GDATMD, ONLY: NK, NTH, XFR, SIG, TH, DTH, ECOS, ESIN + IMPLICIT NONE - DO M2=1,NKHF - XK2 = FAK(M2) - XK2SQ = FAK(M2)**2 - DO M1=1,NKHF - XK1 = FAK(M1) - XK1SQ = FAK(M1)**2 - DO K1=1,NTH - DO K2=1,NTH - COSDIFF = COS(TH(K1)-TH(K2)) - X12 = XK1*XK2*COSDIFF - XK3 = XK1SQ + XK2SQ +2.0*X12 +DEL1 - XK3 = SQRT(XK3) - X13 = XK1SQ+X12 - X32 = X12+XK2SQ - OM1 = SQRT(GRAV*XK1) - OM2 = SQRT(GRAV*XK2) - OM3 = SQRT(GRAV*XK3) - F1 = SQRT(XK1/(2.0*OM1)) - F2 = SQRT(XK2/(2.0*OM2)) - F3 = SQRT(XK3/(2.0*OM3)) - VM = TPI*VMIN_D(XK3,XK1,XK2,X13,X32,X12,OM3,OM1,OM2) - VP = TPI*VPLUS_D(-XK3,XK1,XK2,-X13,-X32,X12,OM3,OM1,OM2) - DELOM1 = OM3-OM1-OM2+DEL1 - DELOM2 = OM3+OM1+OM2+DEL1 - FAC0(K1,K2,M1,M2) = -F3/(F1*F2)*(VM/(DELOM1)+ & - & VP/(DELOM2)) - ENDDO + INTEGER, INTENT(IN) :: NKHF + REAL(KIND=4), DIMENSION(NTH,NTH,NKHF,NKHF), INTENT(OUT) :: FAC0, FAC1, FAC2, FAC3 + REAL(KIND=4), PARAMETER :: FRATIO = 1.1 + + INTEGER :: M, K1, M1, K2, M2 + + REAL(KIND=4), PARAMETER :: DEL1=1.0E-8 + REAL(KIND=4), PARAMETER :: ZCONST = 0.0281349 + + !REAL(KIND=4) :: VMIN_D, VPLUS_D + REAL(KIND=4) :: CO1 + REAL(KIND=4) :: XK1, XK1SQ, XK2, XK2SQ, XK3 + REAL(KIND=4) :: COSDIFF + REAL(KIND=4) :: X12, X13, X32, OM1, OM2, OM3, F1, F2, F3 + REAL(KIND=4) :: VM, VP + REAL(KIND=4) :: DELOM1, DELOM2 + REAL(KIND=4) :: DELOM321, DELOM312 + REAL(KIND=4) :: C22, S22 + + REAL(KIND=4), DIMENSION(NTH,NTH,NKHF,NKHF) :: B + REAL(KIND=4), DIMENSION(:), ALLOCATABLE:: FAK, SIGHF, DFIMHF + !----------------------------------------------------------------------- + !* 1. INITIALISE RELEVANT QUANTITIES. + + ALLOCATE(FAK(NKHF)) + ALLOCATE(SIGHF(NKHF)) + ALLOCATE(DFIMHF(NKHF)) + + SIGHF(1) = SIG(1) + DO M=2,NKHF + SIGHF(M) = XFR*SIGHF(M-1) + ENDDO + + DO M=1,NKHF + FAK(M) = (SIGHF(M))**2/GRAV + ENDDO + + CO1 = 0.5*(XFR-1.)*DTH + DFIMHF(1) = CO1*SIGHF(1) + DO M=2,NKHF-1 + DFIMHF(M)=CO1*(SIGHF(M)+SIGHF(M-1)) + ENDDO + DFIMHF(NKHF)=CO1*SIGHF(NKHF-1) + + DO M2=1,NKHF + XK2 = FAK(M2) + XK2SQ = FAK(M2)**2 + DO M1=1,NKHF + XK1 = FAK(M1) + XK1SQ = FAK(M1)**2 + DO K1=1,NTH + DO K2=1,NTH + COSDIFF = COS(TH(K1)-TH(K2)) + X12 = XK1*XK2*COSDIFF + XK3 = XK1SQ + XK2SQ +2.0*X12 +DEL1 + XK3 = SQRT(XK3) + X13 = XK1SQ+X12 + X32 = X12+XK2SQ + OM1 = SQRT(GRAV*XK1) + OM2 = SQRT(GRAV*XK2) + OM3 = SQRT(GRAV*XK3) + F1 = SQRT(XK1/(2.0*OM1)) + F2 = SQRT(XK2/(2.0*OM2)) + F3 = SQRT(XK3/(2.0*OM3)) + VM = TPI*VMIN_D(XK3,XK1,XK2,X13,X32,X12,OM3,OM1,OM2) + VP = TPI*VPLUS_D(-XK3,XK1,XK2,-X13,-X32,X12,OM3,OM1,OM2) + DELOM1 = OM3-OM1-OM2+DEL1 + DELOM2 = OM3+OM1+OM2+DEL1 + FAC0(K1,K2,M1,M2) = -F3/(F1*F2)*(VM/(DELOM1)+VP/(DELOM2)) ENDDO ENDDO ENDDO - - DO M2=1,NKHF - XK2 = FAK(M2) - XK2SQ = FAK(M2)**2 - DO M1=1,NKHF - XK1 = FAK(M1) - XK1SQ = FAK(M1)**2 - DO K1=1,NTH - DO K2=1,NTH - COSDIFF = COS(TH(K1)-TH(K2)) - X12 = XK1*XK2*COSDIFF - XK3 = XK1SQ + XK2SQ - 2.*X12 + DEL1 - XK3 = SQRT(XK3) - X13 = XK1SQ-X12 - X32 = X12-XK2SQ - OM1 = SQRT(GRAV*XK1) - OM2 = SQRT(GRAV*XK2) - OM3 = SQRT(GRAV*XK3)+DEL1 - F1 = SQRT(XK1/(2.0*OM1)) - F2 = SQRT(XK2/(2.0*OM2)) - F3 = SQRT(ABS(XK3)/(2.0*OM3)) - VM = TPI*VMIN_D(XK1,XK3,XK2,X13,X12,X32,OM1,OM3,OM2) - VP = TPI*VMIN_D(XK2,-XK3,XK1,-X32,X12,-X13,OM2,OM3,OM1) - DELOM321 = OM3+OM2-OM1+DEL1 - DELOM312 = OM3+OM1-OM2+DEL1 - B(K1,K2,M1,M2) = -F3/(F1*F2)*(VM/(DELOM321)+ & - & VP/(DELOM312)) - ENDDO + ENDDO + + DO M2=1,NKHF + XK2 = FAK(M2) + XK2SQ = FAK(M2)**2 + DO M1=1,NKHF + XK1 = FAK(M1) + XK1SQ = FAK(M1)**2 + DO K1=1,NTH + DO K2=1,NTH + COSDIFF = COS(TH(K1)-TH(K2)) + X12 = XK1*XK2*COSDIFF + XK3 = XK1SQ + XK2SQ - 2.*X12 + DEL1 + XK3 = SQRT(XK3) + X13 = XK1SQ-X12 + X32 = X12-XK2SQ + OM1 = SQRT(GRAV*XK1) + OM2 = SQRT(GRAV*XK2) + OM3 = SQRT(GRAV*XK3)+DEL1 + F1 = SQRT(XK1/(2.0*OM1)) + F2 = SQRT(XK2/(2.0*OM2)) + F3 = SQRT(ABS(XK3)/(2.0*OM3)) + VM = TPI*VMIN_D(XK1,XK3,XK2,X13,X12,X32,OM1,OM3,OM2) + VP = TPI*VMIN_D(XK2,-XK3,XK1,-X32,X12,-X13,OM2,OM3,OM1) + DELOM321 = OM3+OM2-OM1+DEL1 + DELOM312 = OM3+OM1-OM2+DEL1 + B(K1,K2,M1,M2) = -F3/(F1*F2)*(VM/(DELOM321)+VP/(DELOM312)) ENDDO ENDDO ENDDO + ENDDO - DO M2=1,NKHF - XK2SQ = FAK(M2)**2 - DO M1=1,NKHF - XK1SQ = FAK(M1)**2 - DO K2=1,NTH - DO K1=1,NTH - C22 = FAC0(K1,K2,M1,M2)+B(K1,K2,M1,M2) - S22 = B(K1,K2,M1,M2)-FAC0(K1,K2,M1,M2) - FAC1(K1,K2,M1,M2) = & - & (XK1SQ*ECOS(K1)**2 + XK2SQ*ECOS(K2)**2)*C22 & - & -FAK(M1)*FAK(M2)*ECOS(K1)*ECOS(K2)*S22 - FAC2(K1,K2,M1,M2) = & - & (XK1SQ*ESIN(K1)**2 + XK2SQ*ESIN(K2)**2)*C22 & - & -FAK(M1)*FAK(M2)*ESIN(K1)*ESIN(K2)*S22 - FAC3(K1,K2,M1,M2) = & - & (XK1SQ*ESIN(K1)*ECOS(K1) + & - & XK2SQ*ESIN(K2)*ECOS(K2))*C22 & - & -FAK(M1)*FAK(M2)*ECOS(K1)*ESIN(K2)*S22 - FAC0(K1,K2,M1,M2) = C22 - ENDDO + DO M2=1,NKHF + XK2SQ = FAK(M2)**2 + DO M1=1,NKHF + XK1SQ = FAK(M1)**2 + DO K2=1,NTH + DO K1=1,NTH + C22 = FAC0(K1,K2,M1,M2)+B(K1,K2,M1,M2) + S22 = B(K1,K2,M1,M2)-FAC0(K1,K2,M1,M2) + FAC1(K1,K2,M1,M2) = (XK1SQ*ECOS(K1)**2 + XK2SQ*ECOS(K2)**2)*C22 & + -FAK(M1)*FAK(M2)*ECOS(K1)*ECOS(K2)*S22 + FAC2(K1,K2,M1,M2) = (XK1SQ*ESIN(K1)**2 + XK2SQ*ESIN(K2)**2)*C22 & + -FAK(M1)*FAK(M2)*ESIN(K1)*ESIN(K2)*S22 + FAC3(K1,K2,M1,M2) = (XK1SQ*ESIN(K1)*ECOS(K1) + & + XK2SQ*ESIN(K2)*ECOS(K2))*C22 & + -FAK(M1)*FAK(M2)*ECOS(K1)*ESIN(K2)*S22 + FAC0(K1,K2,M1,M2) = C22 ENDDO ENDDO ENDDO + ENDDO + CONTAINS - CONTAINS - -!----------------------------------------------------------------------- + !----------------------------------------------------------------------- - REAL(KIND=4) FUNCTION VMIN_D(XI,XJ,XK,XIJ,XIK,XJK,XOI,XOJ,XOK) + REAL(KIND=4) FUNCTION VMIN_D(XI,XJ,XK,XIJ,XIK,XJK,XOI,XOJ,XOK) -! PETER JANSSEN - -! PURPOSE. -! -------- - -! GIVES NONLINEAR TRANSFER COEFFICIENT FOR THREE -! WAVE INTERACTIONS OF DEEP-WATER WAVES IN THE -! IDEAL CASE OF NO CURRENT. (CF.ZAKHAROV) - -! INTERFACE. -! ---------- -! *VMIN_D(XI,XJ,XK)* -! *XI* - WAVE NUMBER -! *XJ* - WAVE NUMBER -! *XK* - WAVE NUMBER -! METHOD. -! ------- -! NONE - -! EXTERNALS. -! ---------- -! NONE. - - -!*** 1. DETERMINE NONLINEAR TRANSFER. -! -------------------------------- - IMPLICIT NONE - REAL, INTENT(IN) :: XI, XJ, XK, XIJ, XIK, XJK, XOI, XOJ, XOK - REAL :: RI, RJ, RK, OI, OJ, OK, SQIJK, SQIKJ, SQJKI - - RI=ABS(XI)+DEL1 - RJ=ABS(XJ)+DEL1 - RK=ABS(XK)+DEL1 - OI=XOI+DEL1 - OJ=XOJ+DEL1 - OK=XOK+DEL1 - SQIJK=SQRT(OI*OJ*RK/(OK*RI*RJ)) - SQIKJ=SQRT(OI*OK*RJ/(OJ*RI*RK)) - SQJKI=SQRT(OJ*OK*RI/(OI*RJ*RK)) - VMIN_D=ZCONST*( (XIJ-RI*RJ)*SQIJK + (XIK-RI*RK)*SQIKJ & - & + (XJK+RJ*RK)*SQJKI ) + ! PETER JANSSEN + ! PURPOSE. + ! -------- + ! GIVES NONLINEAR TRANSFER COEFFICIENT FOR THREE + ! WAVE INTERACTIONS OF DEEP-WATER WAVES IN THE + ! IDEAL CASE OF NO CURRENT. (CF.ZAKHAROV) + ! INTERFACE. + ! ---------- + ! *VMIN_D(XI,XJ,XK)* + ! *XI* - WAVE NUMBER + ! *XJ* - WAVE NUMBER + ! *XK* - WAVE NUMBER + ! METHOD. + ! ------- + ! NONE + ! EXTERNALS. + ! ---------- + ! NONE. + + + !*** 1. DETERMINE NONLINEAR TRANSFER. + ! -------------------------------- + IMPLICIT NONE + REAL, INTENT(IN) :: XI, XJ, XK, XIJ, XIK, XJK, XOI, XOJ, XOK + REAL :: RI, RJ, RK, OI, OJ, OK, SQIJK, SQIKJ, SQJKI + + RI=ABS(XI)+DEL1 + RJ=ABS(XJ)+DEL1 + RK=ABS(XK)+DEL1 + OI=XOI+DEL1 + OJ=XOJ+DEL1 + OK=XOK+DEL1 + SQIJK=SQRT(OI*OJ*RK/(OK*RI*RJ)) + SQIKJ=SQRT(OI*OK*RJ/(OJ*RI*RK)) + SQJKI=SQRT(OJ*OK*RI/(OI*RJ*RK)) + VMIN_D=ZCONST*( (XIJ-RI*RJ)*SQIJK + (XIK-RI*RK)*SQIKJ+ (XJK+RJ*RK)*SQJKI ) END FUNCTION VMIN_D -!----------------------------------------------------------------------- + !----------------------------------------------------------------------- REAL(KIND=4) FUNCTION VPLUS_D(XI,XJ,XK,XIJ,XIK,XJK,XOI,XOJ,XOK) - -!*** *VPLUS_D* DETERMINES THE NONLINEAR TRANSFER COEFFICIENT FOR THREE -! WAVE INTERACTIONS OF DEEP-WATER WAVES. - -! PETER JANSSEN - -! PURPOSE. -! -------- - -! GIVES NONLINEAR TRANSFER COEFFICIENT FOR THREE -! WAVE INTERACTIONS OF GRAVITY-CAPILLARY WAVES IN THE -! IDEAL CASE OF NO CURRENT. (CF.ZAKHAROV) - -! INTERFACE. -! ---------- -! *VPLUS_D(XI,XJ,XK)* -! *XI* - WAVE NUMBER -! *XJ* - WAVE NUMBER -! *XK* - WAVE NUMBER -! METHOD. -! ------- -! NONE - -! EXTERNALS. -! ---------- -! NONE. - - - -!*** 1. DETERMINE NONLINEAR TRANSFER. -! -------------------------------- - - IMPLICIT NONE - REAL, INTENT(IN) :: XI, XJ, XK, XIJ, XIK, XJK, XOI, XOJ, XOK - REAL :: RI, RJ, RK, OI, OJ, OK, SQIJK, SQIKJ, SQJKI - - RI=ABS(XI)+DEL1 - RJ=ABS(XJ)+DEL1 - RK=ABS(XK)+DEL1 - OI=XOI+DEL1 - OJ=XOJ+DEL1 - OK=XOK+DEL1 - SQIJK=SQRT(OI*OJ*RK/(OK*RI*RJ)) - SQIKJ=SQRT(OI*OK*RJ/(OJ*RI*RK)) - SQJKI=SQRT(OJ*OK*RI/(OI*RJ*RK)) - VPLUS_D=ZCONST*( (XIJ+RI*RJ)*SQIJK + (XIK+RI*RK)*SQIKJ & - & + (XJK+RJ*RK)*SQJKI ) + !*** *VPLUS_D* DETERMINES THE NONLINEAR TRANSFER COEFFICIENT FOR THREE + ! WAVE INTERACTIONS OF DEEP-WATER WAVES. + ! PETER JANSSEN + ! PURPOSE. + ! -------- + ! GIVES NONLINEAR TRANSFER COEFFICIENT FOR THREE + ! WAVE INTERACTIONS OF GRAVITY-CAPILLARY WAVES IN THE + ! IDEAL CASE OF NO CURRENT. (CF.ZAKHAROV) + ! INTERFACE. + ! ---------- + ! *VPLUS_D(XI,XJ,XK)* + ! *XI* - WAVE NUMBER + ! *XJ* - WAVE NUMBER + ! *XK* - WAVE NUMBER + ! METHOD. + ! ------- + ! NONE + ! EXTERNALS. + ! ---------- + ! NONE. + + !*** 1. DETERMINE NONLINEAR TRANSFER. + ! -------------------------------- + + IMPLICIT NONE + REAL, INTENT(IN) :: XI, XJ, XK, XIJ, XIK, XJK, XOI, XOJ, XOK + REAL :: RI, RJ, RK, OI, OJ, OK, SQIJK, SQIKJ, SQJKI + + RI=ABS(XI)+DEL1 + RJ=ABS(XJ)+DEL1 + RK=ABS(XK)+DEL1 + OI=XOI+DEL1 + OJ=XOJ+DEL1 + OK=XOK+DEL1 + SQIJK=SQRT(OI*OJ*RK/(OK*RI*RJ)) + SQIKJ=SQRT(OI*OK*RJ/(OJ*RI*RK)) + SQJKI=SQRT(OJ*OK*RI/(OI*RJ*RK)) + VPLUS_D=ZCONST*( (XIJ+RI*RJ)*SQIJK + (XIK+RI*RK)*SQIKJ + (XJK+RJ*RK)*SQJKI ) END FUNCTION VPLUS_D -! ----------------------------------------------------------------- + ! ----------------------------------------------------------------- - END SUBROUTINE SECONDHH + END SUBROUTINE SECONDHH !/ ------------------------------------------------------------------- / !/ !> @@ -4971,52 +4924,40 @@ END SUBROUTINE SECONDHH !> !> @author P. Janssen @date 29-Mar-2024 !> - SUBROUTINE SKEWNESS(A) - -!-------------------------------------------------------------------- - -!*****SKEWNESS** COMPUTES PARAMETERS OF THE NEARLY-GAUSSIAN -! DISTRIBUTION OF OCEAN WAVES AT A FIXED GRID POINT. - -! P.JANSSEN JULY 1997 - -! PURPOSE -! ------- -! DETERMINES SKEWNESS PARAMETERS IN ORDER TO OBTAIN -! CORRECTION ON ALTIMETER WAVE HEIGHT. - -! INTERFACE -! --------- -! *CALL* *SKEWNESS(IU06,F1,NCOLL,XKAPPA1,DELH_ALT)* - - - -! METHOD -! ------ -! EVALUATE DEVIATIONS FROM GAUSSIANITY FOLLOWING THE WORK -! OF SROKOSZ AND LONGUET-HIGGINS. FOR SECOND ORDER -! CORRECTIONS TO SURFACE ELEVATION THE APPROACH OF -! ZAKHAROV HAS BEEN USED. - -! EXTERNALS -! --------- -! NONE - -! REFERENCES -! ---------- -! M.A. SROKOSZ, J.G.R.,91,995-1006(1986) -! V.E. ZAKHAROV, HAMILTONIAN APPROACH(1967) -!-------------------------------------------------------------------- - - - -!-------------------------------------------------------------------- -! *TH* REAL DIRECTIONS IN RADIANS. -USE CONSTANTS, ONLY: GRAV, TPI, TPIINV -USE W3GDATMD, ONLY: NK, NTH, XFR, SIG, DTH, ECOS, ESIN, NSEAL -USE W3PARALL, ONLY: INIT_GET_ISEA -USE W3ADATMD, ONLY: CG, SKEW, EMBIA1, EMBIA2 - + SUBROUTINE SKEWNESS(A) + + !-------------------------------------------------------------------- + !*****SKEWNESS** COMPUTES PARAMETERS OF THE NEARLY-GAUSSIAN + ! DISTRIBUTION OF OCEAN WAVES AT A FIXED GRID POINT. + ! P.JANSSEN JULY 1997 + ! PURPOSE + ! ------- + ! DETERMINES SKEWNESS PARAMETERS IN ORDER TO OBTAIN + ! CORRECTION ON ALTIMETER WAVE HEIGHT. + ! INTERFACE + ! --------- + ! *CALL* *SKEWNESS(IU06,F1,NCOLL,XKAPPA1,DELH_ALT)* + ! METHOD + ! ------ + ! EVALUATE DEVIATIONS FROM GAUSSIANITY FOLLOWING THE WORK + ! OF SROKOSZ AND LONGUET-HIGGINS. FOR SECOND ORDER + ! CORRECTIONS TO SURFACE ELEVATION THE APPROACH OF + ! ZAKHAROV HAS BEEN USED. + ! EXTERNALS + ! --------- + ! NONE + ! REFERENCES + ! ---------- + ! M.A. SROKOSZ, J.G.R.,91,995-1006(1986) + ! V.E. ZAKHAROV, HAMILTONIAN APPROACH(1967) + !-------------------------------------------------------------------- + + !-------------------------------------------------------------------- + ! *TH* REAL DIRECTIONS IN RADIANS. + USE CONSTANTS, ONLY: GRAV, TPI, TPIINV + USE W3GDATMD, ONLY: NK, NTH, XFR, SIG, DTH, ECOS, ESIN, NSEAL + USE W3PARALL, ONLY: INIT_GET_ISEA + USE W3ADATMD, ONLY: CG, SKEW, EMBIA1, EMBIA2 IMPLICIT NONE @@ -5035,7 +4976,7 @@ SUBROUTINE SKEWNESS(A) REAL(KIND=4), DIMENSION(0:3,0:2,0:2) :: XMU, XLAMBDA REAL(KIND=4), DIMENSION(:) , ALLOCATABLE:: SIGHF, DFIMHF, FAK -! ---------------------------------------------------------------------- + ! ---------------------------------------------------------------------- NKHF=NK+13 ! same offset as in ECWAM @@ -5049,14 +4990,13 @@ SUBROUTINE SKEWNESS(A) ALLOCATE(F2(NTH,NKHF)) ALLOCATE(SIGHF(NKHF), DFIMHF(NKHF), FAK(NKHF)) -! 1. COMPUTATION OF FREQUENCY-DIRECTION INCREMENT -! ----------------------------------------------- + ! 1. COMPUTATION OF FREQUENCY-DIRECTION INCREMENT + ! ----------------------------------------------- MSTART = 1 - #ifdef W3_OMPG - !$OMP PARALLEL DO PRIVATE(JSEA) + !$OMP PARALLEL DO PRIVATE(JSEA) #endif DO JSEA=1, NSEAL XMU(:,:,:) = 0.0 @@ -5064,8 +5004,8 @@ SUBROUTINE SKEWNESS(A) DO M=1,NK CONX = TPIINV / SIG(M) * CG(M,JSEA) F2(K,M)=A(K,M,JSEA)/ CONX - END DO END DO + END DO SIGHF(1) = SIG(1) DO M=2,NKHF @@ -5083,7 +5023,7 @@ SUBROUTINE SKEWNESS(A) FAK(M) = (SIGHF(M))**2/GRAV ENDDO -! Deals with the tail ... + ! Deals with the tail ... DO M=NK+1,NKHF FH=(SIGHF(NK)/SIGHF(M))**5 DO K=1,NTH @@ -5091,8 +5031,8 @@ SUBROUTINE SKEWNESS(A) ENDDO ENDDO -! 2. COMPUTATION OF THE SKEWNESS COEFFICIENTS -! -------------------------------------------- + ! 2. COMPUTATION OF THE SKEWNESS COEFFICIENTS + ! -------------------------------------------- DO M1=MSTART,NKHF DO M2=MSTART,NKHF @@ -5120,8 +5060,8 @@ SUBROUTINE SKEWNESS(A) ENDDO -! 3. COMPUTATION OF THE NORMALISED SKEWNESS COEFFICIENTS -! ------------------------------------------------------ + ! 3. COMPUTATION OF THE NORMALISED SKEWNESS COEFFICIENTS + ! ------------------------------------------------------ DO I=0,3 XPI = 0.5*FLOAT(I) @@ -5149,13 +5089,12 @@ SUBROUTINE SKEWNESS(A) END DO ! end of loop on JSEA ! #ifdef W3_OMPG - !$OMP END PARALLEL DO + !$OMP END PARALLEL DO #endif DEALLOCATE(FAC0,FAC1,FAC2,FAC3) DEALLOCATE(F2,SIGHF,DFIMHF,FAK) - - END SUBROUTINE SKEWNESS + END SUBROUTINE SKEWNESS END MODULE W3IOGOMD