Page 1 of 1

convert CSV file to little_r format

PostPosted: Wed Mar 20, 2013 8:48 pm
by lyndonmark

How can I convert a csv file to little_r format? I would like to assimilate observation data using WRF. I have to do observation nudging in wrf and use a "little_r" format readable by wrf?
Any suggestion on how should i do this?


Re: convert CSV file to little_r format

PostPosted: Tue Mar 26, 2013 3:03 am
by lyndonmark
Hi all,
I would like to convert a CSV file containing the following data to Little_r_format..
These are the column names..In total there are 20 columns
and there are 20 089 data

Stn. No.
Year Month
Stn. Press
Dry Bulb
Wet Bulb
Max. Temp.
Min. Temp
Prevailing WD
Dir. Of MaxWD
Time of MaxWD
Minutes of Sunshine
Mean Cloudiness

Can anyone help me?after i convert this to little_r format I can now input this in wrf

Re: convert CSV file to little_r format

PostPosted: Mon Nov 07, 2016 5:41 am
by jjasonlam
I know the post seems to be kinda old however I am having the same question as well.
Have you figure out the solution or can anybody help?

Re: convert CSV file to little_r format

PostPosted: Thu Oct 19, 2017 5:13 pm
by carsonbn
In case anyone else runs into this question... It's my understanding that converting CSV to Little_R Format is relatively straightforward assuming you have slightly more than a beginner background in programming (like me).

Each observation report is considered a "Report" when you are writing a Little R file. Each Report will have 3 records: a header record, a data record, and an ending record. Finally, there are 3 tail integers for each Report. You must have all of these parts for a complete Report even if the values aren't used within OBSPROC.

In the Header Record, you have 46 different columns of data from latitude, longitude, station ID, etc to the precipitable water data and the PW quality control flag.

In the Data Record, you have 20 columns of data including pressure, height, temperature, dew point, wind speed, wind direction, U, V, relative humidity, and thickness plus the corresponding QC flags for each variable.

The Ending Record is a signal to OBSPROC that the observation report is ending. The only important field is Field Number 1, which must contain the "end record" flag value of -777777.00000. The remaining 19 fields can contain any value because the values are unused by the OBSPROC, but needs to have the column structure.

Finally, the Tail Integers are considered "legacy fields", and are also unused by OBSPROC just like most of the Ending Record. However, just like the Ending Record, the columns must still exist even if the values are unused to OBSPROC can properly read the observation report.

This presentation from the July 2017 WRFDA Tutorial has more information on many of the Little R file formatting details: ... DA_obs.pdf.

Best of luck to you!