THE WALL IS COMING, according to President Trump’s recent movie-poster meme of himself captioned thus. Donald Trump’s Wall has, of course, been long threatened. But in the unlikely event that the prizewinning novelist and literary journalist John Lanchester were given to posting such ridiculous memes of himself, he could at least deliver.

For The Wall is here in the eponymous, scary shape of Lanchester’s fifth novel, which is related by Kavanaugh, a young guard patrolling the vast 10,000-kilometres long, five metres high concrete barrier that has been built around the coast of Britain in some unspecified nightmarish future following a global climate disaster, known as “the Change.” The Wall has been built to keep out the flood of desperate refugees, “the Others”. It is guarded by “the Defenders,” like Kavanaugh, who serve two years on the Wall, working 12-hour shifts. “It’s cold on the Wall,” is the book’s opening sentence. It is also, movingly, its closing sentence.

Lanchester's last novel, the brilliantly Dickensian-cum-Trollopean satire, Capital (2012) is set against the backdrop of the 2008 banking crisis and was adapted for TV. This book is his first dystopian work of fiction. It is also the first of a shelfful of bleak novels offering grim images of the future being published this year, culminating in September with Margaret Atwood’s much-anticipated sequel to The Handmaid’s Tale. The Wall can also be read as an addition to the burgeoning volume of Brexit literature, such as Amanda Craig’s fine The Lie of the Land and Jonathan Coe’s Middle England.

Rather than Brexit, though, was Trump’s “big, beautiful” Wall the genesis of his novel, I ask Lanchester (56), who thinks long and hard before answering questions, when we meet at his publisher’s London offices. (The only interview I have ever come away from with a list of the best places to eat in Edinburgh, where I live and London-based Lanchester does not, as well as instructions to try bere bread baked with Orkney meal. Food is one of his many interests: his first book was 1996‘s glorious The Debt to Pleasure, written in the form of a cookbook.)

“Trump’s wall may have been there subliminally but, no, this book began with a dream,” he responds. “That is not something that has ever happened before with any of my writing, although if I can’t sleep I can’t write. But I had this strong vision of a figure guarding a wall. It was a recurring thing. I was writing another novel, with a large cast of characters and set now, but I abandoned it to write The Wall, because this image forced itself on me. I couldn’t stop thinking about it. It popped out of the unconscious. The book is based on research and yet it is totally imagined. When I was writing, I was thinking what that [future] world would be like rather than what in our world I was drawing on; I was trying to fully imagine this other place.

“I wanted to write about climate change in fiction because I think people are reluctant to think about it. People can’t bear it, which is why David Attenborough’s programmes, say, don’t go there. In a novel you can make people look at the bright light, make them contemplate the world that we are making, the world that we are on track for. For some reason stories are more effective than documentaries that refuse to let us to see that bright light. As James Baldwin said, ‘The way writers change the world is by changing the way people see the world.’ There is research showing fiction has an effect on people’s empathy. As a writer you always hope that that is what you might achieve, that you can affect people’s thinking.”

Is that why he writes fiction? “I’d love to say that is the reason but it is almost like a musical thing, liking language, putting sentences together. Gradually you accumulate other reasons for thinking you should do it. Having children has really had an effect on my thinking about the future,” says Lanchester, who is married to the historian and biographer-turned-novelist Miranda Carter, with whom he has two teenage sons, Finn and Jessie. “You think a lot about the world you will leave behind and that definitely played a role in the feeling in the book. With a novel I write about something that bugs me internally; it is pressing on me and I can’t stop thinking about it and I have to excavate it. I’ve said in the past that writing a book is like having a secret room in your head. The next book is always behind a locked door.”

I tell him I find The Wall, an anxious read -- as is Capital. “I can see that, but it is a different sort of anxiety. I suppose [in Capital] the kind of urban press of people on each other in that sense of a kind of competitive maelstrom of modern capitalist life in a big city, people’s aspirations squeezing against each other, is different from the tone of this. I have been thinking, however, of different kinds of anxiety and fear lately while writing short stories.” (As well as picking up where he left off on the abandoned novel, Lanchester, who writes in his garden shed, is working on a ghost story collection after the New Yorker published, to his immense pleasure, his unsettling, contemporary ghost story, Signal, in March 2017. His first attempt at the genre.)

He pauses for a while, then says thoughtfully: “One of the important distinctions between a general sort of anxiety and apprehension is the fact that with anxiety you think that something bad is going to happen. I think the world of this book is about a sense of apprehension when you feel that the next piece of news is not going to be good news whatever it is. Yes, indeed, it’s the times we live in. I was talking to a bilingual friend about this and he said there is oddly no German word for dread -- there is angst which is just fear. But that is different from the thing coming that you are specifically dreading. I have been thinking about this a lot lately. There is a difference between feeling antsy and ill-at-ease in your skin in the way that a lot of people in the City perhaps do all the time. So I think The Wall is an apprehensive book.”

I ask Lanchester about his own anxiety levels since he has written in his touching Family Romance: A Memoir (2007), of how he grew up in a family with secrets and began to suffer panic attacks after his father’s early death at the age of 57. Lanchester’s Irish mother had been a nun and committed identity fraud in order to marry his father, facts which her son discovered only after her death. He relates in the memoir how his own problems spiralled into agoraphobia.

“Worry is anxiety with an agenda,” he writes in his memoir. “I am much, much less anxious now,” he says cheerfully, adding that he had years of therapy but a happy marriage brought his panic attacks under control. “A very, very happy marriage has certainly helped,” he says. “Good riddance to anxiety, although having a new book coming out can often induce it!”

Born in Hamburg and brought up in Hong Kong -- the setting for his 2002 novel, Fragrant Harbour -- he was educated at boarding school in Norfolk and Oxford University. Now a consulting editor at the London Review of Books, he writes on everything that fascinates him from Bitcoin to Agatha Christie. He has written two non-fiction books, Whoops!: Why everyone owes everyone and no one can pay, about the global financial crisis, and How to Speak Money, a primer in popular economics. Longlisted for the Man Booker Prize, he’s won the Hawthornden, the Whitbread First Novel prizes and the E M Forster Award.

“I have many, many interests,” he admits. What is exercising him at the moment? “Apart from having just enjoyably reread the wonderful collected works of Agatha Christie for an LRB article, I love telly -- the box sets, long-form shows that copy the Victorian serial novel. There is so much good writing on TV nowadays, often better than the novel. I’m a tragic nerd -- a massive, massive fan of Game of Thrones. I have also got very interested in baking sourdough bread. There is something magical about that: the fermentation, the bacteria, the use of these invisible things that are around us all the time. Fermentation is like that line in The Tempest about ‘the invisibleness of the air.’ Quite magical!”

The Wall, by John Lanchester (Faber & Faber, £14.99).