New URL for NEMO forge!

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
#2082 (agrif_create_coordinates writes incorrect u,v points to child grid file) – NEMO

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:

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 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, 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


  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


  CALL agrif_interp(G0%gphiu,G1%gphiu,'U')
  CALL agrif_interp(G0%gphiv,G1%gphiv,'V')

Commit History (1)


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

In 9632:

Error: Failed to load processor CommitTicketReference
No macro or processor named 'CommitTicketReference' found

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
Note: See TracTickets for help on using tickets.