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