GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open...

of 22 /22
Bandung, Indonesia 2012 Cosmin BARBU

Embed Size (px)

Transcript of GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open...

Bandung, Indonesia 2012

Cosmin BARBU


Basics of GrADS

Creating plots of COSMO model run


Sample of operative procedure using GrADS

Useful links for GrADS

Name Link

GrADS Home Page

GrADS User's Guide

GrADS Documentation Index

GrADS Script Library

GrADS Tutorial


Graphics based on GrADS

grads Start GrADS session

open xxx.ctl Open ctl-file which describes the GRIB data tobe plotted.

d expression display expression, e.g. T, or 0.01*pmsl, U;V, T-273.15

draw title Some Description Write title over plot

printim file.png create png-file

c clear screen


Important commands

set lon West [East] sets longitudes [deg E], e.g. "set lon 17 23.5"

set lat South [North] sets latitudes [deg N], e.g. "set lat -10 15"

set lev p1 [p2] sets level [hPa], e.g. "set lev 500"

set time time [time2] sets time in format hhZddmmmyyyy, hh=hour, dd=day, mmm=month, yyyy=year, e.g. "set time 15Z19jul2011"

q XX query , i.e. get information XX

q file description of the file

q dims information about set dimensions

q time information about time settings

q ctlinfo show content of control-file

set gxout XX Choose display style, e.g. contour, shaded, grfill, barb


Graphic types: set gxout

shaded contour grfill6

More commands

set display color white white background of map

set mpdset hires use high-resolution coastlines/maps

draw string Hello 2.5 1.2 write string Hello at position 2.5 inches, 1.2 inches

cbar draw the colour bar (Standard script

set clevs 0.1 0.5 1 5 10 25 50 75 100 set contour levels

set cmin 25 show only values above 25

set ccolor 2 set contour color

Basic commands are:


d (or display) draw


close open c (or clear)

See, especially for set



set gxout barb draw WMO wind barbsd skip(u_10m*2,4);v_10m*2 draw every 4th wind grid point as barb

(in knots)set gxout stream draw streamlinesd u_10m;v_10m draw wind at 10m as streamlinesd mag(u_10m,v_10m) draw wind speed (in m/s)d hdivg(u_10m,v_10m)*1.e4 draw divergence (10-4 s-1)d hcurl (u_10m,v_10m)*1.e4 draw vorticity (10-4 s-1)

set clevs 0.1 0.5 1 5 10 25 50 75 100 set contour levelsd tot_prec draw precipitation

condepth=(htop_con-hbas_con)/1000 compute convective cloud depth (in km)

d maskout(condepth, condepth-0.5 ) draw condepth >= 0.5 km; alternative:set cmin 0.5d condepth


Graphics types: set gxout


Let's play:

Try some commands with your own data.

Make a ctl-file with

For more information about gme2ctl usage type: -h

Debug information with option -D (repeat -D for more debug information) -D

Exercise: try to reproduce the images from the previous slide.


Let's play:

How to produce a ctl-file for grib files?? -n c10 lfff0*0

Example 1:

set display color whitecopen c10.ctlq fileset t 1 78set lat -7set lon 108d t_2m-273.15draw title title T_2m evolution in (7S,108E)printim T_2m-evolution.png


Let's play:

Example 2: Don't forget to open your ctl file!!!

run map_ncl.gsc

set gxout shadedset clab forcedd pmsl/100set gxout contourd pmsl/100run cbarn.gsdraw title pressure reduced to MSL [hPa]set strsiz 0.14draw string 1.4 8.3 COSMO-10kmprintim pmsl.png png x1024 y768quit


Let's play:

Example 3: Cross section

run define_colors.gsrun map_ncl.gscopen lfff00150000p.ctlset gxout contourset lat -7set lon 105 116set lev 1000 450d t-273.15d u;v;mag(u,v)draw title Cross section on latitudineprintim lat.png png x1024 y768

cset lon 108set lat -10 -3set lev 1000 450d t-273.15draw title Cross section on longitudeprintim lon.png png x1024 y768



Let's play:

Example 4: Specific humidity

run define_colors.gsrun map_ncl.gscopen lfff00150000.ctlset gxout shadedset rbcols 0 41 42 43 44 45 46 47 48 49set csmooth onset cmin 0set cint 0.001d qv_sdraw title Specific humidity at the surfaceprintim qv_s.png



Let's play:

Example 5: Total precipitation

run define_colors.gsrun map_ncl.gscopen lfff00150000.ctlset gxout shadedset cmin 0.1set clevs 0.1 1 2 5 10 20 40 80 120 160 200set ccols 0 85 86 84 83 82 87 88 89 90 91 92d tot_preccbarn.gsdraw title Total accumulated precipitationprintim acc_prec.png



Let's play:

Example 6: 10m wind

run define_colors.gsrun map_ncl.gscopen lfff00150000.ctlset gxout shadedset rbcols 31 33 35 43 46 48 26 28 93d skip(u_10m,2,2);v_10m;mag(u_10m,v_10m)draw mapcbarn.gsdraw title Wind 10mprintim w_10m.png x1024 y768



Meteographs with


ASCII output of COSMO perl typically in /usr/bin/perl .gnuplot

Explanation with option h

Problems? Use option D (repeat D for more debug information) D

Information on content of a meteograph i M_*


Simple usage M_Bandung -e pmsl,ff10m,dd10m,t2m,td2m,clch,clcm,clcl,rain_con, M_Bandung -e pmsl,ff10m,dd10m,t2m,td2m,clch,clcm,clcl,rain_con,precip -o meteo_Bandung.png


Simple usage M_Bandung -e pmsl,ff10m,dd10m,t2m,td2m,clch,clcm,clcl,rain_con,precip o meteo_Bandung_1.png -time '*:+52'


Simple usage M_Bandung -e pmsl,t2m,tmin2m,tmax2m,precip -o meteo_Bandung_2.png -time '2012101712 : 2012101906'


Example of operative Grads procedure

cd ~/cosmo/grads/postproc

Please, remark the GrADS scripts for plotting:

model output parameter:,, setting colors:,,, . define map projection: legend bars:,, displaying orography domain:


Now, run ./

After finishing take a look in ~/cosmo/grads/postproc/photos


Thank you for your attention!