0001 function remnum = select_remote_profile_yp(remprofile,dkepath)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 if nargin == 0,
0019 remprofile = '';
0020 dkepath = '';
0021 end
0022
0023 if nargin == 1,
0024 dkepath = '';
0025 end
0026
0027 if isempty(dkepath) || ~isstruct(dkepath),
0028 dkepath = load_structures_yp('dkepath','','');
0029 end
0030
0031 if ~isempty(remprofile),
0032
0033 if strfind(remprofile,'local'),
0034 remnum = 0;
0035 else
0036
0037 remlist = [];
0038
0039 for irem = 1:length(dkepath.remote),
0040 if strfind(dkepath.remote(irem).host,remprofile),
0041 remlist = [remlist,irem];
0042 end
0043 end
0044
0045 if isempty(remlist),
0046 disp(['WARNING: no remote profile for ''',remprofile,'''']);
0047 disp(['---> Interactive choice enforced for choosing the remote profile']);
0048 remlist = [];
0049 end
0050
0051 end
0052 else
0053 remlist = [];
0054 end
0055
0056 if exist('remlist','var')
0057
0058 flag_remote = check_remote_yp(dkepath,remlist,0,'');
0059
0060 if ~isempty(find([1:length(flag_remote)].*flag_remote > 0)),
0061 if isempty(remlist), remlist = 1:length(flag_remote);end
0062 remnum = remlist(input_dke_yp('Please identify the profile to be used for the simulation.',find(remlist.*flag_remote > 0),find(remlist.*flag_remote > 0)));
0063 else
0064 remnum = 0;
0065 disp('WARNING: Local calculation enforced.');
0066 end
0067 end