dustem_write_gas.pro
2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
PRO dustem_write_gas,file,st,help=help
;+
; NAME:
; dustem_write_gas
;
; PURPOSE:
; writes information relating to gas properties in the
; corresponding .DAT file
;
; CATEGORY:
; DustEMWrap, Distributed, LowLevel, Initialization
;
; CALLING SEQUENCE:
; dustem_write_gas,file,st
;
; INPUTS:
; st : dustem data structure
; file : output file to be written
;
; OPTIONAL INPUT PARAMETERS:
; None
;
; OUTPUTS:
; None
;
; OPTIONAL OUTPUT PARAMETERS:
; None
;
; ACCEPTED KEY-WORDS:
; help : writes this help
;
; COMMON BLOCKS:
; None
;
; SIDE EFFECTS:
; Files are written
;
; RESTRICTIONS:
; The DustEM fortran code must be installed
; The DustEMWrap IDL code must be installed
;
; PROCEDURES AND SUBROUTINES USED:
;
; EXAMPLES:
;
; MODIFICATION HISTORY:
; Evolution details on the DustEMWrap gitlab.
; See http://dustemwrap.irap.omp.eu/ for FAQ and help.
;-
IF keyword_set(help) THEN BEGIN
doc_library,'dustem_write_gas'
goto,the_end
ENDIF
;=== Note about format for DUSTEM_WHICH=RELEASE
;# DUSTEM : Gas quantities from Ysard, Juvela & Verstraete (2011)
;#
;# Gas temperature (K), hydrogen density, H2 density, CR rate, G0 (if>0 supersedes GRAIN.DAT)
;# number of charge type (electrons, H+, C+, ...)
;# ion density (cm-3), mass (amu), charge, polarizability (A^3)
;# >>>>> 1st line is electron <<<<<<<
;#
; 3.5550e+03 1e-1 -1e0 5e-17 1.0000e+00 3
;-1e0 5.4858e-04 -1e0 0.00
;0e0 1.00794e0 1e0 0.67
; -1.3000e-05 12.0107e0 1e0 1.54
Ncomments=n_elements(st.comments)
openw,unit,file,/get_lun
FOR i=0,Ncomments-1 DO BEGIN
printf,unit,st.comments[i]
ENDFOR
frmt='(5E14.6,I4)'
printf,unit,st.Tgas,st.nH,st.nh2,st.CR_rate,st.G0,st.n_charges,format=frmt
frmt='(3E14.6,F5.2)'
FOR i=0L,st.n_charges-1 DO BEGIN
sst=(*st.charges_props)[i]
printf,unit,sst.density,sst.mass,sst.charge,sst.polarizability,format=frmt
;IF !dustem_verbose EQ 1 THEN BEGIN
; print,unit,sst.density,sst.mass,sst.charge,sst.polarizability,format=frmt
;ENDIF
ENDFOR
close,unit
free_lun,unit
;stop
the_end:
END