mnlevy1981 / MARBL

Marine Biogeochemistry Library
Other
0 stars 0 forks source link

test_set_interior: add workaround for gfortran bug #19

Closed mnlevy1981 closed 5 years ago

mnlevy1981 commented 5 years ago

See https://github.com/mnlevy1981/gfort_bug for bug details, but the work around will involve pushing the num_elements dimension inside co2calc types

mnlevy1981 commented 5 years ago

Testing: I have a virtual machine based on Ubuntu 14.04 (see https://bitbucket.org/mnlevy/marbl_virtualbox/src/master/ for details) that provides gfortran 4.8 and netcdf, so that's a good place to test whether this workaround actually works. Note that the virtual machine has a copy of history_nag.nc from hobart, so not only can we check that 1, 2, and 5 instances all give the same result but we can also check that answer against something presumed to be "truth"

mnlevy1981 commented 5 years ago

From https://github.com/mnlevy1981/MARBL/issues/18#issuecomment-517801263

An easy way to see the problem is to look at the variable photoC_diat_zint in the history output. From the above set of commands:

$ ncdump -v photoC_diat_zint history_1inst.nc | tail -n 4
data:

 photoC_diat_zint = 0, 1.0142560690187e-311, 0, Infinity, Infinity ;
}

Meanwhile, just running

$ ./compute_cols.py --compiler gnu # v8.1.0
$ ncdump -v photoC_diat_zint history_1inst.nc | tail -n 4

 photoC_diat_zint = 0.0253156906580491, 0.0322866652495998, 0,
    0.0054540503475565, 0.00624035209750951 ;
}
mnlevy1981 commented 5 years ago

4973f10 fixed the CO2calc datatypes, and then 5a4be60 fixed the same bug in the PFT settings datatypes.