SURFEX v8.1
General documentation of Surfex
uncompress_field.F90
Go to the documentation of this file.
1 SUBROUTINE uncompress_field(KLONG,PSEUIL,PFIELD_IN,PFIELD_OUT)
2 
3 IMPLICIT NONE
4 
5 INTEGER*4, INTENT(IN) :: KLONG
6 REAL, INTENT(IN) :: PSEUIL
7 REAL, DIMENSION(:), INTENT(IN) :: PFIELD_IN
8 REAL, DIMENSION(:), INTENT(OUT) :: PFIELD_OUT
9 INTEGER :: ICPT, I, K
10 
11 icpt = 0
12 
13 i = 1
14 
15 pfield_out(:) = 0.
16 !
17 ! boucle sur les colonnes
18 DO
19 
20  ! si on a dépassé la dernière colonne, on sort de la boucle
21  IF (icpt>=klong) EXIT
22 
23  ! si la valeur est valide
24  IF (pfield_in(i)<pseuil) THEN
25 
26  ! on la met dans lwrite à l'indice icpt
27  icpt = icpt + 1
28  pfield_out(icpt) = pfield_in(i)
29 !!!!!!!!!!!!!!!!!!!!test temporary: to remove after
30  IF (mod(pfield_out(icpt),100.)==0) pfield_out(icpt)=0.
31 !!!!!!!!!!!!!!!!!!!!!! to remove after
32  ! on incrémente i
33  i = i+1
34 
35  ELSE
36 
37  !ideb = icpt + 1
38  DO k = 1,nint(pfield_in(i)-(pseuil))
39  icpt = icpt + 1
40  IF (icpt>klong) EXIT
41  pfield_out(icpt) = 0.
42  ENDDO
43 
44  i = i+1
45 
46  ENDIF
47 
48 ENDDO
49 
50 END SUBROUTINE uncompress_field
subroutine uncompress_field(KLONG, PSEUIL, PFIELD_IN, PFIELD_OUT)