MPAS-Dev / MPAS-Model

Repository for MPAS models and shared framework releases.
237 stars 318 forks source link

Vertical loop error for tend_w in mpas_atm_time_integration.F #5

Closed wgustafson closed 10 years ago

wgustafson commented 11 years ago

Matus Martini and I discovered a bug at line 2488 of mpas_atm_time_integration.F. This line loops from k=1,nVertLevels to calculate tend_w. However, ru_edge_w(k) is only given values for k=2,nVertLevels.

We believe the appropriate fix is just to change line 2488 to loop from k=2,nVertLevels since the w-tendency is always zero at the bottom anyway, and it is given that value higher up in the subroutine.

-Bill


William I. Gustafson Jr., Ph.D. Scientist ATMOSPHERIC SCIENCES AND GLOBAL CHANGE DIVISION

Pacific Northwest National Laboratory P.O. 999, MSIN K9-30 Richland, WA 99352 Tel: 509-372-6110 William.Gustafson@pnnl.gov http://www.pnnl.gov/atmospheric/staff/staff_info.asp?staff_num=5716 http://www.researcherid.com/rid/A-7732-2008

matusmartini commented 11 years ago

Hi Michael,

We noticed NAN values for tend_w at k=1 distributed randomly in blocks around the earth. This is just a cosmetic correction since the tend_w at k=1 do not seem to be used later in the integration.

Matus

Matus Martini Postdoctoral Research Associate Atmospheric Sciences and Global Change Division Pacific Northwest National Laboratory Tel: 509-372-4082

mgduda commented 10 years ago

Hi, Matus and Bill.

Thanks for catching this; as it's often useful to be able to run the code with floating-point trapping enabled, this is a fix we'll be glad to make. Since the problem is cosmetic, rather than creating another bug-fix release, I'll include the changes in our development repository, and fix fix will appear in the next feature release (2.0) that should be out in a month or two.

Thanks, again! Michael