The TELEMAC-MASCARET system  trunk
art_read_bin_frliq.f
Go to the documentation of this file.
1 ! *****************************
2  SUBROUTINE art_read_bin_frliq
3 ! *****************************
4 !
5  &(nom)
6 !
7 !***********************************************************************
8 ! TELEMAC2D V8P0 Dec 2018
9 !***********************************************************************
10 !
11 !brief READS A BINARY LIQUID BOUNDARY FILE AND EXTRACTS HM0 VALUES
12 !+ FOR THE REQUIRED TIME
13 !+ ASSUMES THAT IPOBO (BND) HAS THE GLOBAL NODE NUMBER WHETHER
14 !+ SIMULATION IS IN SERIAL OR PARALLEL MODE
15 !
16 !history N. DURAND (HRW)
17 !+ 14/09/2017
18 !+ V7P3
19 !+ First version
20 !
21 !history N. DURAND (HRW)
22 !+ Dec 2018
23 !+ V8P0
24 !+ WACLQD replaces ARTBI1
25 !
26 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28 !
30 !
32  IMPLICIT NONE
33 !
34 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
35 !
36  INTEGER :: IERR, I
37  INTEGER :: NFIC, TYP
38  INTEGER :: WACNVAR,WACNPOIN
39  INTEGER :: RECORD
40 !
41  CHARACTER(LEN=16) :: NOM
42  CHARACTER(LEN=8) :: FFORMAT
43  CHARACTER(LEN=16),ALLOCATABLE :: VARNAME(:),VARUNIT(:)
44 !
45  LOGICAL :: DEJAHS1
46 !
47 !-----------------------------------------------------------------------
48 !
49  nfic = art_files(waclqd)%LU
50  fformat = art_files(waclqd)%FMT
51 ! THE SUPPORT MESH IS (BOUNDARY) EDGES
52  typ = edge_bnd_elt_type
53  dejahs1 = .false.
54 !
55 !-----------------------------------------------------------------------
56 !
57 ! PARAMETERS OUTPUT TO THE TOMAWAC RESULT FILE
58 ! AND PRESENT IN THE BINARY BOUNDARY FILE
59 !
60  CALL get_data_nvar(fformat,nfic,wacnvar,ierr)
61  CALL check_call(ierr,'READ_BIN_FRLIQ:GET_DATA_NVAR')
62  ALLOCATE(varname(wacnvar),stat=ierr)
63  CALL check_allocate(ierr,'READ_BIN_FRLIQ:VARNAME')
64  ALLOCATE(varunit(wacnvar),stat=ierr)
65  CALL check_allocate(ierr,'READ_BIN_FRLIQ:VARUNIT')
66  CALL get_data_var_list(fformat,nfic,wacnvar,varname,varunit,ierr)
67  CALL check_call(ierr,'READ_BIN_FRLIQ:GET_DATA_VAR_LIST')
68 !
69 !-----------------------------------------------------------------------
70 !
71 ! NUMBER OF POINTS IN THE BINARY BOUNDARY FILE
72 !
73  CALL get_mesh_npoin(fformat,nfic,typ,wacnpoin,ierr)
74  CALL check_call(ierr,'READ_BIN_FRLIQ:GET_MESH_NPOIN')
75 !
76 !-----------------------------------------------------------------------
77 !
78 ! HM0 AT RECORD TPSTWC
79 !
80  WRITE(lu,201) tpstwc
81  CALL get_data_timestep(fformat,nfic,record,tpstwc,ierr)
82  CALL check_call(ierr,'READ_BIN_FRLIQ:GET_DATA_TIMESTEP')
83 !
84  DO i=1,wacnvar
85 
86  IF(varname(i).EQ.nom) THEN
87  IF(debug.GT.0) WRITE(lu,301) varname(i)
88  CALL get_data_value(fformat,nfic,record,varname(i),hbs%R,
89  & wacnpoin,ierr)
90  CALL check_call(ierr,'READ_BIN_FRLIQ:GET_DATA_VALUE')
91  dejahs1 = .true.
92 
93  ENDIF
94 
95  ENDDO
96 !
97  IF( .NOT.dejahs1 ) THEN
98  WRITE(lu,401)
99  CALL plante(1)
100  stop
101  ENDIF
102 !
103 !-----------------------------------------------------------------------
104 !
105  DEALLOCATE(varname,varunit)
106 !
107 !-----------------------------------------------------------------------
108 !
109 ! PRINTOUT FORMATS:
110 !
111 201 FORMAT(/,1x,'READ_BIN_FRLIQ : READING TIME STEP ',1f9.2,'S')
112 
113 301 FORMAT( 1x,' : PARAMETER ',1a18)
114 401 FORMAT(/,1x,'READ_BIN_FRLIQ : MISSING HM0 ',
115  & 'IN THE TOMAWAC RESULT FILE')
116 !
117 !-----------------------------------------------------------------------
118 !
119  RETURN
120  END
subroutine get_mesh_npoin(FFORMAT, FID, TYP_ELEM, NPOIN, IERR)
Definition: get_mesh_npoin.f:7
subroutine get_data_nvar(FFORMAT, FID, NVAR, IERR)
Definition: get_data_nvar.f:7
type(bief_obj), target hbs
subroutine get_data_var_list(FFORMAT, FID, NVAR, VARLIST, UNITLIST, IERR)
subroutine get_data_value(FFORMAT, FID, RECORD, VAR_NAME, RES_VALUE, N, IERR)
Definition: get_data_value.f:7
subroutine get_data_timestep(FFORMAT, FID, RECORD, TIME, IERR)
subroutine art_read_bin_frliq(NOM)
integer, parameter edge_bnd_elt_type
type(bief_file), dimension(maxlu_art), target art_files
double precision, dimension(:), pointer x