Opened 5 years ago
Closed 5 years ago
#2082 closed Bug (fixed)
agrif_create_coordinates writes incorrect u,v points to child grid file
Reported by: | mdunphy | Owned by: | systeam |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | AGRIF | Version: | trunk |
Severity: | minor | Keywords: | |
Cc: |
Description (last modified by nicolasmartin)
The agrif_create_coordinates program writes the wrong values for the u and v points when producing a child grid coordinates.nc file. The code assumes a regular lon,lat grid, but that is not the case for many grids, such as ORCA-based grids.
This was probably overlooked because the model doesn't make use of the u,v coordinates (when jphgr_msh=0), rather it loads scale factors from coordinates.nc, and the child-grid scale factors are correct despite the error. Also T and F grid business (bathy, etc) would be unaffected -- so many simulations will not notice this bug. However, there is at least one case where it matters, which is agrif_create_restart that would be slightly affected due to interpolating velocities to the incorrect u,v points.
Christoph Renkl discovered this bug.
For a fix: in agrif_create_coordinates.f90, change
G1%glamu = G1%glamf G1%glamv = G1%glamt
to
CALL agrif_interp(G0%glamu,G1%glamu,'U') CALL agrif_interp(G0%glamv,G1%glamv,'V')
and also change
G1%gphiu = G1%gphit G1%gphiv = G1%gphif
to
CALL agrif_interp(G0%gphiu,G1%gphiu,'U') CALL agrif_interp(G0%gphiv,G1%gphiv,'V')
Commit History (1)
Changeset | Author | Time | ChangeLog |
---|---|---|---|
9632 | jchanut | 2018-05-25T12:23:11+02:00 | Correct child velocity points lat/lon interpolation, #2082 |
Change History (3)
comment:1 Changed 5 years ago by nicolasmartin
- Description modified (diff)
comment:2 Changed 5 years ago by jchanut
comment:3 Changed 5 years ago by jchanut
- Resolution set to fixed
- Status changed from new to closed
- Version changed from v3.6 to trunk
In 9632: