def determine_elevations(grid_elevation_file, elevations, height):
    """Determine a list of adjusted elevations to use

    Args:
        grid_elevation_file <file>: File where 0 elevations are to be written
        elevations [<float>]: Initial list of elevations
        height <float>: Height for the bottom pressure layer

    Returns
        [<float>]: List of elevations to use
    """

    # Copy the elevations to iterate over
    new_elevations = [x for x in elevations]

    # Adjust the first element to be the geometric height unless it
    # is negative, then use 0.0
    if height < 0.0:
        new_elevations[0] = 0.0
    else:
        new_elevations[0] = height

    # Write the first elevation to the elevation file.  Write it with more
    # precision for science calculations and less to exactly match the
    # directory name
    grid_elevation_file.write('{0:05.8f} {0:05.3f}\n'.format(new_elevations[0]))

    return new_elevations