The TELEMAC-MASCARET system  trunk
nestor_interface_gaia.f
Go to the documentation of this file.
1 ! ********************************
2  SUBROUTINE nestor_interface_gaia
3 ! ********************************
4 !
5  &(option,grafcount,xmvs0,xkv01,volu2d)
6 !
7 !***********************************************************************
8 ! GAIA
9 !***********************************************************************
10 !
13 !
14 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19 !***********************************************************************
20 !
21  USE bief
23  & ,gai_files,sinact,sinpol
24  & ,sinref,sinrst
25  & ,zf, hn
26  & ,mesh
27  & ,lt, dt, at0
28  & ,mardat, martim
29  & ,zfcl_c, avail
30  & ,zrl
31  & ,zr, nsicla, nomblay
32  & ,mofac, es
33  & ,evcl_mb ! evolution of mass of each sand class for laver-1 [ kg/m**2 ]
34  & ,mass_sand ! mass of each sand class for each laver [ kg/m**2 ]
35  & ,nsand ! number of sand classes
36  & ,m2t ! conversion factor Mass to Thickness
37  & ,mpa2t ! conversion factor MassPerArea to Thickness
38 !
39  USE m_interfaces_nestor, ONLY: interfaceinitnestor,
40  & interfacerunnestor
42  IMPLICIT NONE
43 !
44 !!-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
45 !
46  INTEGER, INTENT(IN) :: OPTION, GRAFCOUNT ! period of graphical outputs
47  DOUBLE PRECISION, INTENT(IN) :: XMVS0(nsicla) ! density sediment classes
48  DOUBLE PRECISION, INTENT(IN) :: XKV01 ! non cohesive bed porosity of layer 1
49  type(bief_obj), INTENT(IN) :: volu2d ! node area
50 !
51 !--------------------- local variables ---------------
52  LOGICAL :: CALLEDBY_T2D
53  INTEGER :: I, ICLA
54 !
55 !
56 !!-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
57 !
58 !
59 !-----------------------------------------------------------------------
60 !
61  IF(option.EQ.1) THEN ! initialisation of Nestor
62 !
63 ! INITIALISATION
64 !
65  calledby_t2d = .false.
66 
67 !
68 !
69 !
70  CALL interfaceinitnestor( ncsize, ipid ! Number of parallel threads, ID of thread
71  & , npoin, nsicla ! Number of: nodes, SIze CLAsses
72  & , mardat, martim ! Sis start: date , time
73  & , mofac ! morphological factor
74  & , grafcount ! period of graphical outputs
75  & , mesh%X%R ! X-coordinate of node
76  & , mesh%Y%R ! Y-coordinate of node
77  & , volu2d%R ! node areas
78  & , maxval( mesh%KNOLG%I(:) ) ! local maxIndex, needed to calc. npion of global mesh
79  & , zf%R ! bottom at time 0 [m+NN] Itera
80  & , lu ! logical unit for standard output
81  & , gai_files(sinact)%LU ! logical unit to NESTOR ACTION FILE
82  & , gai_files(sinpol)%LU ! logical unit to NESTOR POLYGON FILE
83  & , gai_files(sinref)%LU ! logical unit to NESTOR SURFACE REFERENCE FILE
84  & , gai_files(sinrst)%LU ! logical unit to NESTOR RESTART FILE
85  & , calledby_t2d ! true if coupled with telemac2d
86  & , zrl%R ! reference level [m+NN]
87  & )
88 !
89 !
90 ! LEOPRD aus T2D, GRAFCOUNT in gaia.f and sisyphe.F
91 !
92 !
93 ! NO QUASI BUBBLE SUPPORTED
94  IF(ielmh_gai.NE.11) THEN
95  WRITE(*,*)'ONLY LINEAR 2D ELEMENTS ARE SUPPORTED'
96  WRITE(*,*)'NESTOR -STOP, PLEASE START WITHOUT'
97  WRITE(*,*)'NESTOR OR USE ANOTHER ELEMENT TYPE'
98  WRITE(*,*)'ACTUAL ELEMENT TYPE OF ZF: ',ielmh_gai
99  CALL plante(1)
100  stop
101  ENDIF
102 !
103 !
104  !#########################################
105  !
106  ! Run Nestor
107  !
108  !#########################################
109  ELSEIF(option.EQ.2) THEN
110 !
111 ! CALL FROM WITHIN BEDLOAD_MAIN_GAIA
112 !
113  IF (nestor.EQV..true.) THEN
114 !
115  IF(nsand.NE.nsicla)THEN
116  WRITE(*,*)'A L A R M there seems to be mud !'
117  WRITE(*,*)'Coupling of Nestor with mud is not realized'
118  WRITE(*,*)'stop in SUBROUTINE NESTOR_INTERFACE_GAIA'
119  stop
120  ENDIF
121 !
122 ! !==== conversion of mass to thickness and fraction =============!
123 ! EVCL_MB and MASS_SAND given in [ kg/m**2 ]
124  DO icla = 1,nsicla ! convert for layer-1 for each sand class,
125  DO i = 1,npoin
126  zfcl_c%ADR(icla)%P%R(i)
127  & = evcl_mb%ADR(icla)%P%R(i) * mpa2t(icla) ! thickness evolution
128 
129  IF(es(i,1).GT.0.d0) THEN
130  avail(i,1,icla)
131  & = mass_sand(icla,1,i) * mpa2t(icla) / es(i,1) ! mass to fraction
132  ELSE
133  avail(i,1,icla) = 0.d0
134  ENDIF
135  ENDDO
136  ENDDO
137 !
138 ! DO ICLA = 1,NSICLA !debug
139 ! DO i = 1,NPOIN !debug
140 ! IF( (i.GE.1 .AND. i.LE.5) .OR. !debug
141 ! & (i.GE.3001 .AND. i.LE.3005) ) THEN !debug
142 ! WRITE(*,*)'AVAIL i=',i,'1 icla=', ICLA !debug
143 ! & ,'Z=',AVAIL(i,1,ICLA) !debug
144 ! & ,'F=',M2T(ICLA,i) !debug
145 ! & ,'V=',VOLU2D%R(i) !debug
146 ! & ,'M=',MASS_SAND(ICLA,1,i) !debug
147 ! ENDIF !debug
148 ! ENDDO !debug
149 ! ENDDO !debug
150 !
151 !
152  CALL interfacerunnestor( npoin ! Number of POINts (nodes)
153  & , nomblay ! Number of LAYers
154  & , nsicla ! Number of SIze CLAsses
155  & , lt ! Telemac time step
156  & , dt ! duration of Sisyphe time step
157  & , at0 ! time
158  & , es(1:npoin,1) !(non const.) thickness of active laver [m]
159  & , zf%R ! bottom [m+NN]
160  & , zfcl_c ! evolution per class per time step [m]
161  & , avail ! grain composition (part of grainClass per node per layer)
162  & , mesh%KNOLG%I ! index list: Local to Global node index
163  & , hn%R ! water depth [m]
164  & , zr%R ! ridged bed [m+NN]
165  & , zrl%R ! reference level [m+NN]
166  & )
167  ENDIF
168 !
169 ! !==== conversion of thickness to mass ========================!
170  DO icla = 1,nsicla ! convert for each class thickness evolution to mass evolution
171  DO i = 1,npoin
172  evcl_mb%ADR(icla)%P%R(i)
173  & = zfcl_c%ADR(icla)%P%R(i) / mpa2t(icla)
174  ENDDO
175  ENDDO
176 !
177 !
178  ELSE ! OPTION is neither 1 nor 2
179 !
180 ! ERROR
181 !
182  IF(lng.EQ.1) WRITE(lu,*) 'MAUVAISE OPTION POUR NESTOR'
183  IF(lng.EQ.2) WRITE(lu,*) 'BAD OPTION FOR NESTOR'
184  CALL plante(1)
185  stop
186 !
187  ENDIF
188 !
189 !-----------------------------------------------------------------------
190 !
191  RETURN
192  END
subroutine nestor_interface_gaia(OPTION, GRAFCOUNT, XMVS0, XKV01, VOLU2D)
logical nestor
Coupling with NESTOR.
integer, pointer npoin
Number of 2d points in the mesh.
Definition: bief.f:3