Code: Select all
!-----------------------------------------------------------------------
! Compute and write initial and final model-observation misfit
! (innovation) vector for output purposes only. Write also initial
! nonlinear model at observation locations.
!-----------------------------------------------------------------------
!
IF (wrtMisfit(ng)) THEN
DO iobs=Mstr,Mend
# if defined IS4DVAR
misfit(iobs)=ObsScale(iobs)*SQRT(ObsErr(iobs))* &
& (NLmodVal(iobs)+TLmodVal(iobs)-ObsVal(iobs))
But I think the 'TLmodVal' term should be taken out for the outer loops, especially for the very last nonlinear run.
I did a very simple test, which is just a one day assimilation using a single mooring data.
In order to fit the data perfectly, I inflated the model standard devation on purpose.
So the ROMS should yield very small misfit.
When I looked at the variable named 'misfit_final', I was very surprised and thought that something is very wrong.
But it turned out the way how ROMS compute the misfit.
After taking out the 'TLmodVal' from the misfit, everything looks perfect.
Please see this figure.
(Blue, red and black lines represent the initial misfit, final misfit from the calculation above (ROMS) and corrected misfit in which the 'TLmodVal' is removed.)