1
!-------------------------------------------------------------------------------
3
! This file is part of Code_Saturne, a general-purpose CFD tool.
5
! Copyright (C) 1998-2011 EDF S.A.
7
! This program is free software; you can redistribute it and/or modify it under
8
! the terms of the GNU General Public License as published by the Free Software
9
! Foundation; either version 2 of the License, or (at your option) any later
12
! This program is distributed in the hope that it will be useful, but WITHOUT
13
! ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14
! FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
17
! You should have received a copy of the GNU General Public License along with
18
! this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
19
! Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
!-------------------------------------------------------------------------------
26
(irkpar, nrkpar, ilogr0, ilogrp)
28
!===============================================================================
32
! Initialize log files using Fortran IO.
34
!-------------------------------------------------------------------------------
36
!__________________.____._____.________________________________________________.
37
! name !type!mode ! role !
38
!__________________!____!_____!________________________________________________!
39
! irkpar ! i ! <-- ! rank if parallel; -1 if sequential !
40
! nrkpar ! i ! <-- ! number of parallel ranks !
41
! ilogr0 ! i ! <-- ! log output option for rank 0 !
42
! ! ! ! 0: not redirected !
43
! ! ! ! 1: redirected to "listing" file !
44
! ilogrp ! i ! <-- ! log output option for ranks > 0 !
45
! ! ! ! 0: not redirected (for debugging) !
46
! ! ! ! 1: redirected to "listing_n*" files !
47
! ! ! ! 2: redirected to /dev/null (suppressed) !
48
!__________________!____!_____!________________________________________________!
50
! Type: i (integer), r (real), s (string), a (array), l (logical),
51
! and composite types (ex: ra real array)
52
! mode: <-- input, --> output, <-> modifies data, --- work array
53
!===============================================================================
55
!===============================================================================
57
!===============================================================================
62
!===============================================================================
68
integer irkpar, nrkpar, ilogr0, ilogrp
74
!===============================================================================
76
nfecra = 6 ! default value for Fortran "stdout"
78
if (irkpar .le. 0) then
79
if (ilogr0 .eq. 1) then
84
if (ilogrp .eq. 1) then
86
if (nrkpar .ge. 10000) then
87
write (name,'(a9,i7.4)') 'listing_n', irkpar + 1
89
write (name,'(a9,i4.4)') 'listing_n', irkpar + 1
91
else if (ilogrp.eq.2) then
98
open (file=name, unit=nfecra, form='formatted', status='unknown', err=900)
103
900 write (0, 999) name
108
#if defined(_CS_LANG_FR)
111
'Code_Saturne : Erreur d''initialisation :',/, &
112
'Impossible d''ouvrir le fichier : ', a, /)
117
'Code_Saturne: Initialization error:',/, &
118
'Impossible to open the file: ', a, /)