53
November 21 st 2002 Summer 2009 WRFDA Tutorial WRF-Var System Overview Xin Zhang, Yong-Run Guo, Syed R-H Rizvi, and Michael Duda

WRF-Var System Overview

  • Upload
    damisi

  • View
    48

  • Download
    0

Embed Size (px)

DESCRIPTION

WRF-Var System Overview. Xin Zhang, Yong-Run Guo, Syed R-H Rizvi, and Michael Duda. Outline. WRF-Var in the WRF Modeling System WRF-Var Software WRF-Var Implementation. WRF-Var in the WRF Modeling System. WRF-Var in the WRF Modeling System. WRF-Var. Blue --> Supported by WRF-Var Team. - PowerPoint PPT Presentation

Citation preview

Page 1: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial

WRF-Var System Overview

Xin Zhang, Yong-Run Guo,

Syed R-H Rizvi, and Michael Duda

Page 2: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 2

Outline

1. WRF-Var in the WRF Modeling System

2. WRF-Var Software

3. WRF-Var Implementation

Page 3: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 3

WRF-Var in the WRF Modeling System

Page 4: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 4

WRF-Var in the WRF Modeling System

Blue --> Supported by WRF-Var Team

WRF-Var

Page 5: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 5

Blue --> Supported by WRF-Var Team

1. Prepare BE data

WRF-Var in the WRF Modeling System

BackgroundError

(gen_be)B0

WRF-Var

Page 6: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 6

Prepare BE statistics

J(x) = (x - xb)TB-1(x - xb) + (yo - Hx)TR-1(yo - Hx)

For initial testing , default background error statistics may be used be.dat file (CV option 5) from test case tar file can only be used

with the domain from online tutorial

be.dat.cv3 (CV option 3) from source code tar file can be used for general test domains

Ultimately, these should be specific to the particular model domain (and season)

See lecture “WRF-Var Background Error Estimations”

Page 7: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 7

2. Prepare background (WPS and real)

WRF-Var in the WRF Modeling System

BackgroundError

(gen_be)

xb

BackgroundPreprocessing(WPS , real)

xlbc

B0

Cold-Start Background

WRF-Var

Page 8: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 8

Prepare background

J(x) = (x - xb)TB-1(x - xb) + (yo - Hx)TR-1(yo - Hx)

In “cold-start” mode: accomplished by running the WPS and real programs The background is essentially the wrfinput_d01 file

In “cycling” mode: the output of the WRF model WRF can output wrfinput-formatted files used for

cycling

Page 9: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 9

Blue --> Supported by WRF-Var Team

3. Prepare observations (run OBSPROC)

WRF-Var in the WRF Modeling System

BackgroundError

(gen_be)

xb

BackgroundPreprocessing(WPS , real)

xlbc

B0

yo , R

Cold-Start Background

Radar in ASCIIRadiance in BUFR

ObservationPreprocessing(OBSPROC)

WRF-Var

Note: Radar and radiance data do not pass through the OBSPROC program!

Page 10: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 10

Observation input for WRF-Var is supplied through observation preprocessor, OBSPROC Except radar and satellite radiances

Observation error covariance also provided by OBSPROC (R is a diagonal matrix)

Separate input file (ASCII) for radar, both reflectivity and radial velocity.

Separate input file for satellite radiances

Prepare observations (y0)

J(x) = (x - xb)TB-1(x - xb) + (yo - Hx)TR-1(yo - Hx)

Page 11: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 11

Blue --> Supported by WRF-Var Team

4. Run WRF-Var

WRF-Var in the WRF Modeling System

BackgroundError

(gen_be)

xb

xa

BackgroundPreprocessing(WPS , real)

xlbc

B0

yo , R

Cold-Start Background

Radar in ASCIIRadiance in BUFR

ObservationPreprocessing(OBSPROC)

WRF-Var

Page 12: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 12

Blue --> Supported by WRF-Var Team

5. Update boundary conditions (UPDATE_BC)

WRF-Var in the WRF Modeling System

BackgroundError

(gen_be)

xb

xaUpdate Lateral& Lower BCs

(UPDATE_BC)

BackgroundPreprocessing(WPS , real)

xlbc

B0

yo , R

Cold-Start Background

Radar in ASCIIRadiance in BUFR

ObservationPreprocessing(OBSPROC)

WRF-Var

Page 13: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 13

Update boundary conditions

After creating an analysis, xa, we have changed the initial conditions for the model However, tendencies in wrfbdy_d01 (and possibly

wrflbdy) file are valid for background, xb

The update_bc program adjusts these tendencies based on the difference xa - xb

Of course, if xa was produced for reasons other than running WRF, there is probably not a need to update boundary conditions

Page 14: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 14

Blue --> Supported by WRF-Var Team

6a. Run forecast (cold-start mode)

WRF-Var in the WRF Modeling System

BackgroundError

(gen_be)

Forecast(WRF)

xb

xaUpdate Lateral& Lower BCs

(UPDATE_BC)

BackgroundPreprocessing(WPS , real)

xlbc

B0

yo , R

Cold-Start Background

Radar in ASCIIRadiance in BUFR

ObservationPreprocessing(OBSPROC)

WRF-Var

Page 15: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 15

WRF-Var in the WRF Modeling System

Note the arrow from ARW MODEL to WRF-Var!

Page 16: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 16

Blue --> Supported by WRF-Var Team

6b. Run forecast (cycling mode)

WRF-Var in the WRF Modeling System

BackgroundError

(gen_be)

Forecast(WRF)

xb

xaUpdate Lateral& Lower BCs

(UPDATE_BC)

BackgroundPreprocessing(WPS , real)

xlbc

Cycled Background

B0

yo , R

Radar in ASCIIRadiance in BUFR

xf

ObservationPreprocessing(OBSPROC)

WRF-Var

Page 17: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 17

Background Error (BE) for WRF-Var

One important question from WRF-Var users is“What background errors are best for my application?”

• Create your own once you have run your system for a few weeks to a month

• Implement, tune, and iterate

The utility gen_be has been developed at NCAR for use in calculating these BEs

Page 18: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 18

Blue --> Supported by WRF-Var Team

7. WRF-Var/WRF Ultimate Configuration

WRF-Var in the WRF Modeling System

BackgroundError

(gen_be)

Forecast(WRF)

xb

xaUpdate Lateral& Lower BCs

(UPDATE_BC)

BackgroundPreprocessing(WPS , real)

xlbc

Cycled Background

B0

yo , R

Cold-Start Background

Radar in ASCIIRadiance in BUFR

xf

ObservationPreprocessing(OBSPROC)

WRF-Var

Page 19: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 19

WRF-Var Software

Page 20: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 20

Use of the WRF Software Framework• WRF-Var relies on the WRF

Software framework for– Distributed memory parallelism

(halo exchanges, etc.)– Input/Output of first guess and

analysis files– Parallel transposes

• WRF-Var also uses– The WRF Registry mechanism to handle definitions of

fields, halos, and transposes– The WRF build system (clean, configure, compile)

Page 21: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 21

WRF-Var Code Organization

Besides the directories for WRF, the WRFDA tar file contains a “var” directory, which holds all of the WRF-Var code

Page 22: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 22

WRF-Var Code Organization

Generally, each subdirectory of “da” contains a Fortran module with the same name

Page 23: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 23

WRF-Var Code Organization

• da_metar.f90 contains a Fortran module• Each .inc file corresponds to a subroutine within the module

Page 24: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 24

WRF-Var Implementation

Page 25: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 25

WRF-Var Formulation WRF-Var actually uses an incremental formulation

of the 3DVAR problem

Define the increment x’ = x - xb

Also, if x’ is small, H(x) = H(xb + x’) ≈ H(xb) + Hx’

where H is the linearization of H

Then, the problem becomes

with yo’ = yo - H(xb)

J(x) = (x - xb)TB-1(x - xb) + (yo - H(x))TR-1(yo - H(x))

J(x’) = (x’)TB-1(x’) + (yo’ - Hx’)TR-1(yo’ - Hx’)

Page 26: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 26

WRF-Var Formulation

Next, define the control variable transform U such

that x’ = Uv. v is the analysis increment in control variable space

B is approximated by UUT

WRF-Var actually minimizes

After minimization, the analysis, xa, is given by

J(v) = vTv + (yo’ - HUv)TR-1(yo’ - HUv)

xa = xb + Uv

Page 27: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 27

ReadNamelist

xb

xa

yo

ComputeAnalysis

CalculateO-B

SetupFrame

SetupBackground

SetupBackground

Errors

Minimize Cost Function

SetupObservations

CalculateDiagnostics

OutputAnalysis

DiagnosticsFile

NamelistFile

Tidy Up

WRF-VarSTART

WRF-VarEND

“Outer Loop”

B0

WRF-Var

Page 28: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 28

• Reads grid dimensions from “namelist.input” file.

• Use WRF framework’s distributed memory capability to initialize tile, memory, patch dimensions, etc.

Setup Frame

Page 29: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 29

ReadNamelist

xb

xa

yo

ComputeAnalysis

CalculateO-B

SetupFrame

SetupBackground

SetupBackground

Errors

Minimize Cost Function

SetupObservations

CalculateDiagnostics

OutputAnalysis

DiagnosticsFile

NamelistFile

Tidy Up

WRF-VarSTART

WRF-VarEND

“Outer Loop”

B0

WRF-Var

Page 30: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 30

• Reads WRF-Var data assimilation options from “namelist.input” file.

• Performs consistency checks between namelist options.

Read Namelist

Page 31: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 31

ReadNamelist

xb

xa

yo

ComputeAnalysis

CalculateO-B

SetupFrame

SetupBackground

SetupBackground

Errors

Minimize Cost Function

SetupObservations

CalculateDiagnostics

OutputAnalysis

DiagnosticsFile

NamelistFile

Tidy Up

WRF-VarSTART

WRF-VarEND

“Outer Loop”

B0

WRF-Var

Page 32: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 32

• Reads in the first-guess field.

• Format depends on namelist option : “fg_format” ; 1= WRF, etc.

• Extracts necessary fields.

• Creates background FORTRAN 90 derived data type “xb” e.g. xb % mix, xb % u(:,:,:), ….

Setup Background (First-guess)

Page 33: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 33

ReadNamelist

xb

xa

yo

ComputeAnalysis

CalculateO-B

SetupFrame

SetupBackground

SetupBackground

Errors

Minimize Cost Function

SetupObservations

CalculateDiagnostics

OutputAnalysis

DiagnosticsFile

NamelistFile

Tidy Up

WRF-VarSTART

WRF-VarEND

“Outer Loop”

B0

WRF-Var

Page 34: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 34

• Reads in background error statistics.

• Extracts necessary quantities – eigenvectors, eigenvalues, lengthscales, regression coefficients, etc (see “WRF-Var Background Error Estimation”).

• Creates background error FORTRAN 90 derived data type “be” – e.g. be % v1 % evec(:,:), be % v2 % eval(:), etc,

….

Setup Background Errors (BE)

Page 35: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 35

ReadNamelist

xb

xa

yo

ComputeAnalysis

CalculateO-B

SetupFrame

SetupBackground

SetupBackground

Errors

Minimize Cost Function

SetupObservations

CalculateDiagnostics

OutputAnalysis

DiagnosticsFile

NamelistFile

Tidy Up

WRF-VarSTART

WRF-VarEND

“Outer Loop”

B0

WRF-Var

Page 36: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 36

• Reads in observations.• Format depends on namelist variable

“ob_format”

1 = BUFR, 2 = ASCII “WRF-Var” format.• Creates observation FORTRAN 90 derived

data type “ob” – e.g. ob % metar(:), ob % sound(:) % u(:), etc, ….

• Identifies Obs outside/inside the domain

Setup Observations

Page 37: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 37

Obs. on one processor’s halo Obs. on neighboring processor

*

Observations in Distributed Memory

• Halo Region Observation

• For global option obs. on East and

West boundaries are duplicated

Page 38: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 38

ReadNamelist

xb

xa

yo

ComputeAnalysis

CalculateO-B

SetupFrame

SetupBackground

SetupBackground

Errors

Minimize Cost Function

SetupObservations

CalculateDiagnostics

OutputAnalysis

DiagnosticsFile

NamelistFile

Tidy Up

WRF-VarSTART

WRF-VarEND

“Outer Loop”

B0

WRF-Var

Page 39: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 39

• Calculates “model equivalent” B of observation O through interpolation and change of variable.

• Computes observation minus first guess (O-B) value.

• Creates innovation vector FORTRAN 90 derived data type “iv” – e.g. iv % metar(:), iv % qscat(:) % u, iv % sound(:) %

u(:), etc ….

Calculate Innovation Vector (O-B)

Page 40: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 40

ReadNamelist

xb

xa

yo

ComputeAnalysis

CalculateO-B

SetupFrame

SetupBackground

SetupBackground

Errors

Minimize Cost Function

SetupObservations

CalculateDiagnostics

OutputAnalysis

DiagnosticsFile

NamelistFile

Tidy Up

WRF-VarSTART

WRF-VarEND

“Outer Loop”

B0

WRF-Var

Page 41: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 41

Use conjugate gradient method

• (a) Initializes analysis increments to zero.• (b) Computes cost function (if desired).• (c) Computes gradient of cost function.• (d) Uses cost function and gradient to calculate

new value of analysis control variable, v

Iterate (b) to (d)

Minimize Cost Function

Page 42: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 42

ReadNamelist

xb

xa

yo

ComputeAnalysis

CalculateO-B

SetupFrame

SetupBackground

SetupBackground

Errors

Minimize Cost Function

SetupObservations

CalculateDiagnostics

OutputAnalysis

DiagnosticsFile

NamelistFile

Tidy Up

WRF-VarSTART

WRF-VarEND

“Outer Loop”

B0

WRF-Var

Page 43: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 43

• Once WRF-Var has found a converged control variable, convert control variable to model space analysis increments

• Calculate:

analysis = first-guess + analysis increment

• Performs consistency checks, e.g., remove negative humidity etc.

Compute Analysis

Page 44: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 44

ReadNamelist

xb

xa

yo

ComputeAnalysis

CalculateO-B

SetupFrame

SetupBackground

SetupBackground

Errors

Minimize Cost Function

SetupObservations

CalculateDiagnostics

OutputAnalysis

DiagnosticsFile

NamelistFile

Tidy Up

WRF-VarSTART

WRF-VarEND

“Outer Loop”

B0

WRF-Var

Page 45: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 45

• Compute O-B, O-A statistics for all observation types and variables.

• Compute A-B (analysis increment) statistics for all model variables and levels.

• Statistics include minimum, maximum (and their locations), mean and standard deviation.

Compute Diagnostics

Page 46: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 46

ReadNamelist

xb

xa

yo

ComputeAnalysis

CalculateO-B

SetupFrame

SetupBackground

SetupBackground

Errors

Minimize Cost Function

SetupObservations

CalculateDiagnostics

OutputAnalysis

DiagnosticsFile

NamelistFile

Tidy Up

WRF-VarSTART

WRF-VarEND

“Outer Loop”

B0

WRF-Var

Page 47: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 47

• Outputs analysis in native model format. Choice is made through namelist option “fg_format”

1 = WRF, etc.

• Also output analysis increments (for diagnostic purposes) in native model format. Switch off by setting WRITE_INCREMENTS = .FALSE. in namelist.input.

Output Analysis

Page 48: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 48

ReadNamelist

xb

xa

yo

ComputeAnalysis

CalculateO-B

SetupFrame

SetupBackground

SetupBackground

Errors

Minimize Cost Function

SetupObservations

CalculateDiagnostics

OutputAnalysis

DiagnosticsFile

NamelistFile

Tidy Up

WRF-VarSTART

WRF-VarEND

“Outer Loop”

B0

WRF-Var

Page 49: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 49

• Deallocate dynamically-allocated arrays, structures, etc.

• Timing information.

• Clean end to WRF-Var.

Tidy Up

Page 50: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 50

WRFDA has a dedicated page, similar to the ARW Users’ page: http://www.mmm.ucar.edu/wrf/users/wrfda/

Online WRFDA Resources

Page 51: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 51

From the WRFDA page, one can access:

Online WRFDA Resources

Page 52: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 52

• Online WRF-Var Tutorial– http://www.mmm.ucar.edu/wrf/users/wrfda/tutorial.html

• WRF-Var chapter of Users’ Guide– http://www.mmm.ucar.edu/wrf/users/docs/user_guide_V3/

users_guide_chap6.htm

• If further help is needed, try the WRF Users’ Forum http://forum.wrfforum.com/ or ask questions via

[email protected]

Other WRFDA Resources

Page 53: WRF-Var System Overview

November 21st 2002Summer 2009 WRFDA Tutorial 53

Questions?