Hello,
I am seeing some unusual behaviour with Zgrid when running VERIFICATION.
When I kick off the VERIFICATION run, the input observation file is altered. It then has incorrect Zgrid, so the observations are rejected and hence incorrect values are output to the mod file (NLmodel_value output in the mod file).
In my input obs.nc file I have Zgrid=50 and depth=-2 for SST obs (my model has 50 layers).
When I run the VERIFICATION, the obs file is first written to and altered. For the first day (of 6 daily times for which I have SST data) the Zgrid is altered from 50 to zero in some places and to range from 30-50 in others. At all following days Zgrid is left at 50.
The SST values that are output to the mod file are incorrect when the newly written Zgrid=50 or 0, and only make ‘some’ sense when Zgrid is between 30 and just under 50 i.e. on day 1.
I tried writing Zgrid as 49.8 rather than 50 but I still get the same error. I also tried leaving Zgrid at 50 and changed depth to 0 for SST, same error. I also tried swapping Zgrid and depth in the obs file, as I have done in 4D-Var applications in the past, but still get the same error.
I am wondering what is causing the obs file to be altered. How can I look at the code to see where (and why) this is happening? The obs file is altered right at the beginning when I kick off the run for the entire 6 day window, then is not altered as the model runs the course of the 6 days (writing to the history file). But the mod file is subsequently incorrect (with observations rejected) because of this initial altering of the obs file.
Obs file altered in VERIFICATION run such that Zgrid is wrong, then observations rejected
Re: Obs file altered in VERIFICATION run such that Zgrid is wrong, then observations rejected
Hi Collette. I think I had this problem before, and in order to avoid it I always precompute fractional Zgrid positions for all observations (Zgrid>0) in order to prevent ROMS from doing it. I think, the problem may be when some Zgrid values are positive, and some - negative. In ROMS Build directory: file obs_read.f90 has the following lines, which may be helpful to understand what is going on.
!
! Read in observation depth, Zobs. If negative, depth is meter. If
! greater than zero, Zobs is in model fractional vertical levels
! (1 <= Zobs <= N). If Zobs < 0, its fractional level value is
! computed in routine "extract_obs3d" and over-written so it can
! be written into the observation NetCDF file for latter use.
!
IF (wrote_Zobs(ng)) THEN
CALL netcdf_get_fvar (ng, model, OBS(ng)%name, &
& Vname(1,idObsZ), &
& Zobs(Mstr:), &
& ncid = OBS(ng)%ncid, &
& start = (/NstrObs(ng)/), &
& total = (/Nobs(ng)/))
IF (FoundError(exit_flag, NoError, 170, &
& "ROMS/Utility/obs_read.F")) RETURN
ELSE
CALL netcdf_get_fvar (ng, model, OBS(ng)%name, &
& Vname(1,idObsD), &
& Zobs(Mstr:), &
& ncid = OBS(ng)%ncid, &
& start = (/NstrObs(ng)/), &
& total = (/Nobs(ng)/))
IF (FoundError(exit_flag, NoError, 179, &
& "ROMS/Utility/obs_read.F")) RETURN
END IF
Load_Zobs(ng)=.FALSE.
IF ((MINVAL(Zobs).lt.0.0_r8).or. &
& (MAXVAL(Zobs).lt.0.0_r8)) THEN
Load_Zobs(ng)=.TRUE.
END IF
!
! If distributed-memory and Zobs in meters (Zobs < 0), zero-out
! Zobs values in all nodes but itself to facilitate exchages between
! tiles latter before writting into observation NetCDF file.
!
IF (.not.wrote_Zobs(ng)) THEN
CALL obs_depth (ng, MyRank, model)
END IF
Good luck,
Julia
!
! Read in observation depth, Zobs. If negative, depth is meter. If
! greater than zero, Zobs is in model fractional vertical levels
! (1 <= Zobs <= N). If Zobs < 0, its fractional level value is
! computed in routine "extract_obs3d" and over-written so it can
! be written into the observation NetCDF file for latter use.
!
IF (wrote_Zobs(ng)) THEN
CALL netcdf_get_fvar (ng, model, OBS(ng)%name, &
& Vname(1,idObsZ), &
& Zobs(Mstr:), &
& ncid = OBS(ng)%ncid, &
& start = (/NstrObs(ng)/), &
& total = (/Nobs(ng)/))
IF (FoundError(exit_flag, NoError, 170, &
& "ROMS/Utility/obs_read.F")) RETURN
ELSE
CALL netcdf_get_fvar (ng, model, OBS(ng)%name, &
& Vname(1,idObsD), &
& Zobs(Mstr:), &
& ncid = OBS(ng)%ncid, &
& start = (/NstrObs(ng)/), &
& total = (/Nobs(ng)/))
IF (FoundError(exit_flag, NoError, 179, &
& "ROMS/Utility/obs_read.F")) RETURN
END IF
Load_Zobs(ng)=.FALSE.
IF ((MINVAL(Zobs).lt.0.0_r8).or. &
& (MAXVAL(Zobs).lt.0.0_r8)) THEN
Load_Zobs(ng)=.TRUE.
END IF
!
! If distributed-memory and Zobs in meters (Zobs < 0), zero-out
! Zobs values in all nodes but itself to facilitate exchages between
! tiles latter before writting into observation NetCDF file.
!
IF (.not.wrote_Zobs(ng)) THEN
CALL obs_depth (ng, MyRank, model)
END IF
Good luck,
Julia
- jivica
- Posts: 172
- Joined: Mon May 05, 2003 2:41 pm
- Location: The University of Western Australia, Perth, Australia
- Contact:
Re: Obs file altered in VERIFICATION run such that Zgrid is wrong, then observations rejected
Hi Colette,
as Julia pointed out in her email, you should look at the ./ROMS/Utility/obs_read.F and ./ROMS/Adjoint/ad_extract_obs.F (this one in particular)
There you can see what is going on. I remember Hernan updated the logic behind reading/extracting obs to prevent rejecting of the bottom (and surface) most values.
Before, we (Brian and myself) added a few lines just to make sure all obs are used using "z" fractional grid coordinate.
Using absolute depths in the shallow tidal region can cause rejection (i.e. during the low tide etc)...
Make sure you are using the recent version of the ROMS.
Cheers,
Ivica
as Julia pointed out in her email, you should look at the ./ROMS/Utility/obs_read.F and ./ROMS/Adjoint/ad_extract_obs.F (this one in particular)
There you can see what is going on. I remember Hernan updated the logic behind reading/extracting obs to prevent rejecting of the bottom (and surface) most values.
Before, we (Brian and myself) added a few lines just to make sure all obs are used using "z" fractional grid coordinate.
Using absolute depths in the shallow tidal region can cause rejection (i.e. during the low tide etc)...
Make sure you are using the recent version of the ROMS.
Cheers,
Ivica
Re: Obs file altered in VERIFICATION run such that Zgrid is wrong, then observations rejected
Thank you for your help.
I have double and tripled checked and I believe my Zgrid and depth values are correct. Yet the observations are still being rejected. Is there a way I can find out why ROMS is rejecting the obs? I see that they are rejected in the log file but cannot figure out why. They are within the time limit and the lon and lat limits, and the depths and Zgrid are correct.
I have double and tripled checked and I believe my Zgrid and depth values are correct. Yet the observations are still being rejected. Is there a way I can find out why ROMS is rejecting the obs? I see that they are rejected in the log file but cannot figure out why. They are within the time limit and the lon and lat limits, and the depths and Zgrid are correct.
Re: Obs file altered in VERIFICATION run such that Zgrid is wrong, then observations rejected
The Zgrid values in my obs file are all between 1-50 where nlayers=50, and the depth values are all 0 or less (0 or negative). From the ROMS code I cannot see how it is then possible that the Zgrid values in the obs file are being overwritten.
When I have run similar VERIFICATION runs in the past, the obs files remain unaltered and none of the obs are rejected, all observation times and locations are output in the mod file as NLmodel_value.
I am lost as to where to look to fix this issue.
When I have run similar VERIFICATION runs in the past, the obs files remain unaltered and none of the obs are rejected, all observation times and locations are output in the mod file as NLmodel_value.
I am lost as to where to look to fix this issue.
Re: Obs file altered in VERIFICATION run such that Zgrid is wrong, then observations rejected
Did you ever find a solution for this problem?