COSMO-Model-Tutorial March 2009

Working with the COSMO-Model Practical Exercises for Regional Climate Modelling

Deutscher Wetterdienst Ulrich Sch¨attler [email protected] Postfach 10 04 65 63004 Offenbach – Germany

i

Contents 1 Introduction

1

2 Installation of the COSMO-Model Package

3

2.0.1

The COSMO-Model Package . . . . . . . . . . . . . . . . . . . . . . . . .

3

2.0.2

External Libraries needed by the COSMO-Model Package

. . . . . . . .

4

2.0.3

Computer Platforms for the COSMO-Model Package . . . . . . . . . . .

5

2.0.4

Necessary Files and Data . . . . . . . . . . . . . . . . . . . . . . . . . . .

8

2.1 Installation of the I/O Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . .

9

2.1.1

GRIB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9

2.1.2

NetCDF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2.2 Installation of the Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 2.2.1

The source code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

2.2.2

Adaptation of the Makefile . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2.2.3

Compiling and linking the binary . . . . . . . . . . . . . . . . . . . . . . 14

2.2.4

Available Model Versions (March 2009) . . . . . . . . . . . . . . . . . . . 14

3 Running the model system

15

3.1 Run-Scripts for the Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.1.1

Run scripts for the NEC . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

3.2 Installation of the reference-data . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4 Preparing Initial and Boundary Data

18

4.1 Model Domain and External Data . . . . . . . . . . . . . . . . . . . . . . . . . . 18 4.2 Coarse Grid Model Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 4.3 Running the INT2LM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 4.4 Some NAMELIST-variables for INT2LM . . . . . . . . . . . . . . . . . . . . . . 19

COSMO-Model Tutorial

ii

CONTENTS

5 Running the COSMO-Model in CLM Mode

23

5.1 Running the COSMO-Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 5.2 Some NAMELIST-variables for the COSMO-Model . . . . . . . . . . . . . . . . 24 6 IMDI Compile and Running Environment

28

7 Visualizing COSMO-Model Output using NetCDF

29

7.0.1

ncview and ncdump . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

8 Visualizing COSMO-Model Output using Grads

32

8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 8.2 The data descriptor file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 8.3 The gribmap program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 8.4 A Sample GrADS Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 8.5 Drawing a Map Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 9 Troubleshooting for the COSMO-Model

44

9.1 Compiling and Linking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 9.2 Running INT2LM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 9.3 Running the COSMO-Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 10 Running Idealized Test Cases

47

10.1 General remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 10.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

COSMO-Model Tutorial

CONTENTS

1

Chapter 1 Introduction The purpose of this tutorial is to give some practical experience in installing and running the COSMO-CLM-Package. In this chapter a model system overview and the naming conventions are given. The installation, running and visualizing ofthe COSMO-CLM is described in the subsequent chapters. In chapter 2 the installation of the model system is described. Here you can find the description of the model system components, how to compile and run the programs on different computer platforms, the system requirements, a description of the files necessary for compilation and the where to get the files from. Furthermore, the installation of all components needed to perform COSMO-CLM runs and of the Libraries needed to compile the programs is described. The scripts and makefiles provided together with the packages of the COSMO-system are developed by COSMO. In section 3 a short introduction into the COSMO-runscripts for the DWD-IBM and into the main settings (namelist parameters) needed to run the model is given. Please look into the COSMO-Documentation (User’s Guide) and the evaluated and operational applications available on the homepage http://www.cosmo-model.org and http://www.www.clm-community.eu for further details of the namelist. In chapter 6 the standard compile and running evironment of the CLM-Community is introduced and all settings necessary to adapt the environment to own needs are given. The environment can be used instead of the independent compile and run scripts for climate applications. 1

In the chapter 7 the visualising of NetCDF files (not only of cosmo-clm output) is given. The following chapter gives a detailed introduction into visualizing of GRIB files. The chapters 9 describes problems, which occured in the past in several cases. The chapter 10 gives an introduction into running the cosmo model without real boundary conditions, a tool used for idealized case studies. 1

Notice please, that user support is provided by Ulrich Schttler for COSMO members on the basis of the scripts described in chapters 2 and 3 and for CLM-Community members by the group Model and Data on the basis of the IMDI environment.

COSMO-Model Tutorial

2

LM 1.1

LM 2.16

CLM 1

LM 2.19 == LM 3.1

CLM 2

LM 3.x

CLM 2.4.11 == CLM 3

COSMO 4.0 == CCLM 4

COSMO 4.x

COSMOART

COSMO 4.x_CLM_z

COSMO 5.0 == CCLM 5

Figure 1.1: COSMO model history.

COSMO-Model Tutorial

CHAPTER 1. INTRODUCTION

23

Chapter 5 Running the COSMO-Model in CLM Mode 5.1

Running the COSMO-Model

You can use one of the run-scripts provided together with the cosmo clm source code and adapt it to your needs. To do the necessary adaptations for the namelist input, see the next section, where the most important namelist parameters are described. For a detailed explanation of all Namelist parameters, please see the Documentations int2lm.pdf and lmusrgui.pdf and/or the operational and evaluated configurations available on internet at http://www.clm-community.eu - Model System - Evaluated Configurations

COSMO-Model Tutorial

28

Chapter 6 IMDI Compile and Running Environment For climate application the compile and run environment IMDI is offered to the user. It can be downloaded from the repository of the DKRZ. The description of the steps to download, install and start a test simulation are described on internet at https://www.mad.zmaw.de/index.phpid=1112. and in th “IMDI COSMO-CLM quickstart.pdf”. The quick start guide can be found in the IMDI package in the /imdi/util/compile/doc and /imdi/util/running/doc directories.

COSMO-Model Tutorial

29

Chapter 7 Visualizing COSMO-Model Output using NetCDF 7.0.1

ncview and ncdump

Ncview is a visual browser for netCDF format files developed by David W. Pierce. Using ncview you can get a quick and easy look at your netCDF files. It is possible to view simple movies of data, view along different dimensions, to have a look at actual data values at specific coordinates, change colormaps, invert data, etc.. To view files on remote platforms where ncview is already installed use the network protocol to login and enable X-forwarding if your system is Linux or Unix based: ssh -X . If you work with a Windows based system you can use putty to login to the remote system. First install an X-server for Windows (eg. Xming). Call putty and enable X11-forwarding.

Installation To install ncview on your local platform see the ncview-Homepage http://meteora.ucsd.edu/ pierce/ncview home page.html Download the source program and follow the instructions written in the README file for installation. Running ncview After you have installed ncview successfully you can run the program using ncview data-file.nc If data-file.nc contains wildcards like ’*’ or ’ ?’, than all files matching the description are scanned, if all of the files contain the same variables on the same grid.

COSMO-Model Tutorial

30

Choose the variable you want to view. Variables as functions of longitude and latitudes will be displayed in 2 dimensional images. If there is more than one time step available you can easily view a simple movie by just pushing the forward button. The view of the image can be changed by changing colours or the displayed range of the data set values or adding/removing coastlines. Each 2-dimensional and 1-dimensional subset of the data can be selected vor visualization. Ncview allows the selection of the dimensions of the fields available, e.g. longitude and height instead of longitude and latitude of 3D-fields. Ncview Output The pictures can be sent to *.ps-output by using ’print’. To send data to ascii-output use ncdump. Ncdump comes with the netCDF library as provided by Unidata and generates a text representation of a netCDF-file on standard output. The text representation is in a form called CDL (network Common Data form Language). Ncdump may be used as a simple browser for netCDF data files, to display the dimension names and sizes; variable names, types, and shapes; attribute names and values; and optionally, the values of data for all variables or selected variables in a netCDF file. For example, to look at the structure of a netCDF-file use ncdump -c data-file.nc Dimension names and sizes, variable names, dependencies and values of dimensions will be displayed. To get only header information (same as -c option without values of dimensions) use ncdump -h data-file.nc To display the values of a specified variable which is contained in the netCDF-file type ncdump -v Variable data-file.nc And to sent data to a text file use ncdump -b c data-file.nc¿data-file.cdl to produce a annotated CDL version of the structure and the data in the netCDF-file datafile.nc. You can also save data for specified variables for example in *.txt-files just using ncdump -v Variable data-file.nc¿data-file.txt For further information working with ncdump see http://www.unidata.ucar.edu/software/netcdf/docs/ncdump-man-1.html Further tools for visulisation and manipulation of NetCDF data There are many more of programs for viewing and manipulating netCDF data. A complete list of freely available software and commercial or licensed packages can be found at http://www.unidata.ucar.edu/software/netcdf/software.html

COSMO-Model Tutorial

CHAPTER 7. VISUALIZING COSMO-MODEL OUTPUT USING NETCDF