Skip to content

Commit 7945125

Browse files
authored
Merge pull request #3050 from eagles-project/singhbalwinder/read-frac-land-use-file
Adds capability to read fractional land use file in MAM4 dry deposition
2 parents 0bf8e42 + 0b91276 commit 7945125

File tree

18 files changed

+322
-74
lines changed

18 files changed

+322
-74
lines changed

components/eamxx/cime_config/namelist_defaults_scream.xml

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ be lost if SCREAM_HACK_XML is not enabled.
3737
<selector name="hgrid" case_env="ATM_GRID"/>
3838
<selector name="dyn" case_env="CAM_TARGET"/>
3939
<selector name="nlev" case_env="SCREAM_CMAKE_OPTIONS" regex=".*SCREAM_NUM_VERTICAL_LEV ([0-9]+).*"/>
40+
<selector name="ntracers" case_env="SCREAM_CMAKE_OPTIONS" regex=".*SCREAM_NUM_TRACERS ([0-9]+).*"/>
41+
4042
</selectors>
4143

4244
<!-- List of scream grids for a given compset. I/O can only happen on these grids -->
@@ -250,7 +252,17 @@ be lost if SCREAM_HACK_XML is not enabled.
250252
</mam4_aci>
251253

252254
<!-- MAM4xx-Dry Deposition -->
253-
<mam4_drydep inherit="atm_proc_base" />
255+
<mam4_drydep inherit="atm_proc_base">
256+
<fractional_land_use_file type="file" doc="File containing Fractional land use data for drydep">${DIN_LOC_ROOT}/atm/scream/mam4xx/drydep/ne30pg2/atmsrf_ne30pg2_c20241017.nc</fractional_land_use_file>
257+
<fractional_land_use_file hgrid="ne4np4.pg2" type="file" doc="File containing Fractional land use data for drydep">${DIN_LOC_ROOT}/atm/scream/mam4xx/drydep/ne4pg2/atmsrf_ne4pg2_c20241017.nc</fractional_land_use_file>
258+
259+
<!-- Mapping Files for finer resolutions -->
260+
<drydep_remap_file type="file" doc="File containing mapping data from the grid of frac land use files to the model grid. Unused if the grid is the same."/>
261+
<drydep_remap_file hgrid="ne120np4.pg2">${DIN_LOC_ROOT}/atm/scream/maps/map_ne30pg2_to_ne120pg2_20231201.nc</drydep_remap_file>
262+
<drydep_remap_file hgrid="ne256np4.pg2">${DIN_LOC_ROOT}/atm/scream/maps/map_ne30pg2_to_ne256pg2_20231201.nc</drydep_remap_file>
263+
<drydep_remap_file hgrid="ne512np4.pg2">${DIN_LOC_ROOT}/atm/scream/maps/map_ne30pg2_to_ne512pg2_20231201.nc</drydep_remap_file>
264+
<drydep_remap_file hgrid="ne1024np4.pg2">${DIN_LOC_ROOT}/atm/scream/maps/map_ne30pg2_to_ne1024pg2_20231201.nc</drydep_remap_file>
265+
</mam4_drydep>
254266

255267
<!-- CLD fraction -->
256268
<cldFraction inherit="atm_proc_base"/>
@@ -278,15 +290,6 @@ be lost if SCREAM_HACK_XML is not enabled.
278290
<!-- MAM4xx-Surface-Emissions -->
279291
<mam4_srf_online_emiss inherit="atm_proc_base">
280292

281-
<srf_emis_specifier_for_DMS hgrid="ne4np4.pg2" type="file" doc="File containing surface emissions data for DMS">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne4pg2/surface/DMSflux.2010.ne4pg2_conserv.POPmonthlyClimFromACES4BGC_c20240814.nc</srf_emis_specifier_for_DMS>
282-
<srf_emis_specifier_for_SO2 hgrid="ne4np4.pg2" type="file" doc="File containing surface emissions data for SO2">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne4pg2/surface/cmip6_mam4_so2_surf_ne4pg2_2010_clim_c20240815.nc</srf_emis_specifier_for_SO2>
283-
<srf_emis_specifier_for_bc_a4 hgrid="ne4np4.pg2" type="file" doc="File containing surface emissions data for bc_a4">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne4pg2/surface/cmip6_mam4_bc_a4_surf_ne4pg2_2010_clim_c20240815.nc</srf_emis_specifier_for_bc_a4>
284-
<srf_emis_specifier_for_num_a1 hgrid="ne4np4.pg2" type="file" doc="File containing surface emissions data for num_a1">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne4pg2/surface/cmip6_mam4_num_a1_surf_ne4pg2_2010_clim_c20240815.nc</srf_emis_specifier_for_num_a1>
285-
<srf_emis_specifier_for_num_a2 hgrid="ne4np4.pg2" type="file" doc="File containing surface emissions data for num_a2">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne4pg2/surface/cmip6_mam4_num_a2_surf_ne4pg2_2010_clim_c20240815.nc</srf_emis_specifier_for_num_a2>
286-
<srf_emis_specifier_for_num_a4 hgrid="ne4np4.pg2" type="file" doc="File containing surface emissions data for num_a4">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne4pg2/surface/cmip6_mam4_num_a4_surf_ne4pg2_2010_clim_c20240815.nc</srf_emis_specifier_for_num_a4>
287-
<srf_emis_specifier_for_pom_a4 hgrid="ne4np4.pg2" type="file" doc="File containing surface emissions data for pom_a4">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne4pg2/surface/cmip6_mam4_pom_a4_surf_ne4pg2_2010_clim_c20240815.nc</srf_emis_specifier_for_pom_a4>
288-
<srf_emis_specifier_for_so4_a1 hgrid="ne4np4.pg2" type="file" doc="File containing surface emissions data for so4_a1">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne4pg2/surface/cmip6_mam4_so4_a1_surf_ne4pg2_2010_clim_c20240815.nc</srf_emis_specifier_for_so4_a1>
289-
<srf_emis_specifier_for_so4_a2 hgrid="ne4np4.pg2" type="file" doc="File containing surface emissions data for so4_a2">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne4pg2/surface/cmip6_mam4_so4_a2_surf_ne4pg2_2010_clim_c20240815.nc</srf_emis_specifier_for_so4_a2>
290293
<!-- For all other grids -->
291294
<srf_emis_specifier_for_DMS type="file" doc="File containing surface emissions data for DMS">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne30pg2/surface/DMSflux.2010.ne30pg2_conserv.POPmonthlyClimFromACES4BGC_c20240816.nc</srf_emis_specifier_for_DMS>
292295
<srf_emis_specifier_for_SO2 type="file" doc="File containing surface emissions data for SO2">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne30pg2/surface/cmip6_mam4_so2_surf_ne30pg2_2010_clim_c20240816.nc</srf_emis_specifier_for_SO2>
@@ -297,6 +300,18 @@ be lost if SCREAM_HACK_XML is not enabled.
297300
<srf_emis_specifier_for_pom_a4 type="file" doc="File containing surface emissions data for pom_a4">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne30pg2/surface/cmip6_mam4_pom_a4_surf_ne30pg2_2010_clim_c20240816.nc</srf_emis_specifier_for_pom_a4>
298301
<srf_emis_specifier_for_so4_a1 type="file" doc="File containing surface emissions data for so4_a1">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne30pg2/surface/cmip6_mam4_so4_a1_surf_ne30pg2_2010_clim_c20240816.nc</srf_emis_specifier_for_so4_a1>
299302
<srf_emis_specifier_for_so4_a2 type="file" doc="File containing surface emissions data for so4_a2">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne30pg2/surface/cmip6_mam4_so4_a2_surf_ne30pg2_2010_clim_c20240816.nc</srf_emis_specifier_for_so4_a2>
303+
304+
<!-- For ne4pg2 grid -->
305+
<srf_emis_specifier_for_DMS hgrid="ne4np4.pg2" type="file" doc="File containing surface emissions data for DMS">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne4pg2/surface/DMSflux.2010.ne4pg2_conserv.POPmonthlyClimFromACES4BGC_c20240814.nc</srf_emis_specifier_for_DMS>
306+
<srf_emis_specifier_for_SO2 hgrid="ne4np4.pg2" type="file" doc="File containing surface emissions data for SO2">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne4pg2/surface/cmip6_mam4_so2_surf_ne4pg2_2010_clim_c20240815.nc</srf_emis_specifier_for_SO2>
307+
<srf_emis_specifier_for_bc_a4 hgrid="ne4np4.pg2" type="file" doc="File containing surface emissions data for bc_a4">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne4pg2/surface/cmip6_mam4_bc_a4_surf_ne4pg2_2010_clim_c20240815.nc</srf_emis_specifier_for_bc_a4>
308+
<srf_emis_specifier_for_num_a1 hgrid="ne4np4.pg2" type="file" doc="File containing surface emissions data for num_a1">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne4pg2/surface/cmip6_mam4_num_a1_surf_ne4pg2_2010_clim_c20240815.nc</srf_emis_specifier_for_num_a1>
309+
<srf_emis_specifier_for_num_a2 hgrid="ne4np4.pg2" type="file" doc="File containing surface emissions data for num_a2">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne4pg2/surface/cmip6_mam4_num_a2_surf_ne4pg2_2010_clim_c20240815.nc</srf_emis_specifier_for_num_a2>
310+
<srf_emis_specifier_for_num_a4 hgrid="ne4np4.pg2" type="file" doc="File containing surface emissions data for num_a4">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne4pg2/surface/cmip6_mam4_num_a4_surf_ne4pg2_2010_clim_c20240815.nc</srf_emis_specifier_for_num_a4>
311+
<srf_emis_specifier_for_pom_a4 hgrid="ne4np4.pg2" type="file" doc="File containing surface emissions data for pom_a4">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne4pg2/surface/cmip6_mam4_pom_a4_surf_ne4pg2_2010_clim_c20240815.nc</srf_emis_specifier_for_pom_a4>
312+
<srf_emis_specifier_for_so4_a1 hgrid="ne4np4.pg2" type="file" doc="File containing surface emissions data for so4_a1">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne4pg2/surface/cmip6_mam4_so4_a1_surf_ne4pg2_2010_clim_c20240815.nc</srf_emis_specifier_for_so4_a1>
313+
<srf_emis_specifier_for_so4_a2 hgrid="ne4np4.pg2" type="file" doc="File containing surface emissions data for so4_a2">${DIN_LOC_ROOT}/atm/scream/mam4xx/emissions/ne4pg2/surface/cmip6_mam4_so4_a2_surf_ne4pg2_2010_clim_c20240815.nc</srf_emis_specifier_for_so4_a2>
314+
300315

301316
<!-- Mapping Files for finer resolutions -->
302317
<srf_remap_file type="file" doc="File containing mapping data from the grid of emission files to the model grid. Unused if the grid is the same."/>
@@ -490,9 +505,11 @@ be lost if SCREAM_HACK_XML is not enabled.
490505
<initial_conditions>
491506
<Filename type="file">UNSET</Filename>
492507
<Filename hgrid="ne4np4" nlev="72">${DIN_LOC_ROOT}/atm/scream/init/screami_ne4np4L72_20220823.nc</Filename>
508+
<Filename hgrid="ne4np4" nlev="72" ntracers="41">${DIN_LOC_ROOT}/atm/scream/init/screami_mam4xx_ne4np4L72_c20240208.nc</Filename>
493509
<Filename hgrid="ne4np4" nlev="128">${DIN_LOC_ROOT}/atm/scream/init/screami_ne4np4L128_20241022.nc</Filename>
494510
<Filename hgrid="ne30np4" nlev="72">${DIN_LOC_ROOT}/atm/scream/init/screami_ne30np4L72_20220823.nc</Filename>
495511
<Filename hgrid="ne30np4" nlev="128">${DIN_LOC_ROOT}/atm/scream/init/screami_ne30np4L128_20221004.nc</Filename>
512+
<Filename hgrid="ne30np4" nlev="72" ntracers="41">${DIN_LOC_ROOT}/atm/scream/init/screami_mam_ne30np4L72_c20240623.nc</Filename>
496513
<Filename hgrid="ne120np4" nlev="72">${DIN_LOC_ROOT}/atm/scream/init/screami_ne120np4L72_20220823.nc</Filename>
497514
<Filename hgrid="ne120np4" nlev="128">${DIN_LOC_ROOT}/atm/scream/init/screami_ne120np4L128_20230215.nc</Filename>
498515
<Filename hgrid="ne256np4">${DIN_LOC_ROOT}/atm/scream/init/screami_ne256np4L128_ifs-20200120_20220914.nc</Filename>

components/eamxx/cime_config/testdefs/testmods_dirs/scream/mam4xx/aci/shell_commands

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
#------------------------------------------------------
66
$CIMEROOT/../components/eamxx/cime_config/testdefs/testmods_dirs/scream/mam4xx/update_eamxx_num_tracers.sh
77

8-
#modify initial condition file to get aerosol species ICs
9-
$CIMEROOT/../components/eamxx/scripts/atmchange initial_conditions::Filename='$DIN_LOC_ROOT/atm/scream/init/screami_mam4xx_ne4np4L72_c20240208.nc' -b
10-
118
# Add spa as RRTMG needs spa
129
$CIMEROOT/../components/eamxx/scripts/atmchange physics::atm_procs_list="mac_aero_mic,spa,rrtmgp" -b
1310

components/eamxx/cime_config/testdefs/testmods_dirs/scream/mam4xx/drydep/shell_commands

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
$CIMEROOT/../components/eamxx/cime_config/testdefs/testmods_dirs/scream/mam4xx/update_eamxx_num_tracers.sh -b
99

1010
#------------------------------------------------------
11-
#Update IC file and add drydep process
11+
# Add drydep process
1212
#------------------------------------------------------
13-
$CIMEROOT/../components/eamxx/scripts/atmchange initial_conditions::Filename='$DIN_LOC_ROOT/atm/scream/init/screami_mam4xx_ne4np4L72_c20240208.nc' -b
1413
$CIMEROOT/../components/eamxx/scripts/atmchange physics::atm_procs_list="mac_aero_mic,rrtmgp,mam4_drydep" -b
1514

1615

components/eamxx/cime_config/testdefs/testmods_dirs/scream/mam4xx/optics/shell_commands

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#------------------------------------------------------
55
$CIMEROOT/../components/eamxx/cime_config/testdefs/testmods_dirs/scream/mam4xx/update_eamxx_num_tracers.sh
66

7-
$CIMEROOT/../components/eamxx/scripts/atmchange initial_conditions::Filename='$DIN_LOC_ROOT/atm/scream/init/screami_mam4xx_ne4np4L72_c20240208.nc' -b
87
$CIMEROOT/../components/eamxx/scripts/atmchange physics::atm_procs_list="mac_aero_mic,mam4_optics,rrtmgp" -b
98

109

components/eamxx/cime_config/testdefs/testmods_dirs/scream/mam4xx/srf_online_emiss_constituent_fluxes/shell_commands

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
$CIMEROOT/../components/eamxx/cime_config/testdefs/testmods_dirs/scream/mam4xx/update_eamxx_num_tracers.sh -b
99

1010
#------------------------------------------------------
11-
#Update IC file and add the processes
11+
# Add the processes
1212
#------------------------------------------------------
13-
$CIMEROOT/../components/eamxx/scripts/atmchange initial_conditions::Filename='$DIN_LOC_ROOT/atm/scream/init/screami_mam4xx_ne4np4L72_c20240208.nc' -b
1413
$CIMEROOT/../components/eamxx/scripts/atmchange physics::atm_procs_list="mam4_constituent_fluxes,mac_aero_mic,rrtmgp,mam4_srf_online_emiss" -b
1514

1615

components/eamxx/cime_config/testdefs/testmods_dirs/scream/mam4xx/wetscav/shell_commands

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
$CIMEROOT/../components/eamxx/cime_config/testdefs/testmods_dirs/scream/mam4xx/update_eamxx_num_tracers.sh -b
88

99
#------------------------------------------------------
10-
#Update IC file and add wetscav process
10+
# Add wetscav process
1111
#------------------------------------------------------
12-
$CIMEROOT/../components/eamxx/scripts/atmchange initial_conditions::Filename='$DIN_LOC_ROOT/atm/scream/init/screami_mam4xx_ne4np4L72_c20240208.nc' -b
1312
$CIMEROOT/../components/eamxx/scripts/atmchange physics::atm_procs_list="mac_aero_mic,mam4_wetscav,rrtmgp" -b

components/eamxx/src/physics/mam/eamxx_mam_dry_deposition_functions.hpp

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ void compute_tendencies(
1919
const MAMDryDep::const_view_1d ocnfrac,
2020
const MAMDryDep::const_view_1d friction_velocity,
2121
const MAMDryDep::const_view_1d aerodynamical_resistance,
22-
MAMDryDep::view_3d qtracers, MAMDryDep::view_2d fraction_landuse_,
22+
const MAMDryDep::const_view_2d fraction_landuse_,
2323
const MAMDryDep::const_view_3d dgncur_awet_,
2424
const MAMDryDep::const_view_3d wet_dens_,
2525
const mam_coupling::DryAtmosphere dry_atm,
@@ -35,7 +35,7 @@ void compute_tendencies(
3535
// work arrays
3636
MAMDryDep::view_2d rho_, MAMDryDep::view_4d vlc_dry_,
3737
MAMDryDep::view_3d vlc_trb_, MAMDryDep::view_4d vlc_grv_,
38-
MAMDryDep::view_3d dqdt_tmp_) {
38+
MAMDryDep::view_3d dqdt_tmp_, MAMDryDep::view_3d qtracers) {
3939
static constexpr int num_aero_modes = mam_coupling::num_aero_modes();
4040
const auto policy =
4141
ekat::ExeSpaceUtils<MAMDryDep::KT::ExeSpace>::get_default_team_policy(
@@ -86,7 +86,7 @@ void compute_tendencies(
8686
static constexpr int n_land_type = MAMDryDep::n_land_type;
8787
Real fraction_landuse[n_land_type];
8888
for(int i = 0; i < n_land_type; ++i) {
89-
fraction_landuse[i] = fraction_landuse_(i, icol);
89+
fraction_landuse[i] = fraction_landuse_(icol, i);
9090
}
9191

9292
static constexpr int nmodes = mam4::AeroConfig::num_modes();
@@ -181,24 +181,6 @@ void update_cloudborne_mmrs(const MAMDryDep::view_3d qqcw, const double dt,
181181
}
182182
} // Update cloud borne aerosols ends
183183

184-
// FIXME: remove the following function after implementing file read for landuse
185-
void populated_fraction_landuse(MAMDryDep::view_2d flu, const int ncol) {
186-
Kokkos::parallel_for(
187-
"populated_fraction_landuse", 1, KOKKOS_LAMBDA(int) {
188-
static constexpr int n_land_type = MAMDryDep::n_land_type;
189-
const Real temp[n_land_type] = {
190-
0.28044346587077795E-003, 0.26634987180780171E-001,
191-
0.16803558403621365E-001, 0.18076055155371872E-001,
192-
0.00000000000000000E+000, 0.00000000000000000E+000,
193-
0.91803784897907303E+000, 0.17186036997038400E-002,
194-
0.00000000000000000E+000, 0.00000000000000000E+000,
195-
0.18448503115578840E-001};
196-
for(int i = 0; i < n_land_type; ++i)
197-
for(int j = 0; j < ncol; ++j) flu(i, j) = temp[i];
198-
});
199-
Kokkos::fence();
200-
}
201-
202184
} // namespace
203185
} // namespace scream
204186

components/eamxx/src/physics/mam/eamxx_mam_dry_deposition_process_interface.cpp

Lines changed: 41 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@
33
// Drydep functions are stored in the following hpp file
44
#include <physics/mam/eamxx_mam_dry_deposition_functions.hpp>
55

6-
/*
7-
-----------------------------------------------------------------
8-
NOTES:
9-
1. Add a CIME test and multi-process tests
10-
2. Ensure that the submodule for MAM4xx is the main branch
11-
3. Read file for fractional landuse
12-
-----------------------------------------------------------------
13-
*/
6+
// For reading fractional land use file
7+
#include <physics/mam/readfiles/fractional_land_use.hpp>
8+
149
namespace scream {
1510

11+
using FracLandUseFunc = frac_landuse::fracLandUseFunctions<Real, DefaultDevice>;
12+
1613
MAMDryDep::MAMDryDep(const ekat::Comm &comm, const ekat::ParameterList &params)
1714
: AtmosphereProcess(comm, params) {
1815
/* Anything that can be initialized without grid information can be
@@ -56,7 +53,8 @@ void MAMDryDep::set_grids(
5653
// Layout for 4D (2d horiz X 1d vertical x number of modes) variables
5754
// at mid points
5855
const int num_aero_modes = mam_coupling::num_aero_modes();
59-
const FieldLayout vector3d_mid = grid_->get_3d_vector_layout(true, num_aero_modes, "num_modes");
56+
const FieldLayout vector3d_mid =
57+
grid_->get_3d_vector_layout(true, num_aero_modes, "num_modes");
6058

6159
using namespace ekat::units;
6260

@@ -199,6 +197,27 @@ void MAMDryDep::set_grids(
199197
// surface deposition flux of interstitial aerosols, [kg/m2/s] or [1/m2/s]
200198
add_field<Computed>("deposition_flux_of_interstitial_aerosols",
201199
vector2d_pcnst, 1 / m2 / s, grid_name);
200+
201+
// -------------------------------------------------------------
202+
// setup to enable reading fractional land use file
203+
// -------------------------------------------------------------
204+
205+
const auto mapping_file = m_params.get<std::string>("drydep_remap_file", "");
206+
const std::string frac_landuse_data_file =
207+
m_params.get<std::string>("fractional_land_use_file");
208+
209+
// Field to be read from file
210+
const std::string field_name = "fraction_landuse";
211+
212+
// Dimensions of the filed
213+
const std::string dim_name1 = "ncol";
214+
const std::string dim_name2 = "class";
215+
216+
// initialize the file read
217+
FracLandUseFunc::init_frac_landuse_file_read(
218+
ncol_, field_name, dim_name1, dim_name2, grid_, frac_landuse_data_file,
219+
mapping_file, horizInterp_, dataReader_); // output
220+
202221
} // set_grids
203222

204223
// ================================================================
@@ -345,10 +364,14 @@ void MAMDryDep::initialize_impl(const RunType run_type) {
345364
// Work array to hold tendency for 1 species [kg/kg/s] or [1/kg/s]
346365
dqdt_tmp_ = view_3d("dqdt_tmp_", pcnst, ncol_, nlev_);
347366

348-
static constexpr int n_land_type = mam4::DryDeposition::n_land_type;
349-
// FIXME: This should come from a file reading
350-
// The fraction of land use for the column. [non-dimentional]
351-
fraction_landuse_ = view_2d("fraction_landuse_", n_land_type, ncol_);
367+
//-----------------------------------------------------------------
368+
// Read fractional land use data
369+
//-----------------------------------------------------------------
370+
// This data is time-independent, we read all data here for the
371+
// entire simulation
372+
FracLandUseFunc::update_frac_land_use_data_from_file(
373+
dataReader_, *horizInterp_,
374+
frac_landuse_); // output
352375

353376
//-----------------------------------------------------------------
354377
// Setup preprocessing and post processing
@@ -403,21 +426,20 @@ void MAMDryDep::run_impl(const double dt) {
403426
auto aerdepdryis_ = get_field_out("deposition_flux_of_interstitial_aerosols")
404427
.get_view<Real **>();
405428

406-
// FIXME: remove it if it read from a file
407-
populated_fraction_landuse(fraction_landuse_, ncol_);
408-
429+
//--------------------------------------------------------------------
409430
// Call drydeposition and get tendencies
431+
//--------------------------------------------------------------------
410432
compute_tendencies(ncol_, nlev_, dt, obukhov_length_,
411433
surface_friction_velocty_, land_fraction_, ice_fraction_,
412434
ocean_fraction_, friction_velocity_,
413-
aerodynamical_resistance_, qtracers_, fraction_landuse_,
414-
dgncur_awet_, wet_dens_, dry_atm_, dry_aero_,
435+
aerodynamical_resistance_, frac_landuse_, dgncur_awet_,
436+
wet_dens_, dry_atm_, dry_aero_,
415437
// Inouts-outputs
416438
qqcw_,
417439
// Outputs
418440
ptend_q_, aerdepdrycw_, aerdepdryis_,
419441
// work arrays
420-
rho_, vlc_dry_, vlc_trb_, vlc_grv_, dqdt_tmp_);
442+
rho_, vlc_dry_, vlc_trb_, vlc_grv_, dqdt_tmp_, qtracers_);
421443
Kokkos::fence();
422444

423445
// Update the interstitial aerosols using ptend.

0 commit comments

Comments
 (0)