Error in Flux Integrals in Correct_Tracer - two-way nesting

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
leighton
Posts: 7
Joined: Wed Dec 02, 2015 9:06 pm
Location: SRI International

Error in Flux Integrals in Correct_Tracer - two-way nesting

#1 Unread post by leighton »

I've been struggling with a deep water :arrow: two-way nesting issue and after a few false starts I have followed the problem to and into the correct_tracer_tile routine in nesting.F.

The fine grid flux integrals in correct_tracer_tile do not properly account for the coarse grid time interval.

Correct_tracer performs a two-way nesting update of boundary values of the coarse grid tracer field using the difference between the area-integrated (not averaged as stated in initial post), time-integrated fine and coarse boundary fluxes (TFF-TFC), seen below in a nomenclature like the comments in the ROMS code. The timestep interval, dt(ng), is applied in the routine bry_fluxes, but does not appear in the comments.
ROMSFluxEqn.png
ROMSFluxEqn.png (29.3 KiB) Viewed 6458 times
The expression changes slightly depending on which boundary is being corrected.

The fine grid time summation is missing in tracer_correct_tile, ver 783. Therefore only the flux from the most recent fine grid time step contributes the two-way nesting tracer correction.

As coded and for the tests I've run, the relative correction at the nesting boundary is (TFF-TFC)*pn*pm*Dinv/T_c ~ 10^{-2}, since TFC ~ dt(ngc)/dt(ngf)*TFF. If ROMS is run in a synchronized fashion, ie a common time step for all grids, (TFF-TFC)*pn*pm*Dinv/T_c ~ 10^{-8} or smaller. This is consistent with what was observed in viewtopic.php?f=14&t=4288 - synchronization eliminated my observed nesting error.

If I use the KLUDGE of replacing the summation over the fine grid time steps with a multiplication by the time refinement factor , then (TFF-TFC)*pn*pm*Dinv/T_c ~ 10^{-6} and the nesting errors I reported disappear. This kludge assumes fine grid boundary flux is constant over the coarse time step. This kludge is not a valid correction since the fine grid flux at the boundaries does not stay constant over the interval.

User avatar
arango
Site Admin
Posts: 1347
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: Error in Flux Integrals in Correct_Tracer - two-way nest

#2 Unread post by arango »

Yes, thank you very much for reporting this problem with great detail and providing a solution :!: I know that this kind of problems are kind of frustrating and takes a lot of patience to find them. It is refreshing when users get deep into the code and try to understand and find solutions to the problem :) The code was updated. See the following :arrow: trac ticket for more information.

Post Reply