Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metgrid interpolator #1630

Merged
merged 26 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
44bae4b
Porting init_type="metgrid" updates into a clean branch of developmen…
wiersema1 Oct 1, 2024
a263aec
Reformatted the vertical interpolation code for init_type=\"metgrid\"…
wiersema1 Oct 23, 2024
e457440
Updated documentation for init_type="metgrid" options. Made interp_th…
wiersema1 Oct 24, 2024
f86c99f
Changed temporary FABs used in init_type="metgrid" from a vector of F…
wiersema1 Oct 24, 2024
bb0cbb7
Merged in development, resolved conflicts, and unified some syntax th…
wiersema1 Oct 24, 2024
f969b8a
Fixed a bug introduced when cleaning up code for init_type="metgrid"
wiersema1 Oct 25, 2024
adf406a
Undoing the recent switch from dynamically sized vectors to Array1D i…
wiersema1 Nov 6, 2024
ff442b2
Rebase with development
wiersema1 Nov 6, 2024
ef46453
Merge branch 'development' into metgrid_interpolator
wiersema1 Nov 6, 2024
747bf6a
Merge branch 'development' into metgrid_interpolator
AMLattanzi Nov 7, 2024
7c6c6b7
Merge branch 'development' into metgrid_interpolator
AMLattanzi Nov 7, 2024
fc8a9a3
Make this GPU compatible.
AMLattanzi Nov 8, 2024
f1c3b98
Merge branch 'metgrid_interpolator' of https://github.com/wiersema1/E…
AMLattanzi Nov 8, 2024
ee99c78
Merge branch 'development' into metgrid_interpolator
AMLattanzi Nov 12, 2024
b3b4c1c
Fix remaining issues with bounds and unused vars.
Nov 13, 2024
5dbe9ff
Remove size var since we went to fixed length GpuArrays.
Nov 13, 2024
56004c6
Reduce memory overhead and fix GPU warning.
Nov 13, 2024
92dad5b
Merge branch 'development' into metgrid_interpolator
AMLattanzi Nov 13, 2024
6cca316
Added assertions during initialization for init_type of "metgrid" and…
wiersema1 Nov 14, 2024
4b8d722
Merge develop.
AMLattanzi Nov 25, 2024
5e7449b
Merge branch 'development' into metgrid_interpolator
AMLattanzi Nov 26, 2024
8d8b5af
Merge branch 'development' into metgrid_interpolator
AMLattanzi Nov 27, 2024
3a9f526
Merge branch 'development' into metgrid_interpolator
AMLattanzi Dec 2, 2024
bf33f0c
Merge branch 'development' into metgrid_interpolator
AMLattanzi Dec 3, 2024
e1a3c09
Merge branch 'development' into metgrid_interpolator
AMLattanzi Dec 4, 2024
6d12bb2
Fix conflicts.
AMLattanzi Dec 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions Docs/sphinx_doc/Inputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1219,6 +1219,107 @@ List of Parameters
| **erf.project_initial_velocity** | project initial | true or false | true if anelastic; |
| | velocity? | | false if compressible |
+----------------------------------+-------------------+--------------------+-----------------------+
| **erf.real_width** | Lateral boundary | Integer | 0 |
| | total width if | | |
| | use_real_bcs is | | |
| | true | | |
+----------------------------------+-------------------+--------------------+-----------------------+
| **erf.real_set_width** | Lateral boundary | Integer | 0 |
| | specified zone | | |
| | width if | | |
| | use_real_bcs is | | |
| | true | | |
+----------------------------------+-------------------+--------------------+-----------------------+
| **erf.metgrid_debug_quiescent** | If init_type is | true or false | false |
| | metgrid, overwrite| | |
| | initial conditions| | |
| | and boundary | | |
| | conditions to be | | |
| | quiescent. | | |
+----------------------------------+-------------------+--------------------+-----------------------+
| **erf.metgrid_debug_isothermal** | If init_type is | true or false | false |
| | metgrid, overwrite| | |
| | theta to be 300 in| | |
| | initial conditions| | |
| | and boundary | | |
| | conditions. | | |
+----------------------------------+-------------------+--------------------+-----------------------+
| **erf.metgrid_debug_dry** | If init_type is | true or false | false |
| | metgrid, overwrite| | |
| | qv to be dry in | | |
| | initial conditions| | |
| | and boundary | | |
| | conditions. | | |
+----------------------------------+-------------------+--------------------+-----------------------+
| **erf.metgrid_debug_msf** | If init_type is | true or false | false |
| | metgrid, overwrite| | |
| | map scale factors | | |
| | to be 1. | | |
+----------------------------------+-------------------+--------------------+-----------------------+
| **erf.metgrid_debug_psfc** | If init_type is | true or false | false |
| | metgrid, overwrite| | |
| | surface pressure | | |
| | to be 10**5. | | |
+----------------------------------+-------------------+--------------------+-----------------------+
| **erf.metgrid_interp_theta** | If init_type is | true or false | false |
| | metgrid, calculate| | |
| | theta on origin | | |
| | model vertical | | |
| | levels and then | | |
| | interpolate onto | | |
| | the ERF vertical | | |
| | levels. | | |
+----------------------------------+-------------------+--------------------+-----------------------+
| **erf.metgrid_basic_linear** | If init_type is | true or false | false |
| | metgrid, use | | |
| | linear vertical | | |
| | interpolation and | | |
| | no quality | | |
| | control? | | |
+----------------------------------+-------------------+--------------------+-----------------------+
| **erf.metgrid_use_below_sfc** | If init_type is | true or false | true |
| | metgrid, use the | | |
| | origin data levels| | |
| | below the surface?| | |
+----------------------------------+-------------------+--------------------+-----------------------+
| **erf.metgrid_use_sfc** | If init_type is | true or false | true |
| | metgrid, use the | | |
| | origin data level | | |
| | at the surface? | | |
+----------------------------------+-------------------+--------------------+-----------------------+
| **erf.metgrid_retain_sfc** | If init_type is | true or false | false |
| | metgrid, assign | | |
| | the lowest level | | |
| | directly using the| | |
| | surface value from| | |
| | the origin data? | | |
+----------------------------------+-------------------+--------------------+-----------------------+
| **erf.metgrid_proximity** | If init_type is | Real | 1000. |
| | metgrid, pressure | | |
| | differential for | | |
| | detecting origin | | |
| | levels that are | | |
| | problematically | | |
| | close together | | |
+----------------------------------+-------------------+--------------------+-----------------------+
| **erf.metgrid_order** | If init_type is | Integer | 2 |
| | metgrid, order of | | |
| | the Lagrange | | |
| | polynomial | | |
| | interpolation | | |
| | scheme for | | |
| | vertical | | |
| | interpolation | | |
+----------------------------------+-------------------+--------------------+-----------------------+
| **erf.metgrid_force_sfc_k** | If init_type is | Integer | 0 |
| | metgrid, force the| | |
| | origin data | | |
| | surface level to | | |
| | be included in the| | |
| | interpolation for | | |
| | this many ERF | | |
| | vertical levels | | |
+----------------------------------+-------------------+--------------------+-----------------------+

Notes
-----------------
Expand All @@ -1233,6 +1334,15 @@ The extent of the relaxation zone may be controlled with ``erf.real_width`` (cor
and ``erf.real_set_width`` (corresponding to WRF's **spec_zone**, typically set to 1), which corresponds to a relaxation zone with a
width of **real_width - real_set_width**.

If **erf.init_type = metgrid**, the problem is initialized with data
contained in the first NetCDF file provided via ``erf.nc_init_file_0``.
Lateral boundary conditions are derived from the sequence of NetCDF
files provided via ``erf.nc_init_file_0``. The sequence of
``erf.nc_init_file_0`` should be output from the WRF Preprocessing
System (WPS) listed chronologically starting with the earliest
timestamp. A minimum of two files are required to derive lateral
boundary conditions.

If **erf.init_type = input_sounding**, a WRF-style input sounding is read from
``erf.input_sounding_file``. This text file includes any set of levels that
goes at least up to the model top height. The first line includes the surface
Expand Down
15 changes: 15 additions & 0 deletions Source/ERF.H
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,21 @@ private:
// used with init_type == InitType::Input_Sounding
static bool init_sounding_ideal;

// Options for vertical interpolation of met_em*.nc data.
bool metgrid_debug_quiescent{false};
bool metgrid_debug_isothermal{false};
bool metgrid_debug_dry{false};
bool metgrid_debug_psfc{false};
bool metgrid_debug_msf{false};
bool metgrid_interp_theta{false};
bool metgrid_basic_linear{false};
bool metgrid_use_below_sfc{true};
bool metgrid_use_sfc{true};
bool metgrid_retain_sfc{false};
amrex::Real metgrid_proximity{1000.0};
int metgrid_order{2};
int metgrid_force_sfc_k{0};

// 1D CDF output (for ingestion in AMR-Wind)
static int output_1d_column;
static int column_interval;
Expand Down
15 changes: 15 additions & 0 deletions Source/ERF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1503,6 +1503,21 @@ ERF::ReadParameters ()
// Flag to trigger initialization from input_sounding like WRF's ideal.exe
pp.query("init_sounding_ideal", init_sounding_ideal);

// Options for vertical interpolation of met_em*.nc data.
pp.query("metgrid_debug_quiescent", metgrid_debug_quiescent);
pp.query("metgrid_debug_isothermal", metgrid_debug_isothermal);
pp.query("metgrid_debug_dry", metgrid_debug_dry);
pp.query("metgrid_debug_psfc", metgrid_debug_psfc);
pp.query("metgrid_debug_msf", metgrid_debug_msf);
pp.query("metgrid_interp_theta", metgrid_interp_theta);
pp.query("metgrid_basic_linear", metgrid_basic_linear);
pp.query("metgrid_use_below_sfc", metgrid_use_below_sfc);
pp.query("metgrid_use_sfc", metgrid_use_sfc);
pp.query("metgrid_retain_sfc", metgrid_retain_sfc);
pp.query("metgrid_proximity", metgrid_proximity);
pp.query("metgrid_order", metgrid_order);
pp.query("metgrid_force_sfc_k", metgrid_force_sfc_k);

// Set default to FullState for now ... later we will try Perturbation
interpolation_type = StateInterpType::FullState;
pp.query_enum_case_insensitive("interpolation_type" ,interpolation_type);
Expand Down
Loading
Loading