You don't state what machine and control you're using, so one can only assume...
H1 is usually the tool length comp offset number that gets called by G43. Some folks store the distance from the tip of the tool to part zero in the offsets. Some store the length difference from the "reference" tool.
D31 is usually the radius or diameter compensation offset number that gets called by G41/G42 (later in the program?). If your CAM system outputs the code for cutter centerline, enter the radius or diameter difference between the programmed tool and the actual tool in offset #31. If your CAM system outputs the code for "part profile", enter the radius or diameter of the cutter in offset #31.
S39 could be either a speed "code" (some old machines used codes instead of RPM's). Or more likely you have your CAM system set to output Surface Feet Per Minute, but 39 SFM for a 5/16" endmill is only 477 RPM, so maybe it's a metric value (Surface Meters per Minute)?
Good luck. If you need more help, give us a hint as to what machine and control you're using. Also, it would help if you could post a little more of the program code.