SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
read_teb_veg_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_teb_veg_conf_n (CHT, TVG, &
7  hprogram)
8 ! #######################################################
9 !
10 !!**** *READ_TEB_VEG_CONF* - routine to read the configuration for VEG
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 !! P Le Moigne 09/2005 AGS modifs of L. Jarlan
37 !! P Le Moigne 09/2005 CSNOWRES option
38 !! Modified by P. Le Moigne (06/2006): seeding and irrigation
39 !! Modified by P. Le Moigne (05/2008): deep soil characteristics
40 !! B. Decharme 06/2013 delete CTOPREG
41 !-------------------------------------------------------------------------------
42 !
43 !* 0. DECLARATIONS
44 ! ------------
45 !
46 !
47 !
48 !
49 USE modd_ch_teb_n, ONLY : ch_teb_t
51 !
53 !
54 USE mode_pos_surf
55 !
57 USE modi_get_luout
58 USE modi_open_namelist
59 USE modi_close_namelist
60 !
62 !
63 USE modd_read_namelist, ONLY : lnam_read
64 USE modd_surf_par, ONLY : xundef
65 !
66 !
67 USE yomhook ,ONLY : lhook, dr_hook
68 USE parkind1 ,ONLY : jprb
69 !
70 IMPLICIT NONE
71 !
72 !* 0.1 Declarations of arguments
73 ! -------------------------
74 !
75 !
76 TYPE(ch_teb_t), INTENT(INOUT) :: cht
77 TYPE(teb_veg_options_t), INTENT(INOUT) :: tvg
78 !
79  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! program calling ISBA
80 
81 !
82 !* 0.2 Declarations of local variables
83 ! -------------------------------
84 !
85 !
86 LOGICAL :: gfound ! Return code when searching namelist
87 INTEGER :: iluout ! logical unit of output file
88 INTEGER :: inam ! logical unit of namelist file
89 INTEGER :: imi
90 REAL(KIND=JPRB) :: zhook_handle
91 !-------------------------------------------------------------------------------
92 !
93 !* get output listing file logical unit
94 !
95 IF (lhook) CALL dr_hook('READ_TEB_VEG_CONF_N',0,zhook_handle)
96  CALL get_luout(hprogram,iluout)
97 !
99 !
100 IF (imi.NE.-1 .AND. lnam_read) THEN
101  CALL init_nam_teb_vegn(tvg)
102  CALL init_nam_teb_veg_agsn(tvg)
103  CALL init_nam_ch_controln(cht)
104  CALL init_nam_ch_teb_vegn(cht)
105  CALL init_nam_sgh_teb_vegn(tvg)
106 ENDIF
107 
108 IF (lnam_read) THEN
109  !
110  !* open namelist file
111  !
112  CALL open_namelist(hprogram,inam)
113  !
114  !* reading of namelist
115  ! -------------------
116  !
117  CALL posnam(inam,'NAM_ISBAN',gfound,iluout)
118  IF (gfound) READ(unit=inam,nml=nam_isban)
119  CALL posnam(inam,'NAM_ISBA_AGSN',gfound,iluout)
120  IF (gfound) READ(unit=inam,nml=nam_isba_agsn)
121 ! for the time being, chemistry is not implemented on gardens
122 ! CALL POSNAM(INAM,'NAM_CH_ISBAN',GFOUND,ILUOUT)
123 ! IF (GFOUND) READ(UNIT=INAM,NML=NAM_CH_ISBAn)
124  CALL posnam(inam,'NAM_CH_CONTROLN',gfound,iluout)
125  IF (gfound) READ(unit=inam,nml=nam_ch_controln)
126  CALL posnam(inam,'NAM_SGH_ISBAN',gfound,iluout)
127  IF (gfound) READ(unit=inam,nml=nam_sgh_isban)
128  !
129  CALL test_nam_var_surf(iluout,'CROUGH',crough,'NONE','Z01D','Z04D','BE04','UNDE')
130  CALL test_nam_var_surf(iluout,'CSCOND',cscond,'NP89','PL98')
131  CALL test_nam_var_surf(iluout,'CALBEDO',calbedo,'EVOL','DRY ','WET ','MEAN','USER','CM13')
132  CALL test_nam_var_surf(iluout,'CC1DRY',cc1dry,'DEF ','GB93')
133  CALL test_nam_var_surf(iluout,'CSOILFRZ',csoilfrz,'DEF','LWT')
134  CALL test_nam_var_surf(iluout,'CDIFSFCOND',cdifsfcond,'DEF ','MLCH')
135  CALL test_nam_var_surf(iluout,'CSNOWRES',csnowres,'DEF','RIL')
136  CALL test_nam_var_surf(iluout,'CCPSURF',ccpsurf,'DRY','HUM')
137  !
138  CALL test_nam_var_surf(iluout,'CRUNOFF',crunoff,'WSAT','DT92','SGH ','TOPD')
139  CALL test_nam_var_surf(iluout,'CKSAT',cksat,'DEF','SGH','EXP')
140  CALL test_nam_var_surf(iluout,'CHORT',chort,'DEF','SGH')
141  !
142  !* close namelist file
143  !
144  CALL close_namelist(hprogram,inam)
145  !
146 ENDIF
147 !
148 IF (imi.NE.-1) THEN
149  CALL update_nam_teb_vegn(tvg)
150  CALL update_nam_teb_veg_agsn(tvg)
151  CALL update_nam_ch_teb_vegn(cht)
152  CALL update_nam_ch_controln(cht)
153  CALL update_nam_sgh_teb_vegn(tvg)
154 ENDIF
155 IF (lhook) CALL dr_hook('READ_TEB_VEG_CONF_N',1,zhook_handle)
156 !
157 !-------------------------------------------------------------------------------
158 !
159 !* surface time-step forced by the atmosphere
160 !
161 !XTSTEP = XUNDEF
162 !
163 !-------------------------------------------------------------------------------
164 !
165 END SUBROUTINE read_teb_veg_conf_n
subroutine update_nam_ch_controln(CHI)
Definition: modn_isban.F90:365
subroutine init_nam_teb_veg_agsn(TVG)
subroutine update_nam_ch_teb_vegn(CHT)
subroutine update_nam_sgh_teb_vegn(TVG)
subroutine init_nam_teb_vegn(TVG)
subroutine init_nam_ch_teb_vegn(CHT)
subroutine init_nam_ch_controln(CHI)
Definition: modn_isban.F90:350
subroutine update_nam_teb_vegn(TVG)
subroutine update_nam_teb_veg_agsn(TVG)
subroutine close_namelist(HPROGRAM, KLUNAM)
subroutine init_nam_sgh_teb_vegn(TVG)
subroutine posnam(KULNAM, HDNAML, OFOUND, KLUOUT)
subroutine get_luout(HPROGRAM, KLUOUT)
Definition: get_luout.F90:6
subroutine read_teb_veg_conf_n(CHT, TVG, HPROGRAM)
subroutine open_namelist(HPROGRAM, KLUNAM, HFILE)
integer function get_current_model_index_surfex()