The TELEMAC-MASCARET system  trunk
api_coupling.f
Go to the documentation of this file.
1 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 !
5 !
6  MODULE api_coupling
7 !
12 
13  IMPLICIT NONE
14  PRIVATE
15 
16  PUBLIC :: save_charr_susp_cpl
17  PUBLIC :: charr_or_susp_cpl
18  PUBLIC :: set_var_sis_cpl
19  PUBLIC :: set_var_t2d_cpl
20 
21  CONTAINS
22 
23 !
24  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 !
33  SUBROUTINE save_charr_susp_cpl(INST_SIS, INST_T2D, IERR)
34  TYPE(instance_sis), INTENT(IN) :: inst_sis
35  TYPE(instance_t2d), INTENT(INOUT) :: INST_T2D
36  INTEGER, INTENT(OUT) :: IERR
37 !
38  ierr = 0
39 
40  inst_t2d%CHARR_SIS = inst_sis%TEL%SIS_CPL%CHARR
41  inst_t2d%SUSP_SIS = inst_sis%TEL%SIS_CPL%SUSP
42 
43  END SUBROUTINE save_charr_susp_cpl
44 
45 
46  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
57  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58 !
59  SUBROUTINE charr_or_susp_cpl(INST_SIS, INST_T2D, CHARR_SUSP, IERR)
60  TYPE(instance_sis), INTENT(IN) :: INST_SIS
61  TYPE(instance_t2d), INTENT(INOUT) :: INST_T2D
62  INTEGER, INTENT(OUT) :: CHARR_SUSP
63  INTEGER, INTENT(OUT) :: IERR
64  LOGICAL :: YES_CHARR
65 !
66  ierr = 0
67  charr_susp = 0
68 
69  IF(inst_t2d%SUSP_SIS.AND.inst_t2d%CHARR_SIS
70  & .AND.inst_t2d%SIS%PERCOU.NE.1) THEN
71  inst_t2d%LEOPRD_CHARR=inst_t2d%SIS%NIT+inst_t2d%SIS%PERCOU
72  ELSE
73  inst_t2d%LEOPRD_CHARR=inst_t2d%SIS%LEOPRD
74  ENDIF
75 
76  inst_t2d%SUSP1=inst_t2d%SUSP_SIS
77  & .AND.inst_t2d%SIS%PERCOU.EQ.1
78  IF(inst_t2d%SUSP1.OR.(inst_t2d%CHARR_SIS
79  & .AND.(inst_t2d%SIS%PERCOU*(inst_t2d%SIS%LT
80  & /inst_t2d%SIS%PERCOU).EQ.inst_t2d%SIS%LT
81  & ))) THEN
82  charr_susp = 1
83  yes_charr = .true.
84  END IF
85 
86  IF(inst_t2d%SUSP_SIS.AND.inst_t2d%SIS%PERCOU.NE.1) THEN
87  IF (yes_charr) THEN
88  charr_susp = 3
89  ELSE
90  charr_susp = 2
91  END IF
92  END IF
93  END SUBROUTINE charr_or_susp_cpl
94 
95 
96  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
98  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
107  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
108  SUBROUTINE set_var_sis_cpl(INST_T2D, CALL_TYPE, INST_SIS,IERR)
109  TYPE(instance_t2d), INTENT(IN) :: INST_T2D
110  INTEGER, INTENT(IN) :: CALL_TYPE
111  TYPE(instance_sis), INTENT(INOUT) :: INST_SIS
112  INTEGER, INTENT(OUT) :: IERR
113 !
114  ierr = 0
115 
116  IF (call_type.EQ.0) THEN
117  inst_sis%CPL_T2D_SIS = .true.
118  !INS
119  inst_sis%TEL%LOOPCOUNT => inst_t2d%SIS%LT
120  inst_sis%TEL%GRAPHCOUNT => inst_t2d%SIS%LEOPRD
121  inst_sis%TEL%COMPLEO => inst_t2d%COMPLEO
122  inst_sis%TEL%YAGOUT = inst_t2d%LEO
123  inst_sis%TEL%LISTCOUNT => inst_t2d%SIS%LISPRD
124  inst_sis%TEL%NIT => inst_t2d%SIS%NIT
125  inst_sis%TEL%U => inst_t2d%SIS%U
126  inst_sis%TEL%V => inst_t2d%SIS%V
127  inst_sis%TEL%H => inst_t2d%SIS%H
128  inst_sis%TEL%HN => inst_t2d%SIS%H
129  inst_sis%TEL%HPROP => inst_t2d%SIS%H
130 
131  !OUTS
132  inst_sis%TEL%ZF => inst_t2d%SIS%ZF
133  inst_sis%TEL%UETCAR => inst_t2d%SIS%CF
134  inst_sis%TEL%CF => inst_t2d%SIS%CF
135  inst_sis%TEL%KS => inst_t2d%SIS%CHESTR
136 
137  inst_sis%TEL%SIS_CPL%NSIS_CFD = 1
138  inst_sis%TEL%SIS_CPL%SISYPHE_CFD = .false.
139  inst_sis%TEL%SIS_CPL%CONSTFLOW = .false.
140  inst_sis%TEL%SIS_CPL%CHARR = .false.
141  inst_sis%TEL%SIS_CPL%SUSP = .false.
142 
143  !INS
144  inst_sis%TEL%CODE = 'TELEMAC2D '
145  inst_sis%TEL%PERICOU => inst_t2d%SIS%PERCOU
146  inst_sis%TEL%U3D => inst_t2d%SIS%U
147  inst_sis%TEL%V3D => inst_t2d%SIS%V
148  inst_sis%TEL%T = inst_t2d%SIS%AT
149  inst_sis%TEL%VISC => inst_t2d%SIS%VISC
150  inst_sis%TEL%DT = inst_t2d%SIS%DT
151 
152  inst_sis%TEL%FLBOR => inst_t2d%SIS%FLBOR
153  inst_sis%TEL%DM1 => inst_t2d%SIS%DM1
154  inst_sis%TEL%UCONV => inst_t2d%SIS%USIS
155  inst_sis%TEL%VCONV => inst_t2d%SIS%VSIS
156  inst_sis%TEL%ZCONV => inst_t2d%SIS%ZCONV
157  inst_sis%TEL%THETAW => inst_t2d%SIS%DIRMOY
158  inst_sis%TEL%HW => inst_t2d%SIS%HM0
159  inst_sis%TEL%TW => inst_t2d%SIS%TPR5
160  inst_sis%TEL%UW => inst_t2d%SIS%ORBVEL
161 
162  ELSE IF (call_type.EQ.1) THEN
163  inst_sis%TEL%HN => inst_t2d%SIS%HN
164  inst_sis%TEL%HPROP => inst_t2d%SIS%HPROP
165 
166  inst_sis%TEL%LOOPCOUNT => inst_t2d%SIS%LT
167  inst_sis%TEL%GRAPHCOUNT = inst_t2d%LEOPRD_CHARR
168 
169  inst_sis%TEL%T = inst_t2d%SIS%AT
170  inst_sis%TEL%PERICOU = inst_t2d%SIS%PERCOU
171  inst_sis%TEL%DT = inst_t2d%SIS%DT*inst_t2d%SIS%PERCOU
172 
173  inst_sis%TEL%SIS_CPL%CHARR = inst_t2d%CHARR_SIS
174  inst_sis%TEL%SIS_CPL%SUSP = inst_t2d%SUSP1
175 
176  inst_sis%TEL%SOLSYS = inst_t2d%SIS%SOLSYS
177  ELSE IF (call_type.EQ.2) THEN
178 
179  inst_sis%TEL%HN => inst_t2d%SIS%HN
180  inst_sis%TEL%HPROP => inst_t2d%SIS%HPROP
181 
182  inst_sis%TEL%LOOPCOUNT => inst_t2d%SIS%LT
183  inst_sis%TEL%GRAPHCOUNT = inst_t2d%SIS%LEOPRD
184 
185  inst_sis%TEL%T = inst_t2d%SIS%AT
186  inst_sis%TEL%PERICOU = 1
187  inst_sis%TEL%DT = inst_t2d%SIS%DT
188 
189  inst_sis%TEL%SIS_CPL%CHARR = inst_t2d%CHARR_TEL
190  inst_sis%TEL%SIS_CPL%SUSP = inst_t2d%SUSP_SIS
191 
192  inst_sis%TEL%SOLSYS = inst_t2d%SIS%SOLSYS
193 
194  END IF
195 
196  END SUBROUTINE set_var_sis_cpl
197 
198 
199  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
201  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
206  !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
207  SUBROUTINE set_var_t2d_cpl(INST_SIS, INST_T2D,IERR)
208  TYPE(instance_sis), INTENT(IN) :: INST_SIS
209  TYPE(instance_t2d), INTENT(INOUT) :: INST_T2D
210  INTEGER, INTENT(OUT) :: IERR
211 !
212  ierr = 0
213  inst_t2d%ZF = inst_sis%TEL%ZF
214  inst_t2d%CHESTR = inst_sis%TEL%KS
215  inst_t2d%SIS%CF = inst_sis%TEL%CF
216 
217  inst_t2d%SIS%SIS_CPL%NSIS_CFD =inst_sis%TEL%SIS_CPL%NSIS_CFD
218  inst_t2d%SIS%SIS_CPL%SISYPHE_CFD
219  & = inst_sis%TEL%SIS_CPL%SISYPHE_CFD
220  inst_t2d%SIS%SIS_CPL%CONSTFLOW = inst_sis%TEL%SIS_CPL%CONSTFLOW
221 
222  inst_t2d%SIS%SIS_CPL%CHARR = inst_t2d%CHARR_SIS
223  inst_t2d%SIS%SIS_CPL%SUSP = inst_t2d%SUSP_SIS
224  END SUBROUTINE set_var_t2d_cpl
225  END MODULE api_coupling
subroutine, public set_var_sis_cpl(INST_T2D, CALL_TYPE, INST_SIS, IERR)
Definition: api_coupling.f:110
subroutine, public charr_or_susp_cpl(INST_SIS, INST_T2D, CHARR_SUSP, IERR)
Definition: api_coupling.f:61
subroutine, public save_charr_susp_cpl(INST_SIS, INST_T2D, IERR)
Definition: api_coupling.f:35
subroutine, public set_var_t2d_cpl(INST_SIS, INST_T2D, IERR)
Definition: api_coupling.f:209