TKE_backend class
-
class TKE_backend
- #include <TKE_backend.hpp>
TKE backend class.
It implements the part which is in common for each backend:
library frontend-backend interface
library initialization and finalization
Subclassed by TKE_cpu, TKE_gpu
Public Types
-
typedef std::shared_ptr<TKE_backend> Ptr
Public Functions
-
TKE_backend(int nproma, int nlevs, int nblocks, int vert_mix_type, int vmix_idemix_tke, int vert_cor_type, double dtime, double OceanReferenceDensity, double grav, int l_lc, double clc, double ReferencePressureIndbars, double pi)
TKE backend class constructor.
-
virtual ~TKE_backend() = default
TKE backend class destructor.
-
void calc(t_patch p_patch, t_cvmix p_cvmix, t_ocean_state ocean_state, t_atmo_fluxes atmos_fluxes, t_atmos_for_ocean p_as, t_sea_ice p_sea_ice, int edges_block_size, int edges_start_block, int edges_end_block, int edges_start_index, int edges_end_index, int cells_block_size, int cells_start_block, int cells_end_block, int cells_start_index, int cells_end_index)
TKE backend calculation.
It calls calc_impl which contains the actual implementation.
Protected Functions
-
virtual void calc_impl(t_patch p_patch, t_cvmix p_cvmix, t_ocean_state ocean_state, t_atmo_fluxes atmos_fluxes, t_atmos_for_ocean p_as, t_sea_ice p_sea_ice, int edges_block_size, int edges_start_block, int edges_end_block, int edges_start_index, int edges_end_index, int cells_block_size, int cells_start_block, int cells_end_block, int cells_start_index, int cells_end_index) = 0
Polymorphic function for the actual TKE scheme backend implementation.
-
template<template<class...> class memview, template<class, size_t> class dext, class memview_policy>
inline void fill_struct_memview(t_patch_view<memview, dext> *p_patch_view, t_patch *p_patch, int nblocks, int nlevs, int nproma) fill a structure of memory views given a structure of pointers about the grid info.
It is templated with a memview class and a dext class which define the memory view implementation and with a memview_policy which defines how to allocate and deallocate memory in the actual backend and how to create a memory view object.
-
template<template<class...> class memview, template<class, size_t> class dext, class memview_policy>
inline void fill_struct_memview(t_sea_ice_view<memview, dext> *p_sea_ice_view, t_sea_ice *p_sea_ice, int nblocks, int nproma) fill a structure of memory views given a structure of pointers about the sea ice info.
It is templated with a memview class and a dext class which define the memory view implementation and with a memview_policy which defines how to allocate and deallocate memory in the actual backend and how to create a memory view object.
-
template<template<class...> class memview, template<class, size_t> class dext, class memview_policy>
inline void fill_struct_memview(t_atmos_for_ocean_view<memview, dext> *p_as_view, t_atmos_for_ocean *p_as, int nblocks, int nproma) fill a structure of memory views given a structure of pointers about the atmosphere info.
It is templated with a memview class and a dext class which define the memory view implementation and with a memview_policy which defines how to allocate and deallocate memory in the actual backend and how to create a memory view object.
-
template<template<class...> class memview, template<class, size_t> class dext, class memview_policy>
inline void fill_struct_memview(t_atmo_fluxes_view<memview, dext> *atmos_fluxes_view, t_atmo_fluxes *atmos_fluxes, int nblocks, int nproma) fill a structure of memory views given a structure of pointers about the atmosphere fluxes info.
It is templated with a memview class and a dext class which define the memory view implementation and with a memview_policy which defines how to allocate and deallocate memory in the actual backend and how to create a memory view object.
-
template<template<class...> class memview, template<class, size_t> class dext, class memview_policy>
inline void fill_struct_memview(t_ocean_state_view<memview, dext> *ocean_state_view, t_ocean_state *ocean_state, int nblocks, int nlevs, int nproma) fill a structure of memory views given a structure of pointers about the ocean state info.
It is templated with a memview class and a dext class which define the memory view implementation and with a memview_policy which defines how to allocate and deallocate memory in the actual backend and how to create a memory view object.
-
template<template<class...> class memview, template<class, size_t> class dext, class memview_policy>
inline void fill_struct_memview(t_cvmix_view<memview, dext> *p_cvmix_view, t_cvmix *p_cvmix, int nblocks, int nlevs, int nproma) fill a structure of memory views given a structure of pointers about the cvmix info.
It is templated with a memview class and a dext class which define the memory view implementation and with a memview_policy which defines how to allocate and deallocate memory in the actual backend and how to create a memory view object.
-
template<template<class...> class memview, template<class, size_t> class dext, class memview_policy>
inline memview<double, dext<int, 1>> memview_malloc(double *field, int dim1) allocate internal memory and return a 1D memory view object of the allocated memory.
It is templated with a memview class and a dext class which define the memory view implementation and with a memview_policy which defines how to allocate and deallocate memory in the actual backend and how to create a memory view object.
-
template<template<class...> class memview, template<class, size_t> class dext, class memview_policy>
inline memview<double, dext<int, 2>> memview_malloc(double *field, int dim1, int dim2) allocate internal memory and return a 2D memory view object of the allocated memory.
It is templated with a memview class and a dext class which define the memory view implementation and with a memview_policy which defines how to allocate and deallocate memory in the actual backend and how to create a memory view object.
-
template<template<class...> class memview, template<class, size_t> class dext, class memview_policy>
inline memview<double, dext<int, 3>> memview_malloc(double *field, int dim1, int dim2, int dim3) allocate internal memory and return a 3D memory view object of the allocated memory.
It is templated with a memview class and a dext class which define the memory view implementation and with a memview_policy which defines how to allocate and deallocate memory in the actual backend and how to create a memory view object.
-
template<typename memview_policy>
inline void memview_free(double *field) deallocate internal memory.
It is templated with a memview_policy which defines how to deallocate memory in the actual backend.
-
template<template<class...> class memview, template<class, size_t> class dext, class memview_policy>
inline void internal_fields_malloc(t_tke_internal_view<memview, dext> *p_internal_view) fill the internal data structure allocating the arrays and creating memory views.
It is templated with a memview class and a dext class which define the memory view implementation and with a memview_policy which defines how to allocate and deallocate memory in the actual backend and how to create a memory view object.
-
template<typename memview_policy>
inline void internal_fields_free() free the internal data structure memory deallocating the arrays.
It is templated with a memview_policy which defines how to deallocate memory in the actual backend.
Protected Attributes
-
struct t_constant p_constant
-
struct t_constant_tke p_constant_tke
-
bool m_is_view_init
-
double *m_tke_old
-
double *m_tke_Av
-
double *m_tke_kv
-
double *m_forc_tke_surf_2D
-
double *m_dzw_stretched
-
double *m_dzt_stretched
-
double *m_Nsqr
-
double *m_Ssqr
-
double *m_a_dif
-
double *m_b_dif
-
double *m_c_dif
-
double *m_a_tri
-
double *m_b_tri
-
double *m_c_tri
-
double *m_d_tri
-
double *m_sqrttke
-
double *m_forc
-
double *m_ke
-
double *m_cp
-
double *m_dp
-
double *m_tke_upd
-
double *m_tke_unrest