'reinit' 'open ../data/sst/ssta.ctl' 'set display color white' 'c' 'set csmooth on' 'set mpdset hires' 'set poli on' * DEFINING THE LIMITS OF THE TARGETED AREA lon1=-25.0 lon2=-15.0 lat1=62.5 lat2=67.5 * Creating the time series of the variable over the defined arae * the value 612 must be <= number of total month (last record of time in the CTL file * the variable serie is monthly and include all the 612 months 'set t 1 612' 'define serie=tloop(aave(ssta,lon='lon1',lon='lon2',lat='lat1',lat='lat2'))' * Displaying the time series from the beggining to the end 'set grid on' 'set lon 2' 'set lat 2' 'set grads off' 'set cthick 7' 'd serie' * WRITING the TIME SERIES IN A TEXT FILE * PS re-actualize the value 612 f=1 'set t 1' g=1 while(g<=612) 'set lon 2' 'set lat 2' 'set t 'g 'd serie' out1=sublin(result,1);out1=subwrd(out1,4) var.1.f=out1 'set t 'g+1 'd serie' out1=sublin(result,1);out1=subwrd(out1,4) var.2.f=out1 'set t 'g+2 'd serie' out1=sublin(result,1);out1=subwrd(out1,4) var.3.f=out1 g=g+12 f=f+1 endwhile * put the name of the text file between the quotes g=1 while(g<=50) res=write('serie1+2.txt',(var.1.g+var.2.g)/2) res=write('serie1.txt',var.1.g) res=write('serie2.txt',var.2.g) g=g+1 endwhile