The TELEMAC-MASCARET system  trunk
cvsp_interface.f
Go to the documentation of this file.
1 ! *************************
2  SUBROUTINE cvsp_interface
3 ! *************************
4 !
5 !***********************************************************************
6 ! GAIA
7 !***********************************************************************
8 !
10 !
11 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13 
14 
17  USE interface_parallel, ONLY: p_dsum
18 
19  IMPLICIT NONE
20  INTEGER I,ICLA,ILAYER
21 
22 ! CVSM NEEDS ZFCL, AVAIL, ZF, ZR
23 ! CONVERSION EVCL_MB TO ZFCL, MASS_SAND TO AVAIL, SUM UP ZFCL TO ZF
24  DO icla = 1,nsicla
25  DO i = 1,npoin
26  zfcl_c%ADR(icla)%P%R(i)
27  & = evcl_mb%ADR(icla)%P%R(i) * mpa2t(icla)
28  IF(es(i,1).GT.0.d0) THEN
29  avail(i,1,icla)
30  & = mass_sand(icla,1,i) * mpa2t(icla) / es(i,1)
31  ELSE
32  avail(i,1,icla) = 0.d0
33  ENDIF
34  zf%R(i) = zf%R(i)+zfcl_c%ADR(icla)%P%R(i) ! new ZF
35  ENDDO
36  ENDDO
37 !
38 ! CALL MAIN ROUTINE CVSM
39  IF(debug.GT.0) WRITE(lu,*)'CVSP_MAIN_GAIA'
41  IF(debug.GT.0) WRITE(lu,*)'CVSP_MAIN_GAIA'
42 !
43 ! CVSM CHANGES ES, AVAIL
44 ! CONVERSION AVAIL TO MASS_SAND AND SUM UP TO TOTAL MASS SAND
45  mass_sand_tot(:,:) = 0.d0
46 
47  DO ilayer=1,nomblay
48  DO icla=1,nsicla
49  DO i=1,npoin
50  mass_sand(icla,ilayer,i) = avail(i,ilayer,icla) /
51  & mpa2t(icla)*es(i,ilayer)
52  mass_sand_tot(ilayer,i) = mass_sand_tot(ilayer,i)
53  & + mass_sand(icla,ilayer,i)
54  END DO
55  END DO
56  END DO
57 ! COMPUTING RATIO_SAND
58  DO i= 1,npoin
59  DO ilayer = 1,nomblay
60  DO icla = 1,nsicla
61  ratio_sand(icla,ilayer,i) =
62  & min(1.d0,mass_sand(icla,ilayer,i)
63  & / mass_sand_tot(ilayer,i))
64  ENDDO
65  ENDDO
66  ENDDO
67 
68 ! COMPUTE ZF FROM ES
69  DO i = 1,npoin
70  zf%R(i) = zr%R(i)
71  DO ilayer = 1,nomblay
72  zf%R(i) = zf%R(i) + es(i,ilayer)
73  ENDDO
74  ENDDO
75 ! COMPUTES MASSTOT AT EVERY TIME STEP, FOR EVERY CLASS
76 ! NECESSARY FOR BALANCE
77 
78 ! MAYBE TO DO ONLY AT THE LAST TIME STEP?
79 !
80  DO icla=1,nsicla
81  masstot(icla)=0.d0
82  ENDDO
83 !
84  DO icla=1,nsicla
85  DO i=1,npoin
86  DO ilayer=1,nomblay
87  masstot(icla)= masstot(icla) +
88  & mass_sand(icla,ilayer,i)*volu2d%R(i)
89  ENDDO
90  ENDDO
91  ENDDO
92 !
93  IF(ncsize.GT.1) THEN
94  DO i=1,nsicla
95  masstot(i)=p_dsum(masstot(i))
96  ENDDO
97  ENDIF
98 
99  RETURN
100  END SUBROUTINE
subroutine cvsp_main_gaia(ZFCL_W, ZF, NSICLA, NPOIN)
Definition: cvsp_main_gaia.f:7
type(bief_obj), target zfcl_c
Bed evolution per class (due to bedload)
double precision, dimension(nsiclm) masstot
Total mass of sediment of each class.
type(bief_obj), target evcl_mb
Mass evolution for class (due to bedload)
integer, target nomblay
Number of bed load model layers = NUMSTRAT+1 to take the active layer into account.
type(bief_obj), target zr
Non erodable (rigid) bottom elevation.
type(bief_obj), target volu2d
Integral of bases.
double precision, dimension(:,:), allocatable, target es
Layer thicknesses as double precision.
double precision, dimension(:,:), allocatable mass_sand_tot
Surface total mass of sand (kg/m2), for ilayer,ipoin.
double precision, dimension(:,:,:), allocatable, target mass_sand
Surface mass of sand (kg/m2), for isand,ilayer,ipoin.
subroutine cvsp_interface
Definition: cvsp_interface.f:4
integer, target nsicla
Number of sediment classes of bed material (less than NISCLM)
double precision function p_dsum(MYPART)
Definition: p_dsum.F:7
double precision, dimension(:,:,:), allocatable, target ratio_sand
Ratio of sand to all sands, for isand,ilayer,ipoin.
integer debug
Debugger.
type(bief_obj), target zf
Bottom elevation.
double precision, dimension(:), allocatable, target mpa2t
conversion mass per area to thickness
double precision, dimension(:,:,:), allocatable, target avail
Sediment fraction for each layer, class, point.
integer, pointer npoin
Number of 2d points in the mesh.