The TELEMAC-MASCARET system  trunk
homere_damocles.f
Go to the documentation of this file.
1 ! ***********************
2  PROGRAM homere_damocles
3 ! ***********************
4  USE dico_data
5  USE utils_latex
6  USE utils_cata
7  IMPLICIT NONE
8 !
9 !-----------------------------------------------------------------------
10 !
11  CHARACTER(LEN=PATH_LEN) :: DICTIONARY
12  CHARACTER(LEN=PATH_LEN) :: DEPENDENCIES
13  CHARACTER(LEN=PATH_LEN) :: LATEX_FILE
14  CHARACTER(LEN=PATH_LEN) :: ENUM_FILE
15  CHARACTER(LEN=PATH_LEN) :: TS_PATH
16  CHARACTER(LEN=5) :: TODO
17  CHARACTER(LEN=10) :: CODE_NAME
18  INTEGER LLNG
19  LOGICAL :: FILE_EXIST
20 !
21  WRITE(6,*) 'ENTER ACTION [LATEX,CATA,DUMP]'
22  READ(5,'(A)') todo
23 
24  IF(todo.EQ.'LATEX') THEN
25  WRITE(6,*) 'ENTER DICTIONARY FILE: '
26  READ(5,'(A)') dictionary
27  WRITE(6,*) 'DICTIONARY: ',trim(dictionary)
28  WRITE(6,*) 'ENTER LATEX FILE: '
29  READ(5,'(A)') latex_file
30  WRITE(6,*) 'LATEX_FILE: ',trim(latex_file)
31  WRITE(6,*) 'ENTER LANGUAGE [1: FRENCH, 2: ENGLISH]: '
32  READ(5,'(I1)') llng
33  WRITE(6,*) 'LANGUAGE: ',llng
34  ! Checking that the two file exist and that lng is 1 or 2
35  INQUIRE(file=dictionary,exist=file_exist)
36  IF(.NOT.file_exist) THEN
37  WRITE(6,*) 'ERROR FILE: ',trim(dictionary),' DOES NOT EXIST'
38  CALL plante(1)
39  stop
40  ENDIF
41  IF(lng.NE.lng_en.AND.lng.NE.lng_fr) THEN
42  WRITE(6,*) 'WRONG LANGUAGE: ',llng
43  ENDIF
44  ! Reading dictionary
45  CALL read_dictionary(dictionary)
46  ! Writing Latex file
47  CALL write2latex(latex_file,llng)
48  ELSE IF(todo(1:4).EQ.'CATA') THEN
49  WRITE(6,*) 'ENTER CODE NAME: '
50  READ(5,'(A)') code_name
51  WRITE(6,*) 'ENTER DICTIONARY FILE: '
52  READ(5,'(A)') dictionary
53  WRITE(6,*) 'DICTIONARY: ',trim(dictionary)
54  WRITE(6,*) 'ENTER DEPENDENCIES FILE: '
55  READ(5,'(A)') dependencies
56  WRITE(6,*) 'DEPENDENCIES: ',trim(dependencies)
57  WRITE(6,*) 'ENTER CATA FILE: '
58  READ(5,'(A)') latex_file
59  WRITE(6,*) 'CATA: ',trim(latex_file)
60  WRITE(6,*) 'ENTER ENUM FILE: '
61  READ(5,'(A)') enum_file
62  WRITE(6,*) 'ENUM: ',trim(enum_file)
63  WRITE(6,*) 'ENTER TS PATH FILE: '
64  READ(5,'(A)') ts_path
65  WRITE(6,*) 'TS PATH: ',trim(ts_path)
66  ! Checking that the two file exist and that llng is 1 or 2
67  INQUIRE(file=dictionary,exist=file_exist)
68  IF(.NOT.file_exist) THEN
69  WRITE(6,*) 'ERROR FILE: ',trim(dictionary),' DOES NOT EXIST'
70  CALL plante(1)
71  stop
72  ENDIF
73  ! Reading dictionary
74  CALL read_dictionary(dictionary)
75  ! Reading dependencies
76  CALL read_dependencies(dependencies)
77  ! Writing Latex file
78  CALL write2cata(latex_file, code_name)
79  ! WRITING Enumerate for CHOIX and keywords
80  CALL write_enum(enum_file)
81  ! WRITING TS
82  CALL write_ts(code_name, ts_path)
83  ELSE IF(todo(1:5).EQ.'DUMP2') THEN
84  WRITE(6,*) 'ENTER DICTIONARY FILE: '
85  READ(5,'(A)') dictionary
86  WRITE(6,*) 'DICTIONARY: ',trim(dictionary)
87  WRITE(6,*) 'ENTER OUTPUT FILE: '
88  READ(5,'(A)') latex_file
89  WRITE(6,*) 'CATA: ',trim(latex_file)
90  ! Checking that the two file exist and that llng is 1 or 2
91  INQUIRE(file=dictionary,exist=file_exist)
92  IF(.NOT.file_exist) THEN
93  WRITE(6,*) 'ERROR FILE: ',trim(dictionary),' DOES NOT EXIST'
94  CALL plante(1)
95  stop
96  ENDIF
97  ! Reading dictionary
98  CALL read_dictionary(dictionary)
99  ! Writing Latex file
100  CALL dump_dictionary_index(latex_file)
101  ELSE IF(todo(1:4).EQ.'DUMP') THEN
102  WRITE(6,*) 'ENTER DICTIONARY FILE: '
103  READ(5,'(A)') dictionary
104  WRITE(6,*) 'DICTIONARY: ',trim(dictionary)
105  WRITE(6,*) 'ENTER OUTPUT FILE: '
106  READ(5,'(A)') latex_file
107  WRITE(6,*) 'CATA: ',trim(latex_file)
108  ! Checking that the two file exist and that llng is 1 or 2
109  INQUIRE(file=dictionary,exist=file_exist)
110  IF(.NOT.file_exist) THEN
111  WRITE(6,*) 'ERROR FILE: ',trim(dictionary),' DOES NOT EXIST'
112  CALL plante(1)
113  stop
114  ENDIF
115  ! Reading dictionary
116  CALL read_dictionary(dictionary)
117  ! Writing Latex file
118  CALL dump_dictionary_rub(latex_file)
119  ELSE
120  WRITE(6,*) 'UNKNOWN ACTION',todo
121  CALL plante(1)
122  stop
123  ENDIF
124  stop 0
125  END
126 
program homere_damocles
subroutine read_dictionary(FILENAME)
Definition: dico_data.f:688
subroutine write2latex(FILENAME, LNG)
Definition: utils_latex.f:128
subroutine read_dependencies(FILENAME)
Definition: dico_data.f:610
subroutine dump_dictionary_index(FILENAME)
Definition: dico_data.f:1320
subroutine dump_dictionary_rub(FILENAME)
Definition: dico_data.f:1364