1 / 58

CREX software

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

Download Presentation

CREX software

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CREX software Milan Dragosavac WMO BUFR training course Langen 17-20 April 2007

  2. 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

  3. 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

  4. 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

  5. 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

  6. 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

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

  8. 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

  9. 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

  10. 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

  11. 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

  12. 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

  13. 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

  14. 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

  15. 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

  16. 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

  17. 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

  18. 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

  19. 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

  20. 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

  21. 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

  22. 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

  23. 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

  24. 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

  25. KSUP array of 9 words WMO BUFR training course Langen 17-20 April 2007

  26. KSEC0 array WMO BUFR training course Langen 17-20 April 2007

  27. KSEC1 array WMO BUFR training course Langen 17-20 April 2007

  28. KSEC1 array WMO BUFR training course Langen 17-20 April 2007

  29. KSEC3 array WMO BUFR training course Langen 17-20 April 2007

  30. 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

  31. 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

  32. 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

  33. 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

  34. 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

  35. KSEC0 array WMO BUFR training course Langen 17-20 April 2007

  36. KSEC1 array WMO BUFR training course Langen 17-20 April 2007

  37. KSEC1 array WMO BUFR training course Langen 17-20 April 2007

  38. KSEC3 array WMO BUFR training course Langen 17-20 April 2007

  39. 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

  40. 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

  41. 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

  42. CREX software FORTAN routines WMO BUFR training course Langen 17-20 April 2007

  43. CREX software FORTRAN routines WMO BUFR training course Langen 17-20 April 2007

  44. CREX software FORTRAN routines ksec3 WMO BUFR training course Langen 17-20 April 2007

  45. 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

  46. 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

  47. 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

  48. 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

  49. CREX software FORTRAN routines KSUP WMO BUFR training course Langen 17-20 April 2007

  50. CREX software FORTRAN routines KSEC1 WMO BUFR training course Langen 17-20 April 2007

More Related