Go to the documentation of this file.
348 real,
allocatable ::
q_k(:)
351 real,
allocatable ::
q_f(:)
356 real,
allocatable ::
q_a(:)
358 real,
allocatable ::
a(:,:)
361 real,
allocatable ::
qnl(:,:)
463 subroutine xnl_init(sigma,dird,nsigma,ndir,pftail,x_grav,depth,ndepth, &
464 & iquad,iqgrid,iproc,ierr)
521 integer,
intent(in) :: nsigma
522 integer,
intent(in) :: ndir
523 integer,
intent(in) :: ndepth
524 real,
intent(in) :: sigma(nsigma)
525 real,
intent(in) :: dird(ndir)
526 real,
intent(in) :: pftail
527 real,
intent(in) :: depth(ndepth)
528 real,
intent(in) :: x_grav
529 integer,
intent(in) :: iquad
530 integer,
intent(in) :: iqgrid
531 integer,
intent(in) :: iproc
532 integer,
intent(out) :: ierr
642 dstep = dird(2)-dird(1)
643 dgap = 180.- abs(180.- abs(dird(1)-dird(ndir)))
650 if(abs(dstep-dgap) < 0.001)
then
657 if(abs(dird(1)+dird(ndir)) > 0.01)
then
691 call q_error(
'e',
'FILEIO',
'Problem in deleting error file *.ERR')
708 write(
luq_prt,
'(a)')
'---------------------------------------------------------------'
710 write(
luq_prt,
'(a)')
'Solution of Boltzmann integral using Webb/Resio/Tracy method'
711 write(
luq_prt,
'(a)')
'---------------------------------------------------------------'
713 write(
luq_prt,
'(a)')
'Initialisation'
716 if(iproc >=0)
write(
luq_prt,
'(a,i5)')
'(MPI) processor number:',iproc
757 call q_error(
'w',
'DEPTH',
'Invalid depth')
768 if(iquad==1 .and. ndepth > 0)
then
769 write(
luq_prt,
'(a)')
'XNL_INIT: For deep water only one grid suffices'
808 subroutine xnl_main(aspec,sigma,angle,nsig,ndir,depth,iquad,xnl,diag, &
860 integer,
intent(in) :: nsig
861 integer,
intent(in) :: ndir
862 integer,
intent(in) :: iquad
863 integer,
intent(in) :: iproc
865 real,
intent(in) :: aspec(nsig,ndir)
866 real,
intent(in) :: sigma(nsig)
867 real,
intent(in) :: angle(ndir)
868 real,
intent(in) :: depth
869 real,
intent(out) :: xnl(nsig,ndir)
871 real,
intent(out) :: diag(nsig,ndir)
872 integer,
intent(out) :: ierr
899 integer,
save :: i_qmain
920 i_qmain = i_qmain + 1
924 write(
luq_prt,
'(a,i4,f16.3,i4)')
'XNL_MAIN: Input arguments: iquad depth iproc:',&
933 if(iquad==1 .or. iquad==2)
q_depth=1000.
939 call q_error(
'w',
'DEPTH',
'Zero transfer returned')
954 if(iquad>=1 .and. iquad <=3)
then
957 call q_xnl4v4(aspec,sigma,angle,nsig,ndir,depth,xnl,diag,ierr)
960 call q_error(
'e',
'wrtvv',
'Problem in Q_XNL4V4')
972 if(
iq_prt >=1)
write(
luq_prt,
'(a,f7.4)')
'XNL_MAIN depth scale factor:',q_dfac
978 call q_chkcons(xnl,nsig,ndir,sum_e,sum_a,sum_mx,sum_my)
981 write(
luq_prt,
'(a)')
'XNL_MAIN: Conservation checks'
982 write(
luq_prt,
'(a,4e13.5)')
'XNL_MAIN: E/A/MOMX/MOMY:',sum_e,sum_a,sum_mx,sum_my
992 write(
luq_log,
'(a,i4)')
'XNL_MAIN: Number of errors :',
iq_err
1090 &
'Q_ALLOCATE: mkq maq mlocus klocus:',mkq,maq,
mlocus,
klocus
1195 if (
allocated(
q_k))
deallocate (
q_k) ;
allocate (
q_k(
nkq))
1198 if (
allocated(
q_f))
deallocate (
q_f) ;
allocate (
q_f(
nkq))
1203 if (
allocated(
q_a))
deallocate (
q_a) ;
allocate (
q_a(
naq))
1208 if (
allocated(
a))
deallocate (
a) ;
allocate (
a(
nkq,
naq))
1213 write(
luq_log,
'(a)')
'Q_ALLOCATE: size of arrays'
1214 write(
luq_log,
'(a,i4)')
'Q_ALLOCATE: mkq :',mkq
1215 write(
luq_log,
'(a,i4)')
'Q_ALLOCATE: maq :',maq
1216 write(
luq_log,
'(a,i4)')
'Q_ALLOCATE: nkq :',
nkq
1217 write(
luq_log,
'(a,i4)')
'Q_ALLOCATE: naq :',
naq
1301 if(
qf_tail > -1.)
call q_error(
'e',
'CONFIG',
'Incorrect power of spectral: qf_tail')
1304 &
call q_error(
'e',
'CONFIG',
'Invalid option for coupling coefficient iq_cple')
1307 &
call q_error(
'e',
'CONFIG',
'iq_compact /= 0,1')
1310 &
call q_error(
'e',
'CONFIG',
'iq_filt /= 0,1')
1313 &
call q_error(
'e',
'CONFIG',
'iq_gauleg <0')
1316 &
call q_error(
'e',
'CONFIG',
'iq_geom /= 0,1')
1319 &
call q_error(
'e',
'CONFIG',
'iq_interp /= 1,2')
1322 call q_error(
'e',
'CONFIG',
'Invalid combination of iq_disp & iq_geom')
1327 call q_error(
'e',
'CONFIG',
'Lumping and Gauss-Legendre interpolation not together')
1332 &
call q_error(
'e',
'CONFIG',
'Incorrect value for IQ_DSCALE, (0,1)')
1335 &
call q_error(
'e',
'CONFIG',
'Incorrect value for IQ_DISP [DISP],(1,2) ')
1338 &
call q_error(
'e',
'CONFIG',
'Incorrect value for IQ_GRID, (1,2,3)')
1341 call q_error(
'e',
'CONFIG',
'Invalid value for iq_integ')
1346 &
call q_error(
'e',
'CONFIG',
'Incorrect value for IQ_LOG, (>=0) ')
1349 &
call q_error(
'e',
'CONFIG',
'Incorrect specifier for locus method')
1352 call q_error(
'e',
'CONFIG',
'Invalid value for iq_lump')
1357 call q_error(
'e',
'CONFIG',
'Invalid value for iq_make')
1362 &
call q_error(
'e',
'CONFIG',
'Incorrect value for IQ_MOD [MOD] (0,1)')
1365 call q_error(
'e',
'CONFIG',
'klocus < nlocus0')
1366 write(
luq_err,
'(a)')
'Lumping or Gauss-Integration enabled when IMOD=0'
1370 &
call q_error(
'e',
'CONFIG',
'Incorrect value for IQ_PRT, (>=0) ')
1376 call q_error(
'e',
'CONFIG',
'Incorrect value of IQ_SYM /=[0,1]')
1379 &
call q_error(
'e',
'CONFIG',
'Incorrect value for IQ_TEST, (>=0) ')
1382 &
call q_error(
'e',
'CONFIG',
'Incorrect value for IQ_TRF ')
1387 &
call q_error(
'e',
'CONFIG',
'Incorrect value for FQMIN')
1390 &
call q_error(
'e',
'CONFIG',
'Incorrect value for FQMAX')
1393 &
call q_error(
'e',
'CONFIG',
'fmax <= fmin')
1396 &
call q_error(
'e',
'CONFIG',
'Number of wave numbers NKQ < 0')
1399 &
call q_error(
'e',
'CONFIG',
'Number of directions NKQ < 0')
1402 &
call q_error(
'e',
'CONFIG',
'Preferred number of points on locus NLOCUS0 < 6')
1405 &
call q_error(
'e',
'CONFIG',
'Sector too small (<40) or too large (>180)')
1434 subroutine q_chkcons(xnl,nk,ndir,sum_e,sum_a,sum_mx,sum_my)
1471 integer,
intent(in) :: nk
1472 integer,
intent(in) :: ndir
1473 real,
intent(in) :: xnl(nk,ndir)
1474 real,
intent(out) :: sum_e
1475 real,
intent(out) :: sum_a
1476 real,
intent(out) :: sum_mx
1477 real,
intent(out) :: sum_my
1527 momx = aa*kk*cos(
q_a(ia))
1528 momy = aa*kk*sin(
q_a(ia))
1530 sum_a = sum_a + aa*qq
1531 sum_e = sum_e + ee*qq
1532 sum_mx = sum_mx + momx*qq
1533 sum_my = sum_my + momy*qq
1573 subroutine q_chkres(k1x,k1y,k2x,k2y,k3x,k3y,k4x,k4y,dep,sum_kx,sum_ky,sum_w)
1610 real,
intent(in) :: k1x
1611 real,
intent(in) :: k1y
1612 real,
intent(in) :: k2x
1613 real,
intent(in) :: k2y
1614 real,
intent(in) :: k3x
1615 real,
intent(in) :: k3y
1616 real,
intent(in) :: k4x
1617 real,
intent(in) :: k4y
1618 real,
intent(in) :: dep
1619 real,
intent(out) :: sum_kx
1620 real,
intent(out) :: sum_ky
1621 real,
intent(out) :: sum_w
1645 sum_kx = (k1x + k2x) - (k3x + k4x)
1646 sum_ky = (k1y + k2y) - (k3y + k4y)
1650 w1 =
x_disper(sqrt(k1x**2 + k1y**2),dep)
1651 w2 =
x_disper(sqrt(k2x**2 + k2y**2),dep)
1652 w3 =
x_disper(sqrt(k3x**2 + k3y**2),dep)
1653 w4 =
x_disper(sqrt(k4x**2 + k4y**2),dep)
1655 sum_w = w1 + w2 - (w3 + w4)
1719 real,
intent(out) :: ka,kb
1720 real,
intent(out) :: km
1721 real,
intent(out) :: kw
1722 real,
intent(out) :: loclen
1782 eps = 10.*epsilon(1.)
1793 k1m = sqrt(
k1x**2 +
k1y**2)
1794 k3m = sqrt(
k3x**2 +
k3y**2)
1850 call q_polar2(ka,kb,kx_beg,ky_beg,kx_end,ky_end,loclen,ierr)
1855 area2 =
pi*(kb-ka)*0.5*kw
1856 ratio = max(area1/area2,area2/area1)
1859 if(ratio>1.5 .and. k3m/k1m < 100.)
then
1860 call q_error(
'e',
'LOCUS',
'Severe problem in POLAR2')
1861 write(
luq_err,
'(a)')
'Q_CMPLOCUS: ratio > 1.5'
1906 ds_loc(iloc) = 0.5*(dsp + dsm)
1921 cple_loc(iloc) =
x_cple(
k1x,
k1y,
k2x,
k2y,
k3x,
k3y,
k4x,
k4y,
iq_cple,
q_depth,
q_grav)
2023 integer,
intent(in) :: itask
2024 integer,
intent(out) :: igrid
2083 integer iaz,ikz,jaz,jkz
2084 integer iz_geom,iz_disp,iz_cple
2093 real,
allocatable :: z_ad(:),z_sig(:)
2134 jdep = min(99999,jdep)
2143 call q_error(
'e',
'DISPER',
'Incorrect value for IQ_DISP')
2161 write(
luq_prt,
'(2a)')
'Q_CTRGRID: Header line of grid file:',trim(
q_header)
2162 write(
luq_prt,
'(2a)')
'Q_CTRGRID: Name of BINARY grid file:',trim(
bqname)
2182 if(
luq_bqf > 0 .and. iuerr ==0)
then
2184 write(
luq_prt,
'(2a)')
'Q_CTRGRID: Binary grid file detected: ',trim(
bqname)
2196 call q_error(
'w',
'READBQF',
'Read error for header in BQF file')
2197 write(
luq_err,
'(a)')
'BQF file deleted'
2214 &
'Q_CTRGRID: Header in binary quad file :',trim(
r_header)
2216 &
'Q_CTRGRID: Expected header of binary quad file:',trim(
q_header)
2217 write(
luq_prt,
'(a)')
'Q_CTRGRID: The file headers disagree'
2218 write(
luq_prt,
'(a)')
'Q_CTRGRID: A new grid will be generated'
2226 allocate (z_sig(nkz),z_ad(naz))
2229 read(
luq_bqf) iz_geom,iz_disp,iz_cple
2233 write(
luq_prt,
'(a)')
'Q_CTRGRID: Contents of BQF file'
2235 write(
luq_prt,
'(a,i4)')
'Q_CTRGRID: NK:',nkz
2236 write(
luq_prt,
'(a,i4)')
'Q_CTRGRID: NA:',naz
2244 if(abs(
q_ad(iaz)-z_ad(iaz)) > 0.01)
then
2245 write(
luq_prt,
'(a)')
'Q_CTRGRID: Directions do not agree'
2247 write(
luq_prt,
'(1x,a,i4,2f10.3)')
'iaz q_ad z_ad:',jaz,
q_ad(jaz),z_ad(jaz)
2258 if(abs(
q_sig(ikz)-z_sig(ikz)) > 0.01)
then
2259 write(
luq_prt,
'(a)')
'Q_CTRGRID: Wave numbers do not agree'
2261 write(
luq_prt,
'(1x,a,i4,2f10.3)')
'ikz q_k z_sig:',jkz,
q_sig(jkz),z_sig(jkz)
2272 if(abs(z_depth-s_depth) > 0.09 .and.
iq_disp > 1 .and. .not.
lq_grid)
then
2273 write(
luq_prt,
'(a)')
'Q_CTRGRID: Water depths do not agree'
2274 write(
luq_prt,
'(a,2f16.2)')
'Q_CTRGRID: q_depth z_depth:',
q_depth,z_depth
2281 if(
iq_log >= 1)
write(
luq_log,
'(a)')
'Q_CTRGRID: Existing BQF-file invalid, it will be closed'
2306 write(
luq_log,
'(a)')
'Q_CTRGRID: New grid will be generated'
2307 write(
luq_log,
'(a,a)')
'Q_CTRGRID: Name of BQF file:',trim(
bqname)
2312 &
'Q_CTRGRID: Generating wave number grid for quadruplet interactions: ',trim(
bqname)
2331 if(
iq_screen >=1)
write(
iscreen,
'(a)')
'Q_CTRGRID: Grid generation completed succesfully'
2340 if(
iq_prt >= 1)
write(
luq_prt,
'(2a)')
'Q_CTRGRID: Existing grid will be read:',trim(
bqname)
2341 if(
iq_log >= 1)
write(
luq_log,
'(2a)')
'Q_CTRGRID: Existing grid will be read:',trim(
bqname)
2367 if (
allocated(z_ad))
deallocate(z_ad,z_sig)
2396 subroutine q_dscale(n,sigma,angle,nsig,nang,depth,grav,q_dfac)
2436 integer,
intent (in) :: nsig
2437 integer,
intent (in) :: nang
2438 real,
intent(in) :: n(nsig,nang)
2439 real,
intent(in) :: sigma(nsig)
2440 real,
intent(in) :: angle(nang)
2441 real,
intent(in) :: depth
2442 real,
intent(in) :: grav
2443 real,
intent(out) :: q_dfac
2490 call z_steps(sigma,dsigma,nsig)
2491 delta = angle(2)-angle(1)
2503 dnn = n(isig,iang)*dsigma(isig)*delta
2505 sumk = sumk + 1./sqkk*dnn
2513 kms = (sum0/sumk)**2
2514 kd = max(0.5,0.75*kms*depth)
2515 q_dfac = 1+5.5/kd*(1.-5./6.*kd)*exp(-5./4.*kd)
2543 subroutine q_error(err_type,err_name,err_msg)
2578 character(len=1),
intent(in) :: err_type
2581 character(len=*),
intent(in) :: err_name
2582 character(len=*),
intent(in) :: err_msg
2601 character(len=80) qline
2614 &
'Q_ERROR: '//trim(
qbase)//
'.ERR connected to unit:',
luq_err
2620 write(
luq_err,
'(a)')
'--------------------------------------------------'
2625 if(index(
'wW',err_type) > 0)
then
2627 write(
luq_err,
'(a,i4)')
'Warning or non-terminating error:',
iq_warn
2628 write(
luq_err,
'(a,a)')
'Name of error:',trim(err_name)
2630 elseif(index(
'eE',err_type) > 0)
then
2633 write(
luq_err,
'(a,a)')
'Name of error:',trim(err_name)
2634 write(*,
'(1x,a,i4)')
'Terminating error:',
iq_err
2635 write(*,
'(1x,a,a)')
'Name of error:',trim(err_name)
2641 ntext = len_trim(err_name)
2648 &
'Q_ERROR: File ',trim(
qf_error),
' does not exist in current directory'
2652 &
'Q_ERROR: File Q_ERROR.TXT connected to unit:',
luq_txt
2658 read(
luq_txt,
'(a)',iostat=iend) qline
2663 if(qline(1:ntext) == err_name(1:ntext))
then
2665 write(
luq_err,
'(a)')
'Explanation of error, and recommended action'
2666 write(
luq_err,
'(a)')
'--------------------------------------------'
2667 write(
luq_err,
'(a)') trim(qline)
2672 do while (ispace ==1)
2673 read(
luq_txt,
'(a)',iostat=iend) qline
2678 if(qline(1:1) ==
' ')
then
2679 write(
luq_err,
'(a)') trim(qline)
2699 if(len_trim(err_msg) > 0)
then
2701 write(
luq_err,
'(a)')
'Additional message from point of occurrence:'
2702 write(
luq_err,
'(a)') trim(err_msg)
2709 write(
luq_err,
'(a)')
'Trace of error'
2710 write(
luq_err,
'(a)')
'--------------'
2717 if(
iq_warn > 10) stop
'Too many warnings'
2802 integer,
intent(in) :: ik1
2803 integer,
intent(in) :: ia1
2804 integer,
intent(in) :: ik3
2805 integer,
intent(in) :: ia3
2806 integer,
intent(out) :: ifnd
2846 real xt2(nlocus),yt2(nlocus)
2847 real xt4(nlocus),yt4(nlocus)
2853 integer ikmin,ja1,ja3,jk1,jk3,itmin
2871 ikmin = min(ik1,ik3)
2872 ikdif = abs(ik1-ik3)
2882 itmin = min(it1,it3)
2883 iadif = abs(it1-it3)
2893 if (iadif > nhalf)
then
2894 if(it1 > nhalf) it1 = it1 -
naq
2895 if(it3 > nhalf) it3 = it3 -
naq
2897 itmin = min(it1,it3)
2898 ibdif = (
naq - abs(
naq-2*abs(it1-it3)))/2
2913 kmem = (jk3-jk1+1) - (jk1-2*
nkq-2)*(jk1-1)/2
2923 if (amem >
iamax)
then
2925 call q_error(
'e',
'MEMORY',
'Incorrect addres')
2965 lambda =
q_kfac**(ikmin-1.)
2968 j_lambda = 1./sqrt(lambda)
2969 c_lambda = lambda**6
2973 zz_lambda = lambda*c_lambda/j_lambda
2981 if(ik3 > ik1 .and. it3 >= it1)
then
2998 elseif(ik3 > ik1 .and. it3 < it1)
then
3016 elseif(ik1 > ik3 .and. it3 >= it1)
then
3033 elseif(ik1 > ik3 .and. it1 > it3)
then
3050 elseif(ik1==ik3 .and. it3 > it1)
then
3067 elseif(ik1==ik3 .and. it1 > it3)
then
3088 t_zz(1:nloc) = lambda*c_lambda/j_lambda *
r_zz(1:nloc)
3239 write(
luq_prt,
'(a)')
'Basic wave numbers, frequencies'
3251 write(
luq_prt,
'(a,i4,3f10.5,e12.4)')
'Q_INIT: ikq f sigma k k^p:', &
3260 write(
luq_prt,
'(a)')
'Extended wave numbers and spacing'
3267 elseif(ikq==
nkq)
then
3291 write(
luq_prt,
'(a)')
'Q_INIT: Additional information'
3293 write(
luq_prt,
'(a,i3)')
'Number of frequencies:',
nkq
3294 write(
luq_prt,
'(a,f8.4)')
'Geometric f-spacing factor:',
q_ffac
3295 write(
luq_prt,
'(a,f8.4)')
'Geometric k-spacing factor:',
q_kfac
3300 write(
luq_prt,*)
' i f df sig dsig k dk cg'
3303 write(
luq_prt,
'(1x,i4,7f10.4)') &
3322 &
'Q_INIT: Index of first direction for reference:',
iaref
3338 &
'Q_INIT: Range of indices for loop over directions:',
iaq1,
iaq2
3348 if(
iq_prt>0)
write(
luq_prt,
'(a)')
'Q_INIT: take care of q_dird1 and check if sector is OK'
3361 write(
luq_prt,
'(a,f6.2,a)')
'Q_INIT: Angular step :',
q_deltad,
' degrees'
3363 write(
luq_prt,
'(a,i4)')
'Q_INIT: #Angles on circle:',
ncirc
3373 write(
luq_prt,
'(a,i4,f10.4,f10.2)')
'Q_INIT: iaq q_a q_ad:',iaq,
q_a(iaq),
q_ad(iaq)
3413 subroutine q_locpos(ka,kb,km,kw,loclen)
3448 real,
intent (out) :: ka
3449 real,
intent (out) :: kb
3450 real,
intent (out) :: km
3451 real,
intent (out) :: kw
3452 real,
intent (out) :: loclen
3534 kp = sqrt(kpx**2 + kpy**2)
3544 ka = 0.5*(-qs+sqrt(2.0*
pmag-qsq))
3546 kb = (
pmag+qsq)/(2.*qs)
3551 ka = 0.5*(-qs+sqrt(2.0*
pmag-qsq))
3553 kb = (
pmag-qsq)/(2.*qs)
3575 kacc = 10.*max(kk1,kk2)*eps
3590 do while (zz1*zz2 >= 0 .and. iter < maxiter)
3596 if(iter>=maxiter)
then
3597 call q_error(
'e',
'Start kb',
'Too many iterations needed')
3603 kacc = 10.*max(kk1,kk2)*eps
3621 do while (zz1*zz2 >= 0 .and. iter < maxiter)
3627 if(iter>=maxiter)
then
3628 call q_error(
'e',
'Start ka',
'Too many iterations needed')
3634 kacc = 10.*max(abs(kk1),abs(kk2))*eps
3647 do while (zz1*zz2 >= 0 .and. iter < maxiter)
3653 if(iter>=maxiter)
then
3654 call q_error(
'e',
'Start kb',
'Too many iterations needed')
3660 kacc = 10.*max(kk1,kk2)*eps
3701 do while (zz1*zz2 > 0 .and. iter < maxiter)
3713 bacc = 10.*max(beta1,beta2)*eps
3736 a1 = 0.4630151; a2 = 0.1077812;
3737 b1 = 0.2452727; b2 = 0.0412496;
3740 loclen = 4.*max(aa,bb)
3742 loclen = 4.*max(aa,bb)*((1. + a1*mm1 + a2*mm1**2) + (b1*mm1 + b2*mm1**2)*log(1/mm1))
3843 integer iaq3,ikq1,ikq3,nkq1
3846 real aa1,aa3,kk1,kk3
3849 integer nztot1,nztot2
3854 real w1k2,w2k2,w3k2,w4k2
3855 real w1k4,w2k4,w3k4,w4k4
3866 real,
allocatable :: xloc(:),yloc(:)
3879 if(
allocated(xloc))
deallocate(xloc) ;
allocate (xloc(
mlocus))
3880 if(
allocated(yloc))
deallocate(yloc) ;
allocate (yloc(
mlocus))
3911 k3:
do ikq3 = ikq1,
nkq
3919 if(iaq3 ==
iag1 .and. ikq3 == ikq1) cycle
3946 kmem = (ikq3-ikq1+1) - (ikq1-2*
nkq-2)*(ikq1-1)/2;
3970 ik2 = floor(
wk_k2(iloc))
3971 ia2 = floor(
wa_k2(iloc))
3972 wk =
wk_k2(iloc)-real(ik2)
3973 wa =
wa_k2(iloc)-real(ia2)
3974 w1k2 = (1.-wk)*(1.-wa)
3979 ik4 = floor(
wk_k4(iloc))
3980 ia4 = floor(
wa_k4(iloc))
3981 wk =
wk_k4(iloc)-real(ik4)
3982 wa =
wa_k4(iloc)-real(ia4)
3983 w1k4 = (1.-wk)*(1.-wa)
4105 if(
allocated(xloc))
deallocate(xloc,yloc)
4110 if(.not. lwrite)
then
4111 close(
luq_bqf,status=
'delete')
4115 write(
luq_log,*)
'Q_MAKEGRID: Since an error occurred during the generation'
4116 write(
luq_log,*)
'Q_MAKEGRID: of the interaction grid'
4124 write(
luq_prt,
'(a,i10)')
'Total number of points on loci :',nztot2
4125 write(
luq_prt,
'(a,i10)')
'Total number of stored points on locus:',nztot1
4126 write(
luq_prt,
'(a,i10)')
'Total number of zero points on locus :',nztot2-nztot1
4127 write(
luq_prt,
'(a,f8.2)')
'Reduction factor (%):',real(nztot2-nztot1)/real(nztot2)*100.
4241 real,
allocatable :: sold(:)
4242 real,
allocatable :: snew(:)
4284 if(abs(
q)>q_eps) nold = nold+1
4299 allocate (sold(nold),snew(nnew))
4304 if(abs(
q)<q_eps)
then
4310 sold(iold) =
s_loc(iold)
4311 slen = slen +
ds_loc(iold)
4333 if(
iq_gauleg > nnew) stop
'Q_MODIFY: iq_gauleg > nlocus0'
4338 if(abs(
q)>q_eps)
then
4339 dsnew = slen/real(nnew)
4341 snew(inew) = (inew-1.)*dsnew
4344 dsnew = slen/real(nnew-1.)
4346 snew(inew) = (inew-1)*dsnew
4358 if(abs(
q)<1.e-5)
then
4360 if(ierr > 0)
write(
luq_err,*)
'Z_INTP1 x_loc, ierr=',ierr
4364 if(ierr > 0)
write(
luq_err,*)
'Z_INTP1 x_loc, ierr=',ierr
4368 if(ierr > 0)
write(
luq_err,*)
'Z_INTP1 x_loc, ierr=',ierr
4372 if(ierr > 0)
write(
luq_err,*)
'Z_INTP1 x_loc, ierr=',ierr
4376 if(ierr > 0)
write(
luq_err,*)
'Z_INTP1 x_loc, ierr=',ierr
4384 diold = slen/real(nold)
4385 dinew = slen/real(nnew)
4390 jloc = floor((iloc-1.)*diold/dinew)+1
4402 if(ierr > 0)
write(
luq_err,*)
'Z_INTP1 jac_loc, ierr=',ierr
4406 if(ierr > 0)
write(
luq_err,*)
'Z_INTP1 cp_loc, ierr=',ierr
4414 if(ierr > 0)
write(
luq_err,*)
'Z_INTP1 x_loc, ierr=',ierr
4418 if(ierr > 0)
write(
luq_err,*)
'Z_INTP1 y_loc, ierr=',ierr
4422 if(ierr > 0)
write(
luq_err,*)
'Z_INTP1 x_loc, ierr=',ierr
4426 if(ierr > 0)
write(
luq_err,*)
'Z_INTP1 y_loc, ierr=',ierr
4430 if(ierr > 0)
write(
luq_err,*)
'Z_INTP1 s_loc, ierr=',ierr
4439 diold = slen/real(nold-1)
4440 dinew = slen/real(nnew)
4445 jloc = floor((iloc-1.)*diold/dinew + 1.49999)
4446 jloc = mod(jloc-1+nnew,nnew)+1
4458 if(ierr > 0)
write(
luq_err,*)
'Z_INTP1 jac_loc, ierr=',ierr
4462 if(ierr > 0)
write(
luq_err,*)
'Z_INTP1 cp_loc, ierr=',ierr
4468 call q_error(
'e',
'INTER',
'Problem in interpolation process')
4492 k2m = sqrt(
k2x**2 +
k2y**2)
4493 k4m = sqrt(
k4x**2 +
k4y**2)
4509 if(
allocated(sold))
deallocate(sold,snew)
4534 subroutine q_polar2(kmin,kmax,kx_beg,ky_beg,kx_end,ky_end,loclen,ierr)
4575 real,
intent(in) :: kmin
4576 real,
intent(in) :: kmax
4577 real,
intent(in) :: kx_beg
4578 real,
intent(in) :: ky_beg
4579 real,
intent(in) :: kx_end
4580 real,
intent(in) :: ky_end
4581 real,
intent(in) :: loclen
4582 integer,
intent (out) :: ierr
4666 dk = (kmax-kmin)/real(npol-1)
4668 k_pol(ipol) = kmin + (ipol-1)*dk
4687 dk0 = (kmax - kmin)/real(npol)
4695 do while (
k_pol(ipol) < kmax .and. iend==0 .and. ipol < mpol)
4697 knew = min(kmax,
k_pol(ipol)+dk)
4698 dkold = knew -
k_pol(ipol)
4700 ang1 =
pang + acos(cosold)
4701 ang2 =
pang + acos(cosnew)
4704 arg = kk1**2 + kk2**2 -2.*kk1*kk2*cos(ang1-ang2)
4705 dsnew = sqrt(abs(arg))
4706 if(dsnew>0) dke = dk*dsz/dsnew
4714 c_pol(ipol) = cosnew
4717 if (abs(dkold) < 0.0005*(kmax-kmin)) iend=1
4722 if(
k_pol(ipol) < kmax .and. ipol < mpol)
then
4736 kratio = (kmax/kmin)**(1./(npol-1.))
4738 k_pol(ipol) = kmin*kratio**(ipol-1.)
4852 integer,
intent(in) :: iquad
4882 character(len=10) cpar
4931 elseif(iquad==2)
then
4939 elseif(iquad==3)
then
4946 call q_error(
'e',
'IQUAD',
'No valid value of iquad has been given, default settings')
4947 write(
luq_err,
'(a,i4)')
'Q_SETCONFIG: Value of IQUAD:',iquad
4961 write(
luq_log,
'(a)')
'Q_SETCONFIG: Configuration file '//trim(
qbase)//
'.cfg has been found'
4968 read(
luq_cfg,*,iostat=iend) cpar,rpar
4974 if(trim(cpar)==
'DEPTH')
q_depth = rpar
4975 if(trim(cpar)==
'DSTEP')
q_dstep = rpar
4976 if(trim(cpar)==
'F_DMAX')
qf_dmax = rpar
4977 if(trim(cpar)==
'F_KRAT')
qf_krat = rpar
4978 if(trim(cpar)==
'F_FRAC')
qf_frac = rpar
4979 if(trim(cpar)==
'FMIN')
fqmin = rpar
4980 if(trim(cpar)==
'FMAX')
fqmax = rpar
4981 if(trim(cpar)==
'NLOCUS')
nlocus0 = int(rpar)
4982 if(trim(cpar)==
'SECTOR')
q_sector = rpar
4984 if(trim(cpar)==
'GEOM')
then
4988 if(
iq_screen>0)
write(
iscreen,
'(a)')
'Q_SETCONFIG: geometric scaling disabled'
4989 if(
iq_prt>=1)
write(
luq_prt,
'(a)')
'Q_SETCONFIG: geometric scaling disabled'
4992 if(trim(cpar)==
'COMPACT')
iq_compact = int(rpar)
4993 if(trim(cpar)==
'COUPLING')
iq_cple = int(rpar)
4994 if(trim(cpar)==
'DISPER')
iq_disp = int(rpar)
4995 if(trim(cpar)==
'FILT')
iq_filt = int(rpar)
4996 if(trim(cpar)==
'GAULEG')
iq_gauleg = int(rpar)
4997 if(trim(cpar)==
'GRID')
iq_grid = int(rpar)
4998 if(trim(cpar)==
'INTEG')
iq_integ = int(rpar)
4999 if(trim(cpar)==
'INTERP')
iq_interp = int(rpar)
5000 if(trim(cpar)==
'LOCUS')
iq_locus = int(rpar)
5001 if(trim(cpar)==
'LOGGING')
iq_log = int(rpar)
5002 if(trim(cpar)==
'LUMPING')
iq_lump = int(rpar)
5003 if(trim(cpar)==
'MAKE')
iq_make = int(rpar)
5004 if(trim(cpar)==
'MODIFY')
iq_mod = int(rpar)
5005 if(trim(cpar)==
'PRINT')
iq_prt = int(rpar)
5006 if(trim(cpar)==
'PRINT')
iq_prt = int(rpar)
5007 if(trim(cpar)==
'SCREEN')
iq_screen = int(rpar)
5008 if(trim(cpar)==
'SEARCH')
iq_search = int(rpar)
5009 if(trim(cpar)==
'SYM')
iq_sym = int(rpar)
5010 if(trim(cpar)==
'T13')
iq_t13 = int(rpar)
5011 if(trim(cpar)==
'TEST')
iq_test = int(rpar)
5012 if(trim(cpar)==
'TRACE')
iq_trace = int(rpar)
5013 if(trim(cpar)==
'TRANSF')
iq_trf = int(rpar)
5014 if(trim(cpar)==
'XDIA')
iq_xdia = int(rpar)
5021 &
'Q_SETCONFIG: '//trim(
qbase)//
'.cfg disconnected from :',
luq_cfg
5027 write(
luq_log,
'(a)')
'Q_SETCONFIG: Configuration file '//trim(
qbase)//
'.CFG has not been found'
5085 real,
intent(in) :: depth
5086 integer,
intent(out) :: igrid
5144 if(
iq_screen>=1)
write(
iscreen,
'(a)')
'Q_SEARCHGRID: grid accepted, read whole database'
5153 idepth = int(s_depth*10+eps)
5157 id_upper = min(
id_facmax*idepth,id_upper)
5168 do id = idepth-1,id_lower,-1
5184 do id = idepth+1,id_upper
5202 if(d_lower > 0)
then
5203 r_lower = s_depth/d_lower
5208 if(d_upper > 0)
then
5209 r_upper = d_upper/s_depth
5215 write(
luq_prt,
'(a,3f8.2)')
'Q_SEARCHGRID: d_lower d_target d_upper :',d_lower,s_depth,d_upper
5216 write(
luq_prt,
'(a,2f8.2)')
'Q_SEARCHGRID: r_lower r_upper :',r_lower,r_upper
5221 if(r_lower>0 .and. r_upper>0)
then
5222 if(r_lower < r_upper)
then
5228 elseif(r_lower > 0 .and. r_upper <0 )
then
5230 elseif(r_lower < 0 .and. r_upper > 0)
then
5233 call q_error(
'e',
'SEARCHGRID',
'No valid nearest grid could be found')
5247 write(
luq_prt,
'(a,2f8.4)')
'Q_SEARCHGRID: target and nearest scale factors:',dfac1,dfac2
5248 write(
luq_prt,
'(a,f8.4)')
'Q_SEARCHGRID: compound scale factor :',
q_scale
5255 write(
luq_prt,
'(a,f12.2)')
'Q_SEARCHGRID: Q_CTRGRID called with depth:',
q_depth
5256 write(
luq_prt,
'(a,i4)')
'Q_SEARCHGRID: igrid of nearest grid operation:',igrid
5285 q_version =
'GurboQuad Version: 5.03 Build: 59 Date: 2003/09/15 [S]'
5349 character(len=*),
intent(in) :: mod_name
5369 character(len=1) mod_task
5374 if(
iq_prt>0)
write(
luq_prt,
'(2a)')
'TRACE -> ',trim(mod_name)
5383 mod_len = len_trim(mod_name)
5384 mod_task = mod_name(1:1)
5387 if(mod_task(1:1) ==
'+')
then
5391 call q_error(
'e',
'STACKMAX',
' ')
5399 elseif(mod_task(1:1) ==
'-')
then
5404 write(
luq_err,
'(a)')
'Module name:',mod_name
5405 call q_error(
'e',
'STACKNAME',
' ')
5409 call q_error(
'e',
'STACKCALL',
' ')
5499 write(
luq_prt,
'(a)')
'Summary of settings for QUAD computation'
5500 write(
luq_prt,
'(a)')
'------------------------------------------------'
5501 write(
luq_prt,
'(a,i4)')
'Number of wave numbers :',
nkq
5502 write(
luq_prt,
'(a,i4)')
'Number of directions :',
naq
5503 write(
luq_prt,
'(a,f10.5)')
'Minimum frequency (Hz) :',
fqmin
5504 write(
luq_prt,
'(a,f10.5)')
'Maximum frequency (Hz) :',
fqmax
5506 write(
luq_prt,
'(a,i4)')
'Preferred number of locus points:',
nlocus0
5509 write(
luq_prt,
'(a,f10.3)')
'Gravitational acceleration:',
q_grav
5516 if(
iq_type==2)
write(
luq_prt,
'(a)')
'IQUAD = 2: Deep water & WAM depth scaling'
5517 if(
iq_type==3)
write(
luq_prt,
'(a)')
'IQUAD = 3: Direct finite depth calculation'
5520 write(
luq_prt,
'(a,f5.2)')
'Step size in m of BQF coding:',
q_dstep
5525 if(
iq_grid==3)
write(
luq_prt,
'(a)')
'Non-symmetric full circle grid'
5529 if(
iq_compact==1)
write(
luq_prt,
'(a)')
'Compact data along locus by eliminating zero contributions'
5538 if(
iq_screen>=2)
write(
luq_prt,
'(a)')
'Intermediate output to screen + subroutine tracing'
5542 if(
iq_search==0)
write(
luq_prt,
'(a)')
'No search is carried out for nearest QUAD grid'
5543 if(
iq_search==1)
write(
luq_prt,
'(a)')
'A search is carried out for nearest QUAD grid'
5550 if(
iq_cple==1)
write(
luq_prt,
'(a)')
'Deep water coupling coefficient of Webb'
5551 if(
iq_cple==2)
write(
luq_prt,
'(a)')
'Finite depth coupling coefficient of H&H'
5552 if(
iq_cple==3)
write(
luq_prt,
'(a)')
'Finite depth coupling coefficient of Gorman'
5553 if(
iq_cple==4)
write(
luq_prt,
'(a)')
'Deep water coefficient of Zakharov'
5554 if(
iq_cple==5)
write(
luq_prt,
'(a)')
'Finite depth coefficient of Zakharov'
5557 if(
iq_disp==1)
write(
luq_prt,
'(a)')
'Deep water dispersion relation'
5558 if(
iq_disp==2)
write(
luq_prt,
'(a)')
'Finite depth linear dispersion relation'
5559 if(
iq_disp==3)
write(
luq_prt,
'(a)')
'Non linear finite depth dispersion'
5562 if(
iq_filt==0)
write(
luq_prt,
'(a)')
'Filtering of quadruplets off'
5564 write(
luq_prt,
'(a)')
'Filtering of quadruplets on'
5567 write(
luq_prt,
'(a,f8.2)')
'Maximum directional difference :',
qf_dmax
5568 write(
luq_prt,
'(a,e12.3)')
'Fraction of maximum energy density:',
qf_frac
5576 if(
iq_locus==1)
write(
luq_prt,
'(a)')
'Compute locus with polar method with fixed k-step'
5577 if(
iq_locus==2)
write(
luq_prt,
'(a)')
'Compute locus with polar method using adaptive k-step'
5578 if(
iq_locus==3)
write(
luq_prt,
'(a)')
'Compute locus with polar method using geometric k-step'
5581 if(
iq_sym==0)
write(
luq_prt,
'(a)')
'Handling of symmetries disabled'
5582 if(
iq_sym==1)
write(
luq_prt,
'(a)')
'Handling of symmetries enabled'
5585 if(
iq_make==1)
write(
luq_prt,
'(a)')
'Make quadruplet grid when necessary'
5586 if(
iq_make==2)
write(
luq_prt,
'(a)')
'Always make quadruplet grid'
5587 if(
iq_make==3)
write(
luq_prt,
'(a)')
'Stop after generation of quadruplet grid'
5590 if(
iq_interp==1)
write(
luq_prt,
'(a)')
'Apply bi-linear interpotion to retrieve action density'
5591 if(
iq_interp==2)
write(
luq_prt,
'(a)')
'Take nearest bin to retrieve action density'
5594 if(
iq_lump==0)
write(
luq_prt,
'(a)')
'Lumping of coefficients along locus disabled'
5595 if(
iq_lump>0)
write(
luq_prt,
'(a)')
'Lumping of coefficients along locus enabled'
5598 if(
iq_mod==0)
write(
luq_prt,
'(a)')
'?X? Spacing of point along locus as initially computed'
5599 if(
iq_mod==1)
write(
luq_prt,
'(a)')
'Equidistant spacing of points along locus'
5620 write(
luq_prt,
'(a,i4)')
'Level of transformation output :',
iq_trf
5621 write(
luq_prt,
'(a)')
'----------------------------------------------'
5648 subroutine q_symmetry(k1x,k1y,k3x,k3y,k4x,k4y,symfac,nloc)
5677 integer,
intent(in) :: nloc
5678 real,
intent(in) :: k1x
5679 real,
intent(in) :: k1y
5680 real,
intent(in) :: k3x
5681 real,
intent(in) :: k3y
5682 real,
intent(in) :: k4x(nloc)
5683 real,
intent(in) :: k4y(nloc)
5684 real,
intent(out) :: symfac(nloc)
5717 dk13 = (k1x-k3x)**2 + (k1y-k3y)**2
5719 dk14 = (k1x-k4x(iloc))**2 + (k1y-k4y(iloc))**2
5720 if (dk13 >= dk14) symfac(iloc) = 0.
5745 subroutine q_t13v4(ik1,ia1,ik3,ia3,t13,diagk1,diagk3)
5792 integer,
intent(in) :: ik1
5793 integer,
intent(in) :: ia1
5794 integer,
intent(in) :: ik3
5795 integer,
intent(in) :: ia3
5796 real,
intent(out) :: t13
5797 real,
intent(out) :: diagk1
5798 real,
intent(out) :: diagk3
5844 real qn1,qn2,qn3,qn4
5862 if(ik1==ik3 .and. ia1==ia3)
goto 9999
5869 if(ifnd==0 .or.
nlocusx==0)
then
5874 qn1 =
nspec(ik1,ia1)
5875 qn3 =
nspec(ik3,ia3)
5904 jk2p = min(jk2+1,
nkq)
5925 ja2p = min(ja2p,
naq)
5932 jk4p = min(jk4+1,
nkq)
5944 ja4p = min(ja4p,
naq)
5952 nprod = qn13p*(qn4-qn2) + qn2*qn4*qn13d
5954 t13 = t13 + rterm*nprod
5965 qd1 = qn3*(qn4-qn2) - qn2*qn4
5966 qd3 = qn1*(qn4-qn2) + qn2*qn4
5967 diagk1 = diagk1 + qd1*rterm
5968 diagk3 = diagk3 + qd3*rterm
6148 do while (k2m >
q_k(jpos))
6153 if(k2m <=
q_k(1))
then
6156 elseif(k2m <
q_k(
nkq) .and. k2m >
q_k(1))
then
6157 dk =
q_k(jpos)-
q_k(jpos-1)
6158 wk_k2(iloc) = real(jpos-1) + (k2m-
q_k(jpos-1))/dk
6160 elseif(k2m >=
q_k(
nkq))
then
6172 do while (k4m >
q_k(jpos))
6177 if(k4m <=
q_k(1))
then
6180 elseif(k4m <
q_k(
nkq) .and. k4m >
q_k(1))
then
6181 dk =
q_k(jpos)-
q_k(jpos-1)
6182 wk_k4(iloc) = real(jpos-1) + (k4m-
q_k(jpos-1))/dk
6184 elseif(k4m >=
q_k(
nkq))
then
6220 subroutine q_loc_w1w3(k1x,k1y,k3x,k3y,npts,k2x,k2y,k4x,k4y,s)
6250 integer,
intent(in) :: npts
6251 real,
intent(in) :: k1x
6252 real,
intent(in) :: k1y
6253 real,
intent(in) :: k3x
6254 real,
intent(in) :: k3y
6256 real,
intent(out) :: k2x(npts)
6257 real,
intent(out) :: k2y(npts)
6258 real,
intent(out) :: k4x(npts)
6259 real,
intent(out) :: k4y(npts)
6260 real,
intent(out) :: s(npts)
6307 dir1 = atan2(k1y,k1x)
6308 dir3 = atan2(k3y,k3x)
6309 dirs = 0.5*(180-abs(180-abs(dir3-dir1)))
6310 k1m = sqrt(k1x**2 + k1y**2)
6315 xk0 = k1m * cos(dirs)
6316 yk0 = k1m * sin(dirs)
6322 dk0 = 3./real(npts-1.)
6334 w2 = 2.*real(ipt-npts/2)*dk0
6337 k2x(ipt) = xx2*cos(dirs) - yy2*sin(dirs)
6338 k2y(ipt) = yy2*cos(dirs) + xx2*sin(dirs)
6341 k4x(ipt) = xx4*cos(dirs) - yy4*sin(dirs)
6342 k4y(ipt) = yy4*cos(dirs) + xx4*sin(dirs)
6343 s(ipt) = real(ipt-1)*dk0*xk0
6372 subroutine q_xnl4v4(aspec,sigma,angle,nsig,nang,depth,xnl,diag,ierr)
6423 integer,
intent(in) :: nsig
6424 integer,
intent(in) :: nang
6425 real,
intent(in) :: aspec(nsig,nang)
6426 real,
intent(in) :: sigma(nsig)
6427 real,
intent(in) :: angle(nang)
6428 real,
intent(in) :: depth
6429 real,
intent(out) :: xnl(nsig,nang)
6431 real,
intent(out) :: diag(nsig,nang)
6432 integer,
intent(out) :: ierr
6533 if(
iq_screen >= 1)
write(
iscreen,
'(a)')
'Q_XNL4V4: Checking interaction grid '
6538 if(
iq_err /= 0)
goto 9999
6541 call q_error(
'e',
'NOGRID',
'No proper grid exists')
6546 call q_error(
'e',
'MAKEGRID',
'Only computation of grid')
6564 call q_error(
'e',
'NOGRID',
'No proper grid exists')
6577 nspec(ikq,iaq) = aspec(ikq,iaq)/
q_k(ikq)*cg(ikq)
6587 qn_max = maxval(
nspec)
6597 qn1 =
nspec(ik1,ia1)
6601 qn3 =
nspec(ik3,ia3)
6603 if(
iq_screen>=3)
write(
iscreen,
'(a,4i4)')
'Q_XNL4V4: ik1 ia1 ik3 ia3:',ik1,ia1,ik3,ia3
6607 a_dif = 180. - abs(180. - abs(
q_ad(ia1) -
q_ad(ia3)))
6633 if(qn1 < qn_min .and. qn3 < qn_min)
then
6638 if(ifil_dir==0 .and. ifil_krat==0 .and. ifil_dens==0 .or.
iq_filt==0)
then
6643 call q_t13v4(ik1,ia1,ik3,ia3,t13,diagk1,diagk3)
6646 if(
iq_err /= 0)
goto 9999
6680 diag(ik1,ia1) = diag(ik1,ia1) + diagk1*
q_k(ik3)*
q_delta*
q_dk(ik3)
6716 xnl(ikq,jaq) = xnl(ikq,iaq)
6727 jacobian =
q_k(ikq)/cg(ikq)
6729 xnl(ikq,iaq) = xnl(ikq,iaq)*jacobian
6784 real,
intent(in) :: k
6854 real function x_cple(k1x,k1y,k2x,k2y,k3x,k3y,k4x,k4y,iq_cple,depth,grav)
6888 real,
intent(in) ::
k1x
6889 real,
intent(in) ::
k1y
6890 real,
intent(in) ::
k2x
6891 real,
intent(in) ::
k2y
6892 real,
intent(in) ::
k3x
6893 real,
intent(in) ::
k3y
6894 real,
intent(in) ::
k4x
6895 real,
intent(in) ::
k4y
6896 integer,
intent(in) ::
iq_cple
6897 real,
intent(in) :: depth
6898 real,
intent(in) :: grav
6999 real,
intent(in) :: kxx
7000 real,
intent(in) :: kyy
7034 w2 =
sqrtg * (kxx**2 + kyy**2)**(0.25)
7035 w4 =
sqrtg * ((kxx+
px)**2 + (kyy+
py)**2)**(0.25)
7039 k2m = sqrt(kxx**2+kyy**2)
7040 k4m = sqrt((kxx+
px)**2 + (kyy+
py)**2)
7113 real,
intent(in) :: x2
7114 real,
intent(in) :: y2
7115 real,
intent(in) :: x4
7116 real,
intent(in) :: y4
7142 k2m = sqrt(x2**2 + y2**2)
7143 k4m = sqrt(x4**2 + y4**2)
7157 cg2 = sig2/k2m*(0.5+k2md/sinh(2*k2md))
7163 cg4 = sig4/k4m*(0.5+k4md/sinh(2*k4md))
7166 x_jacobian = sqrt(cg2**2+cg4**2-2*cg2*cg4*cos(ang2-ang4))
7225 real,
intent(in) :: k
7226 real,
intent(in) :: d
7260 if (kd > 20.) id = 1
7318 real,
intent(in) :: k2
7351 w2 =
sqrtg * sqrt(k2)
7414 real,
intent(in) :: lambda
7446 kk2m = sqrt(kk2x**2 + kk2y**2)
7450 kk4m = sqrt(kk4x**2 + kk4y**2)
7454 w2 =
sqrtg * sqrt(kk2m)
7455 w4 =
sqrtg * sqrt(kk4m)
7490 real function xc_hh(w1x0,w1y0,w2x0,w2y0,w3x0,w3y0,z4x,z4y,h)
7499 real w1x0,w1y0,w2x0,w2y0,w3x0,w3y0,h,dsq
7500 real om1,om2,om3,om4,scpl1,scpl2,scpl3,stot
7501 real t1,t2,t3,t4,t5,tot1,tot2,tot3,tot4,tot5
7503 real s1,s2,s3,z1,z2,z3,z4,z5
7504 real p1,p2,p3,p4,di,tnz1,tnz2,tnz3,tnz23
7505 real csz1,csz2,csz3,csz23
7506 real e,g,gsq,omsq23,pi4
7514 real k1,k2,k3,
k1x,
k2x,
k3x,
k1y,
k2y,
k3y,k23x,k23y,k23,k1x0,k1y0, &
7515 & k2x0,k2y0,k3x0,k3y0,k1zx,k1zy
7516 data pi4/0.785398163/
7578 k23=sqrt(k23x**2+k23y**2)
7586 di=-(som2+som3)*(k2*k3*tnz2*tnz3-dot23) &
7587 & +0.5*(som2*k3**2/(csz3)**2+som3*k2**2/(csz2)**2)
7589 e=0.5/g *(dot23-som2*som3/gsq*(om2**2+om3**2+som2*som3))
7591 p1=2.*(som1+som2+som3)*(om1**2.*omsq23/gsq-dot123)
7593 p2=-som1*(k23)**2/(csz23)**2
7595 p3=-(som2+som3)*k1**2/(csz1)**2
7598 z2=z2+omsq23-(som2+som3)**2
7602 t1=di/(omsq23-(som2+som3)**2 + eps ) * (p1+p2+p3)
7604 t2=-di*som1/gsq *(om1**2+omsq23)
7606 p4=g*k1**2/(csz1)**2
7608 t3=e*(som1**3*(som2+som3)/g - g*dot123 - p4)
7610 t4=0.5*som1/gsq*dot23*((som1+som2+som3)*(om2**2+om3**2) &
7611 & +som2*som3*(som2+som3))
7613 t5=-0.5*som1*om2**2*k3**2/gsq*(som1+som2+2.*som3) &
7614 & -0.5*som1*om3**2*k2**2/gsq*(som1+2.*som2+som3)
7616 scpl1=t1+t2+t3+t4+t5
7661 k23=sqrt(k23x**2+k23y**2)
7668 di=-(som2+som3)*(k2*k3*tnz2*tnz3-dot23) &
7669 & +0.5*(som2*k3**2/(csz3)**2+som3*k2**2/(csz2)**2)
7671 e=0.5/g *(dot23-som2*som3/gsq *(om2**2+om3**2+som2*som3))
7673 p1=2.*(som1+som2+som3)*(om1**2.*omsq23/gsq-dot123)
7675 p2=-som1*(k23)**2/(csz23)**2
7677 p3=-(som2+som3)*k1**2/(csz1)**2
7679 z2=z2+omsq23-(som2+som3)**2
7684 t1=di/(omsq23-(som2+som3)**2) * (p1+p2+p3)
7686 t2=-di*som1/gsq *(om1**2+omsq23)
7688 p4=g*k1**2/(csz1)**2
7690 t3=e*(som1**3*(som2+som3)/g - g*dot123 - p4)
7692 t4=0.5*som1/gsq*dot23*((som1+som2+som3)*(om2**2+om3**2) &
7693 & +som2*som3*(som2+som3))
7695 t5=-0.5*som1*om2**2*k3**2/gsq*(som1+som2+2.*som3) &
7696 & -0.5*som1*om3**2*k2**2/gsq*(som1+2.*som2+som3)
7698 scpl2=t1+t2+t3+t4+t5
7743 k23=sqrt(k23x**2+k23y**2)
7750 di=-(som2+som3)*(k2*k3*tnz2*tnz3-dot23) &
7751 & +0.5*(som2*k3**2/(csz3)**2+som3*k2**2/(csz2)**2)
7753 e=0.5/g *(dot23-som2*som3/gsq *(om2**2+om3**2+som2*som3))
7755 p1=2.*(som1+som2+som3)*(om1**2.*omsq23/gsq-dot123)
7757 p2=-som1*(k23)**2/(csz23)**2
7759 p3=-(som2+som3)*k1**2/(csz1)**2
7761 z2=z2+omsq23-(som2+som3)**2
7766 t1=di/(omsq23-(som2+som3)**2) * (p1+p2+p3)
7768 t2=-di*som1/gsq*(om1**2+omsq23)
7770 p4=g*k1**2/(
cosz(k1*h))**2
7772 t3=e*(som1**3*(som2+som3)/g - g*dot123 - p4)
7774 t4=0.5*som1/gsq*dot23*((som1+som2+som3)*(om2**2+om3**2) &
7775 & +som2*som3*(som2+som3))
7777 t5=-0.5*som1*om2**2*k3**2/gsq*(som1+som2+2.*som3) &
7778 & -0.5*som1*om3**2*k2**2/gsq*(som1+2.*som2+som3)
7780 scpl3=t1+t2+t3+t4+t5
7787 stot=(scpl1+scpl2+scpl3)
7789 dsq=stot*stot*pi4*gsq/(om1*om2*om3*om4+eps)
7808 real function
tanz(x)
7826 real function
cosz(x)
7855 real function xc_webb(k1x,k1y,k2x,k2y,k3x,k3y,k4x,k4y,grav)
7886 real,
intent(in) ::
k1x
7887 real,
intent(in) ::
k1y
7888 real,
intent(in) ::
k2x
7889 real,
intent(in) ::
k2y
7890 real,
intent(in) ::
k3x
7891 real,
intent(in) ::
k3y
7892 real,
intent(in) ::
k4x
7893 real,
intent(in) ::
k4y
7894 real,
intent(in) :: grav
7915 double precision wsqp12
7916 double precision wsqm13
7917 double precision wsq13
7918 double precision wsqm14
7919 double precision wsq14
7920 double precision wsq12
7923 real p1,p2,p3,p4,p5,p6,p7,p8,p9
7961 wsq12 = (w1+w2)*(w1+w2)
7963 wsq13 = (w1-w3)*(w1-w3)
7965 wsq14 = (w1-w4)*(w1-w4)
7969 z = 2.*wsq12*(k1*k2-dot12)*(k3*k4-dot34)
7971 z = 2.*wsq13*(k1*k3+dot13)*(k2*k4+dot24)
7973 z = 2.*wsq14*(k1*k4+dot14)*(k2*k3+dot23)
7975 p4 = 0.5 *(dot12*dot34 + dot13*dot24 + dot14*dot23)
7976 p5 = 0.25*(dot13+dot24) * wsq13 * wsq13
7977 p6 = -0.25*(dot12+dot34) * wsq12 * wsq12
7978 p7 = 0.25*(dot14+dot23) * wsq14 * wsq14
7979 p8 = 2.5*k1*k2*k3*k4
7980 p9 = wsq12*wsq13*wsq14* (k1 + k2 + k3 + k4)
7982 dwebb = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9
7983 xc_webb = grav**2*pi4*dwebb*dwebb/(w1*w2*w3*w4+eps)
real, dimension(:,:,:), allocatable quad_zz
compound product of cple*ds*sym/jac
real q_scale
additional scale factor resulting from SEARCH for neasrest grid
real rel_k
relative accuracy for equality check of k
subroutine q_cmplocus(ka, kb, km, kw, loclen)
Compute locus function used for the determination of the resonnance condition.
real q_grav
gravitational acceleration (Earth = 9.81 m/s^2)
real, dimension(:), allocatable t_w4k2
transformed weight 4 for k2
real, dimension(:), allocatable r_w4k2
corresponding declarations
subroutine q_polar2(kmin, kmax, kx_beg, ky_beg, kx_end, ky_end, loclen, ierr)
Compute position of locus for given k1-k3 vector.
real, dimension(:), allocatable wk_k2
position of k2 and k4 wave number
real, dimension(:), allocatable q_df
step size of frequency grid
real, dimension(:), allocatable q_f
frequencies accociated to wave number/depth
real qf_krat
maximum ratio of the interacting wave numbers k1 and k3
real, dimension(:), allocatable k4a_mod
k4 angle around locus
integer luq_loc
statistics about computed loci
real fqmax
highest frequency in Hz
real loc_yz
y-coordinate of center of gravity of locus in (kx,ky)-space
real loc_area
area of locus, measured in (kx-ky)- space
integer, dimension(:,:,:), allocatable quad_ik4
lower wave number index of k4
real kmid
wave number at midpoint of locus along symmetry axis
real, dimension(:), allocatable ds_mod
step size around locus
real k4y
components of k4 wave number
real q_deltad
directional spacing of angular grid in degrees
real function x_disper(k, d)
Compute radian frequency for a given wave number and water depth.
integer iq_type
method for computing the nonlinear interactions depending on the value of iq_type a number of setting...
subroutine q_modify
Modify points along the locus, such that they are evenly distributed only when intended,...
subroutine z_cmpcg(sigma, depth, grav, cg)
subroutine z_steps(x, dx, nx)
real, dimension(:), allocatable r_w2k4
integer iaq2
indices of do-loop for directions
real, dimension(:), allocatable a_pol
angles of polar locus
integer iamax
maximum difference in indices for sector grids
real, dimension(:), allocatable nk1d
Internal 1d action density spectrum N(k)
integer luq_cfg
user defined configuration
real q_sector
half plane width in degrees (for iq_grid=1,2)
real, dimension(:), allocatable k2m_mod
k2 magnitude around locus
integer luq_grd
ASCII file storing and retrieving precomputed loci.
integer iq_compact
switch to compact data == 0, do not compact == 1, compact data by elimiting zero contribution along l...
real, dimension(:), allocatable r_ws
corresponding declarations
subroutine z_fclose(iunit)
Close file with unit number IUNIT, and set IUNIT=-1.
subroutine q_getlocus(ik1, ia1, ik3, ia3, ifnd)
Retrieve locus from basic locus as stored in the database.
real, dimension(:), allocatable z_mod
data value around locus
real, dimension(:,:,:), allocatable quad_w1k4
weight 1 of k4
character(len=21) r_header
header of Binary Quadruplet File as exists in BQF-file
integer ncirc
number of angles on a full circle
integer iscreen
identifier for screen, set in XNL_INIT
subroutine q_chkconfig
Check configuration for computation of non-linear transfer.
real, dimension(:), allocatable q_a
directions of quadruplet grid in radians
real, dimension(:), allocatable ds_loc
step size around locus
real function cosz(x)
N/A.
real function z_root2(func, x1, x2, xacc, iprint, ierr)
integer nlocus
number of points on locus, equal to klocus
real, dimension(:), allocatable wt_k2
weight factor in tail,
integer luq_bqf
binary file storing and retrieving precomputed loci
integer mlocus
maximum number of points on locus for defining arrays
subroutine q_loc_w1w3(k1x, k1y, k3x, k3y, npts, k2x, k2y, k4x, k4y, s)
Compute locus for the special case w1=w3.
integer, dimension(:,:), allocatable quad_nloc
number of points on locus
real, dimension(:,:,:), allocatable quad_w4k2
weight 4 of k2
integer iq_test
test level, output is directed to unit luqtst == 0, no test output == 1, output of basic I/O == 2,...
real, dimension(:), allocatable sym_mod
factor for symmetry between k3 and k4
real q_ang2
lower and upper angle of grid in degrees
real, dimension(:), allocatable q_sk
step size of extended wave number array
subroutine q_allocate
Check configuration for non-linear transfer.
real pang
angle related of P-vector, Pang = atan2(py,px), (radians)
integer iq_geom
type of scaling == 0, no geometric scaling, only directional scaling of loci == 1,...
subroutine q_searchgrid(depth, igrid)
Search nearest valid grid, read grid file and scale factor.
integer iq_integ
option to output integration results ==0 no output of integration ==1 only sum per locus ==2 also inf...
subroutine q_ctrgrid(itask, igrid)
Control of interaction grid administration.
integer luq_trf
testing transformation of loci
real q_depth
local water depth in m
real, dimension(:), allocatable s_mod
coordinate along locus
subroutine q_init
Initializing module for quadruplets and setting default settings.
real k3y
components of k3 wave number
subroutine q_setconfig(iquad)
Set settings for computing the nonlinear interactions.
real, dimension(:), allocatable r_jac
real, dimension(:,:), allocatable a
Action density on wave number grid A(sigma,theta)
real rade
conversion from radians to degrees
real crf1
estimated circumference of locus
real, dimension(:,:,:), allocatable quad_w2k2
weight 2 of k2
real, dimension(:), allocatable q_cg
group velocity (m/s)
real, dimension(:), allocatable jac_loc
jacobian term around locus
subroutine q_setversion
Subroutine has automatically been written by MODULE5.
real q_ffac
geometric factor between subsequent frequencies
real, dimension(:,:), allocatable qnl
Nonlinear energy transfer Snl(k,theta)
integer, parameter mq_stack
maximum number of elements in stack
real function x_locus1(k2)
Compute locus function along symmetry axis.
real k2y
components of k2 wave number
integer iq_grid
type of spectral grid == 1, sector & symmetric around zero == 2, sector & symmetric around zero & non...
real function x_jacobian(x2, y2, x4, y4)
Compute gradient/Jacobian term for a given point on the locus.
integer, dimension(:), allocatable r_ik2
corresponding declarations r_ik2
character(len=60) q_version
version string
real q_dird2
first and last direction of host model (via XNL_INIT) degrees
real fqmin
lowest frequency in Hz
real qf_tail
power of spectral tail of E(f), e.g.
real loc_crf
circumference of locus in (kx,ky)-space
real, dimension(:,:,:), allocatable quad_w3k2
weight 3 of k2
real, dimension(:), allocatable dt13
increment along locus
real, dimension(:), allocatable c_pol
cosines during polar generation of locus
integer iq_prt
switch to activate print output, to file QBASE//.PRT == 0, No print output == 1, print output
real function x_locus2(lambda)
Compute locus function perpendicluar to symmetry axis.
integer nlocus0
preferred number of points on locus
real q_kfac
geometric factor between subsequent wave numbers (only valid for IQ_IDISP==1)
real, dimension(:), allocatable cple_mod
coupling coefficient around locus
real, dimension(:), allocatable r_w1k2
subroutine z_intp1(x1, y1, x2, y2, n1, n2, ierr)
real function x_cple(k1x, k1y, k2x, k2y, k3x, k3y, k4x, k4y, iq_cple, depth, grav)
Compute coupling coefficient between a quadruplet of interacting wave numbers.
real, dimension(:), allocatable x4_loc
k4x coordinates around locus
real q_lambda
geometric scaling factor for 'deep' water loci
character(len=20) sub_name
Name of active subroutine.
real eps_k
absolute accuracy for equality check of k
real, dimension(:), allocatable x4_mod
k4x coordinates along locus
character(len=13) bqname
name of binary quadruplet grid file
integer nkq
number of wave numbers of quad-grid
real, dimension(:), allocatable t_w3k4
transformed weight 3 for k4
integer iq_trace
trace option == 0, no trace of subroutine calls 0, maximum number of traces per subroutine < 0,...
real q_dstep
step size for generating BQF files
integer iq_sym
switch to activate use of symmetry reduction == 0, no symmetries are used == 1, symmetry activated (d...
real, dimension(:), allocatable wk_k4
w.r.t.
real, dimension(:), allocatable q_sig
radian frequencies associated to wave number/depth
real kqmax
highest wave number
real kmidx
x-component of wave number at midpoint of locus along symmetry axis
subroutine q_summary
Write summary of GurboQuad settings to print file.
real, dimension(:), allocatable sym_loc
factor for symmetry between k3 and k4
integer iq_cple
type of coupling coefficient == 1, deep water coefficient of Webb == 2, deep water coefficient of Zak...
integer iq_mod
option to redistribute points on locus == 0, Points will be used as computed by tracing algortihm == ...
real, dimension(:), allocatable y4_loc
k4y coordinates around locus
integer iq_t13
option to output T13 integration ==0, no output ==1, test output of T13 per locus
subroutine xnl_init(sigma, dird, nsigma, ndir, pftail, x_grav, depth, ndepth, iquad, iqgrid, iproc, ierr)
Initialize coefficients, integration space, file i/o for computation nonlinear quadruplet wave-wave i...
integer iq_screen
option to send output to the screen == 0, no output is send to screen == 1, output is send to screen
real, dimension(:), allocatable k_pol
wave numbers during polar generation of locus
integer iq_trf
option to print transformed loci to special output file == 0, no output to data file unit luqtrf == 1...
real, dimension(:), allocatable y2_mod
k2y coordinates along locus
real function x_flocus(kxx, kyy)
Compute locus function used for the determination of the resonance condition.
integer luq_fil
test output for filtering
real, dimension(:), allocatable cple_loc
coupling coefficient around locus
integer iq_gauleg
switch for Gauss-Legendre interpolation == 0, No Gauss-Legendre, default 0 Gauss-Legendre,...
integer luq_txt
reading (error) text file
real sk_max
maximum wave number in extended array
subroutine q_chkcons(xnl, nk, ndir, sum_e, sum_a, sum_mx, sum_my)
Check conservation laws of non-linear transfer.
real, dimension(:), allocatable q_xk
extended wave number array starting at index 0
integer iq_interp
type of interpolation to retrieve action density == 1, bi-linear interpolation in discrete spectrum (...
integer, dimension(:), allocatable t_ia4
transformed weight for k4
integer luq_tst
test file for quadruplets
real loc_xz
x-coordinate of center of gravity of locus in (kx,ky)-space
character(len=20) qf_error
name of file with error messages
real sqrtg
square root of grav
real pi
circular constant, 3.1415...
real k1y
components of k1 wave number
subroutine q_dscale(n, sigma, angle, nsig, nang, depth, grav, q_dfac)
Compute scaling factor for nonlinear transfer in finite depth.
real, dimension(:), allocatable s_loc
coordinate along locus
integer iq_lump
switch to activate lumping on locus == 0, No lumping == 1, Lumping along locus
integer, dimension(:), allocatable t_ik2
transformed weight for k2-magnitude
subroutine q_weight
Compute interpolation weights of locus.
integer iq_xdia
switch to activate output to extended DIA data file == 0, no output 0, output to data file,...
integer luq_err
file with error messages
integer iq_filt
switch to activate filtering in wave number space ==0, no filtering ==1, filtering activated
real, dimension(:), allocatable t_w3k2
transformed weight 3 for k2
real function xc_webb(k1x, k1y, k2x, k2y, k3x, k3y, k4x, k4y, grav)
Compute deep water coupling coefficient for non-linear quadruplet interactions.
real, dimension(:), allocatable q_k
wave number grid [1/m]
real, dimension(:), allocatable q_ad
directions of quadruplet grid in degrees
real q_mindepth
minimum water depth, set in XNL_INIT, used in Q_CTRGRID
real, dimension(:,:,:), allocatable quad_w2k4
weight 2 of k4
integer luq_int
test file for test output of integration
subroutine q_makegrid
Set-up grid for computation of loci.
real q_delta
directional spacing of angular grid in radians
integer iq_dscale
switch to activate depth scaling according to Herterich and Hasselmann == 0, No depth scaling == 1,...
character(len=13) aqname
name of ASCII grid file
integer iq_disp
type of dispersion relation, viz.
real q_maxdepth
maximum water depth, set in XNL_INIT, used in Q_CTRGRID
integer iq_warn
counts the number of warnings
real pmag
magnitude of P-vector
integer iq_search
switch to determine search for a proper grid == 0, no search is carried out == 1, search nearest (rel...
real py
components of difference k1-k3 wave number
logical lq_grid
flag to make (new) interaction grid
real, dimension(:), allocatable k4m_mod
k4 magnitude around locus
real xang
angle of locus for the case that w1=w3, Xang=atan2(-px,py), (radians)
real, dimension(:), allocatable wt_k4
wt==1 for wave numbers inside k-grid
integer iq_err
counts the number of errors if no error occurred, IQ_ERR = 0 for each occuring error,...
integer id_facmax
Factor for determining range of depth search (Q_SEARCHGRID)
real, dimension(:), allocatable wa_k4
w.r.t.
real, dimension(:), allocatable t_w4k4
transformed weight 4 for k4
real qk_tail
power of spectral tail of N(k), computed from qf_tail
real, dimension(:), allocatable q_kpow
wave number to a certain power, used in filtering
real, dimension(:), allocatable wa_k2
position of k2 and k4 wave number
integer luq_prt
general print file for quadruplets
real, dimension(:), allocatable r_w2k2
integer, dimension(:,:,:), allocatable quad_ia2
lower direction index of k2
real kmidy
y-component of wave number at midpoint of locus along symmetry axis
real, dimension(:), allocatable r_w1k4
subroutine q_xnl4v4(aspec, sigma, angle, nsig, nang, depth, xnl, diag, ierr)
Compute nonlinear transfer for a given action density spectrum on a given wave number and direction g...
subroutine q_stack(mod_name)
Add or remove mod_name name from module stack.
integer iq_stack
Sequence number of stack with subroutine calls.
integer iq_make
option to make quadruplet grid == 1, make when needed (default) == 2, always make quadruplet grid == ...
integer luq_t13
test of basis integration
character(len=21), dimension(mq_stack) cstack
Stack with module names.
real, dimension(:), allocatable q_dsig
step size of radian frequency grid
real kmax_loc
maximum wave number of locus along symmetry axis
integer ik_k3
indices of main loop variables
real sang
angle of symmytry axis of locus, SANG = PANG +/ pi° (radians)
integer, dimension(:), allocatable r_ik4
corresponding declarations r_ik4
integer ik_k1
indices of main loop variables
real dera
conversion from degrees to radians
real function tanz(x)
N/A.
real, dimension(:,:,:), allocatable quad_w1k2
weight 1 of k2
real, dimension(:), allocatable y4_mod
k4y coordinates along locus
real, dimension(:), allocatable t_w2k4
transformed weight 2 for k4
integer nlocusx
number of points on locus for use in computation (nlocusx <= nlocus)
integer klocus
number of points on locus as stored in quadruplet database based on nlocus0, iq_gauleg and iq_lump (w...
integer iaref
index of first angle of reference wave numbers
real dk0
components of initial wave number of locus,
subroutine q_symmetry(k1x, k1y, k3x, k3y, k4x, k4y, symfac, nloc)
Compute symmetry factor to reduce integration.
subroutine z_polyarea(xpol, ypol, npol, area)
integer naq
number of angles of quad-grad
real, dimension(:), allocatable t_zz
product term
integer, dimension(:,:,:), allocatable quad_ik2
lower wave number index of k2
subroutine y_gauleg(x1, x2, x, w, n)
subroutine q_error(err_type, err_name, err_msg)
Error handling routine.
integer, dimension(:), allocatable r_ia2
corresponding declarations r_ia2
real, dimension(:), allocatable r_w3k2
integer iq_locus
Option for computation of locus ==1, explicit polar method with fixed k-step ==2, explicit polar meth...
character(len=13) lastquadfile
name of last retrieved BQF file
real, dimension(:), allocatable x2_loc
k2x coordinates around locus
Module for computing the quadruplet interaction.
real, dimension(:), allocatable r_cple
real kmin_loc
minimum wave number of locus along symmetry axis
real krefy
components of reference wave number for quad-grid
subroutine xnl_main(aspec, sigma, angle, nsig, ndir, depth, iquad, xnl, diag, iproc, ierr)
Compute nonlinear transfer for a given action density spectrum on a given sigma and direction grid (W...
real eps_q
absolute accuracy for check of Q
integer, dimension(:), allocatable r_ia4
corresponding declarations r_ia4
real, dimension(:), allocatable k2a_mod
k2 angle around locus
real, dimension(:,:,:), allocatable quad_w4k4
weight 4 of k4
real, dimension(:), allocatable t_w1k2
transformed weight 1 for k2
real, dimension(:), allocatable y2_loc
k2y coordinates around locus
integer, dimension(:), allocatable t_ia2
transformed direction for k2
real function z_wnumb(w, d, grav)
character(len=21) q_header
header of Binary Quadruplet File as intended in BQF-file
subroutine z_fileio(filename, qual, iufind, iunit, iostat)
Open file with name FILENAME and determine unit number IUNIT.
real, dimension(:), allocatable r_zz
real kqmin
lowest wave number
integer, dimension(:,:,:), allocatable quad_ia4
lower direction index of k4
real, dimension(:), allocatable r_w4k4
corresponding declarations
real, dimension(:), allocatable r_w3k4
real, dimension(:,:,:), allocatable quad_w3k4
weight 3 of k4
real, dimension(:,:), allocatable nspec
Action density on wave number grid N(kx,ky)
Module for storing file i/o related variables.
real, dimension(:), allocatable r_sym
real, dimension(:), allocatable z_loc
data value around locus
integer iufind
Specifies handling of unit numbers, see Z_FILEIO.
real q
difference of radian frequencies, used in Resio-Tracy method
real wk_max
maximum weight for wave number interpolation, set in Q_INIT
character(len=20) qbase
base name for I/O files
real, dimension(:), allocatable t_w1k4
transformed weight 1 for k4
integer, dimension(:), allocatable t_ik4
transformed tail factor for k2
real function x_cosk(k)
Compute cosine of points on locus for given wave number k.
subroutine q_locpos(ka, kb, km, kw, loclen)
Compute characteristics of locus used to optimize its acutal computation.
real, dimension(:), allocatable x2_mod
k2x coordinates along locus
integer iq_log
switch to activate logging to file QBASE//.LOG == 0, No print output == 1, print output
real, dimension(:), allocatable jac_mod
jacobian term around locus
real, dimension(:), allocatable q_dk
width of wave number bins [1/m]
subroutine q_t13v4(ik1, ia1, ik3, ia3, t13, diagk1, diagk3)
Compute the function T13, defined as a line integral around a locus.
integer nlocus1
number of points on locus as computed in Q_CMPLOCUS
real qf_frac
fraction of maximum action density to filter
real qf_dmax
maximum directional difference between k1 and k3
real, dimension(:), allocatable t_w2k2
transformed weight 2 for k2
subroutine q_chkres(k1x, k1y, k2x, k2y, k3x, k3y, k4x, k4y, dep, sum_kx, sum_ky, sum_w)
Check resonance conditions of 4 interacting wave numbers for a given water depth and dispersion relat...
real function xc_hh(w1x0, w1y0, w2x0, w2y0, w3x0, w3y0, z4x, z4y, h)
N/A.
integer iag2
range of directions for precomputed interaction grid