SURFEX v8.1
General documentation of Surfex
rtoc.F
Go to the documentation of this file.
1  SUBROUTINE rtoc(REAL_V, CHAR_V, N)
2 !
3 !**** SUBROUTINE rtoc - To convert from 64-bit REAL to CHAR
4 !
5 ! S.Saarinen ECMWF 27/6/95
6 !
7 !** INTERFACE
8 ! ---------
9 !
10 ! CALL rtoc(real_v, char_v, n)
11 ! WHERE:
12 ! real_v = 64-bit REAL-vector (INPUT) of n elements
13 ! each holding one ASCII-value [0..255]
14 ! of a character
15 ! char_v = A character-string (OUTPUT) where the result of
16 ! each ASCII to CHAR()-conversion goes
17 ! n = length of the REAL-vector and character-string
18 !
19 !
20 !-----------------------------------------------------------------------
21 !
22  USE parkind1, ONLY : jpim
23  IMPLICIT NONE
24  INTEGER(KIND=JPIM) :: N
25 !-- The following MUST be 64-bit REALs [i.e. REAL(8) on Fortran-90]
26 !#ifdef F90
27 ! real(8) real_v(n)
28 !#else
29  REAL(KIND=8) :: REAL_V(n)
30 !#endif
31  CHARACTER(LEN=*) :: CHAR_V
32  INTEGER(KIND=JPIM) :: I
33 
34  DO i=1,n
35  char_v(i:i) = char(int(real_v(i)))
36  ENDDO
37  ENDSUBROUTINE rtoc
integer, parameter jpim
Definition: parkind1.F90:13
subroutine rtoc(REAL_V, CHAR_V, N)
Definition: rtoc.F:2