My Project
Functions/Subroutines
swancom5.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine swapar (IG, NICMAX, DEP2, KWAVE, CGO)
 
subroutine swapar1 (I, IS, ID, DEP2, KWAVEL, CGOL)
 
subroutine sproxy (I1, IS, ID, CAXL, CAYL, CG0L, ECOSL, ESINL, UX2L, UY2L)
 
subroutine sproxy2 (CAXL, CAYL, CG0L, ECOSL, ESINL, UX2L, UY2L)
 
subroutine sproxy3 (CAXL, CAYLA, CAYLB, CG0L, ECOSL, ESINL, UX2L, UY2L, DLTYETMPP, DLTXETMPP, DLTXEA, DLTXEB)
 
subroutine sprosd (KWAVE, CAS, CAD, CGO, DEP2, DEP1, ECOS, ESIN, UX2, UY2, IDCMIN, IDCMAX, COSCOS, SINSIN, SINCOS, RDX, RDY, CAX, CAY, IG)
 
subroutine dspher (CAD, CAX, CAY, IG, ECOS, ESIN)
 
subroutine adddis (DISSXY, LEAKXY, AC2, ANYBIN, DISC0, DISC1, LEAKC1, SPCSIG)
 
subroutine spredt (AC2, CAX, CAY, IDCMIN, IDCMAX, ISSTOP, RDX, RDY)
 
subroutine swpsel (IDCMIN, IDCMAX, CAX, CAY, ISCMIN, ISCMAX, IDTOT, ISTOT, IDDLOW, IDDTOP, ISSTOP, DEP2, UX2, UY2, SPCDIR)
 

Function/Subroutine Documentation

◆ adddis()

subroutine adddis ( real, dimension(mt)  DISSXY,
real, dimension(mt)  LEAKXY,
real, dimension(mdc,msc,0:mt)  AC2,
logical, dimension(mdc,msc)  ANYBIN,
real, dimension(mdc,msc)  DISC0,
real, dimension(mdc,msc)  DISC1,
real, dimension(mdc,msc)  LEAKC1,
real, dimension(msc)  SPCSIG 
)

Definition at line 875 of file swancom5.f90.

875 ! (This subroutine has not been tested yet)
876 !
877 !*******************************************************************
878 !
879  USE swcomm3
880  USE all_vars, ONLY : mt
881 !
882 !
883 ! --|-----------------------------------------------------------|--
884 ! | Delft University of Technology |
885 ! | Faculty of Civil Engineering |
886 ! | Environmental Fluid Mechanics Section |
887 ! | P.O. Box 5048, 2600 GA Delft, The Netherlands |
888 ! | |
889 ! | Programmers: R.C. Ris, N. Booij, |
890 ! | IJ.G. Haagsma, A.T.M.M. Kieftenburg, |
891 ! | M. Zijlema, E.E. Kriezi, |
892 ! | R. Padilla-Hernandez, L.H. Holthuijsen |
893 ! --|-----------------------------------------------------------|--
894 !
895 !
896 ! SWAN (Simulating WAves Nearshore); a third generation wave model
897 ! Copyright (C) 2004-2005 Delft University of Technology
898 !
899 ! This program is free software; you can redistribute it and/or
900 ! modify it under the terms of the GNU General Public License as
901 ! published by the Free Software Foundation; either version 2 of
902 ! the License, or (at your option) any later version.
903 !
904 ! This program is distributed in the hope that it will be useful,
905 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
906 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
907 ! GNU General Public License for more details.
908 !
909 ! A copy of the GNU General Public License is available at
910 ! http://www.gnu.org/copyleft/gpl.html#SEC3
911 ! or by writing to the Free Software Foundation, Inc.,
912 ! 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
913 !
914 !
915 ! 0. Authors
916 !
917 ! 30.72: IJsbrand Haagsma
918 !
919 ! 1. Updates
920 !
921 ! 20.53, Aug. 95: New subroutine
922 ! 30.74, Nov. 97: Prepared for version with INCLUDE statements
923 ! 30.72, Feb. 98: Introduced generic names XCGRID, YCGRID and SPCSIG for SWAN
924 !
925 ! 2. Purpose
926 !
927 ! Adds dissipation and leak
928 !
929 ! 3. Method
930 !
931 ! ---
932 !
933 ! 4. Argument variables
934 !
935 ! SPCSIG: Relative frequencies in computational domain in sigma-space 30.72
936 !
937  REAL SPCSIG(MSC)
938 !
939 ! IX Counter of gridpoints in x-direction
940 ! IY Counter of gridpoints in y-direction
941 ! MXC Maximum counter of gridppoints in x-direction
942 ! MYC Maximum counter of gridppoints in y-direction
943 ! MSC Maximum counter of relative frequency
944 ! MDC Maximum counter of directional distribution
945 !
946 ! REALS:
947 ! ---------
948 !
949 ! SP Dummy variable
950 ! TEMP Dummy variable
951 !
952 ! one and more dimensional arrays:
953 ! ---------------------------------
954 ! AC2 4D Action density as function of D,S,X,Y and T
955 !
956 ! 7. Common blocks used
957 !
958 !
959 ! 8. Subroutines used
960 !
961 ! ---
962 !
963 ! 9. Subroutines calling
964 !
965 ! SWOMPU
966 !
967 ! 11. Remarks
968 !
969 ! DISSXY and LEAKXY are dissipation and leak integrated over the
970 ! spectrum for each point in the computational grid
971 ! DISSC0 and DISSC1 give the dissipation distributed over the
972 ! spectral space in one point of the computational grid
973 !
974 ! 12. Structure
975 !
976 ! -------------------------------------------------------------
977 ! -------------------------------------------------------------
978 !
979 ! 13. Source text
980 !
981  REAL DISSXY(MT) ,LEAKXY(MT) , &
982  disc0(mdc,msc) ,disc1(mdc,msc) , &
983  leakc1(mdc,msc) ,ac2(mdc,msc,0:mt)
984 !
985  LOGICAL ANYBIN(MDC,MSC)
986  INTEGER, SAVE :: IENT=0
987  CALL strace (ient, 'ADDDIS')
988 !
989  DO 100 isc = 1, msc
990  dsdd = ddir * frintf * spcsig(isc)**2
991  DO 90 idc = 1, mdc
992  IF (anybin(idc,isc)) THEN
993  dissxy(kcgrd(1)) = dissxy(kcgrd(1)) + dsdd*(disc0(idc,isc) + &
994  disc1(idc,isc) * ac2(idc,isc,kcgrd(1)))
995  leakxy(kcgrd(1)) = leakxy(kcgrd(1)) + dsdd * &
996  leakc1(idc,isc) * ac2(idc,isc,kcgrd(1))
997  ENDIF
998  90 CONTINUE
999  100 CONTINUE
1000  RETURN
real, dimension(:), allocatable, save spcsig
Definition: swmod2.f90:767
subroutine strace(IENT, SUBNAM)
Definition: ocpmix.f90:468
integer mt
Definition: mod_main.f90:78
real, dimension(:,:,:), allocatable ac2
integer mdc
Definition: swmod1.f90:1672
real frintf
Definition: swmod1.f90:1678
integer, dimension(micmax) kcgrd
Definition: swmod1.f90:1670
integer msc
Definition: swmod1.f90:1673
real ddir
Definition: swmod1.f90:1676
Here is the call graph for this function:

◆ dspher()

subroutine dspher ( real, dimension(mdc,msc,micmax)  CAD,
real, dimension(mdc,msc,micmax)  CAX,
real, dimension(mdc,msc,micmax)  CAY,
integer  IG,
real, dimension(mdc)  ECOS,
real, dimension(mdc)  ESIN 
)

Definition at line 804 of file swancom5.f90.

804 !
805 !****************************************************************
806 !
807 ! computes the propagation velocities of energy in Theta-
808 ! space, i.e., CAD, due to use of spherical coordinates
809 !
810 ! Method
811 !
812 ! References:
813 ! W. E. Rogers, J. M. Kaihatu, H. A. H. Petit, N. Booij and L. H. Holthuijsen,
814 ! "Multiple-scale Propagation in a Third-Generation Wind Wave Model"
815 ! in preparation
816 !
817 ! Cg Cos(theta) Tan(latitude)
818 ! CAD = - ---------------------------
819 ! Rearth2
820 !
821 ! The group velocity CG in the direction of the wave propagation
822 ! in case with a current is equal to:
823 !
824 ! 1 K(IS,IC)DEP(IX,IY) S
825 ! CG(ID,IS,IC)= ( - + -----------------------) --------- +
826 ! 2 sinh 2K(IS,IC)DEP(IX,IY) |k(IS,IC)|
827 !
828 ! + (UX2(IX,IY)cos(D) + UY2(IX,IY)sin(D))
829 !
830 ! which is equivalent with CAX*cos(D) + CAY*sin(D)
831 !
832 !****************************************************************
833 !
834  USE swcomm2
835  USE swcomm3
836  USE swcomm4
837  USE ocpcomm4
838  USE all_vars, ONLY : vy
839 !
840  IMPLICIT NONE
841 !
842  REAL :: CAD(MDC,MSC,MICMAX)
843  REAL :: CAX(MDC,MSC,MICMAX)
844  REAL :: CAY(MDC,MSC,MICMAX)
845  REAL :: ECOS(MDC)
846  REAL :: ESIN(MDC)
847  INTEGER :: IS, ID, IG
848  REAL TANLAT, CTTMP
849 !
850 !************************************************************************
851 !
852 !
853 ! *** TANLAT is Tan of Latitude
854 !
855  tanlat = tan(degrad*(vy(ig)+yoffs))
856 !
857  DO id = 1, mdc
858  cttmp = ecos(id) * tanlat / rearth2
859  DO is = 1, msc
860  cad(id,is,1) = cad(id,is,1) - &
861  (cax(id,is,1)*ecos(id) + cay(id,is,1)*esin(id)) * cttmp
862  END DO
863  END DO
864 
865  RETURN
real rearth2
Definition: swmod1.f90:2303
integer mdc
Definition: swmod1.f90:1672
real yoffs
Definition: swmod1.f90:1364
real(sp), dimension(:), allocatable, target vy
Definition: mod_main.f90:1002
integer msc
Definition: swmod1.f90:1673
real degrad
Definition: swmod1.f90:1721

◆ spredt()

subroutine spredt ( real, dimension(mdc,msc,0:mt)  AC2,
real, dimension(mdc,msc,micmax)  CAX,
real, dimension(mdc,msc,micmax)  CAY,
integer, dimension(msc)  IDCMIN,
integer, dimension(msc)  IDCMAX,
integer  ISSTOP,
real, dimension(10)  RDX,
real, dimension(10)  RDY 
)

Definition at line 1007 of file swancom5.f90.

1007 ! (This subroutine has not been tested yet)
1008 !
1009 !****************************************************************
1010 !
1011 ! to estimate the action density depending of the sweep
1012 ! direction during the first iteration of a stationary
1013 ! computation. The reason for this is that AC2 is zero
1014 ! at first iteration and no initialisation is given in
1015 ! case of stationarity (NSTATC=0). Action density should
1016 ! be nonzero because of the computation of the source
1017 ! terms. The estimate is based on solving the equation
1018 !
1019 ! dN dN
1020 ! CAX -- + CAY -- = 0
1021 ! dx dy
1022 !
1023 ! in an explicit manner.
1024 !
1025 ! METHOD
1026 !
1027 !
1028 ! [RDX1*CAX + RDY1*CAY]*N(i-1,j) + [RDX2*CAX + RDY2*CAY]*N(i,j-1)
1029 ! N(i,j) = ---------------------------------------------------------------
1030 ! (RDX1+RDX2) * CAX + (RDY1+RDY2) * CAY
1031 !
1032 ! ------------------------------------------------------------
1033 ! For every sweep direction do,
1034 ! For every point in S and D direction in sweep direction do,
1035 ! predict values for action density at new point from values
1036 ! of neighbour gridpoints taking into account spectral propagation
1037 ! direction (with currents !!) and the boundary conditions.
1038 ! --------------------------------------------------------
1039 ! If wave action AC2 is negative, then
1040 ! Give wave action initial value 1.E-10
1041 ! ---------------------------------------------------------
1042 !****************************************************************
1043 !
1044  USE swcomm3
1045  USE swcomm4
1046  USE ocpcomm4
1047  USE all_vars, ONLY : mt
1048 
1049  IMPLICIT NONE
1050 
1051  INTEGER :: IS ,ID ,IDDUM ,ISSTOP
1052  REAL :: FAC_A ,FAC_B
1053  REAL :: AC2(MDC,MSC,0:MT)
1054  REAL :: CAX(MDC,MSC,MICMAX)
1055  REAL :: CAY(MDC,MSC,MICMAX)
1056  REAL :: RDX(10), RDY(10)
1057  INTEGER :: IDCMIN(MSC) ,IDCMAX(MSC)
1058  REAL :: CDEN ,CNUM ,WEIG1, WEIG2
1059 !
1060  DO is = 1, isstop
1061  DO iddum = idcmin(is), idcmax(is)
1062  id = mod( iddum - 1 + mdc , mdc ) + 1
1063 !
1064 ! *** Computation of weighting coefs WEIG1 AND WEIG2 ***
1065 !
1066  cden = rdx(1) * cax(id,is,1) + rdy(1) * cay(id,is,1)
1067  cnum = (rdx(1) + rdx(2)) * cax(id,is,1) &
1068  + (rdy(1) + rdy(2)) * cay(id,is,1)
1069  weig1 = cden/cnum
1070  weig2 = 1. - weig1
1071 !
1072  fac_a = weig1 * ac2(id,is,kcgrd(2))
1073  fac_b = weig2 * ac2(id,is,kcgrd(3))
1074 !
1075  IF (acupda) ac2(id,is,kcgrd(1)) = max( 0. , (fac_a + fac_b))
1076 !
1077  END DO !IDDUM
1078  END DO !IS
1079 !
1080  RETURN
integer mt
Definition: mod_main.f90:78
real, dimension(:,:,:), allocatable ac2
integer mdc
Definition: swmod1.f90:1672
integer, dimension(micmax) kcgrd
Definition: swmod1.f90:1670
logical acupda
Definition: swmod1.f90:2143

◆ sprosd()

subroutine sprosd ( real, dimension(msc,micmax)  KWAVE,
real, dimension(mdc,msc,micmax)  CAS,
real, dimension(mdc,msc,micmax)  CAD,
real, dimension(msc,micmax)  CGO,
real, dimension(mt)  DEP2,
real, dimension(mt)  DEP1,
real, dimension(mdc)  ECOS,
real, dimension(mdc)  ESIN,
real, dimension(mt)  UX2,
real, dimension(mt)  UY2,
integer, dimension(msc), intent(in)  IDCMIN,
integer, dimension(msc), intent(in)  IDCMAX,
real, dimension(mdc)  COSCOS,
real, dimension(mdc)  SINSIN,
real, dimension(mdc)  SINCOS,
real, dimension(10)  RDX,
real, dimension(10)  RDY,
real, dimension(mdc,msc,micmax)  CAX,
real, dimension(mdc,msc,micmax)  CAY,
integer  IG 
)

Definition at line 501 of file swancom5.f90.

501 !
502 !****************************************************************
503 !
504 ! computes the propagation velocities of energy in S- and
505 ! D-space, i.e., CAS, CAD, in the presence or absence of
506 ! currents, for the action balance equation.
507 !
508 ! Method
509 !
510 ! The next equation are solved numerically
511 !
512 ! @S @S @D _ @D @D _ @U
513 ! CAS = -- = -- [ -- + U . ( -- + --) ] - CGO K . --
514 ! @T @D @T @X @Y @s
515 !
516 ! with: @S KS
517 ! -- = ---------
518 ! @D sinh(2KD)
519 !
520 ! @D S @D @D @Ux @Uy
521 ! CAD = -- = ------- [ --sin(D) - --cos(D)] + [--- - ---] *
522 ! @T sinh(2KD) @X @Y @X @Y
523 !
524 ! @Uy @Ux
525 ! * sin(D)cos(D) + ---sin(D)sin(D) - ---cos(D)cos(D)
526 ! @X @Y
527 ! ------------------------------------------------------------
528 ! For current sweep and two adjacent sweeps do
529 ! determine interpolation factors RDXL and RDYL
530 ! determine depth and current gradients
531 ! ------------------------------------------------------------
532 ! For each frequency do
533 ! determine auxiliary quantities depending on sigma
534 ! For each direction in the sweep and two neighbouring
535 ! directions do
536 ! If IREFR=-1
537 ! Then compute reduction factor for contribution due
538 ! to depth gradient
539 ! ----------------------------------------------------
540 ! determine sweep in which this direction is located
541 ! using gradients of the proper sweep determine
542 ! Csigma (CAS) and Ctheta (CAD)
543 ! ------------------------------------------------------------
544 ! If ITFRE=0
545 ! Then make values of CAS=0
546 ! ------------------------------------------------------------
547 ! If IREFR=0
548 ! Then make values of CAD=0
549 ! ------------------------------------------------------------
550 !
551 !****************************************************************
552 !
553  USE m_genarr
554  USE swcomm2
555  USE swcomm3
556  USE swcomm4
557  USE timecomm
558  USE ocpcomm4
559  USE m_diffr
560  USE mod_action_im
561  USE all_vars, ONLY : ntve,nbve,nv,vx,vy,xc,yc,art1,mt,isonb_w,nbsn,ntsn
562 !
563  IMPLICIT NONE
564 !
565  INTEGER, INTENT(IN) :: IDCMIN(MSC), IDCMAX(MSC)
566  REAL :: CAS(MDC,MSC,MICMAX)
567  REAL :: CAD(MDC,MSC,MICMAX)
568  REAL :: CAX(MDC,MSC,MICMAX)
569  REAL :: CAY(MDC,MSC,MICMAX)
570  REAL :: CGO(MSC,MICMAX)
571  REAL :: DEP2(MT) ,DEP1(MT) ,ECOS(MDC) ,ESIN(MDC) ,COSCOS(MDC) , &
572  SINSIN(MDC) ,SINCOS(MDC)
573  REAL :: KWAVE(MSC,MICMAX)
574  REAL :: UX2(MT) ,UY2(MT) ,RDX(10) ,RDY(10)
575  INTEGER IENT ,IS ,ID ,II ,SWPNGB ,IDDUM ,ID1 ,ID2 ,ISWEEP
576  INTEGER :: ISWP
577  INTEGER :: IC, KCGI
578  LOGICAL :: VALSWP
579  REAL :: VLSINH ,KD1 ,COEF
580  REAL :: RDXL(2) ,RDYL(2) ,DET ,DX2 ,DY2 ,DX3 ,DY3
581  REAL :: DPDX ,DPDY ,DUXDX ,DUXDY ,DUYDX ,DUYDY
582  REAL :: CAST1 ,CAST2 ,CAST3(3) ,CAST4(3) , &
583  CAST5 ,CAST6(3) ,CAST7(3) ,CAST8(3) ,CAST9(3) , &
584  CADT1 ,CADT2(3) ,CADT3(3) , &
585  CADT4(3) ,CADT5(3) ,CADT6(3) ,CADT7(3)
586  REAL :: DLOC1, DLOC2, DLOC3
587 
588  INTEGER, PARAMETER :: SWP_ARRAY(1:3) = (/2,1,3/)
589 
590  REAL :: SUMHDX,SUMHDY,SUMUXDX,SUMUXDY,SUMUYDX,SUMUYDY
591  REAL :: SUMUXHDY,SUMUYHDX
592  INTEGER :: IG,I
593  REAL :: UX,UY
594  REAL :: X1,X2,X3,Y1,Y2,Y3,DX1,DY1
595 
596  cast1 = 0.
597  cast2 = 0.
598  cast5 = 0.
599  cadt1 = 0.
600  dloc1 = dep2(ig)
601 
602  cas(:,:,1) = 0.
603  cad(:,:,1) = 0.
604 !
605 ! *** coefficients for CAS -> function of IX and IY only ***
606 !
607  IF(nstatc == 0 .OR. .NOT.dyndep)THEN
608 ! *** stationary calculation ***
609  cast2 = 0.
610  ELSE
611 ! nonstationary depth, CAST2 is @D/@t
612  cast2 = (dloc1-dep1(ig))*rdtim
613  END IF
614 
615  sumhdx = 0.0
616  sumhdy = 0.0
617  IF(icur /= 0)THEN
618  sumuxdx = 0.0
619  sumuxdy = 0.0
620  sumuydx = 0.0
621  sumuydy = 0.0
622  sumuxhdy = 0.0
623  sumuyhdx = 0.0
624  END IF
625 
626  DO i = 1,ntve(ig)
627  ux = ux2(nv(nbve(ig,i),1))+ux2(nv(nbve(ig,i),2))+ux2(nv(nbve(ig,i),3))
628  ux = ux/3.0
629  uy = uy2(nv(nbve(ig,i),1))+uy2(nv(nbve(ig,i),2))+uy2(nv(nbve(ig,i),3))
630  uy = uy/3.0
631 
632  dloc2 = dep2(nv(nbve(ig,i),1)) + &
633  dep2(nv(nbve(ig,i),2)) + &
634  dep2(nv(nbve(ig,i),3))
635  dloc2 = dloc2/3.0
636 
637  IF(irefr == -1)THEN
638 ! limitation of depths in neighbouring grid points
639  dloc2 = min(dloc2, pnums(17)*dloc1)
640  ELSE
641  IF(abs(dloc2 - dloc1) > 100.0)THEN
642  dloc2 = dloc1
643  ELSE
644 ! no limitation
645  dloc2 = dloc2
646  END IF
647  END IF
648 
649  x1 = vx(ig)
650  y1 = vy(ig)
651 
652  IF(nv(nbve(ig,i),1) == ig)THEN
653  x2 = vx(nv(nbve(ig,i),2))
654  y2 = vy(nv(nbve(ig,i),2))
655  x3 = vx(nv(nbve(ig,i),3))
656  y3 = vy(nv(nbve(ig,i),3))
657  ELSE IF(nv(nbve(ig,i),2) == ig)THEN
658  x2 = vx(nv(nbve(ig,i),3))
659  y2 = vy(nv(nbve(ig,i),3))
660  x3 = vx(nv(nbve(ig,i),1))
661  y3 = vy(nv(nbve(ig,i),1))
662  ELSE
663  x2 = vx(nv(nbve(ig,i),1))
664  y2 = vy(nv(nbve(ig,i),1))
665  x3 = vx(nv(nbve(ig,i),2))
666  y3 = vy(nv(nbve(ig,i),2))
667  END IF
668 
669  dx1 = 0.5*(x1+x2)
670  dy1 = 0.5*(y1+y2)
671 
672 
673  dx1 = xc(nbve(ig,i))-dx1
674  dy1 = yc(nbve(ig,i))-dy1
675 
676 
677 
678  dx2 = 0.5*(x1+x3)
679  dy2 = 0.5*(y1+y3)
680 
681  dx2 = dx2-xc(nbve(ig,i))
682  dy2 = dy2-yc(nbve(ig,i))
683 
684  dx = dx1+dx2
685  dy = dy1+dy2
686 
687  sumhdx = sumhdx - dloc2*dx
688  sumhdy = sumhdy - dloc2*dy
689 
690  IF(icur /= 0)THEN
691  sumuxdx = sumuxdx - ux*dx
692  sumuxdy = sumuxdy - ux*dy
693  sumuydx = sumuydx - uy*dx
694  sumuydy = sumuydy - uy*dy
695  sumuxhdy = sumuxhdy - ux*dloc2*dy
696  sumuyhdx = sumuyhdx - uy*dloc2*dx
697  END IF
698  END DO
699 
700  IF(isonb_w(ig) == 1)THEN
701  dx = vx(nbsn(ig,2))-vx(nbsn(ig,ntsn(ig)-1))
702  dx = 0.5*dx
703  dy = vy(nbsn(ig,2))-vy(nbsn(ig,ntsn(ig)-1))
704  dy = 0.5*dy
705 
706  sumhdx = sumhdx - dep2(ig)*dx
707  sumhdy = sumhdy - dep2(ig)*dy
708 
709  IF(icur /= 0)THEN
710  sumuxdx = sumuxdx - ux2(ig)*dx
711  sumuxdy = sumuxdy - ux2(ig)*dy
712  sumuydx = sumuydx - uy2(ig)*dx
713  sumuydy = sumuydy - uy2(ig)*dy
714  sumuxhdy = sumuxhdy - ux2(ig)*dep2(ig)*dy
715  sumuyhdx = sumuyhdx - uy2(ig)*dep2(ig)*dx
716  END IF
717  END IF
718 
719  DO is =1,msc
720  kd1 = kwave(is,1)*dloc1
721  IF(kd1 > 30.0)kd1 = 30.
722  vlsinh = sinh(2.*kd1)
723  coef = spcsig(is)/vlsinh
724 !
725 ! *** coefficients for CAS -> function of IS only ***
726 !
727  cast1 = kwave(is,1)*coef
728  cast5 = cgo(is,1)*kwave(is,1)
729 !
730 ! *** coefficients for CAD -> function of IS only ***
731 !
732  cadt1 = coef
733 !
734 ! loop over spectral directions
735 !
736  DO iddum = idcmin(is)-1, idcmax(is)+1
737  id = mod(iddum-1+mdc, mdc)+1
738  IF(icur == 0)THEN
739  cas(id,is,1) = cast1*cast2
740  cad(id,is,1) = cadt1*(esin(id)*sumhdy+ecos(id)*sumhdx)
741  cad(id,is,1) = cad(id,is,1)/art1(ig)
742 
743 ! --- adapt the velocity in case of diffraction
744  IF(idiffr == 1)THEN
745 ! CAD(ID,IS,1) = DIFPARAM(IG)*CAD(ID,IS,1) &
746 ! - DIFPARDX(IG)*CGO(IS,1)*ESIN(ID) &
747 ! + DIFPARDY(IG)*CGO(IS,1)*ECOS(ID)
748  print*,'NOT FINISH YET. SEE SPROSD 001'
749  stop
750  END IF
751  ELSE
752  IF(idiffr == 0)THEN
753  cas(id,is,1)= cast1*(cast2*art1(ig)+ &
754  sumuxhdy-sumuyhdx-dloc1*sumuxdy+dloc1*sumuydx)- &
755  cast5 * &
756  (coscos(id)*sumuxdy-sincos(id)*(sumuxdx-sumuydy)- &
757  sinsin(id)*sumuydx)
758  cas(id,is,1)=cas(id,is,1)/art1(ig)
759 
760  cad(id,is,1) = cadt1*(esin(id)*sumhdy+ecos(id)*sumhdx) + &
761  sincos(id)*(sumuxdy+sumuydx) + &
762  sinsin(id)*sumuydy+coscos(id)*sumuxdx
763  cad(id,is,1) = cad(id,is,1)/art1(ig)
764  ELSE IF(idiffr == 1)THEN
765 ! CAS(ID,IS,1)= CAST1 * (CAST2 + CAST3(ISWEEP) + CAST4(ISWEEP)) - &
766 ! DIFPARAM(IG)*CAST5 * &
767 ! (COSCOS(ID) * CAST6(ISWEEP) + &
768 ! SINCOS(ID) * (CAST7(ISWEEP) + CAST8(ISWEEP)) + &
769 ! SINSIN(ID) * CAST9(ISWEEP) )
770 
771 ! CAD(ID,IS,1) = DIFPARAM(IG)*CADT1 * (ESIN(ID) * CADT2(ISWEEP) - &
772 ! ECOS(ID) * CADT3(ISWEEP)) - &
773 ! DIFPARDX(IG)*CGO(IS,1)*ESIN(ID) + &
774 ! DIFPARDY(IG)*CGO(IS,1)*ECOS(ID) + &
775 ! SINCOS(ID) * (CADT4(ISWEEP) - CADT5(ISWEEP)) + &
776 ! SINSIN(ID) * CADT6(ISWEEP) - &
777 ! COSCOS(ID) * CADT7(ISWEEP)
778  print*,'NOT FINISH YET. SEE SPROSD 002'
779  stop
780  END IF
781  ENDIF
782  END DO !IDDUM
783  END DO !IS
784 
785 !
786 ! *** for most cases CAS and CAD will be activated. Therefore ***
787 ! *** for IREFR is set 0 (no refraction) or ITFRE = 0 (no ***
788 ! *** frequency shift) we have put the IF statement outside ***
789 ! *** the internal loop above ***
790 !
791  IF(itfre == 0)THEN
792  cas(:,:,1) = 0.0
793  ENDIF
794 !
795  IF(irefr == 0)THEN
796  cad(:,:,1) = 0.0
797  ENDIF
798 !
799  RETURN
integer, dimension(:), allocatable, target ntsn
Definition: mod_main.f90:1023
real, dimension(:), allocatable, save spcsig
Definition: swmod2.f90:767
real, dimension(mnums) pnums
Definition: swmod1.f90:2133
integer itfre
Definition: swmod1.f90:2128
real dy
Definition: swmod1.f90:1677
integer mt
Definition: mod_main.f90:78
integer icur
Definition: swmod1.f90:2125
real dx
Definition: swmod1.f90:1677
real(sp), dimension(:), allocatable, target art1
Definition: mod_main.f90:1010
real(sp), dimension(:), allocatable, target yc
Definition: mod_main.f90:1004
integer, dimension(:), allocatable, target isonb_w
Definition: mod_main.f90:1025
integer mdc
Definition: swmod1.f90:1672
real(sp), dimension(:), allocatable, target vx
Definition: mod_main.f90:1001
real rdtim
Definition: swmod1.f90:1361
real(sp), dimension(:), allocatable, target vy
Definition: mod_main.f90:1002
integer, dimension(:), allocatable, target ntve
Definition: mod_main.f90:1022
integer nstatc
Definition: swmod1.f90:2131
integer, dimension(:,:), allocatable, target nv
Definition: mod_main.f90:1018
logical dyndep
Definition: swmod1.f90:1366
integer irefr
Definition: swmod1.f90:2127
integer, dimension(:,:), allocatable, target nbve
Definition: mod_main.f90:1034
integer msc
Definition: swmod1.f90:1673
real(sp), dimension(:), allocatable, target xc
Definition: mod_main.f90:1003
integer, dimension(:,:), allocatable, target nbsn
Definition: mod_main.f90:1030
integer idiffr
Definition: swmod1.f90:2132

◆ sproxy()

subroutine sproxy ( integer  I1,
integer  IS,
integer  ID,
real  CAXL,
real  CAYL,
real  CG0L,
real  ECOSL,
real  ESINL,
real  UX2L,
real  UY2L 
)

Definition at line 146 of file swancom5.f90.

146 !
147 !****************************************************************
148 !
149 ! computes the propagation velocities of energy in X-, Y-
150 ! -space, i.e., CAX, CAY, in the presence or absence of
151 ! currents, for the action balance equation.
152 !
153 ! The propagation velocities are computed for the fully 360
154 ! degrees sector.
155 !
156 ! METHOD
157 !
158 ! The next equation are calculated:
159 !
160 ! @X _
161 ! CAX = -- = n C cos (id) + Ux = CGO cos(id) + Ux
162 ! @T
163 !
164 ! @Y _
165 ! CAY = -- = n C sin(id) + Uy = CGO sin(id) + Uy
166 ! @T
167 ! _
168 !
169 ! ******************************************************************
170 ! * attention! in the action balance equation the term *
171 ! * dx *
172 ! * -- = CGO + U = CX with x, CGO, U and CX vectors *
173 ! * dt *
174 ! * is in the literature the term dx/dt often indicated *
175 ! * with CX and CY in the action balance equation. *
176 ! * In this program we use: CAX = CGO + U *
177 ! ******************************************************************
178 !
179 ! ------------------------------------------------------------
180 ! If depth is negative ( DEP(IX,IY) <= 0), then,
181 ! For every point in S and D-direction do,
182 ! Give propagation velocities default values :
183 ! CAX(ID,IS,IC) = 0. {propagation velocity of energy in X-dir.}
184 ! CAY(ID,IS,IC) = 0. {propagation velocity of energy in Y-dir.}
185 ! ---------------------------------------------------------
186 ! Else if current is on (ICUR > 0) then,
187 ! For every point in S and D-direction do, {using the output of SWAPAR}
188 ! S = logaritmic distributed via LOGSIG
189 ! Compute propagation velocity in X-direction:
190 !
191 ! 1 K(IS,IC)DEP2(IX,IY) S cos(D)
192 ! CAX = ( - + ------------------------) --------- + UX2(IX,IY)
193 ! 2 sinh 2K(IS,IC)DEP2(IX,IY) |K(IS,IC)|
194 !
195 ! ------------------------------------------------------
196 ! Compute propagation velocity in Y-direction:
197 !
198 ! 1 K(IS,IC)DEP2(IX,IY) S sin(D)
199 ! CAY = ( - + ------------------------) -------- + UY2(IX,IY)
200 ! 2 sinh 2K(IS,IC)DEP2(IX,IY) |K(IS,IC)|
201 !
202 ! ------------------------------------------------------
203 ! Else if current is not on (ICUR = 0)
204 ! For every point in S and D-direction do
205 ! S = logarithmic distributed via LOGSIG
206 ! Compute propagation velocity in X-direction:
207 !
208 ! 1 K(IS,IC)DEP2(IX,IY) S cos(D)
209 ! CAX = ( - + ------------------------) ----------
210 ! 2 sinh 2K(IS,IC)DEP2(IX,IY) |K(IS,IC)|
211 !
212 ! ------------------------------------------------------
213 ! Compute propagation velocity in Y-direction:
214 !
215 ! 1 K(IS,IC)DEP2(IX,IY) S sin(D)
216 ! CAY = ( - + ------------------------) ----------
217 ! 2 sinh 2K(IS,IC)DEP2(IX,IY) |K(IS,IC)|
218 !
219 ! ----------------------------------------------------------
220 ! End IF
221 ! ------------------------------------------------------------
222 !****************************************************************
223  USE swcomm3
224  USE swcomm4
225  USE ocpcomm4
226  USE m_diffr
227  USE mod_action_im
228 
229  IMPLICIT NONE
230 
231  INTEGER IC,IS,ID,I1,NICMAX
232  REAL CAXL,CAYL,CG0L,ECOSL,ESINL,UX2L,UY2L
233 
234  caxl = cg0l * ecosl
235  cayl = cg0l * esinl
236 !
237 ! --- adapt the velocities in case of diffraction
238 !
239  IF(idiffr == 1 .AND. pdiffr(3) /= 0.)THEN
240 ! CAXL = CAXL*DIFPARAM(I1)
241 ! CAYL = CAYL*DIFPARAM(I1)
242  END IF
243 !
244 ! --- ambient currents added
245 !
246  IF(icur == 1)THEN
247  caxl = caxl + ux2l
248  cayl = cayl + uy2l
249  END IF
250 
251  RETURN
real, dimension(mdiffr) pdiffr
Definition: swmod1.f90:2142
integer icur
Definition: swmod1.f90:2125
integer idiffr
Definition: swmod1.f90:2132
Here is the caller graph for this function:

◆ sproxy2()

subroutine sproxy2 ( real, dimension(mdc,msc)  CAXL,
real, dimension(mdc,msc)  CAYL,
real, dimension(mdc,msc)  CG0L,
real, dimension(mdc)  ECOSL,
real, dimension(mdc)  ESINL,
real  UX2L,
real  UY2L 
)

Definition at line 260 of file swancom5.f90.

260 !
261 !****************************************************************
262 !
263 ! computes the propagation velocities of energy in X-, Y-
264 ! -space, i.e., CAX, CAY, in the presence or absence of
265 ! currents, for the action balance equation.
266 !
267 ! The propagation velocities are computed for the fully 360
268 ! degrees sector.
269 !
270 ! METHOD
271 !
272 ! The next equation are calculated:
273 !
274 ! @X _
275 ! CAX = -- = n C cos (id) + Ux = CGO cos(id) + Ux
276 ! @T
277 !
278 ! @Y _
279 ! CAY = -- = n C sin(id) + Uy = CGO sin(id) + Uy
280 ! @T
281 ! _
282 !
283 ! ******************************************************************
284 ! * attention! in the action balance equation the term *
285 ! * dx *
286 ! * -- = CGO + U = CX with x, CGO, U and CX vectors *
287 ! * dt *
288 ! * is in the literature the term dx/dt often indicated *
289 ! * with CX and CY in the action balance equation. *
290 ! * In this program we use: CAX = CGO + U *
291 ! ******************************************************************
292 !
293 ! ------------------------------------------------------------
294 ! If depth is negative ( DEP(IX,IY) <= 0), then,
295 ! For every point in S and D-direction do,
296 ! Give propagation velocities default values :
297 ! CAX(ID,IS,IC) = 0. {propagation velocity of energy in X-dir.}
298 ! CAY(ID,IS,IC) = 0. {propagation velocity of energy in Y-dir.}
299 ! ---------------------------------------------------------
300 ! Else if current is on (ICUR > 0) then,
301 ! For every point in S and D-direction do, {using the output of SWAPAR}
302 ! S = logaritmic distributed via LOGSIG
303 ! Compute propagation velocity in X-direction:
304 !
305 ! 1 K(IS,IC)DEP2(IX,IY) S cos(D)
306 ! CAX = ( - + ------------------------) --------- + UX2(IX,IY)
307 ! 2 sinh 2K(IS,IC)DEP2(IX,IY) |K(IS,IC)|
308 !
309 ! ------------------------------------------------------
310 ! Compute propagation velocity in Y-direction:
311 !
312 ! 1 K(IS,IC)DEP2(IX,IY) S sin(D)
313 ! CAY = ( - + ------------------------) -------- + UY2(IX,IY)
314 ! 2 sinh 2K(IS,IC)DEP2(IX,IY) |K(IS,IC)|
315 !
316 ! ------------------------------------------------------
317 ! Else if current is not on (ICUR = 0)
318 ! For every point in S and D-direction do
319 ! S = logarithmic distributed via LOGSIG
320 ! Compute propagation velocity in X-direction:
321 !
322 ! 1 K(IS,IC)DEP2(IX,IY) S cos(D)
323 ! CAX = ( - + ------------------------) ----------
324 ! 2 sinh 2K(IS,IC)DEP2(IX,IY) |K(IS,IC)|
325 !
326 ! ------------------------------------------------------
327 ! Compute propagation velocity in Y-direction:
328 !
329 ! 1 K(IS,IC)DEP2(IX,IY) S sin(D)
330 ! CAY = ( - + ------------------------) ----------
331 ! 2 sinh 2K(IS,IC)DEP2(IX,IY) |K(IS,IC)|
332 !
333 ! ----------------------------------------------------------
334 ! End IF
335 ! ------------------------------------------------------------
336 !****************************************************************
337  USE swcomm3
338  USE swcomm4
339  USE ocpcomm4
340  USE m_diffr
341  USE mod_action_im
342 
343  IMPLICIT NONE
344 
345  INTEGER IC,IS,ID,I1,NICMAX
346  REAL CAXL(MDC,MSC),CAYL(MDC,MSC),CG0L(MDC,MSC),ECOSL(MDC),ESINL(MDC),UX2L,UY2L
347 
348  DO id=1,mdc
349  caxl(id,:) = cg0l(id,:) * ecosl(id)
350  cayl(id,:) = cg0l(id,:) * esinl(id)
351  END DO
352 
353 !
354 ! --- adapt the velocities in case of diffraction
355 !
356  IF(idiffr == 1 .AND. pdiffr(3) /= 0.)THEN
357 ! CAXL = CAXL*DIFPARAM(I1)
358 ! CAYL = CAYL*DIFPARAM(I1)
359  END IF
360 !
361 ! --- ambient currents added
362 !
363  IF(icur == 1)THEN
364  caxl = caxl + ux2l
365  cayl = cayl + uy2l
366  END IF
367 
368  RETURN
real, dimension(mdiffr) pdiffr
Definition: swmod1.f90:2142
integer icur
Definition: swmod1.f90:2125
integer mdc
Definition: swmod1.f90:1672
integer idiffr
Definition: swmod1.f90:2132
Here is the caller graph for this function:

◆ sproxy3()

subroutine sproxy3 ( real, dimension(mdc,msc)  CAXL,
real, dimension(mdc,msc)  CAYLA,
real, dimension(mdc,msc)  CAYLB,
real, dimension(mdc,msc)  CG0L,
real, dimension(mdc)  ECOSL,
real, dimension(mdc)  ESINL,
real  UX2L,
real  UY2L,
real  DLTYETMPP,
real  DLTXETMPP,
real  DLTXEA,
real  DLTXEB 
)

Definition at line 376 of file swancom5.f90.

376 !
377 !****************************************************************
378 !
379 ! computes the propagation velocities of energy in X-, Y-
380 ! -space, i.e., CAX, CAY, in the presence or absence of
381 ! currents, for the action balance equation.
382 !
383 ! The propagation velocities are computed for the fully 360
384 ! degrees sector.
385 !
386 ! METHOD
387 !
388 ! The next equation are calculated:
389 !
390 ! @X _
391 ! CAX = -- = n C cos (id) + Ux = CGO cos(id) + Ux
392 ! @T
393 !
394 ! @Y _
395 ! CAY = -- = n C sin(id) + Uy = CGO sin(id) + Uy
396 ! @T
397 ! _
398 !
399 ! ******************************************************************
400 ! * attention! in the action balance equation the term *
401 ! * dx *
402 ! * -- = CGO + U = CX with x, CGO, U and CX vectors *
403 ! * dt *
404 ! * is in the literature the term dx/dt often indicated *
405 ! * with CX and CY in the action balance equation. *
406 ! * In this program we use: CAX = CGO + U *
407 ! ******************************************************************
408 !
409 ! ------------------------------------------------------------
410 ! If depth is negative ( DEP(IX,IY) <= 0), then,
411 ! For every point in S and D-direction do,
412 ! Give propagation velocities default values :
413 ! CAX(ID,IS,IC) = 0. {propagation velocity of energy in X-dir.}
414 ! CAY(ID,IS,IC) = 0. {propagation velocity of energy in Y-dir.}
415 ! ---------------------------------------------------------
416 ! Else if current is on (ICUR > 0) then,
417 ! For every point in S and D-direction do, {using the output of SWAPAR}
418 ! S = logaritmic distributed via LOGSIG
419 ! Compute propagation velocity in X-direction:
420 !
421 ! 1 K(IS,IC)DEP2(IX,IY) S cos(D)
422 ! CAX = ( - + ------------------------) --------- + UX2(IX,IY)
423 ! 2 sinh 2K(IS,IC)DEP2(IX,IY) |K(IS,IC)|
424 !
425 ! ------------------------------------------------------
426 ! Compute propagation velocity in Y-direction:
427 !
428 ! 1 K(IS,IC)DEP2(IX,IY) S sin(D)
429 ! CAY = ( - + ------------------------) -------- + UY2(IX,IY)
430 ! 2 sinh 2K(IS,IC)DEP2(IX,IY) |K(IS,IC)|
431 !
432 ! ------------------------------------------------------
433 ! Else if current is not on (ICUR = 0)
434 ! For every point in S and D-direction do
435 ! S = logarithmic distributed via LOGSIG
436 ! Compute propagation velocity in X-direction:
437 !
438 ! 1 K(IS,IC)DEP2(IX,IY) S cos(D)
439 ! CAX = ( - + ------------------------) ----------
440 ! 2 sinh 2K(IS,IC)DEP2(IX,IY) |K(IS,IC)|
441 !
442 ! ------------------------------------------------------
443 ! Compute propagation velocity in Y-direction:
444 !
445 ! 1 K(IS,IC)DEP2(IX,IY) S sin(D)
446 ! CAY = ( - + ------------------------) ----------
447 ! 2 sinh 2K(IS,IC)DEP2(IX,IY) |K(IS,IC)|
448 !
449 ! ----------------------------------------------------------
450 ! End IF
451 ! ------------------------------------------------------------
452 !****************************************************************
453  USE swcomm3
454  USE swcomm4
455  USE ocpcomm4
456  USE m_diffr
457  USE mod_action_ex
458 
459  IMPLICIT NONE
460  INTEGER IC,IS,ID,I1,NICMAX
461  REAL CAXL(MDC,MSC),CAYLA(MDC,MSC),CAYLB(MDC,MSC),CG0L(MDC,MSC),ECOSL(MDC),ESINL(MDC),UX2L,UY2L
462  REAL DLTXETMPP,DLTXEA,DLTXEB,DLTYETMPP
463 
464  DO id=1,mdc
465  caxl(id,:) = cg0l(id,:) * ecosl(id) * dltyetmpp
466  cayla(id,:) = cg0l(id,:) * esinl(id) * dltxea
467  caylb(id,:) = cg0l(id,:) * esinl(id) * dltxeb
468  END DO
469 
470 !
471 ! --- adapt the velocities in case of diffraction
472 !
473  IF(idiffr == 1 .AND. pdiffr(3) /= 0.)THEN
474 ! CAXL = CAXL*DIFPARAM(I1)
475 ! CAYL = CAYL*DIFPARAM(I1)
476  END IF
477 !
478 ! --- ambient currents added
479 !
480  IF(icur == 1)THEN
481  caxl = caxl + ux2l*dltyetmpp
482  cayla = cayla + uy2l*dltxetmpp
483  caylb = caylb + uy2l*dltxetmpp
484  END IF
485 
486  RETURN
real, dimension(mdiffr) pdiffr
Definition: swmod1.f90:2142
integer icur
Definition: swmod1.f90:2125
integer mdc
Definition: swmod1.f90:1672
integer idiffr
Definition: swmod1.f90:2132

◆ swapar()

subroutine swapar ( integer  IG,
integer  NICMAX,
real, dimension(mt)  DEP2,
real, dimension(msc,nicmax)  KWAVE,
real, dimension(msc,nicmax)  CGO 
)

Definition at line 16 of file swancom5.f90.

16 !
17 !****************************************************************
18 !
19 ! computes the wave parameters K and CGO in the nearby
20 ! points, depending of the sweep direction.
21 ! The nearby points are indicated with the index IC (see
22 ! FUNCTION ICODE(_,_)
23 !
24 ! Method
25 !
26 ! The wave number K(IS,iC) is computed with the dispersion relation:
27 !
28 ! S = GRAV K(IS,IC)tanh(K(IS,IC)DEP(IX,IY))
29 !
30 ! where S = is logarithmic distributed via LOGSIG
31 !
32 ! The group velocity CGO in the case without current is equal to
33 !
34 ! 1 K(IS,IC)DEP(IX,IY) S
35 ! CGO(IS,IC) = ( - + --------------------------) -----------
36 ! 2 2 sinh 2K(IS,IC)DEP(IX,IY) |k(IS,IC)|
37 !
38 !
39  USE m_genarr
40  USE swcomm3
41  USE swcomm4
42  USE ocpcomm4
43  USE mod_action_im
44  USE all_vars
45 
46  IMPLICIT NONE
47 
48  INTEGER :: IC,IS,ID,IG,NICMAX,INDX
49  REAL :: NN(1:MSC), ND(1:MSC)
50  REAL :: DEP2(MT),KWAVE(MSC,NICMAX),CGO(MSC,NICMAX)
51  REAL :: DEPLOC
52 
53  DO ic = 1, nicmax
54  IF(ic == 1)THEN
55  indx = ig
56  deploc = dep2(indx)
57  IF(deploc <= depmin)THEN
58 ! *** depth is negative ***
59  DO is = 1, msc
60  kwave(is,ic) = -1.
61  cgo(is,ic) = 0.
62  END DO
63  ELSE
64 ! *** call KSCIP1 to compute KWAVE and CGO ***
65  CALL kscip1(msc,spcsig,deploc,kwave(1,ic),cgo(1,ic),nn,nd)
66  ENDIF
67  ELSE
68  indx = nbve(ig,ic-1)
69  deploc = dep2(nv(indx,1))+dep2(nv(indx,2))+dep2(nv(indx,3))
70  deploc = deploc/3.0
71  IF(deploc <= depmin)THEN
72 ! *** depth is negative ***
73  DO is = 1, msc
74  kwave(is,ic) = -1.
75  cgo(is,ic) = 0.
76  END DO
77  ELSE
78 ! *** call KSCIP1 to compute KWAVE and CGO ***
79  CALL kscip1(msc,spcsig,deploc,kwave(1,ic),cgo(1,ic),nn,nd)
80  ENDIF
81  END IF
82  ENDDO
83 
84  RETURN
real, dimension(:), allocatable, save spcsig
Definition: swmod2.f90:767
real depmin
Definition: swmod1.f90:2133
integer, dimension(:,:), allocatable, target nv
Definition: mod_main.f90:1018
subroutine kscip1(MMT, SIG, D, K, CG, N, ND)
Definition: swanser.f90:504
integer, dimension(:,:), allocatable, target nbve
Definition: mod_main.f90:1034
integer msc
Definition: swmod1.f90:1673
Here is the call graph for this function:

◆ swapar1()

subroutine swapar1 ( integer  I,
integer  IS,
integer  ID,
real, dimension(mt)  DEP2,
real  KWAVEL,
real  CGOL 
)

Definition at line 92 of file swancom5.f90.

92 !
93 !****************************************************************
94 !
95 ! computes the wave parameters K and CGO in the nearby
96 ! points, depending of the sweep direction.
97 ! The nearby points are indicated with the index IC (see
98 ! FUNCTION ICODE(_,_)
99 !
100 ! Method
101 !
102 ! The wave number K(IS,iC) is computed with the dispersion relation:
103 !
104 ! S = GRAV K(IS,IC)tanh(K(IS,IC)DEP(IX,IY))
105 !
106 ! where S = is logarithmic distributed via LOGSIG
107 !
108 ! The group velocity CGO in the case without current is equal to
109 !
110 ! 1 K(IS,IC)DEP(IX,IY) S
111 ! CGO(IS,IC) = ( - + --------------------------) -----------
112 ! 2 2 sinh 2K(IS,IC)DEP(IX,IY) |k(IS,IC)|
113 !
114  USE m_genarr
115  USE swcomm3
116  USE swcomm4
117  USE ocpcomm4
118  USE mod_action_im
119  USE all_vars, ONLY : nv,ntve,mt
120 
121  IMPLICIT NONE
122 !
123  INTEGER :: IC,IS,ID,I,INDX
124  REAL :: NN(1:MSC), ND(1:MSC)
125  REAL :: DEP2(MT),KWAVEL,CGOL
126  REAL :: DEPLOC,SPCSIGL
127 
128  deploc = (dep2(nv(i,1))+dep2(nv(i,2))+dep2(nv(i,3)))/3.0
129  IF(deploc <= depmin)THEN
130 ! *** depth is negative ***
131  kwavel = -1.
132  cgol = 0.
133  ELSE
134 ! *** call KSCIP1 to compute KWAVE and CGO ***
135  spcsigl = spcsig(is)
136  CALL kscip1(1,spcsigl,deploc,kwavel,cgol,nn,nd)
137  END IF
138 
139  RETURN
real, dimension(:), allocatable, save spcsig
Definition: swmod2.f90:767
integer mt
Definition: mod_main.f90:78
real depmin
Definition: swmod1.f90:2133
integer, dimension(:), allocatable, target ntve
Definition: mod_main.f90:1022
integer, dimension(:,:), allocatable, target nv
Definition: mod_main.f90:1018
subroutine kscip1(MMT, SIG, D, K, CG, N, ND)
Definition: swanser.f90:504
Here is the call graph for this function:
Here is the caller graph for this function:

◆ swpsel()

subroutine swpsel ( integer, dimension(msc)  IDCMIN,
integer, dimension(msc)  IDCMAX,
real, dimension(mdc,msc,micmax)  CAX,
real, dimension(mdc,msc,micmax)  CAY,
integer, dimension(mdc)  ISCMIN,
integer, dimension(mdc)  ISCMAX,
integer  IDTOT,
integer  ISTOT,
integer  IDDLOW,
integer  IDDTOP,
integer  ISSTOP,
real, dimension(mt)  DEP2,
real, dimension(mt)  UX2,
real, dimension(mt)  UY2,
real, dimension(mdc,6)  SPCDIR 
)

Definition at line 1090 of file swancom5.f90.

1090 !
1091 !******************************************************************
1092 !
1093 ! compute the frequency dependent counters in directional space
1094 ! in a situation with a current and without a current.
1095 ! The counters are only computed for the gridpoint
1096 ! considered. This means IC = 1
1097 !
1098 !******************************************************************
1099  USE swcomm1
1100  USE swcomm2
1101  USE swcomm3
1102  USE swcomm4
1103  USE ocpcomm4
1104  USE all_vars, ONLY : mt
1105 
1106  IMPLICIT NONE
1107 !
1108  REAL :: SPCDIR(MDC,6)
1109  INTEGER :: IS ,ID ,IDSUM ,IDCLOW ,IDCHGH ,IDTOT ,ISTOT , &
1110  IDDLOW ,IDDTOP ,ISSLOW ,ISSTOP ,IENT ,IDDUM ,ISCLOW , &
1111  ISCHGH ,IX ,IY ,IC
1112  REAL :: CAXMID ,CAYMID ,GROUP ,UABS ,THDIR
1113  INTEGER :: IDCMIN(MSC) ,IDCMAX(MSC) ,ISCMIN(MDC) ,ISCMAX(MDC) ,SECTOR(MSC)
1114  REAL :: CAX(MDC,MSC,MICMAX) ,CAY(MDC,MSC,MICMAX) ,DEP2(MT) , &
1115  UX2(MT) ,UY2(MT) ,RDX(10) ,RDY(10)
1116  LOGICAL :: LOWEST ,LOWBIN ,HGHBIN
1117 !
1118 ! *** initialize arrays in frequency direction ***
1119 !
1120  DO id = 1, mdc
1121  iscmin(id) = 1
1122  iscmax(id) = 1
1123  END DO
1124 !
1125 ! *** initialize array's in theta direction ***
1126 !
1127  DO is = 1, msc
1128  idcmin(is) = 1
1129  idcmax(is) = mdc
1130  sector(is) = 1
1131  END DO
1132 !
1133 ! *** calculate minimum and maximum counters in frequency ***
1134 ! *** space if a current is present: ISCMIN and ISCMAX ***
1135 !
1136  iddlow = 9999
1137  iddtop = -9999
1138  DO is = 1 , msc
1139  IF(sector(is) > 0)THEN
1140  iddlow = min( iddlow , idcmin(is) )
1141  iddtop = max( iddtop , idcmax(is) )
1142  END IF
1143  END DO
1144 !
1145 ! *** Determine counters ***
1146 !
1147  DO iddum = iddlow, iddtop
1148  id = mod( iddum - 1 + mdc , mdc ) + 1
1149  lowest = .true.
1150  DO is = 1, msc
1151  IF(lowest)THEN
1152  isclow = is
1153  lowest = .false.
1154  END IF
1155  ischgh = is
1156  END DO
1157 !
1158 ! *** set the minimum and maximum counters in arrays ***
1159 !
1160  IF(.NOT.lowest)THEN
1161  iscmin(id) = isclow
1162  iscmax(id) = ischgh
1163  ELSE
1164  END IF
1165 !
1166  END DO !IDDUM
1167 !
1168 ! *** calculate the maximum number of counters in both ***
1169 ! *** directional space and frequency space ***
1170 !
1171  IF(iddlow /= 9999)THEN
1172  idtot = ( iddtop - iddlow ) + 1
1173  IF(icur == 1)THEN
1174  IF(idtot < 3)THEN
1175  iddtop = iddtop + 1
1176  IF(idtot == 1) iddlow = iddlow - 1
1177  idtot = 3
1178  END IF
1179  END IF
1180  ELSE
1181  idtot = 0
1182  END IF
1183 !
1184 ! *** set variables ***
1185 !
1186  idtot = 1
1187  istot = 1
1188  isslow = 9999
1189  isstop = -9999
1190 
1191  DO is = 1, msc
1192  idclow = 0
1193  idchgh = 0
1194  idsum = 0
1195  DO id = 1, mdc
1196  idsum = idsum + 1
1197  isslow = min(is,isslow)
1198  isstop = max(is,isstop)
1199  END DO
1200  END DO
1201 !
1202  IF(isslow /= 9999)THEN
1203  isslow = 1
1204 ! minimal value of ISSTOP is 4 (or MSC if MSC<4)
1205  IF(icur > 0) isstop = max(min(4,msc),isstop)
1206  istot = ( isstop - isslow ) + 1
1207  ELSE
1208  istot = 0
1209  END IF
1210 !
1211 ! *** check if IDTOT is less then MDC ***
1212 !
1213  IF(idtot > mdc)THEN
1214  iddlow = 1
1215  iddtop = mdc
1216  idtot = mdc
1217  END IF
1218 !
1219 ! *** check if the lowest frequency is not blocked ! ***
1220 ! *** this can occur in real cases if the depth is very ***
1221 ! *** small and the current velocity is large ***
1222 ! *** the propagation velocity Cg = sqrt (gd) < U ***
1223 !
1224  IF(icur == 1 .AND. fulcir .AND. &
1225  isslow /= 1 .AND. isslow /= 9999)THEN
1226 ! CALL MSGERR (2,'The lowest freqency is blocked')
1227 7002 FORMAT (i4, 1x, i4, 1x, i2)
1228  ic = 1
1229  group = sqrt( grav_w * dep2(kcgrd(ic)) )
1230  END IF
1231 
1232  RETURN
integer mt
Definition: mod_main.f90:78
integer icur
Definition: swmod1.f90:2125
real grav_w
Definition: swmod1.f90:1721
integer mdc
Definition: swmod1.f90:1672
logical fulcir
Definition: swmod1.f90:1683
integer, dimension(micmax) kcgrd
Definition: swmod1.f90:1670
integer msc
Definition: swmod1.f90:1673