SURFEX v8.1
General documentation of Surfex
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, DGO, W, HPROGRAM)
7 ! #############################################################
8 !
9 !!**** *READ_WATFLUX_CONF* - reads the configuration for WATFLUX
10 !!
11 !! PURPOSE
12 !! -------
13 !!
14 !!** METHOD
15 !! ------
16 !!
17 !! EXTERNAL
18 !! --------
19 !!
20 !!
21 !! IMPLICIT ARGUMENTS
22 !! ------------------
23 !!
24 !! REFERENCE
25 !! ---------
26 !!
27 !!
28 !! AUTHOR
29 !! ------
30 !! V. Masson *Meteo France*
31 !!
32 !! MODIFICATIONS
33 !! -------------
34 !! Original 01/2003
35 !-------------------------------------------------------------------------------
36 !
37 !* 0. DECLARATIONS
38 ! ------------
39 !
40 !
41 !
42 !
43 !
44 !
46 USE modd_diag_n, ONLY : diag_options_t
47 USE modd_watflux_n, ONLY : watflux_t
48 !
50 !
51 USE mode_pos_surf
52 !
54 USE modi_get_luout
55 USE modi_open_namelist
56 USE modi_close_namelist
57 !
59 !
60 USE modd_read_namelist, ONLY : lnam_read
61 USE modd_surf_par, ONLY : xundef
62 !
63 !
64 USE yomhook ,ONLY : lhook, dr_hook
65 USE parkind1 ,ONLY : jprb
66 !
67 IMPLICIT NONE
68 !
69 !* 0.1 Declarations of arguments
70 ! -------------------------
71 !
72 !
73 TYPE(ch_watflux_t), INTENT(INOUT) :: CHW
74 TYPE(diag_options_t), INTENT(INOUT) :: DGO
75 TYPE(watflux_t), INTENT(INOUT) :: W
76 !
77  CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM ! program calling ISBA
78 
79 !
80 !* 0.2 Declarations of local variables
81 ! -------------------------------
82 !
83 LOGICAL :: GFOUND ! Return code when searching namelist
84 INTEGER :: ILUOUT ! logical unit of output file
85 INTEGER :: INAM ! logical unit of namelist file
86 INTEGER :: IMI
87 REAL(KIND=JPRB) :: ZHOOK_HANDLE
88 !-------------------------------------------------------------------------------
89 !
90 !* get output listing file logical unit
91 !
92 IF (lhook) CALL dr_hook('READ_WATFLUX_CONF_N',0,zhook_handle)
93  CALL get_luout(hprogram,iluout)
94 !
96 !
97 IF (imi.NE.-1 .AND. lnam_read) THEN
98  CALL init_nam_watfluxn(w)
99  CALL init_nam_diag_surfn(dgo)
100  CALL init_nam_ch_watfluxn(chw)
101 ENDIF
102 !
103 IF (lnam_read) THEN
104  !
105  !* open namelist file
106  !
107  CALL open_namelist(hprogram,inam)
108  !
109  !* reading of namelist
110  ! -------------------
111  !
112  CALL posnam(inam,'NAM_WATFLUXN',gfound,iluout)
113  IF (gfound) READ(unit=inam,nml=nam_watfluxn)
114  CALL posnam(inam,'NAM_DIAG_SURFN',gfound,iluout)
115  IF (gfound) READ(unit=inam,nml=nam_diag_surfn)
116  CALL posnam(inam,'NAM_CH_WATFLUXN',gfound,iluout)
117  IF (gfound) READ(unit=inam,nml=nam_ch_watfluxn)
118  !
119  CALL test_nam_var_surf(iluout,'CWAT_ALB',cwat_alb,'UNIF','TA96')
120  CALL test_nam_var_surf(iluout,'CCH_DRY_DEP',cch_dry_dep,' ','WES89 ','NONE ')
121  CALL test_nam_var_surf(iluout,'CINTERPOL_TS',cinterpol_ts,'QUADRA','LINEAR','UNIF ','NONE ')
122  !
123  !* close namelist file
124  !
125  CALL close_namelist(hprogram,inam)
126  !
127 ENDIF
128 !
129 IF (imi.NE.-1) THEN
130  CALL update_nam_watfluxn(w)
131  CALL update_nam_diag_surfn(dgo)
132  CALL update_nam_ch_watfluxn(chw)
133  ENDIF
134 !
135 !-------------------------------------------------------------------------------
136 !
137 !* surface time-step forced by the atmosphere
138 !
139 xtstep = xundef
140 IF (lhook) CALL dr_hook('READ_WATFLUX_CONF_N',1,zhook_handle)
141 !
142 !-------------------------------------------------------------------------------
143 !
144 END SUBROUTINE read_watflux_conf_n
subroutine init_nam_diag_surfn(DGO)
integer function get_current_model_index_surfex()
subroutine read_watflux_conf_n(CHW, DGO, W, HPROGRAM)
character(len=4) cwat_alb
subroutine posnam(KULNAM, HDNAML, OFOUND, KLUOUT)
subroutine init_nam_watfluxn(W)
subroutine update_nam_ch_watfluxn(CHW)
character(len=6) cinterpol_ts
real, parameter xundef
integer, parameter jprb
Definition: parkind1.F90:32
subroutine init_nam_ch_watfluxn(CHW)
subroutine close_namelist(HPROGRAM, KLUNAM)
subroutine get_luout(HPROGRAM, KLUOUT)
Definition: get_luout.F90:7
logical lhook
Definition: yomhook.F90:15
subroutine update_nam_watfluxn(W)
subroutine open_namelist(HPROGRAM, KLUNAM, HFILE)
subroutine update_nam_diag_surfn(DGO)
character(len=6) cch_dry_dep