The Blackmar-Diemer Gambit is a very controversial gambit starting with 1.d4 d5 2.e4 dxe4 3.Nc3 intending 3...Nf6 4.f3. You can also play it against the Scandinavian Defence: 1.e4 d5 2.d4!?.
Blackmar's original idea, 3.f3, is ineffective because of 3...e5, so Diemer improved upon the idea by interposing the knight moves 3.Nc3 Nf6, so that if 4.f3 e5?!, 5.dxe5 hits Black's knight on f6.
Black can still play 3...e5 against 3.Nc3, but then I quite like White's chances after 4.Nxe4, which is a significant advantage of having played 3.Nc3 instead of 3.f3.
The main accepted line of the gambit arises after 1.d4 d5 2.e4 dxe4 3.Nc3 Nf6 4.f3 exf3 5.Nxf3. White has an extra developing move and a half-open f-file in return for the sacrificed pawn.
I believe that the Blackmar-Diemer is very dangerous, but of marginal soundness - Black can probably get a theoretical edge against it with precise defence. However, it has what Tim McGrew called a high "caltrop coefficient": White can get some very fine attacking wins if Black goes wrong.
The most popular way for White to meet this is the Studier Attack with Bc4, 0-0, Qe1, Qh4 and Bh6. The typical attacking position is illustrated in the diagram on the left. White aims to play Bh6 and exchange off the bishop on g7, and then follow up with Ng5, setting up some dangerous threats along the f-file.
Black will want to disrupt this attacking plan in some way. In this position, the most reliable response is to play ...Bg4, with the threat of ...Bxf3 followed by ...Qxd4+. After White attends to that threat, Black can aim for ...e7-e5 or ...Qd8-d7-g4.
This diagram illustrates the kind of attacking position that White wants. White is threatening to play Nxd5 or Nce4, threatening to exchange off the knight on f6 and play Qxh7 mate. In the game, Black tried 16...c6, but after 17.Nce4!, White still had a winning attack.
The Studier Attack is very dangerous, but personally I have never been that big a fan, as it's rather inflexible and predictable, and White has been having difficulties getting adequate compensation for the pawn against the aforementioned ...Bg4xf3 idea.
My main recommendation for White against the ...g6 setups is instead to play Bf4, Qd2 and 0-0-0. If Black decides to leave the king in the centre, then White can get good play using the half-open e and f-files, and by playing Bh6 at a good moment, leaving Black's kingside bare.
Thus, Black's most challenging reply to the "Long Bogo" is to play ...Bg7 and ...0-0 immediately (which in practice Black usually does), leading to the position on the left, and to aim for queenside counterplay against the centre and the white king with ...c5, ...a6 and ...b5-b4.
In many lines White can use the standard h-pawn hack with h2-h4-h5, and if Black captures on h5 with a piece, a Rxh5 exchange sacrifice is sometimes strong. However, as White is missing an f-pawn, White should generally play Bh6 before playing h4, because if Black can meet h4 with ...h5, it is then hard to engineer g2-g4, and this takes a lot of the sting out of White's attack. If Black plays ...Bg4 or ...Bf5, then White can refine this plan and play h3 and g4, and then aim for h3-h4-h5.
The diagram on the right is a good illustration of the kind of attacking position that White is after.
The other advantage of this "Long Bogo" plan is that it can be used against pretty much every line that involves an early ...g6.
After 1.d4 d5 2.e4 dxe4 3.Nc3 Nf6 4.f3 e3 5.Bxe3 g6, White's pawn on f3 blocks the f-file, which makes the Studier Attack ineffective, but the approach with Qd2 and 0-0-0 is now stronger, because the pawn on f3 makes it much easier to engineer g4 after h4 and ...h5 are played.
In the diagram, Black can't get away with castling: 7...0-0?! 8.Bh6, followed by h2-h4-h5, is extremely dangerous. Thus Black does best to leave the king in the centre, but then White can go for a slower build-up through the centre.
Another fairly common line is 1.d4 d5 2.e4 dxe4 3.Nc3 Nf6 4.f3 c5 5.d5, which is a reversed Albin Counter-Gambit (1.d4 d5 2.c4 e5), with White having the extra tempo f2-f3.
In this line, White is threatening 6.fxe4 with a good game, so Black now usually plays 5...exf3 6.Nxf3, and then Black's most reliable follow-up is 6...g6 (diagram). Here 7.Bc4?! makes little sense as the pawn on d5 blocks the bishop's path to f7. Thus, play most often transposes into "Long Bogo" lines, viz. 7.Bf4 Bg7 8.Qd2 0-0 9.0-0-0.
After 1.d4 d5 2.e4 dxe4 3.Nc3 Nf6 4.f3 exf3 5.Nxf3, Black can play 5...Bf5 immediately. I believe that this is one of the most critical replies. When Black puts the bishop on this square, a standard plan is to kick the bishop back to g6 by playing g2-g4, and then follow up with Nf3-e5 and h2-h4.
In the line with 5...Bf5, White isn't ready to play 6.g4 at once, so White needs to start with 6.Ne5, intending 7.g4. Most often, play will reach the diagram on the left. White will follow up with Bg2 or Qf3 to disrupt Black's ideas of ...Bb4 followed by ...Be4, and then go for h2-h4. It is generally a good idea to wait until Black plays ...h6 or ...Nbd7 before playing Nxg6.
This position shows the kind of attack that White is looking to build up in the 5...Bf5 6.Ne5 line and similar lines where White kicks the black light squared bishop back to g6. Here White has tempted Black into grabbing the pawn on c2, leaving the bishop rather offside on a4, while White threatens to storm the black king with the kingside pawns (despite having also castled to the kingside!).
I think White generally has good compensation for the pawn in these lines. The main problem with 6.Ne5, although this response is rarely encountered in practice as it looks rather odd, is that 6...c6!? 7.g4 Be6 is hard to crack.
The main alternative, which has been endorsed by Stefan Bücker, is to offer to exchange off the light squared bishops with 6.Bd3. White argues that this trade helps White's development, bringing White a move closer to castling queenside, and removes a useful defensive piece.
It's still debatable if White's lead in development and attacking chances are worth a pawn, but in the diagram position on the right, White has ideas of engineering the disruptive d4-d5 pawn push, and playing Ne5 or Ng5.
The diagram position on the right reflects the kind of chaos that White can hope to generate in this variation.
Black has started a queenside attack, but in the meantime White is attacking through the centre and has the ongoing threat of g4-g5 and ideas of Nh4-f5. The position is rather difficult to assess.
However, practical examples with this 6.Bd3 line have been sparse, as most players have stuck with Diemer's preference 6.Ne5.
Black argues that by playing 1.d4 d5 2.e4 dxe4 3.Nc3 Nf6 4.f3 exf3 5.Nxf3 c6, Black can wait for White to commit the bishop on f1 before playing ...Bf5. If 6.Ne5 Nbd7, 6.Bc4 Bf5, or 6.Bd3 Bg4.
It's worth noting that Black can avoid the 6.Bd3 Bg4 line by playing 4...c6 first, whereupon White's best continuation is 5.Bc4, and then 5...exf3 6.Nxf3 Bf5 transposes to the 6.Bc4 Bf5 line, so 6.Bc4 Bf5 is by far the most important continuation.
Then White most often plays 7.0-0 e6 8.Ne5, but then Black plays 8...Bg6! (diagram). White can refine this idea with 8.Ng5!?, with ideas of sacrificing on e6 or f7, but again after 8...Bg6!, although Black has to defend more accurately here, White still doesn't really have enough.
Thus, after 5...c6 6.Bc4 Bf5, White should probably instead try 7.Bg5, as recommended by Stefan Bücker. Again, the idea is generally to castle queenside, and to tie Black down on the kingside, while threatening the d4-d5 push in various positions.
Then if Black plays something like 7...Nbd7, White continues with 8.Qe2 and 9.0-0-0. If 7...e6, however, 8.Qe2 can be met by 8...Bb4!, which stops 9.0-0-0, as then 9...Bxc3 10.bxc3 would leave White's king exposed. But as 7...e6 stops the bishop on f5 from retreating to e6 or d7, 8.Nh4!? now forces the exchange of this bishop: 8...Bg6 9.Nxg6 hxg6 10.Qd3 (diagram), an idea that comes from Lev Gutman.
In this position Black has to beware of possible sacrifices on e6, and White will continue with 0-0-0, h4 and Rhf1, tying Black down to the defence of f7.
Instead of taking on f3, Black can defend the extra pawn on e4 and develop a piece with 1.d4 d5 2.e4 exd4 3.Nc3 Nf6 4.f3 Bf5. This was David Smerdon's recommendation for Black in Smerdon's Scandinavian, and I think it is equally as critical as the Gunderam and Ziegler Defences. However, White has scored well against it (57%), suggesting that Black's positions aren't that easy to play.
Diemer's preference was 5.fxe4 with the idea 5...Nxe4 6.Qf3 (diagram), attacking the bishop on f5 and knight on e4. Play then most often continues 6...Nd6 7.Bf4 e6 8.0-0-0, where White has reasonable compensation for the pawn. Also after 6...Nxc3 7.bxc3 Qc8 White gets compensation. As pointed out in Smerdon's Scandinavian, though, in that last line 7...e6!? 8.Qxb7 (White has no good way to persist in playing for compensation for a pawn here) Nbd7 allows Black to return the pawn and get a lead in development. White has scored quite well here, as the queen has nuisance value, but objectively Black is better.
Generally when Black meets f2-f3 with ...Bf5, White can kick the bishop immediately with g4, where the g-pawn is supported by the pawn on f3. Then White can regain the pawn with g4-g5 followed by Nxe4, or can try to harass the black light squared bishop again by playing h4.
In the Vienna Defence, I don't particularly like 5.g4 Bg6 6.g5 Nd5 7.Nxe4, regaining the pawn, as to me it isn't really in the spirit of the Blackmar-Diemer Gambit, it leaves Black with a lead in development, and Black also has an interesting gambit in 7...e5!?.
Thus, I am inclined to suggest either 7.Bg2 in that last line, or the double-edged 6.h4, both of which persist in playing for compensation for a pawn. The diagram position probably represents the most critical line arising from 6.h4, where White has a strong centre and open lines and can continue with Nf3, 0-0 and Rb1. Black still has the extra pawn though, and White's king will be draughty.