from load_nes import open_netcdf


def reorder_longitudes_cli(infile, outfile):
    """
    Converts longitudes in a NetCDF file and saves the modified file.

    Args:
        infile (str): Path to the input NetCDF file.
        outfile (str): Path to save the output NetCDF file with converted longitudes.

    Returns:
        None
    """
    # open
    nc = open_netcdf(infile)
    # load
    nc.load()
    # convert longitudes from default_projections
    nc.convert_longitudes()
    # save
    nc.to_netcdf(outfile)
    return None
