<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_dimension(ncfile, name, length) -> None: """Add a new dimension with the given name and length to the given NetCDF file. Essentially, |create_dimension| just calls the equally named method of the NetCDF library, but adds information to possible error messages: 5 While trying to add dimension `dim1` with length `5` \ """

    try:
        ncfile.createDimension(name, length)
    except BaseException:
        objecttools.augment_excmessage(
            'While trying to add dimension `%s` with length `%d` '
            'to the NetCDF file `%s`'
            % (name, length, get_filepath(ncfile)))