Conversation
|
Okay, mostly in a good state now: This PR adds analytic tests for The PR adds a new test directory, "analytic". This contains a test program, analytic_test.F90. This program is similar to the ecTrans benchmark program, but with fewer options, no timing capability, and a more targeted, analytic correctness checker. The core of the program is a loop over all zonal ZMAX_ERROR = 0.0_JPRB
! Loop over all wavenumbers (check actually tested wavenumber inside)
DO M = 0, NSMAX
! Prepare Legendre polynomials for this zonal wavenumber
CALL PREPARE_LEGENDRE_POLYNOMIALS(M, NSMAX)
DO N = M, NSMAX
CALL INITIALIZE_SPECTRAL_ARRAY(NSMAX, M, N, ZSPSCALAR)
! Compute analytic solutions
ZSPH_ANALYTIC = COMPUTE_ANALYTIC_SOLUTION(NPROMA, NGPBLKS, NGPTOT, M, N)
! Do inverse transform
CALL INV_TRANS(PSPSCALAR=ZSPSCALAR, KPROMA=NPROMA, KVSETSC=IVSET, PGP=ZGP)
ZMAX_ERROR = MAX(ZMAX_ERROR, COMPUTE_MAX_ERROR(NGPTOT, NPROMA, ZGP(:, 1, :), ZSPH_ANALYTIC(:, :)))
! Do direct transform
CALL DIR_TRANS(PGP=ZGP, KPROMA=NPROMA, KVSETSC=IVSET, PSPSCALAR=ZSPSCALAR)
END DO
END DOAt each Computation of the analytic solutions uses Crucially, computation of the analytic solution doesn't involve a GEMM, an FFT, nor any of I will mark this as ready for review so reviewers can give any early opinions, but the following still needs to be done:
|
There was a problem hiding this comment.
Pull request overview
Adds a new Fortran-based analytic correctness test suite for ecTrans transforms, wiring it into the existing CTest/ecbuild test structure.
Changes:
- Introduces
ANALYTIC_UTILShelper module for grid geometry lookup and Legendre polynomial preparation. - Adds
ANALYTIC_TESTprogram that runs inverse/direct transforms across wavenumbers and checks error against a tolerance. - Integrates the new analytic test targets into the test CMake configuration.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 14 comments.
| File | Description |
|---|---|
tests/trans/analytic/analytic_utils.F90 |
New helper module to build lon/lat arrays, precompute Legendre polynomials, and compute analytic reference fields/errors. |
tests/trans/analytic/analytic_test.F90 |
New test driver program that sets up ecTrans, generates analytic references, runs transforms, and checks errors. |
tests/trans/analytic/CMakeLists.txt |
Adds library/executable build rules and registers analytic tests for precisions/platforms/MPI configurations. |
tests/CMakeLists.txt |
Hooks trans/analytic into the global tests build, alongside existing test suites. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Andreas Mueller <Andreas.Mueller@ecmwf.int>
Does not pass yet.
I don't think it's necessary to make these command line arguments. For debugging, one can just modify the code and rebuild the test executable.
a65ee70 to
f3c814b
Compare
* develop: CI: bump openmpi version to 5.0.7 and avoid need for --oversubscribe Fix CI for intel-classic by removing ambiguity with mpi installations Permit testing with 4 MPI tasks with bitreproducible CI for CPU (#350) Refactor compare_checksums.py (#381) missing routine (horiz_field) in precision renamings (#382)
Will explain this properly once it's working (you can probably guess what it is).