dg_index skipping in check_refine.m

Bug reports, work arounds and fixes

Moderators: arango, robertson

Post Reply
Message
Author
bhayward
Posts: 11
Joined: Thu Aug 31, 2023 3:51 pm
Location: University of Maine

dg_index skipping in check_refine.m

#1 Unread post by bhayward »

Hello all,

I was working on checking volume conservation in my Nested Grid setup using check_refine.m, and ran into an issue where there was a banding pattern appearing in several variables.

inverseDX.png
inverseDX.png (39.92 KiB) Viewed 289 times
inverseDY.png
inverseDY.png (36.54 KiB) Viewed 289 times
area.png
area.png (37.6 KiB) Viewed 289 times
bathy.png
bathy.png (122.24 KiB) Viewed 289 times

Looking at check_refine.m, the issue was coming from dg_index . I've only plotted the gradient in the eta direction, but there is a similar pattern in the xi direction.
gradIndex.png
gradIndex.png (17.58 KiB) Viewed 289 times
This comes from the way the Idg and Jdg points are set. It seems like Idg and Jdg should increase linearly, so I make them increase linearly.

Code: Select all


oldIdg = fix(XrF(Imid) - 0.5) + 1;
oldJdg = fix(YrF(Jmid) - 0.5) + 1;
Idg = (1:size(oldIdg,2))+oldIdg(1)-1;
Jdg = (1:size(oldJdg,2))+oldJdg(1)-1;

jdgOldNew.png
jdgOldNew.png (17.21 KiB) Viewed 289 times
This workaround seems to be helpful for me. This issue might be related to the lat/lon rho points of my grid, but I'm fairly certain I am correctly following the fine2coarse methodology.
inverseDX_new.png
inverseDX_new.png (33.72 KiB) Viewed 289 times
inverseDY_new.png
inverseDY_new.png (33.71 KiB) Viewed 289 times
area_new.png
area_new.png (61.15 KiB) Viewed 289 times
bathy_new.png
bathy_new.png (114.58 KiB) Viewed 289 times
I do apologize for the oversized images. I see there is an imgh and imgw option, but I can't seem to figure out where to put them in the text.

Thank you!

-Ben

Post Reply