Interface module for GKE (resonant & quasi-resonant four-wave interactions).
More...
|
| subroutine, public | w3snl5 (A, CG, WN, FMEAN, T1ABS, U10, UDIR, JSEA, S, D, KURT) |
| | Interface to CalcQRSNL subroutine of the GKE module. More...
|
| |
| subroutine, public | insnl5 |
| | Initialization for the GKE module (Prepare wavenumber grid & kernel coefficients). More...
|
| |
| logical function | hasnan (NK, NTH, ARR2D) |
| | Check if the 2D array ARR2D contains NaN. More...
|
| |
Interface module for GKE (resonant & quasi-resonant four-wave interactions).
- Author
- O. Gramstad
-
Q. Liu
- Date
- 07-Jun-2021
- Copyright
- Copyright 2009-2022 National Weather Service (NWS), National Oceanic and Atmospheric Administration. All rights reserved. WAVEWATCH III is a trademark of the NWS. No unauthorized use without permission.
◆ hasnan()
| logical function w3snl5md::hasnan |
( |
integer, intent(in) |
NK, |
|
|
integer, intent(in) |
NTH, |
|
|
real, dimension(nk, nth), intent(in) |
ARR2D |
|
) |
| |
Check if the 2D array ARR2D contains NaN.
- Parameters
-
- Returns
- HasNaN
- Author
- Q. Liu
- Date
- 25-Apr-2019
Definition at line 887 of file w3snl5md.F90.
903 INTEGER,
INTENT(IN) :: NK, NTH
904 REAL,
INTENT(IN) :: ARR2D(NK, NTH)
909 IF ( all(arr2d .GE. -huge(arr2d(1, 1))) .AND. &
910 all(arr2d .LE. huge(arr2d(1, 1))) )
THEN
Referenced by w3snl5().
◆ insnl5()
| subroutine, public w3snl5md::insnl5 |
Initialization for the GKE module (Prepare wavenumber grid & kernel coefficients).
- Author
- Q. Liu
- Date
- 27-Feb-2019
Definition at line 435 of file w3snl5md.F90.
506 INTEGER,
SAVE :: IENT = 0
512 CALL strace (ient,
'INSNL5')
532 WRITE(
screen,
'(A, F6.1)')
" ⊚ → [WW3 SNL₅]: water depth : ",
qr_depth
533 WRITE(
screen,
'(A, F7.2)')
" ⊚ → [WW3 SNL₅]: ω λc cut off : ",
qr_oml
534 WRITE(
screen,
'(A, I4)' )
" ⊚ → [WW3 SNL₅]: Discretiza. : ",
qi_disc
535 WRITE(
screen,
'(A, I4)' )
" ⊚ → [WW3 SNL₅]: GKE version : ",
qi_kev
536 WRITE(
screen,
'(A, I12)' )
" ⊚ → [WW3 SNL₅]: # of quartets : ",
qi_nnz
538 WRITE(
screen,
'(A, I4)' )
" ⊚ → [WW3 SNL₅]: phase mixing : ",
qi5pmx
References w3servmd::dist_sphere(), w3gdatmd::dsii, w3gdatmd::dth, w3gdatmd::ecos, w3gdatmd::esin, w3servmd::extcde(), file(), w3gdatmd::flagll, w3odatmd::iaproc, w3odatmd::iptint, w3gdatmd::mapfs, w3gdatmd::mapsta, w3odatmd::napout, w3gdatmd::nk, w3odatmd::nopts, w3gdatmd::nth, w3gkemd::prepkernelio(), w3odatmd::ptloc, w3odatmd::ptnme, w3gdatmd::qi5dis, w3gdatmd::qi5ipl, w3gdatmd::qi5kev, w3gdatmd::qi5nnz, w3gdatmd::qi5pmx, w3gkemd::qi_disc, w3gkemd::qi_interp, w3gkemd::qi_kev, w3gkemd::qi_nnz, w3gdatmd::qr5dpt, w3gdatmd::qr5oml, w3gkemd::qr_depth, w3gkemd::qr_oml, w3odatmd::screen, w3gdatmd::sig, w3servmd::strace(), w3gdatmd::th, constants::tpi, w3dispmd::wavnu1(), w3gdatmd::xgrd, and w3gdatmd::ygrd.
Referenced by w3iogrmd::w3iogr().
◆ w3snl5()
| subroutine, public w3snl5md::w3snl5 |
( |
real, dimension(nth, nk), intent(in) |
A, |
|
|
real, dimension(nk), intent(in) |
CG, |
|
|
real, dimension(nk), intent(in) |
WN, |
|
|
real, intent(in) |
FMEAN, |
|
|
integer, dimension(2), intent(in) |
T1ABS, |
|
|
real, intent(in) |
U10, |
|
|
real, intent(in) |
UDIR, |
|
|
integer, intent(in) |
JSEA, |
|
|
real, dimension(nth,nk), intent(out) |
S, |
|
|
real, dimension(nth,nk), intent(out) |
D, |
|
|
real, intent(out) |
KURT |
|
) |
| |
Interface to CalcQRSNL subroutine of the GKE module.
- Parameters
-
| [in] | A | |
| [in] | CG | |
| [in] | WN | |
| [in] | FMEAN | |
| [in] | T1ABS | |
| [in] | U10 | |
| [in] | UDIR | |
| [in] | JSEA | |
| [out] | S | |
| [out] | D | |
| [out] | KURT | |
- Author
- O. Gramstad
-
Q. Liu
- Date
- 24-Apr-2019
Definition at line 100 of file w3snl5md.F90.
204 REAL,
INTENT(IN) :: A(NTH, NK)
205 REAL,
INTENT(IN) :: CG(NK)
206 REAL,
INTENT(IN) :: WN(NK)
207 REAL,
INTENT(IN) :: FMEAN
208 INTEGER,
INTENT(IN) :: T1ABS(2)
209 REAL,
INTENT(IN) :: U10
210 REAL,
INTENT(IN) :: UDIR
211 INTEGER,
INTENT(IN) :: JSEA
212 REAL,
INTENT(OUT) :: S(NTH,NK), &
218 REAL,
PARAMETER :: BTLOW = 10., bthgh = 500.
219 REAL :: T0REL, T1REL, TDEL1, TDEL2
220 REAL :: Cvk1(NSPEC), SNL(NSPEC), DNL(NSPEC)
222 COMPLEX :: INPQR0(QI5NNZ)
223 INTEGER :: IK, ITH, ISPEC, ISEA, JLOC
224 INTEGER,
ALLOCATABLE :: PDIFF(:)
225 LOGICAL,
SAVE :: FSTOUT = .true.
226 REAL :: FACTOR(NK), A2(NK, NTH), S2(NK, NTH)
227 REAL :: PM_PREV, PM_IVAL, PM_DELT
231 INTEGER,
SAVE :: IENT = 0
238 CALL strace (ient,
'W3SNL5')
253 IF(t1rel < 0.) t1rel = 0.
260 WRITE(
screen,
'(A, 2(I10.8, I7.6), E12.3)') &
261 " ⊚ → [WW3 SNL₅] QI5TBEG, T1ABS, T1REL:", &
267 WRITE(
screen,
'(A, 2(I10.8, I7.6), E12.3)', advance=
'no') &
268 " ⊚ → [WW3 SNL₅] QI5TBEG, T1ABS, T1REL, T1REL[P]:", &
275 IF (abs(fmean) < 1e-7)
THEN
276 pm_ival = real(
qi5pmx) * 1.
278 pm_ival = real(
qi5pmx) * (1. / fmean)
281 ELSE IF (
qi5pmx .LT. 0)
THEN
284 wbt = calc_wbtv2(a, cg, wn,
qr5dpt, u10, udir)
287 btinv = max(btlow, min(1./max(1e-6, wbt), bthgh))
288 IF (abs(fmean) < 1e-7)
THEN
291 pm_ival = btinv * (1. / fmean)
299 pm_delt = t1rel - pm_prev
300 IF (pm_delt .GE. pm_ival)
THEN
308 WRITE(
screen,
'(F9.1)') t1rel
309 IF (
qi5pmx .LT. 0 )
WRITE(
screen,
'(A, F6.3)')
'↔ bT: ', wbt
317 ispec = ith + (ik-1) *
nth
318 cvk1(ispec) = a(ith, ik) / wn(ik) *
grav
326 t0rel, t1rel, cvk0, cvk1, &
327 inpqr0, snl, dnl, kurt)
334 ispec = ith + (ik-1) *
nth
335 s(ith, ik) = snl(ispec) * wn(ik) /
grav
352 ' ⊚ → [WW3 SNL₅] Point ouptut initialization'
353 WRITE(
screen,
'(A, I4)') &
354 ' ⊚ → [WW3 SNL₅] # of valid points: ', nsel
364 .AND.
flout(2) .AND. nsel .GT. 0)
THEN
370 IF (abs(tdel1) < 1e-6 .OR. abs(tdel2) < 1e-6)
THEN
374 IF (
ALLOCATED(pdiff))
DEALLOCATE(pdiff);
ALLOCATE(pdiff(nsel))
375 pdiff = abs(psea(1:nsel) - isea)
376 IF (any(pdiff .EQ. 0))
THEN
377 jloc = minloc(pdiff, 1)
380 WRITE(
screen,
'(3A, I10.8, I7.6)') &
381 '✓ Point output for |', pnms(jloc),
'| @', t1abs
386 a2(:, ith) = a(ith, :) * factor
387 s2(:, ith) = s(ith, :) * factor
390 IF (hasnan(
nk,
nth, a2) .OR. hasnan(
nk,
nth, s2))
THEN
392 WRITE(
screen, *)
'★★★ Warning: find NaN in E(f, θ) &
407 OPEN(iunt,
file=
'NL5_'//trim(pnms(jloc))//
'_src.dat', &
408 form=
'formatted',
status=
'old', &
409 position=
'append', action=
'write')
410 WRITE(iunt,
'(I10.8, I7.6)') t1abs
411 WRITE(iunt,
'(ES11.3)') kurt
420 113
FORMAT ((10es11.3))
References w3gkemd::calcqrsnl(), w3gdatmd::clgtype, w3timemd::dsec21(), w3servmd::extcde(), file(), w3odatmd::flout, constants::grav, w3gdatmd::gtype, hasnan(), w3odatmd::iaproc, w3parall::init_get_isea(), w3odatmd::napout, w3gdatmd::nk, w3odatmd::nopts, w3gdatmd::nspec, w3gdatmd::nth, w3wdatmd::qc5int0, w3gdatmd::qi5nnz, w3gdatmd::qi5pmx, w3wdatmd::qi5tbeg, w3wdatmd::qr5cvk0, w3gdatmd::qr5dpt, w3wdatmd::qr5tim0, w3wdatmd::qr5tmix, w3gkemd::qr_depth, w3gdatmd::rlgtype, w3odatmd::screen, w3gdatmd::sig, w3servmd::strace(), w3gdatmd::th, w3odatmd::tolast, w3odatmd::tosnl5, and constants::tpi.
Referenced by w3srcemd::w3srce().
real, dimension(:), pointer qr5tim0
real function dsec21(TIME1, TIME2)
integer, dimension(:), pointer tosnl5
Define data structures to set up wave model dynamic data for several models simultaneously.
integer, parameter rlgtype
real, dimension(:), pointer sig
complex, dimension(:, :), pointer qc5int0
real, dimension(:), pointer th
character(len=8), dimension(max_timers), save status
real, dimension(:), pointer qr5tmix
integer, parameter clgtype
real, dimension(:, :), pointer qr5cvk0
integer(kind=8), pointer qi5nnz
subroutine, public prepkernelio(nk, nth, sig, th, act)
integer, dimension(:,:), pointer tolast
integer, public qi_interp
file(STRINGS ${CMAKE_BINARY_DIR}/switch switch_strings) separate_arguments(switches UNIX_COMMAND $
integer, dimension(:), pointer qi5tbeg
logical, dimension(:), pointer flout
real, parameter tpi
TPI 2*Pi.
subroutine strace(IENT, SNAME)
Define some much-used constants for global use (all defined as PARAMETER).
subroutine extcde(IEXIT, UNIT, MSG, FILE, LINE, COMM)
subroutine, public calcqrsnl(nk, nth, sig, th, t0, t1, Cvk0, Cvk1, Inpqr0, Snl, Dnl, Kurt)
Parallel routines for implicit solver.
integer(kind=8), public qi_nnz
real, parameter grav
GRAV Acc.
subroutine init_get_isea(ISEA, JSEA)
Set ISEA for all schemes.