Software to convert WRF output to HIRLAM-GRIB ...

3 downloads 0 Views 536KB Size Report
angles theta, lambda and alpha (written in HIRLAM GRIB file) need to be put the ... theta is the latitude, in degrees, of the South Pole of the coordinate system;.
Software to convert WRF output to HIRLAM-GRIB format to enable running of MATCH Technical Description and User Guide

F i n a l V e r s i o n

Deliverable number:

1 . 0

D4.12

Towards a self sustaining European Technology Platform (NERIS-TP) on Preparedness for Nuclear and Radiological Emergency Response and Recovery

Euratom for Nuclear Research and Training Activities: Fission 2010: 269718

NERIS-TP(WP4)-(13)-01

WP4: Uploader of global and WRF weather data to the DSS

Software to convert WRF output to HIRLAM-GRIB format to enable running of MATCH NERIS-TP(WP4)- (13)-01 S. Didkivska, Y. Ievdin, I. Kovalets Ukrainian Centre for Environmental and Water Projects Email: [email protected]

Final, April 2013

Date released

Revision

Prepared/ Revised by:

Reviewed by:

April 2013

Final 1

S. Didkivska Y. Ievdin I. Kovalets

S. Andronopoulos

2

Approved by:

WP4: Uploader of global and WRF weather data to the DSS

Management Summary This document describes the convertor developed to prepare input numerical weather prediction data for the far-range model of atmospheric transport MATCH of the RODOS system using the numerical weather prediction data calculated with WRF mesoscale meteorological model. Since WRF is freely available and it is widely used among the atmospheric modelling community, it is assumed that the developed convertor will allow for wider usage of RODOS MATCH for the calculation of far-range transport following real or hypothetical nuclear accidents.

Project co-funded by the European Commission within the seventh Framework Programme (2011-2014) Dissemination Level PU PP RE CO

Public Restricted to other programme participants (including the Commission Services) Restricted to a group specified by the consortium (including the Commission Services) Confidential, only for members of the consortium (including the Commission Services)

3

X

WP4: Uploader of global and WRF weather data to the DSS

Contents SOFTWARE TO CONVERT WRF OUTPUT TO HIRLAM-GRIB FORMAT TO ENABLE RUNNING OF MATCH 2

1

Management Summary

3

Contents

4

1

Introduction

5

2

Implementation details

6

3

Results of testing of the WRF2MATCH program

10

4

User instructions .4.1 Installation .4.2 Running the program .4.3 Descriptions of the parameters in parameters.list .4.4 Auxiliary files

14 14 14 14 15

5

References

16

6

Document History

17

4

WP4: Uploader of global and WRF weather data to the DSS

1 Introduction The experience of the accident at Nuclear Power Plant (NPP) Fukushima once again clearly demonstrated the need for automated Decision Support System (DSS) for the evaluation of the radionuclides transport in air and water environment on the basis of operational Numerical Weather Prediction (NWP) data. At the time of the accident at Fukushima NPP the RODOS system was quickly adapted for prediction of the pollution in case of release to the environment. Operational forecasts of radionuclides were produced by the JRODOS system only in the near zone up to 300 km from the plant. However shortly after the accident it became necessary to calculate the far-range atmospheric transport of radionuclides. During the accident, the JRODOS system was not fully prepared for the solution of this problem because existing in the JRODOS model of the far-range transport of radionuclides MATCH (developed by Swedish Hydrometeorological Institute), worked only with the data from NWP model of the Danish Meteorological Institute (DMI) HIRLAM and with the ECMWF data. Therefore, one of the priorities of the JRODOS system development after the accident was the creation of the possibility of launching a far-range transport model MATCH based on the NWP data calculated with the widely used WRF mesoscale meteorological model (www.wrf-model.org ). In order to run MATCH on the particular NWP data set it is necessary to bring the NWP data to the format of HIRLAM model. In particular the following steps are to be fulfilled: 1) interpolate the output data of WRF NWP model on vertical levels of HIRLAM; 2) convert from the existing set of WRF meteorological parameters to parameters which are output by HIRLAM; 3) write data into the format of the World Meteorological Organization GRIB. Therefore the software tools for the conversion of the NWP data of WRF to the formats required by MATCH have been developed (hereafter referred to as WRF2MATCH program). Below we describe the technical details of the WRF2MATCH implementation as well as user instructions.

5

WP4: Uploader of global and WRF weather data to the DSS

2 Implementation details Objectives of the program WRF2MATCH include solution of problems arising due to the difference in the models WRF and HIRLAM, namely: 1) Map projection 2) Vertical layering 3) Establishing correspondence between output meteorological parameters of the both models Map projection. DMI HIRLAM uses a rotated latitude-longitude projection and WRF just latitudelongitude projection, which is a partial case of rotated latitude-longitude projection. Then angles theta, lambda and alpha (written in HIRLAM GRIB file) need to be put the following values: theta = 0; lambda = -90; alpha = 0; Here: theta is the latitude, in degrees, of the South Pole of the coordinate system; lambda is the Longitude in degrees, of the South Pole of the coordinate system; alpha is the rotation angle, in degrees, around the new polar axis. Vertical grid HIRLAM uses mixed vertical sigma-pressure grid. Levels of this model are defined as the sum of the height and the sigma term, which represents the pressure [RODOS(WG2)TN(99)-11], [WMO306]. In present implementation 32 vertical levels are assigned for output in HIRLAM-GRIB file (including the surface). Pressure at a certain level is determined by the formula where

is the surface pressure.

The peculiarity of the HIRLAM data is that they are measured from the upper levels of the atmosphere down to the ground (in the pressure direction). In DMI HIRLAM and (zero pressure at the top) and and (the surface pressure at the bottom), given that , , and determine the pressure at the boundary layers. The values of and which are used in WRF2MATCH program are presented in the Table below. These settings are contained in the Description section of the grid of every bulletin in HIRLAM-GRIB file. The vertical interpolation performed from the WRF layers to MATCH layers is linear in pressure.

6

WP4: Uploader of global and WRF weather data to the DSS

Table. Values of vertical grid parameters of MATCH which are used in WRF2MATCH program 1

0.000000

0.000000

2

2500.000000

0.000000

3

5000.000000

0.000000

4

7445.261719

0.000860

5

9890.519531

0.001720

6

12028.414062

0.007460

7

14166.308594

0.013200

8

15756.183594

0.027710

9

17346.058594

0.042220

10

18233.605469

0.067990

11

19121.148438

0.093760

12

19246.195312

0.131665

13

19371.238281

0.169570

14

18767.855469

0.218795

15

18164.468750

0.268020

16

16953.324219

0.326145

17

15742.179688

0.384270

18

14115.113281

0.447550

19

12488.050781

0.510830

20

10684.933594

0.574550

21

8881.820312

0.638270

22

7159.679688

0.697325

23

5437.539062

0.756380

24

4031.899902

0.805995

25

2626.260010

0.855610

26

1704.780029

0.892180

27

783.300049

0.928750

28

391.649902

0.950870

29

0.000000

0.972990

30

0.000000

0.982635

31

0.000000

0.992280

32

0.000000

1.000000

7

WP4: Uploader of global and WRF weather data to the DSS

Establishing correspondence between output meteorological parameters of WRF and HIRLAM 3D variables required by MATCH are U and V components of wind, temperature and mixing ratio. They are all interpolated vertically. We take WRF output data on the latitude-longitude projection. This allows to consider U- and V- velocity components calculated by WRF as West-East and South-North velocity components. Pressure (in mb) is calculated from WRF output variables using the formula (see [WRF UG, 2009], section ‘Special WRF Output Variables’): Where ‘P’ is "perturbation pressure" in output WRF file and ‘PB’ is "base state pressure". Temperature is calculated by the following formula: Here ‘T’ is "perturbation potential temperature" in WRF output file which is converted to temperature. Mixing ratio is taken to be equal to variable QVAPOR from WRF output file. As for the 2-dimensional variables the following variables are taken from WRF files without additional calculations: Land cover [LANDMASK], Convective precipitation [RAINC], Non-convective precipitation [RAINNC], Latent heat flux [LH], PBL height [PBLH], Surface pressure [PSFC], Albedo [ALBEDO], Ice cover [SEAICE], Sensible heat flux [HFX], Sea surface temperature [SST], Surface roughness over ground [ZNT]. Surface geopotential is calculated from terrain height stored in WRF file (variable HGT) by multiplying it by 9.81. Ground temperature is taken equal to the value of TSLB array from the WRF output file (soil temperature) on the first (upper) level. Sea level pressure is calculated from the 3D pressure and temperature fields using the approach presented in [INTERPB]. At first the index k0 of the first WRF level which is above 100 mb relative to Earth surface is found: Do k=1,N If (PSFC-P(i,j,k)-PB(i,j,k)=10000) then k0=k; endif Enddo Then pressure and temperature at k0-th level are defined:

Then we find (surface temperature), (mean temperature in layer above ground), level 100 hPa above surface, and (sea level temperature):

8

at

WP4: Uploader of global and WRF weather data to the DSS

Then sea level pressure is calculated as: , , (pressure in Pa on top of WRF domain) Here and the following variables from WRF output files are used: – array containing eta values on half (mass) levels, – perturbation pressure, – base state pressure, – perturbation potential temperature, – terrain height, – surface pressure from NETCDF file of WRF. Workflow of the program First of all, program reads the configuration file which name is parameters.list. Then program reads the NETCDF file (indicated in parameters.list). After that it checks if the latitude-longitude projection is present in the file and if all necessary variables are present in NETCDF file. If at least one test does not pass, the program stops, completing its work. Next, the program reads from NETCDF file the number of grid points in latitude, longitude, altitude and time. Then it calculates grid spacing in latitude Di, longitude Dj, and time step. For each time step the program does the following steps: 1) Reads the pressure variables 2) Calculates the vertical levels for DMI HIRLAM GRIB file 3) Reads 3D variables, making necessary calculations, vertical interpolation and writes results to GRIB file. 4) Reads 2D variables, making necessary calculations, vertical interpolation and writes results to GRIB file. The technical approach used in present work is to a large extend based on the software code developed by Anatoliy Kuschan (UCEWP) in 2001 in frame of the TACIS project TA REG 02/3 on RODOS implementation in Ukraine in which data of MM5 mesoscale meteorological model for (www.mmm.ucar.edu/mm5 ) were prepared to be used by RODOS MATCH.

9

WP4: Uploader of global and WRF weather data to the DSS

3 Results of testing of the WRF2MATCH program Testing of the WRF2MATCH program was conducted by comparing calculations of the (RIMPUFF-based) LSMC model and MATCH model running on the NWP same data set prepared by WRF. Both MATCH and LSMC run on NWP data calculated with WRF model in the 300x300 km domain around Fukushima with the analysis time: 16 March 2011, 06 UTC. Release starts on 16 March, 12:00 UTC and the release duration is 1 hour. The release rate is: 1017 Bq/s. Fig. 1 shows the time-integrated concentration of Cs-137 after 24 hours calculated by LSCMC and MATCH. The orientation of the cloud is the same, but the values are different due to different output units. For the point indicated on Fig. 1 we made a comparison of LSMC- and MATCHcalculated concentrations (Fig. 2). LSMC resulted in the maximum time-integrated concentration in a given point equal 9.38Е12 Bq*s/m3. MATCH resulted in maximum time-integrated concentration at the same point equal to 10.8Е12 Bq*s/m3. (conversion from Bq*h/m3 to Bq*s/m3 has been performed). Thus both models results in consistent time-integrated concentrations. Next step of evaluation was the comparison of dry deposition in the same point (Fig. 3). For the case of LSMC the corresponding value was 4.99Е9 Bq/m2. For the case of MATCH it was 8.16Е9 Bq/m2. The difference between deposited concentrations is almost by the factor of 2. However such difference in deposited concentrations may be attributed to differences in paramerizations of dry deposition between the two models.

1 0

WP4: Uploader of global and WRF weather data to the DSS

Figure 1. Time-integrated concentration calculated by LSMC (upper) and MATCH (bottom) using the same input NWP data set calculated by WRF (visualization is by JRODOS). The units of LSMC-calculated concentration is Bq*s/m3, of MATCHcalculated concentration is Bq*h/m3.

1 1

WP4: Uploader of global and WRF weather data to the DSS

Figure 2. Time-integrated concentration calculated at the point indicated on Fig. 1 by LSMC (upper) and MATCH (bottom) using the same input NWP data set calculated by WRF (visualization is by JRODOS). The units of LSMC-calculated concentration is Bq*s/m3, of MATCH-calculated concentration is Bq*h/m3.

1 2

WP4: Uploader of global and WRF weather data to the DSS

Figure 3. Deposited concentration calculated at the point indicated on Fig. 1 by LSMC (upper) and MATCH (bottom) using the same input NWP data set calculated by WRF (visualization is by JRODOS).

1 3

WP4: Uploader of global and WRF weather data to the DSS

4 User instructions .4.1

Installation

WRF2MATCH is delivered as zipped archive. To install it a user need only unzip the file WRF2MATCH.tar. Important notes 1. The program is written mainly in Java. However User does not need to install JRE (32bit version, Java-6) since WRF2MATCH folder already contains it. 2. Part of the program responsible for writing GRIB file uses C- program written by National Center for Atmospheric Research (NCAR). This code is compiled as 32-bit dll library (file WRF2MATCH/lib/packgrib_.dll) for running on Windows platforms and it is compiled as 32-bit .so library for running on Linux platforms (file WRF2MATCH/lib/libPackgrib.so). However libPackgrib.so file could be incompatible with certain Linux platforms. In this case it has to be recompiled. The source code of the C-program is contained in archive Packgrib.tar (file packgrib_.c). For recompilation of the .so library un-tar the Packgrib.tar and run script run.sh contained inside it. 3. For communication between Java and C parts of the program, WRF2MATCH uses open-source JNA (https://github.com/twall/jna ) library (file WRF2MATCH/lib/jna3.5.1.jar). This library supports wide range of OS-Architecture Platform combinations. However it could probably fail on too outdated or newly developed platforms. In this case we recommend trying different versions available on JNA site. .4.2

Running the program

First prepare WRF output file. Put the WRF files inside WRF2MATCH directory. Prior to running WRF2MATCH program do the following steps: 1) Make changes in the file parameters.list 2) Run program by running one of the scripts: WRF2MATCH/run.cmd on Windows platforms or WRF2MATCH/run.sh on Linux platforms. 3) Output GRIB files are found in the same directory. Notes. 1. WRF2MATCH can work only with WRF fields calculated using latitude-longitude projection. Other projections (such as Lambert or Mercator) are not supported. 2. WRF files must contain the following variables (the names are given as they are present in WRF files): XLONG, XLAT, P, PB, PSFC, U, V, U10, V10, T, T2, QVAPOR, Q2, LANDMASK, RAINC, RAINNC, LH, PBLH, HGT, ZNU, ALBEDO, SEAICE, HFX, SST, TSLB, ZNT. .4.3

Descriptions of the parameters in parameters.list

1 4

WP4: Uploader of global and WRF weather data to the DSS

wrf_file_name –file name of the WRF output file in NETCDF format year – year of the start of forecast in WRF model month – month of the start of forecast in WRF model day – day of the start of forecast in WRF model hour – hour of the start of forecast in WRF model end_time – end time (in hours starting from WRF analysis time) of output files in HIRLAM-GRIB format. dmi_level – number of vertical levels in the GRIB file (when one changes this value, then the size and values in the arrays dmia, dmib are to be changed) dmia, dmib – arrays describing the vertical coordinates in the GRIB files, more details can be found in previous section of this document. dmio - array that specifies which of the vertical levels of HIRLAM are to be put in GRIB file. For example, if , it means that the tenth vertical level will not be recorded in the GRIB file, and if then the tenth level will be recorded in the GRIB file .4.4

Auxiliary files

Java source codes of the program are contained in the archive ConverFilesToMATCH.tar. File Packgrib.tar contains C-code responsible for writing GRIB files (see above). The example of input files (WRF files) and corresponding output files (HIRLAM GRIB files) are contained in archive io_example.tar.

1 5

WP4: Uploader of global and WRF weather data to the DSS

5 References 1. [INTERPB] MM5 Modeling System Version 3. Tutorial Class Notes and User’s Guide. Chapter 11: INTERPB (http://www.mmm.ucar.edu/mm5/documents/MM5_tut_Web_notes/INTERPB/int erpb.htm ) 2. [RODOS(WG2)-TN(99)-11] Description of the Numerical Weather Prediction HIRLAM, Editor: T.Mikkelsen, RODOS(WG2)-TN(99) 3. [Skamarock, et.al., 2008]. W.C. Skamarock, J.B. Klemp, J. Dudhia [et al], 2008. A description of the advanced research WRF version 3. // NCAR Technical Note NCAR/TN-475+STR. – USA, Boulder: National Center for Atmospheric Research, 2008. – 125 p. – (available at http://wrf-model.org ) 4. [TA REG 02/3] Technical report on adaptation of the RODOS system to conditions of Ukraine. Annex 2 to the Report on ‘Implementation in Ukraine of the RODOS System for Off-Site Emergency Preparedness and Response’ W.Lins. M.Zheleznyak (Eds.) Report on Tacis project TA REG 02/3, Kiev, June , 2002. 5. [WMO306] Instruction on codes, Vol.1, International codes // World Meteorological Organization, 1989, №306

1 6

WP4: Uploader of global and WRF weather data to the DSS

6 Document History Document Title:

NERIS-TP number: Version and status: Issued by: History: Date of Issue: Circulation: File Name: Date of print:

Software to convert WRF output to HIRLAM-GRIB format to enable running of MATCH. Technical Description and User Guide NERIS-TP (WP4)-???? Version 1.0 (Final) UCEWP Version 1.0 (Final)

WP_D4.12 23 April 2014

1 7