SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
read_watflux_confn.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 read_watflux_conf_n (CHW, DGW, W, &
7  hprogram)
8 ! #############################################################
9 !
10 !!**** *READ_WATFLUX_CONF* - reads the configuration for WATFLUX
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 01/2003
36 !-------------------------------------------------------------------------------
37 !
38 !* 0. DECLARATIONS
39 ! ------------
40 !
41 !
42 !
43 !
44 !
45 !
48 USE modd_watflux_n, ONLY : watflux_t
49 !
51 !
52 USE mode_pos_surf
53 !
55 USE modi_get_luout
56 USE modi_open_namelist
57 USE modi_close_namelist
58 !
60 !
61 USE modd_read_namelist, ONLY : lnam_read
62 USE modd_surf_par, ONLY : xundef
63 !
64 !
65 USE yomhook ,ONLY : lhook, dr_hook
66 USE parkind1 ,ONLY : jprb
67 !
68 IMPLICIT NONE
69 !
70 !* 0.1 Declarations of arguments
71 ! -------------------------
72 !
73 !
74 TYPE(ch_watflux_t), INTENT(INOUT) :: chw
75 TYPE(diag_watflux_t), INTENT(INOUT) :: dgw
76 TYPE(watflux_t), INTENT(INOUT) :: w
77 !
78  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! program calling ISBA
79 
80 !
81 !* 0.2 Declarations of local variables
82 ! -------------------------------
83 !
84 LOGICAL :: gfound ! Return code when searching namelist
85 INTEGER :: iluout ! logical unit of output file
86 INTEGER :: inam ! logical unit of namelist file
87 INTEGER :: imi
88 REAL(KIND=JPRB) :: zhook_handle
89 !-------------------------------------------------------------------------------
90 !
91 !* get output listing file logical unit
92 !
93 IF (lhook) CALL dr_hook('READ_WATFLUX_CONF_N',0,zhook_handle)
94  CALL get_luout(hprogram,iluout)
95 !
97 !
98 IF (imi.NE.-1 .AND. lnam_read) THEN
99  CALL init_nam_watfluxn(w)
100  CALL init_nam_diag_surfn(dgw)
101  CALL init_nam_ch_watfluxn(chw)
102 ENDIF
103 !
104 IF (lnam_read) THEN
105  !
106  !* open namelist file
107  !
108  CALL open_namelist(hprogram,inam)
109  !
110  !* reading of namelist
111  ! -------------------
112  !
113  CALL posnam(inam,'NAM_WATFLUXN',gfound,iluout)
114  IF (gfound) READ(unit=inam,nml=nam_watfluxn)
115  CALL posnam(inam,'NAM_DIAG_SURFN',gfound,iluout)
116  IF (gfound) READ(unit=inam,nml=nam_diag_surfn)
117  CALL posnam(inam,'NAM_CH_WATFLUXN',gfound,iluout)
118  IF (gfound) READ(unit=inam,nml=nam_ch_watfluxn)
119  !
120  CALL test_nam_var_surf(iluout,'CWAT_ALB',cwat_alb,'UNIF','TA96')
121  CALL test_nam_var_surf(iluout,'CCH_DRY_DEP',cch_dry_dep,' ','WES89 ','NONE ')
122  CALL test_nam_var_surf(iluout,'CINTERPOL_TS',cinterpol_ts,'QUADRA','LINEAR','UNIF ','NONE ')
123  !
124  !* close namelist file
125  !
126  CALL close_namelist(hprogram,inam)
127  !
128 ENDIF
129 !
130 IF (imi.NE.-1) THEN
131  CALL update_nam_watfluxn(w)
132  CALL update_nam_diag_surfn(dgw)
133  CALL update_nam_ch_watfluxn(chw)
134  ENDIF
135 !
136 !-------------------------------------------------------------------------------
137 !
138 !* surface time-step forced by the atmosphere
139 !
140 xtstep = xundef
141 IF (lhook) CALL dr_hook('READ_WATFLUX_CONF_N',1,zhook_handle)
142 !
143 !-------------------------------------------------------------------------------
144 !
145 END SUBROUTINE read_watflux_conf_n
subroutine init_nam_watfluxn(W)
subroutine init_nam_ch_watfluxn(CHW)
subroutine init_nam_diag_surfn(DGF)
subroutine read_watflux_conf_n(CHW, DGW, W, HPROGRAM)
subroutine update_nam_diag_surfn(DGF)
subroutine close_namelist(HPROGRAM, KLUNAM)
subroutine posnam(KULNAM, HDNAML, OFOUND, KLUOUT)
subroutine get_luout(HPROGRAM, KLUOUT)
Definition: get_luout.F90:6
subroutine update_nam_watfluxn(W)
subroutine update_nam_ch_watfluxn(CHW)
subroutine open_namelist(HPROGRAM, KLUNAM, HFILE)
integer function get_current_model_index_surfex()