22
Bandung, Indonesia 2012 Cosmin BARBU

GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

  • Upload
    buidien

  • View
    284

  • Download
    4

Embed Size (px)

Citation preview

Page 1: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

Bandung, Indonesia 2012

Cosmin BARBU

Page 2: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

Overview:

� Basics of GrADS

� Creating plots of COSMO model run

� Meteograms

�Sample of operative procedure using GrADS

Page 3: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

Useful links for GrADS

Name Link

GrADS Home Page grads.iges.org/grads/gadoc

GrADS User's Guide grads.iges.org/grads/gadoc/users.html

GrADS Documentation Index grads.iges.org/grads/gadoc/gaddocindex.html

GrADS Script Library grads.iges.org/grads/gadoc/library.html

GrADS Tutorial grads.iges.org/grads/gadoc/tutorial.html

OpenGrADS opengrads.org/index.php

Page 4: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

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

4

Page 5: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

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

5

Page 6: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

Graphic types: set gxout

shaded contour grfill6

Page 7: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

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 cbar.gs)

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:

set

d (or display) draw

query

close open c (or clear)

See grads.iges.org/grads/gadoc/gaddocindex.html, especially for set

7

Page 8: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

Examples:

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

8

Page 9: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

Graphics types: set gxout

9

Page 10: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

Let's play:

Try some commands with your own data.

Make a ctl-file with

gme2ctl.pl <GRIB-file>

For more information about gme2ctl usage type: gme2ctl.pl -h

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

gme2ctl.pl -D

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

10

Page 11: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

Let's play:

How to produce a ctl-file for grib files??

gme2ctl.pl -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

11

Page 12: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

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

12

Page 13: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

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

quit

13

Page 14: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

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

quit

14

Page 15: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

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

quit

15

Page 16: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

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

quit

16

Page 17: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

Meteographs with meteo_plot.pl

Requirements

ASCII output of COSMO perl typically in /usr/bin/perl .gnuplot http://gnuplot.sourforge.net

Explanation with option –h:meteo_plot.pl –h

Problems? Use option –D (repeat –D for more debug information)meteo_plot.pl –D …

Information on content of a meteograph file:meteo_plot.pl –i M_*

17

Page 18: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

Simple usage

meteo_plot.pl M_Bandung -e pmsl,ff10m,dd10m,t2m,td2m,clch,clcm,clcl,rain_con,precipmeteo_plot.pl M_Bandung -e pmsl,ff10m,dd10m,t2m,td2m,clch,clcm,clcl,rain_con,precip -o meteo_Bandung.png

18

Page 19: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

Simple usage

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

19

Page 20: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

Simple usage

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

20

Page 21: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

Example of operative Grads procedure

cd ~/cosmo/grads/postproc

Please, remark the GrADS scripts for plotting:

� model output parameter: clct_baz.gs, prec_24h_baz.gs, temperatura_baz.gs …� setting colors: define_colors.gs, color.gs, culori_precip2.gs, …. � define map projection: map_ncl.gs� legend bars: cbarc.gs, xcbar.gs, …� displaying orography domain: topo.gs

21

Now, run ./make_photos.sh

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

Page 22: GrADS COSMO n - CLM-Community · Graphics basedon GrADS grads Start GrADS session open xxx.ctl Open ctl-file which describes the GRIB data to be plotted . d expression display expression,

22

Thank you for your attention!