8 INTEGER,
INTENT(IN) :: SIZEKTAB
9 INTEGER(KIND=8),
DIMENSION(SIZEKTAB),
INTENT(IN) :: KTAB
10 INTEGER,
INTENT(OUT) :: KNBELT
11 INTEGER,
INTENT(OUT) :: KTYPECOD
13 CHARACTER(LEN=8) :: STRKEY
18 CALL set_extractidx(0,0)
21 CALL extract_bbuff(ktab,8,intchar)
22 strkey(ji:ji) = char(intchar)
26 IF (strkey ==
'COMPRESS')
THEN 27 CALL extract_bbuff(ktab,32,ktypecod)
28 CALL extract_bbuff(ktab,32,knbelt)
41 INTEGER,
INTENT(IN) :: NBELT
42 INTEGER,
INTENT(IN) :: NBCOMPELT
43 REAL (KIND=8),
DIMENSION(NBELT),
TARGET,
INTENT(OUT) :: XTAB
44 INTEGER(KIND=8),
DIMENSION(NBCOMPELT),
INTENT(IN) :: COMPTAB
45 INTEGER,
INTENT(IN) :: CODINGTYPE
47 INTEGER,
DIMENSION(:),
ALLOCATABLE :: ITAB
48 LOGICAL,
DIMENSION(:),
ALLOCATABLE :: GMASK
55 INTEGER :: IDIMX,IDIMY
57 REAL(KIND=8),
DIMENSION(:),
POINTER :: XPTRTAB
60 SELECT CASE (codingtype)
62 CALL extract_bbuff(comptab,32,xref)
66 CALL extract_bbuff(comptab,32,idimx)
67 CALL extract_bbuff(comptab,32,idimy)
68 ilevnbelt = idimx * idimy
69 inblev = nbelt/(ilevnbelt)
70 ALLOCATE(itab(ilevnbelt))
72 ind1=(ji-1)*ilevnbelt+1
74 xptrtab=>xtab(ind1:ind2)
75 IF (
lpdebug) print *,
'###### Decompress(SOPENCOD) LEVEL ',ji,
'######' 76 CALL extract_bbuff(comptab,32,xref)
77 CALL extract_bbuff(comptab,32,xcoeff)
83 CALL extract_bbuff(comptab,32,idimx)
84 CALL extract_bbuff(comptab,32,idimy)
85 ilevnbelt = idimx * idimy
86 inblev = nbelt/(ilevnbelt)
87 ALLOCATE(itab(ilevnbelt))
88 ALLOCATE(gmask(ilevnbelt))
91 IF (
lpdebug) print *,
'###### Decompress(EXTENCOD) LEVEL ',ji,
'######' 92 ind1=(ji-1)*ilevnbelt+1
94 xptrtab=>xtab(ind1:ind2)
96 CALL extract_bbuff(comptab,3,iextcod)
98 CALL extract_bbuff(comptab,3,iextcod)
101 IF (
lpdebug) print *,
"IEXTCOD = ",iextcod
105 CALL extract_bbuff(comptab,32,xref)
106 CALL extract_bbuff(comptab,32,xcoeff)
113 CALL decomp_fop(xptrtab,itab,xref,xcoeff,gmask,1)
115 xptrtab = exp(xptrtab)
120 CALL extract_bbuff(comptab,32,xref)
122 IF (
lpdebug) print *,
" CONST value=",xref
126 CALL extract_bbuff(comptab,32,xmin)
127 CALL extract_bbuff(comptab,32,xmax)
134 IF (
lpdebug) print *,
" 2 values:",xmin,xmax
138 CALL extract_bbuff(comptab,32,xmin)
139 CALL extract_bbuff(comptab,32,xref)
140 CALL extract_bbuff(comptab,32,xmax)
147 WHERE (itab == 2) xptrtab = xmax
148 IF (
lpdebug) print *,
" 3 values:",xmin,xref,xmax
152 CALL extract_bbuff(comptab,32,xref)
153 CALL extract_bbuff(comptab,32,xcoeff)
156 IF (
lpdebug) print *,
" normal, XREF/XCOEFF = ",xref,xcoeff
160 CALL extract_bbuff(comptab,32,xmin)
161 CALL extract_bbuff(comptab,32,xref)
162 CALL extract_bbuff(comptab,32,xcoeff)
169 CALL decomp_fop(xptrtab,itab,xref,xcoeff,gmask,1)
170 IF (
lpdebug) print *,
" Min exclus, MIN/XREF/XCOEFF = ",xmin,xref,xcoeff
174 CALL extract_bbuff(comptab,32,xmax)
175 CALL extract_bbuff(comptab,32,xref)
176 CALL extract_bbuff(comptab,32,xcoeff)
179 WHERE (itab == 65535)
183 CALL decomp_fop(xptrtab,itab,xref,xcoeff,gmask,0)
184 IF (
lpdebug) print *,
" Max exclus, MAX/XREF/XCOEFF = ",xmax,xref,xcoeff
188 CALL extract_bbuff(comptab,32,xmin)
189 CALL extract_bbuff(comptab,32,xmax)
190 CALL extract_bbuff(comptab,32,xref)
191 CALL extract_bbuff(comptab,32,xcoeff)
198 WHERE (itab == 65535)
202 CALL decomp_fop(xptrtab,itab,xref,xcoeff,gmask,1)
203 IF (
lpdebug) print *,
" Min et Max exclus, MIN/MAX/XREF/XCOEFF = ",&
204 &xmin,xmax,xref,xcoeff
209 print *,
'Error in CODINGTYPE : program aborted' 215 SUBROUTINE decomp_fop(PTAB,KTAB,PREF,PCOEFF,OMASK,KINDCOR)
216 REAL(KIND=8),
DIMENSION(:),
INTENT(INOUT) :: PTAB
224 INTEGER,
DIMENSION(:),
INTENT(IN) :: KTAB
225 REAL,
INTENT(IN) :: PREF
226 REAL,
INTENT(IN) :: PCOEFF
227 LOGICAL,
DIMENSION(:),
INTENT(IN),
OPTIONAL :: OMASK
228 INTEGER,
INTENT(IN),
OPTIONAL :: KINDCOR
232 IF (.NOT.
PRESENT(kindcor))
THEN 238 IF (
PRESENT(omask))
THEN 240 ptab(:) = pcoeff*(ktab(:)-indcor)+pref
243 IF (pcoeff == 0.0)
THEN 246 ptab(:) = pcoeff*ktab(:)+pref
253 INTEGER,
DIMENSION(:),
INTENT(OUT) :: KTAB
262 INTEGER :: NBITCOD,IMIN
267 CALL extract_bbuff(comptab,32,nbgrp)
269 CALL extract_bbuff(comptab,5,ibe)
274 CALL extract_bbuff(comptab,1,alone)
275 CALL extract_bbuff(comptab,16,imin)
284 CALL extract_bbuff(comptab,4,nbitcod)
285 CALL extract_bbuff(comptab,ibe,gelt)
287 IF (nbitcod > 0)
THEN 289 CALL extract_bbuff(comptab,nbitcod,ieps)
290 ktab(cpt) = imin+ieps
294 ktab(cpt:cpt+gelt-1) = imin
integer, parameter jpcstencod
subroutine extractintarray(KTAB)
integer, parameter jpother
integer, parameter jpnorm
subroutine decomp_fop(PTAB, KTAB, PREF, PCOEFF, OMASK, KINDCOR)
integer, parameter jp2val
subroutine invertcol(ITAB, KX, KY)
integer, parameter jpminmaxexcl
integer, parameter jpsopencod
integer, parameter jpextencod
logical, parameter lpdebug
integer, parameter jpconst
subroutine get_compheader(KTAB, SIZEKTAB, KNBELT, KTYPECOD)
subroutine decompress_field(XTAB, NBELT, COMPTAB, NBCOMPELT, CODINGTYPE)
integer, parameter jp3val
integer, parameter jpminexcl
integer, parameter jpmaxexcl