The TELEMAC-MASCARET system  trunk
declarations_special.F
Go to the documentation of this file.
1 ! ***************************
3 ! ***************************
4 !
5 !
6 !***********************************************************************
7 ! SPECIAL 09/05/2014
8 !***********************************************************************
9 !
10 !brief Defining parameters that need to be created first because they
11 !+ could be used by any other library.
12 !
13 !history Y. AUDOUIN & J-M HERVOUET (EDF LAB, LNHE)
14 !+ 09/05/2014
15 !+ V7P0
16 !+ First version.
17 !
18 !history Y AUDOUIN (LNHE)
19 !+ 25/05/2015
20 !+ V7P0
21 !+ Modification to comply with the hermes module
22 !
23 !history S.E. BOURBAN (HRW)
24 !+ 20/09/2016
25 !+ V7P2
26 !+ Enabling ENDIAN and FLOAT formats of the GEOMETRY file to be
27 !+ the default of all OUTPUT FILES binaries, unless the user sets
28 !+ it otherwise in the CAS file. Also:
29 !+ - ENDIAN is also compiler dependent
30 !
31 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33 !
34  IMPLICIT NONE
35 !----------------------------------------------------------------------
36 !
37  INTEGER, PARAMETER :: lng_fr=1
38  INTEGER, PARAMETER :: lng_en=2
39  INTEGER :: lng=lng_en ! Language for listing outputs
40  INTEGER, PARAMETER :: path_len = 250
41 
42  ! If false listing for proc 1 will be written into a file
43  LOGICAL :: std_output = .true.
44  INTEGER :: lu=6 ! Output id
45  INTEGER :: li=5 ! Input id
46  ! VERSION THAT IS DISPLAYED everywhere in the system
47  CHARACTER(LEN=6), PARAMETER :: version = 'V8P2 '
48  ! Max number of keywords
49  INTEGER, PARAMETER :: maxkeyword = 300
50  ! Max lenght of the path of the temporary folder
51  INTEGER, PARAMETER :: maxlentmpdir = 250
52  ! Max lenght for the name of a file
53  INTEGER, PARAMETER :: maxlenfile = 250
54  !
55  !True if partel should have only generated concatenated files and
56  !their index. False if partel should have generated one set of
57  !input files per process. Value is set in lecdon.
58  LOGICAL :: partel_concat = .false.
59  !
60 ! Integer values to allow the allocation of I4 and I8 integers.
61 !
62 ! The syntax will be :
63 !
64 ! INTEGER(KIND=K4) :: I (I WILL BE A 4-BYTE INTEGER)
65 ! INTEGER(KIND=K8) :: I (I WILL BE A 8-BYTE INTEGER)
66 !
67  INTEGER, PARAMETER :: k4 = selected_int_kind(8)
68  INTEGER, PARAMETER :: k8 = selected_int_kind(16)
69  INTEGER, PARAMETER :: r4 = selected_real_kind( 5, 20 ) ! SINGLE PRECISION SIZE
70  INTEGER, PARAMETER :: r8 = selected_real_kind( 10, 60 ) ! DOUBLE PRECISION SIZE
71 !
72 ! ERROR HANDLING
73  CHARACTER(LEN=200) :: error_message
74  INTEGER, PARAMETER :: no_error = 0
75  INTEGER, PARAMETER :: uncontrolled_err = 1
76  INTEGER, PARAMETER :: unknown_elt_type_err = 2
77 !
78 ! ERROR FOR HERMES
79  INTEGER, PARAMETER :: hermes_record_unknown_err = 1000
80  INTEGER, PARAMETER :: hermes_var_unknown_err = 1001
81  INTEGER, PARAMETER :: hermes_file_id_already_in_use_err = 1002
82  INTEGER, PARAMETER :: hermes_file_not_opened_err = 1003
83  INTEGER, PARAMETER :: hermes_max_file_err = 1004
84  INTEGER, PARAMETER :: hermes_wrong_array_size_err = 1005
85  INTEGER, PARAMETER :: hermes_med_not_loaded_err = 1006
86  INTEGER, PARAMETER :: hermes_unknown_element_type_err = 1007
87  INTEGER, PARAMETER :: hermes_wrong_element_type_err = 1008
88  INTEGER, PARAMETER :: hermes_unknown_group_err = 1009
89  INTEGER, PARAMETER :: hermes_wrong_hdf_format_err = 1010
90  INTEGER, PARAMETER :: hermes_wrong_med_format_err = 1011
91  INTEGER, PARAMETER :: hermes_wrong_med_version_err = 1012
92  INTEGER, PARAMETER :: hermes_wrong_axe_err = 1013
93  INTEGER, PARAMETER :: hermes_bnd_point_not_found_err = 1014
94  INTEGER, PARAMETER :: hermes_invalid_open_mode_err = 1015
95  INTEGER, PARAMETER :: hermes_invalid_serafin_file = 1016
96  INTEGER, PARAMETER :: hermes_wrong_size = 1017
97  INTEGER, PARAMETER :: hermes_unknown_bnd_condition = 1018
98  INTEGER, PARAMETER :: hermes_two_diff_liq_bnd_err = 1019
99  INTEGER, PARAMETER :: hermes_vtk_not_loaded_err = 1020
100  INTEGER, PARAMETER :: hermes_write_only_err = 1021
101  INTEGER, PARAMETER :: hermes_cgns_not_loaded_err = 1022
102  INTEGER, PARAMETER :: hermes_unknown_file_format_err = 1023
103 !
104 ! TYPE OF ELEMENTS
105 !
106  INTEGER, PARAMETER :: type_null = -1
107  INTEGER, PARAMETER :: point_elt_type = 0
108  INTEGER, PARAMETER :: point_bnd_elt_type = 1
109  INTEGER, PARAMETER :: triangle_elt_type = 10
110  INTEGER, PARAMETER :: quadrangle_elt_type = 20
111  INTEGER, PARAMETER :: tetrahedron_elt_type = 30
112  INTEGER, PARAMETER :: prism_elt_type = 40
113  INTEGER, PARAMETER :: split_prism_elt_type = 50
114  INTEGER, PARAMETER :: edge_bnd_elt_type = 55
115  INTEGER, PARAMETER :: triangle_bnd_elt_type = 60
116  INTEGER, PARAMETER :: quadrangle_bnd_elt_type = 70
117  INTEGER, PARAMETER :: triangle_3d_bnd_elt_type = 80
118 !
119 ! ID Tracking
120 !
121  INTEGER :: max_id = 10
122 !
123 ! SHARING AND PASSING ON THE ENDIAN AND THE PRECISION FORMATS
124 !
125 #if defined COMPAD || defined LITTLE_ENDIAN
126  CHARACTER(LEN=13) :: endian = 'LITTLE_ENDIAN'
127 #else
128  CHARACTER(LEN=13) :: endian = 'BIG_ENDIAN '
129 #endif
130 !
131  DOUBLE PRECISION tel_offset
132 !
133 !-----------------------------------------------------------------------
134 !
135 ! SPECIAL FLAGS THAT ALTER BEHAVIOUT OF DIFFERENTIATED MODELS
136 !
137 ! USE OF SYMBOLIC LINEAR SOLVER FOR AD
138 !
139  LOGICAL ad_symblinsolv
140 !
141 ! RESET DERIVATIVES FOR ITERATIVE LINEAR SOLVER FOR AD
142 !
143  LOGICAL ad_linsolv_resetderiv
144 !
145 ! USE DERIVATIVES FOR CONVERGENCE TEST IN LINEAR SOLVER FOR AD
146 !
148 !
149 !-----------------------------------------------------------------------
150 !
151  CONTAINS
152 
153  CHARACTER(LEN=12) FUNCTION i2char(INT_IN)
154  IMPLICIT NONE
155  INTEGER, INTENT(IN) :: INT_IN ! THE INTEGER TO CONVERT
156 !
157  CHARACTER(LEN=12) :: STRING ! TEMPORARY STRING
158  CHARACTER(LEN=5) :: THEFORMAT ! FORMAT TO USE FOR THE INTEGER
159  INTEGER :: N ! NUMBER OF DECIMALS IN THE INTEGER
160  ! WE LOOK FOR N SUCH THAT 10^{N-1} < INT_IN < 10^{N}
161  ! THIS IS DONE TO MAKE SURE THAT WE DO NOT CREATE A FORMAT "OVERFLOW"
162  n = 1
163  DO WHILE (int_in.GE.10**n)
164  n = n + 1
165  ENDDO
166  ! CHECK ON THE "LENGTH" OF THE INTEGER
167  IF (n .LE. 9) THEN
168  ! WRITE THE INTEGER IN A STRING WITH THE RIGHT FORMAT
169  WRITE(unit=theformat,fmt='(''(I'',I1,'')'')') n
170  WRITE(unit=string,fmt=theformat) int_in
171  ELSE IF ( (n .GE. 10) .AND. (n .LE. 12) ) THEN
172  ! WRITE THE INTEGER IN A STRING WITH THE RIGHT FORMAT
173  WRITE(unit=theformat,fmt='(''I'',I2)') n
174  WRITE(unit=string,fmt=theformat) int_in
175  ENDIF
176  ! TRIM THE STRING AND RETURN
177  i2char = trim(string)
178  END FUNCTION i2char
179 
180  END MODULE declarations_special
integer, parameter k8
integer, parameter maxlentmpdir
integer, parameter hermes_wrong_med_version_err
integer, parameter r8
integer, parameter prism_elt_type
integer, parameter hermes_vtk_not_loaded_err
integer, parameter hermes_wrong_hdf_format_err
integer, parameter triangle_3d_bnd_elt_type
integer, parameter uncontrolled_err
integer, parameter split_prism_elt_type
integer, parameter lng_en
integer, parameter point_elt_type
integer, parameter hermes_wrong_med_format_err
integer, parameter hermes_unknown_element_type_err
integer, parameter unknown_elt_type_err
integer, parameter hermes_wrong_axe_err
integer, parameter maxlenfile
integer, parameter hermes_two_diff_liq_bnd_err
integer, parameter triangle_elt_type
character(len=200) error_message
integer, parameter maxkeyword
integer, parameter hermes_file_id_already_in_use_err
integer, parameter hermes_unknown_bnd_condition
integer, parameter hermes_invalid_open_mode_err
integer, parameter quadrangle_bnd_elt_type
integer, parameter hermes_bnd_point_not_found_err
integer, parameter hermes_max_file_err
integer, parameter point_bnd_elt_type
integer, parameter lng_fr
Y. AUDOUIN & J-M HERVOUET (EDF LAB, LNHE) 09/05/2014 V7P0 First version.
integer, parameter hermes_invalid_serafin_file
integer, parameter hermes_record_unknown_err
integer, parameter hermes_cgns_not_loaded_err
integer, parameter edge_bnd_elt_type
integer, parameter hermes_unknown_group_err
integer, parameter triangle_bnd_elt_type
integer, parameter hermes_wrong_array_size_err
character(len=13) endian
integer, parameter hermes_wrong_size
integer, parameter tetrahedron_elt_type
integer, parameter no_error
integer, parameter quadrangle_elt_type
double precision tel_offset
integer, parameter hermes_file_not_opened_err
integer, parameter hermes_med_not_loaded_err
integer, parameter type_null
integer, parameter hermes_wrong_element_type_err
integer, parameter path_len
integer, parameter k4
integer, parameter hermes_var_unknown_err
integer, parameter hermes_unknown_file_format_err
integer, parameter hermes_write_only_err
integer, parameter r4
character(len=6), parameter version