The TELEMAC-MASCARET system  trunk
lecdon_postel3d.f
Go to the documentation of this file.
1 ! **************************
2  SUBROUTINE lecdon_postel3d
3 ! **************************
4 !
5  &(motcar,file_desc,path,ncar)
6 !
7 !***********************************************************************
8 ! POSTEL3D VERSION 6.0 01/09/99 T. DENOT (LNH) 01 30 87 74 89
9 ! FORTRAN90
10 !***********************************************************************
11 !
12 ! SOUS-PROGRAMME APPELE PAR : HOMERE_POSTEL3D
13 ! SOUS-PROGRAMME APPELES : DAMOC , LIT
14 !
15 !history Y AUDOUIN (LNHE)
16 !+ 25/05/2015
17 !+ V7P0
18 !+ Modification to comply with the hermes module
19 !
20 !**********************************************************************
21 !
25 !
27  IMPLICIT NONE
28 !
29 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
30 !
31  INTEGER, INTENT(IN) :: NCAR
32  CHARACTER(LEN=PATH_LEN), INTENT(IN) :: PATH
33  CHARACTER(LEN=PATH_LEN), INTENT(INOUT) :: FILE_DESC(4,maxkeyword)
34  CHARACTER(LEN=PATH_LEN), INTENT(INOUT) :: MOTCAR(maxkeyword)
35 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
36 !
37  CHARACTER(LEN=PATH_LEN) NOM_CAS,NOM_DIC
38  CHARACTER(LEN=24), PARAMETER :: CODE='POSTEL3D '
39 !
40 !
41 ! DECLARATION DES VARIABLES LUES DANS NPRE
42 !
43  INTEGER ADRESS(4,maxkeyword),DIMENS(4,maxkeyword)
44  DOUBLE PRECISION MOTREA(maxkeyword)
45  INTEGER MOTINT(maxkeyword)
46  LOGICAL MOTLOG(maxkeyword)
47 !
48  CHARACTER(LEN=72) MOTCLE(4,maxkeyword,2)
49  INTEGER TROUVE(4,maxkeyword)
50  INTEGER J,K
51  LOGICAL DOC
52 !
53  INTEGER ERR
54  CHARACTER(LEN=8) FFORMAT
55  CHARACTER(LEN=80) TITLE
56  CHARACTER(LEN=16),ALLOCATABLE :: VAR_NAME(:), VAR_UNIT(:)
57  INTEGER FID
58  INTEGER ID_CAS, ID_DICO
59 !
60 !***********************************************************************
61 !
62 !-----------------------------------------------------------------------
63 !
64 !-----------------------------------------------------------------------
65 !
66 ! LECTURE DU FICHIER CAS
67 !
68  WRITE(lu,22)
69 !
70  DO k=1,maxkeyword
71 !
72 ! UN FICHIER NON DONNE PAR DAMOCLES SERA RECONNU PAR UN BLANC
73 ! (IL N'EST PAS SUR QUE TOUS LES COMPILATEURS INITIALISENT AINSI)
74 !
75  motcar(k)(1:1)=' '
76 !
77  dimens(1,k) = 0
78  dimens(2,k) = 0
79  dimens(3,k) = 0
80  dimens(4,k) = 0
81 !
82  ENDDO
83 !
84 ! IMPRESSION DE LA DOC
85  doc = .false.
86 !
87 !-----------------------------------------------------------------------
88 ! OUVERTURE DES FICHIERS DICTIONNAIRE ET CAS
89 !-----------------------------------------------------------------------
90 !
91  IF(ncar.GT.0) THEN
92  nom_dic=path(1:ncar)//'POSDICO'
93  nom_cas=path(1:ncar)//'POSCAS'
94  ELSE
95  nom_dic='POSDICO'
96  nom_cas='POSCAS'
97  ENDIF
98 !
99  CALL get_free_id(id_dico)
100  OPEN(id_dico,file=nom_dic,form='FORMATTED',action='READ')
101  CALL get_free_id(id_cas)
102  OPEN(id_cas,file=nom_cas,form='FORMATTED',action='READ')
103 !
104  CALL damocle( adress , dimens , maxkeyword, doc , lng , lu ,
105  & motint , motrea , motlog , motcar , motcle ,
106  & trouve , id_dico, id_cas , .false. , file_desc )
107 !
108 !-----------------------------------------------------------------------
109 ! FERMETURE DES FICHIERS DICTIONNAIRE ET CAS
110 !-----------------------------------------------------------------------
111 !
112  CLOSE(id_dico)
113  CLOSE(id_cas)
114 !
115 ! DECRYPTAGE DES CHAINES SUBMIT
116 !
117  CALL read_submit(pos_files,100,file_desc,maxkeyword)
118 !
119 !-----------------------------------------------------------------------
120 !
121 ! RETRIEVING FILES NUMBERS IN POSTEL-3D FORTRAN PARAMETERS
122 !
123  DO j=1,100
124  IF(pos_files(j)%TELNAME.EQ.'POSPRE') THEN
125  pospre=j
126  ELSEIF(pos_files(j)%TELNAME.EQ.'POSHOR') THEN
127  poshor=j
128  ELSEIF(pos_files(j)%TELNAME.EQ.'POSVER') THEN
129  posver=j
130  ELSEIF(pos_files(j)%TELNAME.EQ.'POSGEO') THEN
131  posgeo=j
132  ENDIF
133  ENDDO
134 !
135 !-----------------------------------------------------------------------
136 !
137 ! MOTS CLES LIES A TOUTES LES COUPES
138 !
139  nuprso = max(motint(adress(1,3)),1)
140  pesogr = max(motint(adress(1,4)),1)
141 !
142 ! FORMATS
143 !
144  pos_files(pospre)%FMT = motcar( adress(4, 19) )(1:8)
145  pos_files(poshor)%FMT = motcar( adress(4, 20) )(1:8)
146  pos_files(posver)%FMT = motcar( adress(4, 21) )(1:8)
147  pos_files(posgeo)%FMT = motcar( adress(4, 18) )(1:8)
148 !
149  pos_files(pospre)%NAME = motcar( adress(4, 3) )
150  pos_files(poshor)%NAME = motcar( adress(4, 4) )
151  pos_files(posver)%NAME = motcar( adress(4, 5) )
152  pos_files(posgeo)%NAME = motcar( adress(4,16) )
153 !
154 !-----------------------------------------------------------------------
155 !
156 ! LECTURE PARTIELLE DU FICHIER DE RESULTATS 3D
157 ! CERTAINES DONNEES (NOMBRE DE POINTS,...) SONT INDISPENSABLES POUR
158 ! CONSTRUIRE LES POINTEURS + COMPTAGE DU NOMBRE D'ENREGISTREMENTS
159 !
160  fformat = pos_files(pospre)%FMT
161  CALL open_mesh(fformat,pos_files(pospre)%TELNAME,fid,'READ ',
162  & err)
163  CALL check_call(err,'LECDON_POSTEL3D:OPEN_MESH')
164 !
165  ! Reading the title
166  CALL get_mesh_title(fformat,fid,title,err)
167  CALL check_call(err,'LECDON_POSTEL3D:GET_MESH_TITLE')
168  titcas = title(1:72)
169 
170  ! Get the number of variables
171  CALL get_data_nvar(fformat,fid,nva3,err)
172  CALL check_call(err,'LECDON_POSTEL3D:GET_DATA_NVAR')
173 
174  ! Get the Name and Unit of the variables
175  ALLOCATE(var_name(nva3),stat=err)
176  CALL check_allocate(err,'LECDON_POSTEL3D:VAR_NAME')
177  ALLOCATE(var_unit(nva3),stat=err)
178  CALL check_allocate(err,'LECDON_POSTEL3D:VAR_UNIT')
179  CALL get_data_var_list(fformat,fid,nva3,var_name,var_unit,err)
180  CALL check_call(err,'LECDON_POSTEL3D:GET_DATA_NVAR')
181  DO k=1,nva3
182  textlu(k)(1:16) = var_name(k)
183  textlu(k)(17:32) = var_unit(k)
184  ENDDO
185  DEALLOCATE(var_name)
186  DEALLOCATE(var_unit)
187 
188  ! Get the number of planes
189  CALL get_mesh_nplan(fformat,fid,nplan,err)
190  CALL check_call(err,'LECDON_POSTEL3D:GET_MESH_NPLAN')
191 
192  ! Get the number of planes
193  CALL get_data_ntimestep(fformat,fid,nenre,err)
194  CALL check_call(err,'LECDON_POSTEL3D:GET_DATA_TIMESTEP')
195 
196  CALL close_mesh(fformat,fid,err)
197  CALL check_call(err,'LECDON_POSTEL3D:CLOSE_MESH')
198 
199 !
200 !
201 !-----------------------------------------------------------------------
202 !
203 ! MOTS CLES LIES AUX COUPES HORIZONTALES
204 !
205  nc2dh = min(max(motint(adress(1,1)),0),9)
206 !
207  IF(nc2dh.GE.1) THEN
208  DO k=1,nc2dh
209  nplref(k) = k-1
210  IF (k.LE.dimens(1,5)) nplref(k) = motint(adress(1,5)+k-1)
211 !th un controle que l'on peut pour l'instant enlever
212 !th (on ne connait pas nplan actuellement
213 !th NPLREF(K) = MIN(MAX(NPLREF(K),0),NPLAN)
214  href(k) = 0.d0
215  IF (k.LE.dimens(2,1)) href(k) = motrea(adress(2,1)+k-1)
216  ENDDO
217  ENDIF
218 !
219 ! MOTS CLES LIES AUX COUPES VERTICALES
220 !
221  nc2dv = min(max(motint(adress(1,2)),0),9)
222 !
223  im = motint(adress(1,6))
224  jm = nplan
225 !
226  IF(nc2dv.GE.1) THEN
227  DO k=1,nc2dv
228  nseg(k) = min(dimens(2,2*k),dimens(2,2*k+1)) - 1
229  IF (nseg(k).LT.1) THEN
230  WRITE(lu,92) k
231  CALL plante(0)
232  ENDIF
233  DO j=0,nseg(k)
234  x2dv(j+1,k) = motrea(adress(2,2*k )+j)
235  y2dv(j+1,k) = motrea(adress(2,2*k+1)+j)
236  ENDDO
237  distor(k) = 1.d0
238  IF (k.LE.dimens(2,20)) distor(k) = motrea(adress(2,20)+k-1)
239  im = max(im,nseg(k)+1)
240  ENDDO !K
241  ENDIF
242 !
243 ! ARRET EN CAS DE DEMANDE DE COUPES NULLE
244 !
245  IF (nc2dh+nc2dv.EQ.0) THEN
246  WRITE(lu,102)
247  CALL plante(1)
248  stop
249  ENDIF
250 !
251 !-----------------------------------------------------------------------
252 !
253 22 FORMAT(/,19x,'********************************************',/,
254  & 19x,'* READING OF THE PARAMETERS *',/,
255  & 19x,'* CALLING DAMOCLES *',/,
256  & 19x,'* CHECKING READ DATA *',/,
257  & 19x,'* ON THE STEERING FILE *',/,
258  & 19x,'********************************************',/)
259 !
260 !-----------------------------------------------------------------------
261 !
262 92 FORMAT('VERTICAL CROSS SECTION',i2,' IS NOT WELL DEFINED :',/,
263  & 'YOU NEED AT LEAST 2 ABSCISSAE AND 2 ORDONATES')
264 !
265 102 FORMAT('YOU HAVE ASKED NO HORIZONTAL CROSS SECTION AND',/,
266  & 'NO VERTICAL CROSS SECTION, POSTEL3D HAS NOTHING TO DO')
267 !
268  RETURN
269  END SUBROUTINE
double precision, dimension(:), pointer x
subroutine close_mesh(FFORMAT, FILE_ID, IERR, MESH_NUMBER)
Definition: close_mesh.f:7
subroutine get_data_nvar(FFORMAT, FID, NVAR, IERR)
Definition: get_data_nvar.f:7
integer, dimension(9) nplref
subroutine get_data_var_list(FFORMAT, FID, NVAR, VARLIST, UNITLIST, IERR)
double precision, dimension(9) href
subroutine read_submit(FILES, NFILES, SUBMIT, NMOT)
Definition: read_submit.f:7
type(bief_file), dimension(100) pos_files
integer, dimension(9) nseg
integer, parameter maxkeyword
double precision, dimension(50, 9) x2dv
character(len=32), dimension(100) textlu
subroutine get_mesh_title(FFORMAT, FID, TITLE, IERR)
Definition: get_mesh_title.f:7
subroutine damocle(ADRESS, DIMENS, NMAX, DOC, LLNG, LLU, MOTINT, MOTREA, MOTLOG, MOTCAR, MOTCLE, TROUVE, NFICMO, NFICDA, GESTD, MOTATT)
Definition: damocle.f:9
subroutine get_mesh_nplan(FFORMAT, FID, NPLAN, IERR)
Definition: get_mesh_nplan.f:7
subroutine open_mesh(FFORMAT, FILE_NAME, FILE_ID, OPENMODE, IERR, MESH_NUMBER)
Definition: open_mesh.f:7
subroutine get_data_ntimestep(FFORMAT, FID, NTIMESTEP, IERR)
subroutine lecdon_postel3d(MOTCAR, FILE_DESC, PATH, NCAR)
double precision, dimension(50, 9) y2dv
double precision, dimension(9) distor