168
170
call fdf_init(filein,trim(fileout))
171
! Read special variables from the command line
173
! Read command line flags from the command line
172
174
count = command_argument_count()
176
! When we are not using pipes we have to skip the last argument
177
if ( .not. is_pipe ) count = count - 1
173
179
if ( count > 0 ) then
175
do while ( in <= count - 1 )
177
call get_command_argument(in,line,length)
179
! If it is not an option, skip it
180
if ( line(1:1) /= '-' ) cycle
182
do while ( line(1:1) == '-' )
186
! We allow these line
187
if ( line(1:3) == 'fdf' ) then
188
if ( in >= count - 1 ) &
189
call die('Missing argument on command line, -fdf')
191
call get_command_argument(in,line,length)
193
! We allow these variations:
197
line = cmd_tokenize(line)
198
call fdf_overwrite(line)
200
else if ( line(1:1) == 'V' ) then
201
if ( in >= count - 1 ) &
202
call die('Missing argument on command line, -V')
204
call get_command_argument(in,line,length)
205
line = cmd_tokenize(line)
206
line = 'TBT.Voltage '//trim(line)
207
call fdf_overwrite(line)
209
else if ( line(1:1) == 'D' ) then
210
if ( in >= count - 1 ) &
211
call die('Missing argument on command line, -D')
213
call get_command_argument(in,line,length)
214
line = 'TBT.Directory '//trim(line)
215
call fdf_overwrite(line)
217
else if ( line(1:2) == 'HS' ) then
218
if ( in >= count - 1 ) &
219
call die('Missing argument on command line, -HS')
221
call get_command_argument(in,line,length)
222
line = 'TBT.HS '//trim(line)
223
call fdf_overwrite(line)
225
else if ( line(1:1) == 'L' ) then
226
if ( in >= count - 1 ) &
227
call die('Missing argument on command line, -L')
229
call get_command_argument(in,line,length)
230
line = cmd_tokenize(line)
231
line = 'SystemLabel '//trim(line)
232
call fdf_overwrite(line)
234
else if ( line(1:4) == 'help' .or. line(1:1) == 'h' ) then
235
write(*,'(a)') 'Help for calling the tight-binding transport code'
236
write(*,'(a)') ' -out <file>'
237
write(*,'(a)') ' Write all output to <file> instead of STDOUT'
238
write(*,'(a)') ' -fdf <label>=<value>[:<unit>]'
239
write(*,'(a)') ' Set the label to the corresponding value.'
240
write(*,'(a)') ' -V <value>:<unit>'
241
write(*,'(a)') ' Short-hand for setting TBT.Voltage'
242
write(*,'(a)') ' -D <directory>'
243
write(*,'(a)') ' Short-hand for setting TBT.Directory'
244
write(*,'(a)') ' -HS <Hamiltonian>'
245
write(*,'(a)') ' Short-hand for setting TBT.HS'
246
write(*,'(a)') ' -L <name>'
247
write(*,'(a)') ' Short-hand for setting SystemLabel'
248
write(*,'(a)') ' <fdf-file>'
249
write(*,'(a)') ' Use file as fdf-input, you need not to pipe it in.'
250
call bye('Help-menu requested, stopping')
181
do while ( in <= count )
183
call get_command_argument(in,line,length)
185
! If it is not an option, skip it
186
if ( line(1:1) /= '-' ) cycle
188
do while ( line(1:1) == '-' )
192
! We allow these line
193
if ( line(1:3) == 'fdf' ) then
195
call die('Missing argument on command line, -fdf')
197
call get_command_argument(in,line,length)
199
! We allow these variations:
203
line = cmd_tokenize(line)
204
call fdf_overwrite(line)
206
else if ( line(1:1) == 'V' ) then
208
call die('Missing argument on command line, -V')
210
call get_command_argument(in,line,length)
211
line = cmd_tokenize(line)
212
line = 'TBT.Voltage '//trim(line)
213
call fdf_overwrite(line)
215
else if ( line(1:1) == 'D' ) then
217
call die('Missing argument on command line, -D')
219
call get_command_argument(in,line,length)
220
line = 'TBT.Directory '//trim(line)
221
call fdf_overwrite(line)
223
else if ( line(1:2) == 'HS' ) then
225
call die('Missing argument on command line, -HS')
227
call get_command_argument(in,line,length)
228
line = 'TBT.HS '//trim(line)
229
call fdf_overwrite(line)
231
else if ( line(1:1) == 'L' ) then
233
call die('Missing argument on command line, -L')
235
call get_command_argument(in,line,length)
236
line = cmd_tokenize(line)
237
line = 'SystemLabel '//trim(line)
238
call fdf_overwrite(line)
240
else if ( line(1:4) == 'help' .or. line(1:1) == 'h' ) then
241
write(*,'(a)') 'Help for calling the tight-binding transport code'
242
write(*,'(a)') ' -out <file>'
243
write(*,'(a)') ' Write all output to <file> instead of STDOUT'
244
write(*,'(a)') ' -fdf <label>=<value>[:<unit>]'
245
write(*,'(a)') ' Set the label to the corresponding value.'
246
write(*,'(a)') ' -V <value>:<unit>'
247
write(*,'(a)') ' Short-hand for setting TBT.Voltage'
248
write(*,'(a)') ' -D <directory>'
249
write(*,'(a)') ' Short-hand for setting TBT.Directory'
250
write(*,'(a)') ' -HS <Hamiltonian>'
251
write(*,'(a)') ' Short-hand for setting TBT.HS'
252
write(*,'(a)') ' -L <name>'
253
write(*,'(a)') ' Short-hand for setting SystemLabel'
254
write(*,'(a)') ' <fdf-file>'
255
write(*,'(a)') ' Use file as fdf-input, you need not to pipe it in.'
256
call bye('Help-menu requested, stopping')
257
263
! Initialize the verbosity setting
258
call init_verbosity('TBT.Verbosity',5)
264
call init_verbosity('TBT.Verbosity', 5)
260
266
! Define Name of the system ...
261
267
sname = fdf_get('SystemName',' ')