Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In our case, simply drag the wind_speed macro icon to the folder ~/metview/System/Mac­ros. From then on you can call this function from within any of your macros. Note that this only works when the name of the macro file is the same as the name of the function it contains. Remove the include statement from your call_wind_speed macro and see if it still works (it should). If you rename the wind_speed macro, or the function inside it, it should no longer work.

This allows you to build your own personal function library. For a function to be available to other users, you can place the macros with the functions into shared folder on the file system; all users will need to set the environment variable METVIEW_MACRO_PATH to this location before starting Metview. 

Extending the Macro Language

It is possible to write your own C/C++/Fortran code and interface it with Metview Macro. In this way we can write functions in another language and call them directly from a macro, passing variables such as vectors, numbers and fieldsets between them. This is beyond the scope of this training course, but be aware that it is possible! It is currently documented in the 2014 Metview training course.