MPAS-Dev / MPAS

Repository for private MPAS development prior to the MPAS v6.0 release.
Other
4 stars 0 forks source link

divide by zero in global stats landIceFloatingAreaSum #1125

Open mark-petersen opened 8 years ago

mark-petersen commented 8 years ago

I get a floating invalid at line 1281 mpas_ocn_global_stats.F:

      averages(variableIndex) = sums(variableIndex)/(landIceFloatingAreaSum)

It appears that landIceFloatingAreaSum is zero. This appears on wolf with: module load intel/15.0.5 openmpi/1.6.5 netcdf/4.4.0 parallel-netcdf/1.5.0 pio/1.7.2 compile in dubug, see analysis case here:

/lustre/scratch3/turquoise/mpeterse/runs/t38r/ocean/global_ocean/QU_240km/analysis_test/forward
mark-petersen commented 8 years ago

@xylar I'm willing to do this. I want to just put an if statement around all computations involving land ice in this section. I could use

if (landIceFloatingAreaSum>0.0_RKIND) then

but it might make more sense to use a flag or associated(variable). What do you think?

xylar commented 8 years ago

@mark-petersen, sorry about this. I should have seen this problem and I guess I haven't been doing enough debug runs.

Each one should really have an if ( associated(<variable>) ) then, as you suggest. Probably easiest if I do a PR for this so you can review with the same test that exposed the problem.

xylar commented 8 years ago

@mark-petersen, what hash should I be starting from to do the PR?

mark-petersen commented 8 years ago

Start from: ef4eec1 Merge branch 'develop' into ocean/develop

xylar commented 8 years ago

Good thing you gave me a hash. That's back a couple of commits, not just one.

mark-petersen commented 8 years ago

Whoops. I just copied the wrong one is all. I did mean just one back, ca1b000 Merge branch 'develop' into ocean/develop but one further back is fine too, will still merge in the same.