SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
open_aux_io_surf_nc.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_nc (&
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_nc,ONLY: nmask,nfull,cmask, nluout, &
45  cfilein_nc, nid_nc, nfull_aux
46 USE modi_get_luout
48 !
49 !
50 USE yomhook ,ONLY : lhook, dr_hook
51 USE parkind1 ,ONLY : jprb
52 !
53 USE modi_get_1d_mask
54 !
55 IMPLICIT NONE
56 !
57 include "netcdf.inc"
58 !
59 !* 0.1 Declarations of arguments
60 ! -------------------------
61 !
62 !
63 !
64  CHARACTER(LEN=28), INTENT(IN) :: hfile ! file name
65  CHARACTER(LEN=6), INTENT(IN) :: hfiletype ! main program
66  CHARACTER(LEN=6), INTENT(IN) :: hmask
67 !
68 !* 0.2 Declarations of local variables
69 ! -------------------------------
70 !
71 REAL, DIMENSION(:),ALLOCATABLE :: zfull ! total cover
72 INTEGER :: ilu,iret, il
73 INTEGER :: inb ! number of articles in the file
74  CHARACTER(LEN=28) :: yfile
75 LOGICAL :: gopened
76 REAL(KIND=JPRB) :: zhook_handle
77 !-------------------------------------------------------------------------------
78 !
79 IF (lhook) CALL dr_hook('OPEN_AUX_IO_SURF_NC',0,zhook_handle)
80 
81 yfile = trim(hfile)//".nc"
82 INQUIRE(file=yfile,opened=gopened)
83 IF (.NOT.gopened) THEN
84  iret = nf_open(yfile,nf_nowrite,nid_nc)
85 ENDIF
86 
87  CALL get_luout('NC ',nluout)
88 !
89  cmask = hmask
90  cfilein_nc = yfile
91  CALL read_surf(&
92  'NC ','DIM_FULL',ilu,iret)
93 nfull_aux = ilu
94 !
95 !------------------------------------------------------------------------------
96 nfull = nfull_aux
97 !
98 il = nfull
99 ALLOCATE(zfull(il))
100 ALLOCATE(nmask(il))
101 zfull=1.
102  CALL get_1d_mask(il,il,zfull,nmask)
103 !
104 !------------------------------------------------------------------------------
105  cmask = hmask
106 IF (lhook) CALL dr_hook('OPEN_AUX_IO_SURF_NC',1,zhook_handle)
107 !-------------------------------------------------------------------------------
108 !
109 END SUBROUTINE open_aux_io_surf_nc
subroutine open_aux_io_surf_nc(HFILE, HFILETYPE, HMASK)
subroutine get_luout(HPROGRAM, KLUOUT)
Definition: get_luout.F90:6
subroutine get_1d_mask(KSIZE, KFRAC, PFRAC, KMASK)
Definition: get_1d_mask.F90:5