My Project
Functions/Subroutines
swancom3.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine windp1 (WIND10, THETAW, IDWMIN, IDWMAX, FPM, UFRIC, WX2, WY2, SPCDIR, UX2, UY2, SPCSIG, IG)
 
subroutine windp2 (IDWMIN, IDWMAX, SIGPKD, FPM, ETOTW, AC2, SPCSIG, WIND10)
 
subroutine windp3 (ISSTOP, ALIMW, AC2, GROWW, IDCMIN, IDCMAX)
 
subroutine swind0 (IDCMIN, IDCMAX, ISSTOP, SPCSIG, THETAW, UFRIC, FPM, PLWNDA, IMATRA, SPCDIR)
 
subroutine swind3 (SPCSIG, THETAW, IMATDA, KWAVE, IMATRA, IDCMIN, IDCMAX, UFRIC, FPM, PLWNDB, ISSTOP, SPCDIR, IG)
 
subroutine swind4 (IDWMIN, IDWMAX, SPCSIG, WIND10, THETAW, XIS, DD, KWAVE, IMATRA, IMATDA, IDCMIN, IDCMAX, UFRIC, PLWNDB, ISSTOP, ITER, USTAR, ZELEN, SPCDIR, IT, IG)
 
subroutine swind5 (SPCSIG, THETAW, ISSTOP, UFRIC, KWAVE, IMATRA, IMATDA, IDCMIN, IDCMAX, PLWNDB, SPCDIR, IG)
 
subroutine wndpar (ISSTOP, IDWMIN, IDWMAX, IDCMIN, IDCMAX, DEP2, WIND10, THETAW, AC2, KWAVE, IMATRA, IMATDA, SPCSIG, CGO, ALIMW, GROWW, ETOTW, PLWNDA, PLWNDB, SPCDIR, ITER)
 

Function/Subroutine Documentation

◆ swind0()

subroutine swind0 ( integer, dimension(msc)  IDCMIN,
integer, dimension(msc)  IDCMAX,
integer  ISSTOP,
real, dimension(msc)  SPCSIG,
real  THETAW,
real  UFRIC,
real  FPM,
real, dimension(mdc,msc,nptst)  PLWNDA,
real, dimension(mdc,msc)  IMATRA,
real, dimension(mdc,6)  SPCDIR 
)

Definition at line 471 of file swancom3.f90.

471 !
472 !****************************************************************
473 !
474 ! Computation of the source term for the wind input for a
475 ! third generation wind growth model:
476 !
477 ! 1) Linear wind input term according to Cavaleri and
478 ! Malanotte-Rizzoli (1981)
479 !
480 ! METHOD
481 !
482 ! To ensure wave growth when no wave energy is present in the
483 ! numerical model a linear growth term is used (see
484 ! Cavaleri and Malanotte-Rizzoli 1981). Contributions for
485 ! frequencies lower then FPM have been eliminated buy aa filter :
486 !
487 ! -3
488 ! 1.5*10 * 4 sigma -4
489 ! A = Sin = ------- { U max[0, (cos(d - dw )] } exp{-(-----) } / Jac
490 ! 2 FPM
491 ! g
492 !
493 ! With Jac = Jacobian = 2 pi sigma
494 !
495 ! The Pierson Moskowitz radian frequency for a fully developed
496 ! sea state spectrum is as follows (computed in WINDP2 :
497 !
498 ! 1 g
499 ! FPM = ---- --------- * 2 pi
500 ! 2 pi 28 UFRIC
501 !
502 !****************************************************************
503 !
504  USE swcomm3
505  USE swcomm4
506  USE ocpcomm4
507 
508  IMPLICIT NONE
509 
510  REAL :: SPCDIR(MDC,6) ,SPCSIG(MSC)
511  INTEGER :: IDDUM ,ID ,IS ,ISSTOP
512  REAL :: FPM ,UFRIC ,THETA ,THETAW ,SWINEA ,SIGMA , &
513  TEMP1 ,TEMP2 ,CTW ,STW ,COSDIF ,TEMP3 , &
514  FILTER ,ARGU
515  REAL :: IMATRA(MDC,MSC) ,PLWNDA(MDC,MSC,NPTST)
516  INTEGER :: IDCMIN(MSC) ,IDCMAX(MSC)
517 !
518 ! *** calculate linear wind input term ***
519 !
520  ctw = cos(thetaw)
521  stw = sin(thetaw)
522  fpm = grav_w / ( 28.0 * ufric )
523  temp1 = pwind(31) / ( grav_w**2 * 2. * pi_w )
524  DO is = 1, isstop
525  sigma = spcsig(is)
526 !
527 ! **** ARGU = FPM / SIGMA ***
528 ! **** the value of ARGU was change for MIN () because for ***
529 ! **** values of fpm/sigma too small could be some problems ***
530 ! **** with some computers to handle small numbers ***
531  argu = min(2., fpm / sigma)
532  filter = exp( - argu**4 )
533  temp2 = temp1 / sigma
534  DO iddum = idcmin(is), idcmax(is)
535  id = mod( iddum - 1 + mdc, mdc ) + 1
536  IF(sigma >= (0.7 * fpm))THEN
537  theta = spcdir(id,1)
538  cosdif = spcdir(id,2)*ctw + spcdir(id,3)*stw
539  temp3 = ( ufric * max( 0. , cosdif))**4
540  swinea = max( 0. , temp2 * temp3 * filter )
541  imatra(id,is) = imatra(id,is) + swinea
542  IF(testfl) plwnda(id,is,iptst) = swinea
543  END IF
544  ENDDO
545  ENDDO
546 
547  RETURN
real, dimension(:), allocatable, save spcsig
Definition: swmod2.f90:767
logical testfl
Definition: swmod1.f90:2274
real, dimension(:,:), allocatable, save spcdir
Definition: swmod2.f90:767
real grav_w
Definition: swmod1.f90:1721
integer mdc
Definition: swmod1.f90:1672
real pi_w
Definition: swmod1.f90:1721
real, dimension(mwind) pwind
Definition: swmod1.f90:2136
integer iptst
Definition: swmod1.f90:2269

◆ swind3()

subroutine swind3 ( real, dimension(msc)  SPCSIG,
real  THETAW,
real, dimension(mdc,msc)  IMATDA,
real, dimension(msc,icmax)  KWAVE,
real, dimension(mdc,msc)  IMATRA,
integer, dimension(msc)  IDCMIN,
integer, dimension(msc)  IDCMAX,
real  UFRIC,
real  FPM,
real, dimension(mdc,msc,nptst)  PLWNDB,
integer  ISSTOP,
real, dimension(mdc,6)  SPCDIR,
integer  IG 
)

Definition at line 556 of file swancom3.f90.

556 !
557 !****************************************************************
558 !
559 ! Computation of the source term for the wind input for a
560 ! third generation wind growth model:
561 !
562 ! 1) Exponential input term, (Snyder et al. 1981, which
563 ! expression has been modified by Komen et al. 1984).
564 !
565 ! This input term should be combinated with the dissipation
566 ! term of Komen et al. (1984)
567 !
568 ! METHOD
569 !
570 ! The exponential term used is taken from Snyder et al. (1981)
571 ! and Komen et al. (1984):
572 !
573 ! Sin (s,d) = B*E(s,d)
574 ! e *
575 ! 28 U cos( d - dw )
576 ! B = max(0. , (0.25 rhoaw( ------------------- -1 ) )) sigma
577 ! sigma / kwave
578 !
579 ! with :
580 !
581 ! * -3
582 ! U = UFRIC = wind10 sqrt( (0.8 + 0.065 wind10 ) 10 )
583 !
584 ! UFRIC is computed in WINDP1
585 !
586 !
587 ! The Pierson Moskowitz radian frequency for a fully developed
588 ! sea state spectrum is as follows (computed in WINDP1):
589 !
590 ! 1 g
591 ! FPM = ---- --------- * 2 pi
592 ! 2 pi 28 UFRIC
593 !
594 !
595 !****************************************************************
596  USE swcomm3
597  USE swcomm4
598  USE ocpcomm4
599 ! USE ALL_VARS, ONLY : MT,AC2
600  USE vars_wave, ONLY : mt,ac2
601 
602  IMPLICIT NONE
603 
604  REAL :: SPCDIR(MDC,6),SPCSIG(MSC)
605  INTEGER :: IDDUM ,ID ,IS ,ISSTOP ,IG
606  REAL :: FPM ,UFRIC ,THETA ,THETAW,SIGMA ,SWINEB,TEMP1, &
607  CTW ,STW ,COSDIF,TEMP2 ,TEMP3 ,CINV
608  REAL :: IMATDA(MDC,MSC),IMATRA(MDC,MSC), &
609  KWAVE(MSC,ICMAX),PLWNDB(MDC,MSC,NPTST)
610  INTEGER :: IDCMIN(MSC),IDCMAX(MSC)
611 
612  ctw = cos(thetaw)
613  stw = sin(thetaw)
614  temp1 = 0.25 * pwind(9)
615  temp2 = 28.0 * ufric
616  DO is = 1, isstop
617  sigma = spcsig(is)
618  cinv = kwave(is,1) / sigma
619  temp3 = temp2 * cinv
620  DO iddum = idcmin(is), idcmax(is)
621  id = mod( iddum - 1 + mdc, mdc ) + 1
622  theta = spcdir(id,1)
623  cosdif = spcdir(id,2)*ctw + spcdir(id,3)*stw
624  swineb = temp1 * ( temp3 * cosdif - 1.0 )
625  swineb = max( 0. , swineb * sigma )
626 
627  imatra(id,is) = imatra(id,is) + swineb * ac2(id,is,ig)
628  imatda(id,is) = imatda(id,is) - swineb
629  IF(testfl) plwndb(id,is,iptst) = swineb
630  ENDDO
631  ENDDO
632 
633  RETURN
real, dimension(:), allocatable, save spcsig
Definition: swmod2.f90:767
logical testfl
Definition: swmod1.f90:2274
integer mt
Definition: mod_main.f90:78
real, dimension(:,:), allocatable, save spcdir
Definition: swmod2.f90:767
real, dimension(:,:,:), allocatable ac2
integer mdc
Definition: swmod1.f90:1672
real, dimension(mwind) pwind
Definition: swmod1.f90:2136
integer iptst
Definition: swmod1.f90:2269

◆ swind4()

subroutine swind4 ( integer  IDWMIN,
integer  IDWMAX,
real, dimension(msc)  SPCSIG,
real  WIND10,
real  THETAW,
real  XIS,
real  DD,
real, dimension(msc,icmax)  KWAVE,
real, dimension(mdc,msc)  IMATRA,
real, dimension(mdc,msc)  IMATDA,
integer, dimension(msc)  IDCMIN,
integer, dimension(msc)  IDCMAX,
real  UFRIC,
real, dimension(mdc,msc,nptst)  PLWNDB,
integer  ISSTOP,
integer  ITER,
real, dimension(mt)  USTAR,
real, dimension(mt)  ZELEN,
real, dimension(mdc,6)  SPCDIR,
integer  IT,
integer  IG 
)

Definition at line 644 of file swancom3.f90.

644 !
645 !******************************************************************
646 !
647 ! Computation of the source term for the wind input for a
648 ! third generation wind growth model:
649 !
650 ! 1) Computation of the exponential input term based on a
651 ! quasi linear theory developped by Janssen (1989, 1991).
652 ! This formulation should be used in combination with the
653 ! whitecapping dissipation source term according to
654 ! Janssen (1991) and Mastenbroek et al. (1993)
655 !
656 ! Method
657 !
658 ! The exponential term for the wind input used is taken
659 ! from Janssen (1991):
660 !
661 ! Sin (s,d) = B*E(s,d)
662 ! e
663 ! *
664 ! / kwave U \ 2
665 ! B = max(0. , (beta rhoaw | --------- | cos( d - dw ) sigma))
666 ! \ sigma /
667 !
668 ! The friction velocity is a fucntion of the roughness
669 ! length Ze. A first gues for U* is given by Wu (1982),
670 ! which is computed in subroutine WINDP2.
671 !
672 !******************************************************************
673  USE swcomm2
674  USE swcomm3
675  USE swcomm4
676  USE ocpcomm4
677 ! USE ALL_VARS, ONLY : MT,AC2
678  USE vars_wave, ONLY : mt,ac2
679 
680  IMPLICIT NONE
681  REAL :: SPCDIR(MDC,6),SPCSIG(MSC)
682  INTEGER :: IDWMAX ,IDWMIN ,IDDUM ,ID ,ISSTOP ,IS
683  REAL :: THETA ,THETAW ,DD ,SWINEB ,WIND10 , &
684  ZO ,ZE ,BETA1 ,BETA2 ,UFRIC ,UFRIC2 ,DS , &
685  ZARG ,ZLOG1 ,ZLOG2 ,ZCN1 ,ZCN2 ,ZCN ,XIS , &
686  SIGMA ,SIGMA1 ,SIGMA2 ,WAVEN ,WAVEN1 ,WAVEN2 ,TAUW , &
687  TAUTOT ,TAUDIR ,COS1 ,COS2 ,CW1 ,RHOA ,RHOW , &
688  RHOAW ,ALPHA ,XKAPPA ,F1 ,TAUWX ,TAUWY ,SE1 , &
689  CTW ,STW ,COSDIF , &
690  SE2 ,SINWAV ,COSWAV
691  REAL :: IMATDA(MDC,MSC) , &
692  IMATRA(MDC,MSC) , &
693  KWAVE(MSC,ICMAX) , &
694  PLWNDB(MDC,MSC,NPTST), &
695  USTAR(MT) , &
696  ZELEN(MT)
697  INTEGER :: IDCMIN(MSC) ,IDCMAX(MSC)
698  REAL :: ZTEN ,RATIO ,BETAMX ,TXHFR ,TYHFR ,CW2 ,ZARG1 ,ZARG2
699  REAL :: GAMHF ,SIGMAX ,SIGHF1 ,SIGHF2 ,ZCNHF1 ,ZCNHF2 ,AUX
700  REAL :: ZAHF1 ,ZAHF2 ,FACHFR ,FA ,FB ,FC ,FD ,FE ,FCEN
701  REAL :: FF1 ,FF2 ,FF3 ,DCEN ,TAUNEW ,XFAC2 ,BETA ,ZLOG
702  INTEGER :: IT ,IG ,ITER ,J ,II
703 
704 !
705 ! *** initialization ***
706 !
707  alpha = pwind(14)
708  xkappa = pwind(15)
709  rhoa = pwind(16)
710  rhow = pwind(17)
711  rhoaw = rhoa / rhow
712  zten = 10.
713  ratio = 0.75
714  betamx = 1.2
715  f1 = betamx / xkappa**2
716  ctw = cos(thetaw)
717  stw = sin(thetaw)
718 !
719  IF(nstatc == 1 .AND. it == 1)THEN
720 !
721 ! *** nonstationary and first time step (the number of ***
722 ! *** iterations however still can increase per time step ***
723 !
724  zo = alpha * ufric * ufric / grav_w
725  ze = zo / sqrt( 1. - ratio )
726  ustar(ig) = ufric
727  zelen(ig) = ze
728  ELSE IF(nstatc == 0 .AND. icond == 4 .AND. iter == 1)THEN
729 !
730 ! *** non-first stationary computations and first iteration ***
731 !
732  zo = alpha * ufric * ufric / grav_w
733  ze = zo / sqrt( 1. - ratio )
734  ustar(ig) = ufric
735  zelen(ig) = ze
736  ELSE IF ( nstatc.EQ.0 .AND. icond.NE.4 .AND. iter .EQ. 2 ) THEN
737 !
738 ! *** first stationary computation (this subroutine is never ***
739 ! *** excecuted anyway, this subroutine in entered after 1 ***
740 ! *** iteration) and thus calculate ZO and ZE as a first ***
741 ! *** prediction only and only in the second sweep ***
742 !
743  zo = alpha * ufric * ufric / grav_w
744  ze = zo / sqrt( 1. - ratio )
745  ustar(ig) = ufric
746  zelen(ig) = ze
747  ELSE
748 !
749 ! *** calculate wave stress using the value of the ***
750 ! *** velocity U* and roughness length Ze from the ***
751 ! *** previous iteration ***
752 !
753  ufric = ustar(ig)
754  ze = zelen(ig)
755 !
756  tauw = 0.
757  tauwx = 0.
758  tauwy = 0.
759  txhfr = 0.
760  tyhfr = 0.
761 !
762 ! *** use old friction velocity to calculate wave stress ***
763 !
764  ufric2 = ufric * ufric
765 !
766  DO is = 1, msc-1
767  sigma1 = spcsig(is)
768  sigma2 = spcsig(is+1)
769  waven1 = kwave(is,1)
770  waven2 = kwave(is+1,1)
771  ds = sigma2 - sigma1
772  cw1 = sigma1 / waven1
773  cw2 = sigma2 / waven2
774  zcn1 = alog( grav_w * ze / cw1**2 )
775  zcn2 = alog( grav_w * ze / cw2**2 )
776  DO iddum = idwmin, idwmax
777  id = mod( iddum - 1 + mdc, mdc ) + 1
778  theta = spcdir(id,1)
779  cosdif = spcdir(id,2)*ctw + spcdir(id,3)*stw
780  sinwav = spcdir(id,3)
781  coswav = spcdir(id,2)
782  cos1 = max( 0. , cosdif )
783  cos2 = cos1 * cos1
784  beta1 = 0.
785  beta2 = 0.
786 !
787 ! *** Miles constant Beta ***
788 !
789  IF(cos1 > 0.01)THEN
790  zarg1 = xkappa * cw1 / ( ufric * cos1 )
791  zarg2 = xkappa * cw2 / ( ufric * cos1 )
792  zlog1 = zcn1 + zarg1
793  zlog2 = zcn2 + zarg2
794  IF(zlog1 < 0.) beta1 = f1 * exp(zlog1) * zlog1**4
795  IF(zlog2 < 0.) beta2 = f1 * exp(zlog2) * zlog2**4
796  ENDIF
797 !
798 ! *** calculate wave stress by integrating input source ***
799 ! *** term in x- and y direction respectively ***
800 !
801  se1 = waven1**2 * beta1 * sigma1 * ac2(id,is ,ig)
802  se2 = waven2**2 * beta2 * sigma2 * ac2(id,is+1,ig)
803 !
804  tauwx = tauwx + 0.5 * ( se1 + se2 ) * ds * coswav * cos2
805  tauwy = tauwy + 0.5 * ( se1 + se2 ) * ds * sinwav * cos2
806  ENDDO
807  ENDDO
808 !
809 ! *** determine effect of high frequency tail to wave stress ***
810 ! *** assuming deep water conditions ***
811 !
812  gamhf = xkappa * grav_w / ufric
813  sigmax = spcsig(msc)
814  sighf1 = sigmax
815  DO j=1, 50
816  sighf2 = xis * sighf1
817  ds = sighf2 - sighf1
818  zcnhf1 = alog( ze * sighf1**2 / grav_w )
819  zcnhf2 = alog( ze * sighf2**2 / grav_w )
820  aux = 0.0
821  DO iddum = idwmin, idwmax
822  id = mod( iddum - 1 + mdc, mdc ) + 1
823  theta = spcdir(id,1)
824  cosdif = spcdir(id,2)*ctw + spcdir(id,3)*stw
825  sinwav = spcdir(id,3)
826  coswav = spcdir(id,2)
827  cos1 = max( 0. , cosdif )
828  cos2 = cos1 * cos1
829  beta1 = 0.0
830  beta2 = 0.0
831 !
832  IF(cos1 > 0.01)THEN
833 ! *** beta is independent of direction ! ***
834  zahf1 = gamhf / sighf1
835  zahf2 = gamhf / sighf2
836  zlog1 = zcnhf1 + zahf1
837  zlog2 = zcnhf2 + zahf2
838  IF(zlog1 < 0.) beta1 = f1 * exp(zlog1) * zlog1**4
839  IF(zlog2 < 0.) beta2 = f1 * exp(zlog2) * zlog2**4
840  aux = aux + beta1 + beta2
841  ENDIF
842 !
843 ! *** calculate contribution of high frequency tail to ***
844 ! *** wave stress by integrating input source term in ***
845 ! *** x- and y direction respectively ***
846 !
847  fachfr = sigmax**6 * ac2(id,msc,ig) * cos2 / grav_w**2
848 
849  se1 = fachfr * beta1 / sighf1
850  se2 = fachfr * beta2 / sighf2
851 !
852  txhfr = txhfr + 0.5 * ( se1 + se2 ) * ds * coswav
853  tyhfr = tyhfr + 0.5 * ( se1 + se2 ) * ds * sinwav
854 !
855 ! *** if coeffcient BETA = 0. for a frequency over ***
856 ! *** all directions is zero skip loop ***
857 !
858  IF(aux == 0.) GOTO 5000
859 !
860  ENDDO
861 
862  sighf1 = sighf2
863  ENDDO
864 5000 CONTINUE
865 
866  tautot = rhoa * ufric2
867 ! *** wave stress ***
868  tauwx = tauwx + txhfr
869  tauwy = tauwy + tyhfr
870  IF(abs(tauwx) > 0. .OR. abs(tauwy) > 0.)THEN
871  taudir = atan2( tauwx, tauwy )
872  ELSE
873  taudir = 0.
874  ENDIF
875  taudir = mod( (taudir + 2. * pi_w) , (2. * pi_w) )
876  tauw = rhoa * ufric2 * dd * sqrt( tauwx**2 + tauwy**2 )
877  tauw = min( tauw , 0.999 * tautot )
878 
879  DO ii = 1, 20
880 ! *** start iteration process ***
881  fa = sqrt( 1. - tauw / tautot )
882  fb = zten * rhoa * grav_w / alpha
883  fc = fa * ( fb / tautot - 1. )
884  fd = sqrt( tautot )
885  fe = alog( fc + 1. )
886 !
887 ! *** calculate function value and derivative in ***
888 ! *** numerical point considered ***
889 !
890  fcen = fd * fe - sqrt(rhoa) * wind10 * xkappa
891  ff1 = 0.5 * fe / fd
892  ff2 = 0.5 * tauw * fc / fa**2 - fa * fb
893  ff3 = tautot**1.5 * ( fc + 1. )
894  dcen = ff1 + ff2 / ff3
895 !
896 ! *** new total stress ***
897 !
898  taunew = tautot - fcen / dcen
899 !
900  IF(taunew <= tauw) taunew = .5 * (tautot + tauw)
901  IF(abs( taunew - tautot ) <= 1.e-5 ) GOTO 3000
902 !
903  tautot = taunew
904  ENDDO
905 3000 CONTINUE
906 !
907  ufric = sqrt( tautot / rhoa )
908 !
909  zo = alpha * ufric * ufric / grav_w
910  ze = zo / sqrt( 1. - tauw / tautot )
911 !
912  ustar(ig) = ufric
913  zelen(ig) = ze
914 !
915  ENDIF
916 !
917 ! ----->
918 !
919 ! *** calculate critical height and Miles parameter and ***
920 ! *** calculate input source term B for with the updated ***
921 ! *** values of UFRIC and ZE ***
922 !
923  ufric2 = ufric * ufric
924 !
925  DO is = 1, isstop
926  sigma = spcsig(is)
927  waven = kwave(is,1)
928  cw1 = sigma / waven
929  zcn = alog( grav_w * ze / cw1**2 )
930  DO iddum = idcmin(is), idcmax(is)
931  id = mod( iddum - 1 + mdc, mdc ) + 1
932  theta = spcdir(id,1)
933  cosdif = spcdir(id,2)*ctw + spcdir(id,3)*stw
934  cos1 = max( 0. , cosdif )
935  cos2 = cos1 * cos1
936  xfac2 = ( ufric / cw1 )**2
937  beta = 0.
938  IF(cos1 > 0.01)THEN
939  zarg = xkappa * cw1 / ( ufric * cos1 )
940  zlog = zcn + zarg
941  IF(zlog < 0.) beta = f1 * exp(zlog) * zlog**4
942  ENDIF
943 !
944 ! *** compute the factor B and store result in array ***
945 !
946  swineb = rhoaw * beta * xfac2 * cos2 * sigma
947  imatra(id,is) = imatra(id,is) + swineb * ac2(id,is,ig)
948  imatda(id,is) = imatda(id,is) - swineb
949  IF(testfl) plwndb(id,is,iptst) = swineb
950  ENDDO
951  ENDDO
952 
953  RETURN
real, dimension(:), allocatable, save spcsig
Definition: swmod2.f90:767
logical testfl
Definition: swmod1.f90:2274
integer mt
Definition: mod_main.f90:78
real, dimension(:,:), allocatable, save spcdir
Definition: swmod2.f90:767
real grav_w
Definition: swmod1.f90:1721
real, dimension(:,:,:), allocatable ac2
integer mdc
Definition: swmod1.f90:1672
real pi_w
Definition: swmod1.f90:1721
integer nstatc
Definition: swmod1.f90:2131
real, dimension(mwind) pwind
Definition: swmod1.f90:2136
integer msc
Definition: swmod1.f90:1673
integer iptst
Definition: swmod1.f90:2269
integer icond
Definition: swmod1.f90:1354

◆ swind5()

subroutine swind5 ( real, dimension(msc)  SPCSIG,
real  THETAW,
integer  ISSTOP,
real  UFRIC,
real, dimension(msc,icmax)  KWAVE,
real, dimension(mdc,msc)  IMATRA,
real, dimension(mdc,msc)  IMATDA,
integer, dimension(msc)  IDCMIN,
integer, dimension(msc)  IDCMAX,
real, dimension(mdc,msc,nptst)  PLWNDB,
real, dimension(mdc,6)  SPCDIR,
integer  IG 
)

Definition at line 962 of file swancom3.f90.

962 !
963 !****************************************************************
964 !
965 ! Computation of the source term for the wind input for a
966 ! third generation wind growth model:
967 !
968 ! The exponential input term is according to Yan (1987). This
969 ! input term is valid for the higher frequency part of the
970 ! spectrum (strongly forced wave components). The expression
971 ! reduces to the Snyder (1982) expression form for spectral
972 ! wave components with weak wind forcing and to the Plant (1982)
973 ! form for more strongly forced wave components:
974 !
975 ! Method
976 !
977 ! The expression reads --> with X = Ustar / C
978 !
979 ! / / 2 ! Sin = | | 0.04 X + 0.00544 X + 0.000055 | * cos (theta)
980 ! \ \ /
981 ! ! - 0.00031 | sigma * AC2(d,s,x,y)
982 ! /
983 !****************************************************************
984 !
985  USE swcomm3
986  USE swcomm4
987  USE ocpcomm4
988 ! USE ALL_VARS, ONLY : MT,AC2
989  USE vars_wave, ONLY : mt,ac2
990 
991  IMPLICIT NONE
992 
993  REAL :: SPCDIR(MDC,6),SPCSIG(MSC)
994  INTEGER :: IDDUM ,ID ,IS ,ISSTOP, IG
995  REAL :: UFRIC ,THETA ,THETAW ,SIGMA ,SWINEB , &
996  CTW ,STW ,COSDIF , &
997  USTAC1 ,USTAC2 ,COF1 ,COF2 ,COF3 ,COF4
998  REAL :: IMATDA(MDC,MSC) ,IMATRA(MDC,MSC) , &
999  KWAVE(MSC,ICMAX) ,PLWNDB(MDC,MSC,NPTST)
1000  INTEGER :: IDCMIN(MSC) ,IDCMAX(MSC)
1001  REAL :: TEMP3
1002 
1003 !
1004 ! *** input according to Yan (1987) ***
1005 !
1006  cof1 = 0.04
1007  cof2 = 0.00544
1008  cof3 = 0.000055
1009  cof4 = 0.00031
1010 !
1011 ! adapted Yan fit for use of Alves and Banner method
1012 !
1013  IF(iwcap == 7)THEN
1014  cof1 = 0.04
1015  cof2 = 0.00552
1016  cof3 = 0.000052
1017  cof4 = 0.000302
1018  END IF
1019 !
1020  ctw = cos(thetaw)
1021  stw = sin(thetaw)
1022  DO is = 1, isstop
1023  sigma = spcsig(is)
1024  ustac1 = ( ufric * kwave(is,1) ) / sigma
1025  ustac2 = ustac1 * ustac1
1026  temp3 = ( cof1 * ustac2 + cof2 * ustac1 + cof3)
1027  DO iddum = idcmin(is), idcmax(is)
1028  id = mod( iddum - 1 + mdc, mdc ) + 1
1029  theta = spcdir(id,1)
1030  cosdif = spcdir(id,2)*ctw + spcdir(id,3)*stw
1031  swineb = temp3 * cosdif - cof4
1032  swineb = max( 0. , swineb * sigma )
1033 ! IMATRA(ID,IS) = IMATRA(ID,IS) + SWINEB * AC2(ID,IS,IGC)
1034  imatra(id,is) = imatra(id,is) + swineb * ac2(id,is,ig)
1035  imatda(id,is) = imatda(id,is) - swineb
1036  IF(testfl) plwndb(id,is,iptst) = swineb
1037  ENDDO
1038  ENDDO
1039 
1040  RETURN
real, dimension(:), allocatable, save spcsig
Definition: swmod2.f90:767
logical testfl
Definition: swmod1.f90:2274
integer mt
Definition: mod_main.f90:78
real, dimension(:,:), allocatable, save spcdir
Definition: swmod2.f90:767
real, dimension(:,:,:), allocatable ac2
integer mdc
Definition: swmod1.f90:1672
integer iwcap
Definition: swmod1.f90:2129
integer iptst
Definition: swmod1.f90:2269

◆ windp1()

subroutine windp1 ( real  WIND10,
real  THETAW,
integer  IDWMIN,
integer  IDWMAX,
real  FPM,
real  UFRIC,
real, dimension(mt)  WX2,
real, dimension(mt)  WY2,
real, dimension(mdc,6)  SPCDIR,
real, dimension(mt)  UX2,
real, dimension(mt)  UY2,
real, dimension(msc)  SPCSIG,
integer  IG 
)

Definition at line 20 of file swancom3.f90.

20 !
21 !****************************************************************
22 !
23 ! Computation of parameters derived from the wind for several
24 ! subroutines such as :
25 ! SWIND1, SWIND2, SWIND3, CUTOFF
26 !
27 ! Output of this subroutine :
28 !
29 ! WIND10 , THETAW, IDWMIN, IDWMAX , UFRIC, FPM
30 !
31 ! METHOD
32 !
33 ! a. For SWIND1 and SWIND2 :
34 !
35 ! SIGMA_FPM = 0.13 * GRAV * 2 * PI / WIND10
36 !
37 ! b. For SWIND3 (wind input according to Snyder (1981) ***
38 !
39 ! - wind friction velocity according to Wu (1982):
40 ! * -3
41 ! U = UFRIC = wind10 sqrt( (0.8 + 0.065 wind10 ) 10 )
42 !
43 ! c. For SWIND4 (wind input according to Janssen 1991)
44 !
45 ! - wind friction velocity:
46 !
47 ! UFRIC = sqrt ( CDRAG) * U10
48 !
49 ! for U10 < 7.5 m/s -> CDRAG = 1.2873.e-3
50 !
51 ! else wind friction velocity according to Wu (1982):
52 !
53 ! * -3
54 ! U = UFRIC = wind10 sqrt( (0.8 + 0.065 wind10 ) 10 )
55 !
56 ! d.
57 ! The Pierson Moskowitz radian frequency for a fully developed
58 ! sea state spectrum for all third generation wind input
59 ! models is equal to:
60 !
61 ! grav
62 ! SIGMA_FPM = ---------
63 ! 28 UFRIC
64 ! -----------------------------------------------------------
65 !****************************************************************
66 !
67  USE ocpcomm1
68  USE ocpcomm2
69  USE ocpcomm3
70  USE ocpcomm4
71  USE swcomm1
72  USE swcomm2
73  USE swcomm3
74  USE swcomm4
75  USE all_vars, ONLY : mt
76 
77  IMPLICIT NONE
78 !
79  REAL :: SPCDIR(MDC,6),SPCSIG(MSC)
80  INTEGER :: IDWMIN ,IDWMAX
81  INTEGER :: ID,IDDUM,IG
82 !
83  REAL :: WIND10 ,THETAW ,UFRIC ,FPM ,CDRAG ,SDMEAN
84  REAL :: WX2(MT), WY2(MT), UX2(MT), UY2(MT)
85 
86  REAL AWX, AWY, RWX, RWY
87 !
88 ! compute absolute wind velocity
89  IF(varwi)THEN
90  awx = wx2(ig)
91  awy = wy2(ig)
92  ELSE
93  awx = u10 * cos(wdic)
94  awy = u10 * sin(wdic)
95  END IF
96 ! compute relative wind velocity
97  IF(icur == 0)THEN
98  rwx = awx
99  rwy = awy
100  ELSE
101  rwx = awx - ux2(ig)
102  rwy = awy - uy2(ig)
103  END IF
104 ! compute absolute value of relative wind velocity
105  wind10 = sqrt(rwx**2+rwy**2)
106  IF(wind10 > 0.)THEN
107  thetaw = atan2(rwy,rwx)
108  thetaw = mod( (thetaw + pi2_w) , pi2_w )
109  ELSE
110  thetaw = 0.
111  END IF
112 !
113 ! *** compute the minimum and maximum counter for the active ***
114 ! *** wind field : ***
115 ! *** . ***
116 ! *** IDWMAX =135 degrees .<--mean wind direction ***
117 ! *** \ o o o | o o o . (THETAW) ***
118 ! *** \ o o | o o . o ***
119 ! *** \ o | o . o o ***
120 ! *** \ | . o o o ***
121 ! *** ----------------\-------------------- ***
122 ! *** | \ o o o o ***
123 ! *** | \ o o o ***
124 ! *** | \ o o ***
125 ! *** IDWMIN = 325 degrees ***
126 ! *** ***
127 !
128 ! move ThetaW to the right interval, shifting + or - 2*PI
129  sdmean = 0.5 * (spcdir(1,1) + spcdir(mdc,1))
130  IF(thetaw < sdmean - pi_w) thetaw = thetaw + 2.*pi_w
131  IF(thetaw > sdmean + pi_w) thetaw = thetaw - 2.*pi_w
132 !
133  IF((thetaw-0.5*pi_w) <= spcdir(1,1))THEN
134  IF((thetaw+1.5*pi_w) >= spcdir(mdc,1))THEN
135  idwmin = 1
136  ELSE
137  idwmin = nint( (thetaw + 1.5*pi_w - spcdir(1,1)) / ddir ) + 1
138  END IF
139  ELSE
140  idwmin = nint( (thetaw - 0.5*pi_w - spcdir(1,1)) / ddir ) + 1
141  END IF
142 !
143  IF((thetaw + 0.5 * pi_w) >= spcdir(mdc,1))THEN
144  IF((thetaw - 1.5 * pi_w) <= spcdir(1,1))THEN
145  idwmax = mdc
146  ELSE
147  idwmax = nint( (thetaw - 1.5 * pi_w - spcdir(1,1)) / ddir ) + 1
148  END IF
149  ELSE
150  idwmax = nint( (thetaw + 0.5 * pi_w - spcdir(1,1)) / ddir ) + 1
151  END IF
152 !
153  IF(idwmin > idwmax) idwmax = mdc + idwmax
154 !
155 ! *** compute the Pierson Moskowitz frequency ***
156 !
157  IF(iwind == 1 .OR. iwind == 2)THEN
158 !
159 ! *** first and second generation wind wave model ***
160 !
161  IF(wind10 < pwind(12) ) wind10 = pwind(12)
162  fpm = 2. * pi_w * pwind(13) * grav_w / wind10
163 !
164 ! *** determine U friction in case predictor is obtained ***
165 ! *** with second genaration wave model ***
166 !
167  IF(wind10 > 7.5)THEN
168  ufric = wind10 * sqrt(( 0.8 + 0.065 * wind10 ) * 0.001 )
169  ELSE
170  cdrag = 0.0012873
171  ufric = sqrt( cdrag ) * wind10
172  END IF
173 !
174 ! Reformulation of the wind speed in terms of friction velocity.
175 ! This formulation is based on Bouws (1986) and described in Delft
176 ! Hydraulics report H3515 (1999)
177 !
178  wind10 = wind10 * sqrt(((0.8 + 0.065 * wind10) * 0.001) / &
179  ((0.8 + 0.065 * 15. ) * 0.001))
180 !
181  ELSE IF(iwind >= 3)THEN
182 !
183 ! *** Calculate the wind friction velocity ***
184 ! *** according to Wu (1982) ***
185 !
186  IF(wind10 > 7.5)THEN
187  ufric = wind10 * sqrt(( 0.8 + 0.065 * wind10 ) * 0.001 )
188  ELSE
189  cdrag = 0.0012873
190  ufric = sqrt( cdrag ) * wind10
191  END IF
192 !
193 ! *** Wind friction velocity and PM-frequency ***
194 !
195  ufric = max( 1.e-15 , ufric)
196  fpm = grav_w / ( 28.0 * ufric )
197 
198  END IF
199 
200  RETURN
integer mt
Definition: mod_main.f90:78
integer icur
Definition: swmod1.f90:2125
real, dimension(:,:), allocatable, save spcdir
Definition: swmod2.f90:767
real grav_w
Definition: swmod1.f90:1721
integer iwind
Definition: swmod1.f90:2129
integer mdc
Definition: swmod1.f90:1672
real pi2_w
Definition: swmod1.f90:1722
real pi_w
Definition: swmod1.f90:1721
real wdic
Definition: swmod1.f90:2139
real, dimension(mwind) pwind
Definition: swmod1.f90:2136
real u10
Definition: swmod1.f90:2138
real ddir
Definition: swmod1.f90:1676
logical varwi
Definition: swmod1.f90:1366

◆ windp2()

subroutine windp2 ( integer  IDWMIN,
integer  IDWMAX,
  SIGPKD,
real  FPM,
real  ETOTW,
real, dimension(mdc,msc,0:mt)  AC2,
real, dimension(msc)  SPCSIG,
  WIND10 
)

Definition at line 210 of file swancom3.f90.

210 ! (This subroutine has not been tested yet)
211 !
212 !****************************************************************
213 !
214  USE ocpcomm1
215  USE ocpcomm2
216  USE ocpcomm3
217  USE ocpcomm4
218  USE swcomm1
219  USE swcomm2
220  USE swcomm3
221  USE swcomm4
222  USE all_vars, ONLY : mt
223 !
224 !
225 ! 2. Purpose
226 !
227 ! Computation of wind sea energy spectrum for the second
228 ! generation wind growth model. Output of the subroutine
229 ! is ETOTW (total wind sea energy spectrum)
230 !
231 ! 3. Method
232 !
233 ! Compute the wind sea energy spectrum : ETOTW
234 !
235 ! +90 inf
236 ! | |
237 ! ETOTW = | | E(s,d) ds dd
238 ! -90 0.7*FPM
239 !
240 ! Compute the total energy density ETOTW for F > 0.7 FPM
241 !
242 ! ^ |
243 ! E()| | *
244 ! | * *
245 ! | *
246 ! | * | * / ETOTW(e)
247 ! | | o * /
248 ! | * | o o/o *
249 ! | | o o o o o *
250 ! | * | o o o o o o o o*
251 ! 0---------------|---------------------------
252 ! 0 0.7*FPM SIGMA --> s
253 !
254 ! SIGMA MAX
255 ! |
256 ! ETOTW(d) = | E(s,d)ds ISFPM = FPM
257 ! 0.7 FPM
258 !
259 ! and over the interval +/- 90 degrees (according to
260 ! the mean wind direction as computed in WINDP1 )
261 !
262 ! IDWMAX = "135"
263 ! o
264 ! ETOTW = o ETOTW(d)dd
265 !
266 ! IDWMIN ="325"
267 !
268 !
269  REAL SPCSIG(MSC)
270 !
271 ! 9. STRUCTURE
272 !
273 ! ------------------------------------------------------------
274 ! Determine the counter for the FPM frequency
275 ! integrate the wind sea energy spectrum
276 ! add the energy of the high frequency tail to the spectrum
277 ! ------------------------------------------------------------
278 !
279 !***********************************************************************
280 !
281 !
282  INTEGER IDWMIN ,IDWMAX ,IDDUM ,ID ,IS ,ISFPM
283 !
284  REAL ETOTW ,FPM ,SIG ,ATOTD
285 
286  REAL AC2(MDC,MSC,0:MT)
287 !
288 ! *** compute wind sea energy spectrum for IS > 0.7 FPM ***
289 ! *** minimum FPM is equal : 2 * pi * 0.13 * grav / pwind(12) ***
290 ! *** is equal 8 rad/s = 1.27 Hz ***
291 !
292  isfpm = msc
293  facint = 0.
294  DO is = 1, msc
295  sig = spcsig(is)
296  IF(frinth * sig > (0.7 * fpm))THEN
297  isfpm = is
298  facint = (frinth - 0.7*fpm/sig) / (frinth - 1./frinth)
299  GOTO 11
300  END IF
301  ENDDO
302 11 CONTINUE
303 !
304 ! *** calculate the energy in the wind sea part of the spectrum ***
305 ! *** from ISFPM. ***
306 !
307  etotw = 0.
308  DO is = isfpm, msc
309  sig = spcsig(is)
310  atotd = 0.
311  DO iddum = idwmin, idwmax
312  id = mod( iddum - 1 + mdc, mdc ) + 1
313  atotd = atotd + ac2(id,is,kcgrd(1))
314  ENDDO
315  IF(is == isfpm)THEN
316  etotw = etotw + facint * frintf * sig**2 * ddir * atotd
317  ELSE
318  etotw = etotw + frintf * sig**2 * ddir * atotd
319  ENDIF
320  ENDDO
321 ! add high-frequency tail:
322  etotw = etotw + pwtail(6) * sig**2 * ddir * atotd
323 
324  RETURN
real, dimension(:), allocatable, save spcsig
Definition: swmod2.f90:767
integer mt
Definition: mod_main.f90:78
real, dimension(:,:,:), allocatable ac2
integer mdc
Definition: swmod1.f90:1672
real frintf
Definition: swmod1.f90:1678
real frinth
Definition: swmod1.f90:1678
real, dimension(10) pwtail
Definition: swmod1.f90:1722
integer, dimension(micmax) kcgrd
Definition: swmod1.f90:1670
integer msc
Definition: swmod1.f90:1673
real ddir
Definition: swmod1.f90:1676
Here is the caller graph for this function:

◆ windp3()

subroutine windp3 ( integer  ISSTOP,
real, dimension(mdc,msc)  ALIMW,
real, dimension(mdc,msc,0:mt)  AC2,
logical, dimension(mdc,msc)  GROWW,
integer, dimension(msc)  IDCMIN,
integer, dimension(msc)  IDCMAX 
)

Definition at line 331 of file swancom3.f90.

331 ! (This subroutine has not been tested yet)
332 !
333 !****************************************************************
334 !
335  USE swcomm3
336  USE swcomm4
337  USE ocpcomm4
338  USE all_vars, ONLY : mt
339 !
340 !
341 ! 2. PURPOSE
342 !
343 ! Reduce the energy density in spectral direction direct after
344 ! solving the tri-diagonal matrix if the energy density level is
345 ! larger then the upper bound limit given by a Pierson Moskowitz
346 ! spectrum. This is only carried out if a particular wave
347 ! component is 'growing'.
348 !
349 ! If the energy density in a bin is larger than the upper bound
350 ! limit (for instance when crossing wind seas are present) then
351 ! the energy density level is a lower limit.
352 !
353 ! 3. METHOD
354 !
355 ! The upper bound limit is given by:
356 !
357 ! 2 -4
358 ! ALPHA g sigma 2 2
359 ! A(s,t) = ----------- exp ( -5/4 (----) ) --- cos ( d - dw )
360 ! sigma^6 FPM pi
361 !
362 ! in which ALPHA is wind sea dependent (see subroutine
363 ! SWIND2) :
364 !
365 ! / C60 ! | / E_windsea g^2 \ |
366 ! ALPHA = MIN | 0.0081 , C50 | ------------ | |
367 ! \ \ U_10^4 / /
368 !
369 !
370 ! 4. PARAMETERLIST
371 !
372 ! INTEGERS :
373 ! ----------
374 ! IX IY Grid point in geographical space
375 ! MDC ,MSC Counters in spectral space
376 ! ISSTOP Maximum frequency that fall within a sweep
377 !
378 ! ARRAYS:
379 ! -------
380 ! AC2 4D Action density as funciton of x,y,s,t
381 ! ALIMW 2D Contains the action density upper bound
382 ! limit regardind spectral action density per
383 ! spectral bin (A(s,t))
384 ! GROWW 2D Logical array which determines is there is
385 ! a) generation ( E < E_lim -> .TRUE. ) or
386 ! b) dissipation ( E > E_lim -> .FALSE. )
387 ! IDCMIN 1D Frequency dependent minimum counter
388 ! IDCMAX 1D Frequency dependent minimum counter
389 !
390 ! 5. SUBROUTINES CALLING
391 !
392 ! SWOMPU
393 !
394 ! 6. SUBROUTINES USED
395 !
396 ! NONE
397 !
398 ! 7. Common blocks used
399 !
400 !
401 ! 8. REMARKS
402 !
403 !
404 ! 9. STRUCTURE
405 !
406 ! ------------------------------------------------------------
407 ! For every spectral bin
408 ! If wave input for a bin is true (GROWW(ID,IS) = .TRUE.) and
409 ! if wave action is larger then maximum then reduce
410 ! wave action to limit its value to upper boundary limit
411 ! else if no growth (see subroutine SWIND1 and SWIND2), check
412 ! if the energy density level in the wind sea part
413 ! of the spectrum is lower than upper bound limit. If so
414 ! set energy level equal to upper bound limit
415 ! endif
416 ! ------------------------------------------------------------
417 ! End of the subroutine WINDP3
418 ! ------------------------------------------------------------
419 !
420 ! 10. SOURCE
421 !
422 !***********************************************************************
423 !
424  INTEGER IS ,ID ,ISSTOP ,IDDUM
425 !
426  INTEGER IDCMIN(MSC) ,IDCMAX(MSC)
427 !
428  REAL AC2CEN
429 !
430  REAL AC2(MDC,MSC,0:MT) ,ALIMW(MDC,MSC)
431 !
432  LOGICAL GROWW(MDC,MSC)
433 !
434  SAVE ient
435  DATA ient/0/
436  IF (ltrace) CALL strace (ient,'WINDP3')
437 !
438 ! *** limit the action density spectrum ***
439 !
440  DO is = 1, isstop
441  DO iddum = idcmin(is) , idcmax(is)
442  id = mod( iddum - 1 + mdc, mdc ) + 1
443  ac2cen = ac2(id,is,kcgrd(1))
444  IF ( groww(id,is) .AND. ac2cen .GT. alimw(id,is) ) &
445  ac2(id,is,kcgrd(1)) = alimw(id,is)
446  IF ( .NOT. groww(id,is) .AND. ac2cen .LT. alimw(id,is) ) &
447  ac2(id,is,kcgrd(1)) = alimw(id,is)
448 !
449  IF (testfl .AND. itest .GE. 50) THEN
450  WRITE(printf,300) is,id,groww(id,is),ac2cen,alimw(id,is)
451  300 FORMAT(' WINDP3 : IS ID GROWW AC2CEN ALIM:',2i4,l4,2e12.4)
452  END IF
453 !
454  ENDDO
455  ENDDO
456 !
457 ! *** test output ***
458 !
459  IF (testfl .AND. itest .GE. 50) THEN
460  WRITE(printf,4000) kcgrd(1),isstop,msc,mdc,mcgrd
461  4000 FORMAT(' WINDP3 : POINT ISSTOP MSC MDC MCGRD :',5i5)
462  END IF
463 !
464  RETURN
logical testfl
Definition: swmod1.f90:2274
subroutine strace(IENT, SUBNAM)
Definition: ocpmix.f90:468
integer mt
Definition: mod_main.f90:78
logical ltrace
Definition: swmod1.f90:537
real, dimension(:,:,:), allocatable ac2
integer mdc
Definition: swmod1.f90:1672
integer printf
Definition: swmod1.f90:517
integer itest
Definition: swmod1.f90:536
integer, dimension(micmax) kcgrd
Definition: swmod1.f90:1670
integer msc
Definition: swmod1.f90:1673
integer mcgrd
Definition: swmod1.f90:1671
Here is the call graph for this function:

◆ wndpar()

subroutine wndpar ( integer  ISSTOP,
integer  IDWMIN,
integer  IDWMAX,
integer, dimension(msc)  IDCMIN,
integer, dimension(msc)  IDCMAX,
real, dimension(mt)  DEP2,
real  WIND10,
real  THETAW,
real, dimension(mdc,msc,0:mt)  AC2,
real, dimension(msc,micmax)  KWAVE,
real, dimension(mdc,msc)  IMATRA,
real, dimension(mdc,msc)  IMATDA,
real, dimension(msc)  SPCSIG,
real, dimension(msc,micmax)  CGO,
real, dimension(mdc,msc)  ALIMW,
logical, dimension(mdc,msc)  GROWW,
real  ETOTW,
real, dimension(mdc,msc,nptst)  PLWNDA,
real, dimension(mdc,msc,nptst)  PLWNDB,
real, dimension(mdc,6)  SPCDIR,
integer  ITER 
)

Definition at line 1052 of file swancom3.f90.

1052 ! (This subroutine has not been tested yet)
1053 !
1054 !****************************************************************
1055 !
1056  USE swcomm3
1057  USE swcomm4
1058  USE ocpcomm4
1059  USE all_vars, ONLY : mt
1060 !
1061  IMPLICIT NONE
1062 !
1063 !
1064 ! 2. Purpose
1065 !
1066 ! Computation of the wind input source term with formulations
1067 ! of a first-generation model (constant porportionality coefficient)
1068 ! and a second-generation model (proportionality coefficient depends
1069 ! on the energy in the wind sea part of the spectrum). The
1070 ! expressions are from Holthuijsen and de Boer (1988) and from
1071 ! the DOLPHIN-B model (Holthuijsen and Booij). During the
1072 ! implementation of the terms modifications to the code have been
1073 ! made after personal communications with Holthuijsen and Booij.
1074 !
1075 ! 3. Method
1076 !
1077 ! The source term of the following nature:
1078 !
1079 ! S = A + B E for E < Elim | t - tw | < pi/2
1080 !
1081 ! (Elim-E)
1082 ! S = -------- for E > Elim | t - tw | < pi/2
1083 ! TAU
1084 !
1085 ! S = 0 for E > Elim | t - tw | > pi/2
1086 !
1087 ! in which the terms A and B are:
1088 !
1089 ! [cf10] 2 2 2 4
1090 ! A = ------ pi (1./g) [rhoaw] [cdrag] (U cos(t-tw))
1091 ! 2 pi
1092 !
1093 ! and:
1094 ! U cos(t-tw) s
1095 ! B = 5 [cf20] [rhoaw] f { ----------- - [cf30] } ----
1096 ! Cph 2 pi
1097 !
1098 ! The coefficient TAU in the relaxation model is given by:
1099 ! 2
1100 ! / 2 pi \ g
1101 ! TAU = [cf40] | ----- | ------------
1102 ! \ s / U cos(d-dw)
1103 !
1104 ! The limiting spectrum is given by:
1105 !
1106 ! -3
1107 ! ALPHA K s -4 2 2
1108 ! Elim = ----------- exp ( -5/4 (----) ) --- cos ( t - tw )
1109 ! 2 Cg spm pi
1110 !
1111 ! in which:
1112 !
1113 ! ALPHA wind sea and/or depth dependent proportionality
1114 ! coefficient which controls the energy scale of the
1115 ! limiting spectrum.
1116 ! * In the first-generation model ALPHA is a constant
1117 ! equal to 0.0081 (fully developed)
1118 ! * In the second-generation model ALPHA depends on the
1119 ! energy in the wind sea part of the spectrum. ALPHA
1120 ! is calculated here by:
1121 ! [cf60]
1122 ! ALPHA = [cf50] * Edml
1123 !
1124 ! spm adapted Pierson-Moskowitz (1964) peak frequency
1125 !
1126 ! The total non-dimensional energy in the wind sea part of the
1127 ! spectrum is calculated by (see subroutine WINDP2):
1128 !
1129 ! 2
1130 ! grav * ETOTW
1131 ! Edml = -------------
1132 ! 4
1133 ! wind10
1134 !
1135 !
1136 ! 4. Argument variables
1137 !
1138 ! i SPCDIR: (*,1); spectral directions (radians)
1139 ! (*,2); cosine of spectral directions
1140 ! (*,3); sine of spectral directions
1141 ! (*,4); cosine^2 of spectral directions
1142 ! (*,5); cosine*sine of spectral directions
1143 ! (*,6); sine^2 of spectral directions
1144 ! i SPCSIG: Relative frequencies in computational domain in sigma-space
1145 !
1146  REAL SPCDIR(MDC,6)
1147  REAL SPCSIG(MSC)
1148 !
1149 ! 6. Local variables
1150 !
1151 ! IENT : Number of entries into this subroutine
1152 !
1153  INTEGER IENT
1154 !
1155  REAL :: FPM ! Pierson-Moskowitz frequency
1156  REAL :: SWIND_EXP, SWIND_IMP ! explicit and implicit part of wind source
1157 !
1158 ! INTEGERS:
1159 ! ---------
1160 ! IDWMIN Minimum counter for spectral wind direction
1161 ! IDWMAX Maximum counter for spectral wind direction
1162 ! IX Counter of gridpoint in x-direction
1163 ! IY Counter of gridpoint in y-direction
1164 ! IS Counter of frequency bin
1165 ! ISSTOP Countrer for the maximum frequency of all directions
1166 ! IDDUM Dummy counter
1167 ! ID Counter of directional distribution
1168 ! IDWMIN/IDWMAX Minimum / maximum counter in wind sector (180 degrees)
1169 !
1170 ! REALS:
1171 ! ---------
1172 ! ALPM Coefficient for overshoot at deep water
1173 ! ALPMD Coefficient for overshoot corrected for shallow
1174 ! water using expression of Bretschnieder (1973)
1175 ! ALIMW limiting spectrum in terms of action density
1176 ! ARG1, ARG2 Exponent
1177 ! CDRAG Wind drag coefficient
1178 ! DND Nondimensional depth
1179 ! DTHETA Difference in rad between wave and wind direction
1180 ! EDML Dimensionless energy
1181 ! ETOTW Total energy of the wind sea part of the spectrum
1182 ! RHOAW Density of air devided by the density of water
1183 ! SIGPK Peak frequency in terms of rad /s
1184 ! SIGPKD Adapted peak frequency for shallow water
1185 ! TAU Variable for the wind growth equation
1186 ! THETA Spectral direction
1187 ! THETAW Mean direction of the relative wind vector
1188 ! TWOPI Two times pi
1189 ! WIND10 Velocity of the relative wind vector
1190 !
1191 ! one and more dimensional arrays:
1192 ! ---------------------------------
1193 ! AC2 4D Action density as function of D,S,X,Y and T
1194 ! ALIMW 2D Limiting action density spectrum
1195 ! DEP2 1D Depth
1196 ! CGO 2D Group velocity
1197 ! KWAVE 2D Wave number
1198 ! LOGSIG 1D Logaritmic distribution of frequency
1199 ! IMATRA 2D Coefficients of right hand side of vector
1200 ! IMATDA 2D Coefficients of the diagonal
1201 ! PLWNDA 3D Values of source term for test point
1202 ! PLWNDB 3D Values of source term for test point
1203 ! SPCDIR 1D Spectral direction of wave component
1204 ! IDCMIN 1D Minimum counter
1205 ! IDCMAX 1D Maximum counter in directional space
1206 ! GROWW 2D Aux. array to determine whether there are
1207 ! wave generation conditions
1208 !
1209 ! PWIND(1) = CF10 188.0
1210 ! PWIND(2) = CF20 0.59
1211 ! PWIND(3) = CF30 0.12
1212 ! PWIND(4) = CF40 250.0
1213 ! PWIND(5) = CF50 0.0023
1214 ! PWIND(6) = CF60 -0.2233
1215 ! PWIND(7) = CF70 0. (not used)
1216 ! PWIND(8) = CF80 -0.56 (not used)
1217 ! PWIND(9) = RHOAW 0.00125 (density air / density water)
1218 ! PWIND(10) = EDMLPM 0.0036 (limit energy Pierson Moskowitz)
1219 ! PWIND(11) = CDRAG 0.0012 (drag coefficient)
1220 ! PWIND(12) = UMIN 1.0 (minimum wind velocity)
1221 ! PWIND(13) = PMLM 0.13 ( )
1222 !
1223 ! 7. Common blocks used
1224 !
1225 !
1226 ! 5. SUBROUTINES CALLING
1227 !
1228 ! SOURCE
1229 !
1230 ! 6. SUBROUTINES USED
1231 !
1232 ! WINDP2 (compute the total energy in the wind sea part of
1233 ! the spectrum). Subroutine WINDP2 is called in
1234 ! SWANCOM1 in subroutine SOURCE
1235 !
1236 ! 7. ERROR MESSAGES
1237 !
1238 ! ---
1239 !
1240 ! 8. REMARKS
1241 !
1242 ! ---
1243 !
1244 ! 9. STRUCTURE
1245 !
1246 ! --------------------------------------------------------------
1247 ! Calculate the adapted peak frequency
1248 ! --------------------------------------------------------------
1249 ! If first-generation model
1250 ! alpha is constant
1251 ! else
1252 ! Calculate energy in wind sea part of spectrum ETOTW
1253 ! Calculate alpha on the basis of ETOTW
1254 ! end
1255 ! --------------------------------------------------------------
1256 ! Take depth effects into account for alpha
1257 ! --------------------------------------------------------------
1258 ! For each frequency and direction
1259 ! compute limiting spectrum and determine whether there is
1260 ! grow or decay
1261 ! end
1262 ! --------------------------------------------------------------
1263 ! Do for each frequency and direction
1264 ! If wind-wave generation conditions are present
1265 ! calculate A + B E
1266 ! else if energy is larger than limiting spectrum
1267 ! calculate dissipation rate with relaxation model
1268 ! endif
1269 ! enddo
1270 ! --------------------------------------------------------------
1271 ! Store results in matrix (IMATRA or IMATDA)
1272 ! --------------------------------------------------------------
1273 ! End of the subroutine WNDPAR
1274 ! --------------------------------------------------------------
1275 !
1276 ! 10. SOURCE
1277 !
1278 !***********************************************************************
1279 !
1280  INTEGER IS,ID,ITER,IDWMIN,IDWMAX,IDDUM ,ISSTOP
1281 !
1282  REAL WIND10,THETA ,THETAW,EDML ,ARG1 ,ARG2 , &
1283  ALPM ,ALPMD ,TEMP1 ,TEMP2 ,FACTA ,FACTB , &
1284  ADUM ,BDUM ,CINV ,SIGTPI,SIGMA ,TWOPI ,TAUINV, &
1285  SIGPK ,SIGPKD,DND ,ETOTW ,ALIM1D, &
1286  CTW ,STW ,COSDIF, &
1287  DIRDIS,AC2CEN,DTHETA
1288 !
1289  REAL :: AC2(MDC,MSC,0:MT)
1290  REAL :: ALIMW(MDC,MSC)
1291  REAL :: IMATDA(MDC,MSC), IMATRA(MDC,MSC)
1292 ! Changed ICMAX to MICMAX, since MICMAX doesn't vary over gridpoint
1293  REAL :: KWAVE(MSC,MICMAX)
1294  REAL :: PLWNDA(MDC,MSC,NPTST)
1295  REAL :: PLWNDB(MDC,MSC,NPTST)
1296  REAL :: DEP2(MT)
1297 ! Changed ICMAX to MICMAX, since MICMAX doesn't vary over gridpoint
1298  REAL :: CGO(MSC,MICMAX)
1299 !
1300  INTEGER IDCMIN(MSC),IDCMAX(MSC)
1301 !
1302  LOGICAL GROWW(MDC,MSC)
1303 !
1304 ! SAVE IENT
1305 ! DATA IENT/0/
1306 ! IF (LTRACE) CALL STRACE (IENT,'WNDPAR')
1307 !
1308 ! *** initialization of arrays ***
1309 !
1310  DO is = 1, msc
1311  DO id = 1, mdc
1312  groww(id,is) = .false.
1313  alimw(id,is) = 0.
1314  ENDDO
1315  ENDDO
1316 !
1317 ! *** calculate the adapted shallow water peak frequency ***
1318 ! *** according to Bretschneider (1973) using the nondimensional ***
1319 ! *** depth DND ***
1320 !
1321  twopi = 2. * pi_w
1322 ! DND = MIN( 50. , GRAV_W * DEP2(IGC) / WIND10**2 )
1323  dnd = min( 50. , grav_w * dep2(kcgrd(1)) / wind10**2 )
1324  sigpk = twopi * 0.13 * grav_w / wind10
1325  sigpkd = sigpk / tanh(0.833*dnd**0.375)
1326  fpm = sigpkd
1327  ctw = cos(thetaw)
1328  stw = sin(thetaw)
1329 !
1330  IF(iwind == 1)THEN
1331 !
1332 ! *** first generation model ***
1333 !
1334  alpm = 0.0081
1335 !
1336  ELSE IF(iwind == 2)THEN
1337 !
1338 ! *** second generation model ***
1339 !
1340 ! *** Determine the proportionality constant alpha on the basis ***
1341 ! *** of the total energy in the wind sea part of the spectrum ***
1342 ! *** output of subroutine (WINDP2) is ETOTW ***
1343 !
1344  CALL windp2 (idwmin ,idwmax ,sigpkd ,fpm , &
1345  etotw , &
1346  ac2 ,spcsig , wind10 )
1347 
1348  edml = min( pwind(10) , (grav_w**2 * etotw) / wind10**4 )
1349  edml = max( 1.e-25 , edml )
1350 !
1351  arg1 = abs(pwind(6))
1352  alpm = max( 0.0081, (pwind(5) * (1./edml)**arg1) )
1353 !
1354  ENDIF
1355 !
1356 ! *** Take into account depth effects for proportionality ***
1357 ! *** constant alpha through the nondimensional depth DND ***
1358 !
1359  alpmd = 0.0081 + ( 0.013 - 0.0081 ) * exp( -1. * dnd )
1360  alpm = min( 0.155 , max( alpmd , alpm ) )
1361 !
1362 ! *** Calculate the limiting spectrum in terms of action density ***
1363 ! *** for the wind sea part (centered around the local wind ***
1364 ! *** direction). For conversion of f^-5 --> k^-3 and coefficients ***
1365 ! *** see Kitaigorodskii et al. 1975 ***
1366 !
1367  DO is = 1, isstop
1368  temp1 = alpm / ( 2. * kwave(is,1)**3 * cgo(is,1) )
1369  arg2 = min( 2. , sigpkd / spcsig(is) )
1370  temp2 = exp( (-5./4.) * arg2**4 )
1371  alim1d = temp1 * temp2 / spcsig(is)
1372  DO iddum = idwmin, idwmax
1373  id = mod( iddum - 1 + mdc, mdc ) + 1
1374  theta = spcdir(id,1)
1375  cosdif = spcdir(id,2)*ctw + spcdir(id,3)*stw
1376 !
1377 ! For better convergence the first guess of the directional spreading
1378 ! is modified in third generation mode. The new formulation better
1379 ! fits the directional spreading of the deep water growth curves.
1380 !
1381  IF((iter == 1).AND.(igen == 3))THEN
1382  dirdis = 0.434917 * (max(0., cosdif))**0.6
1383  ELSE
1384  dirdis = (2./pi_w) * cosdif**2
1385  END IF
1386 !
1387  alimw(id,is) = alim1d * dirdis
1388 ! AC2CEN = AC2(ID,IS,IGC)
1389  ac2cen = ac2(id,is,kcgrd(1))
1390  IF(ac2cen <= alimw(id,is))THEN
1391  groww(id,is) = .true.
1392  ELSE
1393  groww(id,is) = .false.
1394  ENDIF
1395  ENDDO
1396 ! *** test output ***
1397 ! IF(TESTFL .AND. ITEST >= 10)THEN
1398 ! WRITE(PRINTF,2002) IS, SPCSIG(IS), KWAVE(IS,1), CGO(IS,1)
1399 !2002 FORMAT(' WNDPAR: IS SPCSIG KWAVE CGO :',I3,3E12.4)
1400 ! WRITE(PRINTF,2003) TEMP1, TEMP2, ARG2
1401 !2003 FORMAT(' WNDPAR: TEMP1 TEMP2 ARG2 :',3X,3E12.4)
1402 ! END IF
1403  ENDDO
1404 !
1405 ! *** Calculate the wind input (linear term A and exponential ***
1406 ! *** term B) in wave generating conditions or disspation term ***
1407 ! *** if energy in bin is larger than limiting spectrum ***
1408 !
1409 !
1410  facta = pwind(1) * pi_w * pwind(9)**2 * pwind(11)**2 / grav_w**2
1411 !
1412  DO is = 1, isstop
1413  sigma = spcsig(is)
1414  sigtpi = sigma * twopi
1415  cinv = kwave(is,1) / sigma
1416  factb = pwind(2) * pwind(9) * sigma / twopi
1417  DO iddum = idcmin(is), idcmax(is)
1418  id = mod( iddum - 1 + mdc, mdc ) + 1
1419  dtheta = spcdir(id,1) - thetaw
1420  cosdif = spcdir(id,2)*ctw + spcdir(id,3)*stw
1421 ! AC2CEN = AC2(ID,IS,IGC)
1422  ac2cen = ac2(id,is,kcgrd(1))
1423 !
1424  swind_exp = 0.
1425  swind_imp = 0.
1426 
1427  IF(groww(id,is))THEN
1428 ! *** term A ***
1429  IF(sigma >= ( 0.7 * sigpkd ))THEN
1430  adum = facta * (wind10 * cosdif)**4
1431  adum = max( 0. , adum / sigtpi )
1432  ELSE
1433  adum = 0.
1434  END IF
1435 ! *** term B; Note that BDUM is multiplied with a factor 5 ***
1436 ! *** as in the DOLPHIN-B model ***
1437 !
1438  bdum = max( 0., ((wind10 * cinv) * cosdif-pwind(3)))
1439  bdum = factb * bdum * 5.
1440  swind_exp = adum + bdum * ac2cen
1441 !
1442  ELSE IF(.NOT. groww(id,is) .AND. ac2cen > 0.)THEN
1443 !
1444 ! *** for no energy dissipation outside the wind field ***
1445 ! *** TAUINV is set equal zero (as in the DOLPHIN-B model) ***
1446 !
1447  IF(cosdif < 0.) THEN
1448  tauinv = 0.
1449  ELSE
1450  tauinv = ( sigma**2 * wind10 * abs(cosdif) ) / &
1451  ( pwind(4) * grav_w * twopi**2 )
1452  ENDIF
1453  swind_exp = tauinv * alimw(id,is)
1454  swind_imp = -tauinv
1455  adum = alimw(id,is)
1456  bdum = tauinv
1457  END IF
1458 !
1459 ! *** store results in IMATDA and IMATRA ***
1460 !
1461  imatra(id,is) = imatra(id,is) + swind_exp
1462 ! IMATDA(ID,IS) = IMATDA(ID,IS) - SWIND_IMP
1463  IF (testfl) plwnda(id,is,iptst) = swind_exp
1464  IF (testfl) plwndb(id,is,iptst) = swind_imp
1465 !
1466 !
1467 ! *** test output ***
1468 !
1469 ! Value of ITEST changed from 10 to 110 to reduce test output
1470 ! IF ( TESTFL .AND. ITEST .GE. 110 ) THEN
1471 ! WRITE(PRINTF,2004) IS, ID, GROWW(ID,IS), ADUM, BDUM
1472 !2004 FORMAT(' WNDPAR: IS ID GROWW ADUM BDUM :', &
1473 ! 2I3,2X,L1,2X,2E12.4)
1474 ! END IF
1475  ENDDO
1476  ENDDO
1477 !
1478 ! *** test output ***
1479 !
1480 ! Value of ITEST changed from 10 to 60 to reduce test output
1481 ! IF(TESTFL .AND. ITEST >= 60)THEN
1482 ! WRITE(PRINTF,*)
1483 ! WRITE(PRINTF,6051) IDWMIN, IDWMAX
1484 !6051 FORMAT(' WNDPAR : IDWMIN IDWMAX :',2I5)
1485 ! WRITE(PRINTF,6052) THETAW,WIND10,SIGPK,SIGPKD
1486 !6052 FORMAT(' WNDPAR : Tw U10 Spk Spk,d :',4E12.4)
1487 ! WRITE(PRINTF,7050) ETOTW, EDML, ALPM, ALPMD
1488 !7050 FORMAT(' WNDPAR: ETOW EDML ALPM ALPMD:',4E12.4)
1489 ! ENDIF
1490 !
1491  RETURN
1492 
real, dimension(:), allocatable, save spcsig
Definition: swmod2.f90:767
logical testfl
Definition: swmod1.f90:2274
integer mt
Definition: mod_main.f90:78
real, dimension(:,:), allocatable, save spcdir
Definition: swmod2.f90:767
real grav_w
Definition: swmod1.f90:1721
integer iwind
Definition: swmod1.f90:2129
real, dimension(:,:,:), allocatable ac2
integer mdc
Definition: swmod1.f90:1672
real pi_w
Definition: swmod1.f90:1721
integer, dimension(micmax) kcgrd
Definition: swmod1.f90:1670
real, dimension(mwind) pwind
Definition: swmod1.f90:2136
integer msc
Definition: swmod1.f90:1673
integer igen
Definition: swmod1.f90:2126
integer iptst
Definition: swmod1.f90:2269
subroutine windp2(IDWMIN, IDWMAX, SIGPKD, FPM, ETOTW, AC2, SPCSIG, WIND10)
Definition: swancom3.f90:210
Here is the call graph for this function: