The TELEMAC-MASCARET system  trunk
condiw.f
Go to the documentation of this file.
1 ! *****************
2  SUBROUTINE condiw
3 ! *****************
4 !
5  &( part, utel, vtel, htel )
6 !
7 !***********************************************************************
8 ! TOMAWAC V7P1
9 !***********************************************************************
10 !
11 !brief INITIALISES THE ARRAYS WITH PHYSICAL PARAMETERS.
12 !
13 !history F.MARCOS (LNH)
14 !+ 01/02/95
15 !+ V1P0
16 !+
17 !
18 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
19 !+ 13/07/2010
20 !+ V6P0
21 !+ Translation of French comments within the FORTRAN sources into
22 !+ English comments
23 !
24 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
25 !+ 21/08/2010
26 !+ V6P0
27 !+ Creation of DOXYGEN tags for automated documentation and
28 !+ cross-referencing of the FORTRAN sources
29 !
30 !history G.MATTAROLO (EDF)
31 !+ 05/2011
32 !+ V6P1
33 !+ Modification for direct coupling with TELEMAC
34 !
35 !history G.MATTAROLO (EDF - LNHE)
36 !+ 08/06/2011
37 !+ V6P1
38 !+ Translation of French names of the variables in argument
39 !
40 !history J-M HERVOUET (EDF R&D, LNHE)
41 !+ 21/01/2013
42 !+ V6P3
43 !+ Calls modified.
44 !
45 !history Y AUDOUIN (LNHE)
46 !+ 25/05/2015
47 !+ V7P0
48 !+ Modification to comply with the hermes module
49 !
50 !history T FOUQUET (LNHE)
51 !+ 25/05/2015
52 !+ V7P0
53 !+ Modification to initialise spectrum when no wind
54 !+ and speini =1,3,5
55 !
56 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57 !| AT |<--| COMPUTATION TIME
58 !| HTEL |-->| TELEMAC WATER DEPTH
59 !| LT |-->| NUMBER OF THE TIME STEP CURRENTLY SOLVED
60 !| NVCOU |---| NUMBER OF VARIABLES OF THE CURRENT FILE
61 !| NVHMA |<--| N.OF VARIABLES OF THE WATER LEVEL FILE
62 !| NVWIN |<--| N.OF VARIABLES OF THE WIND FILE
63 !| PART |-->| FLAG FOR DIRECT COUPLING WITH TELEMAC
64 !| TC1 |<--| TIME T1 IN THE CURRENT FILE
65 !| TC2 |<--| TIME T2 IN THE CURRENT FILE
66 !| TM1 |<--| TIME T1 IN THE WATER LEVEL FILE
67 !| TM2 |<--| TIME T2 IN THE WATER LEVEL FILE
68 !| TV1 |<--| TIME T1 IN THE WIND FILE
69 !| TV2 |<--| TIME T2 IN THE WIND FILE
70 !| UTEL |-->| X-AXIS TELEMAC CURRENT SPEED
71 !| VTEL |-->| Y-AXIS TELEMAC CURRENT SPEED
72 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73 !
75  USE interface_tomawac, ex_condiw=> condiw
76  USE bief
77 !
80  IMPLICIT NONE
81 !
82 !
83 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
84 !
85  INTEGER, INTENT(IN) :: PART
86  TYPE(bief_obj), INTENT(IN) :: UTEL,VTEL,HTEL
87 !
88 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
89 !
90  INTEGER UL,J
91  CHARACTER(LEN=8) ::FFORMAT
92  LOGICAL TROUVE(3)
93 !
94 !-----------------------------------------------------------------------
95 !
96  at = 0.d0
97 !
98 !-----------------------------------------------------------------------
99 !
100 ! INITIALISES THE TIDAL CURRENT AND WATER LEVEL
101 !
102  trouve(1)=.false.
103  trouve(2)=.false.
104  trouve(3)=.false.
105 !
106  IF(maree) THEN
107 !
108 ! READS IN THE TIDAL CURRRENT AND (OPTIONAL) DEPTH
109 !
110  IF(namcob(1:1).EQ.' '.AND.nammab(1:1).EQ.' '.AND.
111  & namcof(1:1).EQ.' '.AND.nammaf(1:1).EQ.' ') THEN
112  WRITE(lu,*) ' '
113  WRITE(lu,*)'USE OF TIDAL CURRENT VELOCITIES'
114  WRITE(lu,*)'BUT NO CURRENT FILE (NEITHER TELEMAC DATA FILE)'
115  WRITE(lu,*)
116  & '==> INITIALISATION OF TIDAL CURRENT VELOCITIES IN ANAMAR'
117  WRITE(lu,*) ' '
118  CALL anamar
119  ELSEIF(namcob(1:1).NE.' ') THEN
120 !
121 ! READS IN THE CURRENTS FROM BINARY FILE, AND POSSIBLY THE DEPTH
122 !
123  CALL lecdoi(uc,nameu,2,vc,namev,2,depth,nameh,1,
124  & npoin2, lucob, fmtcob, at,tc1,tc2,
125  & uc1,uc2,vc1,vc2,zm1,zm2,
126  & indic,'COURANT',nvcou,texcob,trouve,
127  & unitcob,phascob)
128 ! IF DEPTH READ
129  IF(trouve(3)) THEN
130  CALL ov('X=Y-Z ', x=dzhdt, y=zm2, z=zm1, dim1=npoin2)
131  CALL ov('X=CX ', x=dzhdt, c=1.d0/(tc2-tc1), dim1=npoin2)
132  ELSE
133  CALL ov('X=C ',x=dzhdt, c=0.d0, dim1=npoin2)
134  ENDIF
135 !
136  ELSEIF(namcof(1:1).NE.' ') THEN
137 !
138 ! READS IN THE CURRENTS FROM BINARY FILE, AND POSSIBLY THE DEPTH
139 !
140  CALL lecdoi(uc,nameu,2,vc,namev, 2, depth,nameh,1,
141  & npoin2, lucof, fmtcof, at,tc1,tc2,
142  & uc1,uc2,vc1,vc2, zm1,zm2,
143  & indic,'COURANT',nvcou,texcob,trouve,
144  & unitcob,phascob)
145 ! IF DEPTH READ
146  IF(trouve(3)) THEN
147  CALL ov('X=Y-Z ', x=dzhdt, y=zm2, z=zm1, dim1=npoin2)
148  CALL ov('X=CX ', x=dzhdt, c=1.d0/(tc2-tc1), dim1=npoin2)
149  ELSE
150  CALL ov('X=C ',x=dzhdt, c=0.d0, dim1=npoin2)
151  ENDIF
152 !
153  ENDIF
154 !
155 ! READS IN THE TIDAL WATER LEVEL IF NOT FOUND IN CURRENT FILE
156 !
157  IF(.NOT.trouve(3)) THEN
158  IF(nammaf(1:1).EQ.' '.AND.nammab(1:1).EQ.' ') THEN
159  IF(namcof.NE.' '.OR.namcob.NE.' ') THEN
160  CALL anamar
161  WRITE(lu,*)
162  & '==> INITIALISATION OF TIDAL WATER LEVEL IN ANAMAR'
163  ENDIF
164  ELSE
165  IF(nammaf(1:1).NE.' ') THEN
166  WRITE(lu,*) 'READING DEPTH IN FILE MAF'
167  ul=lumaf
168  fformat=fmtmaf
169  ELSE
170  WRITE(lu,*) 'READING DEPTH IN FILE MAB'
171  ul=lumab
172  fformat=fmtmab
173  ENDIF
174  CALL lecdoi(uc, nameu,0, vc, namev, 0, depth,nameh,2,
175  & npoin2, ul, fformat, at, tm1, tm2,
176  & uc1, uc2, vc1, vc2,zm1, zm2,
177  & indim, 'HAUTEUR', nvhma, texmab,trouve,
178  & unitmab,phasmab)
179  CALL ov('X=Y-Z ', x=dzhdt, y=zm2, z=zm1, dim1=npoin2)
180  CALL ov('X=CX ', x=dzhdt, c=1.d0/(tm2-tm1), dim1=npoin2)
181  ENDIF
182 !
183  ENDIF
184  ENDIF
185 !
186 ! INITIALISES THE CONSTANT CURRENT
187 !
188  IF(cousta) THEN
189  IF(namcof(1:1).EQ.' '.AND.namcob(1:1).EQ.' ') THEN
190  CALL anacos
191  WRITE(lu,*)' '
192  WRITE(lu,*)'USE OF CURRENT VELOCITIES'
193  WRITE(lu,*)
194  & 'BUT NO CURRENT FILE (NEITHER TELEMAC DATA FILE)'
195  WRITE(lu,*)
196  & '==> INITIALISATION OF CURRENT VELOCITIES IN ANACOS'
197  ELSE
198  IF(namcof(1:1).NE.' ') THEN
199  ul=lucof
200  fformat=fmtcof
201  ELSE
202  ul=lucob
203  fformat=fmtcob
204  ENDIF
205 ! HERE DEPTH POSSIBLY READ AS THIRD VARIABLE
206  CALL lecdon(uc, nameu, 2, vc, namev, 2, depth, nameh, 1,
207  & npoin2, ul, fformat, indic, 'COURANT', texcob,
208  & trouve)
209  ENDIF
210  CALL ov('X=C ', x=dzhdt, c=0.d0, dim1=npoin2)
211  ENDIF
212 !
213  IF(part.EQ.wac_cpl_init) THEN
214  CALL os('X=Y ', x=sdepth, y=htel)
215  CALL ov('X=Y ', x=uc, y=utel%R, dim1=npoin2)
216  CALL ov('X=Y ', x=vc, y=vtel%R, dim1=npoin2)
217  ENDIF
218 !
219 !-----------------------------------------------------------------------
220 !
221 ! INITIALISES THE WIND
222 !
223  IF(vent) THEN
224 !
225  DO j=1,3
226  trouve(j)=.false.
227  ENDDO
228  IF(namvef(1:1).EQ.' '.AND.namveb(1:1).EQ.' ' ) THEN
229  WRITE(lu,*) ' '
230  WRITE(lu,*)'USE OF WIND VELOCITIES'
231  WRITE(lu,*)'BUT NO WIND FILE '
232  WRITE(lu,*)'==> INITIALISATION OF WIND VELOCITIES IN ANAVEN'
233  WRITE(lu,*) ' '
234  CALL anaven
235  ELSE
236  IF(namvef(1:1).NE.' ') THEN
237  ul=luvef
238  fformat=fmtvef
239  ELSE
240  ul=luveb
241  fformat=fmtveb
242  ENDIF
243  IF(vensta) THEN
244  CALL lecdon(uv, namewx,2,
245  & vv, namewy,2,
246  & vv,'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',0,
247  & npoin2,ul, fformat,
248  & indiv,'WIND ',texveb,trouve)
249  ELSE
250  CALL lecdoi(uv, namewx,2,
251  & vv, namewy,2,
252  & vv, 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',0,
253  & npoin2, ul, fformat,
254  & at,tv1,tv2, uv1, uv2, vv1, vv2,
255  & vv1, vv2, indiv, 'VENT ', nvwin, texveb,
256  & trouve, unitveb, phasveb)
257  ENDIF
258  ENDIF
259  ENDIF
260 !
261 !-----------------------------------------------------------------------
262 !
263 ! INITIALISES F
264 !
265  IF((inispe.EQ.1.OR.inispe.EQ.3.OR.inispe.EQ.5).AND..NOT.vent) THEN
266 ! SPECTRUM is NULL
267  CALL speini(f, tra01(1:nf), tra01(nf+1:nf+ndire),
268  & uv, vv,
271  & ndire, nf, 0, depth, frabi)
272  ELSE
273  CALL speini(f, tra01(1:nf), tra01(nf+1:nf+ndire),
274  & uv, vv,
277  & ndire, nf, inispe, depth, frabi)
278  ENDIF
279 !
280 !-----------------------------------------------------------------------
281 !
282  RETURN
283  END
subroutine anacos
Definition: anacos.f:4
subroutine ov(OP, X, Y, Z, C, DIM1)
Definition: ov.f:7
double precision, dimension(:), pointer uv
double precision, dimension(:), pointer uc2
character(len=8), pointer fmtveb
subroutine anaven
Definition: anaven.f:4
double precision, dimension(:), pointer dzhdt
double precision, dimension(:), pointer vc
double precision, dimension(:), pointer vc2
double precision, dimension(:), pointer depth
double precision, dimension(:), pointer uc
character(len=8), pointer fmtvef
double precision, target at
subroutine anamar
Definition: anamar.f:4
double precision, dimension(:), pointer vv2
character(len=8), pointer fmtmab
double precision, dimension(:), pointer uv1
character(len=32), dimension(30) texveb
double precision, dimension(:), pointer f
double precision, dimension(:), pointer y
character(len=32), dimension(30) texmab
character(len=path_len), pointer nammaf
subroutine speini(F, SPEC, FRA, UV, VV, FREMAX, FETCH, SIGMAA, SIGMAB, GAMMA, FPIC, HM0, ALPHIL, TETA1, SPRED1, TETA2, SPRED2, XLAMDA, NPOIN2, NDIRE, NF, INISPE, DEPTH, FRABI)
Definition: speini.f:10
double precision, dimension(:), pointer uv2
double precision, dimension(:), pointer vc1
character(len=path_len), pointer namvef
integer, parameter wac_cpl_init
subroutine lecdoi(F1, NAME1, MODE1, F2, NAME2, MODE2, F3, NAME3, MODE3, NPOIN2, NDON, FFORMAT, AT, TV1, TV2, F11, F12, F21, F22, F31, F32, INDIC, CHDON, NVAR, TEXTE, TROUVE, UNITIME, PHASTIME)
Definition: lecdoi.f:10
character(len=path_len), pointer namcob
subroutine lecdon(F1, NAME1, MODE1, F2, NAME2, MODE2, F3, NAME3, MODE3, NPOIN2, NDON, FFORMAT, INDIC, CHDON, TEXTE, TROUVE)
Definition: lecdon.f:8
double precision, dimension(:), pointer zm2
double precision, dimension(:), pointer tra01
double precision, dimension(:), pointer zm1
double precision, dimension(:), pointer vv
subroutine condiw(PART, UTEL, VTEL, HTEL)
Definition: condiw.f:7
double precision, dimension(:), pointer uc1
character(len=8), pointer fmtcob
character(len=8), pointer fmtmaf
double precision, dimension(:), pointer vv1
character(len=8), pointer fmtcof
character(len=path_len), pointer namcof
subroutine os(OP, X, Y, Z, C, IOPT, INFINI, ZERO)
Definition: os.f:7
character(len=path_len), pointer namveb
type(bief_obj), target sdepth
character(len=32), dimension(30) texcob
character(len=path_len), pointer nammab
double precision, dimension(:), pointer x
Definition: bief.f:3