Changes between Version 1 and Version 2 of Examples/WRF


Ignore:
Timestamp:
07/20/18 11:24:18 (6 years ago)
Author:
Herwig Zilken
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Examples/WRF

    v1 v2  
    66== Variables of Interest ==
    77=== 3D Scalar Variables ===
    8 The 3D variables are located on a grid of size 49x1552x1600. As for each variable all 12 timesteps are stored in one hdf5 array, the size of this array is 12x49x1552x1600, obviously.
     8The 3D variables are located on a grid of size 49x1552x1600. As for each variable all 12 timesteps are stored in one hdf5 array, the size of this array is 12x49x1552x1600, obviously.\\
    99Here is a list of interesting scalar variables:
    1010
     
    1515
    1616=== 3D Vector Variables ===
    17 The wind components are stored on a staggered grid. Please note, that therefore the array size of those components vary along one axis
     17The wind components are stored on a staggered grid. Please note, that therefore the array size of those components vary along one axis each.\\
    1818Vector Components:
    1919* U: x-wind component (12 x 49 x 1552 x 1601)
     
    2222
    2323=== 2D Scalar Variables ===
    24 There are also a couple of surface related 2D variables includes in the data, located on a grid of size 12x1552x1600.
     24There are also a couple of surface related 2D variables includes in the data, located on a grid of size 12x1552x1600.\\
    2525Some examples:
    2626* HGT: Terrain Height
    2727* LH: Latent Heat Flux at the Surface
     28* LANDMASK
     29* LU_INDEX
     30* QFX
     31* SNOWH
     32* SST
     33* T2
     34* TMN
     35* VEGFRA
     36
     37== Coordinates ==
     38The coordinates of the 3D grid are given by lon, lat and two pressure values:
     39* XLON: 12 x 1552 x 1600
     40* XLAT: 12 x 1552 x 1600
     41* PH: 12 x 50 x 1552 x 1600
     42* PHB: 12 x 50 x 1552 x 1600
     43
     44As !ParaView can not load the coordinates of the grid from the original data, a new data file coordinates.h5 is generated by the Python script generate_coordinates.py.
     45In this script, the longitude values are corrected by the cosine of the latitude values:
     46{{{
     47#!python
     48xlat = np.cos(xlat/180.0*np.pi)
     49print "generating longitude"
     50dsetIn = fIn['/XLONG']
     51dsetOut = fOut.create_dataset("/XLONG", (num_x, num_y, num_z), dtype=np.float32)
     52xlon = dsetIn[0, : , :]
     53mi = np.min(xlon)
     54ma = np.max(xlon)
     55xlon = (xlon-(ma+mi)/2.0) * xlat
     56}}}
     57
     58Also the height value is calculated as PH+PHB. As these pressure values are located on a staggered grid, two grid levels must be averaged:
     59{{{
     60#!python
     61dsetIn1 = fIn['/PH']
     62dsetIn2 = fIn['/PHB']
     63dsetOut = fOut.create_dataset("/Z", (num_x, num_y, num_z), dtype=np.float32)
     64ph1 = dsetIn1[0, 0, : , :]
     65phb1 = dsetIn2[0, 0, : , :]
     66
     67for z in range(num_x):
     68  sys.stdout.write("%d " % (z))
     69  ph2 = dsetIn1[0, z+1, : , :]
     70  phb2 = dsetIn2[0, z+1, : , :]
     71  result = (ph1+phb1+ph2+phb2)*0.00025/(9.81*2)
     72  dsetOut[z, : , :] = result
     73  print "min=%f, max=%f" % (np.min(result), np.max(result))
     74  ph1 = ph2
     75  phb1 = phb2
     76}}}
     77
     78== Time Information ==
     79The time value of the 12 timesteps is store in the variable XTIME, which is just a one-dimensional array of size 12.