The Environmental IoT is a project where we investigate the potential of an integrated distributed system consisting of an Internet of Things (IoT) and a Cloud Computing infrastructure. The resulting complex distributed system will be used to support deep understanding of the natural environment inter-dependencies and the management of the natural environment through appropriate interventions. In this paper, we discuss our approach to program this resulting complex distributed system with high-level system specifications in the environmental science context. The high-level specification encapsulates environmental science concepts and conveys the system's overall goals. The approach consists of three refinement steps that translate the high-level specification into the accordingly behaviour on the resulting distributed system. This process captures the abstract requirements of scientists and supports runtime adaptation.