Skip to content
Snippets Groups Projects
sfx_call_class_func.cpp 3 KiB
Newer Older
  • Learn to ignore specific revisions
  • 数学の武士's avatar
    数学の武士 committed
    #include <stdlib.h>
    #include <stdio.h>
    
    数学の武士's avatar
    数学の武士 committed
    #include "../includeCXX/sfx_call_class_func.h"
    
    数学の武士's avatar
    数学の武士 committed
    #include "../includeCXX/sfx_esm.h"
    
    数学の武士's avatar
    .  
    数学の武士 committed
    #include "../includeCXX/sfx_sheba.h"
    
    数学の武士's avatar
    数学の武士 committed
    #include <vector>
    
    // -------------------------------------------------------------------------- //
    
    数学の武士's avatar
    .  
    数学の武士 committed
    void surf_flux_esm_CXX (float *zeta_, float *Rib_, float *Re_, float *B_, float *z0_m_, float *z0_t_, float *Rib_conv_lim_, float *Cm_, float *Ct_, float *Km_, float *Pr_t_inv_,
    
    数学の武士's avatar
    数学の武士 committed
        float *U_, float *dT_, float *Tsemi_, float *dQ_, float *h_, float *in_z0_m_,
    
    数学の武士's avatar
    数学の武士 committed
        const float kappa, const float Pr_t_0_inv, const float Pr_t_inf_inv, 
        const float alpha_m, const float alpha_h, const float alpha_h_fix, 
        const float beta_m, const float beta_h, const float Rib_max, const float Re_rough_min, 
        const float B1_rough, const float B2_rough,
        const float B_max_land, const float B_max_ocean, const float B_max_lake,
        const float gamma_c, const float Re_visc_min,
        const float Pr_m, const float nu_air, const float g, 
        const int maxiters_charnock, const int maxiters_convection, 
        const int grid_size)
    {
    
    数学の武士's avatar
    数学の武士 committed
    #ifdef INCLUDE_CUDA
    
    数学の武士's avatar
    数学の武士 committed
        static FluxEsm<float, MemType::CPU, MemType::CPU, MemType::GPU> F;
    
    数学の武士's avatar
    数学の武士 committed
    #else
    
    数学の武士's avatar
    数学の武士 committed
        static FluxEsm<float, MemType::CPU, MemType::CPU, MemType::CPU> F;
    
    数学の武士's avatar
    数学の武士 committed
    #endif
    
    
    数学の武士's avatar
    数学の武士 committed
        F.set_params(grid_size, kappa, Pr_t_0_inv, Pr_t_inf_inv, 
        alpha_m, alpha_h, alpha_h_fix, 
        beta_m, beta_h, Rib_max, Re_rough_min, 
        B1_rough, B2_rough,
        B_max_land, B_max_ocean, B_max_lake,
        gamma_c, Re_visc_min,
        Pr_m, nu_air, g);
    
    
    数学の武士's avatar
    .  
    数学の武士 committed
        F.compute_flux_esm(zeta_, Rib_, Re_, B_, z0_m_, z0_t_, Rib_conv_lim_, Cm_, Ct_, Km_, Pr_t_inv_,
    
    数学の武士's avatar
    数学の武士 committed
        U_, dT_, Tsemi_, dQ_, h_, in_z0_m_,
        maxiters_charnock, maxiters_convection);
    
    数学の武士's avatar
    .  
    数学の武士 committed
    }
    
    void surf_flux_sheba_CXX (float *zeta_, float *Rib_, float *Re_, float *B_, float *z0_m_, float *z0_t_, float *Rib_conv_lim_, float *Cm_, float *Ct_, float *Km_, float *Pr_t_inv_,
        float *U_, float *dT_, float *Tsemi_, float *dQ_, float *h_, float *in_z0_m_,
        const float kappa, const float Pr_t_0_inv, 
        const float alpha_m, const float alpha_h, 
        const float a_m, const float a_h, 
        const float b_m, const float b_h,
        const float c_h,
        const float Re_rough_min, 
        const float B1_rough, const float B2_rough,
        const float B_max_land, const float B_max_ocean, const float B_max_lake,
        const float gamma_c, const float Re_visc_min,
        const float Pr_m, const float nu_air, const float g, 
        const int maxiters_charnock, 
        const int grid_size)
    {
    #ifdef INCLUDE_CUDA
        static FluxSheba<float, MemType::CPU, MemType::CPU, MemType::GPU> F;
    #else
        static FluxSheba<float, MemType::CPU, MemType::CPU, MemType::CPU> F;
    #endif
        F.set_params(grid_size, kappa, Pr_t_0_inv, 
        alpha_m, alpha_h, 
        a_m, a_h, 
        b_m, b_h,
        c_h,
        Re_rough_min, 
        B1_rough, B2_rough,
        B_max_land, B_max_ocean, B_max_lake,
        gamma_c, Re_visc_min,
        Pr_m, nu_air, g);
    
        F.compute_flux_sheba(zeta_, Rib_, Re_, B_, z0_m_, z0_t_, Rib_conv_lim_, Cm_, Ct_, Km_, Pr_t_inv_,
        U_, dT_, Tsemi_, dQ_, h_, in_z0_m_,
        maxiters_charnock);
    
    数学の武士's avatar
    数学の武士 committed
    }