Skip to content

Commit

Permalink
use land mask to determine if over land in ysu
Browse files Browse the repository at this point in the history
  • Loading branch information
baperry2 committed Aug 28, 2024
1 parent 4f2c54b commit 25edcee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
8 changes: 5 additions & 3 deletions Docs/sphinx_doc/Inputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -883,9 +883,11 @@ List of Parameters
| | turb. diffusion | | |
| | terms in QKE eqn. | | |
+------------------------------------+--------------------+---------------------+-------------+
| **erf.pbl_ysu_over_land** | Treat whole domain | bool | 1 |
| | as being over land | | |
| | for YSU PBL scheme | | |
| **erf.pbl_ysu_force_over_water** | Treat whole domain | bool | 0 |
| | as over water for | | |
| | YSU PBL scheme | | |
| | regardless of | | |
| | LSM/other inputs | | |
+------------------------------------+--------------------+---------------------+-------------+
| **erf.pbl_ysu_land_Ribcr** | Over land critical | Real | 0.25 |
| | Richardson number | | |
Expand Down
8 changes: 4 additions & 4 deletions Source/DataStructs/TurbStruct.H
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ struct TurbChoice {
pp.query("pbl_mynn_diffuse_moistvars", pbl_mynn_diffuse_moistvars);
} else if (pbl_type == PBLType::YSU) {
pp.query("pbl_ysu_coriolis_freq", pbl_ysu_coriolis_freq);
pp.query("pbl_ysu_over_land", pbl_ysu_over_land);
pp.query("pbl_ysu_force_over_water", pbl_ysu_force_over_water);
pp.query("pbl_ysu_land_Ribcr", pbl_ysu_land_Ribcr);
pp.query("pbl_ysu_unst_Ribcr", pbl_ysu_unst_Ribcr);
}
Expand Down Expand Up @@ -191,7 +191,7 @@ struct TurbChoice {
pp.query("pbl_mynn_diffuse_moistvars", pbl_mynn_diffuse_moistvars, lev);
} else if (pbl_type == PBLType::YSU) {
pp.query("pbl_ysu_coriolis_freq", pbl_ysu_coriolis_freq);
pp.query("pbl_ysu_over_land", pbl_ysu_over_land);
pp.query("pbl_ysu_force_over_water", pbl_ysu_force_over_water);
pp.query("pbl_ysu_land_Ribcr", pbl_ysu_land_Ribcr);
pp.query("pbl_ysu_unst_Ribcr", pbl_ysu_unst_Ribcr);
}
Expand Down Expand Up @@ -270,7 +270,7 @@ struct TurbChoice {
amrex::Print() << "pbl_mynn_C5 : " << pbl_mynn_C5 << std::endl;
} else if (pbl_type == PBLType::YSU) {
amrex::Print() << "pbl_ysu_coriolis_freq : " << pbl_ysu_coriolis_freq << std::endl;
amrex::Print() << "pbl_ysu_over_land : " << pbl_ysu_over_land << std::endl;
amrex::Print() << "pbl_ysu_force_over_water : " << pbl_ysu_force_over_water << std::endl;
amrex::Print() << "pbl_ysu_land_Ribcr : " << pbl_ysu_land_Ribcr << std::endl;
amrex::Print() << "pbl_ysu_unst_Ribcr : " << pbl_ysu_unst_Ribcr << std::endl;
}
Expand Down Expand Up @@ -323,7 +323,7 @@ struct TurbChoice {
// Model coefficients - YSU
// TODO: Add parmparse for all of these above
amrex::Real pbl_ysu_coriolis_freq = 1.0e-4; // TODO: make this consistent with coriolis forcing (but note WRF always uses 1e-4)
bool pbl_ysu_over_land = true; // TODO: pull from other inputs and make local
bool pbl_ysu_force_over_water = false; // Force YSU to act as if it is over water regardless of other inputs (for testing)
amrex::Real pbl_ysu_land_Ribcr = 0.25; // Critical Bulk Richardson number of Land for stable conditions
amrex::Real pbl_ysu_unst_Ribcr = 0.0; // Critical Bulk Richardson number for unstable conditions

Expand Down
6 changes: 4 additions & 2 deletions Source/Diffusion/PBLModels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ ComputeTurbulentViscosityPBL (const MultiFab& xvel,
const auto& ws10av_arr = most->get_mac_avg(level,5)->const_array(mfi);
const auto& t10av_arr = most->get_mac_avg(level,2)->const_array(mfi);
const auto& t_surf_arr = most->get_t_surf(level)->const_array(mfi);
const auto& over_land_arr = (most->get_lmask(level)) ? most->get_lmask(level)->const_array(mfi) : Array4<int> {};
const Array4<Real const> z_nd_arr = use_terrain ? z_phys_nd->array(mfi) : Array4<Real>{};
const Real most_zref = most->get_zref();

Expand Down Expand Up @@ -339,7 +340,7 @@ ComputeTurbulentViscosityPBL (const MultiFab& xvel,
// -- Diagnose PBL height - starting out assuming non-moist --
// loop is only over i,j in order to find height at each x,y
const Real f0 = turbChoice.pbl_ysu_coriolis_freq;
const bool over_land = turbChoice.pbl_ysu_over_land; // TODO: make this local and consistent
const bool force_over_water = turbChoice.pbl_ysu_force_over_water;
const Real land_Ribcr = turbChoice.pbl_ysu_land_Ribcr;
const Real unst_Ribcr = turbChoice.pbl_ysu_unst_Ribcr;
ParallelFor(xybx, [=] AMREX_GPU_DEVICE (int i, int j, int) noexcept
Expand All @@ -360,7 +361,8 @@ ComputeTurbulentViscosityPBL (const MultiFab& xvel,

// PBL Height: Stable Conditions
Real Rib_cr;
if (over_land) {
bool over_land = (over_land_arr) ? over_land_arr(i,j,0) : 1;
if (over_land && !force_over_water) {
Rib_cr = land_Ribcr;
} else { // over water
// Velocity at z=10 m comes from MOST -> currently the average using whatever averaging MOST uses.
Expand Down

0 comments on commit 25edcee

Please sign in to comment.