In this paper we will discuss automatic code generation for high performance computer architectures in relation to environmental modeling. We will present the CTADEL code generator for scientific models and show performance results of the generated codes for a meteorological model compared with efficient hand-written production codes.