Skip to content

Commit

Permalink
Add comment block for adjoint test
Browse files Browse the repository at this point in the history
  • Loading branch information
samhatfield committed Mar 7, 2025
1 parent 8591169 commit 5a853a1
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tests/trans/test_adjoint.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@
! nor does it submit to any jurisdiction.
!

! ==================================================================================================
! Adjoint test
! ==================================================================================================
!
! This program performs a rudimentary check of tangent-linear/adjoint correspondence of the inverse
! and direct spectral transform.
!
! The program checks the correspondence of <DIR_TRANS(INV_TRANS(X)), Y> and
! <X, INV_TRANSAD(DIR_TRANSAD(Y))>, which with infinite precision should match exactly. In practice
! there is some divergence due to rounding errors. In this program we check whether the two
! expressions are the same to within a tolerance of 2000 * machine epsilon.
!
! The check is only performed for scalar fields (PSPSCALAR). Wind fields are not checked.
!
! ==================================================================================================

PROGRAM TEST_ADJOINT

USE PARKIND1, ONLY: JPIM, JPRB
Expand Down Expand Up @@ -44,11 +60,9 @@ PROGRAM TEST_ADJOINT

LUSE_MPI = DETECT_MPIRUN()

! ======== PARAMETERS WHICH MAY BE MODIFIED, ORIGINALLY COMING FROM NAMELIST ===========
NDGL = 32 ! Number of latitudes from pole to equator
NFLEVG = 9 ! Number of levels
NPROMA = 8 ! Gridpoint block size
! ======================================================================================

! Determine spectral space parameters
NSMAX = (2 * NDGL - 1) / 3 ! Full Gaussian grid
Expand Down

0 comments on commit 5a853a1

Please sign in to comment.