Skip to content

Commit

Permalink
Balance pressure. (#1427)
Browse files Browse the repository at this point in the history
* Balance pressure.

* Overwrite the bdy vars with init state, coalesce the met and wrf operations, fix FArrayBox on GPU without managed memory.

* Missed input change.

* Add commented out unit test and change inputs to use MOST for bottom BC.

* Fill halo cells of HSE arrays for safety.

---------

Co-authored-by: Aaron Lattanzi <[email protected]>
Co-authored-by: Ann Almgren <[email protected]>
  • Loading branch information
3 people authored Feb 11, 2024
1 parent 285409c commit 4157f68
Show file tree
Hide file tree
Showing 26 changed files with 497 additions and 690 deletions.
3 changes: 1 addition & 2 deletions CMake/BuildERFExe.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ function(build_erf_lib erf_lib_name)
${SRC_DIR}/BoundaryConditions/BoundaryConditions_yvel.cpp
${SRC_DIR}/BoundaryConditions/BoundaryConditions_zvel.cpp
${SRC_DIR}/BoundaryConditions/BoundaryConditions_bndryreg.cpp
${SRC_DIR}/BoundaryConditions/BoundaryConditions_wrfbdy.cpp
${SRC_DIR}/BoundaryConditions/BoundaryConditions_metgrid.cpp
${SRC_DIR}/BoundaryConditions/BoundaryConditions_realbdy.cpp
${SRC_DIR}/BoundaryConditions/ERF_FillPatch.cpp
${SRC_DIR}/BoundaryConditions/ERF_FillPatcher.cpp
${SRC_DIR}/BoundaryConditions/ERF_PhysBCFunct.cpp
Expand Down
4 changes: 2 additions & 2 deletions Docs/sphinx_doc/BoundaryConditions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ Specified Domain BCs
When we use specified lateral boundary conditions, we read time-dependent Dirichlet data
from a file. The user may specify (in the inputs file)
the total width of the interior Dirichlet and relaxation region with
``erf.wrfbdy_width = <Int>`` (yellow + blue)
``erf.real_width = <Int>`` (yellow + blue)
and analogously the width of the interior Dirichlet region may be specified with
``erf.wrfbdy_set_width = <Int>`` (yellow).
``erf.real_set_width = <Int>`` (yellow).
We note that all dycore variables are set and relaxed, but moisture and other scalars
are only set in the yellow region if present in the boundary file.

Expand Down
10 changes: 7 additions & 3 deletions Exec/DevTests/MetGrid/inputs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ xlo.type = "Outflow"
xhi.type = "Outflow"
ylo.type = "Outflow"
yhi.type = "Outflow"
zlo.type = "NoSlipWall"
#zlo.type = "NoSlipWall"
zhi.type = "SlipWall"

zlo.type = "Most"
erf.most.z0 = 0.1
erf.most.zref = 40.0

# TIME STEP CONTROL
erf.fixed_dt = 0.5 # fixed time step depending on grid resolution

Expand Down Expand Up @@ -56,8 +60,8 @@ erf.moisture_model = "NullMoist"
#erf.terrain_z_levels = 0 130 354 583 816 1054 1549 2068 2615 3193 3803 4450 5142 5892 6709 7603 8591 9702 10967 12442 14230 16610 18711 20752 22133 23960 26579 28493 31236 33699 36068 40000

# INITIALIZATION WITH ATM DATA
erf.metgrid_bdy_width = 7
erf.metgrid_bdy_set_width = 1
erf.real_width = 7
erf.real_set_width = 1
erf.init_type = "metgrid"
erf.nc_init_file_0 = "met_em.d01.2022-06-18_00_00_00.nc" "met_em.d01.2022-06-18_06_00_00.nc"

Expand Down
16 changes: 10 additions & 6 deletions Exec/DevTests/MetGrid/inputs_flowmas_metgrid
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ xlo.type = "Outflow"
xhi.type = "Outflow"
ylo.type = "Outflow"
yhi.type = "Outflow"
zlo.type = "NoSlipWall"
#zlo.type = "NoSlipWall"
zhi.type = "SlipWall"

zlo.type = "Most"
erf.most.z0 = 0.1
erf.most.zref = 26.63

# TIME STEP CONTROL
erf.fixed_dt = 1.0 # fixed time step depending on grid resolution

Expand All @@ -31,7 +35,7 @@ amr.max_level = 0 # maximum level number allowed

# CHECKPOINT FILES
erf.check_file = chk # root name of checkpoint file
erf.check_int = 25 # number of timesteps between checkpoints
erf.check_int = 1000 # number of timesteps between checkpoints

# PLOTFILES
erf.plot_file_1 = plt # prefix of plotfile name
Expand Down Expand Up @@ -60,10 +64,10 @@ erf.terrain_z_levels = 0 53.25373067 116.3299934 190.8583428 278.6665766 381.71
16453.44037 17477.73597 18503.25481 19533.31103 20500.0

# INITIALIZATION WITH ATM DATA
erf.metgrid_bdy_width = 5
erf.metgrid_bdy_set_width = 1
erf.init_type = "metgrid"
erf.nc_init_file_0 = "met_em.d01.2015-04-01_00_00_00.nc" "met_em.d01.2015-04-01_08_00_00.nc"
erf.real_width = 5
erf.real_set_width = 1
erf.init_type = "metgrid"
erf.nc_init_file_0 = "met_em.d01.2015-04-01_00_00_00.nc" "met_em.d01.2015-04-01_08_00_00.nc"

#There will be no OpenMP tiling
fabarray.mfiter_tile_size = 1024 1024 1024
8 changes: 4 additions & 4 deletions Exec/DevTests/MetGrid/inputs_flowmas_metgrid_NoZlev
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ erf.terrain_smoothing = 2
erf.buoyancy_type = 1

# INITIALIZATION WITH ATM DATA
erf.metgrid_bdy_width = 7
erf.metgrid_bdy_set_width = 1
erf.init_type = "metgrid"
erf.nc_init_file_0 = "met_em.d01.2015-04-01_00_00_00.nc" "met_em.d01.2015-04-01_08_00_00.nc"
erf.real_width = 7
erf.real_set_width = 1
erf.init_type = "metgrid"
erf.nc_init_file_0 = "met_em.d01.2015-04-01_00_00_00.nc" "met_em.d01.2015-04-01_08_00_00.nc"

#There will be no OpenMP tiling
fabarray.mfiter_tile_size = 1024 1024 1024
16 changes: 10 additions & 6 deletions Exec/DevTests/MetGrid/inputs_flowmas_wrfinput
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ xlo.type = "Outflow"
xhi.type = "Outflow"
ylo.type = "Outflow"
yhi.type = "Outflow"
zlo.type = "NoSlipWall"
#zlo.type = "NoSlipWall"
zhi.type = "SlipWall"

zlo.type = "Most"
erf.most.z0 = 0.1
erf.most.zref = 26.63

# TIME STEP CONTROL
erf.fixed_dt = 1.0 # fixed time step depending on grid resolution

Expand Down Expand Up @@ -54,11 +58,11 @@ erf.terrain_smoothing = 0
erf.buoyancy_type = 1

# INITIALIZATION WITH ATM DATA
erf.wrfbdy_width = 5
erf.wrfbdy_set_width = 1
erf.init_type = "real"
erf.nc_init_file_0 = "wrfinput_d01"
erf.nc_bdy_file = "wrfbdy_d01"
erf.real_width = 5
erf.real_set_width = 1
erf.init_type = "real"
erf.nc_init_file_0 = "wrfinput_d01"
erf.nc_bdy_file = "wrfbdy_d01"

#There will be no OpenMP tiling
fabarray.mfiter_tile_size = 1024 1024 1024
15 changes: 6 additions & 9 deletions Exec/LLJ/inputs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ yhi.type = "Outflow"
zlo.type = "NoSlipWall"
zhi.type = "SlipWall"

# RELAXATION WIDTHS
erf.wrfbdy_width = 5
erf.wrfbdy_set_width = 1
erf.cf_width = 5
erf.cf_set_width = 1

# TIME STEP CONTROL
erf.fixed_dt = 0.001 # fixed time step depending on grid resolution
erf.no_substepping = 1
Expand Down Expand Up @@ -63,17 +57,20 @@ prob.rho_0 = 1.0
prob.T_0 = 300.0

# MULTILEVEL FLAGS
#amr.max_level = 0
amr.max_level = 1
erf.cf_width = 5
erf.cf_set_width = 1
amr.max_level = 1
amr.ref_ratio_vect = 3 3 1
erf.refinement_indicators = box1
erf.box1.max_level = 1
erf.box1.in_box_lo = 60. 51.
erf.box1.in_box_hi = 525. 309.
#erf.coupling_type = "TwoWay"
#erf.coupling_type = "TwoWay"
erf.nc_init_file_1 = "wrfinput_d02"

# INITIALIZATION WITH ATM DATA
erf.real_width = 5
erf.real_set_width = 1
erf.init_type = "real"
erf.nc_init_file_0 = "wrfinput_d01"
erf.nc_bdy_file = "wrfbdy_d01"
10 changes: 4 additions & 6 deletions Exec/RegTests/WPS_Test/inputs_real_ChisholmView
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ yhi.type = "Outflow"
zlo.type = "NoSlipWall"
zhi.type = "SlipWall"

# SET/RELAXATION REGIONS
erf.wrfbdy_width = 1
erf.wrfbdy_set_width = 1

# TIME STEP CONTROL
erf.fixed_dt = 0.5 # fixed time step depending on grid resolution

Expand Down Expand Up @@ -70,6 +66,8 @@ prob.rho_0 = 1.0
prob.T_0 = 300.0

# INITIALIZATION WITH ATM DATA
erf.init_type = "real"
erf.real_width = 1
erf.real_set_width = 1
erf.init_type = "real"
erf.nc_init_file_0 = "wrfinput_chisholmview_d01"
erf.nc_bdy_file = "wrfbdy_chisholmview_d01_width1"
erf.nc_bdy_file = "wrfbdy_chisholmview_d01_width1"
193 changes: 0 additions & 193 deletions Source/BoundaryConditions/BoundaryConditions_metgrid.cpp

This file was deleted.

Loading

0 comments on commit 4157f68

Please sign in to comment.