27 subroutine eakf_analysis(num_hor,num_ver,this_hor,this_ver,boundary,x,N&
28 &,statedim,obsdim,rho)
30 integer,
parameter :: rk = kind(1.0d0)
31 integer,
intent(in) :: N,stateDim,obsDim
32 real(kind=rk),
dimension(stateDim,N),
intent(inout) :: x
33 integer,
intent(in) :: num_hor,num_ver,this_hor,this_ver,boundary
34 real(kind=rk),
intent(in) :: rho
36 real(kind=rk),
dimension(obsDim) :: y
37 real(kind=rk),
dimension(obsDim) :: d,dd
38 real(kind=rk),
dimension(stateDim) :: mean_x
39 real(kind=rk),
dimension(obsDim) :: Hmean_xf
40 real(kind=rk),
dimension(stateDim,N) :: Xpf
41 real(kind=rk),
dimension(N) :: G,S,dn
42 real(kind=rk),
dimension(stateDim,N) :: F,FG,FGU,Xpa
43 real(kind=rk),
dimension(obsDim,N) :: HFG,Ysf
44 real(kind=rk),
dimension(N,obsDim) :: YsfT
45 real(kind=rk),
dimension(obsDim,obsDim) :: VT
46 real(kind=rk),
dimension(N,N) :: WT,U
47 integer :: LWORK1,LWORK2,INFO
48 real(kind=rk),
dimension(:),
allocatable :: WORK1,WORK2
56 mean_x = mean_x + x(:,i)
58 mean_x = mean_x/
real(n,rk)
61 xpf(:,i) = (x(:,i) - mean_x)/sqrt(
real(n-1,rk))
123 lwork1 = 2*max( 3*n+statedim, 5*n )
124 allocate(work1(lwork1))
126 call dgesvd(
'S',
'S',statedim,n,xpf,statedim,g,f,statedim,wt,n,work1,lwork1,info)
128 print*,
'First SVD failed with info = ',info
129 print*,
'FYI work(1) = ',work1(1)
136 fg(:,i) = f(:,i)*g(i)
142 ysft = transpose(ysf)
209 lwork2 = 2*max( 3*n+obsdim, 5*n )
210 allocate(work2(lwork2))
212 call dgesvd(
'A',
'A',n,obsdim,ysft,n,s,u,n,vt,obsdim,work2,lwork2,info)
215 print*,
'Second SVD failed with info = ',info
216 print*,
'FYI work(1) = ',work2(1)
222 call dgemm(
'N',
'N',statedim,n,n,1.0_rk,fg,statedim,u,n,0.0_rk,fgu,statedim)
225 fgu(:,i) = fgu(:,i) / sqrt(1.0_rk + s(i)**2)
229 call dgemm(
'N',
'N',statedim,n,n,1.0_rk,fgu,statedim,wt,n,0.0_rk,xpa,statedim)
232 call
h(1,mean_x,hmean_xf)
233 hmean_xf = y - hmean_xf
237 call dgemv(
'N',obsdim,obsdim,1.0_rk,vt,obsdim,d,1,0.0_rk,dd,1)
240 dd(i) = dd(i)/ sqrt(1.0_rk + s(i)**2)
250 call dgemv(
'N',statedim,n,1.0_rk,fgu,statedim,dn,1,1.0_rk,mean_x,1)
256 x(:,i) = mean_x + sqrt(
real(n-1,rk))*xpa(:,i)
subroutine eakf_analysis(num_hor, num_ver, this_hor, this_ver, boundary, x, N, stateDim, obsDim, rho)
subroutine h(obsDim, nrhs, x, hx, t)
subroutine to take a full state vector x and return H(x) in observation space.
subroutine get_local_observation_data(num_hor, num_ver, this_hor, this_ver, boundary, obsDim, y)
subroutine solve_rhalf(obsdim, nrhs, y, v, t)
subroutine to take an observation vector y and return v in observation space.