Data Format and Sample Code

Data Format

The datasets are organized in a daily or monthly matrix for each variable. The hourly variables are organized by day of the year (DOY) and by month of the year. These are provided in yearly tables. The data were written into binary files, proceeding southward first, and then eastward, and then through time (UTC). The details describing each data file are listed below:

 

Projection: UTM 17N (WGS84)

 

Spatial Resolution: 1km×1km

 

Temporal Resolution: Hourly (UTC)

 

Dimensions (row×col×timestep): 610×716×24 for a day, 610×716×24×Days for a month

Data Format: Real*4

 

Unit: (see the table below)

 

Missing data are represented as: -9999.

 

Filenames Convention: VariableName.bin (see the table below)

 

The “VariableName” corresponding to the abbreviation used for each variable is provided in the table below. The digital elevation model (DEM), soil hydraulic parameters, and the domain latitude and longitude coordinates at grid center are provided in Ascii files and can be accessed here .

Table - Summary of the Datasets for IPHEx-HAP(H4SE)

Data Source

Input Fields

File Name

SIZE

FORMAT

Unit

STATSGO  

Saturated hydraulic conductivity

HydroCond.txt

N×M

ASCII

m/s

Porosity

Poro.txt

N×M

ASCII

m 3 /m 3

Field capacity

FieldCapa.txt

N×M

ASCII

m 3 /m 3

Wilting point

WiltPot.txt

N×M

ASCII

m 3 /m 3

MODIS

Albedo

Albedo.bin

N×M×T

BIN

-

Emissivity

Emissivity.bin

N×M×T

BIN

-

Fractional vegetation coverage  

CV.bin

N×M×T

BIN

-  

Leaf area index

LAI.bin

N×M×T

BIN

-

NARR

Specific humidity at 10m ABG

SpecHumi_10m.bin

N×M×T

BIN

kg/kg

Air temperature at 10m ABG

AirTemp_10m.bin

N×M×T

BIN

K

Air pressure at 10m ABG

AirPressure_10m.bin

N×M×T

BIN

mb

Wind velocity at 10m ABG

WindSpeed_10m.bin

N×M×T

BIN

m/s

Incoming longwave radiation at surface

DLWR_surf.bin

N×M×T

BIN

W/m 2

Incoming shortwave radiation at surface

DSWR_surf.bin

N×M×T

BIN

W/m 2

Stage IV  and TRMM 3B42

Precipitation  

Precip_StageIV_Bi.bin Precip_StageIV_TF.bin Precip_StageIV_TF_GC.bin Precip_TRMM_TF.bin Precip_TRMM_TF_GC.bin 

N×M×T

BIN

mm/hr  

Sample Code - Fortran and Matlab

Both Fortran and Matlab versions of a sample program for reading the binary files are provided below. Note the sample code is provided to read hourly data by day, and thus the time step is 24 hours. If reading hourly data by month, the time step should be 24×Days in that month. The output data matrix has dimensions of col×row×timestep.

      a) Fortran code

      PARAMETER (Nrow = 610, Ncol = 716, Ntimestep = 24)

      REAL   Rain(Ncol, Nrow, Ntimestep)

 

      OPEN(1,File=filename, Form='UNFORMATTED', Access='DIRECT',

&      Recl=4, Status='OLD')

 

      irec = 1

      DO 10 t = 1, Ntimestep

         DO 20 i = 1, Nrow

            DO 30 j = 1, Ncol

               READ( 1, Rec=Irec ) Rain(j,i,t)

              irec = irec + 1

30           CONTINUE

20        CONTINUE

10     CONTINUE

 

      b) Matlab code

       row = 610; col = 716; tstep = 24;

       fid = fopen(filename,'rb','ieee-le');

       tmpdata = fread(fid,inf,'single');

       fclose(fid);

       rainfall = reshape(tmpdata,col,row,tstep); %[col,row,tstep]