In this work, we have proposed an iterative optimization model for allocating spectral resources in optical networks. The proposed model gives spatial routes and spatial bandwidth allocations in optical networks with variable data-rates, modulation schemes, and optical reach adaptation. We have also proposed an algorithm which allocates continuous and contiguous block of frequency slots (FS) between transponders which forms bandwidth partitions. The primary objective of the bandwidth partition is to reduce spatial fragmentation. The integrated approach includes the routing information from using the optimization model and the categorical spectrum allocation from using the proposed algorithm. The integrated approach has been used for dynamic traffic to improve network performance in terms of bandwidth blocking, link utilization, and fragmentation metrics. It has been shown that the FS utilization (FSU) and link utilization (LU) largely increase in the proposed integrated scheme with 80% LU compared to shortest path first (SPF) routing with LU as low as 20%. Similarly, the standard deviation between FSU in the proposed scheme is approximately 5% compared to 25% in other schemes which shows that the FSU sufficiently increases in the integrated approach.