Install: copy all files in a directory in Matlab (i.e. work), keeping the directory structure as on the cd Start program: cd to the casa directory, and type 'casa' in the command window. Change spinup years etc in 'defineConstants' Changes: - many, many small ones, but most importantly: - each gridcell consist of a woody and herbaceous fraction, with different turnover times - no more loops: see below % avoiding loops: when one has to check, for example, that an array does % not contain values that are zero, it is easiest to do it like this: array = rand(10000,1); % create an array of 10000 rows by 1 column array with random values [x,y] = size(array); for i=1:x if array(i,1) == 0 array(i,1) = 1; end end % the problem is that this is slow in matlab (and IDL as well), so there are ways around it io = (array == 0); % this returns an array (io) with ones where there are zero values in 'array' array(io) = 1; % replace the zeros in these locations with ones % or even shorter: array(array==0) = 1; % this does make a big difference in processortime: let's do it 100 times: tic for i=1:100 for i=1:x if array(i,1) == 0 array(i,1) = 1; end end end disp(['with loop: ',num2str(toc),' seconds']) tic for i=1:100 array(array==0) = 1; end disp(['without loop: ',num2str(toc),' seconds']) % this gives on my computer: % with loop: 2.032 seconds % without loop: 0.016 seconds