62 SUBROUTINE readxy (NAMX, NAMY, XX, YY, KONT, XSTA, YSTA)
162 DOUBLE PRECISION XTMP, YTMP
163 CHARACTER NAMX *(*), NAMY *(*), KONT *(*)
166 CALL strace (ient,
'READXY')
201 SUBROUTINE txpbla(TEXT,IF,IL)
265 INTEGER LENTXT, ITABVL
279 100
IF(
IF <= lentxt .AND. .NOT. found)
THEN 280 IF(.NOT. (text(if:if) ==
' ' .OR. &
281 ichar(text(if:if)) == itabvl))
THEN 290 200
IF(il > 1 .AND. .NOT. found)
THEN 292 IF(.NOT. (text(il:il) ==
' ' .OR. &
293 ichar(text(il:il)) == itabvl))
THEN 304 CHARACTER*20 FUNCTION numstr ( IVAL, RVAL, FORM )
376 ELSE IF( rval /=
rnan)
THEN 386 SUBROUTINE swcopi ( IARR1, IARR2, LENGTH )
449 INTEGER IARR1(LENGTH), IARR2(LENGTH)
488 CALL msgerr( 3,
'Array length should be positive' )
503 SUBROUTINE kscip1(MMT,SIG,D,K,CG,N,ND)
552 K(MMT), N(MMT), ND(MMT), SIG(MMT)
569 REAL KND, ROOTDG, SND, WGD, SND2, C, FAC1, FAC2, FAC3
615 snd = sig(is) * rootdg
618 k(is) = sig(is) * sig(is) /
grav_w 619 cg(is) = 0.5 *
grav_w / sig(is)
622 ELSE IF(snd < 1.e-6)
THEN 632 c = sqrt(
grav_w*d/(snd2+1./(1.+0.666*snd2+0.445*snd2**2 &
633 -0.105*snd2**3+0.272*snd2**4)))
636 fac1 = 2.*knd/sinh(2.*knd)
637 n(is) = 0.5*(1.+fac1)
640 fac3 = 2.*fac2/(1.+fac2*fac2)
641 nd(is)= fac1*(0.5/d - k(is)/fac3)
657 REAL CG(MSC), D, K,S(MSC)
659 REAL KND, ROOTDG, SND, WGD, SND2, C, FAC1,N
667 k = s(is) * s(is) /
grav_w 668 cg(is) = 0.5 *
grav_w / s(is)
669 ELSE IF(snd < 1.e-6)
THEN 677 c = sqrt(
grav_w*d/(snd2+1./(1.+0.666*snd2+0.445*snd2**2 &
678 -0.105*snd2**3+0.272*snd2**4)))
681 fac1 = 2.*knd/sinh(2.*knd)
695 CHARACTER*20 FUNCTION intstr ( IVAL )
756 INTEGER i, ipos, iquo
757 CHARACTER*1,
ALLOCATABLE :: cval(:)
767 IF (ival/10**ipos.GE.1.)
THEN 775 cval(ipos-i+1)=char(int(iquo)+48)
776 ival=ival-iquo*10**(i-1)
779 WRITE (
intstr,*) (cval(i), i=1,ipos)
787 REAL function
gamma(xx)
802 DATA ient /0/, abig /30./
803 CALL strace (ient,
'GAMMA')
805 IF (yy.GT.abig) yy = abig
806 IF (yy.LT.-abig) yy = -abig
820 DOUBLE PRECISION cof(6),stp,half,one,fpf,x,tmp,ser
821 DATA cof,stp/76.18009173d0,-86.50532033d0,24.01409822d0, &
822 -1.231739516d0,.120858003d-2,-.536382d-5,2.50662827465d0/
823 DATA half,one,fpf/0.5d0,1.0d0,5.5d0/
826 tmp=(x+half)*log(tmp)-tmp
839 SUBROUTINE sshape (ACLOC, SPCSIG, SPCDIR, FSHAPL, DSHAPL)
886 INTEGER FSHAPL, DSHAPL
896 INTEGER ID, IS, LSHAPE
920 REAL APSHAP, AUX1, AUX2, AUX3
921 REAL COEFF ,SYF ,MPER ,CTOT ,CTOTT,PKPER ,DIFPER
923 REAL RA ,SALPHA,SF ,SF4 ,SF5 ,FPK ,FPK4, FAC
928 LOGICAL LOGPM, DVERIF
1007 CALL strace(ient,
'SSHAPE')
1009 IF (
itest >= 80)
WRITE (
prtest, 8) fshapl, dshapl, &
1011 8
FORMAT (
' entry SSHAPE ', 2i3, 4e12.4)
1022 CALL msgerr(1,
' sign. wave height at boundary is not positive')
1030 IF(
abs(pkper -
pi2_w/spcsig(is)) < difper)
THEN 1032 difper =
abs(pkper -
pi2_w/spcsig(is))
1040 100 fpk = (1./pkper)
1043 salpha = ((
spparm(1) ** 2) * (fpk4)) * 5. / 16.
1044 ELSE IF(lshape == 2)
THEN 1046 salpha = (
spparm(1)**2 * fpk4) / &
1047 ((0.06533*(
pshape(1)**0.8015)+0.13467)*16.)
1048 ELSE IF(lshape == 4)
THEN 1058 sf = spcsig(is) /
pi2_w 1061 ra = (salpha/sf5)*exp(-(5.*fpk4)/(4.*sf4))/(
pi2_w*spcsig(is))
1063 ELSE IF(lshape == 2)
THEN 1065 sf = spcsig(is)/(
pi2_w)
1068 cpshap = 1.25 * fpk4 / sf4
1069 IF(cpshap > 10.)
THEN 1072 ra = (salpha/sf5) * exp(-cpshap)
1079 apshap = 0.5 * ((sf-fpk) / (coeff*fpk)) **2
1080 IF(apshap > 10.)
THEN 1083 ppshap = exp(-apshap)
1086 ra = syf*ra/(spcsig(is)*
pi2_w)
1089 sf, salpha, cpshap, apshap, syf, ra
1090 112
FORMAT (
' SSHAPE freq. ', 8e12.4)
1091 ELSE IF(lshape == 3)
THEN 1096 acloc(mdc,is) = (
spparm(1)**2 ) / &
1097 ( 16. * spcsig(is)**2 *
frintf )
1101 ELSE IF(lshape == 4)
THEN 1105 aux2 = ( spcsig(is) - (
pi2_w / pkper ) )**2
1106 ra = aux1 * exp( -1. * aux2 / aux3 ) / spcsig(is)
1110 CALL msgerr (2,
'Wrong type for frequency shape')
1111 WRITE (
printf, *)
' -> ', fshapl, lshape
1115 ctott = ctott +
frintf * acloc(mdc,is) * spcsig(is)**2
1119 hstmp = 4. * sqrt(ctott)
1122 303
FORMAT (
' SSHAPE, deviation in Hs, should be ', f8.3, &
1123 ', calculated ', f8.3)
1129 IF (.NOT.logpm .AND. itper < 10)
THEN 1135 as2 = acloc(mdc,is) * (spcsig(is))**2
1136 as3 = as2 * spcsig(is)
1142 aptail = 1. / (pptail * (1. + pptail * (
frinth-1.)))
1143 am0 = am0 *
frintf + aptail * as2
1145 eptail = 1. / (pptail * (1. + pptail * (
frinth-1.)))
1146 am1 = am1 *
frintf + eptail * as3
1149 mper =
pi2_w * am0 / am1
1151 CALL msgerr(3,
' first moment is zero in calculating the')
1152 CALL msgerr(3,
' spectrum at boundary using param. bc.')
1156 72
FORMAT (
' SSHAPE iter=', i2,
' period values:', 3f7.2)
1159 pkper = (
spparm(2) / mper) * pkper
1164 IF (itper >= 10)
THEN 1165 CALL msgerr(3,
'No convergence calculating the spectrum')
1166 CALL msgerr(3,
'at the boundary using parametric bound. cond.')
1174 ms = max(dspr**(-2) - 2., 1.)
1181 ctot = sqrt(0.5*ms/
pi_w) / (1. - 0.25/ms)
1183 IF(
itest >= 100)
THEN 1186 esom = esom +
frintf * spcsig(is)**2 * acloc(mdc,is)
1188 WRITE (
prtest, *)
' SSHAPE dir ', 4.*sqrt(
abs(esom)), &
1195 acos = cos(spcdir(id,1) - adir)
1197 cdir = ctot * max(acos**ms, 1.e-10)
1199 IF(acos >= cos(
ddir)) dverif = .true.
1204 IF(
itest >= 10) ctott = ctott + cdir *
ddir 1205 IF(
itest >= 100)
WRITE (
prtest, 360) id,spcdir(id,1),cdir
1206 360
FORMAT (
' ID Spcdir Cdir: ',i3,3(1x,e11.4))
1208 acloc(id,is) = cdir * acloc(mdc,is)
1212 IF(
abs(ctott-1.) > 0.1)
WRITE (
printf, 363) ctott
1213 363
FORMAT (
' SSHAPE, integral of Cdir is not 1, but:', f6.3)
1215 IF (.NOT.
fulcir .AND. .NOT.dverif) &
1216 CALL msgerr (1,
'incident direction is outside sector')
1224 REAL FUNCTION DEGCNV (DEGREE)
1333 CALL strace(ient,
'DEGCNV')
1336 degcnv = 180. +
dnorth - degree
1341 IF (degcnv >= 360.)
THEN 1342 degcnv =
mod(degcnv, 360.)
1343 ELSE IF (degcnv < 0.)
THEN 1344 degcnv =
mod(degcnv, 360.) + 360.
subroutine strace(IENT, SUBNAM)
subroutine readxy(NAMX, NAMY, XX, YY, KONT, XSTA, YSTA)
character *20 function intstr(IVAL)
real, dimension(mshape) pshape
real, dimension(msppar) spparm
character *20 function numstr(IVAL, RVAL, FORM)
subroutine sshape(ACLOC, SPCSIG, SPCDIR, FSHAPL, DSHAPL)
real function degcnv(DEGREE)
subroutine kscip1(MMT, SIG, D, K, CG, N, ND)
subroutine msgerr(LEV, STRING)
real, dimension(10) pwtail
subroutine txpbla(TEXT, IF, IL)
subroutine swcopi(IARR1, IARR2, LENGTH)
subroutine kscip2(S, D, CG)