﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
969	VERY IMPORTANT: Mixed precision for Split 4D-Var	arango		"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 r**pcg_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."	defect	closed	major	Release ROMS/TOMS 4.2	Nonlinear	4.1	Fixed		
