Importing the data in the PG programme

Re-name your newly created file (either *.txt or *.csv) to *.dat. Open the file with Pgraph by right clicking on the file with the mouse and choose “Open with” and selecting PG.

The first thing PG needs to know is how time is specified in your data-file, i.e. option 1-4 described above. Enter your choice on the command line and press enter (note that PG is an old program, so you will not be able to use the mouse to move around). Answer the following questions in the same way.

You will eventually be prompted to enter the format of your data. You can either use free format, fixed format or extended format.

       Free format
When you use free format it is not necessary to know the exact position of the variables in your file, as long as they are separated by a space or a comma, and is thus an easy option. The time variable has to be given withing apostrophes (if time is specified in the data-file).

Example: ‘8502140830’ 3.0 2.8 4.5     or: ‘9805230830’ 3.0,2.8,4.5

Choose this option by typing “r” followed by enter.

       Fixed format
If you use fixed format you have to use a format statement as in FORTRAN (for details on how to write a format statement, please refer to a FORTRAN manual). Remember to give time as A10 or A12 and all other variables in F field descriptions, because all variables, except time, will be dealt with as floating point variables. Make sure you use decimal points if you have decimal values.

Example:
8502140830 3.0 2.8
8502140900 11.8 6.5
For this example you should enter (A10, 2F5.0). Note the paranthesis. This means that you use the first 10 characters for time followed by 2 variables allocating 5 characters each.

Choose this option by typing “f” followed by enter.

       Extended format
This is an attempt to make it possible to read data from text files in many formats. The format specifiers are listed in table X (note: in lower case only).


Format

Signifies

y

Year. 2-4 positions. e.g. 80,1987

yy

Year. Exactly 2 pos. e.g. 80,86

m

Month. 1-2 pos. e.g. 01,1,12

mm

Month. Exactly 2 pos. e.g. 01,12

mmm

Month. Exactly 3 letters. e.g. Jan,FEB,Oct

d

Day. 1-2 pos. e.g. 1-31.

dd

Day. Exactly 2 pos.

h

Hour. 1-2 pos.

hh

Hour. Exactly 2 pos

i

Minute. 1-2 pos

ii

Minute. Exactly 2 pos.

v

Data. Delimited of character which is not a digit or one of E, D, + , - .

x

Skip one character.

s

Skip spaces until next non space.


Rules for extended format:
- Characters in the format string which are not format specifier, must correspond exactly to characters in the data file.
- Format specifications, may be repeated e.g.: 10(x) or 4(sxxv) but parentheses cannot be nested.
- Time specifications given using one (1) format specifier letter must be limited by a non-digit e.g. y, m, h.
- Line breaks in the input file are not implemented.
- More than one format may be given, if time specification varies
between records. Ex. Month is only given if, change in month.
- The "v" data format need not be specified if data observations are separated only by spaces.
- An expanded format line can not be longer than 132 chars.

Examples of formats to read the following types of data files:
Use: sy-m-d
80-01-01 9.283099 2.377541 8.012897
80-01-01 5.088338 6.233387 8.425648
80-01-10 0.211389 6.818182 5.779749
80-01-11 7.366003 6.043690 7.828479

Use: sy-m-dsh:ii:xx      (3 data points) Seconds won't be read.
80-01-01 00:00:00 1.407930 0.340819 4.006003
80-01-06 11:10:22 5.185625 8.431309 6.039198

Use: sy-m-dxh:i:xx
sh:i:xx
80-01-05 05:13:15 5.385658 8.322591 2.693153
                06:09:02 9.312413 9.208962 9.516258
80-01-12 02:21:50 4.927451 6.841755 8.943993
80-01-16 20:15:44 5.024314 4.072683 8.386088

Use: s3(x)ddmm8(x)yy16(x)hhiix2(sxxv) or sxxxddmmxxxxxxxxyyxxxxxxxxxxxxxxxxhhiix2(sxxv)
01+0102.  02+0087.  03+0183.  04+0800.  05+4.845  06-0.589

Use: sdd-mmm-yyyy
09-May-1987 12.3 13.4...

      Campbell data logger
Three types of output formats from the Campbell data logger is supported: comma delimited ASCII, printable ASCII and binary. Normally three different time variables (year, day number and time of day) are needed from the Campbell data file for transfer to the time variable in PG. If the year or the day number is missing in the file, you must specify a common value to be used for all records in the file.

Before you exit the PG program you will be able to enter the names of your variables (or you type G5 at the command prompt, which will take you to the list where variable names can be changed). Make sure you name your input variables according to the standards given in the tables over input files (the “ID”) that you find in this manual (see tables “Crop data” and “Meteorological data”). If you fail to do so the CoupModel will not be able to recognize your variables.