Note: You can now use:
mdsconnect,'transpgrid.pppl.gov'
mdsopen,'transp_<TOKAMAK>',<MDS-ID>
where <MDS-ID> = transplated <RUNID>
- or -
sts = pppl_transp_open('<RUNID>','<TOKAMAK>',<YEAR>)
e.g.:
sts=pppl_transp_open('111370A01','NSTX',03)
If you want to switch between TRANSP runs at PPPL and other Servers, you can do this efficiently by keeping all connections open, and switching between the connection sockets, as explained below. Otherwise you must add force=1 to pppl_transp_open, to force starting a new connection each time.
sts=pppl_transp_open('108918A20','NSTX',02, force=1)
; connect/open TRANSP Tree
;
transp_socket=0
sts=pppl_transp_open('37065Y06','tftr',88,socket=transp_socket)
...
; read TRANSP data
...
; now connect to NSTX Tree for EFIT
;
; save server context
!MDS_SOCKET=-1
; connect to server
mdsconnect,'birch.pppl.gov:8501'
; save socket
efit_socket = !MDS_SOCKET
; open tree
mdsopen,...
....
; read EFIT data
...
; switch back to TRANSP
!MDS_SOCKET=transp_socket
...
; or open a different TRANSP run
;
; re-connect/open
sts=pppl_transp_open('108918A20','nstx',02)
...
...
; switch back to NSTX Tree for EFIT
!MDS_SOCKET=efit_socket
...
mdstcl,'dir'
mdstcl,'dir .transp_out:*'
mdstcl,'dir .transp_out:cur:*'
mdstcl,'decompile .transp_out:cur:rplabel'
mdstcl,'dir .inputs:*'
labels = mdsvalue('getnci(".inputs:*:label","record")')
ufiles = mdsvalue('getnci(".inputs:*:filename","record")')
;Read Q on Axis
q0=mdsvalue('.transp_out:q0')
help,q0
;Read Time axis
t1=mdsvalue('dim_of(.transp_out:q0)')
help,t1
;Read Time axis (for 2D profiles, Time is 2nd dimension)
t=mdsvalue('dim_of(.transp_out:cur,1)')
help,t
;Read time units
tu=mdsvalue('units_of(dim_of(.transp_out:q0))')
print,tu
plot,t1,q0,title=label,xtitle=tu
;Read plasma current
cur=mdsvalue('.transp_out:cur')
help,cur
;Read Time axis (for 2D profiles, Time is 2nd dimension)
t2=mdsvalue('dim_of(.transp_out:cur,1)')
help,t2
;Read X axis
x=mdsvalue('dim_of(.transp_out:cur)')
help,x
:Read rplot label
label=mdsvalue('.transp_out:cur:rplabel')
print,label
;Read units of current
units=mdsvalue('units_of(.transp_out:cur)')
print,units
;Read time units
tu=mdsvalue('units_of(dim_of(.transp_out:cur,1))')
print,tu
surface,cur,x,t2,title=label,ztitle=units,ytitle=tu
;Read plasma current scalars
sclab=mdsvalue('.inputs:CUR:SCLAB')
scval=mdsvalue('.inputs:CUR:SCVAL')
print,sclab
print,scval
;Read current
cur=mdsvalue('.inputs:cur')
help,cur
;Read time axis
time=mdsvalue('dim_of(.inputs:cur)')
help,time
;Read label
label=mdsvalue('.inputs:cur:label')
print,label
;Read units
cu=mdsvalue('units_of(.inputs:cur)')
print,cu
;Read units of time axis
tu=mdsvalue('units_of(dim_of(.inputs:cur))')
print,tu
plot,time,cur,title=label,ytitle=cu,xtitle=tu
;Read measured Plasma current
pcur=mdsvalue('.transp_out:pcur')
oplot,t1,pcur,psym=4