WAVEWATCH III  beta 0.0.1
w3sic2md.F90
Go to the documentation of this file.
1 
10 
11 #include "w3macros.h"
12 !/ ------------------------------------------------------------------- /
27 MODULE w3sic2md
28  !/
29  !/ +-----------------------------------+
30  !/ | WAVEWATCH III NOAA/NCEP |
31  !/ | E. Rogers |
32  !/ | S. Zieger |
33  !/ | F. Ardhuin & G. Boutin |
34  !/ | FORTRAN 90 |
35  !/ | Last update : 05-Jan-2018 |
36  !/ +-----------------------------------+
37  !/
38  !/ 10-Mar-2014 : Generalization with turbulent BL ( version 5.01 )
39  !/ 05-Jan-2018 : Addition of floe size effect ( version 6.04 )
40  !/
41  !/ For updates see W3SIC1 documentation.
42  !/
43  ! 1. Purpose :
44  !
45  ! Calculate ice dissipation source term S_{ice}.
46  ! Exponential decay rate according to Liu et al., which
47  ! uses as input: 1) ice thickness, and 2) an eddy
48  ! viscosity parameter. This method is non-uniform in
49  ! frequency. This is discussed further below, in
50  ! subroutine "LIU_REVERSE_DISPERSION".
51  !
52  ! Includes generalization by F. Ardhuin with viscous and tubulent
53  ! boundary layers. That part is activating by setting namelist
54  ! parameters that define the under-ice roughness and a friction
55  ! coefficient. For example: &IC2 IC2TURB = 1. , IC2ROUGH =0.0001
56  !
57  ! References for Subtype 2:
58  ! Liu et al. 1991: JGR 96 (C3), 4605-4621
59  ! Liu and Mollo 1988: JPO 18 1720-1712
60  ! Stopa et al. 2016: The Cryosphere
61  !
62  ! 2. Variables and types :
63  !
64  ! 3. Subroutines and functions :
65  !
66  ! Name Type Scope Description
67  ! ----------------------------------------------------------------
68  ! W3SIC2 Subr. Public Ice source term.
69  ! ----------------------------------------------------------------
70  !
71  ! 4. Subroutines and functions used :
72  !
73  ! See subroutine documentation.
74  !
75  ! 5. Remarks :
76  !
77  ! Reference:Rogers, W.E. and M.D. Orzech, 2013: Implementation and
78  ! Testing of Ice and Mud Source Functions in WAVEWATCH III(R),
79  ! NRL/MR/7320--13-9462, 31pp.
80  ! available from http://www7320.nrlssc.navy.mil/pubs.php
81  ! Direct link:
82  ! http://www7320.nrlssc.navy.mil/pubs/2013/rogers2-2013.pdf
83  !
84  ! 6. Switches :
85  !
86  ! See subroutine documentation.
87  !
88  ! 7. Source code :
89  !/
90  !/ ------------------------------------------------------------------- /
91  !/
92  PUBLIC :: w3sic2
93  !/
94 CONTAINS
95  !/ ------------------------------------------------------------------- /
120  SUBROUTINE w3sic2 (A, DEPTH, ICEH, ICEF, CG, WN, IX, IY, S, D, WN_R, &
121  CG_ICE, ALPHA, R)
122  !/
123  !/ +-----------------------------------+
124  !/ | WAVEWATCH III NOAA/NCEP |
125  !/ | E. Rogers |
126  !/ | S. Zieger |
127  !/ | F. Ardhuin & G. Boutin |
128  !/ | FORTRAN 90 |
129  !/ | Last update : 04-Jan-2018 |
130  !/ +-----------------------------------+
131  !/
132  !/ 16-Oct-2012 : Origination. ( version 4.04 )
133  !/ (E. Rogers)
134  !/ 09-Oct-2013 : W3SIC1 SUBTYPE=2 outsourced to W3SIC2 (S. Zieger)
135  !/ 10-Mar-2014 : Generalization with turbulent BL ( version 5.01 )
136  !/ 16-Feb-2016 : Passes ICEH as parameter ( version 5.10 )
137  !/ 02-May-2016 : Call to Liu disp moved to w3srce ( version 5.10 )
138  !/ 04-Jan-2018 : Includes floe size dependance ( version 6.02 )
139  !/ FIXME : Move field input to W3SRCE and provide
140  !/ (S.Zieger) input parameter to W3SIC1 to make the subroutine
141  !/ : versatile for point output processors ww3_outp
142  !/ and ww3_ounp.
143  !/
144  !/ Copyright 2009 National Weather Service (NWS),
145  !/ National Oceanic and Atmospheric Administration. All rights
146  !/ reserved. WAVEWATCH III is a trademark of the NWS.
147  !/ No unauthorized use without permission.
148  !/
149  ! 1. Purpose :
150  !
151  ! S_{ice} source term using 5 parameters read from input files.
152  ! These parameters are allowed to vary in space and time.
153  ! The parameters control the exponential decay rate k_i
154  ! Since there are 5 parameters, this permits description of
155  ! dependence of k_i on frequency or wavenumber.
156  !
157  !/ ------------------------------------------------------------------- /
158  !
159  ! 2. Method :
160  !
161  ! Regarding i/o (general to all Sice modules): S_{ice} source term
162  ! is calculated using up to 5 parameters read from input files.
163  ! These parameters are allowed to vary in space and time.
164  ! The parameters control the exponential decay rate k_i
165  ! Since there are 5 parameters, this permits description of
166  ! dependence of k_i on frequency or wavenumber.
167  !
168  ! Sea ice affects the wavenumber k of wind-generated ocean waves.
169  ! The ice-modified wavenumber can be expressed as a complex number
170  ! k = k_r + i*k_i, with the real part k_r representing impact of
171  ! the sea ice on the physical wavelength and propagation speeds,
172  ! producing something analogous to shoaling and refraction by
173  ! bathymetry, whereas the imaginary part of the complex
174  ! wavenumber, k_i, is an exponential decay coefficient
175  ! k_i(x,y,t,sigma) (depending on location, time and frequency,
176  ! respectively), representing wave attenuation, and can be
177  ! introduced in a wave model such as WW3 as S_ice/E=-2*Cg*k_i,
178  ! where S_ice is one of several dissipation mechanisms, along
179  ! with whitecapping, for example, S_ds=S_wc+S_ice+⋯. The k_r -
180  ! modified by ice would enter the model via the C calculations
181  ! on the left-hand side of the governing equation.The fundamentals
182  ! are straightforward, e.g. Rogers and Holland (2009 and
183  ! subsequent unpublished work) modified a similar model, SWAN
184  ! (Booij et al. 1999) to include the effects of a viscous mud
185  ! layer using the same approach (k = k_r + i*k_i) previously.
186  !
187  ! General approach is analogous to Rogers and Holland (2009)
188  ! approach for mud.
189  ! See text near their eq. 1 :
190  ! k = k_r + i * k_i
191  ! eta(x,t) = Real( a * exp( i * ( k * x - sigma * t ) ) )
192  ! a = a0 * exp( -k_i * x )
193  ! S / E = -2 * Cg * k_i (see also Komen et al. (1994, pg. 170)
194  !
195  ! Please note that S is source term for action.
196  !
197  ! Notes regarding numerics:
198  ! (Note by F. Ardhuin: these may not apply in version 5 thanks to splitting
199  ! of ice source terms and implicit integration in W3SRCE)
200  ! Experiments with constant k_i values suggest that :
201  ! for dx=20.0 km, k_i should not exceed 3.5e-6
202  ! (assumes 2.7% Hs error in my particular test case is intolerable)
203  ! for dx=5.0 km, k_i should not exceed 2.0e-5
204  ! for dx=2.5 km, k_i should not exceed 5.0e-5
205  ! for dx=1.0 km, k_i should not exceed 2.0e-4
206  ! for dx=0.35 km, error is less than 2.1% for all k_i tested
207  ! for dx=0.10 km, error is less than 1.3% for all k_i tested
208  ! "Ground truth" used for this is an exponential decay profile.
209  !
210  ! For reference, ACNFS is 1/12th deg, so delta_latitude=9.25 km.
211  !
212  ! {put more equations here}
213  !
214  ! The laminar to turbulent transition is described in
215  ! Stopa et al. (The Cryosphere, 2016).
216  !
217  ! 3. Parameters :
218  !
219  ! Parameter list
220  ! ----------------------------------------------------------------
221  ! A R.A. I Action density spectrum (1-D)
222  ! DEPTH Real I Local water depth
223  ! ICEH Real I Ice thickness
224  ! CG R.A. I Group velocities
225  ! WN R.A. I Wavenumbers
226  ! IX,IY I.S. I Grid indices
227  ! S R.A. O Source term (1-D version)
228  ! D R.A. O Diagonal term of derivative (1-D version)
229  ! WN_R R.A. I Wavenumbers in ice
230  ! CG_ICE R.A. I Group velocities in ice
231  ! ALPHA R.A. I Exponential decay rate of energy
232  ! R R.A. I Ratio of energy to wave energy without ice
233  ! ICEF Real I Ice Floe diameter
234  !
235  ! imported via module:
236  ! ICEP2 R.A. I Eddy viscosity
237  ! ----------------------------------------------------------------
238  !
239  ! 4. Subroutines used :
240  !
241  ! Name Type Module Description
242  ! ----------------------------------------------------------------
243  ! STRACE Subr. W3SERVMD Subroutine tracing (!/S switch).
244  ! PRT2DS Subr. W3ARRYMD Print plot output (!/T1 switch).
245  ! OUTMAT Subr. W3ARRYMD Matrix output (!/T2 switch).
246  ! ----------------------------------------------------------------
247  !
248  ! 5. Called by :
249  !
250  ! Name Type Module Description
251  ! ----------------------------------------------------------------
252  ! W3SRCE Subr. W3SRCEMD Source term integration.
253  ! W3EXPO Subr. N/A ASCII Point output post-processor.
254  ! W3EXNC Subr. N/A NetCDF Point output post-processor.
255  ! GXEXPO Subr. N/A GrADS point output post-processor.
256  ! ----------------------------------------------------------------
257  !
258  ! 6. Error messages :
259  !
260  ! None.
261  !
262  ! 7. Remarks :
263  !
264  ! If ice parameter 1 is zero, no calculations are made.
265  !
266  ! 8. Structure :
267  !
268  ! See source code.
269  !
270  ! 9. Switches :
271  !
272  ! !/S Enable subroutine tracing.
273  ! !/T Enable general test output.
274  ! !/T0 2-D print plot of source term.
275  ! !/T1 Print arrays.
276  !
277  ! 10. Source code :
278  !
279  !/ ------------------------------------------------------------------- /
280  USE constants
281  USE w3odatmd, ONLY: ndse
282  USE w3servmd, ONLY: extcde
283  USE w3dispmd
284  USE w3gdatmd, ONLY: nk, nth, nspec, sig, mapwn, ic2pars, dden, &
286  USE w3idatmd, ONLY: inflags2,icep1,icep2,icep3,icep4,icep5,icei
287 #ifdef W3_T
288  USE w3odatmd, ONLY: ndst
289 #endif
290 #ifdef W3_S
291  USE w3servmd, ONLY: strace
292 #endif
293 #ifdef W3_T0
294  USE w3arrymd, ONLY: prt2ds
295 #endif
296 #ifdef W3_T1
297  USE w3arrymd, ONLY: outmat
298 #endif
299  !
300  IMPLICIT NONE
301  !/
302  !/ ------------------------------------------------------------------- /
303  !/ Parameter list
304  REAL, INTENT(IN) :: a(nspec), depth, iceh
305  REAL, INTENT(IN) :: cg(nk), wn(nk)
306  REAL, INTENT(OUT) :: s(nspec), d(nspec)
307  REAL, INTENT(IN) :: alpha(nk) ! exponential (spatial) decay rate for energy (1/m)
308  INTEGER, INTENT(IN) :: ix, iy
309  REAL, INTENT(IN) :: wn_r(nk), cg_ice(nk), r(nk)
310  REAL, INTENT(IN) :: icef ! Hypothesis: friction does not occur for broken ice
311 
312  !/
313  !/ ------------------------------------------------------------------- /
314  !/ Local parameters
315  !/
316 #ifdef W3_S
317  INTEGER, SAVE :: ient = 0
318 #endif
319 #ifdef W3_T0
320  REAL :: dout(nk,nth)
321 #endif
322  INTEGER :: ikth, ik
323  REAL :: d1d(nk) !In SBT1: D1D was named "CBETA"
324  REAL :: icecoef1, icecoef2, iceconc
325  REAL, ALLOCATABLE :: wn_i(:) ! exponential (spatial) decay rate for amplitude (1/m)
326  REAL :: viscm=1.83e-6 ! molecular viscosity of water at freezing
327  REAL :: pturb, pvisc, dturb, dvisc, &
328  smooth, re, uorb, aorb, eb, &
329  deli1, deli2, fw, xi, fturb, &
330  cg_eff(nk), wlg_r(nk), smooth_dmax(nk)
331  INTEGER :: ind, ith, is
332  LOGICAL :: noice=.false.
333  ! Warning, ALPHA = 2 * WN_I -> Makes WN_I useless, doesnt it ?
334  !/
335  !/ ------------------------------------------------------------------- /
336  !/
337 #ifdef W3_S
338  CALL strace (ient, 'W3SIC2')
339 #endif
340  !
341  ! 0. Initializations ------------------------------------------------ *
342  !
343  d = 0.0
344  !
345  ALLOCATE(wn_i(nk))
346  wn_i = 0.0
347  icecoef1 = iceh
348  icecoef2 = 0.0
349  iceconc = 0.0
350  cg_eff = 0.
351  smooth_dmax(:)=1.
352  !
353  IF (inflags2(-7))icecoef1 = iceh
354  IF (inflags2(-6))icecoef2 = icep2(ix,iy)
355  IF (inflags2(4)) iceconc = icei(ix,iy)
356  !
357  !
358  ! 1. No ice --------------------------------------------------------- /
359  !
360  noice=.false.
361  IF (icecoef1==0.0) noice=.true.
362  IF (inflags2(4).AND.(iceconc==0.0)) noice=.true.
363 
364  IF ( noice ) THEN
365  d = 0.0
366  !
367  ! 2. Ice ------------------------------------------------------------ /
368  ELSE
369  !
370  ! 2.a Set constant(s) and write test output -------------------------- /
371  !
372  ! (none)
373  !
374 #ifdef W3_T38
375  WRITE (ndst,9000) depth,icecoef1,icecoef2
376 #endif
377  !
378  ! 2.b Make calculations ---------------------------------------------- /
379 
380  ! ICECOEF1 = H_ICE
381  ! ICECOEF2 = VISC
382  !
383  ! Branches out depending on choice of dispersion relation...
384  ! by default IC2PARS(1)=0, and attenuation computed as described in Stopa et al. 2016
385  !
386  IF (ic2pars(1).GT.0.5) THEN
387  IF (.NOT.inflags2(-7))THEN
388  WRITE (ndse,1001) 'ICE PARAMETER 1'
389  CALL extcde(2)
390  ENDIF
391  IF (.NOT.inflags2(-6))THEN
392  WRITE (ndse,1001) 'ICE PARAMETER 2'
393  CALL extcde(2)
394  ENDIF
395  !
396  wn_i(:) = 0.5 * alpha(:) ! ALPHA=2*WN_I
397  DO ik=1, nk
398  ! recall that D=S/E=-2*Cg*k_i
399  ! Note: We should not use CG_ICE here unless CG_ICE is also
400  ! used for advection in w3wavemd.ftn (see lines for IC3
401  ! there).
402  d1d(ik)= -2.0 * cg(ik) * wn_i(ik)
403  END DO
404  !
405  ! Alternative by F.A.: generalization to a turbulent boundary layer
406  ! uses the ice-free dispersion, to be updated later
407  !
408  ELSE ! goes here if IC2PARS(1).LE.0.5 (this is the default behavior)
409  IF (ic2pars(2).GT.0.) THEN
410  uorb=0.
411  aorb=0.
412  fturb = ic2pars(2)
413  ! Special treatment in the southern ocean ...
414  IF (ic2pars(7).GT.0) THEN
415  IF (ygrd(iy,ix).LT.0.AND.gtype.EQ.rlgtype.AND.flagll) fturb = ic2pars(7)
416  END IF
417  DO ik=1, nk
418  eb = 0.
419  DO ith=1, nth
420  is=ith+(ik-1)*nth
421  eb = eb + a(is)
422  END DO
423  !
424  ! UORB and AORB are the variances of the orbital velocity and surface elevation
425  ! of the water relative to the ice ... this is only correct if the ice layer
426  ! does not move. This should is changed by taking into account DMAX when IC2DMAX > 0:
427  !
428 #ifdef W3_IS2
429  IF (ic2pars(8).GT.0) THEN
430  wlg_r(ik)=tpi/wn_r(ik)
431  smooth_dmax(ik)= (0.5*(1+tanh((icef-ic2pars(8)*wlg_r(ik))/(icef*0.5))))**2
432  END IF
433 #endif
434  !
435  IF (r(ik).GT.1.) THEN
436  uorb = uorb + eb * smooth_dmax(ik)* sig(ik)**2 * dden(ik) / cg(ik) &
437  / (r(ik)*cg_ice(ik)/cg(ik))
438  aorb = aorb + eb * smooth_dmax(ik) * dden(ik) / cg(ik) &
439  / (r(ik)*cg_ice(ik)/cg(ik)) !deep water only
440  ELSE
441  uorb = uorb + eb * smooth_dmax(ik) *sig(ik)**2 * dden(ik) / cg(ik)
442  aorb = aorb + eb * smooth_dmax(ik) * dden(ik) / cg(ik) !deep water only
443  END IF
444 
445  END DO
446  !
447  aorb = 2*sqrt(aorb) ! significant amplitude
448  uorb = 2*sqrt(uorb) ! significant amplitude
449 
450  re = uorb*aorb / viscm
451  smooth = 0.5*tanh((re-ic2pars(4))/ic2pars(5))
452  pturb=(0.5+smooth)
453  pvisc=(0.5-smooth)
454 
455  xi=(alog10(max(aorb/ic2pars(3),3.))-abmin)/delab
456  ind = min(sizefwtable-1, int(xi))
457  deli1= min(1. ,xi-float(ind))
458  deli2= 1. - deli1
459  fw =fwtable(ind)*deli2+fwtable(ind+1)*deli1
460  dturb= fturb*fw*uorb/grav
461  ELSE ! so case of IC2PARS(2).LE.0.
462  dturb = 0.
463  pturb = 0.
464  pvisc = 1.
465  END IF ! IF (IC2PARS(2).GT.0.)
466  !
467  DO ik=1, nk
468  ! WN_R is used here but warning, this is only OK for unbroken ice
469  dvisc = ic2pars(6) * wn_r(ik) * sqrt(viscm* sig(ik) / 2.)
470  d1d(ik) = -1.*(pturb*max(dturb*sig(ik)**2,dvisc) + pvisc*dvisc) &
471  *smooth_dmax(ik)
472  END DO
473  END IF ! IF (IC2PARS(1).GT.0.5)
474 
475  !
476  ! 2.c Fill diagional matrix
477  !
478  DO ikth=1, nspec
479  d(ikth) = d1d(mapwn(ikth))
480  END DO
481  !
482  END IF ! IF ( NOICE ) THEN
483  !
484  s = d * a
485  !
486  ! ... Test output of arrays
487  !
488 #ifdef W3_T0
489  DO ik=1, nk
490  DO ith=1, nth
491  dout(ik,ith) = d(ith+(ik-1)*nth)
492  END DO
493  END DO
494  CALL prt2ds (ndst, nk, nk, nth, dout, sig(1:), ' ', 1., &
495  0.0, 0.001, 'Diag Sice', ' ', 'NONAME')
496 #endif
497  !
498 #ifdef W3_T1
499  CALL outmat (ndst, d, nth, nth, nk, 'diag Sice')
500 #endif
501  !
502  ! Formats
503  !
504 1001 FORMAT (/' *** WAVEWATCH III ERROR IN W3SIC2 : '/ &
505  ' ',a,' REQUIRED BUT NOT SELECTED'/)
506  !
507 #ifdef W3_T38
508 9000 FORMAT (' TEST W3SIC2 : DEPTH,ICECOEF1 : ',2e10.3)
509 #endif
510  !/
511  !/ End of W3SIC2 ----------------------------------------------------- /
512  !/
513  END SUBROUTINE w3sic2
514 
515  !/
516  !/ End of module W3SIC2MD -------------------------------------------- /
517  !/
518 END MODULE w3sic2md
w3gdatmd::nk
integer, pointer nk
Definition: w3gdatmd.F90:1230
constants::abmin
real, parameter abmin
ABMIN.
Definition: constants.F90:94
w3gdatmd::ygrd
double precision, dimension(:,:), pointer ygrd
Definition: w3gdatmd.F90:1205
w3gdatmd::nspec
integer, pointer nspec
Definition: w3gdatmd.F90:1230
w3gdatmd::rlgtype
integer, parameter rlgtype
Definition: w3gdatmd.F90:624
w3idatmd::inflags2
logical, dimension(:), pointer inflags2
Definition: w3idatmd.F90:260
w3gdatmd::sig
real, dimension(:), pointer sig
Definition: w3gdatmd.F90:1234
w3sic2md::w3sic2
subroutine, public w3sic2(A, DEPTH, ICEH, ICEF, CG, WN, IX, IY, S, D, WN_R, CG_ICE, ALPHA, R)
S_{ice} source term using 5 parameters read from input files.
Definition: w3sic2md.F90:122
w3arrymd::outmat
subroutine outmat(NDS, A, MX, NX, NY, MNAME)
Definition: w3arrymd.F90:988
w3odatmd::ndse
integer, pointer ndse
Definition: w3odatmd.F90:456
constants::sizefwtable
integer, parameter sizefwtable
SIZEFWTABLE.
Definition: constants.F90:91
w3servmd
Definition: w3servmd.F90:3
w3gdatmd::nth
integer, pointer nth
Definition: w3gdatmd.F90:1230
w3odatmd
Definition: w3odatmd.F90:3
constants::tpi
real, parameter tpi
TPI 2*Pi.
Definition: constants.F90:72
w3servmd::strace
subroutine strace(IENT, SNAME)
Definition: w3servmd.F90:148
constants::fwtable
real, dimension(0:sizefwtable) fwtable
FWTABLE.
Definition: constants.F90:92
w3gdatmd::gtype
integer, pointer gtype
Definition: w3gdatmd.F90:1094
w3idatmd
Define data structures to set up wave model input data for several models simultaneously.
Definition: w3idatmd.F90:16
w3gdatmd::mapwn
integer, dimension(:), pointer mapwn
Definition: w3gdatmd.F90:1231
w3arrymd
Definition: w3arrymd.F90:3
w3gdatmd::ic2pars
real, dimension(:), pointer ic2pars
Definition: w3gdatmd.F90:1145
w3odatmd::ndst
integer, pointer ndst
Definition: w3odatmd.F90:456
constants
Define some much-used constants for global use (all defined as PARAMETER).
Definition: constants.F90:20
constants::delab
real delab
DELAB.
Definition: constants.F90:93
w3gdatmd::dden
real, dimension(:), pointer dden
Definition: w3gdatmd.F90:1234
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
w3dispmd
Definition: w3dispmd.F90:3
constants::grav
real, parameter grav
GRAV Acc.
Definition: constants.F90:61
w3sic2md
Calculate ice dissipation source term S_{ice}.
Definition: w3sic2md.F90:27
w3gdatmd::flagll
logical, pointer flagll
Definition: w3gdatmd.F90:1219