SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
read_default_teb_vegn.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_default_teb_veg_n (CHT, TVG, &
7  hprogram)
8 ! #######################################################
9 !
10 !!**** *READ_DEFAULT_TEB_VEG* - routine to read the configuration for VEGs
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 USE modd_ch_teb_n, ONLY : ch_teb_t
46 !
48 !
49 USE mode_pos_surf
50 !
51 USE modi_get_luout
52 USE modi_get_default_nam_n
53 !
54 USE modd_read_namelist, ONLY : lnam_read
56 !
57 !
58 USE yomhook ,ONLY : lhook, dr_hook
59 USE parkind1 ,ONLY : jprb
60 !
61 IMPLICIT NONE
62 !
63 !* 0.1 Declarations of arguments
64 ! -------------------------
65 !
66 !
67 TYPE(ch_teb_t), INTENT(INOUT) :: cht
68 TYPE(teb_veg_options_t), INTENT(INOUT) :: tvg
69 !
70  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! program calling ISBA
71 
72 !
73 !* 0.2 Declarations of local variables
74 ! -------------------------------
75 !
76 !
77 LOGICAL :: gfound ! Return code when searching namelist
78 INTEGER :: iluout ! output listing logical unit
79 INTEGER :: iludes ! .des file logical unit
80 INTEGER :: imi
81 REAL(KIND=JPRB) :: zhook_handle
82 !-------------------------------------------------------------------------------
83 !
84 IF (lhook) CALL dr_hook('READ_DEFAULT_TEB_VEG_N',0,zhook_handle)
85  CALL get_luout(hprogram,iluout)
86 !
87  CALL get_default_nam_n(hprogram,'READ ',iludes)
88 !
89 IF (iludes==0 .AND. lhook) CALL dr_hook('READ_DEFAULT_TEB_VEG_N',1,zhook_handle)
90 IF (iludes==0) RETURN
91 !
93 !
94 IF (imi.NE.-1 .AND. lnam_read) THEN
95  CALL init_nam_teb_vegn(tvg)
96  CALL init_nam_teb_veg_agsn(tvg)
97  CALL init_nam_ch_controln(cht)
98  CALL init_nam_ch_teb_vegn(cht)
99  CALL init_nam_sgh_teb_vegn(tvg)
100 ENDIF
101 !
102 IF (lnam_read) THEN
103  !
104  !* reading of new defaults in file
105  ! -------------------------------
106  !
107  CALL posnam(iludes,'NAM_ISBAN',gfound,iluout)
108  IF (gfound) READ(unit=iludes,nml=nam_isban)
109  CALL posnam(iludes,'NAM_ISBA_AGSN',gfound,iluout)
110  IF (gfound) READ(unit=iludes,nml=nam_isba_agsn)
111  CALL posnam(iludes,'NAM_CH_CONTROLN',gfound,iluout)
112  IF (gfound) READ(unit=iludes,nml=nam_ch_controln)
113 ! for the time being, chemistry is not implemented on gardens
114 ! CALL POSNAM(ILUDES,'NAM_CH_ISBAN',GFOUND,ILUOUT)
115 ! IF (GFOUND) READ(UNIT=ILUDES,NML=NAM_CH_ISBAn)
116  CALL posnam(iludes,'NAM_SGH_ISBAN',gfound,iluout)
117  IF (gfound) READ(unit=iludes,nml=nam_sgh_isban)
118  !
119 ENDIF
120 !
121 IF (imi.NE.-1) THEN
122  CALL update_nam_teb_vegn(tvg)
123  CALL update_nam_teb_veg_agsn(tvg)
124  CALL update_nam_ch_controln(cht)
125  CALL update_nam_ch_teb_vegn(cht)
126  CALL update_nam_sgh_teb_vegn(tvg)
127 ENDIF
128 IF (lhook) CALL dr_hook('READ_DEFAULT_TEB_VEG_N',1,zhook_handle)
129 !
130 !
131 !-------------------------------------------------------------------------------
132 !
133 END SUBROUTINE read_default_teb_veg_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 init_nam_sgh_teb_vegn(TVG)
subroutine posnam(KULNAM, HDNAML, OFOUND, KLUOUT)
subroutine get_luout(HPROGRAM, KLUOUT)
Definition: get_luout.F90:6
subroutine read_default_teb_veg_n(CHT, TVG, HPROGRAM)
integer function get_current_model_index_surfex()
subroutine get_default_nam_n(HPROGRAM, HACTION, KLUDES)