Constructor function for the domain object.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grid_type), | intent(in) | :: | grid | Input |
||
type(spectrum_type), | intent(in) | :: | spectrum | Input |
||
logical, | intent(in), | optional | :: | shallow_water_mode | Logical switch to enable shallow water solver |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=:), | private, | allocatable | :: | type_name | |||
type(grid_type), | private | :: | grid | ||||
type(spectrum_type), | private, | dimension(:,:), allocatable | :: | spectrum | |||
logical, | private | :: | shallow_water_mode | ||||
type(datetime), | private | :: | start_time | Simulation start time |
|||
type(datetime), | private | :: | end_time | Simulation end time |
|||
type(timedelta), | private | :: | time_step | Time step [s] |
|||
real(kind=rk), | private, | dimension(:,:), allocatable | :: | dx | |||
real(kind=rk), | private, | dimension(:,:), allocatable | :: | dy | |||
real(kind=rk), | private, | dimension(:,:), allocatable | :: | u | |||
real(kind=rk), | private, | dimension(:,:), allocatable | :: | v | |||
real(kind=rk), | private, | dimension(:,:), allocatable | :: | eta | |||
real(kind=rk), | private, | dimension(:,:), allocatable | :: | depth | |||
integer(kind=ik), | private, | dimension(2) | :: | lb | |||
integer(kind=ik), | private, | dimension(2) | :: | ub | |||
integer(kind=ik), | private | :: | nfreqs | ||||
integer(kind=ik), | private | :: | ndirs |
private function constructor(grid, spectrum, shallow_water_mode) | Constructor function for the domain object. |
procedure, public, pass(self) :: frequencyMoment | |
procedure, public, pass(self) :: getCurrent_u | |
procedure, public, pass(self) :: getCurrent_v | |
procedure, public, pass(self) :: getGravity | |
procedure, public, pass(self) :: getGrid | |
procedure, public, pass(self) :: getGridSpacingXWithHalo | |
procedure, public, pass(self) :: getGridSpacingYWithHalo | |
procedure, public, pass(self) :: getDepth | |
procedure, public, pass(self) :: getElevation | |
procedure, public, pass(self) :: getFrequency | |
procedure, public, pass(self) :: getDirections | |
procedure, public, pass(self) :: getLowerBounds | |
procedure, public, pass(self) :: getUpperBounds | |
procedure, public, pass(self) :: getSpectrum | |
procedure, public, pass(self) :: getSpectrumArray | |
procedure, public, pass(self) :: getPhaseSpeed | |
procedure, public, pass(self) :: getGroupSpeed | |
procedure, public, pass(self) :: getSurfaceTension | |
procedure, public, pass(self) :: getAirDensity | |
procedure, public, pass(self) :: getWaterDensity | |
procedure, public, pass(self) :: isAllocated | |
procedure, public, pass(self) :: meanPeriod | |
procedure, public, pass(self) :: meanPeriodZeroCrossing | |
procedure, public, pass(self) :: setDepth | |
procedure, public, pass(self) :: setElevation | |
procedure, public, pass(self) :: setGravity | |
procedure, public, pass(self) :: setSurfaceTension | |
procedure, public, pass(self) :: setAirDensity | |
procedure, public, pass(self) :: setWaterDensity | |
procedure, public, pass(self) :: significantWaveHeight | |
procedure, public, pass(self) :: wavenumberMoment | |
procedure, public, pass(self) :: writeJSON | |
procedure, private, pass(self) :: advect1dRank1 | |
procedure, private, pass(self) :: advect1dRank2 | |
procedure, private, pass(self) :: advect2dRank2 | |
procedure, private, pass(self) :: assign_spectrum_array_1d | |
procedure, private, pass(self) :: assign_spectrum_array_2d | |
procedure, private, pass(self) :: domain_add_domain | |
procedure, private, pass(self) :: domain_add_real | |
procedure, private, pass(self) :: domain_sub_domain | |
procedure, private, pass(self) :: domain_sub_real | |
procedure, private, pass(self) :: domain_mult_domain | |
procedure, private, pass(self) :: domain_mult_real | |
procedure, private, pass(self) :: domain_div_domain | |
procedure, private, pass(self) :: domain_div_real | |
procedure, private, pass(self) :: domain_unary_minus | |
procedure, private, pass(self) :: real_add_domain | |
procedure, private, pass(self) :: real_sub_domain | |
procedure, private, pass(self) :: real_mult_domain | |
procedure, private, pass(self) :: real_div_domain | |
procedure, private, pass(self) :: eq | |
procedure, private, pass(self) :: neq | |
procedure, private, pass(self) :: setSpectrum1d | |
procedure, private, pass(self) :: setSpectrum2d | |
procedure, private, pass(self) :: setSpectrumArray1d1d | |
procedure, private, pass(self) :: setSpectrumArray1d2d | |
procedure, private, pass(self) :: setSpectrumArray2d2d | |
generic, public :: advect => advect1dRank1, advect1dRank2, advect2dRank2 | |
generic, public :: setSpectrum => setSpectrum1d, setSpectrum2d | |
generic, public :: setSpectrumArray => setSpectrumArray1d1d, setSpectrumArray1d2d, setSpectrumArray2d2d | |
generic, public :: assignment(=) => assign_spectrum_array_1d, assign_spectrum_array_2d | |
generic, public :: operator(+) => domain_add_domain, domain_add_real, real_add_domain | |
generic, public :: operator(-) => domain_sub_domain, domain_sub_real, domain_unary_minus, real_sub_domain | |
generic, public :: operator(*) => domain_mult_domain, domain_mult_real, real_mult_domain | |
generic, public :: operator(/) => domain_div_domain, domain_div_real, real_div_domain | |
generic, public :: operator(==) => eq | |
generic, public :: operator(/=) => neq |
Constructor function for the domain object.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(grid_type), | intent(in) | :: | grid | Input |
||
type(spectrum_type), | intent(in) | :: | spectrum | Input |
||
logical, | intent(in), | optional | :: | shallow_water_mode | Logical switch to enable shallow water solver |
Computes the advective tendency for the domain instance given the desired
advection method as an input function and the number of halo cells. This
function works only in cases where ndirs == 1
.
Type | Intent | Optional | Attributes | Name | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self |
|
||||||||||||||||||||||||||||||
public pure function advection_method(f, u, dx) result(tendency)Arguments
Return Value real(kind=rk), dimension(:,:), allocatable |
||||||||||||||||||||||||||||||||||
integer(kind=ik), | intent(in) | :: | halowidth | number of halo cells to use in the advection method |
||||||||||||||||||||||||||||||
integer(kind=ik), | intent(in), | dimension(:) | :: | directional_type | A global constant that helps resolve the interface of this specific prodedure |
Computes the advective tendency for the domain instance given the desired
advection method as an input function and the number of halo cells. This
function works both when ndirs == 1
(omnidirectional) and when
ndirs > 1
(directional).
Type | Intent | Optional | Attributes | Name | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self |
|
||||||||||||||||||||||||||||||
public pure function advection_method(f, u, dx) result(tendency)Arguments
Return Value real(kind=rk), dimension(:,:,:), allocatable |
||||||||||||||||||||||||||||||||||
integer(kind=ik), | intent(in) | :: | halowidth | number of halo cells to use in the advection method |
||||||||||||||||||||||||||||||
integer(kind=ik), | intent(in), | dimension(:,:) | :: | directional_type | A global constant that helps resolve the interface of this specific prodedure |
Computes the advective tendency for the domain instance given the desired
advection method as an input function and the number of halo cells. This
function works both when ndirs == 1
(omnidirectional) and when
ndirs > 1
(directional).
Type | Intent | Optional | Attributes | Name | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self |
|
||||||||||||||||||||||||||||||||||||||||||||
public pure function advection_method(f, u, v, dx, dy) result(tendency)Arguments
Return Value real(kind=rk), dimension(:,:,:,:), allocatable |
||||||||||||||||||||||||||||||||||||||||||||||||
integer(kind=ik), | intent(in), | dimension(:) | :: | halowidth | number of halo cells to use in the advection method |
Returns the allocation status of the domains sub-components.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self |
|
Logical equality comparison function. Overloads the /=
operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | l.h.s. |
||
class(domain_type), | intent(in) | :: | d2 | r.h.s. |
Logical inequality comparison function. Overloads the /=
operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | l.h.s. |
||
class(domain_type), | intent(in) | :: | d2 | r.h.s. |
Returns a sum of two domain instances.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | l.h.s. domain instance |
||
class(domain_type), | intent(in) | :: | d2 | r.h.s. domain instance |
Returns a difference between two domain instances.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | l.h.s. domain instance |
||
class(domain_type), | intent(in) | :: | d2 | r.h.s. domain instance |
Returns a negative domain instances.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | domain instance |
Returns a product of two domain instances.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | l.h.s. domain instance |
||
class(domain_type), | intent(in) | :: | d2 | r.h.s. domain instance |
Returns a division of two domain instances.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | l.h.s. domain instance |
||
class(domain_type), | intent(in) | :: | d2 | r.h.s. domain instance |
Returns a sum of a domain instance and a real number.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | l.h.s. domain instance |
||
real(kind=rk), | intent(in) | :: | a | r.h.s. real number |
Returns a difference between a domain instance and a real number.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | l.h.s. domain instance |
||
real(kind=rk), | intent(in) | :: | a | r.h.s. real number |
Returns a product of a domain instance and a real number.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | l.h.s. domain instance |
||
real(kind=rk), | intent(in) | :: | a | r.h.s. real number |
Returns a division of a domain instance and a real number.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | l.h.s. domain instance |
||
real(kind=rk), | intent(in) | :: | a | r.h.s. real number |
Returns a sum of a real number and a domain instance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rk), | intent(in) | :: | a | l.h.s. real number |
||
class(domain_type), | intent(in) | :: | self | r.h.s. domain instance |
Returns a difference between a real number and a domain instance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rk), | intent(in) | :: | a | l.h.s. real number |
||
class(domain_type), | intent(in) | :: | self | r.h.s. domain instance |
Returns a product of a real number and a domain instance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rk), | intent(in) | :: | a | l.h.s. real number |
||
class(domain_type), | intent(in) | :: | self | r.h.s. domain instance |
Returns a product of a real number and a domain instance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rk), | intent(in) | :: | a | l.h.s. real number |
||
class(domain_type), | intent(in) | :: | self | r.h.s. domain instance |
Returns the 3-d array with values of Eulerian velocity (mean current) in x-direction [m/s].
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
Eulerian u-velocity [m/s]
Returns the 3-d array with values of Eulerian velocity (mean current) in y-direction [m/s].
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
Eulerian v-velocity [m/s]
Returns the mean water depth [m] array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
Mean water depth [m]
Returns the mean water elevation [m] array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
Mean water elevation [m]
Returns the frequency [Hz] array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
Frequency [Hz]
Returns the spectral direction bins [rad].
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
Directions [rad]
Returns the gravitational acceleration [m/s^2] array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
Gravitational acceleration [m/s^2]
Returns the grid instance that is the component of the domain.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
Grid instance component
Returns the lower bounds of the domain instance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
Lower bound indices
Returns the upper bounds of the domain instance.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
Upper bound indices
Returns the array of spectrum instances.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
Array of spectrum instances
Returns a 4-dimensional spectrum array, where the first two dimensions are frequency and directional dimensions and the second two are spatial x and y dimensions.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
||
integer(kind=ik), | intent(in), | dimension(2) | :: | halowidth | Integers indicating how many cells to allocate for halo points |
|
logical, | intent(in) | :: | periodic | If |
Spectrum array
Returns a 3-d array with phase speed values [m/s].
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
Phase speed [m/s] array
Returns a 3-d array with group speed values [m/s].
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
||
integer(kind=ik), | intent(in), | dimension(2) | :: | halowidth | Integers indicating how many cells to allocate for halo points |
|
logical, | intent(in) | :: | periodic | If |
Group speed [m/s] array
Returns grid spacing array in x-direction including halo cells.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
||
integer(kind=ik), | intent(in), | dimension(2) | :: | halowidth | Integer width of halo region |
|
logical, | intent(in) | :: | periodic | If |
Grid spacing in x [m]
Returns grid spacing array in y-direction including halo cells.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
||
integer(kind=ik), | intent(in), | dimension(2) | :: | halowidth | Integer width of halo region |
|
logical, | intent(in) | :: | periodic | If |
Grid spacing in y [m]
Returns the surface tension [N/m].
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
Surface tension [N/m]
Returns the air density [kg/m^3].
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
Air density [kg/m^3]
Returns the water density [kg/m^3].
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
Water density [kg/m^3]
Returns the spectral frequency moment of order n.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Spectrum instance |
||
integer(kind=ik), | intent(in) | :: | n | Order |
Returns the spectral frequency moment of order n.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Spectrum instance |
||
integer(kind=ik), | intent(in) | :: | n | Order |
Returns the mean wave period [s] for the whole domain.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
Mean period [s] array
Returns the zero-crossing mean wave period [s] for the whole domain.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
Mean period [s] array
Returns the significant wave height [m] for the whole domain.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self | Domain instance |
Significant wave height [m] array
Assigns a 1-d array of spectrum
instances to a domain
instance. This
procedure overloads the assignment ('=') operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(inout) | :: | self | l.h.s. |
||
class(spectrum_type), | intent(in), | dimension(:) | :: | spectrum_array | r.h.s. array of |
Assigns a 2-d array of spectrum
instances to a domain
instance. This
procedure overloads the assignment ('=') operator.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(inout) | :: | self | l.h.s. |
||
class(spectrum_type), | intent(in), | dimension(:,:) | :: | spectrum_array | r.h.s. array of |
Sets the mean water depth [m].
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(inout) | :: | self | Domain instance |
||
real(kind=rk), | intent(in), | dimension(:,:) | :: | depth | Mean water depth [m] |
Sets the mean water elevation [m].
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(inout) | :: | self | Domain instance |
||
real(kind=rk), | intent(in), | dimension(:,:) | :: | elevation | Mean water elevation [m] |
Sets the gravitational acceleration [m/s^2].
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(inout) | :: | self | Domain instance |
||
real(kind=rk), | intent(in), | dimension(:,:) | :: | grav | Gravitational acceleration [m/s^2] |
Sets the surface tension [N/m^2].
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(inout) | :: | self | Domain instance |
||
real(kind=rk), | intent(in), | dimension(:,:) | :: | surface_tension | Surface tension [N/m^2] |
Sets the air density [kg/m^3].
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(inout) | :: | self | Domain instance |
||
real(kind=rk), | intent(in), | dimension(:,:) | :: | air_density | Air density [kg/m^3] |
Sets the water density [kg/m^3].
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(inout) | :: | self | Domain instance |
||
real(kind=rk), | intent(in), | dimension(:,:) | :: | water_density | Water density [kg/m^3] |
Sets the 1-d spectrum array. This procedure is overloaded by the generic procedure setSpectrum.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(inout) | :: | self | Domain instance |
||
type(spectrum_type), | intent(in), | dimension(:) | :: | spectrum | Input 1-d array of spectrum object instances |
Sets the 2-d spectrum array. This procedure is overloaded by the generic procedure setSpectrum.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(inout) | :: | self | Domain instance |
||
type(spectrum_type), | intent(in), | dimension(:,:) | :: | spectrum | Input 2-d array of spectrum object instances |
Sets the spectrum instances based on input spectrum array. This implementation is for omnidirectional spectrum in 1-d space (1d-1d)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(inout) | :: | self | Domain instance |
||
real(kind=rk), | intent(in), | dimension(:,:) | :: | spectrum_array | Spectrum array |
Sets the spectrum instances based on input spectrum array. This implementation is for setting 1-d spectrum into 2-d physical space of 2-d spectrum into 1-d physical space.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(inout) | :: | self | Domain instance |
||
real(kind=rk), | intent(in), | dimension(:,:,:) | :: | spectrum_array | Spectrum array |
Sets the spectrum instances based on input spectrum array. This implementation is for directional spectrum in 2-d space (2d-2d)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(inout) | :: | self | Domain instance |
||
real(kind=rk), | intent(in), | dimension(:,:,:,:) | :: | spectrum_array | Spectrum array |
Writes a spectrum instance to a JSON file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(domain_type), | intent(in) | :: | self |
|
||
character(len=*), | intent(in) | :: | filename | JSON file name |
||
logical, | intent(in) | :: | minify | Logical switch to minify the JSON file |