⬆️ ⬇️

Do-it-yourself weather forecast

Each of us scolded weather forecasters when we were in the rain, not having an umbrella in our hands. In the topic, I will tell you how to make a weather forecast based on the WRF (Weather Research & Forecasting Model) model for several days in advance.



A few words about the WRF


WRF is a numerical weather prediction model that is suitable for both atmospheric prediction and scientific research. Developed by the community of scientific organizations of the USA, including the National Center for Atmosphere and Ocean, the National Center for Atmospheric Research.

It is a system of modules: the module for preparing initial and boundary data (WRF Preprocessing System), the decisive core itself (Advanced Research WRF), the post-processing module (WRF Postprocessing System).

Most of the model (actually all mathematics) is implemented in the fortran language using the MPI library. On C written modules for working with data. The model is available in source codes.

Naturally, the model consumes a huge amount of processor time, and is designed to run on supercomputers, because the weather forecast is one of the most difficult tasks.



How does the model actually work?


Download the input data set (current state of the atmosphere). Then it runs the preprocessing module, which consists of three programs:
  1. geogrid.exe - processes static data (relief, soil types, hydrography);
  2. ungrib.exe - unpacks the initial data;
  3. metgrid.exe - interpolates the data obtained above to the model grid.
Then the kernel of the model starts, which with the help of numerical methods solves a nonlinear system of partial differential equations. It consists of two parallelized programs:
  1. real.exe - performs vertical interpolation of input data;
  2. wrf.exe is the resolving kernel itself.
Read more about the math model here .

Then, after the completion of the calculation, we get a data set, i.e. forecast of the state of the atmosphere for several days ahead with a discretization of 1 hour.

Now it is necessary to process this data and build slides on which we would apply the surface temperature, wind, pressure and precipitation. In fact, wrf produces a large number of fields, but we will limit ourselves to only these. For this purpose, we will use the wrfpost.exe program from the postprocessing module.



Computing resources


If you haven't got a supercomputer, then the model will take a long time to read.

At home, you can use Core i5 or i7, the more cores - the faster it will count. But I took a pair of 4 nuclear Xeons with 8 GB of RAM for Slackware 12 . In addition to the compilers, you must install the MPI libraries, for example, MPICH2 .

The only requirement is that the platform must be x86_64. Otherwise, preprocessing will not start.

The time costs for an area of 3000 x 3000 km (forecast for 2 days) are shown in the table below.

Step, kmPointsCalculation time, h
ten301 x 301ten
20151 x 1516
thirty101 x 101four
Customization Wishes


All settings are specified in the files namelist.input and namelist.wps .

The steps along the X and Y axes ( DX, DY parameters) should be the same. And the step should depend on the capacities that you have. 10-50 km is enough to play.

The time step DT is recommended to set equal to 9 * DX (in km) . DX, DY are given in meters, and DT in seconds.

')

Regarding parametrizations (boundary, surface layer, convection, microphysics) it is better to adhere to the recommended parameters:

&physics

mp_physics = 8,8,8

ra_lw_physics = 1,1,1,

ra_sw_physics = 1,1,1,

sf_sfclay_physics = 1,1,1,

sf_surface_physics = 2,2,2,

bl_pbl_physics = 1,1,1,

cu_physics = 1,0,0,

/

A detailed description of all parameters is given in the User Guide.



Where can I download?


The official website of the model: www.wrf-model.org

Components of the model: www.mmm.ucar.edu/wrf/users/download/get_sources.html

I recommend downloading version 3.2.1. At a minimum, you will need:

WRF model V3.2.1,

WRF Preprocessing System V3.2.1,

WRF Postprocessing System V3.2,

low-resolution geographical data (10' resolution),

( 1°, 500): www.nco.ncep.noaa.gov/pmb/products/gfs

To download the model you need to go through a simple registration procedure.

If you want to count in steps less than 10 km, then you will need to download a more detailed relief.



The grads program (for building slides) can be taken from the opengrads.org project .

Full user manual (eng), online version + pdf .



Ready to answer questions and help in the launch, if someone has a desire. You can try to fine tune the model and give the weather forecast to yourself.



results


For starters, I offer you the slides with forecasts for Saturday (check out tomorrow):

1. The temperature of the Earth and the wind at a height of 10m

image

2. Ground pressure and precipitation accumulated from the start of the count *

image



All pictures , dospuny in the album: imgur.com/a/XqBi6 (I hope it will).



For comparison, the forecast for Moscow from Yandex: pogoda.yandex.ru/moscow/details



* , . . ( 03. 22.07.2011 MSK).

Source: https://habr.com/ru/post/117140/



All Articles