Skip to content

Commit 679cebf

Browse files
committed
Merge branch 'origin/oksanaguba/homme/xx-ttype9' into master (PR #4682)
Adding ttype9 and dcmip2012 tests 2.1, 2.2, and 3 to the bfb suite. Converting some of the tests to ttype9. Not yet added is a limiter call between ttype9 stages. There will be another PR to move limiter from CaarFunctorImpl and to verify it is bfb with F code. [nonbfb] for homme bfb suite for theta-fhs3 (now with ttype9) and new baselines for theta-fdc tests.
2 parents 7e954ba + 5af86a4 commit 679cebf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+533
-143
lines changed

components/homme/src/preqx_kokkos/cxx/HyperviscosityFunctorImpl.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "SimulationParams.hpp"
1212
#include "KernelVariables.hpp"
1313
#include "SphereOperators.hpp"
14+
#include "PhysicalConstants.hpp"
1415

1516
#include <memory>
1617

components/homme/src/preqx_kokkos/cxx/cxx_f90_interface_preqx.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ void init_simulation_params_c (const int& remap_alg, const int& limiter_option,
3939
const int& hypervis_order, const int& hypervis_subcycle, const double& hypervis_scaling,
4040
const int& ftype, const bool& prescribed_wind, const bool& moisture, const bool& disable_diagnostics,
4141
const bool& use_cpstar, const int& transport_alg,
42-
const int& dt_remap_factor, const int& dt_tracer_factor)
42+
const int& dt_remap_factor, const int& dt_tracer_factor,
43+
const double& rearth)
4344
{
4445
// Check that the simulation options are supported. This helps us in the future, since we
4546
// are currently 'assuming' some option have/not have certain values. As we support for more
@@ -68,7 +69,7 @@ void init_simulation_params_c (const int& remap_alg, const int& limiter_option,
6869
params.remap_alg = RemapAlg::PPM_FIXED_MEANS;
6970
}
7071
if (time_step_type==5) {
71-
params.time_step_type = TimeStepType::ULLRICH_RK35;;
72+
params.time_step_type = TimeStepType::ttype5;
7273
}
7374

7475
params.limiter_option = limiter_option;
@@ -92,6 +93,7 @@ void init_simulation_params_c (const int& remap_alg, const int& limiter_option,
9293
params.moisture = (moisture ? MoistDry::MOIST : MoistDry::DRY);
9394
params.use_cpstar = use_cpstar;
9495
params.transport_alg = transport_alg;
96+
params.rearth = rearth;
9597

9698
//set nu_ratios values
9799
if (params.nu != params.nu_div) {
@@ -236,7 +238,7 @@ void init_elements_c (const int& num_elems)
236238
const SimulationParams& params = c.get<SimulationParams>();
237239

238240
const bool consthv = (params.hypervis_scaling==0.0);
239-
e.init (num_elems, consthv, /* alloc_gradphis = */ false);
241+
e.init (num_elems, consthv, /* alloc_gradphis = */ false, params.rearth);
240242

241243
// Init also the tracers structure
242244
Tracers& t = c.create<Tracers> ();

components/homme/src/preqx_kokkos/cxx/prim_advance_exp.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void prim_advance_exp (TimeLevel& tl, const Real dt, const bool compute_diagnost
5151

5252
// Perform time-advance
5353
switch (params.time_step_type) {
54-
case TimeStepType::ULLRICH_RK35:
54+
case TimeStepType::ttype5:
5555
// Perform RK stages
5656
u3_5stage_timestep(tl, dt, eta_ave_w);
5757
break;
@@ -71,13 +71,11 @@ void prim_advance_exp (TimeLevel& tl, const Real dt, const bool compute_diagnost
7171
}
7272
#endif
7373

74-
if (!is_implicit(params.time_step_type)) {
75-
// Get and run the HVF
76-
HyperviscosityFunctor& functor = Context::singleton().get<HyperviscosityFunctor>();
77-
GPTLstart("tl-ae advance_hypervis_dp");
78-
functor.run(tl.np1,dt,eta_ave_w);
79-
GPTLstop("tl-ae advance_hypervis_dp");
80-
}
74+
// Get and run the HVF
75+
HyperviscosityFunctor& functor = Context::singleton().get<HyperviscosityFunctor>();
76+
GPTLstart("tl-ae advance_hypervis_dp");
77+
functor.run(tl.np1,dt,eta_ave_w);
78+
GPTLstop("tl-ae advance_hypervis_dp");
8179

8280
#ifdef ENERGY_DIAGNOSTICS
8381
if (compute_diagnostics) {

components/homme/src/preqx_kokkos/preqx_f2c_mod.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ subroutine init_simulation_params_c (remap_alg, limiter_option, rsplit, qsplit,
1212
hypervis_order, hypervis_subcycle, hypervis_scaling, &
1313
ftype, prescribed_wind, moisture, &
1414
disable_diagnostics, use_cpstar, transport_alg, &
15-
dt_remap_factor, dt_tracer_factor) bind(c)
15+
dt_remap_factor, dt_tracer_factor, rearth) bind(c)
1616
use iso_c_binding, only: c_int, c_bool, c_double, c_ptr
1717
!
1818
! Inputs
1919
!
2020
integer(kind=c_int), intent(in) :: remap_alg, limiter_option, rsplit, qsplit, time_step_type
2121
integer(kind=c_int), intent(in) :: state_frequency, qsize, dt_remap_factor, dt_tracer_factor
22-
real(kind=c_double), intent(in) :: nu, nu_p, nu_q, nu_s, nu_div, nu_top, hypervis_scaling
22+
real(kind=c_double), intent(in) :: nu, nu_p, nu_q, nu_s, nu_div, nu_top, hypervis_scaling, rearth
2323
integer(kind=c_int), intent(in) :: hypervis_order, hypervis_subcycle, ftype, transport_alg
2424
logical(kind=c_bool), intent(in) :: prescribed_wind, moisture, disable_diagnostics, use_cpstar
2525
end subroutine init_simulation_params_c

components/homme/src/preqx_kokkos/prim_driver_mod.F90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module prim_driver_mod
88
use element_mod, only : element_t
99
use prim_driver_base, only : deriv1, smooth_topo_datasets
1010
use prim_cxx_driver_base, only : prim_init1, prim_finalize
11+
use physical_constants, only : rearth
1112

1213
implicit none
1314

@@ -88,7 +89,7 @@ subroutine prim_create_c_data_structures (tl, hvcoord, mp)
8889
LOGICAL(disable_diagnostics,c_bool), &
8990
LOGICAL(use_cpstar==1,c_bool), &
9091
transport_alg, &
91-
dt_remap_factor, dt_tracer_factor)
92+
dt_remap_factor, dt_tracer_factor, rearth)
9293

9394
! Initialize time level structure in C++
9495
call init_time_level_c(tl%nm1, tl%n0, tl%np1, tl%nstep, tl%nstep0)

components/homme/src/share/cxx/ComposeTransportImplTrajectory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ void ComposeTransportImpl::calc_trajectory (const int np1, const Real dt) {
435435
const int num_phys_lev = this->num_phys_lev;
436436
const auto m_sphere_cart = geo.m_sphere_cart;
437437
//todo get scale_factor into PhysicalConstants
438-
const auto scale_factor = m_data.geometry_type == 1 ? 1 : PhysicalConstants::rearth;
438+
const auto scale_factor = m_data.geometry_type == 1 ? 1 : geo.m_rearth;
439439
const auto m_dep_pts = m_data.dep_pts;
440440
const auto calc_departure_point = KOKKOS_LAMBDA (const MT& team) {
441441
KernelVariables kv(team, tu_ne);

components/homme/src/share/cxx/Elements.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
namespace Homme {
1414

1515
void Elements::init(const int num_elems, const bool consthv, const bool alloc_gradphis,
16+
const Real rearth,
1617
const bool alloc_sphere_coords) {
1718
// Sanity check
1819
assert (num_elems>0);
1920

2021
m_num_elems = num_elems;
2122

22-
m_geometry.init(num_elems,consthv,alloc_gradphis,alloc_sphere_coords);
23+
m_geometry.init(num_elems,consthv,alloc_gradphis,rearth,alloc_sphere_coords);
2324
m_state.init(num_elems);
2425
m_derived.init(num_elems);
2526
m_forcing.init(num_elems);

components/homme/src/share/cxx/Elements.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ class Elements {
4242
int num_elems () const { return m_num_elems; }
4343

4444
void init (const int num_elems, const bool consthv, const bool alloc_gradphis,
45+
const Real rearth,
4546
const bool alloc_sphere_coords=false);
4647
void randomize (const int seed, const Real max_pressure = 1.0);
4748
void randomize (const int seed, const Real max_pressure, const Real ps0, const Real hyai0);

components/homme/src/share/cxx/ElementsGeometry.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,17 @@
1717
namespace Homme {
1818

1919
void ElementsGeometry::init(const int num_elems, const bool consthv, const bool alloc_gradphis,
20+
const Real rearth,
2021
const bool alloc_sphere_coords) {
2122
// Sanity check
2223
assert (num_elems>0);
2324

2425
m_num_elems = num_elems;
2526
m_consthv = consthv;
2627

28+
assert( rearth > 0);
29+
m_rearth = rearth;
30+
2731
// Coriolis force
2832
m_fcor = ExecViewManaged<Real * [NP][NP]>("FCOR", m_num_elems);
2933

components/homme/src/share/cxx/ElementsGeometry.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ class ElementsGeometry {
4848

4949
ElementsGeometry() : m_num_elems(0) {}
5050

51+
Real m_rearth;
52+
5153
void init (const int num_elems, const bool consthv, const bool alloc_gradphis,
54+
const Real rearth,
5255
const bool alloc_sphere_coords=false);
5356

5457
void randomize (const int seed);
@@ -69,7 +72,7 @@ class ElementsGeometry {
6972

7073
private:
7174
bool m_consthv;
72-
int m_num_elems;
75+
int m_num_elems;
7376
};
7477

7578
} // Homme

0 commit comments

Comments
 (0)