| 28 | * LANDMASK |
| 29 | * LU_INDEX |
| 30 | * QFX |
| 31 | * SNOWH |
| 32 | * SST |
| 33 | * T2 |
| 34 | * TMN |
| 35 | * VEGFRA |
| 36 | |
| 37 | == Coordinates == |
| 38 | The 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 | |
| 44 | As !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. |
| 45 | In this script, the longitude values are corrected by the cosine of the latitude values: |
| 46 | {{{ |
| 47 | #!python |
| 48 | xlat = np.cos(xlat/180.0*np.pi) |
| 49 | print "generating longitude" |
| 50 | dsetIn = fIn['/XLONG'] |
| 51 | dsetOut = fOut.create_dataset("/XLONG", (num_x, num_y, num_z), dtype=np.float32) |
| 52 | xlon = dsetIn[0, : , :] |
| 53 | mi = np.min(xlon) |
| 54 | ma = np.max(xlon) |
| 55 | xlon = (xlon-(ma+mi)/2.0) * xlat |
| 56 | }}} |
| 57 | |
| 58 | Also 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 |
| 61 | dsetIn1 = fIn['/PH'] |
| 62 | dsetIn2 = fIn['/PHB'] |
| 63 | dsetOut = fOut.create_dataset("/Z", (num_x, num_y, num_z), dtype=np.float32) |
| 64 | ph1 = dsetIn1[0, 0, : , :] |
| 65 | phb1 = dsetIn2[0, 0, : , :] |
| 66 | |
| 67 | for 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 == |
| 79 | The time value of the 12 timesteps is store in the variable XTIME, which is just a one-dimensional array of size 12. |