ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_CheckpointLandmask.H
Go to the documentation of this file.
1 #ifndef ERF_CHECKPOINT_LANDMASK_H_
2 #define ERF_CHECKPOINT_LANDMASK_H_
3 
4 #include <AMReX_iMultiFab.H>
5 #include <AMReX_GpuLaunch.H>
6 
8 
9 // Older checkpoints can mark building footprints as immersed on levels where
10 // the current resolution cutoff disables building forcing. Those footprints
11 // are land; restore their ordinary land mask before MOST and the LSM read it.
12 inline void restore_coarse_building_landmask (amrex::iMultiFab& mask)
13 {
14  for (amrex::MFIter mfi(mask); mfi.isValid(); ++mfi) {
15  const auto arr = mask.array(mfi);
16  amrex::ParallelFor(mfi.fabbox(), [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept {
17  if (arr(i,j,k) == 2) { arr(i,j,k) = 1; }
18  });
19  }
20 }
21 
22 } // namespace erf_checkpoint_landmask
23 
24 #endif
ParallelFor(fab_box, [=] AMREX_GPU_DEVICE(int i, int j, int k) { qrcuten_arr(i, j, k)=Real(0);qscuten_arr(i, j, k)=Real(0);qicuten_arr(i, j, k)=Real(0);})
Definition: ERF_CheckpointLandmask.H:7
void restore_coarse_building_landmask(amrex::iMultiFab &mask)
Definition: ERF_CheckpointLandmask.H:12