Chapter 7: INTERPF

 

 

7.1 Purpose

 

The INTERPF program handles the data transformation required to go from the analysis programs to the mesoscale model. This entails vertical interpolation, diagnostic computation, and data reformatting. INTERPF takes REGRID, RAWINS, LITTLE_R, or INTERPB output data as input to generate a model initial, lateral boundary condition and a lower boundary condition.

 

The INTERPF program runs on the following platforms: HP/Compaq/Alpha, Cray, Fujitsu, HP, IBM, SGI, Sun, PCs running Linux (Fedora with PGI or Intel compilers), and MAC (OSX with xlf). The INTERPF code is written in FORTRAN 90.

 

 

7.2 INTERPF Procedure

 

 

7.3 Surface Pressure Computation

 

Please note that the "X" used in the following computations throughout the entire chapter signifies an arithmetic multiplication, not a cross product.

 

1. first guess for representative T, p 100 hPa above surface

 

       

(7.1)

 

2. extrapolate Tslv

 

       

(7.2)


 
       

(7.3)

 

 

3. corrected Tsfc

 

       

(7.4)

 

 

4a. use mean temperature underground to estimate surface pressure

 

       

(7.5)

 

 

4b. OR use daily mean surface temperature to compute surface pressure

 

       

(7.6)

 

 

 

 

7.4 Hydrostatic Vertical Interpolation

 

The process of going from pressure levels to the σ coordinate requires only strictly bounded interpolation. Since the σ coordinate is defined to be contained within the maximum and minimum pressure, no extrapolations are required. A generated surface field is available as a coding option inside INTERPF via the namelist. Vertical interpolation uses linear techniques exclusively, typically linear in pressure or linear in ln pressure.

 

Hydrostatic pressure is defined as

 

       

(7.7)

 

where σ is a 1-D vertical coordinate, σ =1 at the ground, σ =0 at the model lid; p* is the arithmetic difference of the 2-D field of surface pressure and a constant (Ptop); and Ptop is the constant pressure at the model lid.

 

 

       

(7.8)

 

 

 

 

7.5 Integrated Mean Divergence Removal

 

Removing the integrated mean divergence allows the model to begin with a smaller amount of initial condition noise that the analysis contains. Given the average upper-air station separation, the reasonableness of the high frequency, column-averaged vertical motion is spurious at best. Again, the computations are scalar, and the "X" signifies scalar multiplication.

 

1. pressure weighted u, v on each σ

 

       

(7.9)

 

2. vertically average p*u, p*v

 

       

(7.10)

 

 

3. divergence of vertically-averaged pressure-weighted wind [m is the map scale factor for dot (D) and cross (X)]

 

       

(7.11)

 

4. solve for the velocity potential, with assumed boundary conditions

 

       

(7.12)

 

 

5. mean divergent wind components

 

       

(7.13)

 

6. vertical weighting

 

       

(7.14)

       

(7.15)

 

 

7. corrected wind components

 

       

(7.16)

 

 

 

7.6 Base State Computation

 

The base state for the MM5 model is constructed from several constants prescribing a surface level temperature and pressure, a temperature profile which may include an isothermal layer above the tropopause, and analytic expressions for a reference pressure and the height of the non-hydrostatic σ surfaces. Other than the terrain elevation only these constants are required by the modeling system as user input to completely define the base state.

 

1. constants

 

  • P00: reference sea level pressure (in the INTERPF namelist)
  • Ts0: reference sea level temperature (in the INTERPF namelist)
  • A: reference temperature lapse rate (in the INTERPF namelist)
  • PTOP: reference pressure at model top (in the REGRIDDER and INTERPF namelists)
  • TISO: (optional) temperature at which the reference temperature becomes constant (possibly for use in modeling the stratosphere) (in the INTERPF namelist)

 

2. reference p*

 

       

(7.17)

 

 

3. reference pressure 3-D

 

       

(7.18)

 

 

4. reference temperature 3-D

 

       

(7.19)

 

 

5. reference height

 

       

(7.20)

 

 

This provides a fixed (in time) height for each σ surface, since each i,j,k location is a function of the fixed σ values and the terrain elevation.

 

If the user has requested the use of the isothermal temperature option from the namelist, the temperature and height computations are modified. First, the minimum temperature allowable is defined as the isothermal temperature. The pressure at the location for the switch to the isothermal temperature is computed. From this pressure (PISO), the isothermal height is found, and then the adjusted reference height.

 

 

       

(7.21)

       

(7.22)

 

 

 

7.7 Initialization of Nonhydrostatic Model

 

INTERPF first generates a hydrostatic input file on the hydrostatic sigma levels which is based on actual surface pressure, not reference pressure. To initialize the data for the nonhydrostatic model a further small vertical interpolation is needed to move to the nonhydrostatic sigma levels. This involves first calculating the heights of the hydrostatic levels, then doing a linear-in-height interpolation of u, v, T and q to the nonhydrostatic levels.

 

While sea-level pressure, u, v, T and q are known from the input data sets, the nonhydrostatic model requires two more variables to be initialized.

 

  • Vertical velocity (w) is simply calculated from the pressure velocity (ω) obtained by integrating horizontal velocity divergence vertically while still on the hydrostatic sigma levels. Divergence removal has already ensured that this integration will give no vertical motion at the top of the model domain. This ω is then interpolated to the nonhydrostatic levels and converted to w (w=-ω/ρg). In practice, the results are not sensitive to whether w is initialized this way or equal to zero. 
  • Pressure perturbation (p′) has to be initialized to give a hydrostatic balance. Once virtual temperature is known on the nonhydrostatic model levels, the model's vertical velocity equation in finite difference form is used with the acceleration and advection terms set to zero. This leaves a relation between Tv(z) and the vertical gradient of p′. Given the sea-level pressure, p′ at the lowest sigma level can be estimated, and then given the profile of virtual temperature vertical integration gives p′ at the other levels. This balance ensures that the initial vertical acceleration is zero in each model column.

 

7.8 Substrate Temperature and the LOWBDY_DOMAINn file

 

There are three primary binary output files from the INTERPF program: MMINPUT_DOMAINn, BDYOUT_DOMAINn and LOWBDY_DOMAINn. The MMINPUT_DOMAINn file contains the time dependent 3D and 2D fields, such as wind, temperature, moisture and pressure. The BDYOUT_DOMAINn file contains the lateral boundaries of the 3D fields, typically, four rows worth of data. The LOWBDY_DOMAINn file contains either daily means of, or time-varying surface temperature fields (surface air temperature and sea surface temperature), and optionally sea-ice and snow cover fields.

 

The surface air temperature is either the temperature field defined at the surface from the input pressure-level data set (typically), or the lowest σ-level temperature field (if the namelist option was set to not use the input surface data in the vertical interpolation). This field is used as the constant, deep-soil temperature whenever the land surface model is not selected. The variable used as the sea surface temperature in REGRID is not well defined. Based on user selections, the sea surface temperature could be the water temperature, the skin temperature or the 1000 hPa temperature. Users with high resolution land use may find that they have very "hot" lakes during the summer.

 

If the user selected the skin temperature from the PREGRID Vtable, a daily mean of both the surface air temperature and the sea surface temperature are computed and output in the LOWBDY_DOMAINn file. The purpose for the daily mean is to reduce the diurnal variation of the "constant" temperature and provide more realistic inland lake temperatures. This is the reason it is recommended that users always prepare an analysis/forecast that extends for at least a full day. If the user selected the SST from the PREGRID Vtable, then the INTERPF program automatically provides time varying fields of both SST and the surface air temperature. When in doubt, the user should assume that that temperature at the ground is the skin temperature and not suitable for use as a time varying field for SST.

 

 

7.9 Shell Variables (for NCAR IBM job deck only)

 

All of the MM5 system job decks for IBM are written as C-shell executables. Strict adherence to C-shell syntax is required in this section.

Table 7.1: INTERPF IBM deck shell variables.

C-shell

Variable

Name

Options and Use

ExpName

location of MSS files, keep same as used for deck generating input file for this program

RetPd

time in days to retain data on MSS after last access

input_file

MSS root name for p-level input to INTERPF

 

 

7.10 Parameter Statements

 

Ha! There aren't any.

 

 

7.11 FORTRAN Namelist Input File

 

Most of the available options for the INTERPF code are handled through the namelist input file. Since this file is a FORTRAN namelist (FORTRAN 90 standard), syntax is very specific. There are six namelist records (record0 through record5). In general, all of the namelist records must be filled with the user's description of the data.

 

Table 7.2: INTERPF namelist values: RECORD0 and RECORD1.

Namelist

Record

Namelist

Variable

Description

RECORD0

INPUT_FILE

input file from REGRID, RAWINS, LITTLE_R, or INTERPB complete with directory structure

RECORD1

START_YEAR

starting time, 4 digit INTEGER of the year

RECORD1

START_MONTH

starting time, 2 digit INTEGER of the month

RECORD1

START_DAY

starting time, 2 digit INTEGER of the day

RECORD1

START_HOUR

starting time, 2 digit INTEGER of the hour

RECORD1

END_YEAR

ending time, 4 digit INTEGER of the year

RECORD1

END_MONTH

ending time, 2 digit INTEGER of the month

RECORD1

END_DAY

ending time, 2 digit INTEGER of the day

RECORD1

END_HOUR

ending time, 2 digit INTEGER of the hour

RECORD1

INTERVAL

time interval in seconds between analysis periods

RECORD1

LESS_THAN_24H

T/F flag of whether to force less than 24 h in the analysis (FALSE by default)

 

Table 7.3: INTERPF namelist values: RECORD2 and RECORD3.

Namelist

Record

Namelist

Variable

Description

RECORD2

SIGMA_F_BU

input sigma levels, full levels, bottom-up (1.0 through 0.0)

RECORD2

PTOP

pressure of the model lid (Pa)

RECORD2

ISFC

how many sigma levels to include in the use of the lowest level analysis for the vertical interpolation; 0 = normal interpolation, 1 = use surface level for lowest sigma layer, n>1 use surface level for n sigma layers in interpolation

RECORD3

P0

reference sea level pressure (Pa)

RECORD3

TLP

reference temperature lapse rate (K {ln Pa}-1)

RECORD3

TS0

reference sea level temperature (K)

RECORD3

TISO

isothermal temperature (K), if this is left as 0 there is no effect, this is the temperature that the reference profile assumes when the temperature would otherwise be less than TISO

 

Table 7.4: INTERPF namelist values: RECORD4 and RECORD5.

Namelist

Record

Namelist

Variable

Description

RECORD4

REMOVEDIV

T/F flag, remove the integrated mean divergence

RECORD4

USESFC

T/F flag, use the input surface data in the vertical interpolation

RECORD4

WRTH2O

T/F flag, saturation is with respect to liquid water

RECORD4

PSFC_METHOD

INTEGER, 0 => (Tslv + Tsfc )/2; 1 => surface pressure from diurnally averaged surface temp

RECORD5

IFDATIM

INTEGER, number of time periods of initial condition output required (only 1 is necessary if not doing analysis nudging), "-1" is the magic value that means output all of the time periods

 

 

7.12 How to Run INTERPF

 

1) Obtain the source code tar file from one of the following places:

 

Anonymous ftp:

ftp://ftp.ucar.edu/mesouser/MM5V3/INTERPF.TAR.gz

 

On NCAR MSS:

/MESOUSER/MM5V3/INTERPF.TAR.gz

 

2) gunzip the file, untar it. A directory INTERPF will be created. cd to INTERPF.

 

3) Type `make' to create an executable for your platform.

 

4) On an NCAR IBM, edit interpf.deck.ibm (located in ~mesouser/MM5V3/IBM) to select script options and to select namelist options. On workstations, edit the namelist.input file for the namelist options.

 

5) On an NCAR IBM, type interpf.deck.ibm to compile and execute the program. It is usually a good practice to pipe the output to an output file so that if the program fails, you can take a look at the log file. To do so, type: interpf.deck.ibm >& interpf.log, for example. On a workstation, run the executable directly (interpf >& interpf.log).

 

INTERPF requires one of the following input files: REGRID_DOMAINn, RAWINS_DOMAINn, LITTLE_R_DOMAINn, or MMOUTP_DOMAINn (where n is the domain identifier). The location for the input data, including directory structure, is defined in the namelist file.

 

Output files from INTERPF (input files for MM5): MMINPUT_DOMAINn, BDYOUT_DOMAINn, LOWBDY_DOMAINn (where n is the domain identifier). These files are output in the current working directory. The user has no control over this naming convention.

 

 

7.13 INTERPF didn't Work! What Went Wrong?

 

  • Most of the errors from INTERPF that do not end with a "segmentation fault", "core dump", or "floating point error" are accompanied with a print statement. Though the message itself may not contain enough substance to correct the problem, it will lead you to the section of the code that failed, which should provide more diagnostic information. The last statement that INTERPF prints during a controlled failed run is the diagnostic error. 
  • To see if INTERPF completed successfully, first check to see if the "STOP 99999" statement appears. Also check to see that INTERPF processed each of the requested times from the namelist. The initial condition file should be written-to after each analysis time, up to the number of time periods requested by the namelist. The boundary condition file is written-to after each analysis time, beginning with the second time period. The lower boundary file is written to just once. 
  • When INTERPF tells you that it "Relaxation did not converge in 20000 iterations", you may doing an idealized run with non-divergent winds. Set the flag (REMOVEDIV = .FALSE. in the namelist) so that you are not doing the mean divergence removal.
  • Remember that to generate a single boundary condition file, you must have at least two time periods, so that a lateral boundary tendency may be computed. Even if you are not going to run a long forecast, it is advantageous to provide a full day for the lower boundary condition file, as this file contains the daily mean of the surface air temperature and the daily mean of the SST. 
  • When INTERPF runs into an interpolation error that it did not expect (i.e. forced to do an extrapolation when none should be required), INTERPF will stop and print out the offending (I,J,K) and pressure values. If this is not simply a fix by amending the provided σ or pressure surfaces, it is usually a bit more tricky and implies that the analysis data is possibly in error.  

 

7.14 File I/O

 

The interpolation program has input and output files that are ingested and created during an INTERPF run. The binary input files and all of the output files are unformatted FORTRAN write statements (binary, sequential access). One of the input files is a human-readable namelist formatted file of run-time options.

 

The following tables are for the input and output units.

 

Table 7.5: INTERPF program input file.

File Name

Description

namelist.input

namelist file containing run-time options

LITTLE_R_DOMAINn,

RAWINS_DOMAINn,

REGRID_DOMAINn,

MMOUTP_DOMAINn

(specified in namelist file)

MM5 system, meteorological data on pressure levels, input to INTERPF

Table 7.6: INTERPF program output files.

File Name

Description

MMINPUT_DOMAINn

initial condition for MM5

BDYOUT_DOMAINn

lateral boundary condition for MM5

LOWBDY_DOMAINn

lower boundary condition (reservoir temperature, mean or time-varying SST, sea ice, fractional seaice, snow cover)

 

 

7.15 INTERPF tar File

 

The interpf.tar file contains the following files and directories:

 

CHANGES

Description of changes to the INTERPF program

Doc

Contains a couple of README files

Makefile

Makefile to create INTERPF executable

README

General information about the INTERPF directory

interpf.deck.cray

job deck for usage on one of the NCAR Cray machines

namelist.input

input namelist file for run-time options

src/

INTERPF source code