Hello,
We believe this is a bug that was introduced earlier this year. It has since been fixed in more recent releases of LROSE (either the January or August release).
For reference, I’ve included Mike’s email explanation.
Please let us know if you have any further questions or problems.
Regards,
Jen
I have received reports from a number of people about problems with LROSE switching from writing MDV files in NetCDF instead of the older binary format, even when the older format is specified. The problem kicked in at the new year (so I don’t want to say Happy New Year!) I apologize for this problem.
This only applies if you are forcing a write in the old binary MDV format. Typically this is done by setting the environment variable MDV_WRITE_FORMAT to FORMAT_MDV. The default since 2020 has been to write the files in NetCDF format.
The bug is in the Mdvx library:
codebase/libs/Mdv/src/Mdvx/Mdvx_write.cc
line 337.
The offending code is:
if (_internalFormat == FORMAT_NCF ||
writeLen >= SI32_MAX ||
dtime.getYear() >= 2025) {
_writeFormat = FORMAT_NCF;
}
When I wrote this code (in 2020) I assumed (unwisely) that all systems would have switched over to the new format by 2025. I should have been more conservative - the old format date goes bad in 2038, not 2025.
So I have changed the code to:
if (_internalFormat == FORMAT_NCF ||
writeLen >= SI32_MAX ||
dtime.getYear() >= 2038) {
_writeFormat = FORMAT_NCF;
}
I have checked that in to git, so if you do a pull and a new build, that should fix it.
If you do not want to do a new build, you can edit Mdvx_write.cc yourself and change 2025 to 2038, and rebuild.