ESCOMP / MOSART

Model for Scale Adaptive River Transport, Mosart, part of the Community Earth System Model
http://www.cesm.ucar.edu/
Other
8 stars 27 forks source link

With python3, coupling_period is real rather than int #10

Closed billsacks closed 5 years ago

billsacks commented 6 years ago

When running ./preview_namelists under python3, I get a death in mosart's buildnml:

Invalid values ['10800.0']
ERROR: Variable 'coupling_period' has invalid value ['10800.0'].

I think the problem is that this line:

        coupling_period = basedt / mosart_ncpl

Generates a float in python3. If this is supposed to round down (as would happen in python2), then it should use // rather than / (though I'm not sure if that's guaranteed to be portable to python2).

ekluzek commented 5 years ago

I tested the "floor" operator // in python2 and it works fine. From looking at python operators it looks like it's a standard. So this should be done along with the same change in rtm.