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

Conversation

wiersema1
Copy link
Contributor

@wiersema1 wiersema1 commented May 25, 2024

Adds a WRF-styled vertical interpolation and quality control to the init_type="metgrid" initialization. This approach closely follows that used in WRF's real.exe (see WRF/dyn_em/module_initialize_real.F). The WRF quality control algorithm prunes data if points are deemed "too close" in pressure, which becomes messy in ERF since we are on a height-based grid and we don't yet have pressure on the ERF grid since it is calculated using the variables that we are interpolating. In an attempt to be apples-to-apples with WRF, the ERF QC checks whether points are problematically close together by calculating a pressure difference assuming a baroclinic atmosphere. This approach seems to work well except for some cases near the surface where ERF QC differs from WRF QC and results in a slightly different selection of points being fed into the vertical interpolator (see attached figures).

There are several new input parameters and the docs have been updated accordingly. Default values are in parenthesis below.

  • metgrid_interp_theta (false) calculate theta on origin model vertical levels (see note below).
  • metgrid_basic_linear (false) use the old linear interpolation without any quality control.
  • metgrid_use_below_sfc (true) QC keeps origin data values below the surface.
  • metgrid_use_sfc (true) QC keeps the origin data surface value.
  • metgrid_retain_sfc (false) Assign the lowest ERF level as the origin data surface value.
  • metgrid_proximity (1000.) Minimum pressure difference for QC algorithm.
  • metgrid_order (2) Order of the vertical interpolation scheme.
  • metgrid_force_sfc_k (0) QC removes origin data (except the surface value) below this ERF vertical level, forcing use of the origin data surface value in the vertical interpolation.

metgrid_interp_theta controls how potential temperature is to be set when init_type="metgrid". Previously, potential temperature was calculated using the origin data and then vertically interpolated onto the ERF grid. This now corresponds to metgrid_interp_theta=true. When metgrid_interp_theta=false, the origin data pressure and temperature are vertically interpolated onto the ERF grid and then used to calculate the potential temperature. Note that pressure is interpolated not with respect to height but rather p_0exp(-CONST_GRAVz/(t_0*R_d)), i.e., pressure in a baroclinic atmosphere. All other variables are interpolated with respect to height.

Several debugging options are also included, which will likely be useful for future development. The input parameters are as follows.

  • metgrid_debug_quiescent (false) initial & boundary conditions are quiescent.
  • metgrid_debug_isothermal (false) initial & boundary conditions have potential temperature = 300.
  • metgrid_debug_dry (false) initial & boundary conditions have qv = 0.
  • metgrid_debug_psfc (false) P & rho are iteratively calculated using a surface pressure of 10**5.
  • metgrid_debug_msf (false) map scale factors are set to 1.

These changes have been evaluated using several test cases that all use met_em files generated with GFS origin data. These include,

  • "MetGrid" devtest, which is a microscale (dx = 200 m) simulation of a small region entirely over water in the Gulf of Mexico.
  • A mesoscale configuration (dx = 2520 m, nx = ny = 400) centered over Nevada. Results from this case are included below.

profiles_erf_wrf_metgrid_0200-0200

profiles_erf_wrf_metgrid_0300-0100

@gardner48 gardner48 self-assigned this Jun 3, 2024
…t. This includes,\n * an updated vertical interpolator used when interpolating met_em files onto the ERF vertical grid.\n * option to either interpolate potential temperature or interpolate pressure and temperature then calculate potential temperature.\n * debugging runtime options to overwrite incoming met_em data with idealized hard-coded values.
@wiersema1 wiersema1 force-pushed the metgrid_interpolator branch from d4769fa to 44bae4b Compare October 1, 2024 20:34
wiersema1 and others added 16 commits October 23, 2024 15:32
… to use fixed-size amrex Array1D variables instead of amrex Vector. This was done in an attempt to satisfy HIP, which would choke when resizing Vectors.
…ABs for each met_em timestamp to a single FAB since we only ever need access to these FABs for whatever met_em time is currently being worked on. Minor clean up of the metgrid initialization code.
…roughout Initialization/ERF_init_from_metgrid.cpp.
…n the vertical interpolation scheme used for met_em data
@AMLattanzi AMLattanzi marked this pull request as ready for review November 13, 2024 21:02
@AMLattanzi AMLattanzi changed the title **DO NOT MERGE** Metgrid interpolator Metgrid interpolator Nov 13, 2024
@AMLattanzi AMLattanzi merged commit 41f6533 into erf-model:development Dec 6, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants