Fix incorrect qrn gradient scaling in WRFDA radial velocity adjoint#2356
Fix incorrect qrn gradient scaling in WRFDA radial velocity adjoint#2356Weiyu-Yang wants to merge 1 commit into
Conversation
|
Regression test results: |
|
To facilitate the review process, I have created a standalone Tangent Linear (TL) and Adjoint (AD) testing suite to verify the sensitivities of the rain mixing ratio ( 1. Mathematical FoundationThe strict correctness of an adjoint operator is verified by the following inner product identity:
Theoretically, within machine floating-point precision, both sides of the equation ( 2. Test Results Before the FixIn the original official code ( Conclusion: As shown above, the right side ( 3. Test Results After the FixAfter applying the correction ( Conclusion: The adjoint test now passes perfectly, maintaining precision up to the limits of double-precision floating-point format. 4. Attached Files for VerificationPlease find the attached
(Please see the attached |
Fix incorrect gradient scaling of rain mixing ratio in WRFDA radial velocity adjoint
TYPE:
bug fix
KEYWORDS:
WRFDA, radar, radial velocity, adjoint, tangent linear, gradient, rain mixing ratio
SOURCE:
Weiyu Yang (Nanjing University of Information Science and Technology)
DESCRIPTION OF CHANGES:$10^{-6}$ compared to the true analytical adjoint, causing the traditional Adjoint Test to fail significantly.
Problem:
In the WRFDA radial velocity tangent linear code, the rain mixing ratio (
qrn) is scaled by a factor of 1000 (qrn_g = qrn * 1000.). According to the strict definition of an adjoint operator (the transpose of the tangent linear operator), the backward propagation of the gradient must also be scaled by 1000 and accumulated. However, the current official adjoint code (da_radial_velocity_adj.inc) incorrectly applies an inverse operation (qrn = qrn_g * 0.001) instead of the transpose operation. This scales the gradient incorrectly by a factor ofSolution:
Modified the source code to strictly follow the mathematical transpose logic of the tangent linear operator:
qrn_gto0.0.qrn = qrn + qrn_g * 1000.0.ISSUE:
N/A
LIST OF MODIFIED FILES:
M var/da/da_radar/da_radial_velocity_adj.inc
TESTS CONDUCTED:
real*8). Before the fix, the adjoint test failed because the analytical gradient was scaled by 0.001 instead of 1000. After the fix, the test passed perfectly. The inner products(Hx)^T * (Hx)andx^T * H^T * (Hx)match exactly up to 15-16 significant digits (the machine precision limit) across perturbation scales fromRELEASE NOTE:
Fixed a gradient calculation bug in the WRFDA radial velocity adjoint operator (
da_radial_velocity_adj.inc). The sensitivities of the rain mixing ratio (qrn) were previously scaled incorrectly due to the use of an inverse operation instead of a mathematical transpose operation. This fix ensures the strict accuracy of the adjoint gradient for radar radial velocity assimilation.