From NCAR teamwork site 2016-02-29, from @ckoven - an idea that I think would be very good to have:
I was having a discussion with Gautam the other day about how to make isotope fluxes more robust. they aren't really amenable to unit tests in the sense of carving off a small chunk of code and giving it known inputs, since the isotope code is spread throughout the model. but maybe an approach to making the isotope code testable is to define a special testing mode using a logical flag, where when set you initialize all the carbon pools with a known reference isotope ratio perhaps downstream of the xsmr flux), run the model for a few timesteps with the same reference isotope ratio, and then check all the pools and fluxes to make sure they still have the same reference isotope ratio. if anyone added a carbon flux and forgot to add the corresponding isotopte flux, that would generate an error.
From NCAR teamwork site 2016-02-29, from @ckoven - an idea that I think would be very good to have:
I was having a discussion with Gautam the other day about how to make isotope fluxes more robust. they aren't really amenable to unit tests in the sense of carving off a small chunk of code and giving it known inputs, since the isotope code is spread throughout the model. but maybe an approach to making the isotope code testable is to define a special testing mode using a logical flag, where when set you initialize all the carbon pools with a known reference isotope ratio perhaps downstream of the xsmr flux), run the model for a few timesteps with the same reference isotope ratio, and then check all the pools and fluxes to make sure they still have the same reference isotope ratio. if anyone added a carbon flux and forgot to add the corresponding isotopte flux, that would generate an error.