From 2cb51e5e8261ba5c198b4e6f60f32f3f9616af3d Mon Sep 17 00:00:00 2001 From: Balwinder Singh Date: Tue, 30 Apr 2024 14:00:58 -0700 Subject: [PATCH] Fixes GPU runtime error about illegal memory access --- .../mam/eamxx_mam_aci_process_interface.cpp | 350 +----------------- .../eamxx/src/physics/mam/mam_coupling.hpp | 20 +- .../single-process/mam/aci/CMakeLists.txt | 5 +- .../tests/single-process/mam/aci/input.yaml | 13 +- 4 files changed, 31 insertions(+), 357 deletions(-) diff --git a/components/eamxx/src/physics/mam/eamxx_mam_aci_process_interface.cpp b/components/eamxx/src/physics/mam/eamxx_mam_aci_process_interface.cpp index 9e3c272ef89..64e0e3420e8 100644 --- a/components/eamxx/src/physics/mam/eamxx_mam_aci_process_interface.cpp +++ b/components/eamxx/src/physics/mam/eamxx_mam_aci_process_interface.cpp @@ -21,217 +21,6 @@ namespace scream { namespace { -void print_output(const Real w0, const Real rho, const Real tke, - const Real wsub, const Real wice, const Real wsig, - const Real naai_hom, const Real naai, const Real rpdel, - MAMAci::view_3d factnum, const Real tendnd, - MAMAci::view_2d ptend_q[mam4::aero_model::pcnst], - MAMAci::view_2d qqcw_fld_work[mam4::ndrop::ncnst_tot], - const Real hetfrz_immersion_nucleation_tend, - const Real hetfrz_contact_nucleation_tend, - const Real hetfrz_depostion_nucleation_tend, - const mam_coupling::AerosolState &dry_aero, const int kb) { - std::cout << "w0:" << w0 << std::endl; - std::cout << " rho: " << rho << std::endl; - std::cout << "TKE:" << tke << std::endl; - std::cout << "WSUB:" << wsub << std::endl; - std::cout << "WICE:" << wice << std::endl; - std::cout << "WSIG:" << wsig << std::endl; - std::cout << "naai_hom_:" << naai_hom << std::endl; - std::cout << "naai_:" << naai << std::endl; - std::cout << "rpdel_:" << rpdel << std::endl; - std::cout << "factnum_:" << factnum(0, 0, kb) << " : " << factnum(0, 1, kb) - << " : " << factnum(0, 2, kb) << " : " << factnum(0, 3, kb) - << std::endl; - std::cout << "tendnd_:" << tendnd << std::endl; - for(int ic = 9; ic < 40; ++ic) { - std::cout << "ptend_q_:" << ic << ": " << ptend_q[ic](0, kb) << std::endl; - } - for(int ic = 0; ic < 25; ++ic) { - std::cout << "qqcw_:" << ic << ": " << qqcw_fld_work[ic](0, kb) - << std::endl; - } - for(int m = 0; m < mam_coupling::num_aero_modes(); ++m) { - std::cout << "cldbrn_num:" << dry_aero.cld_aero_nmr[m](0, kb) << std::endl; - for(int a = 0; a < mam_coupling::num_aero_species(); ++a) { - if(dry_aero.cld_aero_mmr[m][a].data()) { - std::cout << "cldbrn-mmr:" << dry_aero.cld_aero_mmr[m][a](0, kb) - << std::endl; - } - } - } - - for(int m = 0; m < mam_coupling::num_aero_modes(); ++m) { - std::cout << "inter_num:" << dry_aero.int_aero_nmr[m](0, kb) << std::endl; - for(int a = 0; a < mam_coupling::num_aero_species(); ++a) { - if(dry_aero.int_aero_mmr[m][a].data()) { - std::cout << "inter-mmr:" << dry_aero.int_aero_mmr[m][a](0, kb) - << std::endl; - } - } - } - - for(int m = 0; m < mam_coupling::num_aero_modes(); ++m) { - std::cout << "cld_num:" << dry_aero.cld_aero_nmr[m](0, kb) << std::endl; - for(int a = 0; a < mam_coupling::num_aero_species(); ++a) { - if(dry_aero.cld_aero_mmr[m][a].data()) { - std::cout << "cld-mmr:" << dry_aero.cld_aero_mmr[m][a](0, kb) - << std::endl; - } - } - } - - std::cout << "hetfrz_immersion_nucleation_tend_:" - << hetfrz_immersion_nucleation_tend << ":" - << hetfrz_immersion_nucleation_tend << std::endl; - std::cout << "hetfrz_contact_nucleation_tend_:" - << hetfrz_contact_nucleation_tend << std::endl; - std::cout << "hetfrz_depostion_nucleation_tend_:" - << hetfrz_depostion_nucleation_tend << std::endl; -} - -void set_input(MAMAci::view_2d w_sec_int_, MAMAci::view_2d kvh_int_, - const int ncol_, const int nlev_) { - const Real w_sec_e3sm[73] = { - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.40000000000000002E-003, - 0.40000000000000002E-003, 0.44201892319518146E-003, - 0.77315620137962326E-003, 0.24806301482800117E-002, - 0.11109772692898754E-001, 0.40651094032490273E-001, - 0.82156694426095800E-001, 0.12207124453993526E+000, - 0.15516728994634110E+000, 0.17775318086169636E+000, - 0.18549817250146838E+000, 0.17184548286554119E+000, - 0.12741230682196053E+000, 0.65495229516041628E-001, - 0.26909155217660592E-001}; - - for(int icol = 0; icol < ncol_; ++icol) { - for(int kk = 0; kk < nlev_; ++kk) { - w_sec_int_(icol, kk) = w_sec_e3sm[kk]; - // w_sec_int_(icol, kk) = w_sec_mid_(icol, kk); - } - // w_sec_int_(icol, nlev_ + 1) = w_sec_mid_(icol, nlev_); - w_sec_int_(icol, nlev_ + 1) = w_sec_e3sm[nlev_ + 1]; - } - const Real kvh_e3sm[73] = {0.25020913575496480E-002, 0.25021052914616470E-002, - 0.75991761081225006E-002, 0.12291092068185365E-001, - 0.11484807652762415E-001, 0.10856880396302943E-001, - 0.10500384508819637E-001, 0.10361486171738229E-001, - 0.10333325067964508E-001, 0.10258838031435397E-001, - 0.10027325248446619E-001, 0.97784259072973521E-002, - 0.96611845055866539E-002, 0.96249746122327937E-002, - 0.95773431515696512E-002, 0.95180614513688099E-002, - 0.94713233348487150E-002, 0.94503864489758338E-002, - 0.94536294366578833E-002, 0.94575972194308883E-002, - 0.94403767489615684E-002, 0.93975694769176284E-002, - 0.93322843554751022E-002, 0.92777070192527501E-002, - 0.92456776697171228E-002, 0.92266924824142716E-002, - 0.92123025773060436E-002, 0.91888715633294191E-002, - 0.91516797753615851E-002, 0.90958299606649744E-002, - 0.89988037524983237E-002, 0.88220984587642423E-002, - 0.85231270833157156E-002, 0.81397522619395188E-002, - 0.79160421807845088E-002, 0.81206851117902653E-002, - 0.86526891616674779E-002, 0.91682975412125615E-002, - 0.96043394254592580E-002, 0.10033689085881327E-001, - 0.10428656694074272E-001, 0.10715913043864789E-001, - 0.10919631245454951E-001, 0.11250937075285789E-001, - 0.11829292157343831E-001, 0.12413311776454055E-001, - 0.12851317662157077E-001, 0.13175523677700330E-001, - 0.13224182907540188E-001, 0.13085937680733115E-001, - 0.12615055546741534E-001, 0.11995423733019836E-001, - 0.12346556881757400E-001, 0.13433752971524651E-001, - 0.13904308240950175E-001, 0.13539811748121957E-001, - 0.12555099320041433E-001, 0.11519643673351362E-001, - 0.11414071302852231E-001, 0.13409756835238139E-001, - 0.24071962815959351E-001, 0.75489419450816414E-001, - 0.62082011878960308E+000, 0.63952862312816796E+001, - 0.16226857944175123E+002, 0.21882852534279891E+002, - 0.24966173574402408E+002, 0.25710753126453692E+002, - 0.24069881024271943E+002, 0.19743922403487922E+002, - 0.98667814246712027E+001, 0.25633359450143991E+001, - 0.14682471685037493E+001}; - // compute eddy diffusivity of heat at the interfaces - for(int icol = 0; icol < ncol_; ++icol) { - for(int kk = 0; kk < nlev_; ++kk) { - // kvh_int_(icol, kk) = kvh_mid_(icol, kk); - kvh_int_(icol, kk) = kvh_e3sm[kk]; - } - // kvh_int_(icol, nlev_ + 1) = kvh_mid_(icol, nlev_); - kvh_int_(icol, nlev_ + 1) = kvh_e3sm[nlev_ + 1]; - } -} -void set_dgait(MAMAci::view_2d aitken_dry_dia_, const int ncol_, - const int nlev_) { - const Real dgnum_ait_e3sm[72] = { - 0.20877713336487552E-007, 0.21782230353342090E-007, - 0.21688324003865861E-007, 0.21112855042342451E-007, - 0.19162058462939536E-007, 0.18102979880838476E-007, - 0.17906980715477606E-007, 0.20271254074583327E-007, - 0.22698983422181942E-007, 0.24134835117044986E-007, - 0.25498156808001372E-007, 0.29796738799905547E-007, - 0.35822987394021908E-007, 0.41170963764365215E-007, - 0.44892726528330642E-007, 0.47217231342203107E-007, - 0.48928661807108766E-007, 0.50170939816128735E-007, - 0.51078750853732200E-007, 0.52247333465736065E-007, - 0.53190758580174931E-007, 0.53576491941850044E-007, - 0.53915614473890715E-007, 0.54510964775236826E-007, - 0.55643231691556703E-007, 0.57057811112589899E-007, - 0.58177383586181116E-007, 0.58209849180850108E-007, - 0.57976751598840998E-007, 0.52000000000000002E-007, - 0.50728746567226150E-007, 0.49119902704480870E-007, - 0.48212162162050883E-007, 0.49227715213506454E-007, - 0.46876827233752246E-007, 0.45360603896257791E-007, - 0.49986783979004747E-007, 0.51186879246229022E-007, - 0.50009353247048599E-007, 0.48250264542204811E-007, - 0.47560278748093609E-007, 0.48298089720730957E-007, - 0.49095935613468768E-007, 0.49493024126912931E-007, - 0.50250797590476007E-007, 0.51949267668322422E-007, - 0.53778727208416418E-007, 0.53563593301099588E-007, - 0.51218136771199298E-007, 0.43171429694325200E-007, - 0.39019610039033895E-007, 0.36175109143257051E-007, - 0.42731638777892750E-007, 0.38060728507221777E-007, - 0.44046323901481340E-007, 0.39216732751330010E-007, - 0.34842233953609988E-007, 0.34068804733226066E-007, - 0.30636043694263528E-007, 0.28302341686131413E-007, - 0.33023014309036320E-007, 0.34745748365385196E-007, - 0.43623545003583371E-007, 0.48206451795644064E-007, - 0.49854490325455530E-007, 0.50346335647724146E-007, - 0.50661560988561763E-007, 0.50986261962838767E-007, - 0.51256955985111086E-007, 0.51482578449096488E-007, - 0.51684364851091471E-007, 0.51849719162939729E-007}; - for(int icol = 0; icol < ncol_; ++icol) { - for(int kk = 0; kk < nlev_; ++kk) { - aitken_dry_dia_(icol, kk) = dgnum_ait_e3sm[kk]; - } - } -} - KOKKOS_INLINE_FUNCTION void compute_w0_and_rho(const haero::ThreadTeam &team, const MAMAci::const_view_2d omega, @@ -680,8 +469,9 @@ void call_function_dropmixnuc( // Construct state_q (interstitial) and qqcw (cloud borne) arrays Kokkos::parallel_for( - Kokkos::TeamThreadRange(team, 0u, mam4::ndrop::pver), + Kokkos::TeamThreadRange(team, 0u, mam4::ndrop::pver), [=](int klev) { + Real state_q_at_lev_col[mam4::aero_model::pcnst] = {}; // get state_q at a grid cell (col,lev) @@ -1039,8 +829,7 @@ void MAMAci::set_grids( // and we might need to revisit this. // Vertical velocity variance at midpoints - // add_field("w_variance", scalar3d_layout_mid, m2 / s2, grid_name); - add_field("w_variance", scalar3d_layout_int, m2 / s2, grid_name); + add_field("w_variance", scalar3d_layout_mid, m2 / s2, grid_name); // NOTE: "cldfrac_liq" is updated in SHOC. "cldfrac_liq" in C++ code is // equivalent to "alst" in the shoc_intr.F90. In the C++ code, it is used as @@ -1054,7 +843,7 @@ void MAMAci::set_grids( grid_name); // Eddy diffusivity for heat - add_field("eddy_diff_heat", scalar3d_layout_int, m2 / s, grid_name); + add_field("eddy_diff_heat", scalar3d_layout_mid, m2 / s, grid_name); // Layout for 4D (2d horiz X 1d vertical x number of modes) variables const int num_aero_modes = mam_coupling::num_aero_modes(); @@ -1421,9 +1210,6 @@ void MAMAci::initialize_impl(const RunType run_type) { // RUN_IMPL // ================================================================ void MAMAci::run_impl(const double dt) { - // FIXME: Remove set_input and print_input - set_input(w_sec_int_, kvh_int_, ncol_, nlev_); - const auto scan_policy = ekat::ExeSpaceUtils< KT::ExeSpace>::get_thread_range_parallel_scan_team_policy(ncol_, nlev_); @@ -1432,17 +1218,16 @@ void MAMAci::run_impl(const double dt) { Kokkos::parallel_for("preprocess", scan_policy, preprocess_); Kokkos::fence(); - // haero::ThreadTeamPolicy team_policy(ncol_, Kokkos::AUTO); - haero::ThreadTeamPolicy team_policy(1, Kokkos::AUTO); + haero::ThreadTeamPolicy team_policy(ncol_, Kokkos::AUTO); compute_w0_and_rho(team_policy, dry_atm_, top_lev_, nlev_, // output w0_, rho_); // Get w_sec_int_ from w_sec_mid_ - /*compute_values_at_interfaces(team_policy, w_sec_mid_, dry_atm_.dz, nlev_, + compute_values_at_interfaces(team_policy, w_sec_mid_, dry_atm_.dz, nlev_, // output - w_sec_int_);*/ + w_sec_int_); compute_tke_using_w_sec(team_policy, w_sec_int_, nlev_, // output @@ -1461,8 +1246,6 @@ void MAMAci::run_impl(const double dt) { aitken_dry_dia_); Kokkos::fence(); // wait for aitken_dry_dia_ to be computed. - // FIXME:Remove set_dgait - set_dgait(aitken_dry_dia_, ncol_, nlev_); // Compute Ice nucleation // NOTE: The Fortran version uses "ast" for cloud fraction which is @@ -1488,9 +1271,9 @@ void MAMAci::run_impl(const double dt) { Kokkos::fence(); // wait for rpdel_ to be computed. // Get kvh_int_ from kvh_mid_ - // compute_values_at_interfaces(team_policy, kvh_mid_, dry_atm_.dz, nlev_, - // // output - // kvh_int_); + compute_values_at_interfaces(team_policy, kvh_mid_, dry_atm_.dz, nlev_, + // output + kvh_int_); // Compute activated CCN number tendency (tendnd_) and updated // cloud borne aerosols (stored in a work array) and interstitial @@ -1536,122 +1319,9 @@ void MAMAci::run_impl(const double dt) { // output dry_aero_); - const int kb = 62; - print_output(w0_(0, kb), rho_(0, kb), tke_(0, kb), wsub_(0, kb), - wsubice_(0, kb), wsig_(0, kb), naai_hom_(0, kb), naai_(0, kb), - rpdel_(0, kb), factnum_, tendnd_(0, kb), ptend_q_, - qqcw_fld_work_, hetfrz_immersion_nucleation_tend_(0, kb), - hetfrz_contact_nucleation_tend_(0, kb), - hetfrz_depostion_nucleation_tend_(0, kb), dry_aero_, kb); - // call post processing to convert dry mixing ratios to wet mixing ratios Kokkos::parallel_for("postprocess", scan_policy, postprocess_); Kokkos::fence(); // wait before returning to calling function } } // namespace scream - -/* FORTRAN output - - AT THE END OF MICROP_AERO---- - ----- OUPUT AT time step: 6 6 - wo 3.343177351577457E-004 - rho: 1.28186433384113 - TKE: 1.666465903934813E-002 6.097664104873541E-002 - wsub: 0.160873967324407 - wsubi: 0.200000000000000 - wsig: 0.160873967324407 - dgnum_ait: 4.362354500358337E-008 - naai: 11464.5957222634 - naai_hom: 29838.6879763933 - factnum: 0.998556176544263 0.861689826773470 - 0.999999999974140 0.000000000000000E+000 - nctend_mixnuc: -839.404918218856 - O3_state: 7.467031959984916E-008 - H2O2_state: 9.349365721024434E-013 - H2SO4_state: 6.828290138182288E-015 - SO2_state: 5.331014679199532E-012 - DMS_state: 2.308803742493950E-012 - SOAG_state: 5.353788713507973E-012 - so4_a1_state: 2.725322171440633E-011 - pom_a1_state: 5.550204151691568E-012 - soa_a1_state: 4.265179209409266E-011 - bc_a1_state: 4.464761667085421E-013 - dst_a1_state: 4.822960238167224E-013 - ncl_a1_state: 1.572123611679146E-013 - mom_a1_state: 1.295791882646146E-014 - num_a1_state: 3113980.27259761 - so4_a2_state: 5.931234261210945E-014 - soa_a2_state: 5.442455780020074E-015 - ncl_a2_state: 1.536147864466575E-015 - mom_a2_state: 1.003300717028814E-016 - num_a2_state: 302994.843261936 - dst_a3_state: 1.680288936900572E-011 - ncl_a3_state: 2.766061699712112E-012 - so4_a3_state: 2.666433567899354E-013 - bc_a3_state: 2.232845976874488E-015 - pom_a3_state: 6.726406544964171E-015 - soa_a3_state: 5.446646976638719E-014 - mom_a3_state: 4.675942808467773E-016 - num_a3_state: 889.148316994625 - pom_a4_state: 2.796218924673357E-012 - bc_a4_state: 2.713331090178062E-013 - mom_a4_state: 1.155299651446152E-018 - num_a4_state: 2110535.03879661 - O3_tend: 0.000000000000000E+000 - H2O2_tend: 0.000000000000000E+000 - H2SO4_tend: 0.000000000000000E+000 - SO2_tend: 0.000000000000000E+000 - DMS_tend: 0.000000000000000E+000 - SOAG_tend: 0.000000000000000E+000 - so4_a1_tend: -1.384310943569190E-014 - pom_a1_tend: -2.950799002682271E-015 - soa_a1_tend: -2.283869371271150E-014 - bc_a1_tend: -2.202672700280516E-016 - dst_a1_tend: -2.194060414083922E-016 - ncl_a1_tend: -6.981124745267083E-017 - mom_a1_tend: -5.662690535048673E-018 - num_a1_tend: -1626.38730532537 - so4_a2_tend: -2.548707408341951E-017 - soa_a2_tend: -1.929990276139139E-018 - ncl_a2_tend: -6.855087738119723E-019 - mom_a2_tend: -4.571691604185304E-020 - num_a2_tend: -111.890330245159 - dst_a3_tend: -7.609611333715698E-015 - ncl_a3_tend: -1.256350252705383E-015 - so4_a3_tend: -1.320988655880598E-016 - bc_a3_tend: -1.099586316024402E-018 - pom_a3_tend: -3.309939677824050E-018 - soa_a3_tend: -2.767668335981830E-017 - mom_a3_tend: -2.254911604324925E-019 - num_a3_tend: -0.406788905791186 - pom_a4_tend: -2.375070578317096E-017 - bc_a4_tend: 4.082479713528180E-017 - mom_a4_tend: -4.901356204764327E-023 - num_a4_tend: -34.4232851017138 - At the end:num_c1 1322558.40616450 - At the end:so4_c1 1.233997159684093E-011 - At the end:pom_c1 2.393397505793018E-012 - At the end:soa_c1 1.872520079842212E-011 - At the end:bc_c1 1.922157644491776E-013 - At the end:dst_c1 2.530385880698310E-013 - At the end:ncl_c1 8.315014074126540E-014 - At the end:mom_c1 6.895143982427237E-015 - At the end:num_c2 142214.467855250 - At the end:so4_c2 3.181118913367564E-014 - At the end:soa_c2 2.996638282752921E-015 - At the end:ncl_c2 8.055333842809433E-016 - At the end:mom_c2 5.202632275847699E-017 - At the end:num_c3 464.524744048298 - At the end:dst_c3 8.814810290885256E-012 - At the end:ncl_c3 1.417415096039318E-012 - At the end:so4_c3 1.284022582681906E-013 - At the end:bc_c3 1.081226492056768E-015 - At the end:pom_c3 3.292708392236485E-015 - At the end:soa_c3 2.584587804061707E-014 - At the end:mom_c3 2.324887367507579E-016 - At the end:num_c4 6.934165370527951E-014 - At the end:pom_c4 2.703924752644086E-026 - At the end:bc_c4 3.684880329580097E-027 - At the end:mom_c4 1.049556651713384E-032 -*/ \ No newline at end of file diff --git a/components/eamxx/src/physics/mam/mam_coupling.hpp b/components/eamxx/src/physics/mam/mam_coupling.hpp index 3be0abc2d63..ae8c84210b5 100644 --- a/components/eamxx/src/physics/mam/mam_coupling.hpp +++ b/components/eamxx/src/physics/mam/mam_coupling.hpp @@ -646,11 +646,11 @@ void compute_dry_mixing_ratios(const Team& team, int i = column_index; Kokkos::parallel_for(Kokkos::TeamVectorRange(team, nlev), [&] (const int k) { const auto qv_ik = wet_atm.qv(i,k); - dry_atm.qv(i,k) = wet_atm.qv(i,k);//PF::calculate_drymmr_from_wetmmr(wet_atm.qv(i,k), qv_ik); - dry_atm.qc(i,k) = wet_atm.qc(i,k);//PF::calculate_drymmr_from_wetmmr(wet_atm.qc(i,k), qv_ik); - dry_atm.nc(i,k) = wet_atm.nc(i,k);//PF::calculate_drymmr_from_wetmmr(wet_atm.nc(i,k), qv_ik); - dry_atm.qi(i,k) = wet_atm.qi(i,k);//PF::calculate_drymmr_from_wetmmr(wet_atm.qi(i,k), qv_ik); - dry_atm.ni(i,k) = wet_atm.ni(i,k);//PF::calculate_drymmr_from_wetmmr(wet_atm.ni(i,k), qv_ik); + dry_atm.qv(i,k) = PF::calculate_drymmr_from_wetmmr(wet_atm.qv(i,k), qv_ik); + dry_atm.qc(i,k) = PF::calculate_drymmr_from_wetmmr(wet_atm.qc(i,k), qv_ik); + dry_atm.nc(i,k) = PF::calculate_drymmr_from_wetmmr(wet_atm.nc(i,k), qv_ik); + dry_atm.qi(i,k) = PF::calculate_drymmr_from_wetmmr(wet_atm.qi(i,k), qv_ik); + dry_atm.ni(i,k) = PF::calculate_drymmr_from_wetmmr(wet_atm.ni(i,k), qv_ik); }); } @@ -671,21 +671,21 @@ void compute_dry_mixing_ratios(const Team& team, Kokkos::parallel_for(Kokkos::TeamVectorRange(team, nlev), [&] (const int k) { const auto qv_ik = wet_atm.qv(i,k); for (int m = 0; m < num_aero_modes(); ++m) { - dry_aero.int_aero_nmr[m](i,k) = wet_aero.int_aero_nmr[m](i,k);//PF::calculate_drymmr_from_wetmmr(wet_aero.int_aero_nmr[m](i,k), qv_ik); + dry_aero.int_aero_nmr[m](i,k) = PF::calculate_drymmr_from_wetmmr(wet_aero.int_aero_nmr[m](i,k), qv_ik); if (dry_aero.cld_aero_nmr[m].data()) { - dry_aero.cld_aero_nmr[m](i,k) = wet_aero.cld_aero_nmr[m](i,k);//PF::calculate_drymmr_from_wetmmr(wet_aero.cld_aero_nmr[m](i,k), qv_ik); + dry_aero.cld_aero_nmr[m](i,k) = PF::calculate_drymmr_from_wetmmr(wet_aero.cld_aero_nmr[m](i,k), qv_ik); } for (int a = 0; a < num_aero_species(); ++a) { if (dry_aero.int_aero_mmr[m][a].data()) { - dry_aero.int_aero_mmr[m][a](i,k) = wet_aero.int_aero_mmr[m][a](i,k);//PF::calculate_drymmr_from_wetmmr(wet_aero.int_aero_mmr[m][a](i,k), qv_ik); + dry_aero.int_aero_mmr[m][a](i,k) = PF::calculate_drymmr_from_wetmmr(wet_aero.int_aero_mmr[m][a](i,k), qv_ik); } if (dry_aero.cld_aero_mmr[m][a].data()) { - dry_aero.cld_aero_mmr[m][a](i,k) = wet_aero.cld_aero_mmr[m][a](i,k);//PF::calculate_drymmr_from_wetmmr(wet_aero.cld_aero_mmr[m][a](i,k), qv_ik); + dry_aero.cld_aero_mmr[m][a](i,k) = PF::calculate_drymmr_from_wetmmr(wet_aero.cld_aero_mmr[m][a](i,k), qv_ik); } } } for (int g = 0; g < num_aero_gases(); ++g) { - dry_aero.gas_mmr[g](i,k) = wet_aero.gas_mmr[g](i,k);//PF::calculate_drymmr_from_wetmmr(wet_aero.gas_mmr[g](i,k), qv_ik); + dry_aero.gas_mmr[g](i,k) = PF::calculate_drymmr_from_wetmmr(wet_aero.gas_mmr[g](i,k), qv_ik); } }); } diff --git a/components/eamxx/tests/single-process/mam/aci/CMakeLists.txt b/components/eamxx/tests/single-process/mam/aci/CMakeLists.txt index 7d77ba718fe..8c5028828bb 100644 --- a/components/eamxx/tests/single-process/mam/aci/CMakeLists.txt +++ b/components/eamxx/tests/single-process/mam/aci/CMakeLists.txt @@ -12,8 +12,7 @@ CreateADUnitTest(${TEST_BASE_NAME} ) # Set AD configurable options -#SetVarDependingOnTestSize(NUM_STEPS 12 24 36) -SetVarDependingOnTestSize(NUM_STEPS 1 1 1) +SetVarDependingOnTestSize(NUM_STEPS 12 24 36) set (ATM_TIME_STEP 600) set (RUN_T0 2021-10-12-45000) @@ -43,4 +42,4 @@ if (SCREAM_ENABLE_BASELINE_TESTS) # Note: one is enough, since we already check that np1 is BFB with npX set (OUT_FILE ${TEST_BASE_NAME}_output.INSTANT.nsteps_x2.np${TEST_RANK_END}.${RUN_T0}.nc) CreateBaselineTest(${TEST_BASE_NAME} ${TEST_RANK_END} ${OUT_FILE} ${FIXTURES_BASE_NAME}) -endif() \ No newline at end of file +endif() diff --git a/components/eamxx/tests/single-process/mam/aci/input.yaml b/components/eamxx/tests/single-process/mam/aci/input.yaml index dd164585b6b..fe26d828d41 100644 --- a/components/eamxx/tests/single-process/mam/aci/input.yaml +++ b/components/eamxx/tests/single-process/mam/aci/input.yaml @@ -26,14 +26,19 @@ grids_manager: initial_conditions: # The name of the file containing the initial conditions for this test. - Filename: /qfs/people/sing201/delete/screami_unit_tests_mam4xx_ne2np4L72_LAT_71p9201421331276_LON_286p572525837053.nc + Filename: ${SCREAM_DATA_DIR}/init/${EAMxx_tests_IC_FILE_MAM4xx_72lev} topography_filename: ${TOPO_DATA_DIR}/${EAMxx_tests_TOPO_FILE} phis : 1.0 #These should come from the input file - pbl_height: 1.0 - dgnum: 0.1 + + #we should get the following variables from other processes + pbl_height : 1.0 + dgnum: 4.362354500358337E-008 + cldfrac_liq_prev: 0.138584624960092 + eddy_diff_heat: 0.620820118789603 + w_variance: 1.110977269289875E-002 # The parameters for I/O control Scorpio: output_yaml_files: ["output.yaml"] -... \ No newline at end of file +...