Skip to content
Snippets Groups Projects
Commit 14f0bd30 authored by Olivier Sauter's avatar Olivier Sauter
Browse files

added eqdsk for JET

git-svn-id: https://spcsvn.epfl.ch/repos/TCV/gdat/trunk@7753 d63d8f72-b253-0410-a779-e742ad2e26cf
parent 0c3f4fcb
No related branches found
No related tags found
No related merge requests found
...@@ -664,66 +664,45 @@ elseif strcmp(mapping_for_jet.method,'switchcase') ...@@ -664,66 +664,45 @@ elseif strcmp(mapping_for_jet.method,'switchcase')
else else
gdat_data.gdat_params.zshift = zshift; gdat_data.gdat_params.zshift = zshift;
end end
gdat_data.gdat_params.zshift = zshift; if abs(zshift-1) <= 1e-6
for itime=1:length(time) zshift_eff = -99;
time_eff = time(itime); else
% use read_results updated to effectively obtain an eqdsk with sign correct with COCOS=2 zshift_eff = zshift;
[fnames_readresults]=read_results_for_chease(shot,time_eff,liuqe_version,3,[],[],[],zshift,0,1); end
if isempty(fnames_readresults) [efitdata,eqd]=geteqdskJET(shot,time,[],[],[],zshift_eff);
if gdat_params.nverbose>=1; if length(time) > 1
warning(['could not create eqdsk file from read_results_for_chease with data_request= ' data_request_eff]); gdat_data.eqdsk = eqd;
end for itime=1:length(time)
return
end
eqdskval=read_eqdsk(fnames_readresults{4},7,0,[],[],1); % LIUQE is 17 but read_results divided psi by 2pi thus 7
for i=1:length(fnames_readresults)
unix(['rm ' fnames_readresults{i}]);
end
% transform to cocos=2 since read_results originally assumed it was cocos=2
cocos_in = 2;
[eqdsk_cocos_in, eqdsk_cocosout_IpB0pos,cocos_inout]=eqdsk_cocos_transform(eqdskval,[7 cocos_in]);
fnamefull = fullfile(['/tmp/' getenv('USER')],['EQDSK_' num2str(shot) 't' num2str(time_eff,'%.4f')]);
% We still write COCOS=2 case, since closer to standard (in /tmp)
write_eqdsk(fnamefull,eqdsk_cocos_in,cocos_in,[],[],[],1);
% Now gdat_jet should return the convention from LIUQE which is COCOS=17, except if specified in option
% create standard filename name from shot, time_eff (cocos will be added by write_eqdsk)
cocos_out = 17;
if isfield(gdat_data.gdat_params,'cocos') && ~isempty(gdat_data.gdat_params.cocos)
cocos_out = gdat_data.gdat_params.cocos;
else
gdat_data.gdat_params.cocos = cocos_out;
end
[eqdsk_cocosout, eqdsk_cocosout_IpB0pos,cocos_inout]=eqdsk_cocos_transform(eqdsk_cocos_in,[cocos_in cocos_out]);
% for several times, use array of structure for eqdsks,
% cannot use it for psi(R,Z) in .data and .x since R, Z might be different at different times,
% so project psi(R,Z) on Rmesh, Zmesh of 1st time
if length(time) > 1
gdat_data.eqdsk{itime} = write_eqdsk(fnamefull,eqdsk_cocosout,cocos_out);
if itime==1 if itime==1
gdat_data.data(:,:,itime) = gdat_data.eqdsk{itime}.psi; gdat_data.data(:,:,itime) = gdat_data.eqdsk{itime}.psi;
gdat_data.dim{1} = gdat_data.eqdsk{itime}.rmesh; gdat_data.dim{1} = gdat_data.eqdsk{itime}.rmesh;
gdat_data.dim{2} = gdat_data.eqdsk{itime}.zmesh; gdat_data.dim{2} = gdat_data.eqdsk{itime}.zmesh;
else else
% for several times, use array of structure for eqdsks,
% cannot use it for psi(R,Z) in .data and .x since R, Z might be different at different times,
% so project psi(R,Z) on Rmesh, Zmesh of 1st time
xx=repmat(reshape(gdat_data.dim{1},length(gdat_data.dim{1}),1),1,size(gdat_data.eqdsk{itime}.psi,2)); xx=repmat(reshape(gdat_data.dim{1},length(gdat_data.dim{1}),1),1,size(gdat_data.eqdsk{itime}.psi,2));
yy=repmat(reshape(gdat_data.dim{2},1,length(gdat_data.dim{2})),size(gdat_data.eqdsk{itime}.psi,1),1); yy=repmat(reshape(gdat_data.dim{2},1,length(gdat_data.dim{2})),size(gdat_data.eqdsk{itime}.psi,1),1);
aa = interpos2Dcartesian(gdat_data.eqdsk{itime}.rmesh,gdat_data.eqdsk{itime}.zmesh ... aa = interpos2Dcartesian(gdat_data.eqdsk{itime}.rmesh,gdat_data.eqdsk{itime}.zmesh ...
,gdat_data.eqdsk{itime}.psi,xx,yy,-1,-1); ,gdat_data.eqdsk{itime}.psi,xx,yy,-1,-1);
gdat_data.data(:,:,itime) = aa; gdat_data.data(:,:,itime) = aa;
end end
else
gdat_data.eqdsk = write_eqdsk(fnamefull,eqdsk_cocosout,cocos_out);
gdat_data.data = gdat_data.eqdsk.psi;
gdat_data.dim{1} = gdat_data.eqdsk.rmesh;
gdat_data.dim{2} = gdat_data.eqdsk.zmesh;
end end
else
gdat_data.eqdsk = eqd{1};
gdat_data.data = gdat_data.eqdsk.psi;
gdat_data.dim{1} = gdat_data.eqdsk.rmesh;
gdat_data.dim{2} = gdat_data.eqdsk.zmesh;
end end
gdat_data.dim{3} = gdat_data.t; gdat_data.dim{3} = gdat_data.t;
gdat_data.x = gdat_data.dim(1:2); gdat_data.x = gdat_data.dim(1:2);
gdat_data.data_fullpath=['psi(R,Z) and eqdsk from read_eqdsk from LIUQE' num2str(liuqe_version) ';zshift=' num2str(zshift)]; gdat_data.data_fullpath=['psi(R,Z) and eqdsk from geteqdskJET from efit ; zshift=' num2str(zshift)];
gdat_data.units = 'T m^2'; gdat_data.units = 'T m^2';
gdat_data.dimunits = {'m','m','s'}; gdat_data.dimunits = {'m','m','s'};
gdat_data.request_description = ['data=psi, x=(R,Z), eqdsk contains eqdsk structure with which ' ... gdat_data.request_description = ['data=psi, x=(R,Z), eqdsk contains eqdsk structure with which ' ...
'plot_eqdsk, write_eqdsk, read_eqdsk can be used']; 'plot_eqdsk, write_eqdsk, read_eqdsk can be used'];
% data loaded to create eqdsks, can be used in geteqdskJET for other times to avoid to reload all
gdat_data.efitdata = efitdata;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case {'mhd'} case {'mhd'}
......
...@@ -31,7 +31,7 @@ help_struct_all = struct(... ...@@ -31,7 +31,7 @@ help_struct_all = struct(...
% $$$ ' good value' char(10) ... % $$$ ' good value' char(10) ...
% $$$ 'cxrs: if numeric, default for all cases, if structure, default for non given fields']; % $$$ 'cxrs: if numeric, default for all cases, if structure, default for non given fields'];
help_struct_all.time = 'time(s) value(s) if relevant, for example eqdsk is provided by default only for time=1.0s'; help_struct_all.time = 'time(s) value(s) if relevant, for example eqdsk is provided by default only for time=1.0s';
% $$$ help_struct_all.zshift = 'vertical shift of equilibrium, either for eqdsk (1 to shift to zaxis=0) or for mapping measurements on to rho surfaces [m]'; help_struct_all.zshift = 'vertical shift of equilibrium, either for eqdsk (1 or -99 to shift to zaxis=0) or for mapping measurements on to rho surfaces [m]';
help_struct_all.cocos = ['cocos value desired in output, uses eqdsk_cocos_transform. Note should use latter if a specific Ip and/or B0 sign' ... help_struct_all.cocos = ['cocos value desired in output, uses eqdsk_cocos_transform. Note should use latter if a specific Ip and/or B0 sign' ...
'is wanted. See O. Sauter et al Comput. Phys. Commun. 184 (2013) 293']; 'is wanted. See O. Sauter et al Comput. Phys. Commun. 184 (2013) 293'];
% $$$ help_struct_all.edge = '0 (default), 1 to get edge Thomson values'; % $$$ help_struct_all.edge = '0 (default), 1 to get edge Thomson values';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment