LIS3MDL Magnetometer Calibration

The calibration parameters go in your code.

You may find this post, which describes a more effective approach, to be useful: Correcting the Balboa magnetometer