The TELEMAC-MASCARET system  trunk
api_run_wac.f
Go to the documentation of this file.
1 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 !
5  MODULE api_run_wac
6 !
12  & ipid
13  USE declarations_parallel, ONLY : comm
15  IMPLICIT NONE
16  PRIVATE
17  ! COMMON VALUES TO DEFINE OUTPUT + LANGUAGE
18 !
19  INTEGER tdeb(8),tfin(8),ncar,nit_ori
20  DOUBLE PRECISION :: dt_ori
21 !
22  CHARACTER(LEN=24), PARAMETER :: code='TOMAWAC '
23  CHARACTER(LEN=250) file_desc(4,maxkeyword)
24 !
25  CHARACTER(LEN=MAXLENTMPDIR) path
26 !
27 ! List the public subroutines
28 !
29  PUBLIC :: run_set_config_wac_d
30  PUBLIC :: run_read_case_wac_d
31  PUBLIC :: run_allocation_wac_d
32  PUBLIC :: run_init_wac_d
33  PUBLIC :: run_timestep_wac_d
34  PUBLIC :: run_finalize_wac_d
35  SAVE
36 !
37  CONTAINS
38  !
39  ! SET THE LU AND LNG VALUES
40  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
51  SUBROUTINE run_set_config_wac_d(INST, U_LU, U_LNG, U_COMM,
52  & U_STD_OUTPUT, IERR)
53  TYPE(instance_wac), INTENT(INOUT) :: inst
54  INTEGER, INTENT(IN) :: U_LU, U_LNG, U_COMM
55  LOGICAL, INTENT(IN) :: U_STD_OUTPUT
56  INTEGER, INTENT(OUT) :: IERR
57 !
58  ierr = 0
59 !
60  lu = u_lu
61  lng = u_lng
62  comm = u_comm
63  std_output = u_std_output
64 !
65  END SUBROUTINE run_set_config_wac_d
66 !
67 !!!!!!! FUNCTION HANDLING THE EXECUTION OF THE SIMULATION
68 !
69  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
71  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
79  SUBROUTINE run_read_case_wac_d(INST,CAS_FILE, DICO_FILE,INIT,IERR)
80 !
81  TYPE(instance_wac), INTENT(INOUT) :: INST
82  CHARACTER(LEN=250), INTENT(IN) :: CAS_FILE
83  CHARACTER(LEN=250), INTENT(IN) :: DICO_FILE
84  LOGICAL, INTENT(IN) :: INIT
85  INTEGER, INTENT(OUT) :: IERR
86 !
87  ierr = 0
88 !
89  CALL bief_init(path,ncar,init)
90 !
91 ! INITIAL TIME FOR COMPUTATION DURATION
92 !
93  CALL date_and_time(values=tdeb)
94 !
95 ! PRINTS BANNER TO LISTING
96 !
97  CALL print_header(code,' ')
98 !
99 !-----------------------------------------------------------------------
100 !
101 ! READS THE STEERING FILE
103  & path,ncar,cas_file,dico_file)
104 !
105 !-----------------------------------------------------------------------
106 !
107 ! OPENS THE FILES FOR TELEMAC2D
108 !
109  END SUBROUTINE run_read_case_wac_d
110 !
111  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
113  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
117  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
118  SUBROUTINE run_allocation_wac_d(INST,IERR)
119  TYPE(instance_wac), INTENT(INOUT) :: INST
120  INTEGER, INTENT(OUT) :: IERR
121 !
122  INTEGER :: IFLOT
123 !
124  ierr = 0
125 !
126  iflot = 0
127 
128  CALL bief_open_files(code,inst%WAC_FILES,
129  & inst%MAXLU_WAC,
130  & path,ncar,
131  & 1,.true.)
132 !
133 !-----------------------------------------------------------------------
134 !
135 ! ALLOCATES MEMORY
136 !
137  CALL point_tomawac
138 !
139 !-----------------------------------------------------------------------
140 !
141 !
142  END SUBROUTINE run_allocation_wac_d
143 !
144  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
146  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
150  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
151  SUBROUTINE run_init_wac_d(INST,IERR)
152 !
153  TYPE(instance_wac), INTENT(INOUT) :: INST
154  INTEGER, INTENT(OUT) :: IERR
155 !
156  ierr = 0
157 !
158  ! RUN THE INITIAL TIME STEP
159  nit_ori = inst%NIT
160  dt_ori = inst%DT
161  CALL wac(part=2,
162  & nit_ori=nit_ori)
163 !
164  END SUBROUTINE run_init_wac_d
165 !
166  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
168  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
172  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
173  SUBROUTINE run_timestep_wac_d(INST,IERR)
174 !
175  TYPE(instance_wac), INTENT(INOUT) :: INST
176  INTEGER, INTENT(OUT) :: IERR
177 !
178  ierr = 0
179 !
180  inst%NIT = 1
181  CALL wac(part=3,
182  & nit_ori=nit_ori)
183  END SUBROUTINE run_timestep_wac_d
184 !
185  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
187  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
191  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
192 !
193  SUBROUTINE run_finalize_wac_d(INST,IERR)
194 !
195  TYPE(instance_wac), INTENT(INOUT) :: INST
196  INTEGER, INTENT(OUT) :: IERR
197 !
198  ierr = 0
199 !
200  CALL bief_close_files(inst%WAC_FILES,
201  & inst%MAXLU_WAC,.false.)
202 !
203 ! DEALLOCATE ALL OF BIEF AND TELEMAC2D ARRAYS
204  CALL deall_tomawac()
205  CALL deall_bief()
206 !
207  WRITE(lu,11)
208 11 FORMAT(1x,///,1x,'CORRECT END OF RUN',///)
209 !
210 ! TIME OF END OF COMPUTATION
211 !
212  CALL date_and_time(values=tfin)
213  CALL elapse(tdeb,tfin)
214  ! Closing log files
215  IF(ipid.NE.0) THEN
216  CLOSE(lu)
217  ELSE
218  IF(.NOT.std_output) CLOSE(lu)
219  ENDIF
220 !
221  END SUBROUTINE run_finalize_wac_d
222 !
223  END MODULE api_run_wac
subroutine bief_init(CHAINE, NCAR, PINIT)
Definition: bief_init.f:7
subroutine deall_tomawac
Definition: deall_tomawac.f:4
subroutine, public run_set_config_wac_d(INST, U_LU, U_LNG, U_COMM, U_STD_OUTPUT, IERR)
Definition: api_run_wac.f:54
character(len=24), parameter code
Definition: api_run_wac.f:23
subroutine point_tomawac
Definition: point_tomawac.f:4
character(len=250), dimension(4, maxkeyword) file_desc
Definition: api_run_wac.f:24
double precision dt_ori
Definition: api_run_wac.f:21
character(len=maxlentmpdir) path
Definition: api_run_wac.f:26
integer, parameter maxkeyword
subroutine, public run_allocation_wac_d(INST, IERR)
Definition: api_run_wac.f:120
subroutine elapse(TDEB, TFIN)
Definition: elapse.f:7
subroutine wac(PART, NIT_ORI)
Definition: wac.F:7
logical function inclus(C1, C2)
Definition: inclus.f:7
subroutine, public run_read_case_wac_d(INST, CAS_FILE, DICO_FILE, INIT, IERR)
Definition: api_run_wac.f:81
integer ncar
Definition: api_run_wac.f:20
subroutine, public run_init_wac_d(INST, IERR)
Definition: api_run_wac.f:153
integer, dimension(8) tdeb
Definition: api_run_wac.f:20
subroutine lecdon_tomawac(FILE_DESC, PATH, NCAR, CAS_FILE, DICO_FILE)
Definition: lecdon_tomawac.f:7
integer nit_ori
Definition: api_run_wac.f:20
subroutine bief_open_files(CODE, FILES, NFILES, PATH, NCAR, ICODE, FULLNAME)
subroutine, public run_finalize_wac_d(INST, IERR)
Definition: api_run_wac.f:195
subroutine bief_close_files(FILES, NFILES, PEXIT)
integer, dimension(8) tfin
Definition: api_run_wac.f:20
subroutine deall_bief
Definition: deall_bief.f:4
subroutine, public run_timestep_wac_d(INST, IERR)
Definition: api_run_wac.f:175
Definition: bief.f:3