The flames coming out the exhaust indicate that the bike is pumping air/fuel out the exhaust which isn't getting burned, so unless something catastrophic happened to your carbs, like a jet needle falling out - which seems improbable - the bike isn't getting regular plug firing sparks.
This could be a bad ignition coil if it still has the original coil, as the 81-83 years are notorious for the dreaded "crack-o-matic" coil problems - several on this forum have had this issue in the past year or two. Often with the cracked coil syndrome, the bike runs OK until one has a moist/damp day, and then it is dead, but if cracked or burned through they can exhibit other weird symptoms of erratic firing. Another possibility is the ICU, which fires the coil based on the crank position sensor signal - if the wires to the sensor are loose then the ICU will fire the coil intermittently. If it has been rather warm where you are, it might be that the ICU is overheating - the back of the ICU has a metal plate in it, which is supposed to be in intimate contact with a silvery aluminium alloy heatsink that it bolts to. If the heatsink paste has all dried out it might not be able to dissipate enough heat into the alloy heatsink are get too warm and misbehave. Or you may have a loose connection, bad wire in the wiring between the ICU and the coil.
If you haven't ventured under the fuel tank yet, this might be a good opportunity for you to examine the condition of the coil and the ICU under there. this thread will give you some idea of what to look for as far as the coil goes- it could possibly have cracks or little holes were an electrical arc can short to the frame. There are other threads on this somewhere in the tech section, but here is a link to one from me that may help - it talks about the coil and the ICU on my bike:
http://www.bmwr65.org/cgi-bin/yabb2/YaBB.pl?num=1195434246/3#3