SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
open_aux_io_surf_fa.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  SUBROUTINE open_aux_io_surf_fa (&
7  hfile,hfiletype,hmask)
8 ! #######################################################
9 !
10 !!**** *OPEN_AUX_IO_SURF_ASC* - chooses the routine to OPENialize IO
11 !!
12 !! PURPOSE
13 !! -------
14 !!
15 !!** METHOD
16 !! ------
17 !!
18 !! EXTERNAL
19 !! --------
20 !!
21 !!
22 !! IMPLICIT ARGUMENTS
23 !! ------------------
24 !!
25 !! REFERENCE
26 !! ---------
27 !!
28 !!
29 !! AUTHOR
30 !! ------
31 !! V. Masson *Meteo France*
32 !!
33 !! MODIFICATIONS
34 !! -------------
35 !! Original 10/2006
36 !-------------------------------------------------------------------------------
37 !
38 !* 0. DECLARATIONS
39 ! ------------
40 !
41 !
42 !
43 !
44 USE modd_io_surf_fa,ONLY:nunit_fa,nluout,nfull,nmask,cmask,iverbfa,cdnomc
45 USE modi_get_luout
47 USE modi_io_buff_clean
48 !
49 USE yomhook ,ONLY : lhook, dr_hook
50 USE parkind1 ,ONLY : jprb
51 !
52 USE modi_get_surf_mask_n
53 !
54 USE modi_get_type_dim_n
55 !RJ: missing modi
56 USE modi_get_1d_mask
57 !
58 IMPLICIT NONE
59 !
60 !* 0.1 Declarations of arguments
61 ! -------------------------
62 !
63 !
64 !
65  CHARACTER(LEN=28), INTENT(IN) :: hfile ! file name
66  CHARACTER(LEN=6), INTENT(IN) :: hfiletype ! main program
67  CHARACTER(LEN=6), INTENT(IN) :: hmask
68 !
69 !* 0.2 Declarations of local variables
70 ! -------------------------------
71 !
72  CHARACTER(LEN=28) :: yfile
73  CHARACTER(LEN=16), PARAMETER :: ycadre='external'
74 !
75 INTEGER :: inb ! number of articles in the file
76 INTEGER, DIMENSION(:),POINTER :: imask
77 INTEGER :: ilu,iret
78 REAL, DIMENSION(:),ALLOCATABLE :: zfull ! total cover
79 REAL(KIND=JPRB) :: zhook_handle
80 !-------------------------------------------------------------------------------
81 !
82 IF (lhook) CALL dr_hook('OPEN_AUX_IO_SURF_FA',0,zhook_handle)
83  CALL io_buff_clean
84  CALL get_luout(hfiletype,nluout)
85 !
86 ilu =0
87 !
88 yfile=hfile(1:len_trim(hfile))//'.fa'
89 !
90  CALL faitou(iret,nunit_fa,.true.,yfile,'OLD',.true.,.false.,iverbfa,0,inb,ycadre)
91 WRITE(nluout,*)'HFILETYPE ',hfiletype,'READ EXTERNAL',nunit_fa,yfile
92 !
93  cmask = 'FULL '
94  CALL read_surf(&
95  hfiletype,'DIM_FULL',ilu,iret)
96 nfull = ilu
97 !
98 !------------------------------------------------------------------------------
99 !
100 ALLOCATE(nmask(nfull))
101 ALLOCATE(zfull(nfull))
102 zfull=1.
103  CALL get_1d_mask(nfull,nfull,zfull,nmask)
104 DEALLOCATE(zfull)
105 !
106 !------------------------------------------------------------------------------
107  cmask = hmask
108 IF (lhook) CALL dr_hook('OPEN_AUX_IO_SURF_FA',1,zhook_handle)
109 !-------------------------------------------------------------------------------
110 !
111 END SUBROUTINE open_aux_io_surf_fa
subroutine io_buff_clean
subroutine get_luout(HPROGRAM, KLUOUT)
Definition: get_luout.F90:6
subroutine get_1d_mask(KSIZE, KFRAC, PFRAC, KMASK)
Definition: get_1d_mask.F90:5
subroutine open_aux_io_surf_fa(HFILE, HFILETYPE, HMASK)