~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to src/base/csopli.f90

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-01 17:43:32 UTC
  • mto: (6.1.7 sid)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: package-import@ubuntu.com-20111101174332-tl4vk45no0x3emc3
Tags: upstream-2.1.0
ImportĀ upstreamĀ versionĀ 2.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
!-------------------------------------------------------------------------------
 
2
 
 
3
! This file is part of Code_Saturne, a general-purpose CFD tool.
 
4
!
 
5
! Copyright (C) 1998-2011 EDF S.A.
 
6
!
 
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
 
10
! version.
 
11
!
 
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
 
15
! details.
 
16
!
 
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.
 
20
 
 
21
!-------------------------------------------------------------------------------
 
22
 
 
23
subroutine csopli &
 
24
!================
 
25
 
 
26
 (irkpar, nrkpar, ilogr0, ilogrp)
 
27
 
 
28
!===============================================================================
 
29
! Purpose:
 
30
! -------
 
31
 
 
32
!    Initialize log files using Fortran IO.
 
33
 
 
34
!-------------------------------------------------------------------------------
 
35
! Arguments
 
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
!__________________!____!_____!________________________________________________!
 
49
 
 
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
!===============================================================================
 
54
 
 
55
!===============================================================================
 
56
! Module files
 
57
!===============================================================================
 
58
 
 
59
use paramx
 
60
use entsor
 
61
 
 
62
!===============================================================================
 
63
 
 
64
implicit none
 
65
 
 
66
! Arguments
 
67
 
 
68
integer          irkpar, nrkpar, ilogr0, ilogrp
 
69
 
 
70
! Local variables
 
71
 
 
72
character        name*30
 
73
 
 
74
!===============================================================================
 
75
 
 
76
nfecra = 6  ! default value for Fortran "stdout"
 
77
 
 
78
if (irkpar .le. 0) then
 
79
  if (ilogr0 .eq. 1) then
 
80
    nfecra = 9
 
81
    name = 'listing'
 
82
  endif
 
83
else
 
84
  if (ilogrp .eq. 1) then
 
85
    nfecra = 9
 
86
    if (nrkpar .ge. 10000) then
 
87
      write (name,'(a9,i7.4)') 'listing_n', irkpar + 1
 
88
    else
 
89
      write (name,'(a9,i4.4)') 'listing_n', irkpar + 1
 
90
    endif
 
91
  else if (ilogrp.eq.2) then
 
92
    nfecra = 9
 
93
    name = '/dev/null'
 
94
  endif
 
95
endif
 
96
 
 
97
if (nfecra.eq.9) then
 
98
   open (file=name, unit=nfecra, form='formatted', status='unknown', err=900)
 
99
endif
 
100
 
 
101
goto 950
 
102
 
 
103
 900  write (0, 999) name
 
104
call csexit (1)
 
105
 
 
106
 950  continue
 
107
 
 
108
#if defined(_CS_LANG_FR)
 
109
 
 
110
 999  format(/,                                    &
 
111
'Code_Saturne : Erreur d''initialisation :',/,     &
 
112
'Impossible d''ouvrir le fichier : ', a, /)
 
113
 
 
114
#else
 
115
 
 
116
 999  format(/,                                    &
 
117
'Code_Saturne: Initialization error:',/,           &
 
118
'Impossible to open the file: ', a, /)
 
119
 
 
120
#endif
 
121
 
 
122
return
 
123
end subroutine