Commit f8a3fa18 authored by ronesy's avatar ronesy
Browse files

Change to error calculation for ocean boxes and added min error threshold

parent 701d705c
......@@ -83,7 +83,7 @@ subroutine init_ghg(files, config, fluxes, obs, states, covar)
real :: area
real(kind=8) :: jd
integer :: ix, jy, ix0, jy0
integer :: n, nread, num
integer :: n, nb, nread, num
integer :: ierr
! global prior fluxes
......@@ -230,11 +230,11 @@ subroutine init_ghg(files, config, fluxes, obs, states, covar)
if ( (nbox_xy(ix,jy).gt.0).and.(lsm(ix,jy).ge.0.01) ) then
! land box -> error is proportional to flux
err_box(nbox_xy(ix,jy),n) = err_box(nbox_xy(ix,jy),n) + &
(flx(ix0+ix-1,jy0+jy-1,n) * config%flxerr * area)**2
(abs(flx(ix0+ix-1,jy0+jy-1,n)) * config%flxerr * area)**2
else if ( config%inc_ocean ) then
! ocean box -> minimum error
! ocean box -> error is proportional to flux
err_box(nbox_xy(ix,jy),n) = err_box(nbox_xy(ix,jy),n) + &
(config%flxerr_ll/3600. * numscale * area)**2
(abs(flx(ix0+ix-1,jy0+jy-1,n)) * config%flxerr * area)**2
endif
end do
end do
......@@ -243,6 +243,13 @@ subroutine init_ghg(files, config, fluxes, obs, states, covar)
err_box(:,n) = sqrt(err_box(:,n))/area_box
end do
! set minimum error
do n = 1, ntstate
do nb = 1, nbox
err_box(nb,n) = max(config%flxerr_ll/3600.*numscale,err_box(nb,n))
end do
end do
! verbose output
! --------------
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment