Hi there,
I'm trying to adapt some code I have been given for running climate simulations to work with Python3.7 on windows 10 using Anaconda (code was written in linux).
I'm getting SyntaxError: unexpected character after line continuation character.
The code in linux looked like this below.
would appreciate any help!
I'm trying to adapt some code I have been given for running climate simulations to work with Python3.7 on windows 10 using Anaconda (code was written in linux).
#select netcdf data file fname_data = 'C:\Users\Jodman\Documents\data\' + model + '\' + exp_id + '\' + variable + '\' + variable + '_day_' + model + '_' + exp_id + '_r1i1p1_20051201-20991230.nc' #load data file as cube cube = iris.load(fname_data)The code is trying to select different climate models and various variables as shown below:
#define model and experiment of choice model = 'HadGEM2-CC' #HadGEM2-CC or HadGEM2-ES exp_id = 'rcp45' #rcp45 or rcp85 variable = 'ua' # ua, tas or zg if(variable == 'tas'): unit = 'K' if(variable == 'ua'): unit = 'm/s' if(variable == 'zg'): unit = 'm' sel_lev = 5000 #Pa #5000 or 1000
I'm getting SyntaxError: unexpected character after line continuation character.
The code in linux looked like this below.
#select netcdf data file fname_data = '/nfs/jack/earataj/Jody/data/' + model + '/' + exp_id + '/' + variable + '/' + variable + '_day_' + model + '_' + exp_id + '_r1i1p1_20051201-20991230.nc'I've tried to adapt the windows script by changing the / to \ but have come to a dead end.
would appreciate any help!