Skip to content

Commit

Permalink
Bug fix for TAMDAR T VarBC (#1632)
Browse files Browse the repository at this point in the history
Bug fix for TAMDAR T variational bias correction

TYPE: bug fix

KEYWORDS: TAMDAR, VarBC

SOURCE: Yi-Chuan Lo (Taiwan Central Weather Bureau), Feng Gao (WeatherFlow Inc.)

DESCRIPTION OF CHANGES:
Problem:
Yi-Chuan Lo at CWB found inconsistency between TAMDAR and Radiance VarBC code.

Solution:
Feng Gao confirmed there is a bug in TAMDAR VarBC code and provided bug fix.

LIST OF MODIFIED FILES: 
M   var/da/da_varbc_tamdar/da_varbc_tamdar_tl.inc
M   var/da/da_varbc_tamdar/da_varbc_tamdar_update.inc

TESTS CONDUCTED: 
1. WRFDA regression tests passed.
2. Jenkins tests are OK

RELEASE NOTE: Bug fix for TAMDAR T VarBC.
  • Loading branch information
liujake authored Jan 15, 2022
1 parent 92fd706 commit 7b642cc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions var/da/da_varbc_tamdar/da_varbc_tamdar_tl.inc
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@
type (y_type), intent(inout) :: y ! y = h (xa)

integer :: isn,ivar,iflt,ipred,iobs,iphase
integer :: npred
real :: delta_bc

real, allocatable :: varbc_param_tl(:)


if (trace_use) call da_trace_entry("da_varbc_tamdar_tl")

allocate( varbc_param_tl(iv%varbc_tamdar%npred) )
npred = iv%varbc_tamdar%npred
allocate( varbc_param_tl(npred) )

do iflt = 1, iv%varbc_tamdar%nair
do iphase = 1, iv%varbc_tamdar%nphase
Expand All @@ -30,14 +32,14 @@

varbc_param_tl(:) = 0.0

do ipred = 1, iv%varbc_tamdar%npred
do ipred = 1, npred
varbc_param_tl(ipred) = &
SUM( cv(iv%varbc_tamdar%index(ipred,iphase,iflt)) * &
iv%varbc_tamdar%vtox(ipred,1:iv%varbc_tamdar%npred,iphase,iflt) )
SUM( cv(iv%varbc_tamdar%index(1:npred,iphase,iflt)) * &
iv%varbc_tamdar%vtox(ipred,1:npred,iphase,iflt) )
end do

delta_bc = SUM( varbc_param_tl(1:iv%varbc_tamdar%npred)* &
iv%varbc_tamdar%pred(1:iv%varbc_tamdar%npred,iphase,iflt) )
delta_bc = SUM( varbc_param_tl(1:npred)* &
iv%varbc_tamdar%pred(1:npred,iphase,iflt) )

do iobs = 1, iv%varbc_tamdar%nobs(iphase,iflt)
isn = iv%varbc_tamdar%obs_sn(iobs,iphase,iflt)
Expand Down
2 changes: 1 addition & 1 deletion var/da/da_varbc_tamdar/da_varbc_tamdar_update.inc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
if (iv%varbc_tamdar%nobs(iphase,iflt) > 0 .and. iv%varbc_tamdar%ifuse(iphase,iflt) > 0) then
do ipred = 1, npred
varbc_param_tl(ipred,iphase,iflt) = &
SUM( cv(iv%varbc_tamdar%index(ipred,iphase,iflt)) * &
SUM( cv(iv%varbc_tamdar%index(1:npred,iphase,iflt)) * &
iv%varbc_tamdar%vtox(ipred,1:npred,iphase,iflt) )
end do
end if
Expand Down

0 comments on commit 7b642cc

Please sign in to comment.