En:toolbox:io-processing:interpolateug

De WAVEWATCH-III Wiki

interpolateUG

This FORTRAN 90 program expects to find the following files in the running directory

  • interpolateUG.inp : ASCII input file with WWATCH convention (first character in file is the comment character)
  • interpolateUG.grd : fortran unformatted binary file, using big-endian convention. (see below for details)
  • interpolateUG.list : interpolation method and list of input and output ASCII files

Three different interpolation methods are used, for different types of variables:

  • 1. linear interpolation : used for all “normal” variables (hs, t02, uss, mss, CgE … )
  • 2. nearest non-missing value : used for variables with jumps (peak frequency stuff: fp …)
  • 3. linear interpolation through sines and cosines: used for direction variables (dir, dp …)

interpolateUG.inp

$ File for definition of new domain
my_zone.log
$ MSH file corresponding to input file
/work/my_zone.msh
$ header information
III 1.03
WAVEWATCH III BOUNDARY DATA FILE
$ tag in file
WWIII UG interp
$ nxmin, nxmax, nymin,nymax
1 nbLon 1 nbLat

my_zone.log

latMin latMax lonMin lonMax
0
0 0
nbLon nbLat
0 0 0 0

/!\ be careful with lat and lon order which is inverted in the line 4 /!\

How to calculate nbLon and nbLat for France zones:

nbLon=int[(3600/6)*(lonMax-lonMin)]+1
nbLat=int[(3600/9)*(latMax-latMin)]+1

interpolateUG.grd

All the information necessary for the interpolation is stored in the interpolateUG.grd file.
If this file does not exist it will be generated (this takes some time!).
The unformatted binary contains the following records:

  • NX, NTRI, NXO, NYO (record of 4 integers)
  • IPBPI, RDBPI (record with an integer array IPBPI(NXO,NYO,3) and a real array RDBPI(NXO,NYO,3) )
  • LATMIN,LATMAX,LONMIN,LONMAX (record of 4 real values)