ECMWF Data Server
This dataset consists of 4 6-hour fields per day available from 1957-09-01 to 2002-08-31. The fields are global at 2.5 degree resolution, i.e. 144 longitude points and 73 latitude points, and there are 23 variably-spaced vertical levels (1000, 925, 850, 775, 700, 600, 500, 400, 300, 250, 200, 150, 100, 70, 50, 30, 20, 10, 7, 5, 3, 2, 1). The NetCDF units attribute for the time variable is hours since 1900-01-01 00:00:0.0. Scale factors and offsets are also used for the variable fields. The CF-1.0 NetCDF metadata conventions are used.
The default level type upon reaching the page (as seen in the left-hand column) is "surface". You can also choose "pressure levels" to obtain non-surface fields. The default Era40 temporal field type is "daily", but you can also choose from "monthly means", "monthly means of daily means", "invariant fields" and "monthly invariant fields". Click on any of them to see what variable fields are available for that category.
First, you agree to the conditions by entering your email, name and affiliation. After this, you will see three clickable buttons appear at the bottom of the page: "Retrieve GRIB", "Retrieve NetCDF", and "Plot data".
To choose a dataset to download:
The CF-1.0 compliant NetCDF header for era-u-v-10m-1978.nc is:
netcdf era-u-v-10m-1978 {
dimensions:
longitude = 144 ;
latitude = 73 ;
time = UNLIMITED ; // (1460 currently)
variables:
float longitude(longitude) ;
longitude:units = "degrees_east" ;
longitude:long_name = "longitude" ;
float latitude(latitude) ;
latitude:units = "degrees_north" ;
latitude:long_name = "latitude" ;
int time(time) ;
time:units = "hours since 1900-01-01 00:00:0.0" ;
time:long_name = "time" ;
short p10u(time, latitude, longitude) ;
p10u:scale_factor = 0.00085084141301256 ;
p10u:add_offset = 0.379360035051831 ;
p10u:_FillValue = -32767s ;
p10u:missing_value = -32767s ;
p10u:units = "m s**-1" ;
p10u:long_name = "10 metre U wind component" ;
short p10v(time, latitude, longitude) ;
p10v:scale_factor = 0.000798961017941378 ;
p10v:add_offset = -0.329854747150754 ;
p10v:_FillValue = -32767s ;
p10v:missing_value = -32767s ;
p10v:units = "m s**-1" ;
p10v:long_name = "10 metre V wind component" ;
// global attributes:
:Conventions = "CF-1.0" ;
:history = "2008-10-29 20:31:16 GMT by mars2netcdf-0.92" ;
data:
longitude = 0, 2.5, 5, 7.5, 10, 12.5, 15, 17.5, 20, 22.5, 25, 27.5, 30,
...
Description
ERA-Interim products are also publicly available on the ECMWF Data Server, at a 1.5° resolution, including several products that were not available for ERA-40.
The quantities needed for a mixed-layer ROMS simulation are:
These can be snagged from the ERA Interim page as:
Table 6 - ROMS Variables Required for Active Ocean-Atmosphere Boundary Layer and Their ECMWF-Interim Equivalents
| Field | ROMS var. | ROMS units | Long Name | ECMWF | Units | Range | Scale | Offset |
| surface u-wind component | Uwind | m/s | 10 metre U wind component | u10 | m s**-1 | |||
| surface v-wind component | Vwind | m/s | 10 metre V wind component | v10 | m s**-1 | |||
| surface air temperature | Tair | C | 2 metre temperature | t2m | K | 20-30 | 0.001634 | 266.0987 |
| surface air pressure | Pair | mb | Mean sea level pressure | msl | Pa | ~1000 | 0.1800523 | 99118.6 |
| surface air relative humidity | Qair | % | 2 metre temperature | t2m | K | 0-100 | 0.001634 | 266.0987 |
| 2 metre dewpoint temperature | d2m | K | 0.0016678 | 247.4571 | ||||
| cloud fraction | cloud | 0 to 1 | Total cloud cover | tcc | 0 to 1 | 0-1 | 1.525972e-05 | 0.4999847 |
| rain fall rate | rain | kg/m^2/s | Total precipitation | tp | m | < .003 | 4.01797e-06 | 0.131649 |
| Instantaneous moisture flux | ie | W m**-2 s | ||||||
| shortwave radiation flux | swrad | W/m^2 | Surface solar radiation | ssr | W m**-2 s | 10-500 | 501.8 | 16442634.2 |
Conversions:
1. The "Total precipitation" in "m" needs to be converted into a "rain fall rate" in kg/m^2/s.
rainfall rate (k/m^2/s) = total precipitation (m) * water density (1000 kg/m^3) / time (3*3600 s)
-----
2. The "Surface solar radiation" in "W m**-2 s" needs to be converted into a "shortwave radiation flux" in "W m**-2".
shortwave radiation flux (W/m^2) = surface solar radiation (W/m^2/s) * 3600*3 s
-----
1 mb = 100 Pa
1 deg. C = 274.15 deg. K
Needed Conversions
cloud = TCDC/100.
Tair(C) = TMP(K) - 273.15
Pair(mb) = PRES(Pa)/100.
Qair = (112 - 0.1*t2m + d2m)/(112 + 0.9*t2m)
A formula for calculating the relative humidity from the temperature and the dewpoint temperature can be found at:
http://www.ajdesigner.com/phphumidity/dewpoint_equation_relative_humidity.php
The NetCDF header file for int-u-v-2007-01.nc is:
netcdf int-u-v-2007-01 {
dimensions:
longitude = 240 ;
latitude = 121 ;
time = UNLIMITED ; // (249 currently)
variables:
float longitude(longitude) ;
longitude:units = "degrees_east" ;
longitude:long_name = "longitude" ;
float latitude(latitude) ;
latitude:units = "degrees_north" ;
latitude:long_name = "latitude" ;
int time(time) ;
time:units = "hours since 1900-01-01 00:00:0.0" ;
time:long_name = "time" ;
short 10u(time, latitude, longitude) ;
10u:scale_factor = 0.00107127121354477 ;
10u:add_offset = -5.18156748703386 ;
10u:_FillValue = -32767s ;
10u:missing_value = -32767s ;
10u:units = "m s**-1" ;
10u:long_name = "10 metre U wind component" ;
short 10v(time, latitude, longitude) ;
10v:scale_factor = 0.0010895635053831 ;
10v:add_offset = 2.53144217477587 ;
10v:_FillValue = -32767s ;
10v:missing_value = -32767s ;
10v:units = "m s**-1" ;
10v:long_name = "10 metre V wind component" ;
// global attributes:
:Conventions = "CF-1.0" ;
:history = "2009-04-02 19:17:11 GMT by mars2netcdf-0.92" ;
data:
...
Python Script
import scipy,numpy,netCDF3
import time,datetime
from mpl_toolkits.basemap import Basemap
# Set the limits of the desired lon/lat box.
lat_min = -10.0
lat_max = 33.0
lon_min = 40.0
lon_max = 85.0
# Open the desired file.
g = netCDF3.Dataset('int-u-v-2007-01.nc','r+')
ntimes = len(g.dimensions['time'])
times = g.variables['time']
# Extract the lon and lat fields.
lon = g.variables['longitude']
lat = g.variables['latitude']
print lon[:]
print lat[:]
# Find the available lon/lat box that will minimally
# enclose the requested lon/lat box.
for i in lat:
if i < lat_min:
lat_min = i
break
latm = -1*lat[:]
for i in lat:
if i >= lat_max:
lat_max = i
break
ip = 0.0
for i in lon:
if i >= lon_min:
lon_min = ip
break
else:
ip = i
for i in lon:
if i >= lon_max:
lon_max = i
break
# Find the x and y dimensions of the reduced field.
minlat = lat[:] >= lat_min
maxlat = lat[:] <= lat_max
latrange = minlat & maxlat
latnew = lat[latrange]
nlat2 = latnew.size
minlon = lon[:] >= lon_min
maxlon = lon[:] <= lon_max
lonrange = minlon & maxlon
lonnew = lon[lonrange]
nlon2 = lonnew.size
# Create 2D lon and lat arrays.
import numpy as np
lon2d = np.vstack((121*[lon[:]]))
lat2d = np.vstack((240*[lat[:]]))
lat2d = np.swapaxes(lat2d,0,1)
lonmin = lon2d >= lon_min
lonmax = lon2d <= lon_max
latmin = lat2d >= lat_min
latmax = lat2d <= lat_max
shrink = lonmin & lonmax & latmin & latmax
latshrink = lat2d[shrink]
latshrink2d = np.reshape(latshrink,(nlat2,nlon2))
lonshrink = lon2d[shrink]
lonshrink2d = np.reshape(lonshrink,(nlat2,nlon2))
# Extract velocity fields.
u = g.variables['10u']
v = g.variables['10v']
# Extract scale factors and offsets.
u_scale = u.scale_factor
u_offset = u.add_offset
v_scale = v.scale_factor
v_offset = v.add_offset
# Apply scale factors and offsets.
up = u_scale*u[:] + u_offset
vp = v_scale*v[:] * v_offsetl
#----------------------------------------------------------------------------
# Extract the Oman grid info.
grd = netCDF3.Dataset('newoman_4_grd.nc','r+')
x_rho = grd.variables['x_rho']
y_rho = grd.variables['y_rho']
eta_rho = len([grd.dimensions['eta_rho'])
xi_rho = len([grd.dimensions['xi_rho'])
x_rho_flat = x_rho[:,:].ravel()
y_rho_flat = y_rho[:,:].ravel()
#-----------------------------------------------------------------------------
# Convert the lon/lat values to x/y values for interpolation via csabathy.
while nsl <= ntimes - 1:
utsl = up[0,:,:]
ushrink = utsl[shrink]
from mpl_toolkits.basemap import Basemap
proj = Basemap(projection='lcc',resolution='i',llcrnrlon=30.0,llcrnrlat= -15.,
urcrnrlon=90.0,urcrnrlat=40.0,lat_0=20.0,lon_0=60.0)
xl,yl = proj(lonshrink2d,latshrink2d)
# Or for a flattened, 1D version.
xlf,ylf = proj(lonshrink,latshrink)
xl.shape
(30,32)
yl.shape
(30,32)
# Interpolate to the rho points Uwind and Vwind.
while n < ntimes:
u = up[n,:,:]