-
Notifications
You must be signed in to change notification settings - Fork 0
/
wwm_femeanws.F90
126 lines (96 loc) · 3.75 KB
/
wwm_femeanws.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
SUBROUTINE FEMEANWS (F, IJS, IJL, EM, FM, XLLWS)
! ----------------------------------------------------------------------
!**** *FEMEANWS* - COMPUTATION OF MEAN ENERGY, MEAN FREQUENCY
! FOR WINDSEA PART OF THE SPECTRUM AS DETERMINED
! BY THE EMPIRICAL LAW BASED ON WAVE AGE AND
! THE DIRECTIOn WITH RESPECT TO THE WIND DIRECTION
! (SEE LLWS)
!* PURPOSE.
! --------
! COMPUTE MEAN FREQUENCY AT EACH GRID POINT FOR PART OF THE
! SPECTRUM WHERE LLWS IS TRUE OR THE WINDSEA PARAMETRIC LAW
! APPLIES.
!** INTERFACE.
! ----------
! *CALL* *FEMEANWS (F, IJS, IJL, EM, FM)*
! *F* - SPECTRUM.
! *IJS* - INDEX OF FIRST GRIDPOINT
! *IJL* - INDEX OF LAST GRIDPOINT
! *USNEW* - FRICTION VELOCITY
! *THWNEW* - WIND DIRECTION
! *EM* - MEAN WAVE ENERGY (OUTPUT)
! *FM* - MEAN WAVE FREQUENCY (OUTPUT)
! METHOD.
! -------
! NONE.
! EXTERNALS.
! ----------
! NONE.
! REFERENCE.
! ----------
! NONE.
! ----------------------------------------------------------------------
! USE YOWFRED , ONLY : FR ,DFIM ,DFIMOFR ,DELTH ,
! & WETAIL ,FRTAIL ,TH ,C ,FRIC
! USE YOMHOOK ,ONLY : LHOOK, DR_HOOK
! USE YOWPARAM , ONLY : NANG ,NFRE
! USE YOWPCONS , ONLY : G ,ZPI ,EPSMIN
USE DATAPOOL, ONLY : FR, WETAIL, FRTAIL, WP1TAIL, ISHALLO, &
& DFIM, DFIMOFR, DFFR, DFFR2, WK, RKIND, &
& DELTH => DDIR, &
& G => G9, &
& ZPI => PI2, &
& EPSMIN => SMALL, &
& NANG => MDC, &
& NFRE => MSC, &
& INDEP => DEP
! ----------------------------------------------------------------------
IMPLICIT NONE
INTEGER :: IJ,M,K,IJS,IJL
REAL(rkind) :: DELT25, DELT2, CM, CHECKTA
REAL(rkind) :: F(IJS:IJL,NANG,NFRE)
REAL(rkind),DIMENSION(IJS:IJL) :: TEMP2, EM, FM, THRESHOLD
REAL(rkind), DIMENSION(IJS:IJL,NANG,NFRE) :: XLLWS
!REAL ZHOOK_HANDLE
!IF (LHOOK) CALL DR_HOOK('FEMEANWS',0,ZHOOK_HANDLE)
! ----------------------------------------------------------------------
!* 1. INITIALISE MEAN FREQUENCY ARRAY AND TAIL FACTOR.
! ------------------------------------------------
DO IJ=IJS,IJL
EM(IJ) = EPSMIN
FM(IJ) = EPSMIN
ENDDO
DELT25 = WETAIL*FR(NFRE)*DELTH
DELT2 = FRTAIL*DELTH
!* 2. INTEGRATE OVER FREQUENCIES AND DIRECTIONS.
! ------------------------------------------
DO M=1,NFRE
K = 1
DO IJ =IJS,IJL
TEMP2(IJ) = F(IJ,K,M)*XLLWS(IJ,K,M)
ENDDO
DO K=2,NANG
DO IJ=IJS,IJL
TEMP2(IJ) = TEMP2(IJ)+F(IJ,K,M)*XLLWS(IJ,K,M)
ENDDO
ENDDO
DO IJ=IJS,IJL
EM(IJ) = EM(IJ)+TEMP2(IJ)*DFIM(M)
FM(IJ) = FM(IJ)+DFIMOFR(M)*TEMP2(IJ)
!write(*,'(10F20.10)') EM(IJ) , FM(IJ), DFIMOFR(M), DFIM(M), TEMP2(IJ)
ENDDO
ENDDO
!* 3. ADD TAIL CORRECTION TO MEAN FREQUENCY AND
!* NORMALIZE WITH TOTAL ENERGY.
! ------------------------------------------
DO IJ=IJS,IJL
EM(IJ) = EM(IJ)+DELT25*TEMP2(IJ)
FM(IJ) = FM(IJ)+DELT2*TEMP2(IJ)
FM(IJ) = EM(IJ)/FM(IJ)
ENDDO
!IF (LHOOK) CALL DR_HOOK('FEMEANWS',1,ZHOOK_HANDLE)
RETURN
END SUBROUTINE FEMEANWS
! ----------------------------------------------------------------------
!
! ----------------------------------------------------------------------