53 character(len=6),
public,
parameter ::
io_stdout =
"STDOUT" 61 logical,
public ::
io_l = .false.
77 integer,
private,
parameter :: io_minfid = 10
78 integer,
private,
parameter :: io_maxfid = 99
90 namelist / param_io / &
101 character(len=*),
intent(in) :: modelname
102 logical,
intent(in) :: call_from_launcher
103 character(len=*),
intent(in),
optional :: fname_in
105 character(len=H_LONG) :: fname
110 if ( call_from_launcher )
then 111 if (
present(fname_in) )
then 114 write(*,*)
'xxx Not imported name of config file! STOP.' 126 h_libname =
'SCALE Library ver. '//trim(libversion)
133 write(*,*)
'xxx Not appropriate names in namelist PARAM_IO . Check!' 147 integer,
intent(in) :: myrank
148 logical,
intent(in) :: is_master
150 namelist / param_io / &
160 character(len=H_LONG) :: fname
168 if ( is_master )
then 190 file = trim(fname), &
191 form =
'formatted', &
193 if ( ierr /= 0 )
then 194 write(*,*)
'xxx File open error! :', trim(fname)
204 write(
io_fid_log,*)
' .+++++++++++++++++++++++ ' 205 write(
io_fid_log,*)
' +++++++++++++++++++++++++ ' 206 write(
io_fid_log,*)
' +++++++++++++++++++++++++++ ' 207 write(
io_fid_log,*)
' =++++++=x######+++++++++++++; ' 208 write(
io_fid_log,*)
' .++++++X####XX####++++++++++++ ' 209 write(
io_fid_log,*)
' =+xxx=, ++++ +++++=##+ .###++++++++++- ' 210 write(
io_fid_log,*)
' ,xxxxxxxxxx- +++++.+++++=## .##++++++++++ ' 211 write(
io_fid_log,*)
' xxxxxxxxxxxxx -+++x#;+++++#+ ##+++++++++. ' 212 write(
io_fid_log,*)
' xxxxxxxx##xxxx, ++++# +++++XX #+++++++++- ' 213 write(
io_fid_log,*)
' xxxxxxx####+xx+x ++++#.++++++# #+++++++++ ' 214 write(
io_fid_log,*)
' +xxxxxX#X #Xx#= =+++#x=++++=#. x=++++++++ ' 215 write(
io_fid_log,*)
' xxxxxx#, x### .++++#,+++++#= x++++++++ ' 216 write(
io_fid_log,*)
' xxxxxx#. ++++# +++++x# #++++++++ ' 217 write(
io_fid_log,*)
' xxxxxx+ ++++#-+++++=# #++++++++ ' 218 write(
io_fid_log,*)
',xxxxxX -+++XX-+++++#, +++++++++ ' 219 write(
io_fid_log,*)
'=xxxxxX .++++#.+++++#x -++++++++ ' 220 write(
io_fid_log,*)
'+xxxxx= ++++#.++++++# ++++++++# ' 221 write(
io_fid_log,*)
'xxxxxx; ++++#+=++++=# ++++++++# ' 222 write(
io_fid_log,*)
'xxxxxxx ,+++x#,+++++#- ;++++++++- ' 223 write(
io_fid_log,*)
'#xxxxxx +++=# +++++xX ++++++++# ' 224 write(
io_fid_log,*)
'xxxxxxxx ++++#-+++++=# +++++++++X ' 225 write(
io_fid_log,*)
'-+xxxxxx+ ++++X#-++++=#. -++; =++++++++# ' 226 write(
io_fid_log,*)
' #xxxxxxxx. .+++++# +++++#x =++++- +++++++++XX ' 227 write(
io_fid_log,*)
' #xxxxxxxxxx=--=++++++#.++++++# ++++++ -+++++++++x# ' 228 write(
io_fid_log,*)
' #+xxxxxxxxxx+++++++#x=++++=# ++++++;=+++++++++++x# ' 229 write(
io_fid_log,*)
' =#+xxxxxxxx+++++++##,+++++#= =++++++++++++++++++##. ' 230 write(
io_fid_log,*)
' X#xxxxxxxx++++++## +++++x# ;x++++++++++++++++##. ' 231 write(
io_fid_log,*)
' x##+xxxx+++++x## +++++=# ##++++++++++++x##X ' 232 write(
io_fid_log,*)
' ,###Xx+++x###x -++++=#, .####x+++++X####. ' 233 write(
io_fid_log,*)
' -########+ -#####x .X#########+. ' 236 write(
io_fid_log,*)
' .X####### +###- =###+ ###x x######## ' 237 write(
io_fid_log,*)
' .######### ######X ####### #### .#########x ' 238 write(
io_fid_log,*)
' ####+++++= X#######. -#######x .###; ####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 #### #### #### #### ###########. ' 243 write(
io_fid_log,*)
' x######. =### ###, .###- ###+ x###-------- ' 244 write(
io_fid_log,*)
' =##### X### -### #### ,### #### ' 245 write(
io_fid_log,*)
' .###=x###; .###+ ###X ###X ####. ' 246 write(
io_fid_log,*)
' ###########; ###########+ ########### ########### ,##########. ' 247 write(
io_fid_log,*)
'-########### ,##########, #########X ########## +######### ' 248 write(
io_fid_log,*)
',,,,,,,,,,. ,,,,,,,,, .,,,,,,,. .,,,,,,,, ,,,,,,,, ' 250 write(
io_fid_log,*)
' SCALE : Scalable Computing by Advanced Library and Environment ' 255 write(
io_fid_log,*)
'++++++ Module[STDIO] / Categ[IO] / Origin[SCALElib]' 263 if( is_master )
write(*,*)
'*** Log report is suppressed.' 267 if(
io_l )
write(
io_fid_log,*)
'*** The used config is output to the file.' 270 if ( is_master )
then 275 form =
'formatted', &
277 if ( ierr /= 0 )
then 284 write(
io_fid_nml,
'(A)')
'################################################################################' 288 write(
io_fid_nml,
'(A)')
'################################################################################' 294 if(
io_l )
write(
io_fid_log,*)
'*** The file for used config is open by the master rank' 300 if(
io_l )
write(
io_fid_log,*)
'*** The used config is output to the log.' 302 if(
io_l )
write(
io_fid_log,*)
'*** 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)
362 logical,
intent(in) :: is_master
364 character(len=H_LONG) :: fname
367 if ( command_argument_count() < 1 )
then 368 if(is_master)
write(*,*)
'xxx Program needs config file from argument! STOP.' 371 call get_command_argument(1,fname)
385 character(len=*),
intent(in) :: fname
386 logical,
intent(in) :: is_master
395 file = trim(fname), &
396 form =
'formatted', &
400 if ( ierr /= 0 )
then 401 if(is_master)
write(*,*)
'xxx Failed to open config file! STOP.' 402 if(is_master)
write(*,*)
'xxx filename : ', trim(fname)
logical, public io_l
output log or not? (this process)
integer, parameter, public h_long
Character length (short=256)
integer, parameter, public io_fid_stdout
subroutine, public io_make_idstr(outstr, instr, ext, rank, isrgn)
generate process specific filename
character(len=h_long) function, public io_arg_getfname(is_master)
get config filename from argument
character(len=h_mid), public h_modelname
name and version of the model
subroutine, public io_log_setup(myrank, is_master)
Setup LOG.
character(len=6), parameter, public io_stdout
logical, public io_log_suppress
suppress all of log output?
integer, public io_step_to_stdout
interval for output current step to STDOUT (negative is off)
logical, public io_nml
output log or not? (for namelist, this process)
character(len=h_mid), public h_source
for file header
integer function, public io_get_available_fid()
search & get available file ID
subroutine, public io_setup(MODELNAME, call_from_launcher, fname_in)
Setup.
logical, public io_log_allnode
output log for each node?
integer, parameter, public h_short
Character length (short=16)
character(len=h_mid), public h_institute
for file header
logical, public io_aggregate
do parallel I/O through PnetCDF
integer, public io_fid_conf
Config file ID.
character(len=h_mid), public h_libname
name and version of the library
integer, parameter, public h_mid
Character length (short=64)
integer, public io_fid_log
Log file ID.
character(len=h_long), public io_log_basename
basename of logfile
integer, public io_fid_nml
Log file ID (only for output namelist)
logical, public io_log_nml_suppress
suppress all of log output? (for namelist)
integer function, public io_cnf_open(fname, is_master)
open config file
character(len=h_long), public io_nml_filename
filename of logfile (only for output namelist)