WAVEWATCH III  beta 0.0.1
w3sic4md Module Reference

Calculate ice source term S_{ice} according to simple methods. More...

Functions/Subroutines

subroutine, public w3sic4 (A, DEPTH, CG, IX, IY, S, D)
 S_{ice} source term using 5 parameters read from input files. More...
 

Detailed Description

Calculate ice source term S_{ice} according to simple methods.

Attenuation is a function of frequency and specified directly by the user. Example: a function is based on an exponential fit to the empirical data of Wadhams et al. (1988).

Author
C. Collins
E. Rogers
Date
21-Jan-2015

Function/Subroutine Documentation

◆ w3sic4()

subroutine, public w3sic4md::w3sic4 ( real, dimension(nspec), intent(in)  A,
real, intent(in)  DEPTH,
real, dimension(nk), intent(in)  CG,
integer, intent(in)  IX,
integer, intent(in)  IY,
real, dimension(nspec), intent(out)  S,
real, dimension(nspec), intent(out)  D 
)

S_{ice} source term using 5 parameters read from input files.

Parameters
[in]AAction density spectrum (1-D).
[in]DEPTHLocal water depth.
[in]CGGroup velocities.
[in]IXGrid index.
[in]IYGrid index.
[out]SSource term (1-D version).
[out]DDiagonal term of derivative (1-D version).
Author
C. Collins
E. Rogers
Date
24-Feb-2017

Definition at line 121 of file w3sic4md.F90.

121  !/
122  !/ +-----------------------------------+
123  !/ | WAVEWATCH III NOAA/NCEP |
124  !/ | C. Collins |
125  !/ | E. Rogers |
126  !/ | FORTRAN 90 |
127  !/ | Last update : 24-Feb-2017 |
128  !/ +-----------------------------------+
129  !/
130  !/ 03-Dec-2015 : Origination ( version 5.09 )
131  !/ (starting from IC1) (C. Collins)
132  !/ 03-Dec-2015 : W3SIC4 created, Methods 1,2,3,4 (C. Collins)
133  !/ 21-Jan-2016 : IC4 added to NCEP repository (E. Rogers)
134  !/ 27-Jan-2016 : Method 5 added (step function) (E. Rogers)
135  !/ 08-Apr-2016 : Method 6 added (namelist step funct.) (E. Rogers)
136  !/ 24-Feb-2017 : Corrections to Methods 1,2,3,4 (E. Rogers)
137  !/ 13-Apr-2017 : Method 7 added (Doble et al. 2015) (E. Rogers)
138  !/ 11-Jan-2024 : Method 8 added (Meylan et al. 2018) (E. Rogers)
139  !/ 11-Jan-2024 : Method 9 added (Rogers et al., 2021)
140  !/ denoted "RYW2021" (E. Rogers)
141  !/
142  !/ FIXME : Move field input to W3SRCE and provide
143  !/ (S.Zieger) input parameter to W3SIC1 to make the subroutine
144  !/ : versatile for point output processors ww3_outp
145  !/ and ww3_ounp.
146  !/
147  !/ Copyright 2009 National Weather Service (NWS),
148  !/ National Oceanic and Atmospheric Administration. All rights
149  !/ reserved. WAVEWATCH III is a trademark of the NWS.
150  !/ No unauthorized use without permission.
151  !/
152  ! 1. Purpose :
153  !
154  ! S_{ice} source term using 5 parameters read from input files.
155  ! These parameters are allowed to vary in space and time.
156  ! The parameters control the exponential decay rate k_i
157  ! Since there are 5 parameters, this permits description of
158  ! dependence of k_i on frequency or wavenumber.
159  !
160  !/ ------------------------------------------------------------------- /
161  !
162  ! 2. Method :
163  !
164  ! Apply parametric/empirical functions, e.g. from the literature.
165  ! 1) Exponential fit to Wadhams et al. 1988, Table 2
166  ! 2) Polynomial fit, Eq. 3 from Meylan et al. 2014
167  ! 3) Quadratic fit to Kohout & Meylan'08 in Horvat & Tziperman'15
168  ! Here, note that their eqn is given as ln(alpha)=blah, so we
169  ! have alpha=exp(blah).
170  ! Note from ER:
171  ! This implementation has two things to keep in mind:
172  ! 1) This is a scattering model, applied as dissipation,
173  ! which is not correct.
174  ! 2) This is not actually HT15! The alpha of HT15 has
175  ! different meaning from alpha of CR17, as follows:
176  ! HT15: decay is exp(-alpha*Lambda) where Lambda
177  ! is the number of floes encountered.
178  ! CR17: decay is exp(-alpha*x)
179  ! Thus, CR17's implementation of HT15 is equivalent to
180  ! the actual HT15 only if one assumes one floe encountered
181  ! per meter. This is very strong attenuation, as shown in
182  ! Figure 3 of CR17! This problem might be fixed by computing
183  ! an encounter interval length scale from an a_ice and d_ice
184  ! provided by the user...or a length scale provided by the
185  ! user.
186  ! See also: page 3 of Rogers et al. (RYW2021).
187  ! 4) Eq. 1 from Kohout et al. 2014
188  !
189  ! 5) Simple step function for ki as a function of frequency
190  ! with up to 4 "steps". Controlling parameters KIx and FCx are
191  ! read in as input fields, so they may be nonstationary and
192  ! non-uniform in the same manner that ice concentration and
193  ! water levels may be nonstationary and non-uniform.
194  ! 444444444444
195  ! 33333333333
196  ! 222222222222
197  ! 1111111111111
198  ! ^ ^ ^
199  ! | | |
200  ! 5 6 7
201  ! Here, 1 indicates ki=KI1=ICECOEF1 (ICEP1)
202  ! 2 indicates ki=KI2=ICECOEF2 (ICEP2)
203  ! 3 indicates ki=KI3=ICECOEF3 (ICEP3)
204  ! 4 indicates ki=KI4=ICECOEF4 (ICEP4)
205  ! 5 indicates freq cutoff #1 =FC5=ICECOEF5 (ICEP5)
206  ! 6 indicates freq cutoff #2 =FC6=ICECOEF6 (MUDD)
207  ! 7 indicates freq cutoff #3 =FC7=ICECOEF7 (MUDT)
208  ! freq cutoff is given in Hz, freq=1/T (not sigma)
209  ! Examples using hindcast, inversion with uniform ki:
210  ! 5.1) Beaufort Sea, AWAC mooring, 2012, Aug 17 to 20
211  ! 0.0418 Hz to 0.15 Hz : ki=10e-6
212  ! 0.15 Hz to 0.175 Hz : ki=11e-6
213  ! 0.175 Hz to 0.25 Hz : ki=15e-6
214  ! 0.25 Hz to 0.5 Hz : ki=25e-6
215  ! 5.2) Beaufort Sea, AWAC mooring, 2012, Oct 27 to 30
216  ! 0.0418 Hz to 0.1 Hz : ki=5e-6
217  ! 0.1 Hz to 0.12 Hz : ki=7e-6
218  ! 0.12 Hz to 0.16 Hz : ki=15e-6
219  ! 0.16 Hz to 0.5 Hz : ki=100e-6
220  ! ICEP1=KI1=5.0e-6
221  ! ICEP2=KI2=7.0e-6
222  ! ICEP3=KI3=15.0e-6
223  ! ICEP4=KI4=100.0e-6
224  ! ICEP5=FC5=0.10
225  ! MUDD=FC6=0.12
226  ! MUDT=FC7=0.16
227  ! In terms of the 3-character IDs for "Homogeneous field
228  ! data" in ww3_shel.inp, these are, respectively, IC1, IC2,
229  ! IC3, IC4, IC5, MDN, MTH, and so this might look like:
230  ! 'IC1' 19680606 000000 5.0e-6
231  ! 'IC2' 19680606 000000 7.0e-6
232  ! 'IC3' 19680606 000000 15.0e-6
233  ! 'IC4' 19680606 000000 100.0e-6
234  ! 'IC5' 19680606 000000 0.10
235  ! 'MDN' 19680606 000000 0.12
236  ! 'MTH' 19680606 000000 0.16
237  !
238  ! 6) Simple step function for ki as a function of frequency
239  ! with up to 16 "steps". Controlling parameters KIx and FCx are
240  ! read in as namelist parameters, so they are stationary and
241  ! uniform. (If 16 steps is not enough, the number of steps can be
242  ! increased at compile time by changing NIC4 in w3gdatmd.ftn.)
243  ! The last non-zero FCx value should be a large number, e.g. 99 Hz
244  !
245  ! 4444444444 <--- ki=ic4_ki(4)
246  ! 3333333333 <--- ki=ic4_ki(3)
247  ! 2222222222 <--- ki=ic4_ki(2)
248  ! 11111111111 <--- ki=ic4_ki(1)
249  ! ^ ^ ^ ^
250  ! | | | |
251  ! ic4_fc(1) ic4_fc(2) ic4_fc(3) ic4_fc(4)=large number
252  ! Example: Beaufort Sea, AWAC mooring, 2012, Oct 27 to 30
253  ! &SIC4 IC4METHOD = 6,
254  ! IC4KI = 0.50E-05, 0.70E-05, 0.15E-04,
255  ! 0.10E+00, 0.00E+00, 0.00E+00,
256  ! 0.00E+00, 0.00E+00, 0.00E+00,
257  ! 0.00E+00,
258  ! IC4FC = 0.100, 0.120, 0.160,
259  ! 99.00, 0.000, 0.000,
260  ! 0.000, 0.000, 0.000,
261  ! 0.000
262  ! /
263  !
264  ! 7) Doble et al. (GRL 2015), eq. 3. This is a function of ice
265  ! thickness and wave period.
266  ! ALPHA = 0.2*(T^(-2.13)*HICE or
267  ! ALPHA = 0.2*(FREQ^2.13)*HICE
268  !
269  ! 8) Meylan et al. (JGR 2018), eq. 48. "Model with Order 3 Power
270  ! Law". The is denoted as the "M2" model by Liu et al. (JPO 2020)
271  ! It is a function of ice thickness and wave period.
272  ! ki = ChfM2*h_ice*freq^3
273  ! where ChfM2 is a coefficient of proportionality which formally
274  ! includes viscosity, density, and gravity parameters, see
275  ! Meylan et al. (JGR 2018) for details.
276  ! ChfM2 has units of s3/m2
277  ! It is equation 53 in Meylan et al. (2018) and equation 16 in
278  ! Liu et al. (2020).
279  ! This method is functionally the same as the "M2" model in IC5
280  ! in WW3 (IC5 w/IC5VEMOD=3) and is redundantly included here as
281  ! IC4M8 because it is in the same "family" as IC4M7 and IC4M9,
282  ! being in the form of:
283  ! ki=Chf * h_ice^m * freq^n .
284  ! Calibrations:
285  ! * Liu et al. has ChfM2=eta*(2*pi)^3/(1025*9.81^2)
286  ! ** eta=14.0 for "Sikuliaq" case of Liu et al., so ChfM2=0.035
287  ! ** eta=3.0 for "SIPEX" case of Liu et al., so ChfM2=0.0075
288  ! * Rogers et al. (tech rep. 2021, "RYW2021") :
289  ! ** Fit to Rogers et al. (CRST 2021 "RMK2021") ChfM2=0.059 (*SD*)
290  ! suggested default is marked with "(*SD*)", for consistency
291  ! with SWAN (v41.31AB or later)
292  !
293  ! 9) Rogers et al. (tech. rep. 2021, "RYW2021"): the "monomial power
294  ! fit" described in section 2.2.3. It is the general form above,
295  ! ki=Chf * h_ice^m * freq^n but is constrained such that m=n/2-1.
296  ! This constraint is derived by RYW2021 by invoking the scaling from
297  ! Yu et al. (2019), which is based on Reynolds number with ice
298  ! thickness as the relevant length scale.
299  ! This is also given as equation 2 in Yu et al. (CRST 2022).
300  ! Some calibrations are as follows:
301  ! * RYW2021, calibration to RMK2021: Chf=2.9 and n=4.5 (*SD*)
302  ! * Yu et al. (2022) calibration to RMK2021 : Chf=2.4 and n=4.46
303  ! (noting that c_n=0.108 and Chf=c_n*(2*pi/sqrt(g))^n)
304  ! * Yu (2022) adjusted the prior calibration to get better fit
305  ! to higher frequency lab measurements and got:
306  ! Chf=7.89 and n=4.8
307  ! suggested default is marked with "(*SD*)", for consistency
308  ! with SWAN (v41.31AB or later)
309  !
310  ! ------------------------------------------------------------------
311  !
312  ! For all methods, the user can specify namelist
313  ! variables IC4FMIN and IC4KIBK such as:
314  ! &SIC4 IC4METHOD = [...], IC4FMIN=0.08, IC4KIBK=1.0e-7, [...]
315  ! This accomodates the situation where the empirically-derived
316  ! dissipation is uncertain for the lowest frequencies, which can be
317  ! the case if estimated dissipation rate is so small that it falls
318  ! in the noise level for the estimation method. (This is common,
319  ! since some ice types cause only very weak dissipation
320  ! to low frequencies.) In the example above, the amplitude
321  ! dissipation rate ki is set to some low background level
322  ! dissipation IC4KIBK=1.0e-7 1/m when model frequency is less than
323  ! 0.08 Hz.
324  !
325  ! More verbose description of implementation of Sice in WW3:
326  ! See documentation for IC1
327  !
328  ! Notes regarding numerics:
329  ! See documentation for IC1
330  !
331  ! 3. Parameters :
332  !
333  ! Parameter list
334  ! ----------------------------------------------------------------
335  ! A R.A. I Action density spectrum (1-D)
336  ! DEPTH Real I Local water depth
337  ! CG R.A. I Group velocities.
338  ! IX,IY I.S. I Grid indices.
339  ! S R.A. O Source term (1-D version).
340  ! D R.A. O Diagonal term of derivative (1-D version).
341  ! ----------------------------------------------------------------
342  !
343  ! 4. Subroutines used :
344  !
345  ! Name Type Module Description
346  ! ----------------------------------------------------------------
347  ! STRACE Subr. W3SERVMD Subroutine tracing (!/S switch).
348  ! PRT2DS Subr. W3ARRYMD Print plot output (!/T1 switch).
349  ! OUTMAT Subr. W3ARRYMD Matrix output (!/T2 switch).
350  ! ----------------------------------------------------------------
351  !
352  ! 5. Called by :
353  !
354  ! Name Type Module Description
355  ! ----------------------------------------------------------------
356  ! W3SRCE Subr. W3SRCEMD Source term integration.
357  ! W3EXPO Subr. N/A ASCII Point output post-processor.
358  ! W3EXNC Subr. N/A NetCDF Point output post-processor.
359  ! GXEXPO Subr. N/A GrADS point output post-processor.
360  ! ----------------------------------------------------------------
361  !
362  ! 6. Error messages :
363  !
364  ! None.
365  !
366  ! 7. Remarks :
367  !
368  ! If ice parameter 1 is zero, no calculations are made.
369  ! For questions, comments and/or corrections, please refer to:
370  ! Method 1 : C. Collins
371  ! Method 2 : C. Collins
372  ! Method 3 : C. Collins
373  ! Method 4 : C. Collins
374  ! Method 5 : E. Rogers
375  ! Method 6 : E. Rogers
376  ! Method 7 : E. Rogers
377  !
378  ! ALPHA = 2 * WN_I
379  ! Though it may seem redundant/unnecessary to have *both* in the
380  ! code, we do it this way to make the code easier to read and
381  ! relate to other codes and source material, and hopefully avoid
382  ! mistakes.
383  !/ ------------------------------------------------------------------- /
384  !
385  ! 8. Structure :
386  !
387  ! See source code.
388  !
389  ! 9. Switches :
390  !
391  ! !/S Enable subroutine tracing.
392  ! !/T Enable general test output.
393  ! !/T0 2-D print plot of source term.
394  ! !/T1 Print arrays.
395  !
396  ! 10. Source code :
397  !
398  !/ ------------------------------------------------------------------- /
399  USE constants, ONLY: tpi
400  USE w3odatmd, ONLY: ndse
401  USE w3servmd, ONLY: extcde
402  USE w3gdatmd, ONLY: nk, nth, nspec, sig, mapwn, ic4pars, dden, &
404  ic4_kibk
405  USE w3idatmd, ONLY: icep1, icep2, icep3, icep4, icep5, &
406  mudt, mudv, mudd, inflags2
407 
408 #ifdef W3_T
409  USE w3odatmd, ONLY: ndst
410 #endif
411 #ifdef W3_S
412  USE w3servmd, ONLY: strace
413 #endif
414 #ifdef W3_T0
415  USE w3arrymd, ONLY: prt2ds
416 #endif
417 #ifdef W3_T1
418  USE w3arrymd, ONLY: outmat
419 #endif
420  !
421  IMPLICIT NONE
422  !/
423  !/ ------------------------------------------------------------------- /
424  !/ Parameter list
425  REAL, INTENT(IN) :: CG(NK), A(NSPEC), DEPTH
426  REAL, INTENT(OUT) :: S(NSPEC), D(NSPEC)
427  INTEGER, INTENT(IN) :: IX, IY
428  !/
429  !/ ------------------------------------------------------------------- /
430  !/ Local parameters
431  !/
432 #ifdef W3_S
433  INTEGER, SAVE :: IENT = 0
434 #endif
435 #ifdef W3_T0
436  INTEGER :: ITH
437  REAL :: DOUT(NK,NTH)
438 #endif
439  INTEGER :: IKTH, IK, ITH, IC4METHOD, IFC
440  REAL :: D1D(NK), EB(NK)
441  REAL :: ICECOEF1, ICECOEF2, ICECOEF3, &
442  ICECOEF4, ICECOEF5, ICECOEF6, &
443  ICECOEF7, ICECOEF8
444  REAL :: CICE1,CICE2,CICE3,CICE4,CICE5 ! temporary variables
445  REAL :: KI1,KI2,KI3,KI4,FC5,FC6,FC7
446  REAL :: HS, EMEAN, HICE
447  REAL :: Chf,mpow,npow
448  REAL, ALLOCATABLE :: WN_I(:) ! exponential decay rate for amplitude
449  REAL, ALLOCATABLE :: ALPHA(:) ! exponential decay rate for energy
450  REAL, ALLOCATABLE :: FREQ(:) ! wave frequency
451  REAL, ALLOCATABLE :: MARG1(:), MARG2(:) ! Arguments for M2
452  REAL, ALLOCATABLE :: KARG1(:), KARG2(:), KARG3(:) !Arguments for M3
453  LOGICAL :: NML_INPUT ! if using namelist input for M2
454 
455  !/
456  !/ ------------------------------------------------------------------- /
457  !/
458 #ifdef W3_S
459  CALL strace (ient, 'W3SIC4')
460 #endif
461  !
462  ! 0. Initializations ------------------------------------------------ *
463  !
464  d = 0.0
465  !
466  ALLOCATE(wn_i(0:nk+1))
467  ALLOCATE(alpha(0:nk+1))
468  ALLOCATE(marg1(0:nk+1))
469  ALLOCATE(marg2(0:nk+1))
470  ALLOCATE(karg1(0:nk+1))
471  ALLOCATE(karg2(0:nk+1))
472  ALLOCATE(karg3(0:nk+1))
473  ALLOCATE(freq(0:nk+1))
474  marg1 = 0.0
475  marg2 = 0.0
476  karg1 = 0.0
477  karg2 = 0.0
478  karg3 = 0.0
479  wn_i = 0.0
480  alpha = 0.0
481  icecoef1 = 0.0
482  icecoef2 = 0.0
483  icecoef3 = 0.0
484  icecoef4 = 0.0
485  icecoef5 = 0.0
486  icecoef6 = 0.0
487  icecoef7 = 0.0
488  icecoef8 = 0.0
489  hs = 0.0
490  hice = 0.0
491  emean = 0.0
492  freq=sig/tpi
493  !
494  ! IF (.NOT.INFLAGS2(-7))THEN
495  ! WRITE (NDSE,1001) 'ICE PARAMETER 1'
496  ! CALL EXTCDE(201)
497  ! ENDIF
498  !
499  ! We cannot remove the other use of INFLAGS below,
500  ! because we would get 'array not allocated' error for the methods
501  ! that don't use MUDV, etc. and don't have MUDV allocated.
502 
503  IF (inflags2(-7)) icecoef1 = icep1(ix,iy) ! a.k.a. IC1
504  IF (inflags2(-6)) icecoef2 = icep2(ix,iy) ! etc.
505  IF (inflags2(-5)) icecoef3 = icep3(ix,iy)
506  IF (inflags2(-4)) icecoef4 = icep4(ix,iy)
507  IF (inflags2(-3)) icecoef5 = icep5(ix,iy)
508 
509  ! Borrow from Smud (error if BT8 or BT9)
510 #ifdef W3_BT8
511  WRITE (ndse,*) 'DUPLICATE USE OF MUD PARAMETERS'
512  CALL extcde(202)
513 #endif
514 #ifdef W3_BT9
515  WRITE (ndse,*) 'DUPLICATE USE OF MUD PARAMETERS'
516  CALL extcde(202)
517 #endif
518  IF (inflags2(-2)) icecoef6 = mudd(ix,iy) ! a.k.a. MDN
519  IF (inflags2(-1)) icecoef7 = mudt(ix,iy) ! a.k.a. MTH
520  IF (inflags2(0 )) icecoef8 = mudv(ix,iy) ! a.k.a. MVS
521 
522  ic4method = ic4pars(1)
523  !
524 #ifdef W3_T38
525  ! Write test output ---------------------------------------------- /
526  WRITE (ndst,9000) depth,icecoef1,icecoef2,icecoef3,icecoef4
527 #endif
528  !
529  ! 1. Make calculations ---------------------------------------------- /
530  !
531  ! 1.a Calculate WN_I
532 
533  SELECT CASE (ic4method)
534 
535  CASE (1) ! IC4M1 : Exponential fit to Wadhams et al. 1988
536  alpha = exp(-icecoef1 * tpi / sig - icecoef2)
537  wn_i = 0.5 * alpha
538 
539  CASE (2) ! IC4M2 : Polynomial fit, Eq. 3 from Meylan et al. 2014
540  !NB: Eq. 3 only includes T^2 and T^4 terms,
541  ! which correspond to ICECOEF3, ICECOEF5, so in
542  ! regtest: ICECOEF1=ICECOEF2=ICECOEF4=0
543 
544  nml_input=.true.
545  IF (inflags2(-7).OR.inflags2(-6).OR.inflags2(-5).OR. &
546  inflags2(-4).OR.inflags2(-3)) nml_input=.false.
547 
548  IF(nml_input)THEN ! get from namelist array
549 
550  cice1=ic4_cn(1)
551  cice2=ic4_cn(2)
552  cice3=ic4_cn(3)
553  cice4=ic4_cn(4)
554  cice5=ic4_cn(5)
555 
556  ELSE ! get from input-field array (ICEP1 etc.)
557 
558  cice1=icecoef1
559  cice2=icecoef2
560  cice3=icecoef3
561  cice4=icecoef4
562  cice5=icecoef5
563 
564  ENDIF
565 
566  ! CICE1 is C_{ice,1} in Collins and Rogers (2017), for example.
567  marg1 = cice1 + cice2*freq + cice3*freq**2
568  marg2 = cice4*freq**3 + cice5*freq**4
569  alpha = marg1 + marg2
570  wn_i = 0.5 * alpha
571 
572  CASE (3) ! IC4M3 : Quadratic fit to Kohout & Meylan'08 in Horvat & Tziperman'15
573  hice=icecoef1 ! For this method, ICECOEF1=ice thickness
574  karg1 = -0.3203 + 2.058*hice - 0.9375*(tpi/sig)
575  karg2 = -0.4269*hice**2 + 0.1566*hice*(tpi/sig)
576  karg3 = 0.0006 * (tpi/sig)**2
577  alpha = exp(karg1 + karg2 + karg3)
578  wn_i = 0.5 * alpha
579 
580  CASE (4) !Eq. 1 from Kohout et al. 2014
581  !Calculate HS
582  DO ik=1, nk
583  eb(ik) = 0.
584  DO ith=1, nth
585  eb(ik) = eb(ik) + a(ith+(ik-1)*nth)
586  END DO
587  END DO
588  DO ik=1, nk
589  eb(ik) = eb(ik) * dden(ik) / cg(ik)
590  emean = emean + eb(ik)
591  END DO
592  hs = 4.*sqrt( max(0.,emean) )
593  ! If Hs < 3 m then do Hs dependent calc, otherwise dH/dx is a constant
594  IF (hs <= 3) THEN
595  wn_i=icecoef1 ! from: DHDX=ICECOEF1*HS and WN_I=DHDX/HS
596  ELSE IF (hs > 3) THEN
597  wn_i=icecoef2/hs ! from: DHDX=ICECOEF2 and WN_I=DHDX/HS
598  END IF
599 
600  CASE (5) ! Simple step function (time- and/or space-varying)
601  ! rename variables for clarity
602  ki1=icecoef1
603  ki2=icecoef2
604  ki3=icecoef3
605  ki4=icecoef4
606  fc5=icecoef5
607  fc6=icecoef6
608  fc7=icecoef7
609  IF((ki1.EQ.0.0).OR.(ki2.EQ.0.0).OR.(ki3.EQ.0.0).OR. &
610  (ki4.EQ.0.0).OR.(fc5.EQ.0.0).OR.(fc6.EQ.0.0).OR. &
611  (fc7.EQ.0.0))THEN
612  WRITE (ndse,1001)'ICE PARAMETERS'
613  CALL extcde(201)
614  END IF
615  DO ik=1, nk
616  ! select ki
617  IF(freq(ik).LT.fc5)THEN
618  wn_i(ik)=ki1
619  ELSEIF(freq(ik).LT.fc6)THEN
620  wn_i(ik)=ki2
621  ELSEIF(freq(ik).LT.fc7)THEN
622  wn_i(ik)=ki3
623  ELSE
624  wn_i(ik)=ki4
625  ENDIF
626  END DO
627 
628  CASE (6) ! Simple step function (from namelist)
629 
630  ! error checking: require at least 3 steps
631  IF((ic4_ki(1).EQ.0.0).OR.(ic4_ki(2).EQ.0.0).OR. &
632  (ic4_ki(3).EQ.0.0).OR.(ic4_fc(1).EQ.0.0).OR. &
633  (ic4_fc(2).EQ.0.0) )THEN
634  WRITE (ndse,1001)'ICE PARAMETERS'
635  CALL extcde(201)
636  END IF
637 
638  DO ik=1, nk
639  ! select ki
640  DO ifc=1,nic4
641  IF(freq(ik).LT.ic4_fc(ifc))THEN
642  wn_i(ik)=ic4_ki(ifc)
643  EXIT
644  END IF
645  END DO
646  END DO
647 
648  CASE (7) ! Doble et al. (GRL 2015)
649 
650  hice=icecoef1 ! For this method, ICECOEF1=ice thickness
651  DO ik=1,nk
652  alpha(ik) = 0.2*(freq(ik)**2.13)*hice
653  END DO
654  wn_i= 0.5 * alpha
655 
656  CASE (8) ! Meylan et al. (JGR 2018), Liu et al. (JPO 2020)
657 
658  nml_input=.true.
659  IF (inflags2(-6)) nml_input=.false.
660 
661  IF(nml_input)THEN ! get from namelist array
662 
663  chf=ic4_cn(1) ! Denoted "ChfM2" in documentation
664 
665  ELSE ! get from input-field array (ICEP1 etc.)
666 
667  chf=icecoef2 ! Denoted "ChfM2" in documentation
668 
669  ENDIF
670 
671  ! Rename variable, for clarity
672  hice=icecoef1 ! For this method, ICECOEF1 is ice thickness
673 
674  DO ik=1,nk
675  wn_i(ik) = chf*hice*(freq(ik)**3)
676  END DO
677 
678  CASE (9) ! Rogers et al. (2021) (RYW2021), Yu et al. (JGR 2022)
679 
680  nml_input=.true.
681  IF (inflags2(-6).OR.inflags2(-5)) nml_input=.false.
682 
683  IF(nml_input)THEN ! get from namelist array
684 
685  chf=ic4_cn(1) ! Denoted as same in documentation
686  npow=ic4_cn(2) ! Denoted "n" in documentation
687 
688  ELSE ! get from input-field array (ICEP1 etc.)
689 
690  chf=icecoef2 ! Denoted as same in documentation
691  npow=icecoef3 ! Denoted "n" in documentation
692 
693  ENDIF
694 
695  ! Rename variable, for clarity
696  hice=icecoef1 ! For this method, ICECOEF1 is ice thickness
697  ! Compute
698  mpow=0.5*npow-1.0 ! Denoted "m" in documentation
699  DO ik=1,nk
700  wn_i(ik) = chf*(hice**mpow)*(freq(ik)**npow)
701  END DO
702 
703  CASE DEFAULT
704  wn_i = icecoef1 !Default to IC1: Uniform in k
705 
706  END SELECT
707 
708  !
709  ! 1.b Calculate DID
710  !
711  DO ik=1, nk
712  ! SBT1 has: D1D(IK) = FACTOR * MAX(0., (CG(IK)*WN(IK)/SIG(IK)-0.5) )
713  ! recall that D=S/E=-2*Cg*k_i
714  IF(freq(ik).LT.ic4_fmin)wn_i(ik)=ic4_kibk
715  ! write(*,*)freq(ik),wn_i(ik),ICECOEF1,' % :: freq,ki,hice' ! temporary code: do not commit to repo uncommented
716  d1d(ik) = -2. * cg(ik) * wn_i(ik)
717 
718  END DO
719 
720  !
721  ! 1.c Fill diagional matrix
722  !
723  DO ikth=1, nspec
724  d(ikth) = d1d(mapwn(ikth))
725  END DO
726  !
727  ! END IF
728  !
729  s = d * a
730  !
731  ! ... Test output of arrays
732  !
733 #ifdef W3_T0
734  DO ik=1, nk
735  DO ith=1, nth
736  dout(ik,ith) = d(ith+(ik-1)*nth)
737  END DO
738  END DO
739  CALL prt2ds (ndst, nk, nk, nth, dout, sig(1:), ' ', 1., &
740  0.0, 0.001, 'Diag Sice', ' ', 'NONAME')
741 #endif
742  !
743 #ifdef W3_T1
744  CALL outmat (ndst, d, nth, nth, nk, 'diag Sice')
745 #endif
746  !
747  ! Formats
748  !
749 1001 FORMAT (/' *** WAVEWATCH III ERROR IN W3SIC4 : '/ &
750  ' ',a,' REQUIRED BUT NOT SELECTED'/)
751  !
752 #ifdef W3_T
753 9000 FORMAT (' TEST W3SIC4 : DEPTH,ICECOEF1 : ',2e10.3)
754 #endif
755  !/
756  !/ End of W3SIC4 --------------------------------------------------- /
757  !/

References w3gdatmd::dden, w3servmd::extcde(), w3gdatmd::ic4_cn, w3gdatmd::ic4_fc, w3gdatmd::ic4_fmin, w3gdatmd::ic4_ki, w3gdatmd::ic4_kibk, w3gdatmd::ic4pars, w3idatmd::inflags2, w3gdatmd::mapwn, w3odatmd::ndse, w3odatmd::ndst, w3gdatmd::nic4, w3gdatmd::nk, w3gdatmd::nspec, w3gdatmd::nth, w3arrymd::outmat(), w3arrymd::prt2ds(), w3gdatmd::sig, w3servmd::strace(), and constants::tpi.

Referenced by gxexpo(), and w3srcemd::w3srce().

w3gdatmd::nk
integer, pointer nk
Definition: w3gdatmd.F90:1230
w3gdatmd::nspec
integer, pointer nspec
Definition: w3gdatmd.F90:1230
w3idatmd::inflags2
logical, dimension(:), pointer inflags2
Definition: w3idatmd.F90:260
w3gdatmd::ic4_cn
real, dimension(:), pointer ic4_cn
Definition: w3gdatmd.F90:1154
w3gdatmd::sig
real, dimension(:), pointer sig
Definition: w3gdatmd.F90:1234
w3arrymd::outmat
subroutine outmat(NDS, A, MX, NX, NY, MNAME)
Definition: w3arrymd.F90:988
w3odatmd::ndse
integer, pointer ndse
Definition: w3odatmd.F90:456
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
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::ic4pars
integer, dimension(:), pointer ic4pars
Definition: w3gdatmd.F90:1151
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
w3gdatmd::dden
real, dimension(:), pointer dden
Definition: w3gdatmd.F90:1234
w3gdatmd
Definition: w3gdatmd.F90:16
w3gdatmd::ic4_ki
real, dimension(:), pointer ic4_ki
Definition: w3gdatmd.F90:1152
w3arrymd::prt2ds
subroutine prt2ds(NDS, NFR0, NFR, NTH, E, FR, UFR, FACSP, FSC, RRCUT, PRVAR, PRUNIT, PNTNME)
Definition: w3arrymd.F90:1943
w3gdatmd::ic4_kibk
real, pointer ic4_kibk
Definition: w3gdatmd.F90:1155
w3gdatmd::ic4_fmin
real, pointer ic4_fmin
Definition: w3gdatmd.F90:1155
w3gdatmd::ic4_fc
real, dimension(:), pointer ic4_fc
Definition: w3gdatmd.F90:1153
w3gdatmd::nic4
integer, parameter nic4
Definition: w3gdatmd.F90:622