Spectral partitioning according to the watershed method. More...
Functions/Subroutines | |
| subroutine | w3part (SPEC, UABS, UDIR, DEPTH, WN, NP, XP, DIMXP) |
| Interface to watershed partitioning routines. More... | |
| subroutine | ptsort (IMI, IND, IHMAX) |
| Sorts the image data in ascending order. More... | |
| subroutine | ptnghb |
| Nearest neighbour calculation. More... | |
| subroutine | pt_fld (IMI, IND, IMO, ZP, NPART) |
| Image watersheding. More... | |
| subroutine | ptmean (NPI, IMO, ZP, DEPTH, UABS, UDIR, WN, NPO, XP, DIMXP, PMAP) |
| Compute mean parameters per partition. More... | |
Spectral partitioning according to the watershed method.
Multiple partitioning methods are provided in this module that can be selected via the PTMETH namelist variable. Please see the w3part() subroutine for details
| subroutine w3partmd::pt_fld | ( | integer, dimension(nspec), intent(in) | IMI, |
| integer, dimension(nspec), intent(in) | IND, | ||
| integer, dimension(nspec), intent(out) | IMO, | ||
| real, dimension(nspec), intent(in) | ZP, | ||
| integer, intent(out) | NPART | ||
| ) |
Image watersheding.
This subroutine does incremental flooding of the image to determine the watershed image.
| [in] | IMI | Input discretized spectrum |
| [in] | IND | Sorted addresses |
| [out] | IMO | Output partitioned spectrum |
| [in] | ZP | Spectral array |
| [out] | NPART | Number of partitions found |
Definition at line 841 of file w3partmd.F90.
References fifo_add(), fifo_empty(), fifo_first(), w3odatmd::ihmax, w3gdatmd::nspec, and w3servmd::strace().
Referenced by w3part().
| subroutine w3partmd::ptmean | ( | integer, intent(in) | NPI, |
| integer, dimension(nspec), intent(in) | IMO, | ||
| real, dimension(nspec), intent(in) | ZP, | ||
| real, intent(in) | DEPTH, | ||
| real, intent(in) | UABS, | ||
| real, intent(in) | UDIR, | ||
| real, dimension(nk), intent(in) | WN, | ||
| integer, intent(out) | NPO, | ||
| real, dimension(dimp,0:dimxp), intent(out) | XP, | ||
| integer, intent(in) | DIMXP, | ||
| integer, dimension(dimxp), intent(out) | PMAP | ||
| ) |
Compute mean parameters per partition.
| [in] | NPI | Number of partitions found. |
| [in] | IMO | Partition map. |
| [in] | ZP | Input spectrum. |
| [in] | DEPTH | Water depth. |
| [in] | UABS | Wind speed. |
| [in] | UDIR | Wind direction. |
| [in] | WN | Wavenumebers for each frequency. |
| [out] | NPO | Number of partitions with mean parameters. |
| [out] | XP | Array with output parameters. |
| [in] | DIMXP | Second dimension of XP. |
| [out] | PMAP | Mapping between orig. and combined partitions |
Definition at line 1178 of file w3partmd.F90.
References constants::dera, w3gdatmd::dsii, w3gdatmd::dsip, w3gdatmd::dth, w3gdatmd::ecos, w3gdatmd::esin, w3gdatmd::fachfe, w3gdatmd::fte, w3odatmd::iaproc, w3odatmd::naperr, w3odatmd::ndse, w3odatmd::ndst, w3gdatmd::nk, w3gdatmd::nspec, w3gdatmd::nth, constants::rade, w3gdatmd::sig, w3servmd::strace(), w3gdatmd::th, constants::tpi, constants::tpiinv, constants::undef, w3dispmd::wavnu1(), and w3gdatmd::xfr.
Referenced by w3part().
| subroutine w3partmd::ptnghb |
Nearest neighbour calculation.
Computes the nearest neighbors for each grid point. Wrapping of directional distribution (0 to 360) is taken care of using the nearest neighbor system
| [in] | IMI | Input discretized spectrum |
| [out] | IMD | Sorted data |
| [in] | IHMAX | Number of integer levels |
Definition at line 632 of file w3partmd.F90.
References w3gdatmd::nk, w3gdatmd::nspec, w3gdatmd::nth, and w3servmd::strace().
Referenced by w3part().
| subroutine w3partmd::ptsort | ( | integer, dimension(nspec), intent(in) | IMI, |
| integer, dimension(nspec), intent(out) | IND, | ||
| integer, intent(in) | IHMAX | ||
| ) |
Sorts the image data in ascending order.
This sort original to F. T. Tracy (2006)
| [in] | IMI | Input discretized spectrum |
| [out] | IND | Sorted data |
| [in] | IHMAX | Number of integer levels |
Definition at line 513 of file w3partmd.F90.
References w3gdatmd::nspec, and w3servmd::strace().
Referenced by w3part().
| subroutine w3partmd::w3part | ( | real, dimension(nk,nth), intent(in) | SPEC, |
| real, intent(in) | UABS, | ||
| real, intent(in) | UDIR, | ||
| real, intent(in) | DEPTH, | ||
| real, dimension(nk), intent(in) | WN, | ||
| integer, intent(out) | NP, | ||
| real, dimension(dimp,0:dimxp), intent(out) | XP, | ||
| integer, intent(in) | DIMXP | ||
| ) |
Interface to watershed partitioning routines.
Watershed Algorithm of Vincent and Soille, 1991, implemented by Barbara Tracy (USACE/ERDC) for NOAA/NCEP.
This version of W3PART contains alternate Met Office partitioning methods, selected at runtime using the PTMETH namlist variable:
PTFCUT).DIMXP will always be of size 2 when using PTMETH 4 or 5.DIMXP = ((NK+1)/2) * ((NTH-1)/2) unless specified otherwise below.| [in] | SPEC | 2-D spectrum E(f,theta) |
| [in] | UABS | Wind speed |
| [in] | UDIR | Wind direction |
| [in] | DEPTH | Water depth |
| [in] | WN | Wavenumebers for each frequency |
| [out] | NP | Number of partitions found (-1=Spectrum without minumum energy; 0=Spectrum with minumum energy but no partitions) |
| [out] | XP | Parameters describing partitions. Entry '0' contains entire spectrum |
| [in] | DIMXP | Second dimension of XP |
Definition at line 139 of file w3partmd.F90.
References constants::dera, w3odatmd::flcomb, w3gdatmd::nk, w3gdatmd::nspec, w3gdatmd::nth, pt_fld(), ptmean(), ptnghb(), ptsort(), w3gdatmd::sig, w3servmd::strace(), w3gdatmd::th, constants::tpi, and w3odatmd::wscut.
Referenced by w3iosfmd::w3cprt(), w3exnc(), and w3expo().