The TELEMAC-MASCARET system  trunk
cvsp_compress_clean_gaia.f
Go to the documentation of this file.
1 ! ***********************************
2  SUBROUTINE cvsp_compress_clean_gaia
3 ! ***********************************
4 !
5  &(j)
6 !
7 !***********************************************************************
8 ! GAIA V8P1 14/03/2013
9 !***********************************************************************
10 !
13 !
14 !
18 !
23 !
24 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27 !
30 !
31  IMPLICIT NONE
32 !
33 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
34 !
35  INTEGER, INTENT(IN) :: J
36 !
37 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
38 !
39  INTEGER I,K, MARKERMAX, MARKERCNT, TTT, JG
40  INTEGER MARKER(pro_max_max)
41 !
42 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
43 !
44 ! STORES THE FRACTION ERRORS THAT WILL OCCURE IF THE POINT IS ELEMINATED FROM CURRENT PROFILE
45 !
46  DOUBLE PRECISION SUMFERR
47 !
48 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
49 !
50 ! STORES THE MAXIMUM DISTANCE OF ANY NODE IN THE CURRENT LOOP
51 !
52  DOUBLE PRECISION DIST, SUMF
53 !
54 !-----------------------------------------------------------------------
55 ! LOCAL -> GLOBAL / PARALLEL STUFF
56 !-----------------------------------------------------------------------
57 !
58  jg = j
59  IF (ncsize.GT.1) jg = mesh%KNOLG%I(j)
60 !
61 !-----------------------------------------------------------------------
62 ! INITIAL DEBUGGING OUTPUT ...
63 !-----------------------------------------------------------------------
64 !
65  IF (cvsp_db_gaia(jg,0).EQV..true.) CALL cvsp_p_gaia('./','V_W',jg)
66 !
67 !--------------------------------------------------------------------------
68 ! INIT
69 !-----------------------------------------------------------------------
70 !
71  IF(pro_max(j) <= 2) RETURN
72 ! FIRST AND LAST POINT WILL ALWAYS BE KEPT
73  markermax = 2 !MAXIMUM USED INDEX IN MARKER ARRAY
74  marker(1) = 1 !FIRST WILL ALWAYS BE KEPT
75  markercnt = 1 !MAXIMUM USED INDEX IN MARKERTEMP ARRAY
76 !
77 !--------------------------------------------------------------------------
78 ! TOP TO BOTTOM
79 !-----------------------------------------------------------------------
80 !
81  DO ttt = 2,pro_max(j)
82  sumf = 0.d0
83  sumferr = 0.d0
84  DO i = 1, nsicla
85  sumf = pro_f(j,ttt, i) + sumf
86  sumferr = abs((pro_f(j,ttt,i)-pro_f(j,marker(markercnt),i)))
87  & + sumferr
88  ENDDO
89 !
90  IF (ttt > 1) THEN
91  dist = abs((pro_d(j,ttt,1)-pro_d(j,marker(markercnt),1)))
92  IF ((dist.GT.zero).OR.(sumferr.GT.0.d0)) THEN
93  markercnt = markercnt + 1
94  marker(markercnt) = ttt
95  ENDIF
96  ENDIF
97  ENDDO !TTT
98 !
99  markermax = markercnt
100 !
101 !--------------------------------------------------------------------------
102 ! RECREATE THE SORTING PROFILE WITH LESS NUMBER OF NODES=LAYERS
103 !-----------------------------------------------------------------------
104 !
105  DO k = 1, nsicla
106  DO i = 1, markermax
107  pro_f(j,i,k) = pro_f(j,marker(i),k)
108  pro_d(j,i,k) = pro_d(j,marker(i),k)
109  ENDDO !I
110  ENDDO !K
111  pro_max(j) = markermax
112 !
113 !--------------------------------------------------------------------------
114 ! BRUTFORCE COMPRESSION IN CASE OF EXCEPTIONAL FRAGMENTATION
115 !-----------------------------------------------------------------------
116 !
117  IF (pro_max(j) > pro_max_max-8*nsicla) THEN
118  CALL cvsp_compress_dp_gaia(j, 1.d-5)
119  ENDIF
120  IF (pro_max(j) < 4) THEN
122  ENDIF
123 !
124 !--------------------------------------------------------------------------
125 ! FINAL DEBUGGING OUTPUT ...
126 !-----------------------------------------------------------------------
127 !
128  IF(cvsp_db_gaia(jg,0)) CALL cvsp_p_gaia('./','V_V',jg)
129 !
130 !-----------------------------------------------------------------------
131 !
132  RETURN
133  END SUBROUTINE cvsp_compress_clean_gaia
subroutine cvsp_compress_clean_gaia(J)
subroutine cvsp_compress_brut_gaia(J)
subroutine cvsp_p_gaia(PATH_PRE, FILE_PRE, JG)
Definition: cvsp_p_gaia.f:7
subroutine cvsp_compress_dp_gaia(J, THRESHOLD)
double precision zero
Parameter used for clipping variables or testing values against zero.
integer, target nsicla
Number of sediment classes of bed material (less than NISCLM)
double precision, dimension(:,:,:), allocatable, target pro_f
Vertical sorting profile: fraction for each layer, class, point.
double precision, dimension(:,:,:), allocatable, target pro_d
Vertical sorting profile: depth for each layer, class, point.
integer pro_max_max
Maximum Number of Profile SECTIONS.
logical function cvsp_db_gaia(J_GLOBAL, TIMESTAMP)
Definition: cvsp_db_gaia.f:7
type(bief_mesh), target mesh
Mesh structure.
integer, dimension(:), allocatable pro_max
Maximum layer number in a vertical sorting profile for each point.