SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
read_topd_file.F90
Go to the documentation of this file.
1 !SFX_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
2 !SFX_LIC This is part of the SURFEX software governed by the CeCILL-C licence
3 !SFX_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4 !SFX_LIC for details. version 1.
5 !-----------------------------------------------------------------
6 ! #######################
7  SUBROUTINE read_topd_file(HPROGRAM,HFILE,HFORM,KNPT,PTOPD_READ)
8 ! #######################
9 !
10 !!**** *READ_TOPD_FILE*
11 !!
12 !! PURPOSE
13 !! -------
14 ! This routine aims at reading topographic files
15 !!** METHOD
16 !! ------
17 !
18 !! EXTERNAL
19 !! --------
20 !!
21 !! none
22 !!
23 !! IMPLICIT ARGUMENTS
24 !! ------------------
25 !!
26 !!
27 !!
28 !!
29 !!
30 !! REFERENCE
31 !! ---------
32 !!
33 !!
34 !!
35 !! AUTHOR
36 !! ------
37 !!
38 !! B. Vincendon * Meteo-France *
39 !!
40 !! MODIFICATIONS
41 !! -------------
42 !!
43 !! Original 11/2006
44 !-------------------------------------------------------------------------------
45 !
46 !* 0. DECLARATIONS
47 ! ------------
48 !
49 USE modi_get_luout
50 USE modi_open_file
51 USE modi_close_file
52 !
53 USE modd_topd_par, ONLY : nunit
54 USE modd_topodyn, ONLY : npmax
55 USE modd_surf_par, ONLY : xundef
56 !
57 USE yomhook ,ONLY : lhook, dr_hook
58 USE parkind1 ,ONLY : jprb
59 !
60 IMPLICIT NONE
61 !
62 !* 0.1 declarations of arguments
63 !
64  CHARACTER(LEN=*), INTENT(IN) :: hprogram !
65  CHARACTER(LEN=*), INTENT(IN) :: hfile ! File to be read
66  CHARACTER(LEN=*), INTENT(IN) :: hform ! Format of the file to be read
67 INTEGER, INTENT(IN) :: knpt ! Number of points in the catchment
68 REAL, DIMENSION(:), INTENT(OUT) :: ptopd_read ! Topographic parameter read on file
69 !
70 !* 0.2 declarations of local variables
71 !
72 INTEGER :: jj,ji ! loop control
73 INTEGER :: iluout ! Unit of the files
74 REAL(KIND=JPRB) :: zhook_handle
75 !-------------------------------------------------------------------------------
76 IF (lhook) CALL dr_hook('READ_TOPD_FILE',0,zhook_handle)
77 !
78 !* 0.2 preparing file openning
79 ! ----------------------
80 !
81  CALL get_luout(hprogram,iluout)
82 !
83  CALL open_file(hprogram,nunit,hfile,hform,haction='READ')
84 !PTOPD_READ(:)=XUNDEF
85 !
86 DO jj=1,13
87  READ(nunit,*)
88 ENDDO
89 !
90 DO ji=1,knpt
91  !
92  READ(nunit,*,end=110) ptopd_read(ji)
93  !
94  IF (ptopd_read(ji).LT.0.0) ptopd_read(ji) = xundef
95  !
96 ENDDO
97 !
98 110 CALL close_file(hprogram,nunit)
99 !
100 IF (lhook) CALL dr_hook('READ_TOPD_FILE',1,zhook_handle)
101 !
102 END SUBROUTINE read_topd_file
103 
104 
105 
106 
107 
108 
109 
subroutine read_topd_file(HPROGRAM, HFILE, HFORM, KNPT, PTOPD_READ)
subroutine close_file(HPROGRAM, KUNIT)
Definition: close_file.F90:6
subroutine get_luout(HPROGRAM, KLUOUT)
Definition: get_luout.F90:6
subroutine open_file(HPROGRAM, KUNIT, HFILE, HFORM, HACTION, HACCESS, KRECL)
Definition: open_file.F90:6