Blame view

src/idl/dustem_write_grain_release.pro 3.25 KB
eafc1f8f   Annie Hughes   updated help info
1
PRO dustem_write_grain_release,file,st,help=help
73acf100   Annie Hughes   First commit
2

eafc1f8f   Annie Hughes   updated help info
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
;+
; NAME:
;   dustem_write_grain_release
;
; PURPOSE:
;   writes information relating to grain parameters to the .DAT files 
;
; CATEGORY:
;    DustEMWrap, Distributed, LowLevel, Initialization
;
; CALLING SEQUENCE:
;   dustem_write_grain_release,dir,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_grain_release'
     goto,the_end
  ENDIF
  
  
da01e0aa   Annie Hughes   comments editing ...
57
;Remark: It is a bit odd that this is using both st and (*!dustem_params)
73acf100   Annie Hughes   First commit
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
97
98
99
100
;Remark: This should use automated comment detection, as in dustem_write_gas.pro

;stop

Ncomments=100
c=strarr(Ncomments)

ii=0L
c(ii)='# DUSTEM: definition of grain populations' & ii=ii+1
c(ii)='# for each grain TYPE make sure you have the following files' & ii=ii+1
c(ii)='# Q_TYPE.DAT in code_f90/les_QABS' & ii=ii+1
c(ii)='# C_TYPE.DAT in code_f90/les_CAPA' & ii=ii+1
c(ii)='# if option(MIX) MIX_TYPE.DAT in code_f90/les_DAT' & ii=ii+1
c(ii)='# if option(POL) POL_TYPE.DAT in code_f90/les_DAT' & ii=ii+1
c(ii)='# if option(DTLS) DTLS_TYPE.DAT in code_f90/les_DAT' & ii=ii+1
c(ii)='# if keyword(SIZE) SIZE_TYPE.DAT in code_f90/les_DAT' & ii=ii+1
c(ii)='# Written by the DUSTEM IDL Wrapper: dustem_write_grain_release.pro' & ii=ii+1
c(ii)='#' & ii=ii+1
c(ii)='# run keywords' & ii=ii+1
c(ii)='# G0 scaling factor for radiation field' & ii=ii+1
c(ii)='# grain type, nsize, type keywords, Mdust/MH, rho, amin, amax, alpha/a0 [, at, ac, gamma (ED)] [, au, zeta, eta (CV)]' & ii=ii+1
c(ii)='# cgs units' & ii=ii+1
c(ii)='#' & ii=ii+1
Ncomments=ii
c=c(0:Ncomments-1)

openw,unit,file,/get_lun

FOR i=0,Ncomments-1 DO BEGIN
  printf,unit,c(i)
ENDFOR
;stop

printf,unit,(*!dustem_params).keywords
printf,unit,(*!dustem_params).G0
;printf,unit,(*!dustem_params).ngrains
;===== JPB: updating for longer keywords
;frmt='(A12,I4,A12,11E14.6)'
;frmt='(A12,I4,A20,11E14.6)'
;frmt='(A20,I4,A20,11E14.6)'
frmt='(A25,I4,A20,11E14.6)'
;frmt='(A30,I4,A25,11E14.6)'

a8bf7c1c   Annie Hughes   minor changes
101
102
;stop

73acf100   Annie Hughes   First commit
103
FOR i=0L,(*!dustem_params).ngrains-1 DO BEGIN
a8bf7c1c   Annie Hughes   minor changes
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
   printf,unit,st(i).grain_type, $
          st(i).nsize, $
          st(i).type_keywords, $
          st(i).mdust_o_mh, $
          st(i).rho, $
          st(i).amin, $
          st(i).amax, $
          st(i).alpha_o_a0, $
          st(i).at, $
          st(i).ac, $
          st(i).gamma, $
          st(i).au, $
          st(i).zeta, $
          st(i).eta, $
          format=frmt
   IF !dustem_verbose EQ 1 THEN BEGIN
    ;stop
73acf100   Annie Hughes   First commit
121
122
123
124
125
126
127
128
129
    print,st(i).grain_type,st(i).nsize,st(i).type_keywords,st(i).mdust_o_mh,st(i).rho,st(i).amin,st(i).amax, $
              st(i).alpha_o_a0, st(i).at,st(i).ac,st(i).gamma,st(i).au,st(i).zeta,st(i).eta,format=frmt
  ENDIF
ENDFOR

close,unit
free_lun,unit


eafc1f8f   Annie Hughes   updated help info
130
the_end:
73acf100   Annie Hughes   First commit
131
END