The TELEMAC-MASCARET system  trunk
bief_desimp.f
Go to the documentation of this file.
1 ! **********************
2  SUBROUTINE bief_desimp
3 ! **********************
4 !
5  &(format_res,varsor,n,nres,at,lt,lisprd,leoprd,
6  & sorleo,sorimp,maxvar,texte,ptinig,ptinil,mesh,
7  & iimp,ileo,compgraph)
8 !
9 !***********************************************************************
10 ! BIEF V7P1
11 !***********************************************************************
12 !
13 !brief WRITES TO RESULT OR LISTING FILE.
14 !
15 !history J-M HERVOUET (LNHE)
16 !+ 01/04/2009
17 !+ V6P0
18 !+
19 !
20 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
21 !+ 13/07/2010
22 !+ V6P0
23 !+ Translation of French comments within the FORTRAN sources into
24 !+ English comments
25 !
26 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
27 !+ 21/08/2010
28 !+ V6P0
29 !+ Creation of DOXYGEN tags for automated documentation and
30 !+ cross-referencing of the FORTRAN sources
31 !
32 !history V. STOBIAC
33 !+ 10/12/2014
34 !+ V7P0
35 !+ Add update of mesh coordinates for moving mesh
36 !
37 !history Y AUDOUIN (LNHE)
38 !+ 25/05/2015
39 !+ V7P0
40 !+ Modification to comply with the hermes module
41 !
42 !history R. ATA (LNHE)
43 !+ 11/01/2015
44 !+ V7P2
45 !+ adaptation for fv (leo, imp and compgraph added as
46 !+ optional arguments)
47 !
48 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
49 !| FORMAT_RES |-->| FORMAT OF RESULT FILE
50 !| LEOPRD |-->| GRAPHIC PRINTOUT PERIOD
51 !| LISPRD |-->| LISTING PRINTOUT PERIOD
52 !| MAXVAR |-->| MAXIMUM OF VARIABLES IN THE FILE
53 !| N |-->| NUMBER OF POINTS IN THE MESH
54 !| NRES |-->| LOGICAL UNIT OF THE RESULTS FILE
55 !| PTINIG |-->| NUMBER OF FIRST TIME STEP FOR GRAPHIC PRINTOUTS
56 !| PTINIL |-->| NUMBER OF FIRST TIME STEP FOR LISTING PRINTOUTS
57 !| SORIMP |-->| ARRAY OF LOGICAL SAYING IF VARIABLES MUST BE PUT
58 !| | | IN THE LISTING
59 !| SORLEO |-->| ARRAY OF LOGICAL SAYING IF VARIABLES MUST BE PUT
60 !| | | IN THE RESULTS FILE
61 !| TEXTE |-->| NAMES AND UNITS OF VARIABLES
62 !| VARSOR |-->| BLOCK WITH VARIABLES TO BE PRINTED OR COPIED
63 !| MESH (OPTIONAL)|-->| MESH STRUCTURE
64 !| ILEO & IIMP) |-->| LOGICAL FOR LISTING AND GRAPHICAL OUTPUTS
65 !| COMPGRAPH |-->| COUNTER FOR FV GRAPHICAL OUTPUTS
66 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
67 !
68  USE bief, ex_bief_desimp => bief_desimp
70 !
72  IMPLICIT NONE
73 !
74 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
75 !
76  TYPE(bief_obj) , INTENT(IN) :: VARSOR
77  CHARACTER(LEN=8) , INTENT(IN) :: FORMAT_RES
78  INTEGER , INTENT(IN) :: NRES,LT,LISPRD,LEOPRD
79  INTEGER , INTENT(IN) :: PTINIG,PTINIL,N
80  INTEGER , INTENT(IN) :: MAXVAR
81  DOUBLE PRECISION , INTENT(IN) :: AT
82  CHARACTER(LEN=32), INTENT(IN) :: TEXTE(*)
83  LOGICAL , INTENT(IN) :: SORLEO(maxvar),SORIMP(maxvar)
84  TYPE(bief_mesh) , INTENT(IN), OPTIONAL :: MESH
85  LOGICAL , INTENT(IN), OPTIONAL :: IIMP,ILEO
86  INTEGER , INTENT(IN), OPTIONAL :: COMPGRAPH
87 !
88 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
89 !
90  INTEGER LTT,K
91 !
92  LOGICAL LEO,IMP
93 !
94 !-----------------------------------------------------------------------
95 !
96 ! LOGICAL THAT DEFINE THE OUTPUTS
97 !
98  imp=.false.
99  leo=.false.
100  ltt=(lt/lisprd)*lisprd
101  IF(lt.EQ.ltt.AND.lt.GE.ptinil) imp=.true.
102  ltt=(lt/leoprd)*leoprd
103  IF(lt.EQ.ltt.AND.lt.GE.ptinig) leo=.true.
104  IF(lt.EQ.0) leo=.true.
105  IF(PRESENT(iimp))imp=iimp
106  IF(PRESENT(ileo))leo=ileo
107 !
108 !-----------------------------------------------------------------------
109 !
110  IF(leo) THEN
111 !
112 ! COUNTERS FOR TELEMAC2D
113  IF(PRESENT(compgraph))THEN
114  ltt=compgraph
115  ELSE
116 ! COUNTERS FOR OTHER CODES
117  ltt = (lt-ptinig)/leoprd
118  ! In case the starting point is not at lt.eq.0 but later
119  ! we still write the timestep 0 so we need to increment LTT
120  IF(ptinig.NE.0) ltt = ltt + 1
121  IF(lt.EQ.0) ltt = 0
122  ENDIF
123 !
124  IF(PRESENT(mesh)) THEN
125  CALL write_data(format_res,nres,maxvar,at,ltt,sorleo,
126  & texte,varsor,n,mesh)
127  ELSE
128  CALL write_data(format_res,nres,maxvar,at,ltt,sorleo,
129  & texte,varsor,n)
130  ENDIF
131  ENDIF
132 !
133 ! TO LISTING FILE
134 !
135  IF(imp) THEN
136  DO k=1,maxvar
137  IF(sorimp(k)) THEN
138  IF(ASSOCIATED(varsor%ADR(k)%P%R)) THEN
139  CALL impvec(varsor%ADR(k)%P%R,texte(k),n)
140  ELSE
141  WRITE(lu,*) 'DESIMP: VARIABLE NUMBER: ',k
142  WRITE(lu,*) ' NOT OR NOT WELL ALLOCATED'
143  WRITE(lu,*) ' OR POINTER NOT ASSOCIATED '
144 ! CALL PLANTE(1)
145 ! STOP
146  ENDIF
147  ENDIF
148  ENDDO
149  ENDIF
150 !
151 !=======================================================================
152 !
153  RETURN
154  END
subroutine write_data(FFORMAT, FILERES, NVARS, TIME, TIMESTEP, OUTVAR, NOMVAR, BVARSOR, N, MESH)
Definition: write_data.f:7
subroutine impvec(VEC, NOM, NPOIN)
Definition: impvec.f:7
subroutine bief_desimp(FORMAT_RES, VARSOR, N, NRES, AT, LT, LISPRD, LEOPRD, SORLEO, SORIMP, MAXVAR, TEXTE, PTINIG, PTINIL, MESH, IIMP, ILEO, COMPGRAPH)
Definition: bief_desimp.f:9
Definition: bief.f:3