The TELEMAC-MASCARET system  trunk
api_run_sis.f
Go to the documentation of this file.
1 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 !
5  MODULE api_run_sis
6 !
7 
12  USE bief
16  USE declarations_parallel, ONLY : comm
17  IMPLICIT NONE
18  PRIVATE
19  ! COMMON VALUES TO DEFINE OUTPUT + LANGUAGE
20 !
22 !
23  CHARACTER(LEN=24), PARAMETER :: code='SISYPHE '
24 !
25  CHARACTER(LEN=MAXLENTMPDIR) path
26  CHARACTER(LEN=250) motcar(300),file_desc(4,300)
27 !
28  INTEGER time_in_seconds
29  EXTERNAL time_in_seconds
30 !
31 ! List the public subroutines
32 !
33  PUBLIC :: run_set_config_sis_d
34  PUBLIC :: run_read_case_sis_d
35  PUBLIC :: run_allocation_sis_d
36  PUBLIC :: run_init_sis_d
37  PUBLIC :: run_timestep_sis_d
38  PUBLIC :: run_finalize_sis_d
39 
40  CONTAINS
41  ! SET THE LU AND LNG VALUES
42  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
52  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
53  SUBROUTINE run_set_config_sis_d(INST, U_LU, U_LNG, U_COMM,
54  & U_STD_OUTPUT, IERR)
55  TYPE(instance_sis), INTENT(INOUT) :: inst
56  INTEGER, INTENT(IN) :: U_LU, U_LNG, U_COMM
57  LOGICAL, INTENT(IN) :: U_STD_OUTPUT
58  INTEGER, INTENT(OUT) :: IERR
59 !
60  ierr = 0
61 !
62  lu = u_lu
63  lng = u_lng
64  comm = u_comm
65  std_output = u_std_output
66 !
67  END SUBROUTINE run_set_config_sis_d
68 !
69 !!!!!!! FUNCTION HANDLING THE EXECUTION OF THE SIMULATION
70 !
71  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
82  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
83  SUBROUTINE run_read_case_sis_d(INST,CODE1,CAS_FILE,DICO_FILE,
84  & INIT,IERR)
85 !
86  TYPE(instance_sis), INTENT(INOUT) :: INST
87  CHARACTER(LEN=24), INTENT(IN) :: CODE1
88  CHARACTER(LEN=250), INTENT(IN) :: CAS_FILE
89  CHARACTER(LEN=250), INTENT(IN) :: DICO_FILE
90  LOGICAL, INTENT(IN) :: INIT
91  INTEGER, INTENT(OUT) :: IERR
92 !
93 !
94  ierr = 0
95 !
96  CALL bief_init(path,ncar,init)
97 !
99 !
100 ! HEADING TO THE LISTING
101 !
102  CALL print_header(code1,' ')
103 !
104 !-----------------------------------------------------------------------
105 !
106 ! READS THE STEERING FILE
107 !
109  & cas_file,dico_file)
110 !
111  END SUBROUTINE run_read_case_sis_d
112 !
113  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
115  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
120  SUBROUTINE run_allocation_sis_d(INST,IERR)
121  TYPE(instance_sis), INTENT(INOUT) :: INST
122  INTEGER, INTENT(OUT) :: IERR
123 
124  ierr = 0
125  iflot = 0
126  CALL bief_open_files(code,inst%SIS_FILES,inst%MAXLU_SIS,
127  & path,ncar,2,.true.)
128 !
129 !-----------------------------------------------------------------------
130 !
131 ! ALLOCATES VECTORS, MATRICES AND BLOCKS
132 !
133  CALL point_sisyphe
134  END SUBROUTINE run_allocation_sis_d
135 
136 !
137  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
139  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
143  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
144  SUBROUTINE run_init_sis_d(INST,IERR)
145 !
146  TYPE(instance_sis), INTENT(INOUT) :: INST
147  INTEGER, INTENT(OUT) :: IERR
148 !
149  ierr = 0
150 
151  CALL sisyphe(2, inst%TEL%LOOPCOUNT,inst%TEL%GRAPHCOUNT,
152  & inst%TEL%LISTCOUNT, inst%TEL%NIT, inst%TEL%U,
153  & inst%TEL%V, inst%TEL%H, inst%TEL%HN,
154  & inst%TEL%ZF, inst%TEL%UETCAR,
155  & inst%TEL%CF, inst%TEL%KS, inst%TEL%SIS_CPL%CONSTFLOW,
156  & inst%TEL%SIS_CPL%NSIS_CFD,inst%TEL%SIS_CPL%SISYPHE_CFD,
157  & inst%TEL%CODE, inst%TEL%PERICOU, inst%TEL%U3D,
158  & inst%TEL%V3D, inst%TEL%T, inst%TEL%VISC, inst%TEL%DT,
159  & inst%TEL%SIS_CPL%CHARR, inst%TEL%SIS_CPL%SUSP,
160  & inst%TEL%FLBOR,inst%TEL%SOLSYS, inst%TEL%DM1,
161  & inst%TEL%UCONV,inst%TEL%VCONV, inst%TEL%ZCONV,
162  & inst%TEL%THETAW,inst%TEL%HW, inst%TEL%TW, inst%TEL%UW,
163  & inst%TEL%YAGOUT,api_iter=inst%LT,grcomp=inst%TEL%COMPLEO)
164 
165  nit_ori = inst%NIT !NEED TO CHECK THESE VARIABLE
166  nit_to_do = nit_ori !NEED TO CHECK THESE VARIABLE
167  END SUBROUTINE run_init_sis_d
168 
169 !
170  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
172  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
176  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
177  SUBROUTINE run_timestep_sis_d(INST,IERR)
178 !
179  TYPE(instance_sis), INTENT(INOUT) :: INST
180  INTEGER, INTENT(OUT) :: IERR
181 !
182  ierr = 0
183 !
184  IF (nit_to_do.LT.0) THEN
185  ierr = overtime_error
186  err_mess = 'INITIAL NUMBER OF TIMESTEP OVERREACHED'
187  ENDIF
188  inst%LT=inst%NIT-nit_to_do+1 !RESTE A TROUVER LE LT DE SISYPHE
189 
190  CALL sisyphe(3, inst%TEL%LOOPCOUNT,inst%TEL%GRAPHCOUNT,
191  & inst%TEL%LISTCOUNT, inst%TEL%NIT, inst%TEL%U,
192  & inst%TEL%V, inst%TEL%H, inst%TEL%HN,
193  & inst%TEL%ZF, inst%TEL%UETCAR,
194  & inst%TEL%CF, inst%TEL%KS, inst%TEL%SIS_CPL%CONSTFLOW,
195  & inst%TEL%SIS_CPL%NSIS_CFD,inst%TEL%SIS_CPL%SISYPHE_CFD,
196  & inst%TEL%CODE, inst%TEL%PERICOU, inst%TEL%U3D,
197  & inst%TEL%V3D, inst%TEL%T, inst%TEL%VISC, inst%TEL%DT,
198  & inst%TEL%SIS_CPL%CHARR, inst%TEL%SIS_CPL%SUSP,
199  & inst%TEL%FLBOR, inst%TEL%SOLSYS, inst%TEL%DM1,
200  & inst%TEL%UCONV, inst%TEL%VCONV, inst%TEL%ZCONV,
201  & inst%TEL%THETAW, inst%TEL%HW, inst%TEL%TW, inst%TEL%UW,
202  & inst%TEL%YAGOUT,api_iter=inst%LT,grcomp=inst%TEL%COMPLEO)
203 
204  nit_to_do = nit_to_do - 1
205 !
206  END SUBROUTINE run_timestep_sis_d
207 
208 !
209  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
211  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
215  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
216 !
217  SUBROUTINE run_finalize_sis_d(INST,IERR)
218 !
219  TYPE(instance_sis), INTENT(INOUT) :: INST
220  INTEGER, INTENT(OUT) :: IERR
221 !
222  ierr = 0
223 !
224 !-----------------------------------------------------------------------
225 !
226  CALL bief_close_files(inst%SIS_FILES,
227  & inst%MAXLU_SIS,.false.)
228  CALL deall_sisyphe()
229 !
230 !
231 !-----------------------------------------------------------------------
232 !
233  WRITE(lu,11)
234 11 FORMAT(1x,///,1x,'CORRECT END OF RUN',///)
235 !
236 !-----------------------------------------------------------------------
237 !
239  WRITE(lu,*) 'COMPUTER TIME: ',tfin-tdeb,' SECONDS'
240  ! Only closing file in stand alone otherwise telemac2d will do
241  ! it
242  IF(inst%TEL%CODE(1:7) == 'SISYPHE') THEN
243  ! Closing log files
244  IF(ipid.NE.0) THEN
245  CLOSE(lu)
246  ELSE
247  IF(.NOT.std_output) CLOSE(lu)
248  ENDIF
249  ENDIF
250 !
251 !-----------------------------------------------------------------------
252 !
253  END SUBROUTINE run_finalize_sis_d
254 !
255  END MODULE api_run_sis
subroutine, public run_read_case_sis_d(INST, CODE1, CAS_FILE, DICO_FILE, INIT, IERR)
Definition: api_run_sis.f:86
subroutine bief_init(CHAINE, NCAR, PINIT)
Definition: bief_init.f:7
subroutine, public run_init_sis_d(INST, IERR)
Definition: api_run_sis.f:146
subroutine, public run_allocation_sis_d(INST, IERR)
Definition: api_run_sis.f:122
integer, parameter overtime_error
character(len=250), dimension(4, 300) file_desc
Definition: api_run_sis.f:27
subroutine lecdon_sisyphe(MOTCAR, FILE_DESC, PATH, NCAR, CODE, CAS_FILE, DICO_FILE)
Definition: lecdon_sisyphe.f:7
subroutine, public run_set_config_sis_d(INST, U_LU, U_LNG, U_COMM, U_STD_OUTPUT, IERR)
Definition: api_run_sis.f:56
subroutine, public run_finalize_sis_d(INST, IERR)
Definition: api_run_sis.f:219
integer tdeb
Definition: api_run_sis.f:22
double precision, dimension(:), pointer x
character(len=24), parameter code
Definition: api_run_sis.f:24
integer, external time_in_seconds
Definition: api_run_sis.f:29
integer iflot
Definition: api_run_sis.f:22
character(len=250), dimension(300) motcar
Definition: api_run_sis.f:27
integer nit_to_do
Definition: api_run_sis.f:22
character(len=maxlentmpdir) path
Definition: api_run_sis.f:26
subroutine point_sisyphe
Definition: point_sisyphe.f:4
character(len=error_mess_len) err_mess
Error message.
subroutine deall_sisyphe
Definition: deall_sisyphe.f:4
subroutine bief_open_files(CODE, FILES, NFILES, PATH, NCAR, ICODE, FULLNAME)
integer ncar
Definition: api_run_sis.f:22
integer tfin
Definition: api_run_sis.f:22
subroutine sisyphe(PART, LOOPCOUNT, GRAFCOUNT, LISTCOUNT, TELNIT, U_TEL, V_TEL, H_TEL, HN_TEL, ZF_TEL, UETCAR, CF_TEL, KS_TEL, CONSTFLOW, NSIS_CFD, SISYPHE_CFD, CODE, PERICOU, U3D, V3D, T_TEL, VISC_TEL, DT_TEL, CHARR_TEL, SUSP_TEL, FLBOR_TEL, SOLSYS, DM1, UCONV_TEL, VCONV_TEL, ZCONV, THETAW_TEL, HW_TEL, TW_TEL, UW_TEL, YAGOUT, API_ITER, GRCOMP)
Definition: sisyphe.F:12
subroutine bief_close_files(FILES, NFILES, PEXIT)
integer nit_ori
Definition: api_run_sis.f:22
subroutine, public run_timestep_sis_d(INST, IERR)
Definition: api_run_sis.f:179
Definition: bief.f:3