26 character(len=*),
parameter :: libversion = version_macro
52 character(len=9),
public,
parameter ::
io_nullfile =
"/dev/null" 53 character(len=6),
public,
parameter ::
io_stdout =
"STDOUT" 61 logical,
public ::
io_l = .false.
76 integer,
private,
parameter :: io_minfid = 10
77 integer,
private,
parameter :: io_maxfid = 99
90 namelist / param_io / &
100 character(len=*),
intent(in) :: APPNAME
101 character(len=*),
intent(in),
optional :: conf_name
102 logical,
intent(in),
optional :: allow_noconf
104 character(len=H_LONG) :: fname
109 if (
present(conf_name) )
then 121 h_libname =
'SCALE Library ver. '//trim(libversion)
129 log_error(
'IO_setup',*)
'Not appropriate names in namelist PARAM_IO . Check!' 144 integer,
intent(in) :: myrank
145 logical,
intent(in) :: is_master
147 namelist / param_io / &
156 character(len=H_LONG) :: fname
164 if ( is_master )
then 186 file = trim(fname), &
187 form =
'formatted', &
189 if ( ierr /= 0 )
then 190 log_error(
'IO_LOG_setup',*)
'File open error! :', trim(fname)
201 write(
io_fid_log,*)
' .+++++++++++++++++++++++ ' 202 write(
io_fid_log,*)
' +++++++++++++++++++++++++ ' 203 write(
io_fid_log,*)
' +++++++++++++++++++++++++++ ' 204 write(
io_fid_log,*)
' =++++++=x######+++++++++++++; ' 205 write(
io_fid_log,*)
' .++++++X####XX####++++++++++++ ' 206 write(
io_fid_log,*)
' =+xxx=, ++++ +++++=##+ .###++++++++++- ' 207 write(
io_fid_log,*)
' ,xxxxxxxxxx- +++++.+++++=## .##++++++++++ ' 208 write(
io_fid_log,*)
' xxxxxxxxxxxxx -+++x#;+++++#+ ##+++++++++. ' 209 write(
io_fid_log,*)
' xxxxxxxx##xxxx, ++++# +++++XX #+++++++++- ' 210 write(
io_fid_log,*)
' xxxxxxx####+xx+x ++++#.++++++# #+++++++++ ' 211 write(
io_fid_log,*)
' +xxxxxX#X #Xx#= =+++#x=++++=#. x=++++++++ ' 212 write(
io_fid_log,*)
' xxxxxx#, x### .++++#,+++++#= x++++++++ ' 213 write(
io_fid_log,*)
' xxxxxx#. ++++# +++++x# #++++++++ ' 214 write(
io_fid_log,*)
' xxxxxx+ ++++#-+++++=# #++++++++ ' 215 write(
io_fid_log,*)
',xxxxxX -+++XX-+++++#, +++++++++ ' 216 write(
io_fid_log,*)
'=xxxxxX .++++#.+++++#x -++++++++ ' 217 write(
io_fid_log,*)
'+xxxxx= ++++#.++++++# ++++++++# ' 218 write(
io_fid_log,*)
'xxxxxx; ++++#+=++++=# ++++++++# ' 219 write(
io_fid_log,*)
'xxxxxxx ,+++x#,+++++#- ;++++++++- ' 220 write(
io_fid_log,*)
'#xxxxxx +++=# +++++xX ++++++++# ' 221 write(
io_fid_log,*)
'xxxxxxxx ++++#-+++++=# +++++++++X ' 222 write(
io_fid_log,*)
'-+xxxxxx+ ++++X#-++++=#. -++; =++++++++# ' 223 write(
io_fid_log,*)
' #xxxxxxxx. .+++++# +++++#x =++++- +++++++++XX ' 224 write(
io_fid_log,*)
' #xxxxxxxxxx=--=++++++#.++++++# ++++++ -+++++++++x# ' 225 write(
io_fid_log,*)
' #+xxxxxxxxxx+++++++#x=++++=# ++++++;=+++++++++++x# ' 226 write(
io_fid_log,*)
' =#+xxxxxxxx+++++++##,+++++#= =++++++++++++++++++##. ' 227 write(
io_fid_log,*)
' X#xxxxxxxx++++++## +++++x# ;x++++++++++++++++##. ' 228 write(
io_fid_log,*)
' x##+xxxx+++++x## +++++=# ##++++++++++++x##X ' 229 write(
io_fid_log,*)
' ,###Xx+++x###x -++++=#, .####x+++++X####. ' 230 write(
io_fid_log,*)
' -########+ -#####x .X#########+. ' 233 write(
io_fid_log,*)
' .X####### +###- =###+ ###x x######## ' 234 write(
io_fid_log,*)
' .######### ######X ####### #### .#########x ' 235 write(
io_fid_log,*)
' ####+++++= X#######. -#######x .###; ####x+++++. ' 236 write(
io_fid_log,*)
' ### ###= #### #### x### #### -###. ' 237 write(
io_fid_log,*)
' .### #### ###+ X### ###X =###. #### ' 238 write(
io_fid_log,*)
' ###- ;###, .###+ -### #### x##########+ ' 239 write(
io_fid_log,*)
' +####x #### #### #### #### ###########. ' 240 write(
io_fid_log,*)
' x######. =### ###, .###- ###+ x###-------- ' 241 write(
io_fid_log,*)
' =##### X### -### #### ,### #### ' 242 write(
io_fid_log,*)
' .###=x###; .###+ ###X ###X ####. ' 243 write(
io_fid_log,*)
' ###########; ###########+ ########### ########### ,##########. ' 244 write(
io_fid_log,*)
'-########### ,##########, #########X ########## +######### ' 245 write(
io_fid_log,*)
',,,,,,,,,,. ,,,,,,,,, .,,,,,,,. .,,,,,,,, ,,,,,,,, ' 247 write(
io_fid_log,*)
' SCALE : Scalable Computing by Advanced Library and Environment ' 254 log_info(
"IO_LOG_setup",*)
'Setup' 256 log_info(
'IO_LOG_setup',
'(1x,A,I3)')
'Open config file, FID = ',
io_fid_conf 257 log_info(
'IO_LOG_setup',
'(1x,A,I3)')
'Open log file, FID = ',
io_fid_log 258 log_info(
'IO_LOG_setup',
'(1x,2A)')
'basename of log file = ', trim(
io_log_basename)
263 if( is_master )
write(*,*)
'*** Log report is suppressed.' 267 log_info(
"IO_LOG_setup",*)
'The used configurations are output to the file.' 268 log_info(
"IO_LOG_setup",*)
'filename of used config file = ', trim(
io_nml_filename)
270 if ( is_master )
then 275 form =
'formatted', &
277 if ( ierr /= 0 )
then 278 log_error(
'IO_LOG_setup',*)
'File open error! :', trim(
io_nml_filename)
282 log_info(
"IO_LOG_setup",
'(1x,A,I3)')
'Open file to output used config, FID = ',
io_fid_nml 284 write(
io_fid_nml,
'(A)')
'################################################################################' 288 write(
io_fid_nml,
'(A)')
'################################################################################' 294 log_info(
"IO_LOG_setup",*)
'The file for used config is open by the master rank' 300 log_info(
"IO_LOG_setup",*)
'The used config is output to the log.' 302 log_info(
"IO_LOG_setup",*)
'The used config is not output.' 319 do fid = io_minfid, io_maxfid
320 inquire(fid,opened=i_opened)
321 if ( .NOT. i_opened )
return 336 character(len=H_LONG),
intent(out) :: outstr
337 character(len=*),
intent(in) :: instr
338 character(len=*),
intent(in) :: ext
339 integer,
intent(in) :: rank
340 logical,
intent(in),
optional :: isrgn
342 character(len=H_SHORT) :: srank
345 write(srank,
'(I6.6)') rank
347 if (
present(isrgn) )
then 348 if(isrgn)
write(srank,
'(I8.8)') rank-1
351 outstr = trim(instr)//
'.'//trim(ext)//trim(srank)
361 logical,
intent(in) :: is_master
362 logical,
intent(in),
optional :: allow_noconf
364 character(len=H_LONG) :: fname
365 logical :: allow_noconf_
368 if ( command_argument_count() < 1 )
then 369 allow_noconf_ = .false.
370 if (
present(allow_noconf) ) allow_noconf_ = allow_noconf
371 if ( .not. allow_noconf_ )
then 373 log_error(
"IO_ARG_getfname",*)
'Program needs config file from argument! STOP.' 380 call get_command_argument(1,fname)
394 character(len=*),
intent(in) :: fname
395 logical,
intent(in) :: is_master
404 file = trim(fname), &
405 form =
'formatted', &
409 if ( ierr /= 0 )
then 411 log_error(
"IO_CNF_open",*)
'Failed to open config file! STOP.' 412 log_error(
"IO_CNF_open",*)
'filename : ', trim(fname)
logical, public io_log_nml_suppress
suppress all of log output? (for namelist)
logical, public io_log_suppress
suppress all of log output?
integer function, public io_cnf_open(fname, is_master)
open config file
integer, parameter, public file_hlong
integer, public io_fid_nml
Log file ID (only for output namelist)
integer, parameter, public file_hmid
character(len=9), parameter, public io_nullfile
integer, public io_fid_conf
Config file ID.
character(len=h_long), public io_log_basename
basename of logfile
integer, parameter, public h_mid
Character length (short=64)
logical, public io_l
output log or not? (this process)
integer, parameter, public io_fid_stdout
logical, public io_log_allnode
output log for each node?
character(len=h_mid), public h_source
for file header
integer function, public io_get_available_fid()
search & get available file ID
integer, parameter, public file_hshort
character(len=h_mid), public h_institute
for file header
character(len=h_mid), public h_libname
name and version of the library
integer, public io_step_to_stdout
interval for output current step to STDOUT (negative is off)
character(len=6), parameter, public io_stdout
subroutine, public io_setup(APPNAME, conf_name, allow_noconf)
Setup.
integer, parameter, public h_short
Character length (short=16)
character(len=h_long) function, public io_arg_getfname(is_master, allow_noconf)
get config filename from argument
character(len=h_mid), public h_appname
name of the application
character(len=h_long), public io_nml_filename
filename of logfile (only for output namelist)
integer, parameter, public h_long
Character length (short=256)
subroutine, public io_log_setup(myrank, is_master)
Setup LOG.
subroutine, public io_make_idstr(outstr, instr, ext, rank, isrgn)
generate process specific filename
logical, public io_nml
output log or not? (for namelist, this process)
integer, public io_fid_log
Log file ID.