Size: 3658
Comment:
|
Size: 5438
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
#format inline_latex | #acl ClamsUserGroup:read,write,delete,revert All:read #format inline_latex scale_factor=1 |
Line 9: | Line 10: |
Latitude range of the (external) grid where interpolations have to be determined. |
|
Line 14: | Line 14: |
{{{Start triangle for the walking triangle algorithm: y/n -- north/south hemisphere (does not work. Now, the $n/2$ ($n-$number of all triangles) is chosen as a start triangle). |
{{{ |
Line 22: | Line 20: |
Line 31: | Line 28: |
The program can be compiled on different platforms with the makefile stored in the directory ''i3d'': | The programs can be compiled on different platforms with the makefile stored in the directory ''i3d'': |
Line 34: | Line 31: |
gmake i3d_reg | |
Line 35: | Line 33: |
The program will be compiled for the used platform and an executable ''i3d'' will be created. | The programs will be compiled for the used platform and executables ''i3d'' and ''i3d_reg'' will be created. === Available programs === * [[/i3d | i3d]] * [[/i3dreg | i3d_reg]] |
Line 44: | Line 47: |
3) 3 ! 0=nearest, 1=weighted, 2=both, 3=weighted_new | 3) 1 ! 0=nearest, 1=weighted, 2=both |
Line 61: | Line 64: |
3) 3 ! 0=nearest, 1=weighted, 2=both, 3=weighted_new | 3) 2 ! 0=nearest, 1=weighted, 2=both |
Line 78: | Line 81: |
1. Interpolation type 1. Number of species and their names 1. ... 1. Name of init file | Directory with CLaMS output and prefix of these files 1. Input file with the external grid |
1. [[/InterpolationType | Interpolation type]] 1. Number of species to add to input file (line 7) and their names. If Variable ''TRACER'' should be added to input file, it should be specified at the end of the list.<<BR>> If the number of species is "0", all species from CLaMS file (line 6) listed on Variable ''SPECIES'' and Variable ''TRACER'' are added to input file. 1. use one CLaMS file for all dates in input file (y/n) 1. [[/ClamsInputFiles | CLaMS input files]]:<<BR>> line5='y': Name of CLaMS file <<BR>> line5='n': directory with CLaMS output and prefix of these files 1. [[/InputFiles | Input file with the external grid]] |
Line 84: | Line 90: |
1. Name of the NetCDF output file | 1. Name of the [[/OutputFile | NetCDF output file]] 1. Write warnings if triangle is not found |
Line 87: | Line 94: |
The walking triangle algorithm is described in [1]. It describes how in 2D (and 3D) a Delaunay triangle can be found that contains a given point ''X''. The walking triangle uses the following criterion to find such a triangle: ''X'' is inside of a triangle ''ABC'' if the given point ''X'' and the triangle point that does not define the considered triangle side are on the same side of the considered triangle side for each of the 3 possible sides of the triangle. E.g. for the side ''AB'', the following relation has to be valid: $[{\bf n}\cdot({\bf c}-{\bf a})][{\bf n}\cdot({\bf x}-{\bf a})] > 0$ with ${\bf n}={\bf a}\times {\bf b}$. This means that ''X'' and ''C'' are on the same side of ''AB'' if both scalar products have the same sign. The walking triangle algorithm checks if ''X'' is inside of the the start triangle by applying criterion for each triangle side. If for one triangle side this criterion is not valid, one has to walk to the corresponding neighboring triangle. In this way one walks in this triangle world directly to the triangle containing ''X''. === References === [1] M. Sambridge, J. Braun, and H. !McQueen. Geophysical parameterization and interpolation of irregular data using natural neighbors. ''Geophys. J. Int.'', 122:837--857, 1995. ---- [[ /Changes | History of Changes ]] |
The package i3d
The program i3d.f90 can be used for interpolation of the CLaMS output (usually stored on irregular grid in init*.nc) on an arbitrary different irregular grid (e.g. experimental data). In particular, it can be applied for interpolation on a spatially highly resolved regular grid that, on the one side, does not destroy the fine structures in the spatial distributions calculated with CLaMS and, on the other side, makes easier the handling of the CLaMS output (e.g. plotting).
How to get the source code
The source code of this package is under control of the CVS (Concurrent Version System) utility. To get the source code the environment variable CVSROOT must be set to /usr/local/icg/icg1/archive. The command
cvs co -P i3d
creates a directory i3d in the current working directory and copies the current version of the i3d package to this directory.
The directory i3d includes the following subdirectories:
doc: latex file for documentation
mod: module files
obj: object files
source: source code
templates: templates for configuration file
Compiling
The programs can be compiled on different platforms with the makefile stored in the directory i3d:
gmake i3d gmake i3d_reg
The programs will be compiled for the used platform and executables i3d and i3d_reg will be created.
Available programs
Configuration file
The options for the execution of i3d are set in the configuration file i3d.inp:
1) y ! north_hemisphere (y/n) 2) 30., 90. ! lat_min, lat_max 3) 1 ! 0=nearest, 1=weighted, 2=both 4) 2 ! number of tags CH4 O3 5) n ! use one init-file 6) /private/CNx_ECN_3d_24_1.5 ! input directory (init-files) CNx ! prefix of init-files (3 character) 7) data/mipas_isen_noonpos_030103_030131.nc ! input file (aircraft/satellite data) 8) outdir ! output directory 9) testout ! output prefix 10) y ! write warnings (y/n)
1) y ! north_hemisphere (y/n) 2) 30., 90. ! lat_min, lat_max 3) 2 ! 0=nearest, 1=weighted, 2=both 4) 2 ! number of tags CH4 O3 5) y ! use one init-file 6) test1/init_BN0_02100112.nc ! init-file 7) test1/pos_A_0_01100112.nc ! input file (aircraft/satellite data) 8) test1 ! output directory 9) testout ! output prefix 10) n ! write warnings (y/n)
Remarks:
- Start triangle for the walking triangle algorithm:
y/n -- north/south hemisphere (does not work. Now, the
(
number of all triangles) is chosen as a start triangle).
- Latitude range of the (external) grid where interpolations have to be determined.
Number of species to add to input file (line 7) and their names. If Variable TRACER should be added to input file, it should be specified at the end of the list.
If the number of species is "0", all species from CLaMS file (line 6) listed on Variable SPECIES and Variable TRACER are added to input file.- use one CLaMS file for all dates in input file (y/n)
CLaMS input files:
line5='y': Name of CLaMS file
line5='n': directory with CLaMS output and prefix of these files- Output directory
Name of the NetCDF output file
- Write warnings if triangle is not found
The walking triangle algorithm
The walking triangle algorithm is described in [1]. It describes how in 2D (and 3D) a Delaunay triangle can be found that contains a given point X. The walking triangle uses the following criterion to find such a triangle:
X is inside of a triangle ABC if the given point X and the triangle point that does not define the considered triangle side are on the same side of the considered triangle side for each of the 3 possible sides of the triangle.
E.g. for the side AB, the following relation has to be valid:
with . This means that X and C are on the same side of AB if both scalar products have the same sign.
The walking triangle algorithm checks if X is inside of the the start triangle by applying criterion for each triangle side. If for one triangle side this criterion is not valid, one has to walk to the corresponding neighboring triangle. In this way one walks in this triangle world directly to the triangle containing X.
References
[1] M. Sambridge, J. Braun, and H. McQueen. Geophysical parameterization and interpolation of irregular data using natural neighbors. Geophys. J. Int., 122:837--857, 1995.