For the processing of scientific applications in cloud computing, the important challenge is to find an optimized resource scheduling method that guarantees cloud service users' service-level agreement while minimizing the resource management cost. To overcome this problem, in contrast to previous solutions that focus on a few specific applications, we design and implement a unified scientific cloud framework called science gateway cloud, which is a broker between users and providers and is able to process various scientific applications efficiently upon heterogeneous cloud resources. In particular, we design a costadaptive resource management scheme that reduces the resource management cost significantly without any degradation of performance based on the long-term payment plans of cloud resource providers. Furthermore, this system allows us to parallelize divisible scientific applications to improve the processing performance. Through the division policy for workflow scheduling, we show that both deadline assurance and cost minimization can be satisfied concurrently. Finally, we demonstrate that our proposed system significantly outperforms conventional cloud systems through various experimental and simulation results.