@@ -45,11 +45,8 @@ void setinv_test_nlev(Ensemble *ensemble) {
4545 const int num_tracer_cnst = mam4::mo_setinv::num_tracer_cnst;
4646
4747 ColumnView tfld = haero::testing::create_column_view (nlev);
48- auto tfld_h = Kokkos::create_mirror_view (tfld);
49- ColumnView h2ovmr = haero::testing::create_column_view (nlev);
50- auto h2ovmr_h = Kokkos::create_mirror_view (h2ovmr);
48+ ColumnView qv = haero::testing::create_column_view (nlev);
5149 ColumnView pmid = haero::testing::create_column_view (nlev);
52- auto pmid_h = Kokkos::create_mirror_view (pmid);
5350
5451 View2D invariants (" invariants" , nlev, nfs);
5552 View1DHost invariants_h (" invariants_h" , nlev);
@@ -61,18 +58,18 @@ void setinv_test_nlev(Ensemble *ensemble) {
6158
6259 View2DHost c_off_h (" c_off_h" , nlev, num_tracer_cnst);
6360
61+ constexpr Real mwh2o = Constants::molec_weight_h2o;
62+ Real qv_k_in = conversions::mmr_from_vmr (h2ovmr_in, mwh2o);
63+
6464 for (int k = 0 ; k < nlev; ++k) {
65- tfld_h (k) = tfld_in;
66- h2ovmr_h (k) = h2ovmr_in;
67- pmid_h (k) = pmid_in;
6865 for (int i = 0 ; i < num_tracer_cnst; ++i) {
6966 c_off_h (k, i) = c_off_in[i];
7067 }
7168 }
7269
73- Kokkos::deep_copy (tfld, tfld_h );
74- Kokkos::deep_copy (h2ovmr, h2ovmr_h );
75- Kokkos::deep_copy (pmid, pmid_h );
70+ Kokkos::deep_copy (tfld, tfld_in );
71+ Kokkos::deep_copy (qv, qv_k_in );
72+ Kokkos::deep_copy (pmid, pmid_in );
7673 for (int i = 0 ; i < num_tracer_cnst; ++i) {
7774 const auto c_off_h_at_i = Kokkos::subview (c_off_h, Kokkos::ALL, i);
7875 Kokkos::deep_copy (c_off[i], c_off_h_at_i);
@@ -82,7 +79,7 @@ void setinv_test_nlev(Ensemble *ensemble) {
8279 auto team_policy = ThreadTeamPolicy (1u , Kokkos::AUTO);
8380 Kokkos::parallel_for (
8481 team_policy, KOKKOS_LAMBDA (const ThreadTeam &team) {
85- mam4::mo_setinv::setinv (team, invariants, tfld, h2ovmr , c_off, pmid);
82+ mam4::mo_setinv::setinv (team, invariants, tfld, qv , c_off, pmid);
8683 });
8784
8885 std::vector<Real> invariants_out (nfs);
0 commit comments