SABER
type_nicas Module Reference

Subroutines/functions list. More...

Data Types

type  nicas_type
 
interface  test_consistency
 
interface  define_test_vectors
 

Functions/Subroutines

subroutine nicas_alloc (nicas, bpar)
 Allocation. More...
 
subroutine nicas_partial_dealloc (nicas)
 Release memory (partial) More...
 
subroutine nicas_dealloc (nicas)
 Release memory (full) More...
 
subroutine nicas_read_local (nicas, mpl, nam, geom, bpar)
 Read. More...
 
subroutine nicas_write_local (nicas, mpl, nam, geom, bpar)
 Write. More...
 
subroutine nicas_read_global (nicas, mpl, nam, geom, bpar)
 Read. More...
 
subroutine nicas_write_global (nicas, mpl, nam, geom, bpar)
 Write. More...
 
subroutine nicas_write_grids (nicas, mpl, nam, bpar)
 Write. More...
 
subroutine nicas_send (nicas, mpl, geom, bpar, iproc)
 Send. More...
 
subroutine nicas_receive (nicas, mpl, geom, bpar, iproc)
 Receive. More...
 
subroutine nicas_run_nicas (nicas, mpl, rng, nam, geom, bpar, cmat)
 NICAS driver. More...
 
subroutine nicas_run_nicas_tests (nicas, mpl, rng, nam, geom, bpar, ens)
 NICAS tests driver. More...
 
subroutine nicas_alloc_cv (nicas, mpl, bpar, cv, getsizeonly)
 Allocation. More...
 
subroutine nicas_random_cv (nicas, mpl, rng, bpar, cv)
 Generate a random control vector. More...
 
subroutine nicas_apply (nicas, mpl, nam, geom, bpar, fld)
 Apply NICAS (non smoother case) More...
 
subroutine nicas_apply_sqrt (nicas, mpl, nam, geom, bpar, cv, fld)
 Apply NICAS square-root. More...
 
subroutine nicas_apply_sqrt_ad (nicas, mpl, nam, geom, bpar, fld, cv)
 Apply NICAS square-root, adjoint. More...
 
subroutine nicas_gen_ens_pert (nicas, mpl, rng, nam, geom, bpar, ne, ens)
 Randomize NICAS to generate an ensemble of perturbation. More...
 
subroutine nicas_apply_bens (nicas, mpl, nam, geom, bpar, ens, fld)
 Apply localized ensemble covariance. More...
 
subroutine nicas_test_adjoint (nicas, mpl, rng, nam, geom, bpar, ens)
 Test NICAS adjoint. More...
 
subroutine nicas_test_dirac (nicas, mpl, nam, geom, bpar, ens)
 Apply NICAS to diracs. More...
 
subroutine nicas_test_randomization (nicas, mpl, rng, nam, geom, bpar)
 Test NICAS randomization method with respect to theoretical error statistics. More...
 
subroutine nicas_test_consistency (mpl, rng, nam, geom, bpar)
 Test HDIAG-NICAS consistency with a randomization method. More...
 
subroutine nicas_test_optimality (nicas, mpl, rng, nam, geom, bpar)
 Test HDIAG localization optimality with a randomization method. More...
 
subroutine nicas_define_test_vectors (mpl, rng, nam, geom, ntest, fld)
 Define test vectors. More...
 

Variables

integer, parameter nfac_rnd = 9
 Number of ensemble size factors for randomization. More...
 
integer, parameter nfac_opt = 4
 Number of length-scale factors for optimization. More...
 
integer, parameter ntest = 50
 Number of tests. More...
 

Detailed Description

Subroutines/functions list.

Instrumentation functions NICAS data derived type

Function/Subroutine Documentation

◆ nicas_alloc()

subroutine type_nicas::nicas_alloc ( class(nicas_type), intent(inout)  nicas,
type(bpar_type), intent(in)  bpar 
)
private

Allocation.

Parameters
[in,out]nicasNICAS data
[in]bparBlock parameters

Definition at line 113 of file type_nicas.F90.

◆ nicas_alloc_cv()

subroutine type_nicas::nicas_alloc_cv ( class(nicas_type), intent(in)  nicas,
type(mpl_type), intent(inout)  mpl,
type(bpar_type), intent(in)  bpar,
type(cv_type), intent(inout)  cv,
logical, intent(in), optional  getsizeonly 
)
private

Allocation.

Parameters
[in]nicasNICAS data
[in,out]mplMPI data
[in]bparBlock parameters
[in,out]cvControl vector
[in]getsizeonlyFlag to get the control variable size only (no allocation)

Definition at line 1048 of file type_nicas.F90.

◆ nicas_apply()

subroutine type_nicas::nicas_apply ( class(nicas_type), intent(in)  nicas,
type(mpl_type), intent(inout)  mpl,
type(nam_type), intent(in)  nam,
type(geom_type), intent(in)  geom,
type(bpar_type), intent(in)  bpar,
real(kind_real), dimension(geom%nc0a,geom%nl0,nam%nv), intent(inout)  fld 
)
private

Apply NICAS (non smoother case)

Parameters
[in]nicasNICAS data
[in,out]mplMPI data
[in]namNamelist
[in]geomGeometry
[in]bparBlock parameters
[in,out]fldField

Definition at line 1179 of file type_nicas.F90.

◆ nicas_apply_bens()

subroutine type_nicas::nicas_apply_bens ( class(nicas_type), intent(in)  nicas,
type(mpl_type), intent(inout)  mpl,
type(nam_type), intent(in)  nam,
type(geom_type), intent(in)  geom,
type(bpar_type), intent(in)  bpar,
type(ens_type), intent(in)  ens,
real(kind_real), dimension(geom%nc0a,geom%nl0,nam%nv), intent(inout)  fld 
)
private

Apply localized ensemble covariance.

Parameters
[in]nicasNICAS data
[in,out]mplMPI data
[in]namNamelist
[in]geomGeometry
[in]bparBlocal parameters
[in]ensEnsemble
[in,out]fldField

Definition at line 1654 of file type_nicas.F90.

◆ nicas_apply_sqrt()

subroutine type_nicas::nicas_apply_sqrt ( class(nicas_type), intent(in)  nicas,
type(mpl_type), intent(inout)  mpl,
type(nam_type), intent(in)  nam,
type(geom_type), intent(in)  geom,
type(bpar_type), intent(in)  bpar,
type(cv_type), intent(in)  cv,
real(kind_real), dimension(geom%nc0a,geom%nl0,nam%nv), intent(out)  fld 
)
private

Apply NICAS square-root.

Parameters
[in]nicasNICAS data
[in,out]mplMPI data
[in]namNamelist
[in]geomGeometry
[in]bparBlock parameters
[in]cvControl variable
[out]fldField

Definition at line 1233 of file type_nicas.F90.

◆ nicas_apply_sqrt_ad()

subroutine type_nicas::nicas_apply_sqrt_ad ( class(nicas_type), intent(in)  nicas,
type(mpl_type), intent(inout)  mpl,
type(nam_type), intent(in)  nam,
type(geom_type), intent(in)  geom,
type(bpar_type), intent(in)  bpar,
real(kind_real), dimension(geom%nc0a,geom%nl0,nam%nv), intent(in)  fld,
type(cv_type), intent(out)  cv 
)
private

Apply NICAS square-root, adjoint.

Parameters
[in]nicasNICAS data
[in,out]mplMPI data
[in]namNamelist
[in]geomGeometry
[in]bparBlock parameters
[in]fldField
[out]cvControl variable

Definition at line 1401 of file type_nicas.F90.

◆ nicas_dealloc()

subroutine type_nicas::nicas_dealloc ( class(nicas_type), intent(inout)  nicas)
private

Release memory (full)

Parameters
[in,out]nicasNICAS data

Definition at line 193 of file type_nicas.F90.

◆ nicas_define_test_vectors()

subroutine type_nicas::nicas_define_test_vectors ( type(mpl_type), intent(inout)  mpl,
type(rng_type), intent(inout)  rng,
type(nam_type), intent(in)  nam,
type(geom_type), intent(in)  geom,
integer, intent(in)  ntest,
real(kind_real), dimension(geom%nc0a,geom%nl0,nam%nv,ntest), intent(out)  fld 
)
private

Define test vectors.

Parameters
[in,out]mplMPI data
[in,out]rngRandom number generator
[in]namNamelist
[in]geomGeometry
[in]ntestNumber of vectors
[out]fldField

Definition at line 2345 of file type_nicas.F90.

◆ nicas_gen_ens_pert()

subroutine type_nicas::nicas_gen_ens_pert ( class(nicas_type), intent(inout)  nicas,
type(mpl_type), intent(inout)  mpl,
type(rng_type), intent(inout)  rng,
type(nam_type), intent(in)  nam,
type(geom_type), intent(in)  geom,
type(bpar_type), intent(in)  bpar,
integer, intent(in)  ne,
type(ens_type), intent(inout)  ens 
)
private

Randomize NICAS to generate an ensemble of perturbation.

Parameters
[in,out]nicasNICAS data
[in,out]mplMPI data
[in,out]rngRandom number generator
[in]namNamelist
[in]geomGeometry
[in]bparBlocal parameters
[in]neNumber of members
[in,out]ensEnsemble

Definition at line 1600 of file type_nicas.F90.

◆ nicas_partial_dealloc()

subroutine type_nicas::nicas_partial_dealloc ( class(nicas_type), intent(inout)  nicas)
private

Release memory (partial)

Parameters
[in,out]nicasNICAS data

Definition at line 160 of file type_nicas.F90.

◆ nicas_random_cv()

subroutine type_nicas::nicas_random_cv ( class(nicas_type), intent(inout)  nicas,
type(mpl_type), intent(inout)  mpl,
type(rng_type), intent(inout)  rng,
type(bpar_type), intent(in)  bpar,
type(cv_type), intent(out)  cv 
)
private

Generate a random control vector.

Parameters
[in,out]nicasNICAS data
[in,out]mplMPI data
[in,out]rngRandom number generator
[in]bparBlock parameters
[out]cvControl vector

Definition at line 1110 of file type_nicas.F90.

◆ nicas_read_global()

subroutine type_nicas::nicas_read_global ( class(nicas_type), intent(inout)  nicas,
type(mpl_type), intent(inout)  mpl,
type(nam_type), intent(in)  nam,
type(geom_type), intent(in)  geom,
type(bpar_type), intent(in)  bpar 
)
private

Read.

Parameters
[in,out]nicasNICAS data
[in,out]mplMPI data
[in]namNamelist
[in]geomGeometry
[in]bparBlock parameters

Definition at line 477 of file type_nicas.F90.

◆ nicas_read_local()

subroutine type_nicas::nicas_read_local ( class(nicas_type), intent(inout)  nicas,
type(mpl_type), intent(inout)  mpl,
type(nam_type), intent(in)  nam,
type(geom_type), intent(in)  geom,
type(bpar_type), intent(in)  bpar 
)
private

Read.

Parameters
[in,out]nicasNICAS data
[in,out]mplMPI data
[in]namNamelist
[in]geomGeometry
[in]bparBlock parameters

Definition at line 227 of file type_nicas.F90.

◆ nicas_receive()

subroutine type_nicas::nicas_receive ( class(nicas_type), intent(inout)  nicas,
type(mpl_type), intent(inout)  mpl,
type(geom_type), intent(in)  geom,
type(bpar_type), intent(in)  bpar,
integer, intent(in)  iproc 
)
private

Receive.

Parameters
[in,out]nicasNICAS data
[in,out]mplMPI data
[in]geomGeometry
[in]bparBlock parameters
[in]iprocSource task

Definition at line 713 of file type_nicas.F90.

◆ nicas_run_nicas()

subroutine type_nicas::nicas_run_nicas ( class(nicas_type), intent(inout)  nicas,
type(mpl_type), intent(inout)  mpl,
type(rng_type), intent(inout)  rng,
type(nam_type), intent(inout)  nam,
type(geom_type), intent(inout)  geom,
type(bpar_type), intent(in)  bpar,
type(cmat_type), intent(in)  cmat 
)
private

NICAS driver.

Parameters
[in,out]nicasNICAS data
[in,out]mplMPI data
[in,out]rngRandom number generator
[in,out]namNamelist
[in,out]geomGeometry
[in]bparBlock parameters
[in]cmatC matrix data

Definition at line 786 of file type_nicas.F90.

◆ nicas_run_nicas_tests()

subroutine type_nicas::nicas_run_nicas_tests ( class(nicas_type), intent(inout)  nicas,
type(mpl_type), intent(inout)  mpl,
type(rng_type), intent(inout)  rng,
type(nam_type), intent(inout)  nam,
type(geom_type), intent(inout)  geom,
type(bpar_type), intent(in)  bpar,
type(ens_type), intent(in)  ens 
)
private

NICAS tests driver.

Parameters
[in,out]nicasNICAS data
[in,out]mplMPI data
[in,out]rngRandom number generator
[in,out]namNamelist
[in,out]geomGeometry
[in]bparBlock parameters
[in]ensEnsemble

Definition at line 888 of file type_nicas.F90.

◆ nicas_send()

subroutine type_nicas::nicas_send ( class(nicas_type), intent(in)  nicas,
type(mpl_type), intent(inout)  mpl,
type(geom_type), intent(in)  geom,
type(bpar_type), intent(in)  bpar,
integer, intent(in)  iproc 
)
private

Send.

Parameters
[in]nicasNICAS data
[in,out]mplMPI data
[in]geomGeometry
[in]bparBlock parameters
[in]iprocDestination task

Definition at line 632 of file type_nicas.F90.

◆ nicas_test_adjoint()

subroutine type_nicas::nicas_test_adjoint ( class(nicas_type), intent(in)  nicas,
type(mpl_type), intent(inout)  mpl,
type(rng_type), intent(inout)  rng,
type(nam_type), intent(in)  nam,
type(geom_type), intent(in)  geom,
type(bpar_type), intent(in)  bpar,
type(ens_type), intent(in)  ens 
)
private

Test NICAS adjoint.

Parameters
[in]nicasNICAS data
[in,out]mplMPI data
[in,out]rngRandom number generator
[in]namNamelist
[in]geomGeometry
[in]bparBlock parameters
[in]ensEnsemble

Definition at line 1709 of file type_nicas.F90.

◆ nicas_test_consistency()

subroutine type_nicas::nicas_test_consistency ( type(mpl_type), intent(inout)  mpl,
type(rng_type), intent(inout)  rng,
type(nam_type), intent(inout)  nam,
type(geom_type), intent(inout)  geom,
type(bpar_type), intent(in)  bpar 
)
private

Test HDIAG-NICAS consistency with a randomization method.

Parameters
[in,out]mplMPI data
[in,out]rngRandom number generator
[in,out]namNamelist variables
[in,out]geomGeometry
[in]bparBlock parameters

Definition at line 1980 of file type_nicas.F90.

◆ nicas_test_dirac()

subroutine type_nicas::nicas_test_dirac ( class(nicas_type), intent(in)  nicas,
type(mpl_type), intent(inout)  mpl,
type(nam_type), intent(in)  nam,
type(geom_type), intent(in)  geom,
type(bpar_type), intent(in)  bpar,
type(ens_type), intent(in)  ens 
)
private

Apply NICAS to diracs.

Parameters
[in]nicasNICAS data
[in,out]mplMPI data
[in]namNamelist
[in]geomGeometry
[in]bparBlock parameters
[in]ensEnsemble

Definition at line 1786 of file type_nicas.F90.

◆ nicas_test_optimality()

subroutine type_nicas::nicas_test_optimality ( class(nicas_type), intent(inout)  nicas,
type(mpl_type), intent(inout)  mpl,
type(rng_type), intent(inout)  rng,
type(nam_type), intent(inout)  nam,
type(geom_type), intent(in)  geom,
type(bpar_type), intent(in)  bpar 
)
private

Test HDIAG localization optimality with a randomization method.

Parameters
[in,out]nicasNICAS data
[in,out]mplMPI data
[in,out]rngRandom number generator
[in,out]namNamelist variables
[in]geomGeometry
[in]bparBlock parameters

Definition at line 2135 of file type_nicas.F90.

◆ nicas_test_randomization()

subroutine type_nicas::nicas_test_randomization ( class(nicas_type), intent(inout)  nicas,
type(mpl_type), intent(inout)  mpl,
type(rng_type), intent(inout)  rng,
type(nam_type), intent(inout)  nam,
type(geom_type), intent(in)  geom,
type(bpar_type), intent(in)  bpar 
)
private

Test NICAS randomization method with respect to theoretical error statistics.

Parameters
[in,out]nicasNICAS data
[in,out]mplMPI data
[in,out]rngRandom number generator
[in,out]namNamelist variables
[in]geomGeometry
[in]bparBlock parameters

Definition at line 1846 of file type_nicas.F90.

◆ nicas_write_global()

subroutine type_nicas::nicas_write_global ( class(nicas_type), intent(inout)  nicas,
type(mpl_type), intent(inout)  mpl,
type(nam_type), intent(in)  nam,
type(geom_type), intent(in)  geom,
type(bpar_type), intent(in)  bpar 
)
private

Write.

Parameters
[in,out]nicasNICAS data
[in,out]mplMPI data
[in]namNamelist
[in]geomGeometry
[in]bparBlock parameters

Definition at line 524 of file type_nicas.F90.

◆ nicas_write_grids()

subroutine type_nicas::nicas_write_grids ( class(nicas_type), intent(inout)  nicas,
type(mpl_type), intent(inout)  mpl,
type(nam_type), intent(in)  nam,
type(bpar_type), intent(in)  bpar 
)
private

Write.

Parameters
[in,out]nicasNICAS data
[in,out]mplMPI data
[in]namNamelist
[in]bparBlock parameters

Definition at line 582 of file type_nicas.F90.

◆ nicas_write_local()

subroutine type_nicas::nicas_write_local ( class(nicas_type), intent(inout)  nicas,
type(mpl_type), intent(inout)  mpl,
type(nam_type), intent(in)  nam,
type(geom_type), intent(in)  geom,
type(bpar_type), intent(in)  bpar 
)
private

Write.

Parameters
[in,out]nicasNICAS data
[in,out]mplMPI data
[in]namNamelist
[in]geomGeometry
[in]bparBlock parameters

Definition at line 364 of file type_nicas.F90.

Variable Documentation

◆ nfac_opt

integer, parameter type_nicas::nfac_opt = 4

Number of length-scale factors for optimization.

Definition at line 60 of file type_nicas.F90.

◆ nfac_rnd

integer, parameter type_nicas::nfac_rnd = 9

Number of ensemble size factors for randomization.

Definition at line 59 of file type_nicas.F90.

◆ ntest

integer, parameter type_nicas::ntest = 50

Number of tests.

Definition at line 61 of file type_nicas.F90.