Opened 7 weeks ago
Last modified 5 weeks ago
#967 closed defect
IMPORTANT: Updating mixed-precision split 4D-Var RPCG solver — at Version 2
Reported by: | arango | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | Release ROMS/TOMS 4.2 |
Component: | Nonlinear | Version: | 4.1 |
Keywords: | Cc: |
Description (last modified by )
github.com/myroms/roms/pull/33
A few routines were updated to allow compiling and running split 4D-Var with mixed precision.
The split 4D-Var algorithms (like RBL4DVAR_SPLIT) recommend the mixed precision approach to accelerate computations. The executing script (see submit_split_rbl4dvar.sh) uses multiple ROMS executables, which runs the outer loop in double precision (nonlinear background trajectory, prior) and single precision in the inner loops (tangent linear and adjoint minimization, increment phase).
In this update, several of the variables needed by the RPCG solver are declared in double precision to reduce the impact of rounding error and the convergence of the minimization algorithm (rpcg_lanczos.F) when computing dot-products and Ritz eigenvalues and eigenvectors.
We use the real(dp) to declare specific internal variables in such cases. For example, in rpcg_lanczos.F, we have:
! ! Local variable declarations. ! logical :: Ltrans, Laug ! integer :: i, ic, j, iobs, ivec, Lscale, info ! real(dp) :: zbet, eps, preducv, preducy real(dp) :: Jopt, Jf, Jmod, Jdata, Jb, Jobs, Jact, cff ! real(dp), dimension(NinnLoop) :: zu, zgam, zfact, ztemp3 real(dp), dimension(NinnLoop) :: ztemp1, ztemp2, zu1, zu2 real(dp), dimension(NinnLoop) :: ztemp4 real(dp), dimension(Ndatum(ng)+1) :: px, pgrad, zw, zt real(dp), dimension(Ndatum(ng)+1) :: zhv, zht, zd real(dp), dimension(Ninner,3) :: zwork real(dp), dimension(2*(NinnLoop-1)) :: work real(dp), dimension(Ninner,Ninner) :: zgv
Many thanks to Pariza Heidary (NOAA) and Julia Levin for bringing this to my attention.
Change History (2)
comment:1 by , 7 weeks ago
Description: | modified (diff) |
---|
comment:2 by , 7 weeks ago
Description: | modified (diff) |
---|