Skip to content

Commit

Permalink
Fixed merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
wiersema1 committed Jan 23, 2024
2 parents a2d9e50 + a51636c commit f1d50fd
Show file tree
Hide file tree
Showing 8 changed files with 204 additions and 169 deletions.
1 change: 1 addition & 0 deletions Exec/DevTests/MetGrid/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ USE_ASSERTION = TRUE

USE_NETCDF = TRUE

USE_MOISTURE = TRUE
#USE_WARM_NO_PRECIP = TRUE

# GNU Make
Expand Down
26 changes: 15 additions & 11 deletions Exec/DevTests/MetGrid/inputs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ------------------ INPUTS TO MAIN PROGRAM -------------------
max_step = 100
max_step = 10

amrex.fpe_trap_invalid = 1
amrex.fpe_trap_zero = 1
Expand All @@ -11,15 +11,15 @@ amr.n_cell = 140 80 100

geometry.is_periodic = 0 0 0

xlo.type = "Outflow"
xhi.type = "Outflow"
ylo.type = "Outflow"
yhi.type = "Outflow"
xlo.type = "outflow"
xhi.type = "outflow"
ylo.type = "outflow"
yhi.type = "outflow"
zlo.type = "NoSlipWall"
zhi.type = "SlipWall"

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

erf.use_terrain = true
erf.terrain_smoothing = 2
Expand All @@ -40,24 +40,28 @@ erf.check_int = 100 # number of timesteps between checkpoints
# PLOTFILES
erf.plot_file_1 = plt # prefix of plotfile name
erf.plot_int_1 = 1 # number of timesteps between plotfiles
erf.plot_vars_1 = qv Rhoqv density dens_hse rhoadv_0 x_velocity y_velocity z_velocity pressure temp theta z_phys mapfac pres_hse pert_pres KE QKE
erf.plot_vars_1 = qt qv qc density dens_hse rhoadv_0 x_velocity y_velocity z_velocity pressure temp theta z_phys mapfac pres_hse pert_pres pert_dens KE QKE
#erf.plot_vars_1 = density dens_hse rhoadv_0 x_velocity y_velocity z_velocity pressure temp theta z_phys mapfac pres_hse pert_pres pert_dens KE QKE

# SOLVER CHOICE
erf.alpha_T = 1.0
erf.alpha_C = 1.0
erf.use_gravity = true

erf.molec_diff_type = "None"
erf.les_type = "Smagorinsky"
#erf.les_type = "Deardorff"
#erf.les_type = "Smagorinsky"
erf.les_type = "Deardorff"
erf.Cs = 0.1

erf.moisture_model = "SAM"
erf.moisture_model = "Kessler"
#erf.moisture_model = "Null"
#erf.do_cloud = false
#erf.do_precip = false

#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 = 5
erf.metgrid_bdy_width = 10
erf.metgrid_bdy_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" "met_em.d01.2022-06-18_12:00:00.nc" "met_em.d01.2022-06-18_18:00:00.nc"
Expand Down
11 changes: 6 additions & 5 deletions Exec/RegTests/Bubble/inputs_squall2d_x
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ erf.check_int = 9000 # number of timesteps between checkpoints
# PLOTFILES
erf.plot_file_1 = plt # prefix of plotfile name
erf.plot_int_1 = 10 # number of timesteps between plotfiles
erf.plot_vars_1 = density x_velocity y_velocity z_velocity pressure theta pres_hse
erf.plot_vars_1 = qt qp qv qc qi qrain qsnow qgraup density x_velocity y_velocity z_velocity pressure theta pres_hse

# SOLVER CHOICES
erf.use_gravity = true
Expand All @@ -44,15 +44,16 @@ erf.rotational_time_period = 86400.0
erf.use_rayleigh_damping = false # TODO: enable

# PHYSICS OPTIONS
erf.les_type = "Deardorff"
#erf.les_type = "Deardorff"
erf.les_type = "None"
erf.pbl_type = "None"
erf.moisture_model = "SAM"
erf.buoyancy_type = 1

erf.molec_diff_type = "Constant"
erf.molec_diff_type = "ConstantAlpha"
erf.rho0_trans = 1.0 # [kg/m^3], used to convert input diffusivities
erf.dynamicViscosity= 0.0 # [kg/(m-s)] ==> nu = 75.0 m^2/s
erf.alpha_T = 0.0 # [m^2/s]
erf.dynamicViscosity= 75.0 # [kg/(m-s)] ==> nu = 75.0 m^2/s
erf.alpha_T = 75.0 # [m^2/s]

# INITIAL CONDITIONS
erf.init_type = "input_sounding"
Expand Down
7 changes: 3 additions & 4 deletions Source/BoundaryConditions/BoundaryConditions_metgrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ ERF::fill_from_metgrid (const Vector<MultiFab*>& mfs,
// Loop over each component
for (int comp_idx(offset); comp_idx < (comp_var[var_idx]+offset); ++comp_idx)
{
int width = metgrid_bdy_set_width;
int width = metgrid_bdy_width;
int set_width = metgrid_bdy_set_width;

// Variable can be read from met_em files
//------------------------------------
Expand Down Expand Up @@ -100,8 +101,6 @@ ERF::fill_from_metgrid (const Vector<MultiFab*>& mfs,
// Grown tilebox so we fill exterior ghost cells as well
Box gbx = mfi.growntilebox(ng_vect);
const Array4<Real>& dest_arr = mf.array(mfi);

// Call w/o interior ghost cells
Box bx_xlo, bx_xhi, bx_ylo, bx_yhi;
compute_interior_ghost_bxs_xy(gbx, domain, width, 0,
bx_xlo, bx_xhi,
Expand Down Expand Up @@ -159,7 +158,7 @@ ERF::fill_from_metgrid (const Vector<MultiFab*>& mfs,
Box bx_xlo, bx_xhi, bx_ylo, bx_yhi;
compute_interior_ghost_bxs_xy(gbx, domain, width, 0,
bx_xlo, bx_xhi,
bx_ylo, bx_yhi, ng_vect);
bx_ylo, bx_yhi, ng_vect, true);

// x-faces (includes y ghost cells)
ParallelFor(bx_xlo, bx_xhi,
Expand Down
43 changes: 35 additions & 8 deletions Source/IO/ReadFromMetgrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ read_from_metgrid (int lev, const Box& domain, const std::string& fname,
auto ncf = ncutils::NCFile::open(fname, NC_CLOBBER | NC_NETCDF4);
{ // Global Attributes (int)
std::vector<int> attr;
ncf.get_attr("FLAG_PSFC", attr); flag_psfc = attr[0];

/* UNCOMMENT FOR FLOWMAS
flag_msfu = 0; //ncf.get_attr("FLAG_MAPFAC_U", attr); flag_msfu = attr[0];
flag_msfv = 0; //ncf.get_attr("FLAG_MAPFAC_V", attr); flag_msfv = attr[0];
Expand All @@ -37,12 +35,41 @@ read_from_metgrid (int lev, const Box& domain, const std::string& fname,
flag_sst = 0; //ncf.get_attr("FLAG_SST", attr); flag_sst = attr[0];
flag_lmask = 0; //ncf.get_attr("FLAG_LANDMASK", attr); flag_lmask = attr[0];
*/
ncf.get_attr("FLAG_MAPFAC_U", attr); flag_msfu = attr[0];
ncf.get_attr("FLAG_MAPFAC_V", attr); flag_msfv = attr[0];
ncf.get_attr("FLAG_MAPFAC_M", attr); flag_msfm = attr[0];
ncf.get_attr("FLAG_HGT_M", attr); flag_hgt = attr[0];
ncf.get_attr("FLAG_SST", attr); flag_sst = attr[0];
ncf.get_attr("FLAG_LANDMASK", attr); flag_lmask = attr[0];
if (ncf.has_attr("FLAG_PSFC")) {
ncf.get_attr("FLAG_PSFC", attr); flag_psfc = attr[0];
} else {
flag_psfc = 0;
}
if (ncf.has_attr("FLAG_MAPFAC_U")) {
ncf.get_attr("FLAG_MAPFAC_U", attr); flag_msfu = attr[0];
} else {
flag_msfu = 0;
}
if (ncf.has_attr("FLAG_MAPFAC_V")) {
ncf.get_attr("FLAG_MAPFAC_V", attr); flag_msfv = attr[0];
} else {
flag_msfv = 0;
}
if (ncf.has_attr("FLAG_MAPFAC_M")) {
ncf.get_attr("FLAG_MAPFAC_M", attr); flag_msfm = attr[0];
} else {
flag_msfm = 0;
}
if (ncf.has_attr("FLAG_HGT_M")) {
ncf.get_attr("FLAG_HGT_M", attr); flag_hgt = attr[0];
} else {
flag_hgt = 0;
}
if (ncf.has_attr("FLAG_SST")) {
ncf.get_attr("FLAG_SST", attr); flag_sst = attr[0];
} else {
flag_sst = 0;
}
if (ncf.has_attr("FLAG_LANDMASK")) {
ncf.get_attr("FLAG_LANDMASK", attr); flag_lmask = attr[0];
} else {
flag_lmask = 0;
}

ncf.get_attr("WEST-EAST_GRID_DIMENSION", attr); NC_nx = attr[0];
ncf.get_attr("SOUTH-NORTH_GRID_DIMENSION", attr); NC_ny = attr[0];
Expand Down
Loading

0 comments on commit f1d50fd

Please sign in to comment.