fixed basin delineation code