GENIE:GENIEToolboxExampleParamSweep

% Example ensemble study

% Load the default model configuration [configuration, runtime.EXPID] = genie_eb_go_gs_config; % Run the model for 2000 years configuration.genie_main.Parameter.GENIE_CONTROL_NML.koverall_total=1000000; % Change embm output periods configuration.genie_embm.Parameter.npstp_embm=500000; configuration.genie_embm.Parameter.iwstp=500000; configuration.genie_embm.Parameter.itstp=100; configuration.genie_embm.Parameter.ianav=500000; % Change goldstein output periods configuration.genie_goldstein.Parameter.npstp_goldstein=500000; configuration.genie_goldstein.Parameter.iwstp=500000; configuration.genie_goldstein.Parameter.itstp=100; configuration.genie_goldstein.Parameter.ianav=500000; % Change seaice output periods configuration.genie_seaice.Parameter.npstp_seaice=500000; configuration.genie_seaice.Parameter.iwstp=500000; configuration.genie_seaice.Parameter.itstp=100; configuration.genie_seaice.Parameter.ianav=500000;

% Specify the model runtime runtime.RuntimeArchive    = './rel-2-1-0/genie_eb_go_gs_archive.zip'; runtime.RuntimeArchiveTool = './rel-2-1-0/unzip.exe'; runtime.LocalRunDir       = './output';

% Load the resource description metadata resource = createResource('NGSSoton'); resource.RemoteRunDir='/home/andrew'; resource.shareuncpath='\\sb-node002.soton.ac.uk\andrew';

% Define the parameter range over which the model will be evaluated NJobs = 21; SclFWF = linspace(0.0, 2.0, NJobs);

% Submit the compute jobs that make up the ensemble if ~exist('handles.mat','file')
 * for index=1:NJobs
 * runtime.LocalRunDirUniq = ['./output/', num2str(index,'%02d')];
 * configuration.genie_embm.Parameter.SclFWF=SclFWF(index);
 * [handle, retrieve] = gc_jobsubmit(configuration, runtime, resource);
 * JobDetail{index}.handle  = handle;
 * JobDetail{index}.retrieve = retrieve;
 * end
 * save handles JobDetail

else
 * load('handles');

end

% Poll the job handles until all simulations are complete running=ones(1,NJobs); while sum(running)
 * for index=1:NJobs
 * status = gc_jobstatus(JobDetail{index}.handle);
 * if status >= 3
 * running(index) = 0;
 * end
 * end
 * pause(30)

end

% Retrieve the output for each job for index=1:NJobs
 * [success, resultsFiles] = gc_jobretrieve(JobDetail{index}.retrieve);

end

% Plot the results for index=1:21
 * load(['./output/' num2str(index,'%02d') '/spn.opsit']);
 * moc(index)=spn(end,5);

end plot(SclFWF, moc, 'o-') xlabel('FWF Scaling factor') ylabel('Atlantic MOC (Sv)') title('Example parametric study of genie\_eb\_go\_gs')