Docstoc

analyse and visualize

Document Sample
analyse and visualize Powered By Docstoc
					                                                                                       > -Z238.859
247.21              244.83    242.70   240.88     239.51 238.76                           8.4375 83.0147
238.52              238.58    238.68   238.82     238.99 239.18                           14.0625 83.0147
239.17              238.95    238.78   238.42     238.04 237.71                           14.0625 90
237.43              237.33    237.53   238.16     239.29 240.95
                                                                                cdo       8.4375 90
243.37              245.92    248.69   251.52     252.06 257.99                           8.4375 83.0147
260.38              262.42    263.97   265.29     265.57 266.06                        > -Z239.668
265.64              264.20    263.74   263.20     262.42 261.77                           14.0625 83.0147
261.32              260.99    260.78   260.71     260.72 261.14                           19.6875 83.0147
261.53              261.57    263.04   263.72     264.30 265.09
                                    analyse and visualize                                 19.6875 90
265.23              264.64    264.52   263.75     261.33 259.16                           14.0625 90
257.07              255.06    252.64   249.88     245.79 244.97                           14.0625 83.0147
244.23              243.53    242.89   242.34               model output data
                                                      climate
                                                  241.87 241.45                        > -Z240.523
241.12              240.87    240.69   240.56     240.47 240.42                           19.6875 83.0147
240.41              240.45    240.55   240.71                or NetCDF format
                                                       in GRIB
                                                  240.96 241.32                           25.3125 83.0147
241.75              242.28    242.88   243.58     244.34 245.15                           25.3125 90
                                                               with                       19.6875 90
                                                   cdo and GMT on UNIX systems            19.6875 83.0147
                                                                                       > -Z240.857
                                           t21 temp2m GMT                                 25.3125 83.0147
                             210˚   260˚   310˚      0˚    50˚ handouts:
                                                                  100˚
                                                                   150˚                   30.9375 83.0147
                                                                                          30.9375 90
Summerschool 2007




                     80˚
                                                              this slides
                                                                        80˚
                                                                                          25.3125 90
                     60˚                                                60˚

                     40˚
                                                          cdo quick reference
                                                                        40˚

                     20˚                                  gmt quick reference
                                                                        20˚

                      0˚                                                        0˚
                                                                                       GMT
                    −20˚                                                        −20˚

                    −40˚                                                        −40˚

                    −60˚                                                        −60˚

                    −80˚                                                        −80˚

                             210˚   260˚   310˚      0˚    50˚    100˚   150˚



    1
2d field & cdo info
                    tiny 23%cdo info tsurf.1.nc
                        -1 :       Date Time Code Level Size Miss : Minimum                 Mean   Maximum
                         1 : 1978-01-02 00:00 169       0 2048      0 :   226.98          268.46    311.08
                    cdo info : Processed 1 variable 1 timestep. ( 0.00s )


                                                       <-- x   values for longitude -->
                       <-- y values for latitude -->
Summerschool 2007




    2
2d fields timeseries
                                 t+5
                               t+4
                             t+3
                          t+2
                        t+1
                    t
Summerschool 2007




    3
Grib & NetCDF representation of a 2d timeseries




                    var(lat,lon) time records        var(time,lat,lon)


                          4 3 1 0
                          4 3 1 0                    11 24 36 47
Summerschool 2007




                           4 3 1 0
                            4 3 1 0                             0
                                                          39 710 1
                                                       6847 38 1 0
                          2 4 3 1 0
                          2 55 77 99                 52 65 3 9
                           2 55 77 99                     51 2
                                                             7 9
                                                       272 65 57 49
                          8 2 5 5 7 69
                          8 2 5 10 6
                             5 10                       10
                                                     912 4 3 6
                           8 5 10 6
                            8 5 10 6                      1 12 9 6
                                                       818 25 310 6
                            8     10 6
                          here: var(3,4) 5 records       var(5,3,4)
    4
Data Formats: GRIB

                         Grib header information: Product Description Section
                                                  GRID Description Section
                                                  Bitmap Section
                         Data:                    Binary Data Section


                    ds8 55%grib -ginfo zzz.grb
                      Rec : Position    Size : V PDS GDS      BMS     BDS   :   Code   Level   :   LType GType
                        1 :        0 36948 : 1 28     32        0   36876   :   133    20000   :    100     4
                        2 :    36948 36948 : 1 28     32        0   36876   :   133    20000   :    100     4
                        3 :    73896 36948 : 1 28     32        0   36876   :   133    20000   :    100     4
Summerschool 2007




                        4 :   110844 36948 : 1 28     32        0   36876   :   133    20000   :    100     4
                        5 :   147792 36948 : 1 28     32        0   36876   :   133    20000   :    100     4
                    ds8 56%grib -gdsinfo zzz.grb
                      Rec : GDS NV PVPL Typ : xsize ysize      Lat1    Lon1       Lat2     Lon2       dx    dy
                        1 : 32    0 255     4 :   192    96   88572       0     -88572   358125     1875    48
                        2 : 32    0 255     4 :   192    96   88572       0     -88572   358125     1875    48
                        3 : 32    0 255     4 :   192    96   88572       0     -88572   358125     1875    48
                        4 : 32    0 255     4 :   192    96   88572       0     -88572   358125     1875    48
                        5 : 32    0 255     4 :   192    96   88572       0     -88572   358125     1875    48
                    ds8 57%

    5
Data Formats: NetCDF
                    netcdf zzz {
                    dimensions:
                            lon = 192 ;
                            lat = 96 ;
                            lev = 1 ;
                            time = UNLIMITED ; // (10 currently)
                    variables:
                            double lon(lon) ;
                                    lon:long_name = "longitude" ;
                                    lon:units = "degrees_east" ;
                    double lat(lat) ;
                                    lat:long_name = "latitude" ;
                                    lat:units = "degrees_north" ;
                    double lev(lev) ;
                                    lev:long_name = "pressure" ;
                                    lev:units = "Pa" ;
                    double time(time) ;
                                    time:units = "day as %Y%m%d.%f" ;
Summerschool 2007




                    float q(time, lev, lat, lon) ;
                                    q:long_name = "specific humidity" ;
                                    q:units = "kg/kg" ;
                                    q:code = 133 ;
                                    q:table = 128 ;
                                    q:grid_type = "gaussian" ;
                    // global attributes:
                                    :CDO = "Climate Data Operators version 0.9.5 " ;
                                    :source = "ECHAM5.2" ;
                                    :institution = "Max-Planck-Institute for Meteorology" ;
                    data:
                    lon = ...... ;
                    ....}
    6
grib tools

                    wgrib, dkrz-readgrib: Small tools just for read and
                                          write grib files
                    GMT: visualization tool
                    xconv: quicklook for grib files (BADC)
                    cdo: mpi choice only for data processing
                    gradsc: visualisation tool



netcdf tools
Summerschool 2007




                    nco: good for file and header manipulation
                    ncview: simple view on netcdf files
                    ncdump, ncgen: nc to ascii and vice versa
                           options: -h (header only) -v [var] (var only)
                    GMT: vizualisation tool
                    cdo: mpi choice only for data processing
                    gradsnc: visualisation tool

    7
                                       CDO
                               Climate Data Operators

                    Current officially released version is cdo 1.0.8

                    homepage:
                    http://www.mpimet.mpg.de/fileadmin/software/cdo/

                    SUN (Solaris 8):                            /client/bin
                    SUN (Solaris 10)(zetta, jango):             /client/bin
Summerschool 2007




                    LINUX:                                      /client/bin
                    hurrikan:                                   /pool/SX-6/cdo/bin
                    cross:                                      /pool/ia64/cdo/bin

                    or local installations ( LINUX, Mac OS X)
                    (cc or gcc, NetCDF support: libnetcdf.a )


    8
Usage:




                    cdo [options]          \
                        operator[,op[,op]] \
                        [-operator]        \
                        ifile [ifile ...] [ofile]

                    for:
Summerschool 2007




                    GRIB-, NetCDF-, ieg-, Service-, Extra-
                    formatted files




    9
Options:


                    -a             Convert from relative to absolute time axis
                    -f <format>    Format of output file. (grb, nc, nc2, srv, ext or ieg)
                    -g <grid>      Grid name or file. Available grids:
                                   t<RES>grid, t<RES>spec, r<NX>x<NY>, g<NX>x<NY>, ni<NI>
                    -h             Help information for the operators
                    -m <missval>   Set the default missing value (default: -9e+33)
                    -p <prec>      Set the precision of the output data in bytes
                                   (4/8 for nc, nc2, srv, ext, ieg; 1/2/3 for grb)
                    -R             Convert GRIB data from reduced to regular grid
                    -r             Convert from absolute to relative time axis
                    -t <partab>    Parameter table name or file
Summerschool 2007




                                   Predefined tables: echam4 echam5 mpiom1 ecmwf remo
                    -V             Print the version number
                    -v             Print extra details for some operators

                    (-s)           silent (no extra output on stdout - not documented)




10
There are more than 350 operators available:

                    - informations
                    cdo info, infov, infos, map, griddes, vardes, ...
                    cdo showcode, showvar, showyear, showmonth, showlevel, ...
                    - file operations
                    cdo copy, merge, split
                    - selections
                    cdo selvar, selcode, sellevel, selyear, ...
                    cdo sellonlatbox
                    cdo seltimestep
                    - input/ ouput
                    cdo input, output, outputf, gradsdes, outputbounds ...
                    - statistic
                    cdo yearmean, yearavg, yearmax, yearsum, yearvar, yearstd
Summerschool 2007




                    cdo hour..., day..., mon..., seas...
                    - arithmetic
                    cdo add, addc, sqr, sqrt, cos, atan2
                    - conditional selection
                    cdo ifthen, ifnotthen, ifthenelse, ifthenc, ifnotthenc
                    - comparision
                    cdo eq, eqc, ne, nec, le, lec, ge, gec, lt, ltc, gt, gtc


11
example informations: info, infov

                    sophie 29%cdo info zzz.grb
                    -1 :     Date Time Code Level Size Miss : Minimum    Mean Maximum
                     1 : 24-01-01 18:00 214      0 8192     0 : 229.31 279.04 327.19
                    cdo info : Processed 1 variable 1 timestep. ( 0.00s 0B )
                    sophie 30%cdo infov zzz.grb
                    -1 :     Date Time Varname Level Size Miss : Minimum     Mean Maximum
                     1 : 24-01-01 18:00 var214      0 8192     0 : 229.31 279.04 327.19



example file operations: copy
Summerschool 2007




                    sophie 35%cdo -f nc -t echam4 copy zzz.grb zzz.nc
                    cdo copy : Processed 1 variable 1 timestep. ( 0.01s 0B )
                    sophie 36%cdo infov zzz.nc
                    -1 :     Date Time Varname Level Size Miss : Minimum   Mean   Maximum
                     1 : 24-01-01 18:00 tsmax       0 8192    0 : 229.31 279.04    327.19
                    cdo infov : Processed 1 variable 1 timestep. ( 0.00s 0B )




12
example selections: seltimestep



                    jango 52%cdo seltimestep,1 EH5_OM_A2_1_MM_TEMP2_1-1200.grb zzz1.grb
                    cdo seltimestep : Processed 1 variable 2 timesteps. ( 0.00s )
                    jango 53%cdo seltimestep,1/5 EH5_OM_A2_1_MM_TEMP2_1-1200.grb zzz5.grb
                    cdo seltimestep : Processed 1 variable 6 timesteps. ( 0.01s )
                    jango 54%cdo info zzz5.grb
                        -1 :       Date Time Code   Level    Size   Miss   :   Minimum     Mean   Maximum
                         1 : 2001-01-31 18:00 167       0   18432      0   :    227.84   276.36    307.02
                         2 : 2001-02-28 18:00 167       0   18432      0   :    221.51   276.02    307.52
                         3 : 2001-03-31 18:00 167       0   18432      0   :    212.20   276.55    306.41
                         4 : 2001-04-30 18:00 167       0   18432      0   :    206.65   277.81    311.49
Summerschool 2007




                         5 : 2001-05-31 18:00 167       0   18432      0   :    206.30   279.51    314.02
                    cdo info : Processed 1 variable 5 timesteps. ( 0.00s )




13
example selection/piping: seltimestep, selcode




                    jango 56%cdo seltimestep,2 -selcode,130 -sellevel,100000 \
                                 EH5_OM_ALLES_MM.grb zzz.grb
                    cdo seltimestep: Started child process "selcode,130 -sellevel,100000 \
                                     EH5_OM_ALLES_MM.grb (pipe1.1)".
                    cdo(2) selcode: Started child process "sellevel,100000 \
                                     EH5_OM_ALLES_MM.grb (pipe2.1)".
                    cdo(3) sellevel : Processed 8 variables 12 timesteps. ( 0.08s )
                    cdo(2) selcode : Processed 3 variables 12 timesteps. ( 0.08s )
                    cdo seltimestep : Processed 1 variable 3 timesteps. ( 0.08s )
Summerschool 2007




                    jango 57%cdo info zzz.grb
                        -1 :       Date Time Code Level       Size   Miss : Minimum    Mean   Maximum
                         1 : 2001-02-28 18:00 130 100000     18432      0 : 234.55 278.21      307.33
                    cdo info : Processed 1 variable 1 timestep. ( 0.00s )




14
 example cond. selection/comparision
cdo                  info EH5_OM_A1B_1_MM_APRC_1-12.grb
 -1                  :       Date Time Code Level      Size   Miss   :     Minimum          Mean       Maximum
  1                  : 2001-01-31 18:00 143       0   18432      0   : -6.3936e-22    1.2878e-05    0.00029618
  2                  : 2001-02-28 18:00 143       0   18432      0   : -6.0044e-22    1.3204e-05    0.00033819
  3                  : 2001-03-31 18:00 143       0   18432      0   : -4.2327e-22    1.2977e-05    0.00021810
cdo gtc,0.0 EH5_OM_A1B_1_MM_APRC_1-12.grb mask
cdo info mask
   -1 :       Date Time Code Level      Size                   Miss   :     Minimum          Mean     Maximum
    1 : 2001-01-31 18:00 143       0   18432                      0   :      0.0000       0.63840     1.0000
    2 : 2001-02-28 18:00 143       0   18432                      0   :      0.0000       0.66574     1.0000
    3 : 2001-03-31 18:00 143       0   18432                      0   :      0.0000       0.66596     1.0000
cdo setmisstoc,0.0 -ifthen mask EH5_OM_A1B_1_MM_APRC_1-12.grb APRC.grb
cdo info res.grb
    -1 :       Date Time Code Level      Size    Miss : Minimum        Mean                            Maximum
 Summerschool 2007




     1 : 2001-01-31 18:00 143       0   18432       0 :   0.0000 1.2878e-05                         0.00029618
     2 : 2001-02-28 18:00 143       0   18432       0 :   0.0000 1.3204e-05                         0.00033819
     3 : 2001-03-31 18:00 143       0   18432       0 :   0.0000 1.2977e-05                         0.00021810



                        ifthen = i2(t,x) if i1 != 0           gtc      = 1 if i1 > 0
                               = miss    if i1 = 0                     = 0 if i1 <= 0


 15
example arithmetic: sqr, sqrt



                                           √(u2 + v2)

                    jango 78%cdo sqrt -add -sqr U1000.grb -sqr V1000.grb SPEED1000.grb
                    cdo sqrt: Started child process "add -sqr U1000.grb -sqr V1000.grb (pipe1.1)"
                    cdo(2) add: Started child process "sqr U1000.grb (pipe2.1)".
                    cdo(2) add: Started child process "sqr V1000.grb (pipe2.2)".
                    cdo(4) sqr : Processed 1 variable 12 timesteps. ( 0.11s )
                    cdo(3) sqr : Processed 1 variable 12 timesteps. ( 0.11s )
Summerschool 2007




                    cdo(2) add : Processed 2 variables 24 timesteps. ( 0.11s )
                    cdo sqrt : Processed 1 variable 12 timesteps. ( 0.11s )




16
example arithmetic/modification
  cdo               info APRL.grb
   -1               :       Date Time    Code   Level    Size   Miss   :      Minimum          Mean        Maximum
    1               : 2001-01-31 18:00   142        0   18432      0   :   1.5681e-18    1.4289e-05     0.00016663
    2               : 2001-02-28 18:00   142        0   18432      0   :   1.5726e-18    1.4478e-05     0.00013505
    3               : 2001-03-31 18:00   142        0   18432      0   :   1.5640e-18    1.4938e-05     0.00013354

  cdo               add APRL.grb APRC.grb aprt.grb
  cdo               info aprt.grb
   -1               :       Date Time Code Level         Size   Miss   :      Minimum          Mean        Maximum
    1               : 2001-01-31 18:00 142       0      18432      0   :   1.5681e-18    2.7167e-05     0.00031561
    2               : 2001-02-28 18:00 142       0      18432      0   :   1.5726e-18    2.7682e-05     0.00034394
    3               : 2001-03-31 18:00 142       0      18432      0   :   1.5640e-18    2.7915e-05     0.00022897

   cdo              setcode,4 aprt.grb APRT.grb
   cdo              info APRT.grb
    -1              :       Date Time Code Level         Size   Miss   :      Minimum          Mean        Maximum
Summerschool 2007




     1              : 2001-01-31 18:00   4      0       18432      0   :   1.5681e-18    2.7167e-05     0.00031561
     2              : 2001-02-28 18:00   4      0       18432      0   :   1.5726e-18    2.7682e-05     0.00034394
     3              : 2001-03-31 18:00   4      0       18432      0   :   1.5640e-18    2.7915e-05     0.00022897

                    cdo   mulc,86400 APRT.grb APRTmd.grb
                    cdo   info APRTmd.grb
                     -1   :       Date Time Code Level       Size      Miss   :      Minimum     Mean     Maximum
                      1   : 2001-01-31 18:00   4       0    18432         0   :   1.3549e-13   2.3473      27.268
                      2   : 2001-02-28 18:00   4       0    18432         0   :   1.3587e-13   2.3917      29.716
                      3   : 2001-03-31 18:00   4       0    18432         0   :   1.3513e-13   2.4119      19.783

17
time, field & running means
                    day-, month-, seas-, yearmean:

                    cdo   daymean file.6h.grb file.1d.grb
                    cdo   monmean file.1d.grb file.mon.grb
                    cdo   seasmean file.mon.grb file.seas.grb
                    cdo   yearmean file.seas.grb file.year.grb

                    fieldmean:

                    cdo fldmean file.global.grb file.gmean.grb
                    # or for selected regions:
                    cdo fldmean -sellonlatbox,w,e,s,n file.global.grb file.regmean.grb

                    running mean:
Summerschool 2007




                    cdo runmean,5 file.mon file.runmon.grb
                    # the running mean over 5 month



                    experts: mean and average give different result if missing
                    values occur: mean only treats "real values": 1 + 2 + 3 +
                    miss = 6/3 = 2; average: 1 + 2 + 3 + miss = miss/4 = miss.


18
How a parameter table looks like:
                                134   aps      surface pressure [Pa]
                                141   sn       snow depth [m]
                                147   ahfl     latent heat flux [W/m**2]
                                172   slm      land sea mask
                                175   albedo   surface albedo
                                211   siced    ice depth [m]

                                Example:
                                cdo -f nc -t tab2 file.grb file.nc
                                cdo infov file.nc
Summerschool 2007




                    tiny   78%cdo infov sechs2.grb
                    -1 :         Date Time Varname Level   Size   Miss   :   Minimum      Mean     Maximum
                     1 :   1978-12-31 00:00 aps        0   2048      0   :     58574.    97057. 1.0789e+05
                     2 :   1978-12-31 00:00 sn         0   2048      0   :     0.0000 0.0058780    0.16087
                     3 :   1978-12-31 00:00 ahfl       0   2048      0   :    -362.71   -60.509     3.8557
                     4 :   1978-12-31 00:00 slm        0   2048      0   :     0.0000   0.33105     1.0000
                     5 :   1978-12-31 00:00 albedo     0   2048      0   :   0.070000   0.28956    0.80000
                     6 :   1978-12-31 00:00 siced      0   2048      0   :     0.0000   0.31012     3.6166


19
cdo formats:
                    converting a GRIB-file to NetCDF...
                    cdo -r -f nc -t echam4 copy zzz.grb zzz.nc

                    -r relative time axis
                    -f nc output format is netcdf
                    -t echam4 use parameter table echam4

                    converting a GRIB-file to extra...
                    cdo -f ext copy zzz.grb zzz.ext
Summerschool 2007




                    -f ext output format is extra

                    output is a formatted text file...
                    cdo outputf,%8.3f,5 zzz.grb zzz.asc

                    %8.3f c format convention
                    5     values per line
20
mpiom1 & hamocc
                    grib files. scalar and vektor codes need different grids:
                    GR30s.nc for scalar, GR30v.nc for zonal vector and
                    GR30u.nc for meridional vector values. Vertical vector
                    values on scalar grid but different level.

                    first select the code:
                    cdo selcode,<code> [-sellevel,<lev>] ifile ofile
                    adjust the size, cut off overlapping columns and set
                    the curve linear grid:
                    cdo -t mpiom1 -f nc setgrid,GR30s.nc \
                        -selindexbox,2,121,1,101 -setgrid,r122x101 \
                        filein.ext inter.nc
Summerschool 2007




                    convert to regular grid:
                    cdo remapcon,r240x120 inter.nc fileout.nc


                    control run (grid for source file already set and
                    selected):
                    cdo -t mpiom1 -f nc setgrid,GR30s.nc zzz.grb oceanorig.nc
                    cdo remapcon,r240x120 oceanorig.nc oceanreg.nc
                    cdo mergetime ifiles ofile # for a complete timeseries

21
echam5 & jsbach


                    select code 130 with all level from echam5 ATM file
                    or select code 130 on level 500 hpa.


                    cdo selcode,130 sus0000_ATM_0801.grb temp130.atm.0801.grb
                    cdo selcode,130 -sellevel,50000 sus0000_ATM_0801.grb \
                                    temp130.500.atm.0801.grb



                    Convert a jsbach veg file from
Summerschool 2007




                    grib to netcdf:


                    cdo -f nc -t jsbach.veg.codes copy \
                        sus0000_jsbach_veg_0801.grb    \
                        sus0000_jsbach_veg_0801.nc

                    cdo mergetime ifiles ofile   # for a complete timeseries


22
                                GMT
                            generic mapping tools



                    Current officially released version is gmt 4.2

                    http://gmt.soest.hawaii.edu/
Summerschool 2007




                    http://gmt.soest.hawaii.edu/

                    cross (version 4.2) : /pool/ia64/gmt-4.2
                    sun solaris (version 3.41) : /client/bin
                    LINUX (version ?) : /client/bin



23
The picture
                                                                       !"#$!%&'"&$()*
                           "++!           ",+!             "-+!        ."+!         +!          ,+!       -+!        #"+!       #/+!


                     -+!                                                                                                               -+!




                     ,+!                                                                                                               ,+!




                      +!                                                                                                               +!




                    !,+!                                                                                                               !,+!
Summerschool 2007




                    !-+!                                                                                                               !-+!


                           "++!           ",+!             "-+!        ."+!         +!          ,+!       -+!        #"+!       #/+!

                                                                                                                345$6$"1.7#08

                                                       ".+       ",+   "0+    "/+   "1+   "-+     "2+   .++

                            2007 Aug 21 14:49:19   joergwegner



24
The commands (in a script)


    opener.j        #!/bin/ksh
                    set -xv
                    #
                    IFILE=$1
                    OFILE=$2
                    cdo outputbounds $IFILE > ${IFILE%.*}.asc
                    #
                    #gmtset HEADER_FONT Courier-Bold HEADER_FONT_SIZE 18
                    #gmtset ANNOT_FONT_PRIMARY Courier-Bold ANNOT_FONT_SIZE_PRIMARY 10
                    makecpt -Crainbow -T230/307/3 > zzz.cpt
                    psbasemap -Rd -JQ0/8i -X1.8i -Y2i -B40/40:."t21 temp2m GMT": \
                              -U/0.0i/-1.3i/"joergwegner" -K >| $OFILE
Summerschool 2007




                    psxy -R -J -M ${IFILE%.*}.asc -L -Czzz.cpt -O -K >> $OFILE
                    psscale -Czzz.cpt -D4.0i/-0.5i/4.0i/0.2ih -B10/:"[\260C + 273.15]": \
                            -O -K >> $OFILE
                    psbasemap -R -J -Bg15/g15 -O -K >> $OFILE
                    pscoast -R -J -Dc -W0.5p -O >> $OFILE
                    #




25
                                                                                                                                                                                                                                   +data
The puzzle
                                                                                                                                                                                                                                        !"#$!%&'"&$()*
                                                                                                                                                                                            "++!           ",+!             "-+!        ."+!         +!          ,+!       -+!        #"+!       #/+!

                                                                                                                                                                                      -+!                                                                                                               -+!




                                                                                                                                                                                      ,+!                                                                                                               ,+!




                                                                                                                                                                                       +!                                                                                                               +!




                                                                                                                                                                                     !,+!                                                                                                               !,+!




                                                                                                                                                                                     !-+!                                                                                                               !-+!

                                                                                                                                                                                            "++!           ",+!             "-+!        ."+!         +!          ,+!       -+!        #"+!       #/+!


                                                                                                                                                                                                                                                                                 345$6$"1.7#08



                                                                 frame                                                                                                                       2007 Aug 24 09:26:18
                                                                                                                                                                                                                        ".+

                                                                                                                                                                                                                    joergwegner
                                                                                                                                                                                                                                  ",+   "0+    "/+   "1+   "-+     "2+   .++

                                                                                                                                                                                                                                                                                                                                                                                                                            +colors

                                                           ,!+$,-./!.$012                                                                                                                                                                                                                                                                                                                                                         !"#$!%&'"&$()*
                           !""!          !("!             !3"!    4!"!   "!   ("!   3"!   +!"!     +5"!                                                                                                                                                                                                                                                                               "++!           ",+!             "-+!        ."+!         +!          ,+!       -+!        #"+!       #/+!
                                                                                                                                                          #!/bin/ksh
                     3"!                                                                                         3"!                                                                                                                                                                                                                                                            -+!                                                                                                               -+!
                                                                                                                                                          set -xv
                                                                                                                                                          #
                     ("!                                                                                         ("!                                                                                                                                                                                                                                                            ,+!                                                                                                               ,+!
                                                                                                                                                          IFILE=$1
                                                                                                                                                          OFILE=$2
                      "!                                                                                         "!                                                                                                                                                                                                                                                              +!                                                                                                               +!
                                                                                                                                                          cdo outputbounds $IFILE > ${IFILE%.*}.asc
                                                                                                                                                          #
                    !("!                                                                                         !("!                                                                                                                                                                                                                                                          !,+!                                                                                                               !,+!
                                                                                                                                                          gmtset HEADER_FONT Courier-Bold HEADER_FONT_SIZE 18
                                                                                                                                                          gmtset ANNOT_FONT_PRIMARY Courier-Bold ANNOT_FONT_SIZE_PRIMARY 10
                    !3"!                                                                                         !3"!
                                                                                                                                                          makecpt -Crainbow -T230/307/3 > zzz.cpt                                                                                                                                                                              !-+!                                                                                                               !-+!

                                                                                                                                                                                                                                                                                                                                                                                      "++!           ",+!             "-+!        ."+!         +!          ,+!       -+!        #"+!       #/+!
                           !""!          !("!             !3"!    4!"!   "!   ("!   3"!   +!"!     +5"!
                                                                                                                                                          psbasemap -Rd -JQ0/8i -X1.8i -Y2i -B40/40:."t21 temp2m GMT": \
                                                                                                                                                                                                                                                                                                                                                                                                                                                                           345$6$"1.7#08
                                                                                                                                                                     -U/0.0i/-1.3i/"joergwegner" -K >| $OFILE                                                                                                                                                                                                     ".+       ",+   "0+    "/+   "1+   "-+     "2+   .++

                            !""#$%&'$!($")*!!*+)   joergwegner                                                                                            psxy -R -J -M ${IFILE%.*}.asc -L -Czzz.cpt -O -K >> $OFILE                                                                                                                                                                   2007 Aug 24 09:26:00   joergwegner



                                                                                                                                                          psscale -Czzz.cpt -D4.0i/-0.5i/4.0i/0.2ih -B10/:"[\260C + 273.15]": \
                                                                                                                                                                   -O -K >> $OFILE
                                                                                                                                                          psbasemap -R -J -Bg15/g15 -O -K >> $OFILE
                                                                                                                                                          pscoast -R -J -Dc -W0.5p -O >> $OFILE
Summerschool 2007




                                                                                                                                                          #




                                                                                                                           +settings                                                                                                                                                                                               +map & grid

                                                                                                                                        !"#$!%&'"&$()*                                                                                                                                                                                                       !"#$!%&'"&$()*
                                                                                                 "++!           ",+!             "-+!   ."+!   +!   ,+!   -+!   #"+!   #/+!                                                                                                                                           "++!           ",+!             "-+!   ."+!   +!   ,+!   -+!     #"+!            #/+!


                                                                                           -+!                                                                                -+!                                                                                                                               -+!                                                                                                  -+!




                                                                                           ,+!                                                                                ,+!                                                                                                                               ,+!                                                                                                  ,+!




                                                                                            +!                                                                                +!                                                                                                                                 +!                                                                                                  +!




                                                                                          !,+!                                                                                !,+!                                                                                                                             !,+!                                                                                                  !,+!




                                                                                          !-+!                                                                                !-+!                                                                                                                             !-+!                                                                                                  !-+!


                                                                                                 "++!           ",+!             "-+!   ."+!   +!   ,+!   -+!   #"+!   #/+!                                                                                                                                           "++!           ",+!             "-+!   ."+!   +!   ,+!   -+!     #"+!            #/+!




                                                                                                                                                                                                                                                                                                                       2007 Aug 24 09:25:28   joergwegner
                                                                                                  2007 Aug 24 09:23:29   joergwegner




26
#!/bin/ksh
IFILE=$1                       Preparing the data
OFILE=$2
cdo outputbounds $IFILE > ${IFILE%.*}.asc
gmtset HEADER_FONT Courier-Bold HEADER_FONT_SIZE 18
gmtset ANNOT_FONT_PRIMARY Courier-Bold ANNOT_FONT_SIZE_PRIMARY 10
makecpt -Crainbow -T230/307/3 > zzz.cpt
psbasemap -Rd -JQ0/8i -X1.8i -Y2i -B40/40:."t21 temp2m GMT": \
                                                                        sophie 25% more zzz.asc
           -U/0.0i/-1.3i/"joergwegner" -K >| $OFILE
psxy -R -J -M ${IFILE%.*}.asc -L -Czzz.cpt -O -K >> $OFILE              # File = zzz.nc
psscale -Czzz.cpt -D4.0i/-0.5i/4.0i/0.2ih -B10/:"[\260C + 273.15]": \   # Name = T_2M
         -O -K >> $OFILE                                                # Code = -1
psbasemap -R -J -Bg15/g15 -O -K >> $OFILE                               # Level = 2
pscoast -R -J -Dc -W0.5p -O >> $OFILE
                                                                        # Date = 1950-01-01
                                                                        # Time = 03:00
                                                                        #
                                                                        > -Z287.575
                                                                           -10.7 34.5
                     cdo outputbounds zzz.grb > zzz.asc                    -10.5 34.5
 Summerschool 2007




                                                                           -10.5 34.7
                                                                           -10.7 34.7
                     creates                                               -10.7 34.5
                                                                        > -Z287.542
                                                                           -10.5 34.5
                                                                           -10.3 34.5
                                                                           -10.3 34.7
                                                                           -10.5 34.7
                                                                           -10.5 34.5
                                                                        .....

 27
#!/bin/ksh
IFILE=$1                                The frame
OFILE=$2
cdo outputbounds $IFILE > ${IFILE%.*}.asc
gmtset HEADER_FONT Courier-Bold HEADER_FONT_SIZE 18
gmtset ANNOT_FONT_PRIMARY Courier-Bold ANNOT_FONT_SIZE_PRIMARY 10
makecpt -Crainbow -T230/307/3 > zzz.cpt
psbasemap -Rd -JQ0/8i -X1.8i -Y2i -B40/40:."t21 temp2m GMT": \
           -U/0.0i/-1.3i/"joergwegner" -K >| $OFILE
psxy -R -J -M ${IFILE%.*}.asc -L -Czzz.cpt -O -K >> $OFILE
psscale -Czzz.cpt -D4.0i/-0.5i/4.0i/0.2ih -B10/:"[\260C + 273.15]": \
         -O -K >> $OFILE
psbasemap -R -J -Bg15/g15 -O -K >> $OFILE                                ,!+$,-./!.$012
                                                               !""! !("! !3"! 4!"! "! ("! 3"!                                              +!"!   +5"!
pscoast -R -J -Dc -W0.5p -O >> $OFILE                      3"!                                                                                           3"!



                                                                       ("!                                                                               ("!



                                                                        "!                                                                               "!



                                                                      !("!                                                                               !("!
 Summerschool 2007




                                                                      !3"!                                                                               !3"!

                                                                             !""!          !("!             !3"!   4!"!   "!   ("!   3"!   +!"!   +5"!


                     psbasemap
                                                                              !""#$%&'$!($")*!!*+)

                     -R             region in
                                                                                                     joergwegner




                                    west/east/south/north
                                    or shortcut g,d for global
                     -J             projection & scale
                     -X -Y          shift origin of plot
                     -B             axes, ticks, label, header
                     -U             timestamp
                     -K >| $OFILE   composing the postscript output


  28
#!/bin/ksh
IFILE=$1                     The settings
OFILE=$2
cdo outputbounds $IFILE > ${IFILE%.*}.asc
gmtset HEADER_FONT Courier-Bold HEADER_FONT_SIZE 18
gmtset ANNOT_FONT_PRIMARY Courier-Bold ANNOT_FONT_SIZE_PRIMARY 10
makecpt -Crainbow -T230/307/3 > zzz.cpt
psbasemap -Rd -JQ0/8i -X1.8i -Y2i -B40/40:."t21 temp2m GMT": \
           -U/0.0i/-1.3i/"joergwegner" -K >| $OFILE
psxy -R -J -M ${IFILE%.*}.asc -L -Czzz.cpt -O -K >> $OFILE
psscale -Czzz.cpt -D4.0i/-0.5i/4.0i/0.2ih -B10/:"[\260C + 273.15]": \
         -O -K >> $OFILE
psbasemap -R -J -Bg15/g15 -O -K >> $OFILE                                                               !"#$!%&'"&$()*
                                                                 "++!           ",+!             "-+!   ."+!   +!   ,+!   -+!   #"+!   #/+!
pscoast -R -J -Dc -W0.5p -O >> $OFILE                      -+!                                                                                -+!




                                                           ,+!                                                                                ,+!




                                                            +!                                                                                +!




                     -> .gmtdefaults4                     !,+!                                                                                !,+!
 Summerschool 2007




                                                          !-+!                                                                                !-+!

                                                                 "++!           ",+!             "-+!   ."+!   +!   ,+!   -+!   #"+!   #/+!




                                                                  2007 Aug 24 09:23:29   joergwegner




 29
#!/bin/ksh
IFILE=$1                   The map & the grid lines
OFILE=$2
cdo outputbounds $IFILE > ${IFILE%.*}.asc
gmtset HEADER_FONT Courier-Bold HEADER_FONT_SIZE 18
gmtset ANNOT_FONT_PRIMARY Courier-Bold ANNOT_FONT_SIZE_PRIMARY 10
makecpt -Crainbow -T230/307/3 > zzz.cpt
psbasemap -Rd -JQ0/8i -X1.8i -Y2i -B40/40:."t21 temp2m GMT": \
           -U/0.0i/-1.3i/"joergwegner" -K >| $OFILE
psxy -R -J -M ${IFILE%.*}.asc -L -Czzz.cpt -O -K >> $OFILE
psscale -Czzz.cpt -D4.0i/-0.5i/4.0i/0.2ih -B10/:"[\260C + 273.15]": \
         -O -K >> $OFILE
psbasemap -R -J -Bg15/g15 -O -K >> $OFILE                                                               !"#$!%&'"&$()*
                                                                 "++!           ",+!             "-+!   ."+!   +!   ,+!   -+!   #"+!   #/+!
pscoast -R -J -Dc -W0.5p -O >> $OFILE                      -+!                                                                                -+!




                                                           ,+!                                                                                ,+!




                                                            +!                                                                                +!




                                                          !,+!                                                                                !,+!
 Summerschool 2007




                                                          !-+!                                                                                !-+!

                                                                 "++!           ",+!             "-+!   ."+!   +!   ,+!   -+!   #"+!   #/+!




                                                                  2007 Aug 24 09:25:28   joergwegner




 30
#!/bin/ksh
IFILE=$1                   The colors
OFILE=$2
cdo outputbounds $IFILE > ${IFILE%.*}.asc
gmtset HEADER_FONT Courier-Bold HEADER_FONT_SIZE 18
gmtset ANNOT_FONT_PRIMARY Courier-Bold ANNOT_FONT_SIZE_PRIMARY 10
makecpt -Crainbow -T230/307/3 > zzz.cpt
psbasemap -Rd -JQ0/8i -X1.8i -Y2i -B40/40:."t21 temp2m GMT": \
           -U/0.0i/-1.3i/"joergwegner" -K >| $OFILE
psxy -R -J -M ${IFILE%.*}.asc -L -Czzz.cpt -O -K >> $OFILE
psscale -Czzz.cpt -D4.0i/-0.5i/4.0i/0.2ih -B10/:"[\260C + 273.15]": \
         -O -K >> $OFILE
psbasemap -R -J -Bg15/g15 -O -K >> $OFILE                                                                    !"#$!%&'"&$()*
                                                                 "++!           ",+!             "-+!        ."+!         +!          ,+!       -+!        #"+!       #/+!
pscoast -R -J -Dc -W0.5p -O >> $OFILE                      -+!                                                                                                               -+!




                                                           ,+!                                                                                                               ,+!




                                                            +!                                                                                                               +!




                                                          !,+!                                                                                                               !,+!
 Summerschool 2007




                                                          !-+!                                                                                                               !-+!

                                                                 "++!           ",+!             "-+!        ."+!         +!          ,+!       -+!        #"+!       #/+!


                                                                                                                                                      345$6$"1.7#08
                                                                                             ".+       ",+   "0+    "/+   "1+   "-+     "2+   .++

                                                                  2007 Aug 24 09:26:00   joergwegner




 31
#!/bin/ksh
IFILE=$1                   The data & the colors
OFILE=$2
cdo outputbounds $IFILE > ${IFILE%.*}.asc
gmtset HEADER_FONT Courier-Bold HEADER_FONT_SIZE 18
gmtset ANNOT_FONT_PRIMARY Courier-Bold ANNOT_FONT_SIZE_PRIMARY 10
makecpt -Crainbow -T230/307/3 > zzz.cpt
psbasemap -Rd -JQ0/8i -X1.8i -Y2i -B40/40:."t21 temp2m GMT": \
           -U/0.0i/-1.3i/"joergwegner" -K >| $OFILE
psxy -R -J -M ${IFILE%.*}.asc -L -Czzz.cpt -O -K >> $OFILE
psscale -Czzz.cpt -D4.0i/-0.5i/4.0i/0.2ih -B10/:"[\260C + 273.15]": \
         -O -K >> $OFILE
psbasemap -R -J -Bg15/g15 -O -K >> $OFILE
pscoast -R -J -Dc -W0.5p -O >> $OFILE
 Summerschool 2007




 32
The complete picture !
                                                                       !"#$!%&'"&$()*
                           "++!           ",+!             "-+!        ."+!         +!          ,+!       -+!        #"+!       #/+!


                     -+!                                                                                                               -+!




                     ,+!                                                                                                               ,+!




                      +!                                                                                                               +!




                    !,+!                                                                                                               !,+!
Summerschool 2007




                    !-+!                                                                                                               !-+!


                           "++!           ",+!             "-+!        ."+!         +!          ,+!       -+!        #"+!       #/+!

                                                                                                                345$6$"1.7#08

                                                       ".+       ",+   "0+    "/+   "1+   "-+     "2+   .++

                            2007 Aug 21 14:49:19   joergwegner



33
The options

                    makecpt   -Ccolortable          #master color table (rainbow, polar, red2green, ocean, ...)
                              -Tmin/max/incr        #range (lowest/highest/increment) value of variable
                    psbasemap -Rwest/east/south/north#region (west/east/south/north or abbr. g (global
                                                     #0 degree centered) or d (180 degree centered)
                              -Jmap/size       # select map projection and size see extra slide
                              -Xpos -Ypos      # x y position of lower left corner in inches[i] or centimeter[c]
                              -B[p|s]xinfo[/yinfo[/zinfo]][:".Title":WSEN
                                               #boundary annotation and tick mark intervalls
                                               #a= annotation, f = frame, g = grid (a40g30), WESN all axes with
                                               #ticks, wsen all axes without ticks, WE only west-east axes
                              -U/0.0i/-1.3i/"joergwegner" # timestamp location/annotation
                              -K -O                      #postscript mode: K more code will follow, O overlay
                    psxy      -M IFILE                   #ascii input file (from cdo outputbounds)
                              -L                         #force closed polygons
                              -Ccolortable               #color palette file
                    psscale   -D4.0i/-0.5i/4.0i/0.2ih    #center/left[top] position length/height in inch[i] or
                                                         #cm[c] add. h for horizontal position
Summerschool 2007




                              -B10/:"[\260C + 273.15]": #annotation, tick and interval for colorbar

                    psbasemap -Bxgrid/ygrid              #in degree
                    pscoast   -Dresolution               #of map file (crude, low, intermediate, high, full)
                              -W0.5p                     #Pen size in points
                              -Nborder                   #draw political borders [1,2,3,a]& format
                              -Iriver                    #draw rivers [1-10, a, r, i, c]

                    detailled description with
                    man <command>



34
The defaults
                               .gmtdefaults4       -I-
                                                                 #-------- Basemap Layout Parameters ------
                    #                                            BASEMAP_AXES            = WESN
                    #       GMT-SYSTEM 4.1.1 Defaults file       BASEMAP_FRAME_RGB       = 0/0/0
                    #                                            BASEMAP_TYPE            = fancy
                    #-------- Plot Media Parameters ---------    FRAME_PEN               = 1.25p
                    PAGE_COLOR              = 255/255/255        FRAME_WIDTH             = 0.2c
                    PAGE_ORIENTATION        = landscape          GRID_CROSS_SIZE_PRIMARY = 0c
                    PAPER_MEDIA             = a4                 GRID_CROSS_SIZE_SECONDARY       = 0c
                    #-------- Basemap Annotation Parameters --   GRID_PEN_PRIMARY        = 0.25p
                    ANNOT_MIN_ANGLE         = 20                 GRID_PEN_SECONDARY      = 0.5p
                    ANNOT_MIN_SPACING       = 0                  MAP_SCALE_HEIGHT        = 0.2c
                    ANNOT_FONT_PRIMARY      = Courier-Bold       TICK_LENGTH             = 0.2c
                    ANNOT_FONT_SIZE         = 10p                TICK_PEN                = 0.5p
                    ANNOT_OFFSET_PRIMARY    = 0.1c               X_AXIS_LENGTH           = 25c
                    ANNOT_FONT_SECONDARY    = Courier-Bold       Y_AXIS_LENGTH           = 15c
                    ANNOT_FONT_SIZE_SECONDARY       = 14p        X_ORIGIN                = 2.5c
                    ANNOT_OFFSET_SECONDARY = 0.2c                Y_ORIGIN                = 2.5c
Summerschool 2007




                    DEGREE_SYMBOL           = ring               UNIX_TIME               = FALSE
                    HEADER_FONT             = Courier-Bold       UNIX_TIME_POS           = -2c/-2c
                    HEADER_FONT_SIZE        = 18p                #-------- Color System Parameters --------
                    HEADER_OFFSET           = 0.47625c           COLOR_BACKGROUND        = 0/0/0
                    LABEL_FONT              = Courier-Bold       COLOR_FOREGROUND        = 255/255/255
                    LABEL_FONT_SIZE         = 16p                COLOR_NAN               = 128/128/128
                    LABEL_OFFSET            = 0.3c               COLOR_IMAGE             = adobe
                    OBLIQUE_ANNOTATION      = 1                  COLOR_MODEL             = rgb
                    PLOT_CLOCK_FORMAT       = hh:mm:ss           HSV_MIN_SATURATION      = 1
                    PLOT_DATE_FORMAT        = yyyy-mm-dd         HSV_MAX_SATURATION      = 0.1
                    PLOT_DEGREE_FORMAT      = +ddd:mm:ss         HSV_MIN_VALUE           = 0.3
                    Y_AXIS_TYPE             = hor_text           HSV_MAX_VALUE           = 1

35
The defaults
                           .gmtdefaults4       -II-
                    #-------- PostScript Parameters ---------
                    CHAR_ENCODING           = ISOLatin1+
                    DOTS_PR_INCH            = 300
                    N_COPIES                = 1
                    PS_COLOR                = rgb
                    PS_IMAGE_COMPRESS       = none              #-------- Projection Parameters ---------
                    PS_IMAGE_FORMAT         = ascii             ELLIPSOID               = WGS-84
                    PS_LINE_CAP             = butt              MAP_SCALE_FACTOR        = default
                    PS_LINE_JOIN            = miter             MEASURE_UNIT            = cm
                    PS_MITER_LIMIT          = 0                 #-------- Calendar/Time Parameters ------
                    GLOBAL_X_SCALE          = 1                 TIME_FORMAT_PRIMARY     = full
                    GLOBAL_Y_SCALE          = 1                 TIME_FORMAT_SECONDARY   = full
                    #-------- I/O Format Parameters ---------   TIME_EPOCH              = 2000-01-01T00:00:00
                    D_FORMAT                = %lg               TIME_IS_INTERVAL        = OFF
                    FIELD_DELIMITER         = tab               TIME_INTERVAL_FRACTION = 0.5
                    GRIDFILE_SHORTHAND      = FALSE             TIME_LANGUAGE           = us
Summerschool 2007




                    GRID_FORMAT             = nf                TIME_SYSTEM             = j2000
                    INPUT_CLOCK_FORMAT      = hh:mm:ss          TIME_UNIT               = d
                    INPUT_DATE_FORMAT       = yyyy-mm-dd        TIME_WEEK_START         = Sunday
                    IO_HEADER               = FALSE             Y2K_OFFSET_YEAR         = 1950
                    N_HEADER_RECS           = 1                 #-------- Miscellaneous Parameters -------
                    OUTPUT_CLOCK_FORMAT     = hh:mm:ss          INTERPOLANT             = akima
                    OUTPUT_DATE_FORMAT      = yyyy-mm-dd        LINE_STEP               = 0.025c
                    OUTPUT_DEGREE_FORMAT    = +D                VECTOR_SHAPE            = 0
                    XY_TOGGLE               = FALSE             VERBOSE                 = FALSE


                             gmtset HEADER_FONT Courier-Bold HEADER_FONT_SIZE 18
                             gmtset ANNOT_FONT_PRIMARY Courier-Bold ANNOT_FONT_SIZE_PRIMARY 10
36
The color-table
                           #colors from deep blue over yellow and red to violet
                           #B= < z0, F= > zn, N=NaN (not a number)
                           #COLOR_MODEL = RGB
                           from K red     green     blue    to K   red     green   blue
                    z0     252     15      0        100     254    35      50      100
                    z1     254     35      50       100     256    35      50      140
                    .      256     35      50       140     258    35      80      160
                    .      258     35      80       160     260    35      125     180
                    .      260     35      125      180     262    100     200     225
                           262     100     200      225     264    150     225     250
                           264     150     225      250     266    175     240     250
                           266     175     240      250     268    200     250     250
                           268     200     250      250     270    210     250     230
                           270     210     250      230     272    230     250     210
                           272     230     250      210     274    255     255     175
                           274     255     255      175     276    255     220     175
                           276     255     220      175     278    255     200     150
                           278     255     200      150     280    255     200     0
Summerschool 2007




                           280     255     200      0       282    255     150     0
                           282     255     150      0       284    255     100     0
                           284     255     100      0       286    255     50      0
                           286     255     50       0       288    200     0       0
                           288     200     0        0       290    175     0       0
                    .      290     175     0        0       292    125     0       0
                    .      292     125     0        0       294    75      0       0
                    .      294     75      0        0       296    160     70      160
                    zn-1   296     160     70       160     298    130     30      140
                    zn     298     130     30       140     300    100     0       120
                           B       0       0        0
                           F       255     255      255
                           N       128     128      128
37
tail, cut & sed

tiny 74%cdo info temp2.rm5f.grb
    -1 :       Date Time Code Level             Size    Miss   :   Minimum   Mean     Maximum
     1 : 0801-03-15 18:00 167     0                1       0   :             286.67
     2 : 0801-04-15 18:00 167     0                1       0   :             287.36
     3 : 0801-05-15 18:00 167     0                1       0   :             288.12
....


                    cdo info temp2.day15f.grb | tail +2 | \
                        cut -c 10-19,73-79 | sed -e"s/ /,/g" > temp2.day15f.asc



                                   tiny 76%more temp2.rm5f.asc
Summerschool 2007




                                   0801-03-15,286.67
                                   0801-04-15,287.36
                                   0801-05-15,288.12
                                   0801-06-15,288.66
                                   0801-07-15,288.83
                                   0801-08-15,288.54
                                   0801-09-15,287.89
                                   0801-10-15,286.98
                                   0801-11-15,286.09


38
Timeseries I: preparing the data

                                                               timeseries.rmm.j
                    #!/bin/ksh
                    cdo selcode,167 sus0000_BOT_0801.grb temp2.1.grb
                    cdo selcode,167 sus0000_BOT_0802.grb temp2.2.grb
                    cdo selcode,167 sus0000_BOT_0803.grb temp2.3.grb # loop!
                    cdo selcode,167 sus0000_BOT_0804.grb temp2.4.grb
                    cdo selcode,167 sus0000_BOT_0805.grb temp2.5.grb
                    cdo mergetime temp2.?.grb temp2.1-5.grb
                    cdo setday temp2.1-5.grb temp2.day15.grb
                    cdo runmean,5 temp2.day15.grb temp2.rm5.grb
                    cd ../
                    cdo fldmean temp2.day15.grb temp2.day15f.grb
                    cdo fldmean temp2.rm5.grb temp2.rm5f.grb
Summerschool 2007




                    cdo info temp2.day15f.grb | tail +2 | \
                        cut -c 10-19,73-79 | sed -e"s/ /,/g" > temp2.day15f.asc
                    cdo info temp2.rm5f.grb | tail +2 | \
                        cut -c 10-19,73-79 | sed -e"s/ /,/g" > temp2.rm5f.asc




39
Timeseries II: GMT handling
                                                                              timeseries.rmm.j
                    IFIL1=temp2.day15f.asc
                    IFIL2=temp2.rm5f.asc
                    OFILE=temp2.rmm.ps
                    rm $OFILE
                    gmtset INPUT_DATE_FORMAT yyyy-mm-dd
                    gmtconvert -F0,1 -f0T -Hi $IFIL1 > tempday15.env
                    gmtconvert -F0,1 -f0T -Hi $IFIL2 > temprm5.env
                    info=`minmax -f0T -I10/10 -C ${IFIL1}`
                    info1=`echo $info | cut -d" " -f 1`
                    info2=`echo $info | cut -d" " -f 2`
                    info3=`echo $info | cut -d" " -f 3`
                    info4=`echo $info | cut -d" " -f 4`
                    psbasemap -R${info1}/${info2}/${info3}/${info4} \
Summerschool 2007




                              -JX8iT/5i -X2.0i -Y1.5i                \
                              -Bp3o:"Time":/5WS:=K::"Temperature"::."TEMP MM&RM5 T31 ECHAM5": \
                              -Bs2Y/WS -K >| $OFILE
                    psxy -R -J tempday15.env -W0.5p,/255/0/0,-- -O -K >> $OFILE
                    psxy -R -J temprm5.env -O >> $OFILE




40
Timeseries III: The picture
                                                                         TEMP MM&RM5 T31 ECHAM5
                    Temperature   K 290




                                  K 285
Summerschool 2007




                                  K 280
                                          01   04   07   10   01   04    07    10   01   04   07   10   01   04    07    10   01   04   07   10
                                                                        0802                                      0804
                                                                                          Time

41
Regional data & Albers projection
                                                                   CLM d2 t_s

                    sophie 65% clmalbersproj.j
                    #!/bin/ksh
                    set -xv
                    #
                    IFILE=clm_a1b_d2_ts.nc
                    REC=1
                    OFILE=clm${REC}.ps

                    cdo outputbounds -seltimestep,$REC \
                        $IFILE > ${IFILE%.*}${REC}.asc
                    #
                    psbasemap -R-10/30/35/75 -JB10/40/25/85/6i \
                              -B15/10wsen:."CLM d2 t_s": \
                              -P -K > $OFILE
Summerschool 2007




                    psxy -R -J -M ${IFILE%.*}${REC}.asc -L \
                        -Ccolor240-320.3.cpt -K -O >> $OFILE
                    pscoast -R -J -Di -Ir -Na/1p,255/0/0 \
                        -W0.5p -O >> $OFILE




42
Grids & landseamask                                                              clm grid d2 d3 with d3 land seamask
                                                                            6˚         8˚        10˚       12˚         14˚




                                                                      58˚                                                    58˚



                    #!/bin/ksh
                    #
                    psbasemap -R5/15/50/59 -JM6i \
                               --HEADER_FONT_SIZE=18 \
                    -B2/2:."clm grid d2 d3 with d3 land seamask": \   56˚                                                    56˚
                               -P -K >! zclm.ps
                    psxy -R -J -M clmls3.asc -Czj.cpt -L \
                         -P -O -K >> zclm.ps
                    psxy -R -J -M clmd3.asc -W0/0/0 \
                         -P -O -K >> zclm.ps
                    psxy -R -J -M clmd2.asc -W255/0/0 \
                                                                      54˚                                                    54˚
                         -P -O -K >> zclm.ps
Summerschool 2007




                    pscoast -R -J -Di -W1.0p,0/0/255 \
                            -P -O >> zclm.ps
                    #
                    exit

                                                                      52˚                                                    52˚




                                                                      50˚                                                    50˚
                                                                            6˚         8˚        10˚       12˚         14˚


43
   MPIOM in original & regular grid
                                 #!/bin/ksh
oceancurvreg.j #
                                 cdo -t mpiom1 -f nc setgrid,GR30s.nc zzz.grb oceanorig.nc #original grid
                                 cdo remapcon,r240x120 oceanorig.nc oceanreg.nc             #regular grid
                                 cdo outputbounds oceanorig[reg].nc >| ${IFILE}             #create GMT input
                                 #
                                 makecpt -Crainbow -T-3/33/3 > color.cpt
                                 psbasemap -R-105/45/0/90 -JQ0/8i -X1.8i -Y2i -B40/40:."MPIOM surface temp GMT": \
                                           -U/0.0i/-1.3i/"joergwegner" -K >| $OFILE
                                 psxy -R -J -M ${IFILE} -L -Ccolor.cpt -O -K >> $OFILE
                                 psscale -Ccolor.cpt -D4.0i/-0.5i/4.0i/0.2ih -B10/:"[\260C]": -O -K >> $OFILE
                                 psbasemap -R -J -Bg15/g15 -O -K >> $OFILE
                                 pscoast -R -J -Dc -W0.5p -O >> $OFILE


                                                                     !"#$!%%&'()*+,%-,./%0!1                                                                                        !"#$!%%&'()*+,%-,./%0!1
                               233!           243!             253!      623!        3!        43!   53!          723!   783!                 233!           243!             253!      623!        3!        43!   53!          723!   783!


                         53!                                                                                                    53!     53!                                                                                                    53!
    Summerschool 2007




                         43!                                                                                                    43!     43!                                                                                                    43!




                          3!                                                                                                    3!       3!                                                                                                    3!




                        !43!                                                                                                    !43!   !43!                                                                                                    !43!




                        !53!                                                                                                    !53!   !53!                                                                                                    !53!


                               233!           243!             253!      623!        3!        43!   53!          723!   783!                 233!           243!             253!      623!        3!        43!   53!          723!   783!

                                                                                                           9:;<                                                                                                           9:;<

                                                                     3          73        23         63                                                                             3          73        23         63

                                2007 Aug 28 16:53:47   joergwegner                                                                             2007 Aug 28 17:06:37   joergwegner




    44
  MPIOM: select north atlantic
                       #!/bin/ksh
                       #
                       cdo -t mpiom1 -f nc setgrid,GR30s.nc zzz.grb oceanorig.nc #original grid
                       cdo remapcon,r240x120 oceanorig.nc oceanreg.nc             #regular grid
                       cdo sellonlatbox,-105,45,0,90 oceanreg.nc northatl.nc      #select north atlantic
oceanselatl.j          cdo outputbounds northatl.nc >| ${IFILE}                   #create GMT input
                       makecpt -Crainbow -T-3/33/3 > color.cpt
                       psbasemap -R-105/45/0/90 -JQ0/8i -X1.8i -Y2i -B40/40:."MPIOM surface temp GMT": \
                                  -U/0.0i/-1.3i/"joergwegner" -K >| $OFILE
                       psxy -R -J -M ${IFILE} -L -Ccolor.cpt -O -K >> $OFILE
                       psscale -Ccolor.cpt -D4.0i/-0.5i/4.0i/0.2ih -B10/:"[\260C]": -O -K >> $OFILE
                       psbasemap -R -J -Bg15/g15 -O -K >> $OFILE
                       pscoast -R -J -Dc -W0.5p -O >> $OFILE

                                                                                                       MPIOM   surface temp GMT
                                                                                280˚                           320˚          0˚           40˚
   Summerschool 2007




                                                            80˚                                                                                 80˚




                                                            40˚                                                                                 40˚




                                                             0˚                                                                                 0˚
                                                                                280˚                           320˚          0˚           40˚

                                                                                                                                   [°C]


   45                                                             2007 Aug 28 17:15:39   joergwegner
                                                                                                       0       10     20      30
MPIOM: north and south pole
                                                        cdo outputbounds $IFILE >| ${IFILE%.*}.asc
                                                        makecpt -Crainbow -T-3/33/3 > zzz.cpt
                                                        psbasemap -Rg -JG0/90[-90]/6i -X1.8i -Y2i -B40/40:."MPIOM surface temp GMT": \
                    oceanpole.j                                   -U/0.0i/-1.3i/"joergwegner" -K >| $OFILE
                                                        psxy -R -J -M ${IFILE%.*}.asc -L -Czzz.cpt -O -K >> $OFILE
                                                        psscale -Czzz.cpt -D3.0i/-0.5i/4.0i/0.2ih -B10/:"[\260C]": -O -K >> $OFILE
                                                        psbasemap -R -J -Bg15/g15 -O -K >> $OFILE
                                                        pscoast -R -J -Dl -W0.5p -O >> $OFILE
                                                                                                                                                                                  0˚
                                                                   ˚                    160
                                                             200                              ˚

                                                                                                                                                                                                         40
                                                                                                                                                  0˚                                                          ˚
                                                                                                                                                32
                               0˚




                                                                                                                12
                               24




                                                                                                                0˚




                                                                                                                            280˚




                                                                                                                                                                                                                          80 ˚
Summerschool 2007

                        280˚




                                                                                                                     80 ˚




                                                                                                                                   24




                                                                                                                                                                                                                     0˚
                                                                                                                                   0˚




                                                                                                                                                                                                                     12
                                          32
                                            0˚                                                              ˚
                                                                                                       40

                                                                                                                                                                 200                            ˚
                                                                                                                                                                       ˚                    160
                                                                              0˚

                                                                                                        [°C]                                                                                                  [°C]

                                                    0                    10        20             30                                                    0                    10        20           30

                                    2007 Aug 29 15:44:00   joergwegner                                                                  2007 Aug 29 15:54:03   joergwegner


46
MPIOM: north and south pole
                                                                                                           ˚          160
                                                                                                     200                    ˚




                    sophie 65%oceanpole.j
                    #!/bin/ksh
                    # changed region!




                                                                       ˚




                                                                                                                                             12
                                                                        0
                    IFILE=zzz.nc




                                                                     24




                                                                                                                                               0˚
                    OFILE=zzsr.ps
                    cdo outputbounds $IFILE >| \
                               ${IFILE%.*}.asc
                    #
                    makecpt -Cpolar -T-3/12/1 > zzz.cpt
                    psbasemap -R-180/180/55/90 -JG0/90/6i \
                               -X1.8i -Y2i -B40/40 \
                               -U/0.0i/-1.3i/"joergwegner"




                                                              280˚




                                                                                                                                                    80˚
                               -K >| $OFILE
                    psxy -R -J -M ${IFILE%.*}.asc -L \
                         -Czzz.cpt -O -K >> $OFILE
                    psscale -Czzz.cpt
Summerschool 2007




                            -D3.0i/-0.5i/4.0i/0.2ih \
                            -B10/:"[\260C]": \
                            -O -K >> $OFILE
                    psbasemap -R -J -Bg15/g15 \
                                                                                  32
                               -O -K >> $OFILE                                       0˚
                                                                                                                                     40
                                                                                                                                        ˚
                    pscoast -R -J -Dl -W0.5p -O >> $OFILE
                    #
                                                                                                                 0˚

                                                                                                                                      [°C]

                                                                                                     0                          10

                                                                            2007 Aug 30 14:13:59   joergwegner


47
ECHAM3: orthographic projection
                                                                              t21 temp2m GMT




                    sophie 64%balltemp.j
                    #!/bin/ksh
                    set -vx
                    #
                    IFILE=temp120.grb
                    OFILE=tempball.ps
                    cdo outputbounds $IFILE > ${IFILE%.*}.asc
                    makecpt -Cpolar -T230/307/3 > zzz.cpt
                    psbasemap -Rg -JG20/45/6i -B40/40 \
                               -K >| $OFILE
                    psxy -R -J -M ${IFILE%.*}.asc -L -W0.2p \
Summerschool 2007




                         -Czzz.cpt -O -K >> $OFILE
                    psscale -Czzz.cpt -D3.0i/-0.5i/4.0i/0.2ih \
                            -B10/:"[\260C + 273.15]": \
                            -O -K >> $OFILE
                    pscoast -R -J -Dc -I1 -W0.5p -O >> $OFILE




                                                                                                                  [°C + 273.15]
                                                                  230   240   250   260   270   280   290   300



48
ECHAM3: orthographic projection: moving


                    tiny 182%ballmovie.j
                    #!/bin/ksh
                    set -vx
                    #
                    IFILE=temp120.grb
                    integer LON=370
                    integer LO2=1
                    cdo outputbounds $IFILE > ${IFILE%.*}.asc
                    #
                    cd /Users/joerg/Summer
                    while (( (LON=LON-10) >= 10 )); do
                    typeset -LZ2 LO2
                    OFILE=movball.${LO2}.ps
                    makecpt -Cpolar -T230/307/3 > zzz.cpt
                    psbasemap -Rg -JG${LON}/45/6i \
Summerschool 2007




                               -B40/40 -Y1.6i -K >| $OFILE
                    psxy -R -J -M ${IFILE%.*}.asc -L \
                         -W0.2p -Czzz.cpt -O -K >> $OFILE
                    psscale -Czzz.cpt -D3.0i/-0.5i/4.0i/0.2ih \
                            -B10/:"[K]": -O -K >> $OFILE
                    pscoast -R -J -Dc -I1 -W0.5p -O >> $OFILE
                    let LO2=LO2+1
                    done




49
                      Thanks
                        for
Summerschool 2007




                    Listening!




50
                    ECHAM5 :

                    Boden-Monatsmittelfiles (BOT.._mm_..) werden            MPIOM
                    standardmaessig die codes
                    97 ice cover (fraction of grid box)                    fuer mpiom sollten folgende codes einen ersten Ueberblick geben:
                    103 surface temperature of water
                    167 2m temperature                                     2, 5, 70, 79, 13, 15, 27, 110, 111, 183
                    210 ice cover (fraction of 1-SLM)                      HAMOCC
                    211 ice depth
                                                                           code 7 dissolved inorganic carbon
                    CO2-Monatsmittelfile die codes                          code 11 dissolved_phosphate
                    5 upward surface CO2 flux (acc.)                        code 12 oxygen concentration
                    6 upward land CO2 flux (acc.)                           code 81 phosphate flux in 90m
                    7 upward ocean CO2 flux (acc.)                          code 84 detritus export production
                    8 CO2 content (acc.)                                   code 94 detritus sediment flux

                    JSBACH :

                    165   LAI_yDayMean Mean Leaf Area Index of the Previous Day []
                    166   NPP_yDayMean Mean NPP Rate of the Previous Day [mol(CO2)m-2(canopy) s-1]
                    167   GPP_yDayMean Mean GPP Rate of the Previous Day [mol(CO2)m-2(canopy) s-1]
                    168   topSoilTemp_yDayMean Previous Day Mean Temperature of the Uppermost Soil Layer [K]
Summerschool 2007




                    169   alpha_yDayMean Previous Day Mean Value of the Water StressCoefficient []
                    171   box_NPP_yDayMean Mean NPP Rate of the Previous Day [mol(CO2)m-2(grid box) s-1]
                    173   box_GPP_yDayMean Mean GPP Rate of the Previous Day [mol(CO2)m-2(grid box) s-1]

                    und ausserdem die Variablen, die angeben, wieviel sich in den verschiedenen Kohlenstoffpools befindet (auch im veg-stream):
                    160 boxC_green          C-Pool for Green Parts of Vegetation [mol(C) m-2(grid box)]
                    161 boxC_woods           C-Pool for Structural Material of Plants [mol(C) m-2(grid box)]
                    162 boxC_reserve         C-Pool for reserve carbohydrates (starches, sugars) [mol(C) m-2(grid box)]
                    163 boxC_fast          C-Pool for fastly respirated soil organic material [mol(C) m-2(grid box)]
                    164 boxC_slow           C-Pool for slowly respirated soil organic material [mol(C) m-2(grid box)]
                    170 box_soil_respiration Soil respiration [mol(C) m-2(grid box)]
                    176 box_Cpools_total      Sum of carbon from all carbon pools [mol(CO2) m-2(grid box)]

51

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:140
posted:8/4/2011
language:English
pages:51