Mdv question when i use Radx2Grid and RadxQpe

Hello everyone, I have a question. When I run Radx2Grid using radar data from 2024 and 2025, and set the default output format to MDV, the data from 2024 generates a normal MDV format, but the results from 2025 do not. The output from 2025 cannot be opened using PrintMdv -path .

file ./20240909/001820.mdv
./20240909/001820.mdv: data

file ./20250723/002433.mdv
./20250723/002433.mdv: Hierarchical Data Format (version 5) data

I encountered the same issue when using the RadxQpe program. Can anyone help? Thank you very much.

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.

Thank you very much for your reply and guidance.