Skip to content

ERA40 Climatological Forcing

Alexandros Avdis edited this page Jun 10, 2014 · 3 revisions

Introduction

Fluidity can use ERA40 climatological data as forcing in simulations.

This page will guide you through a few things you need to do before adding ocean forcing to a run

Useful tools

  • NCVIEW is a simple but fast netCDF viewing utility.
  • NetCDF tools (nco) is a suite of tools for editing NetCDF files. Install "nco" using your preferred package manager
  • Generic Mapping Tools (GMT) is suite of tools for cartography and editing NetCDF files

Getting forcing data

Data can be downloaded from ECMWF data-server.

You'll need to download the following variables from the "surface data":

  • 10 metre U wind component (m/2)
  • 10 metre V wind component (m/2)
  • 2m temperature (K)
  • Surface solar radiation downward (W/m^2 s)
  • Surface thermal radiation downward (W/m^2 s)
  • Total precipitation (m s)
  • Run off (m s)
  • 2m dew point temperature
  • Mean sea-level pressure

These variables need to be named as, respectively:

  • u10
  • v10
  • t2m
  • ssrd
  • strd
  • tp
  • ro
  • d2m
  • msl

Note that the radiations, precipitations and runoffs are in accumulated values. We assume in the code that the temporal resolution is 6 hours (i.e. we divide these values by 6 * 60 * 60 to get an instantaneous value). Make sure you do specify 6 hour resolution when downloading.

There are a few issues with downloading data like this:

  • There are a limited numbers of fields that can be downloaded in one go, so downloading all the fields required for 20 years worth of measurements in one go is not possible. You must therefore "concat" the NetCDF files in time
  • You can specify to download a specific area's worth of data by setting up an area on the ERA40 website. This is recommended and the area is stored for next time.

For periods of less than 13 years the easiest way to download them is one variable at a time. This way you won't hit the upper limit for the number of data in a file. The files can then be glued together using:

ncks -A tp.nc -o india_1970_1980.nc

where tp.nc is the downloaded NetCDF file containing "Total Precipitation" and india_1970_1980.nc is the output file. Simply repeat the above command for all 9 NetCDF files downloaded.

If you require more than 13 years, then the NCO tool kit can be used to "glue" together the data into a single NetCDF file. For some reason, the files from ERA40 when downloaded have data missing. This often happens on the 01/01/** at 0:00 or on the last day of the year, depending on whether the variable is an accumulated variable or not. That data will be found in the previous year so you need to remove the first or last data step. The command below removes the first step.

ncea -F -d time,2,1461 2001_surface.nc 2001_surface_correct.nc

This command assumes you have downloaded 1 years worth of data at 6 hour temporal frequency. Adjust the 1461 if not. Once we have continuous data, we can then concat the file together to produce one file containing all the data for all years of interest:

ncrcat 8?.nc 80_89.nc

which will concat 8-something.nc files into 80_89.nc files with a continuous "record" field. Warning This file will be many Gb in size!

Additionally, the ERA40 data contains missing values from time-to-time. These tend to occur for an entire field, across the globe, for one time step at a time. You can easily stop these in ncview as a sudden "white-ish" output, rather than the pretty picture expected.

Finally, the ERA40 variables names are subject to change. Luckily there is a handy tool for renaming variables in NetCDF files.

ncrename -v 10u,u10 -v 10v,v10 india_1970_1980.nc

which renames 10u to u10 and 10v to v10 in the file india_1970_1980.nc.

We now have an input file ready for forcing.

FLML Options and fields required

There are two options of interest in terms of boundaries, and another for time issues:

  • The first is in /geometry/ This needs switching on and the top_Surface_ids needs setting. Set the bottom_surface_ids too to be sure, but they shouldn't be needed/

  • Next turn on /ocean_forcing. The input file is the NetCDF file you created. For Mesh, specify the highest order mesh. If you have a DG mesh, use that one. Then switch on which forcings you require.

  • Time now needs to be set properly. In /timestepping/current_time/time_units you need to specify the reference time that your simulation starts at. So if you want to simulate from 13th March 2000, midnight, that time corresponds to time 0 in your simulation. Simulation time is typically in seconds and the ERA40 data has 6 hour resolution, so we need to map from simulation time to real time. This is done via this reference time. For the date above, put the following in this field: seconds since 2000-03-13 00:00.0

Few notes:

  • You need a temperature and velocity field to use forcing, even if you just want solar or salinity forcing
  • Your input meshes need to be in global cartesian co-ordinates.
  • The NetCDF data are geographic coordinates (lat/long) and the conversion is done automatically, but you will get odd results if your mesh NE corner is at (0,0), rather than the true location OR
  • Use the long_lat option to set the longitude and latitude of the (0,0) node.

For developers

Boundaries are created in preprocessor/Boundary_Conditions_From_Options.F90

Two routines are of interest. One (populate_ocean_forcing_boundary_conditions) is called at initialisation, which creates the fields in which the BCs are stored. The other (set_ocean_forcings_boundary_conditions) is called every time step and puts values into the fields, via the get_era40_fluxes routine.

get_era40_fluxes is a C++ routine that reads in the ERA40 NetCDF file and uses the NCAR bulk forcing routines to calculate the forcings. get_era40_fluxes can be found in ocean_forcing/forcingERA40.cpp along with the NCAR Fortran routine ncar_ocean_fluxes.F90. There is a test associated with forcingERA40.cpp (called forcingERA40), which can be built with

make forcingERA40

in the ocean_forcing directory. This builds an executable that takes a VTU file as input and calculates the forcing on that VTU file. Try the globe.vtu as input. This will produce output which can be compared directly to the fluxes calculated by the ERA40 analysis (sensible, latent, stresses, evaporation). In addition, the executable also outputs the fluxes at a single point to screen for a direct comparison.

Clone this wiki locally