YAC 3.7.0
Yet Another Coupler
Loading...
Searching...
No Matches
Creating weight files and visualise them
Author
Moritz Hanke (Deutsches Klimarechenzentrum Hamburg)

In order to let YAC write out weight files the writing has to be enabled either through the interface or the configuration file by providing a weight file name.

YAC will write out the weight file in parallel. This parallel output can be configured as described here: Configuration of parallel IO in YAC

coupling:
- src_component: ...
tgt_component: ...
...
field: TAUX
weight_file_name: weights_TAUX.nc
- ...

Visualisation

Paraview

The my_weight_file.nc can be converted to vtk using weights2vtk.x in the src/utils directory

weights2vtk.x -S I -T I -s <source_grid.nc> -t <target_grid.nc> -w my_weight_file.nc -o weights.vtk

weights.vtk can be visualised with paraview.

plot_weights.py

In the tools subdirectory you can find the python program plot_weights.py that can be used to visualise grids and weights files. It can be called as follows

python plot_weights.py source_grid target_grid weight_file

Where source_grid and target_grid follow the grid format (see below) and weight_file is the weight file as generated as above.

It will open a matplotlib plot which shows a visualization of the weight file.

Different grid types are available (see tools/grid_utils.py), including

  • ICON grid ("icon:<file>")
  • GaussianGrid ("(g|G)dx,dy[,lon1,lon2,lat1,lat2]", g = 0-based indexing, G = 1 based indexing. dx,dy are the resolution and lon1,lon2,lat1,lat2 is the extent)
  • HealPix ("[hH]l[rn]", h = 0-based indexing, H = 1-based indexing, l is the level, n = nest, r = ring. See (healpy){https://healpy.readthedocs.io/en/latest/})
  • Fesom grid ("fesom:<file>")
  • Scrip ("scrip:<file>:[<mask>:]<grid>")
  • Dual grid ("dual:<gridspec>")

The format in the brackets denote how to specify the grid at the command line.

To configure the visualization a variaty of options are avaiable. See python plot_weights.py --help for details.