From 9085bd37a3480c8905b792f9396e2c32ea90d316 Mon Sep 17 00:00:00 2001 From: Ahmad Nawab Date: Wed, 27 Mar 2024 10:02:46 +0000 Subject: [PATCH] Restore peak_ang and stress_gc --- src/ecwam/peak_ang.F90 | 10 ++++++---- src/ecwam/stress_gc.F90 | 13 ++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/ecwam/peak_ang.F90 b/src/ecwam/peak_ang.F90 index 950fca0d9..b83603927 100644 --- a/src/ecwam/peak_ang.F90 +++ b/src/ecwam/peak_ang.F90 @@ -75,8 +75,9 @@ SUBROUTINE PEAK_ANG(KIJS, KIJL, FL1, XNU, SIG_TH) !*** 1. DETERMINE L-H SPECTRAL WIDTH OF THE 2-D SPECTRUM. ! --------------------------------------------------- - ZEPSILON = 10._JWRB*EPSILON(ZEPSILON) - NSH = 1 + INT(LOG(1.5_JWRB)/LOG(FRATIO)) + ZEPSILON=10._JWRB*EPSILON(ZEPSILON) + + NSH = 1 + INT(LOG(1.5_JWRB)/LOG(FRATIO)) DO IJ=KIJS,KIJL SUM0(IJ)= ZEPSILON @@ -147,9 +148,10 @@ SUBROUTINE PEAK_ANG(KIJS, KIJL, FL1, XNU, SIG_TH) DO IJ=KIJS,KIJL MMSTART = MAX(1,MMAX(IJ)-NSH) MMSTOP = MIN(NFRE,MMAX(IJ)+NSH) + + SUM_S(IJ) = 0._JWRB + SUM_C(IJ) = ZEPSILON DO M=MMSTART,MMSTOP - SUM_S(IJ) = 0._JWRB - SUM_C(IJ) = ZEPSILON DO K=1,NANG SUM_S(IJ) = SUM_S(IJ) +SINTH(K)*FL1(IJ,K,M) SUM_C(IJ) = SUM_C(IJ) +COSTH(K)*FL1(IJ,K,M) diff --git a/src/ecwam/stress_gc.F90 b/src/ecwam/stress_gc.F90 index 0558578df..099ff16af 100644 --- a/src/ecwam/stress_gc.F90 +++ b/src/ecwam/stress_gc.F90 @@ -61,7 +61,7 @@ REAL(KIND=JWRB) FUNCTION STRESS_GC(ANG_GC, USTAR, Z0, Z0MIN, HALP, RNFAC) REAL(KIND=JWRB) :: CONST, ZN REAL(KIND=JWRB) :: GAMNORMA ! RENORMALISATION FACTOR OF THE GROWTH RATE REAL(KIND=JPHOOK) :: ZHOOK_HANDLE - REAL(KIND=JWRB) :: GAM_W + REAL(KIND=JWRB), DIMENSION(NWAV_GC) :: GAM_W ! INCLUDE FUNCTIONS FROM GRAVITY-CAPILLARY DISPERSION REALTIONS #include "gc_dispersion.h" @@ -96,12 +96,12 @@ REAL(KIND=JWRB) FUNCTION STRESS_GC(ANG_GC, USTAR, Z0, Z0MIN, HALP, RNFAC) ZLOG = XLOG - LOG(XLAMBDA) ZLOG = MIN(ZLOG, 0.0_JWRB) ZLOG2X = ZLOG*ZLOG*X + GAM_W(I)= ZLOG2X*ZLOG2X*EXP(XLOG)*OM3GMKM_GC(I) ENDDO - GAM_W = ZLOG2X*ZLOG2X*EXP(XLOG)*OM3GMKM_GC(NS) - ZN = CONST*XKMSQRTVGOC2_GC(NS)*GAM_W + ZN = CONST*XKMSQRTVGOC2_GC(NS)*GAM_W(NS) GAMNORMA = (1.0_JWRB + RN1_RN*ZN)/(1.0_JWRB + ZN) - TAUWCG = GAM_W * DELKCC_GC_NS(NS) * OMXKM3_GC(NS) * GAMNORMA + TAUWCG = GAM_W(NS) * DELKCC_GC_NS(NS) * OMXKM3_GC(NS) * GAMNORMA DO I = NS+1, NWAV_GC ! ANALYTICAL FORM INERTIAL SUB RANGE F(k) = k**(-4)*BB ! BB = HALP * C2OSQRTVG_GC(NS)*SQRT(VG_GC(I))/C_GC(I)**2 @@ -112,10 +112,9 @@ REAL(KIND=JWRB) FUNCTION STRESS_GC(ANG_GC, USTAR, Z0, Z0MIN, HALP, RNFAC) ! Tauwcg : integral of omega * gammma_wam * F(k) k dk ! It should be done in vector form with actual directional spreading information ! It simplified here by using the ANG_GC factor. - GAM_W = ZLOG2X*ZLOG2X*EXP(XLOG)*OM3GMKM_GC(I) - ZN = CONST*XKMSQRTVGOC2_GC(I)*GAM_W + ZN = CONST*XKMSQRTVGOC2_GC(I)*GAM_W(I) GAMNORMA = (1.0_JWRB + RN1_RN*ZN)/(1.0_JWRB + ZN) - TAUWCG = TAUWCG + GAM_W * DELKCC_OMXKM3_GC(I) * GAMNORMA + TAUWCG = TAUWCG + GAM_W(I) * DELKCC_OMXKM3_GC(I) * GAMNORMA ENDDO STRESS_GC = MAX(ZABHRC * TAUWCG, TAUWCG_MIN)