ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
PBLDerivativeDzInv_S Struct Reference

Functor for inverse vertical spacings for stretched grids using a spacing array. More...

#include <ERF_PBLModels.H>

Collaboration diagram for PBLDerivativeDzInv_S:

Public Member Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE PBLDerivativeDzInv operator() (int, int, int k) const noexcept
 

Public Attributes

const amrex::Real * dz
 
int klo
 
int khi
 

Detailed Description

Functor for inverse vertical spacings for stretched grids using a spacing array.

Member Function Documentation

◆ operator()()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE PBLDerivativeDzInv PBLDerivativeDzInv_S::operator() ( int  ,
int  ,
int  k 
) const
inlinenoexcept

Return inverse vertical spacings for stretched grids.

Parameters
kz-index
Returns
PBLDerivativeDzInv inverse spacing values
638  {
639  // Adjacent cell centers are separated by half the sum of their widths.
640  const amrex::Real dz_lo = dz[(k > klo) ? k-1 : k];
641  const amrex::Real dz_hi = dz[(k < khi) ? k+1 : k];
642  return {two / (dz_lo + two*dz[k] + dz_hi),
643  two / dz[k],
644  two / dz[k]};
645  }
constexpr amrex::Real two
Definition: ERF_NumericalConstants.H:38
const amrex::Real * dz
Definition: ERF_PBLModels.H:627
int klo
Definition: ERF_PBLModels.H:628
int khi
Definition: ERF_PBLModels.H:629

Member Data Documentation

◆ dz

const amrex::Real* PBLDerivativeDzInv_S::dz

Referenced by operator()().

◆ khi

int PBLDerivativeDzInv_S::khi

Referenced by operator()().

◆ klo

int PBLDerivativeDzInv_S::klo

Referenced by operator()().


The documentation for this struct was generated from the following file: