Add AMReX-based inflow reader to AWAE for FAST.Farm #3238
Add AMReX-based inflow reader to AWAE for FAST.Farm #3238deslaughter wants to merge 54 commits intoOpenFAST:devfrom
Conversation
- rearranged some locations of files
- had to hard code locations of libraries from amrex. I should not need to do this:
target_link_libraries(amrex_reader ${CMAKE_BINARY_DIR}/dependencies/amrex/Src/libamrex.a)
target_include_directories(amrex_reader PUBLIC ${CMAKE_BINARY_DIR}/dependencies/amrex/mod_files_3d/)
There was a problem hiding this comment.
Pull request overview
Adds an optional AMReX-based inflow reader to AWAE/FAST.Farm (enabled via AMREX_READER=ON) and integrates it into CI/regression/unit tests.
Changes:
- Introduces C++/Fortran AMReX reader wrappers (
amrex_utils.cpp+amrex_utils.F90) and wires AMReX FetchContent + linking in CMake. - Adds AMReX inflow mode (Mod_AmbWind=4) plumbing across AWAE + FAST.Farm I/O and summary output.
- Adds a new AMReX unit test plus AMReX regression test and accompanying plotfile test data.
Reviewed changes
Copilot reviewed 74 out of 79 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| unit_tests/CMakeLists.txt | Adds AMReX reader unit test target and copies required test data into the build tree. |
| reg_tests/r-test | Updates r-test submodule pointer for new/updated regression inputs. |
| reg_tests/CTestList.cmake | Registers a new FAST.Farm regression test case for AMReX inflow. |
| modules/version/tests/versioninfo_utest.F90 | Forces serial execution of testdrive suites. |
| modules/nwtc-library/tests/nwtc_library_utest.F90 | Forces serial execution of testdrive suites. |
| modules/inflowwind/tests/inflowwind_utest.F90 | Forces serial execution of testdrive suites. |
| modules/beamdyn/tests/beamdyn_utest.F90 | Forces serial execution of testdrive suites. |
| modules/aerodyn/tests/aerodyn_utest.F90 | Forces serial execution of testdrive suites. |
| modules/awae/tests/test_AMReX_reader.f90 | Adds unit tests for AMReX header/data reading and subvolume discovery logic. |
| modules/awae/tests/AMReX_reader_utest.F90 | Adds a standalone testdrive runner for AMReX unit tests with AMReX init/finalize. |
| modules/awae/tests/data/subvolmultiple_1_00040/Level_0/Cell_H | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_1_00040/Level_0/Cell_D_00065 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_1_00040/Level_0/Cell_D_00064 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_1_00040/Header | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_1_00032/Level_0/Cell_H | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_1_00032/Level_0/Cell_D_00065 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_1_00032/Level_0/Cell_D_00064 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_1_00032/Header | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_1_00024/Level_0/Cell_H | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_1_00024/Level_0/Cell_D_00065 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_1_00024/Level_0/Cell_D_00064 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_1_00024/Header | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_1_00016/Level_0/Cell_H | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_1_00016/Level_0/Cell_D_00065 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_1_00016/Level_0/Cell_D_00064 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_1_00016/Header | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_1_00008/Level_0/Cell_H | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_1_00008/Level_0/Cell_D_00065 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_1_00008/Header | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_1_00000/Level_0/Cell_H | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_1_00000/Header | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00040/Level_0/Cell_H | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00040/Level_0/Cell_D_00065 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00040/Level_0/Cell_D_00064 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00040/Header | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00036/Level_0/Cell_H | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00036/Level_0/Cell_D_00065 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00036/Level_0/Cell_D_00064 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00036/Header | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00030/Level_0/Cell_H | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00030/Level_0/Cell_D_00065 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00030/Level_0/Cell_D_00064 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00030/Header | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00024/Level_0/Cell_H | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00024/Level_0/Cell_D_00065 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00024/Level_0/Cell_D_00064 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00024/Header | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00018/Level_0/Cell_H | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00018/Level_0/Cell_D_00065 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00018/Level_0/Cell_D_00064 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00018/Header | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00012/Level_0/Cell_H | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00012/Level_0/Cell_D_00065 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00012/Level_0/Cell_D_00064 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00012/Header | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00006/Level_0/Cell_H | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00006/Level_0/Cell_D_00065 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00006/Level_0/Cell_D_00064 | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00006/Header | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00000/Level_0/Cell_H | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/tests/data/subvolmultiple_0_00000/Header | Adds AMReX plotfile fixture data for unit tests. |
| modules/awae/src/amrex_utils.cpp | Implements C++ AMReX plotfile header/data reading and subvolume scanning for Fortran. |
| modules/awae/src/amrex_utils.F90 | Adds Fortran wrappers around the C++ AMReX utilities and stubs when disabled. |
| modules/awae/src/AWAE_Types.f90 | Extends AWAE types/serialization for AMReX directory indexing parameters. |
| modules/awae/src/AWAE_Registry.txt | Updates AWAE registry to include new AMReX parameters in generated types. |
| modules/awae/src/AWAE_IO.f90 | Adds AMReX read path and renames VTK reader routines for clarity. |
| modules/awae/src/AWAE.f90 | Wires Mod_AmbWind=4 into initialization, validation, update states, and cleanup. |
| modules/awae/CMakeLists.txt | Adds AMReX sources and links AMReX when AMREX_READER is enabled. |
| glue-codes/fast-farm/src/FAST_Farm_Subs.f90 | Updates WAT discretization logic for AMReX ambient wind mode. |
| glue-codes/fast-farm/src/FAST_Farm_IO.f90 | Adds AMReX configuration inputs and improves per-mode path/time-step handling. |
| glue-codes/fast-farm/src/FAST_Farm.f90 | Initializes/finalizes AMReX runtime from the FAST.Farm main program. |
| docs/source/user/api_change.rst | Documents new FAST.Farm primary-file inputs for AMReX mode (Mod_AmbWind=4). |
| CMakeLists.txt | Adds AMREX_READER option + FetchContent integration for AMReX dependency. |
| .github/workflows/automated-dev-tests.yml | Enables AMReX reader in CI builds and modifies workspace artifact packaging. |
Comments suppressed due to low confidence (4)
modules/awae/tests/test_AMReX_reader.f90:1
- This test module uses
c_double,c_int, andc_floatkind-suffixed literals, but does notuse iso_c_bindingto import those named constants. This should fail to compile on a standard-conforming compiler. Adduse iso_c_binding, only: c_double, c_int, c_float(or switch these literals to the project’sDbKi/IntKi/SiKikinds consistently).
modules/awae/tests/test_AMReX_reader.f90:1 - This test module uses
c_double,c_int, andc_floatkind-suffixed literals, but does notuse iso_c_bindingto import those named constants. This should fail to compile on a standard-conforming compiler. Adduse iso_c_binding, only: c_double, c_int, c_float(or switch these literals to the project’sDbKi/IntKi/SiKikinds consistently).
modules/awae/tests/test_AMReX_reader.f90:1 - This test module uses
c_double,c_int, andc_floatkind-suffixed literals, but does notuse iso_c_bindingto import those named constants. This should fail to compile on a standard-conforming compiler. Adduse iso_c_binding, only: c_double, c_int, c_float(or switch these literals to the project’sDbKi/IntKi/SiKikinds consistently).
modules/awae/tests/test_AMReX_reader.f90:1 - This test module uses
c_double,c_int, andc_floatkind-suffixed literals, but does notuse iso_c_bindingto import those named constants. This should fail to compile on a standard-conforming compiler. Adduse iso_c_binding, only: c_double, c_int, c_float(or switch these literals to the project’sDbKi/IntKi/SiKikinds consistently).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 74 out of 79 changed files in this pull request and generated 10 comments.
Comments suppressed due to low confidence (1)
unit_tests/CMakeLists.txt:1
- Using an
ALLcustom target for copying test data can add unnecessary work to every build (even when nothing changed). Consider tying the copy step to the AMReX unit test target (e.g., a POST_BUILD step or a custom command that generates a stamp output), so it runs only when building/running that test.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| do nt = 1, p%NumTurbines | ||
|
|
||
| ! Loop through high resolution grids | ||
| do i_hl = 0, n_high_low |
There was a problem hiding this comment.
We'll have to update this indexing after merging 4.2.1 in. Some other logic as well.
Co-authored-by: Andy Platt <andrew-platt@users.noreply.github.com>
Co-authored-by: Andy Platt <andrew-platt@users.noreply.github.com>
This PR is almost ready to merge, pending feedback from @rthedin.
Feature or improvement description
This PR adds an AMReX file reader to AWAE (must enable AMREX_READER=ON when configuring CMake) so it can use inflow files in this format.
Impacted areas of the software
Additional supporting information
The AMReX reader is based on the AMReX library, which CMake fetches during configuration and then AWAE is linked against it during compilation. Two new modules were added which wrap this library and make it available to AWAE:
amrex_utils.cppandamrex_utils.F90. Since AMReX is a C++ library, theamrex_utils.cppwraps the necessary calls and provides Fortran compatible functions which are wrapped inamrex_utils.F90to be compatible with the standard types used in OpenFAST.Generative AI usage
Test results, if applicable