Crex software
Download
1 / 58

CREX software - PowerPoint PPT Presentation


  • 131 Views
  • Uploaded on

CREX software. Milan Dragosavac. Requirements for CREX software. Suitable for small volume of observations Building blocks for other applications Encoding Decoding Conversion to BUFR Low maintenance costs Portable. Programming languages used. Fortran 77

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' CREX software' - adena-hampton


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Crex software

CREX software

Milan Dragosavac

WMO BUFR training course Langen 17-20 April 2007


Requirements for crex software
Requirements for CREX software

  • Suitable for small volume of observations

  • Building blocks for other applications

  • Encoding

  • Decoding

  • Conversion to BUFR

  • Low maintenance costs

  • Portable

WMO BUFR training course Langen 17-20 April 2007


Programming languages used
Programming languages used

  • Fortran 77

    - All CREX subroutines and functions

  • C

    - Reading/writing CREX data

    - gbyte, sbyte routines unpack/pack bytes

WMO BUFR training course Langen 17-20 April 2007


Ecmwf crex software
Ecmwf CREX software

  • How to get the software?

    The software can be downloaded from Ecmwf web site

    http://www.ecmwf.int/products/data/software/

  • Go to Free download and get crex_000320.tar.gz file

  • gunzip crex_000320.tar.gz

  • cd crex_000320

  • Read README file for explanations

  • Execute make command which will create libcrex.a

  • cd example

  • Running make will create number of executables

WMO BUFR training course Langen 17-20 April 2007


Ecmwf crex software1
Ecmwf CREX software

  • Content of crex_000310 directory

    -rw-r----- 1 maa ma 450 Jul 5 2006 Makefile

    -rw-r----- 1 maa ma 10758 Jul 5 2006 README

    -rwxr----- 1 maa ma 3662 Jul 5 2006 build_library

    drwxr-x--- 2 maa ma 4096 Jul 5 2006 config

    drwxr-x--- 2 maa ma 4096 Feb 12 07:53 crexdc

    drwxr-x--- 2 maa ma 4096 Feb 12 11:07 crextables

    drwxr-x--- 2 maa ma 4096 Jul 5 2006 doc

    drwxr-x--- 3 maa ma 4096 Feb 12 09:27 example

    -

WMO BUFR training course Langen 17-20 April 2007


Ecmwf crex software2
Ecmwf CREX software

rwxr----- 1 maa ma 3107 Jul 5 2006 install

-rw-r----- 1 maa ma 1196 Jul 5 2006 licence

drwxr-x--- 2 maa ma 4096 Jul 5 2006 options

drwxr-x--- 2 maa ma 4096 Feb 12 07:53 pbio

WMO BUFR training course Langen 17-20 April 2007


Ecmwf crex software3
Ecmwf CREX software

  • config directory contains various configuration files

    for different platforms and compilers

  • options directory contains various options for different platforms

  • You can make additional configurations and options if needed

WMO BUFR training course Langen 17-20 April 2007


Ecmwf crex software4
Ecmwf CREX software

  • pbio

    pbio directory contain all c and fortran routines needed for BUFR and CREX IO

    all routines are part of bufr and crex libraries

  • crexdc

    crexdc directory contain all crex software source code routines which are written in fortran 77

WMO BUFR training course Langen 17-20 April 2007


Ecmwf crex software5
Ecmwf CREX software

  • example

    bufr2crex.F

    create_crex.F

    crex2bufr.F

    crextdexp.F

    decode_crex.F

  • doc

    doc directory contain CREX User’s Guide and Reference Manual in pdf format

WMO BUFR training course Langen 17-20 April 2007


Ecmwf crex software6
Ecmwf CREX software

  • Crex is table driven code form

    - no need to transfer element names, units …

    - no need to change CREX software for new observations

  • Crex table B – classification elements

    - reference number

    - element name

    - element unit

    - scale

    - data width in bytes

WMO BUFR training course Langen 17-20 April 2007


Ecmwf crex software7
Ecmwf CREX software

  • Crex table D – list of common sequences to describe the data

    - table B elements

    - operators

    - other table D descriptors

  • Crex table C – text and meaning of code/flag tables

WMO BUFR training course Langen 17-20 April 2007


Ecmwf crex software8
Ecmwf CREX software

  • CREX table naming convention

    BXXYYZZ

    DXXYYZZ

    B - Crex table B

    D - Crex table D

    XX - Crex Master table used “00”

    YY - Crex edition number used “01”

    ZZ - Crex table version number “03”

WMO BUFR training course Langen 17-20 April 2007


Ecmwf crex software9
Ecmwf CREX software

  • PATH for CREX tables

    export CREX_TABLES=/xxx/

    setenv CREX_TABLES /xxx/

    The path must end with back slash “/”

  • Check digit indicator

    export USE_E=true

    setenv USE_E true

WMO BUFR training course Langen 17-20 April 2007


Ecmwf crex software10
Ecmwf CREX software

  • Defaults

    Integer missing value indicator

    NVIND=2147483647

    Real*8 missing value indicator

    RVIND= 1.7E38

WMO BUFR training course Langen 17-20 April 2007


Decoding crex data
Decoding CREX data

There are 4 steps in CREX data processing

  • Open crex input file

  • Read in one crex message at a time

  • Expand crex message

  • Use the data

    Repeat last three steps until the end of file is reached

WMO BUFR training course Langen 17-20 April 2007


Pbio routines
PBIO routines

FORTRAN routines to handle products in an unblocked binary file

subroutine PBOPEN ( kunit, filename, mode, kerr )

Input arguments:

filename - character variable

mode - character variable ‘r’ read, ‘w’ write, ‘a’ append, ‘r+’ read and write

Output arguments:

kunit - integer unit number

kerr - integer status return code

WMO BUFR training course Langen 17-20 April 2007


Pbio routines1
PBIO routines

kerr - 0, successful

-1, file does not exist

-2, invalid file name

-3, invalid open mode specified

WMO BUFR training course Langen 17-20 April 2007


Pbio routines2
PBIO routines

subroutine PBCLOSE (kunit, kret)

Input argument is an integer:

kunit - unit number from PBOPEN

Output argument is an integer:

kret – status return code

0 - OK

-1 - error in handling the file

WMO BUFR training course Langen 17-20 April 2007


Pbio routines3
PBIO routines

subroutine PBWRITE( kunit, karray, kount, kerr)

Input arguments are integers:

kunit – unit number from PBOPEN

karray- an integer array holding bytes for write

kount – number of bytes to write to the file

Output arguments:

kret – status return code

>= 0 number of bytes written to the file

-1 Error in writing to the file

WMO BUFR training course Langen 17-20 April 2007


Pbio routines4
PBIO routines

  • Subroutine PBCREX( KUNIT, KARRAY, KINLEN,

    KOUTLEN, KRET)

    Input arguments:

    KUNIT - unit number returned by PBOPEN

    KARRAY - integer array big enough to hold crex message

    KINLEN - size in bytes of KARRAY

    Output arguments:

    KOUTLEN - size in bytes of the CREX product read

    KRET - 0 if OK

WMO BUFR training course Langen 17-20 April 2007


Pbio routines5
PBIO routines

KRET -1 if EOF is hit before CREX product is read

-2 if file read error is generated

-3 if size of KARRAY is not sufficient for the CREX product

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines
CREX software FORTRAN routines

  • CREX expansion

    subroutine crexex( kbufl, ybuff, ksup, ksec0,ksec1, ksec3, kelem, cnames, cunits, kvals, values, cvals, kerr)

    Input arguments:

    kbufl - length of bufr message in words

    ybuff - character string containing crex message

    kelem - expected number of expanded elements

    kvals - the size of values array in words

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines1
CREX software FORTRAN routines

Output arguments:

ksup - an array containing supplementary information

ksec0 - integer array of 3 words containing CREX

section 0 information

ksec1 - integer array of at least 40 words containing

CREX section 1 information

ksec3 - integer array of 4 words

cnames – character*64 array of kelem containing element names

cunits - character*24 array of kelem containing element units

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines2
CREX software FORTRAN routines

values - real*8 array of kvals containing expanded data

cvals - character*80 array of kvals containing code table or CCITTIA5 CREX element entries

kerr - return error code

WMO BUFR training course Langen 17-20 April 2007


Ksup array of 9 words
KSUP array of 9 words

WMO BUFR training course Langen 17-20 April 2007


Ksec0 array
KSEC0 array

WMO BUFR training course Langen 17-20 April 2007


Ksec1 array
KSEC1 array

WMO BUFR training course Langen 17-20 April 2007


Ksec1 array1
KSEC1 array

WMO BUFR training course Langen 17-20 April 2007


Ksec3 array
KSEC3 array

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines3
CREX software FORTRAN routines

  • Values array is of type real*8

  • If crex table B element is CCITTIA5, corresponding element contain a real number, when truncated to an integer represents

    index*1000+length

    where

    index – subscript of the element in CVALS array where character strings are stored

    length – number of characters in the string

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines4
CREX software FORTRAN routines

In the case of multi-subset data, one dimensional array

VALUES contains all subsets. Index to values array of

i-th element of observation is:

index=i+(nsub-1)*kelem

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines5
CREX SOFTWARE fortran ROUTINES

  • CREX encoding

    subroutine crexen (ksec0, ksec1, ksec3, ktdlen, crexktdlst, kdlen, kdata, kelem, kvals, values, cvals, kbufl, kerr)

    Input arguments:

    ksec0 - an integer array containing section 0 information

    ksec1 - an integer array containing section 1 information

    ksec3 - an integer array of size 4 containing number of subsets

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines6
CREX software FORTRAN routines

ktdlen - an integer, number of data descriptors to be packed in section 1 of crex message

crexktdlst - an integer array containing ktdlen descriptors

kdlen - an integer, dimension of kdata array

kdata - an integer array containing delayed replication values

kelem - an integer containing expected number of expanded elements

kvals - an integer containing expected number of data values

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines7
CREX software FORTRAN routines

values - real*8 array of kvals words containing element values

cvals - character*80 array of kvals words containing CCITTIA5 elements

Output arguments:

kbufl - an integer containing the length of bufr message in words

kbuff - an integer array containing packed bufr message

kerr - integer, status return code

WMO BUFR training course Langen 17-20 April 2007


Ksec0 array1
KSEC0 array

WMO BUFR training course Langen 17-20 April 2007


Ksec1 array2
KSEC1 array

WMO BUFR training course Langen 17-20 April 2007


Ksec1 array3
KSEC1 array

WMO BUFR training course Langen 17-20 April 2007


Ksec3 array1
KSEC3 array

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines8
CREX software FORTRAN routines

  • Printing routines

    subroutine CREXPRS0 (ksec0)

    Input arguments:

    ksec0 – an array containing section 0 information

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines9
CREX software FORTRAN routines

  • subroutine crexprs1 ( ksec1,ksec3, ktdlen, ktdlst, ktdexl, ktdexp, kelem, cnames)

    Input arguments:

    ksec1 - an integer array containing CREX section 1

    ksec3 - an integer array containing number of subsets

    ktdlen - number of data descriptors in section 1

    ktdlst - an array containing data descriptors in section 1

    ktdexl - number of entries in the list of expanded data descriptors

    ktdexp - an array containing expanded data descriptors

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines10
CREX software FORTRAN routines

kelem - expected number of expanded elements

cnames - character*64 array of kelem containing CREX section 1 information

KSEC1

WMO BUFR training course Langen 17-20 April 2007


Crex software fortan routines
CREX software FORTAN routines

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines11
CREX software FORTRAN routines

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines12
CREX software FORTRAN routines

ksec3

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines13
CREX software FORTRAN routines

  • Subroutine crexsel2 (kbubset, kelem, ktdlen, ktdlst, ktdexl, ktdexp, cnames, cunits, kerr)

    Input arguments:

    ksubset - subset number

    kelem - number of expected elements

    Output arguments:

    ktdlen - number of data descriptors in section 1

    ktdlst - list of data descriptors in section 1

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines14
CREX software FORTRAN routines

ktdexl - number of expanded data descriptors

ktdexp - array containing expanded data descriptors

cnames - array containing element names

cunits - array containing element units

kerr - return error code

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines15
CREX software FORTRAN routines

  • Subroutine crexprt ( k, ksub1, ksub2, kelem, cnames, cunits, cvals, kvals, values, ksup, ksec1, kerr)

    Input arguments:

    k - switch to print with/without code tables content

    0 – no code table content, 1 – code table content

    ksub1 – starting subset

    ksub2 – ending subset

    kelem – dimension of cnames, cunits arrays

    cnames- character*64 array containing element names

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines16
CREX software FORTRAN routines

cunits – character*24 array containing element units

kvals – dimension of values array

values – real*8 array ( expanded data values)

ksup – an array containing supplementary information

ksec1 – an integer array of 40 containing section 1

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines17
CREX software FORTRAN routines

KSUP

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines18
CREX software FORTRAN routines

KSEC1

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines19
CREX software FORTRAN routines

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines20
CREX software FORTRAN routines

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines21
CREX software FORTRAN routines

  • CREX template design

    Basic idea is to know one to one correspondence between data descriptors expanded and the data values

    To achieve that use:

    subroutine CREXDES ( k, ksec1, ktdlen, crexktdlst, kdlen, kdata, kelem, ktdexl, crexktdexp, cnames, cunits, kerr)

    Input arguments:

    k - an integer, 0 no print; 1 – print

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines22
CREX software FORTRAN routines

ksec1 - an integer array containing section 1 information.

Set the following words

ksec1(2) – Bufr edition number

ksec1(3) – Originating centre

ksec1(8) – Version number of local tables used

ksec1(15) – version number of master table used

ktdlen – number of data descriptors

crexktdlst- list of data descriptors in section 1

kdlen – dimension of kdata array

kdata - an integer array containing delayed replications

kelem – expected number of expanded elements

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines23
CREX software FORTRAN routines

Output arguments:

ktdexl – number of expanded elements

crexktdexp – integer array containing list of expanded

elements

cnames – character *64 array containing element names

cunits – character*24 array containing element units

kerr – status return code

WMO BUFR training course Langen 17-20 April 2007


Crex software fortran routines24
CREX software FORTRAN routines

  • Program to use for template design

    …/crex_000320/example/crextdexp.F

  • Conversion CREX to BUFR

    …/crex_000320/example/crex2bufr.F

  • Conversion BUFR to CREX

    …/crex_000320/example/bufr2crex.F

WMO BUFR training course Langen 17-20 April 2007


Crex software and pre processing
CREX software and pre-processing

  • What happens when crex data reach DPC

  • How to organize observation

  • Pre-process observations

    - unpacking

    - re-organization of data

    - possible quality control

    - grouping of observations which belong to

    particular analysis cycle

    - creating RDB key for further more efficient processing

    - packing the data into BUFR format

    - writing data into RDB

WMO BUFR training course Langen 17-20 April 2007


Crex software and pre processing1
CREX software and pre-processing

  • Alternatively

    - unpack crex message

    - write unpacked values into DB

    - make decisions about archiving

WMO BUFR training course Langen 17-20 April 2007


ad