WAVEWATCH III  beta 0.0.1
w3sis1md.F90
Go to the documentation of this file.
1 
7 
8 #include "w3macros.h"
9 !/ ------------------------------------------------------------------- /
10 
22 MODULE w3sis1md
23  !/
24  !/ +-----------------------------------+
25  !/ | WAVEWATCH III NOAA/NCEP |
26  !/ | S. Zieger |
27  !/ | FORTRAN 90 |
28  !/ | Last update : 20-Dec-2013 |
29  !/ +-----------------------------------+
30  !/
31  !/ For updates see W3SID1 documentation.
32  !/
33  ! 1. Purpose :
34  !
35  ! Diffusion source term.
36  !
37  ! 2. Variables and types :
38  !
39  ! 3. Subroutines and functions :
40  !
41  ! Name Type Scope Description
42  ! ----------------------------------------------------------------
43  ! W3SIS1 Subr. Public Ice scattering term.
44  ! ----------------------------------------------------------------
45  !
46  ! 4. Subroutines and functions used :
47  !
48  ! See subroutine documentation.
49  !
50  ! 5. Remarks :
51  !
52  ! 6. Switches :
53  !
54  ! See subroutine documentation.
55  !
56  ! 7. Source code :
57  !/
58  !/ ------------------------------------------------------------------- /
59  !/
60  PUBLIC :: w3sis1
61  !/
62 CONTAINS
63  !/ ------------------------------------------------------------------- /
74  SUBROUTINE w3sis1 (A, ICE, S)
75  !/
76  !/ +-----------------------------------+
77  !/ | WAVEWATCH III NOAA/NCEP |
78  !/ | S. Zieger |
79  !/ | FORTRAN 90 |
80  !/ | Last update : 20-Dec-2013 |
81  !/ +-----------------------------------+
82  !/
83  !/ 16-Nov-2012 : Origination. ( version 4.14 )
84  !/ (S. Zieger)
85  ! 1. Purpose :
86  ! Spectral reflection due to ice.
87  !
88  !/ ------------------------------------------------------------------- /
89  !
90  ! 2. Method :
91  !
92  ! 3. Parameters :
93  !
94  ! Parameter list
95  ! ----------------------------------------------------------------
96  ! A R.A. I Action density spectrum (1-D)
97  ! ICE Real I Sea ice concentration.
98  ! S R.A. O Source term (1-D version).
99  ! ----------------------------------------------------------------
100  !
101  ! 4. Subroutines used :
102  !
103  ! Name Type Module Description
104  ! ----------------------------------------------------------------
105  ! ----------------------------------------------------------------
106  !
107  ! 5. Called by :
108  !
109  ! Name Type Module Description
110  ! ----------------------------------------------------------------
111  ! W3SRCE Subr. W3SRCEMD Source term integration.
112  ! W3EXPO Subr. N/A ASCII Point output post-processor.
113  ! W3EXNC Subr. N/A NetCDF Point output post-processor.
114  ! GXEXPO Subr. N/A GrADS point output post-processor.
115  ! ----------------------------------------------------------------
116  !
117  ! 6. Error messages :
118  !
119  ! None.
120  !
121  ! 7. Remarks :
122  !
123  ! If ice parameter 1 is zero, no calculations are made.
124  !
125  ! 8. Structure :
126  !
127  ! See source code.
128  !
129  ! 9. Switches :
130  !
131  ! !/S Enable subroutine tracing.
132  ! !/T Enable general test output.
133  ! 2-D print plot of source term.
134  !
135  ! 10. Source code :
136  !
137  !/ ------------------------------------------------------------------- /
138  USE w3odatmd, ONLY: ndse
139  USE w3servmd, ONLY: extcde
140  USE w3gdatmd, ONLY: nk, nth, nspec, sig, sig2, dden2
141  USE w3gdatmd, ONLY: dtmin, th, dth, ecos, dtmin
142  USE w3gdatmd, ONLY: is1c1, is1c2
143 #ifdef W3_T
144  USE w3odatmd, ONLY: ndst
145 #endif
146 #ifdef W3_S
147  USE w3servmd, ONLY: strace
148 #endif
149 #ifdef W3_T
150  USE w3arrymd, ONLY: prt2ds
151 #endif
152  !
153  IMPLICIT NONE
154  !/
155  !/ ------------------------------------------------------------------- /
156  !/ Parameter list
157  REAL, INTENT(IN) :: a(nspec), ice
158  REAL, INTENT(OUT) :: s(nspec)
159  !/
160  !/ ------------------------------------------------------------------- /
161  !/ Local parameters
162  !/
163 #ifdef W3_S
164  INTEGER, SAVE :: ient = 0
165 #endif
166  INTEGER :: ik, ith, ith2, is, is2
167  REAL :: alpha
168 #ifdef W3_T
169  REAL :: sout(nk,nth)
170 #endif
171  !/
172  !/ ------------------------------------------------------------------- /
173  !/
174 #ifdef W3_S
175  CALL strace (ient, 'W3SIS1')
176 #endif
177  !
178  ! 0. Initializations ------------------------------------------------ *
179  !
180  s = 0.
181 #ifdef W3_T
182  sout = 0.
183 #endif
184  !
185  ! Calculate scattering coefficient (linear transfer function) ---- *
186  alpha = max(0., is1c1 * ice + is1c2)
187 #ifdef W3_T
188  WRITE(ndst,8000) alpha
189 #endif
190  !
191  IF (alpha.GT.0. .AND. ice.GT.0.) THEN
192  ! 1. Calculate the derivative ---------------------------------------- *
193  DO ik = 1,nk
194  DO ith = 1,nth
195  is = ith+(ik-1)*nth
196  IF (a(is).GE.0.) THEN
197  s(is) = s(is) - alpha * a(is)
198  DO ith2 = 1,nth
199  is2 = ith2+(ik-1)*nth
200  IF (is2.NE.is) THEN
201  s(is2) = s(is2) + alpha * a(is) / real(nth-1)
202  END IF
203  END DO
204  END IF
205  END DO
206  END DO
207  !
208  s = s / dtmin
209  !
210 #ifdef W3_T
211  DO ik = 1, nk
212  DO ith = 1, nth
213  is = ith+(ik-1)*nth
214  sout(ik,ith) = s(is)
215  END DO
216  END DO
217  CALL prt2ds (ndst, nk, nk, nth, sout, sig(1:nk), ' ', 1., &
218  0.0, 0.001, 'Diag Sir1', ' ', 'NONAME')
219 #endif
220  !
221  END IF
222  ! Formats
223 8000 FORMAT (' TEST W3SIS1 : ALPHA :',e10.3)
224  !
225  !/
226  !/ End of W3SIS1 ----------------------------------------------------- /
227  !/
228  END SUBROUTINE w3sis1
229  !/
230  !/ End of module W3SIS1MD -------------------------------------------- /
231  !/
232 END MODULE w3sis1md
w3gdatmd::nk
integer, pointer nk
Definition: w3gdatmd.F90:1230
w3gdatmd::dth
real, pointer dth
Definition: w3gdatmd.F90:1232
w3gdatmd::nspec
integer, pointer nspec
Definition: w3gdatmd.F90:1230
w3gdatmd::is1c2
real, pointer is1c2
Definition: w3gdatmd.F90:1426
w3gdatmd::is1c1
real, pointer is1c1
Definition: w3gdatmd.F90:1426
w3sis1md::w3sis1
subroutine, public w3sis1(A, ICE, S)
Spectral reflection due to ice.
Definition: w3sis1md.F90:75
w3gdatmd::sig
real, dimension(:), pointer sig
Definition: w3gdatmd.F90:1234
w3gdatmd::ecos
real, dimension(:), pointer ecos
Definition: w3gdatmd.F90:1234
w3gdatmd::dden2
real, dimension(:), pointer dden2
Definition: w3gdatmd.F90:1234
w3gdatmd::th
real, dimension(:), pointer th
Definition: w3gdatmd.F90:1234
w3odatmd::ndse
integer, pointer ndse
Definition: w3odatmd.F90:456
w3servmd
Definition: w3servmd.F90:3
w3gdatmd::dtmin
real, pointer dtmin
Definition: w3gdatmd.F90:1183
w3gdatmd::nth
integer, pointer nth
Definition: w3gdatmd.F90:1230
w3odatmd
Definition: w3odatmd.F90:3
w3gdatmd::sig2
real, dimension(:), pointer sig2
Definition: w3gdatmd.F90:1234
w3servmd::strace
subroutine strace(IENT, SNAME)
Definition: w3servmd.F90:148
w3arrymd
Definition: w3arrymd.F90:3
w3sis1md
Diffusion source term.
Definition: w3sis1md.F90:22
w3odatmd::ndst
integer, pointer ndst
Definition: w3odatmd.F90:456
w3gdatmd
Definition: w3gdatmd.F90:16
w3servmd::extcde
subroutine extcde(IEXIT, UNIT, MSG, FILE, LINE, COMM)
Definition: w3servmd.F90:736
w3arrymd::prt2ds
subroutine prt2ds(NDS, NFR0, NFR, NTH, E, FR, UFR, FACSP, FSC, RRCUT, PRVAR, PRUNIT, PNTNME)
Definition: w3arrymd.F90:1943