Go to the documentation of this file.
26 character(len=*),
parameter :: LIBVERSION = version_macro
53 character(len=9),
public,
parameter ::
io_nullfile =
"/dev/null"
54 character(len=6),
public,
parameter ::
io_stdout =
"STDOUT"
62 logical,
public ::
io_l = .false.
70 character(len=6),
public ::
io_jobid =
"UNKNWN"
82 integer,
private,
parameter :: io_minfid = 10
83 integer,
private,
parameter :: io_maxfid = 256
96 namelist / param_io / &
106 character(len=*),
intent(in) :: appname
107 character(len=*),
intent(in),
optional :: conf_name
108 logical,
intent(in),
optional :: allow_noconf
110 character(len=H_LONG) :: fname
115 if (
present(conf_name) )
then
127 h_libname =
'SCALE Library ver. '//trim(libversion)
135 log_error(
'IO_setup',*)
'Not appropriate names in namelist PARAM_IO . Check!'
150 integer,
intent(in) :: myrank
151 logical,
intent(in) :: is_master
153 namelist / param_io / &
162 character(len=H_LONG) :: fname
170 if ( is_master )
then
192 file = trim(fname), &
193 form =
'formatted', &
195 if ( ierr /= 0 )
then
196 log_error(
'IO_LOG_setup',*)
'File open error! :', trim(fname)
207 write(
io_fid_log,*)
' .+++++++++++++++++++++++ '
208 write(
io_fid_log,*)
' +++++++++++++++++++++++++ '
209 write(
io_fid_log,*)
' +++++++++++++++++++++++++++ '
210 write(
io_fid_log,*)
' =++++++=x######+++++++++++++; '
211 write(
io_fid_log,*)
' .++++++X####XX####++++++++++++ '
212 write(
io_fid_log,*)
' =+xxx=, ++++ +++++=##+ .###++++++++++- '
213 write(
io_fid_log,*)
' ,xxxxxxxxxx- +++++.+++++=## .##++++++++++ '
214 write(
io_fid_log,*)
' xxxxxxxxxxxxx -+++x#;+++++#+ ##+++++++++. '
215 write(
io_fid_log,*)
' xxxxxxxx##xxxx, ++++# +++++XX #+++++++++- '
216 write(
io_fid_log,*)
' xxxxxxx####+xx+x ++++#.++++++# #+++++++++ '
217 write(
io_fid_log,*)
' +xxxxxX#X #Xx#= =+++#x=++++=#. x=++++++++ '
218 write(
io_fid_log,*)
' xxxxxx#, x### .++++#,+++++#= x++++++++ '
219 write(
io_fid_log,*)
' xxxxxx#. ++++# +++++x# #++++++++ '
220 write(
io_fid_log,*)
' xxxxxx+ ++++#-+++++=# #++++++++ '
221 write(
io_fid_log,*)
',xxxxxX -+++XX-+++++#, +++++++++ '
222 write(
io_fid_log,*)
'=xxxxxX .++++#.+++++#x -++++++++ '
223 write(
io_fid_log,*)
'+xxxxx= ++++#.++++++# ++++++++# '
224 write(
io_fid_log,*)
'xxxxxx; ++++#+=++++=# ++++++++# '
225 write(
io_fid_log,*)
'xxxxxxx ,+++x#,+++++#- ;++++++++- '
226 write(
io_fid_log,*)
'#xxxxxx +++=# +++++xX ++++++++# '
227 write(
io_fid_log,*)
'xxxxxxxx ++++#-+++++=# +++++++++X '
228 write(
io_fid_log,*)
'-+xxxxxx+ ++++X#-++++=#. -++; =++++++++# '
229 write(
io_fid_log,*)
' #xxxxxxxx. .+++++# +++++#x =++++- +++++++++XX '
230 write(
io_fid_log,*)
' #xxxxxxxxxx=--=++++++#.++++++# ++++++ -+++++++++x# '
231 write(
io_fid_log,*)
' #+xxxxxxxxxx+++++++#x=++++=# ++++++;=+++++++++++x# '
232 write(
io_fid_log,*)
' =#+xxxxxxxx+++++++##,+++++#= =++++++++++++++++++##. '
233 write(
io_fid_log,*)
' X#xxxxxxxx++++++## +++++x# ;x++++++++++++++++##. '
234 write(
io_fid_log,*)
' x##+xxxx+++++x## +++++=# ##++++++++++++x##X '
235 write(
io_fid_log,*)
' ,###Xx+++x###x -++++=#, .####x+++++X####. '
236 write(
io_fid_log,*)
' -########+ -#####x .X#########+. '
239 write(
io_fid_log,*)
' .X####### +###- =###+ ###x x######## '
240 write(
io_fid_log,*)
' .######### ######X ####### #### .#########x '
241 write(
io_fid_log,*)
' ####+++++= X#######. -#######x .###; ####x+++++. '
242 write(
io_fid_log,*)
' ### ###= #### #### x### #### -###. '
243 write(
io_fid_log,*)
' .### #### ###+ X### ###X =###. #### '
244 write(
io_fid_log,*)
' ###- ;###, .###+ -### #### x##########+ '
245 write(
io_fid_log,*)
' +####x #### #### #### #### ###########. '
246 write(
io_fid_log,*)
' x######. =### ###, .###- ###+ x###-------- '
247 write(
io_fid_log,*)
' =##### X### -### #### ,### #### '
248 write(
io_fid_log,*)
' .###=x###; .###+ ###X ###X ####. '
249 write(
io_fid_log,*)
' ###########; ###########+ ########### ########### ,##########. '
250 write(
io_fid_log,*)
'-########### ,##########, #########X ########## +######### '
251 write(
io_fid_log,*)
',,,,,,,,,,. ,,,,,,,,, .,,,,,,,. .,,,,,,,, ,,,,,,,, '
253 write(
io_fid_log,*)
' SCALE : Scalable Computing by Advanced Library and Environment '
260 log_info(
"IO_LOG_setup",*)
'Setup'
262 log_info(
'IO_LOG_setup',
'(1x,A,I3)')
'Open config file, FID = ',
io_fid_conf
263 log_info(
'IO_LOG_setup',
'(1x,A,I3)')
'Open log file, FID = ',
io_fid_log
264 log_info(
'IO_LOG_setup',
'(1x,2A)')
'basename of log file = ', trim(
io_log_basename)
269 if( is_master )
write(*,*)
'*** Log report is suppressed.'
273 log_info(
"IO_LOG_setup",*)
'The used configurations are output to the file.'
274 log_info(
"IO_LOG_setup",*)
'filename of used config file = ', trim(
io_nml_filename)
276 if ( is_master )
then
281 form =
'formatted', &
283 if ( ierr /= 0 )
then
284 log_error(
'IO_LOG_setup',*)
'File open error! :', trim(
io_nml_filename)
288 log_info(
"IO_LOG_setup",
'(1x,A,I3)')
'Open file to output used config, FID = ',
io_fid_nml
290 write(
io_fid_nml,
'(A)')
'################################################################################'
294 write(
io_fid_nml,
'(A)')
'################################################################################'
300 log_info(
"IO_LOG_setup",*)
'The file for used config is open by the master rank'
306 log_info(
"IO_LOG_setup",*)
'The used config is output to the log.'
308 log_info(
"IO_LOG_setup",*)
'The used config is not output.'
327 do fid = io_minfid, io_maxfid
328 inquire(fid,opened=i_opened)
329 if ( .NOT. i_opened )
return
332 if ( fid >= io_maxfid )
then
333 log_error(
"IO_get_available_fid",*)
'Used I/O unit number reached to the limit! STOP'
347 integer,
intent(in) :: myrank
348 integer,
intent(in) :: jobid
349 integer,
intent(in) :: domainid
369 character(len=H_LONG),
intent(out) :: outstr
370 character(len=*),
intent(in) :: instr
371 character(len=*),
intent(in) :: ext
372 integer,
intent(in) :: rank
373 logical,
intent(in),
optional :: isrgn
375 character(len=H_SHORT) :: srank
378 write(srank,
'(I6.6)') rank
380 if (
present(isrgn) )
then
381 if(isrgn)
write(srank,
'(I8.8)') rank-1
384 outstr = trim(instr)//
'.'//trim(ext)//trim(srank)
394 logical,
intent(in) :: is_master
395 logical,
intent(in),
optional :: allow_noconf
397 character(len=H_LONG) :: fname
398 logical :: allow_noconf_
401 if ( command_argument_count() < 1 )
then
402 allow_noconf_ = .false.
403 if (
present(allow_noconf) ) allow_noconf_ = allow_noconf
404 if ( .not. allow_noconf_ )
then
406 log_error(
"IO_ARG_getfname",*)
'Program needs config file from argument! STOP.'
413 call get_command_argument(1,fname)
427 character(len=*),
intent(in) :: fname
428 logical,
intent(in) :: is_master
437 file = trim(fname), &
438 form =
'formatted', &
442 if ( ierr /= 0 )
then
444 log_error(
"IO_CNF_open",*)
'Failed to open config file! STOP.'
445 log_error(
"IO_CNF_open",*)
'filename : ', trim(fname)
character(len=6), public io_universalrank
universal rank for error log
character(len=6), public io_domainid
nesting domain id for error log
character(len=h_long), public io_log_basename
basename of logfile
subroutine, public io_set_universalrank(myrank, jobid, domainid)
Put for error log.
integer, parameter, public file_hlong
character(len=6), public io_jobid
bulk job id for error log
integer, parameter, public file_hmid
integer, public io_step_to_stdout
interval for output current step to STDOUT (negative is off)
integer function, public io_get_available_fid()
search & get available file ID
character(len=h_mid), public h_institute
for file header
subroutine, public io_setup(APPNAME, conf_name, allow_noconf)
Setup.
character(len=h_mid), public h_source
for file header
integer, parameter, public file_hshort
character(len=h_long), public io_nml_filename
filename of logfile (only for output namelist)
integer, parameter, public h_mid
Character length (short=64)
character(len=9), parameter, public io_nullfile
character(len=h_mid), public h_appname
name of the application
integer, public io_fid_log
Log file ID.
integer, parameter, public h_short
Character length (short=16)
integer, parameter, public h_long
Character length (short=256)
logical, public io_log_nml_suppress
suppress all of log output? (for namelist)
logical, public io_log_suppress
suppress all of log output?
character(len=6), parameter, public io_stdout
character(len=h_mid), public h_libname
name and version of the library
logical, public io_l
output log or not? (this process)
integer, public io_fid_nml
Log file ID (only for output namelist)
logical, public io_nml
output log or not? (for namelist, this process)
integer, parameter, public io_fid_stdout
logical, public io_log_allnode
output log for each node?
subroutine, public io_log_setup(myrank, is_master)
Setup LOG.
character(len=h_long) function, public io_arg_getfname(is_master, allow_noconf)
get config filename from argument
integer function, public io_cnf_open(fname, is_master)
open config file
integer, public io_fid_conf
Config file ID.
character(len=6), public io_localrank
local rank for error log
subroutine, public io_make_idstr(outstr, instr, ext, rank, isrgn)
generate process specific filename