Ming Hu Prepbufr converter for GSI GSI tutorial, 29 June 2010, Boulder.

Slides:



Advertisements
Similar presentations
Interfacing BUFR to NMC Systems Jeff Ator NOAA National Weather Service United States of America WORLD METEOROLOGICAL ORGANIZATION RA.
Advertisements

Complex Integrity Constraints in SQL. Constraints over a Single Table Table Constraint: Create TABLE Sailors (sid INTEGER, sname CHAR(10), rating INTEGER,
FM 94 BUFR and FM 95 CREX Table Driven Code Forms (or “Self-descriptive” Code Forms). The term "self-descriptive" means that the form and content of the.
Contracts, Purpose Statements, Examples and Tests CS 5010 Program Design Paradigms “Bootcamp” Lesson 1.6 TexPoint fonts used in EMF. Read the TexPoint.
Groom-gliders data-management workshop Brest, December 2012 Groom gliders data management n In 2012 : vertical profiles from 26 platforms.
1 © Crown copyright 2003 GRAS SAF User Workshop Helsingør, Denmark, June 2003 WMO BUFR Format for NRT Dissemination of RO Data Dave Offiler.
Atmospheric data for Arctic modeling John Walsh International Arctic Research Center University of Alaska, Fairbanks Arctic System Modeling Workshop, Montreal,
BACS 287 Programming Logic 3. BACS 287 Iteration Constructs Iteration constructs are used when you want to execute a segment of code several times. In.
1 Type Type system for a programming language = –set of types AND – rules that specify how a typed program is allowed to behave Why? –to generate better.
Copyright © Cengage Learning. All rights reserved.
Functions. Program complexity the more complicated our programs get, the more difficult they are to develop and debug. It is easier to write short algorithms.
Android Apps: Look and Feel Module 6, Intro to I.T., Fall 2011 Sam Scott.
Beginning Fortran Fortran (77) Basics 22 October 2009 *Black text on white background provided for easy printing.
Donald Stark National Center for Atmospheric Research (NCAR) The Developmental Testbed Center (DTC) Wednesday 29 June, 2011 GSI Fundamentals (1): Setup.
Working with text ASCII and UNICODE.   
Kathryn Newman * and Ming Hu ** Developmental Testbed Center * National Center for Atmospheric Research ** NOAA/ESRL/Global System Division EnKF Fundamentals.
Assimilation of GOES Hourly and Meteosat winds in the NCEP Global Forecast System (GFS) Assimilation of GOES Hourly and Meteosat winds in the NCEP Global.
An Overview of Meteorological Observations in BUFR Format (including “PrepBUFR” files) Stacie Bender NWS/NCEP/EMC GSI Tutorial June.
PAX VOBIS PAX VOBIS PAX VOBIS PAX VOBIS PAX VOBIS PAX VOBIS PAX VOBIS PAX VOBIS PAX VOBIS PAX VOBIS PAX VOBIS PAX VOBIS PAX VOBIS PAX VOBISPAX VOBISPAX.
Training on Meteorological Telecommunications Alanya, Turkey, September 2010 General Philosophy of Table Driven Code Forms Simon Elliott, EUMETSAT.
Chapter 3 Section 1 Number Representation Modern cryptographic methods, unlike the classical methods we just learned, are computer based. Representation.
Using Inverse Matrices in Real Life
GSI EXPERIMENTS FOR RUA REFLECTIVITY/CLOUD AND CONVENTIONAL OBSERVATIONS Ming Hu, Stan Benjamin, Steve Weygandt, David Dowell, Terra Ladwig, and Curtis.
Encryption, continued Public Key encryption and Digital Signatures.
Kathryn Newman Ming Hu, and Chunhua Zhou EnKF Fundamentals (2b): Applications Developmental Testbed Center (DTC) 2015 EnKF Community Tutorial August 13-14,
Ming Hu Developmental Testbed Center Introduction to Practice Session 2011 GSI Community Tutorial June 29-July 1, 2011, Boulder, CO.
Ruifang Li*, Ming Hu**, and Yongrun Guo* *NCAR/MMM **Developmental Testbed Center Community Tools (1) - PrepBUFR/BUFR: Basic tools, NCEP data tank, and.
Computer Science: A Structured Programming Approach Using C1 2-7 Input/Output Although our programs have implicitly shown how to print messages, we have.
Slide 1 WMO BUFR training course Langen April 2007 Slide 1 CREX software Milan Dragosavac.
Outline Announcements –HW II due Friday –HW III option Interpolation Colormaps.
1 EMC’s Current and future GSI development John C. Derber Environmental Modeling Center NCEP/NWS/NOAA With input from: Many others.
Python Mini-Course University of Oklahoma Department of Psychology Lesson 18 Using text files to share data with other programs 5/07/09 Python Mini-Course:
Beginning Fortran Fortran (77) Advanced 29 October 2009 *Black text on white background provided for easy printing.
Authentication protocol providing user anonymity and untraceability in wireless mobile communication systems Computer Networks Volume: 44, Issue: 2, February.
Guide to Programming with Python Chapter Seven Files and Exceptions: The Trivia Challenge Game.
Unit 2 Test: Tues 11/3. ASCII / Unicode –Each letter, symbol, etc has a # value –See ascii table (in folder) –To convert a char into its ascii value,
Exercise 1 Introduction to C# CIS Code the C# program to prompt the user to key in 12 integer values from the keyboard. If a value containing.
Fall 2008Programming Development Techniques 1 Topic 8 Sequences as Conventional Interfaces Section October 2008.
Data in Haskell. What is data? Measurements of some kind stored in a computer. – Examples Simple: numbers, text, truth values … Structured: sequences,
WORLD METEOROLOGICAL ORGANIZATION RA-VI Regional Training on BUFR and Migration to Table Driven Code Forms Langen, Germany, April, 2007 General.
Notes Over 4.4 Finding the Inverse of 2 x 2 Matrix.
ASCII, Binary, and Data Storage A MATLAB Tutorial.
Towards Assimilation of GOES Hourly winds in the NCEP Global Forecast System (GFS) Xiujuan Su, Jaime Daniels, John Derber, Yangrong Lin, Andy Bailey, Wayne.
WMO GRIB Edition 3 Enrico Fucile Inter-Program Expert Team on Data Representation Maintenance and Monitoring IPET-DRMM Geneva, 30 May – 3 June 2016.
LINEAR ALGEBRA APPLICATION TO CODING THEORY. Introduction Transmitted messages, like data from a satellite, are always subject to noise. Therefore, to.
Fortran Tutorial Fortran spaces for code qqqqqqCODE
From the ASCII table… Symbol Decimal Binary A B 66
Ting-Chi Wu CIRA Data Assimilation Group, CSU 5/9/2016
Binary Universal Form Representation (BUFR) Paul Hamer November, 2009
Value-Returning Functions
Status of Generation of Simulated Observations for the Joint OSSE
Functions Defined on General Sets
Lessons from incompatible units of time-integrated GRIB parameters
WMO, World Weather Watch, Data Processing and Forecasting Systems)
BCD = Binary Coded Decimal
Student: Ying Hong Course: Database Security Instructor: Dr. Yang
بسمه تعالی کارگاه ارزشیابی پیشرفت تحصیلی
Simple Encryption- Lesson 5
Digital Encodings.
Contracts, Purpose Statements, Examples and Tests
Copyright © Cengage Learning. All rights reserved.
Unit 1 Day 1: The Real Number Line
functions: argument, return value
Group: Data analysis.
Cat.
2015 State Convention Focus Tables.
Electrical Communications Systems ECE
Presentation transcript:

Ming Hu Prepbufr converter for GSI GSI tutorial, 29 June 2010, Boulder

What is this lesson for? GSI is using BUFR/PrepBUFR Conventional data : PrepBUFR Satellite: BUFR Radar: BUFR If you have data not in BUFR, you have to convertor them into PrepBUFR/BUFR. In this talk, we will learn: How to encode and decode from a simple example How to append a data to existing prepbufr file What GSI prepbufr needs

A simplest case: One temperature observation Encode (write observations into prepbufr file)

program encode_sample ! write one observation into prepbufr file implicit none character(80):: hdstr='XOB YOB ELV DHR' character(80):: obstr='TOB',qcstr='TQM',oestr='TOE' real(8) :: hdr(4),obs(1,1),oer(1,1),qcf(1,1) INTEGER, PARAMETER :: MXBF = ,ibfmsg = MXBF/4 character(8) subset integer :: unit_out=10,idate,iret hdr(1)=175.0;hdr(2)=30.0;hdr(3)=500.0;hdr(4)=10.0 obs(1,1)=287.0;oer(1,1)=1.0;qcf(1,1)=1.0 idate= subset='ADPUPA' open(22,file='prepobs_prep.bufrtable',action='read') open(unit_out,file='singleT.bufr',action='write',form='unformatted') call datelen(10) call openbf(unit_out,'OUT',22) call openmb(unit_out,subset,idate) call ufbint(unit_out,hdr,4,1,iret,hdstr) call ufbint(unit_out,obs,1,1,iret,obstr) call ufbint(unit_out,oer,1,1,iret,oestr) call ufbint(unit_out,qcf,1,1,iret,qcstr) call writsb(unit_out,ibfmsg,iret) call closmg(unit_out) call closbf(unit_out) end program "A BUFR file contains one or more BUFR messages, each containing one or more BUFR data subsets, each containing one or more BUFR BUFR tables file BUFR file

Read the data we just encoded Decode (read observation from prepbufr file)

program encode_sample ! write one observation into prepbufr file implicit none character(80):: hdstr='XOB YOB ELV DHR' character(80):: obstr='TOB',qcstr='TQM',oestr='TOE' real(8) :: hdr(4),obs(1,1),oer(1,1),qcf(1,1) INTEGER, PARAMETER :: MXBF = ,ibfmsg = MXBF/4 character(8) subset integer :: unit_out=10,idate,iret hdr(1)=175.0;hdr(2)=30.0;hdr(3)=500.0;hdr(4)=10.0 obs(1,1)=287.0;oer(1,1)=1.0;qcf(1,1)=1.0 idate= subset='ADPUPA' open(22,file='prepobs_prep.bufrtable',action='read') open(unit_out,file='singleT.bufr',action='write',form='unformatted') call datelen(10) call openbf(unit_out,'OUT',22) call openmb(unit_out,subset,idate) call ufbint(unit_out,hdr,4,1,iret,hdstr) call ufbint(unit_out,obs,1,1,iret,obstr) call ufbint(unit_out,oer,1,1,iret,oestr) call ufbint(unit_out,qcf,1,1,iret,qcstr) call writsb(unit_out,ibfmsg,iret) call closmg(unit_out) call closbf(unit_out) end program program decode_sample ! read observation from prepbufr implicit none character(80):: hdstr='XOB YOB ELV DHR' character(80):: obstr='TOB',qcstr='TQM',oestr='TOE' real(8) :: hdr(4),obs(1,1),oer(1,1),qcf(1,1) INTEGER, PARAMETER :: MXBF = ,ibfmsg = MXBF/4 INTEGER :: ireadmg,ireadsb character(8) subset integer :: unit_in=10,idate,iret,nmsg,ntb open(unit_in,file='singleT.bufr',form='unformatted') call openbf(unit_in,'IN',unit_in) call datelen(10) nmsg=0 msg_report: do while (ireadmg(unit_in,subset,idate) == 0) nmsg=nmsg+1 ntb = 0 sb_report: do while (ireadsb(unit_in) == 0) ntb = ntb+1 call ufbint(unit_in,hdr,4,1,iret,hdstr) call ufbint(unit_in,obs,1,1,iret,obstr) call ufbint(unit_in,oer,1,1,iret,oestr) call ufbint(unit_in,qcf,1,1,iret,qcstr) write(*,'(I10,8f8.1)') idate,hdr,obs(1,1),oer(1,1),qcf(1,1) enddo sb_report write(*,*) 'subset num=',ntb enddo msg_report write(*,*) 'message num=',nmsg call closbf(unit_in) end program Encode Decode

Append one more temperature observation to the prepbufr file we just created Append data to existing prepbufr

program encode_sample ! write one observation into prepbufr file implicit none character(80):: hdstr='XOB YOB ELV DHR' character(80):: obstr='TOB',qcstr='TQM',oestr='TOE' real(8) :: hdr(4),obs(1,1),oer(1,1),qcf(1,1) INTEGER, PARAMETER :: MXBF = ,ibfmsg = MXBF/4 character(8) subset integer :: unit_out=10,idate,iret hdr(1)=175.0;hdr(2)=30.0;hdr(3)=500.0;hdr(4)=10.0 obs(1,1)=287.0;oer(1,1)=1.0;qcf(1,1)=1.0 idate= subset='ADPUPA' open(22,file='prepobs_prep.bufrtable',action='read') open(unit_out,file='singleT.bufr',action='write',form='unformatted') call datelen(10) call openbf(unit_out,'OUT',22) call openmb(unit_out,subset,idate) call ufbint(unit_out,hdr,4,1,iret,hdstr) call ufbint(unit_out,obs,1,1,iret,obstr) call ufbint(unit_out,oer,1,1,iret,oestr) call ufbint(unit_out,qcf,1,1,iret,qcstr) call writsb(unit_out,ibfmsg,iret) call closmg(unit_out) call closbf(unit_out) end program program append_sample ! write one observation into prepbufr file implicit none character(80):: hdstr='XOB YOB ELV DHR' character(80):: obstr='TOB',qcstr='TQM',oestr='TOE' real(8) :: hdr(4),obs(1,1),oer(1,1),qcf(1,1) INTEGER, PARAMETER :: MXBF = ,ibfmsg = MXBF/4 character(8) subset integer :: unit_out=10,idate,iret hdr(1)=275.0;hdr(2)=50.0;hdr(3)=700.0;hdr(4)=1.0 obs(1,1)=297.0;oer(1,1)=2.0;qcf(1,1)=2.0 idate= subset='ADPUPA' open(22,file='prepobs_prep.bufrtable',action='read') open(unit_out,file='singleT.bufr',status='old',form='unformatted') call datelen(10) call openbf(unit_out,'APN',22) call openmb(unit_out,subset,idate) call ufbint(unit_out,hdr,4,1,iret,hdstr) call ufbint(unit_out,obs,1,1,iret,obstr) call ufbint(unit_out,oer,1,1,iret,oestr) call ufbint(unit_out,qcf,1,1,iret,qcstr) call writsb(unit_out,ibfmsg,iret) call closmg(unit_out) call closbf(unit_out) end program Encode Append

Test samples:./encode_sample.exe This should generate a bufr file singleT.bufr../decode_sample.exe This reads one observation from singleT.bufr, and write out observation: subset num= 1 message num= 1./append_sample.exe Now, append a new observation to singleT.bufr../decode_sample.exe Read singleT.bufr and show two observations in it: subset num= subset num= 1 message num= 2

Read_prepbufr.f90 reads prepbufr file What GSI needs

MNEMONIC in read_prepbufr.f90 data hdstr /'SID XOB YOB DHR TYP ELV SAID '/ data obstr /'POB QOB TOB ZOB UOB VOB PWO CAT PRSS' / data qcstr /'PQM QQM TQM ZQM WQM NUL PWQ '/ data oestr /'POE QOE TOE NUL WOE NUL PWE '/ data drift /'XDR YDR HRDR '/ data sststr /'MSST DBSS SST1 SSTQM SSTOE '/ data satqcstr /'RFFL QIFY QIFN EEQF'/ data prvstr /'PRVSTG'/ data sprvstr /'SPRVSTG'/ data levstr /'POB'/

MNEMONIC list

MNEMONIC list, continue

Notes prepbufr Each observation value should have the same unit as GSI expected Each observation error should have the same mean Pay attention to quality mark

program encode_prepbufr ! write one observation into prepbufr file implicit none character(80):: hdstr='SID XOB YOB DHR TYP ELV SAID T29' character(80):: obstr='POB QOB TOB ZOB UOB VOB PWO CAT PRSS' character(80):: qcstr='PQM QQM TQM ZQM WQM NUL PWQ ' character(80):: oestr='POE QOE TOE NUL WOE NUL PWE ' real(8) :: hdr(8),obs(35,1),qcf(35,1),oer(35,1) REAL,PARAMETER :: MXBF = INTEGER :: ibfmsg = MXBF/4 character(8) :: subset,c_sid integer :: unit_out=10,idate,iret real(8) :: rstation_id equivalence(rstation_id,c_sid) ! READ IN DATA and QUALITY into hdr, obs, oer, qcf ! write observation into prepbufr file open(22,file='prepobs_prep.bufrtable',action='read') open(unit_out,file='prepbufr.test',action='write',form='unformatted') call datelen(10) call openbf(unit_out,'OUT',22) call openmb(unit_out,subset,idate) call ufbint(unit_out,hdr,8,1,iret,hdstr) call ufbint(unit_out,obs,9,1,iret,obstr) call ufbint(unit_out,oer,7,1,iret,oestr) call ufbint(unit_out,qcf,7,1,iret,qcstr) call writsb(unit_out,ibfmsg,iret) call closmg(unit_out) call closbf(unit_out) end program

Prepbufr case (two observations) HU obs= oer= qcf= subset num= HU obs= oer= qcf= subset num= 1 message num= 2./encode_prepbufr.exe /append_prepbufr.exe /decode_prepbufr.exe character(80):: hdstr='SID XOB YOB DHR TYP ELV SAID T29' character(80):: obstr='POB QOB TOB ZOB UOB VOB PWO CAT PRSS' character(80):: qcstr='PQM QQM TQM ZQM WQM NUL PWQ ' character(80):: oestr='POE QOE TOE NUL WOE NUL PWE '

GSI analysis with generated prepbufr One observation Two observations

Summary

Based on example, we can: Write data into a new prepbufr file Append data into a existing prepbufr file Read data from prepbufr file But data are complex: Each kind of data needs a code to write Didn’t touch quality control …