WAVEWATCH III  beta 0.0.1
w3snl3md.F90 File Reference

Generalized and optimized multiple DIA implementation. More...

Go to the source code of this file.

Modules

module  w3snl3md
 Generalized and optimized multiple DIA implementation.
 

Functions/Subroutines

subroutine w3snl3md::w3snl3 (A, CG, WN, DEPTH, S, D)
 Multiple Discrete Interaction Parameterization for arbitrary depths with generalized quadruplet layout. More...
 
subroutine expand (SPEC)
 Expand spectrum, subroutine used to simplify addressing. More...
 
subroutine expnd2 (ARIN, AROUT)
 Expand spectrum to simplify indirect addressing. More...
 
subroutine w3snl3md::insnl3
 Initialization for generalized multiple DIA routine. More...
 
real function minlam (MU, THETA)
 Calculate minimum allowed lambda for quadruplet configuration. More...
 
real function maxlam (MU, THETA)
 Calculate maximum allowed lambda for quadruplet configuration. More...
 

Variables

real, parameter, public w3snl3md::lammax = 0.49999
 
real, parameter, public w3snl3md::delthm = 90.
 

Detailed Description

Generalized and optimized multiple DIA implementation.

Author
H. L. Tolman
Date
13-Jul-2012

Definition in file w3snl3md.F90.

Function/Subroutine Documentation

◆ expand()

subroutine w3snl3::expand ( real, dimension(1-nthmax:nth+nthmax,nfrmin:nfrmax), intent(out)  SPEC)

Expand spectrum, subroutine used to simplify addressing.

Parameters
[out]SPECExpanded spectrum.
Author
H. L. Tolman
Date
21-Aug-2009

Definition at line 644 of file w3snl3md.F90.

644  !/
645  !/ +-----------------------------------+
646  !/ | WAVEWATCH-III NOAA/NCEP |
647  !/ | H. L. Tolman |
648  !/ | FORTRAN 90 |
649  !/ | Last update : 21-Aug-2009 |
650  !/ +-----------------------------------+
651  !/
652  !/ 03-Jul-2008 : Origination. ( version 3.13 )
653  !/ 21-Aug-2009 : Conversion to F(f,theta) form. ( version 3.13 )
654  !/
655  ! 1. Purpose :
656  !
657  ! Expand spectrum, subroutine used to simplify addressing.
658  !
659  ! 3. Parameters :
660  !
661  ! Parameter list
662  ! ----------------------------------------------------------------
663  ! SPEC R.A. O Expanded spectrum.
664  ! ----------------------------------------------------------------
665  !
666  ! 10. Source code :
667  !
668  !/ ------------------------------------------------------------------- /
669  IMPLICIT NONE
670  !/
671  !/ Parameter list
672  !/
673  REAL, INTENT(OUT) :: SPEC(1-NTHMAX:NTH+NTHMAX,NFRMIN:NFRMAX)
674  !/
675  !/ Local parameters
676  !/
677  INTEGER :: IFR, ITH
678  !/
679  !/ ------------------------------------------------------------------- /
680  !
681  spec(:,nfrmin:0) = 0.
682  !
683  spec(1:nth,1:nfr) = a * tpi
684  !
685  DO ifr=1, nfr
686  spec(1:nth,ifr) = spec(1:nth,ifr) * xsi(ifr) / xcg(ifr)
687  END DO
688  !
689  DO ifr=nfr+1, nfrmax
690  spec(1:nth,ifr) = spec(1:nth,ifr-1) * fachfe
691  END DO
692  !
693  DO ith=1, nthmax
694  spec(nth+ith,1:nfrmax) = spec( ith ,1:nfrmax)
695  spec( 1 -ith,1:nfrmax) = spec(nth+1-ith,1:nfrmax)
696  END DO
697  !
698  RETURN
699  !/
700  !/ End of EXPAND ----------------------------------------------------- /
701  !/

References w3gdatmd::fachfe, constants::tpi, and w3gdatmd::xsi.

Referenced by w3snl3md::w3snl3(), and w3snlsmd::w3snls().

◆ expnd2()

subroutine w3snl3::expnd2 ( real, dimension(nth,nfrcut), intent(in)  ARIN,
real, dimension(1-nthmax:nth+nthmax,nfrmin:nfrcut), intent(out)  AROUT 
)

Expand spectrum to simplify indirect addressing.

Done 'in place' with temporary array ( ARIN = AROUT ).

Parameters
[in]ARINInput array.
[out]AROUTOutput array.
Author
H. L. Tolman
Date
16-Jul-2008

Definition at line 717 of file w3snl3md.F90.

717  !/
718  !/ +-----------------------------------+
719  !/ | WAVEWATCH-III NOAA/NCEP |
720  !/ | H. L. Tolman |
721  !/ | FORTRAN 90 |
722  !/ | Last update : 16-Jul-2008 |
723  !/ +-----------------------------------+
724  !/
725  !/ 16-Jul-2008 : Origination. ( version 3.13 )
726  !/
727  ! 1. Purpose :
728  !
729  ! Expand spectrum to simplify indirect addressing.
730  ! Done 'in place' with temporary array ( ARIN = AROUT )
731  !
732  ! 3. Parameters :
733  !
734  ! Parameter list
735  ! ----------------------------------------------------------------
736  ! SPIN R.A. I Input array.
737  ! SPOUT R.A. I Output array.
738  ! ----------------------------------------------------------------
739  !
740  ! 10. Source code :
741  !
742  !/ ------------------------------------------------------------------- /
743  IMPLICIT NONE
744  !/
745  !/ Parameter list
746  !/
747  REAL, INTENT(IN) :: ARIN(NTH,NFRCUT)
748  REAL, INTENT(OUT) :: AROUT(1-NTHMAX:NTH+NTHMAX,NFRMIN:NFRCUT)
749  !/
750  !/ Local parameters
751  !/
752  INTEGER :: IFR, ITH
753  REAL :: TEMP(NTH,NFRCUT)
754  !/
755  !/ ------------------------------------------------------------------- /
756  !
757  temp = arin
758  !
759  arout(:,nfrmin:0) = 0.
760  !
761  arout(1:nth,1:nfrcut) = temp
762  !
763  DO ith=1, nthmax
764  arout(nth+ith,1:nfrcut) = arout( ith ,1:nfrcut)
765  arout( 1 -ith,1:nfrcut) = arout(nth+1-ith,1:nfrcut)
766  END DO
767  !
768  RETURN
769  !/
770  !/ End of EXPND2 ----------------------------------------------------- /
771  !/

Referenced by w3snl3md::w3snl3().

◆ maxlam()

real function insnl3::maxlam ( real, intent(in)  MU,
real, intent(in)  THETA 
)

Calculate maximum allowed lambda for quadruplet configuration.

Attention
replaced (likely typo) 'minimum' from original header here with 'maximum'.
Parameters
MUQuadruplet parameters.
THETATheta in degrees.
Returns
MAXLAM Maximum allowed lambda.
Author
H. L. Tolman
Date
28-Jan-2004

Definition at line 1602 of file w3snl3md.F90.

1602  !/
1603  !/ +-----------------------------------+
1604  !/ | WAVEWATCH-III NOAA/NCEP |
1605  !/ | H. L. Tolman |
1606  !/ | FORTRAN 90 |
1607  !/ | Last update : 28-Jan-2004 |
1608  !/ +-----------------------------------+
1609  !/
1610  !/ 28-Jan-2009 : Origination.
1611  !/
1612  ! 1. Purpose :
1613  !
1614  ! Calculate minimum allowed lambda for quadruplet configuration.
1615  !
1616  ! 3. Parameters :
1617  !
1618  ! Parameter list
1619  ! ----------------------------------------------------------------
1620  ! MU, THETA Real Quadruplet parameters, theta in degree.
1621  ! ----------------------------------------------------------------
1622  !
1623  ! 10. Source code :
1624  !
1625  !/ ------------------------------------------------------------------- /
1626  IMPLICIT NONE
1627  !/
1628  !/ Parameter list
1629  !/
1630  REAL, INTENT(IN) :: MU, THETA
1631  !/
1632  !/ Local parameters
1633  !/
1634  REAL :: MULOC, THETAR, BB, AUX
1635  !/
1636  !/ ------------------------------------------------------------------- /
1637  !/
1638  IF ( theta .LT. 0. ) THEN
1639  maxlam = 0.5
1640  ELSE
1641  muloc = max( 0. , min( 1., mu ) )
1642  thetar = theta * atan(1.) / 45.
1643  bb = (1.+muloc)**4 + (1.-muloc)**4 + &
1644  2. * (1.+muloc)**2 * (1.-muloc)**2 * cos(thetar)
1645  bb = sqrt( max( bb , 0. ) )
1646  maxlam = 0.25 * bb
1647  END IF
1648  !
1649  RETURN
1650  !/
1651  !/ End of MAXLAM ----------------------------------------------------- /
1652  !/

Referenced by w3snl3md::insnl3().

◆ minlam()

real function insnl3::minlam ( real, intent(in)  MU,
real, intent(in)  THETA 
)

Calculate minimum allowed lambda for quadruplet configuration.

Parameters
MUQuadruplet parameters.
THETATheta in degrees.
Returns
MINLAM Minimum allowed lambda.
Author
H. L. Tolman
Date
28-Jan-2004

Definition at line 1534 of file w3snl3md.F90.

1534  !/
1535  !/ +-----------------------------------+
1536  !/ | WAVEWATCH-III NOAA/NCEP |
1537  !/ | H. L. Tolman |
1538  !/ | FORTRAN 90 |
1539  !/ | Last update : 28-Jan-2004 |
1540  !/ +-----------------------------------+
1541  !/
1542  !/ 28-Jan-2009 : Origination.
1543  !/
1544  ! 1. Purpose :
1545  !
1546  ! Calculate minimum allowed lambda for quadruplet configuration.
1547  !
1548  ! 3. Parameters :
1549  !
1550  ! Parameter list
1551  ! ----------------------------------------------------------------
1552  ! MU, THETA Real Quadruplet parameters, theta in degree.
1553  ! ----------------------------------------------------------------
1554  !
1555  ! 10. Source code :
1556  !
1557  !/ ------------------------------------------------------------------- /
1558  IMPLICIT NONE
1559  !/
1560  !/ Parameter list
1561  !/
1562  REAL, INTENT(IN) :: MU, THETA
1563  !/
1564  !/ Local parameters
1565  !/
1566  REAL :: MULOC, THETAR, BB, AUX
1567  !/
1568  !/ ------------------------------------------------------------------- /
1569  !/
1570  IF ( theta .LT. 0. ) THEN
1571  minlam = 0.
1572  ELSE
1573  muloc = max( 0. , min( 1., mu ) )
1574  thetar = theta * atan(1.) / 45.
1575  bb = (1.+muloc)**4 + (1.-muloc)**4 + &
1576  2. * (1.+muloc)**2 * (1.-muloc)**2 * cos(thetar)
1577  bb = sqrt( max( bb , 0. ) )
1578  aux = max( 0. , 0.5*bb-1. )
1579  minlam = sqrt( aux )
1580  END IF
1581  !
1582  RETURN
1583  !/
1584  !/ End of MINLAM ----------------------------------------------------- /
1585  !/

Referenced by w3snl3md::insnl3().

maxlam
real function maxlam(MU, THETA)
Calculate maximum allowed lambda for quadruplet configuration.
Definition: w3snl3md.F90:1602
minlam
real function minlam(MU, THETA)
Calculate minimum allowed lambda for quadruplet configuration.
Definition: w3snl3md.F90:1534
constants::tpi
real, parameter tpi
TPI 2*Pi.
Definition: constants.F90:72