SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
prep_teb_garden_buffer.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 prep_teb_garden_buffer(HPROGRAM,HSURF,KLUOUT,PFIELD)
7 ! #################################################################################
8 !
9 !!**** *PREP_TEB_GARDEN_BUFFER* - initializes ISBA fields from operational BUFFER
10 !!
11 !! PURPOSE
12 !! -------
13 !
14 !!** METHOD
15 !! ------
16 !!
17 !! REFERENCE
18 !! ---------
19 !!
20 !!
21 !! AUTHOR
22 !! ------
23 !! S. Malardel
24 !!
25 !! MODIFICATIONS
26 !! -------------
27 !! Original 03/2005
28 !!------------------------------------------------------------------
29 !
30 
31 !
33 !
35 !
36 USE modi_prep_buffer_grid
38 !
39 USE modd_prep, ONLY : cinterp_type
40 USE modd_prep_teb_garden,ONLY : xgrid_soil, xwr_def
41 USE modd_data_cover_par, ONLY : nvegtype
42 USE modd_surf_par, ONLY : xundef
43 USE modd_grid_buffer, ONLY : nni
44 !
45 !
46 USE yomhook ,ONLY : lhook, dr_hook
47 USE parkind1 ,ONLY : jprb
48 !
49 IMPLICIT NONE
50 !
51 !* 0.1 declarations of arguments
52 !
53  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! program calling surf. schemes
54  CHARACTER(LEN=7), INTENT(IN) :: hsurf ! type of field
55 INTEGER, INTENT(IN) :: kluout ! logical unit of output listing
56 REAL,DIMENSION(:,:,:), POINTER :: pfield ! field to interpolate horizontally
57 !
58 !* 0.2 declarations of local variables
59 !
60 TYPE (date_time) :: tztime_buf ! current date and time
61  CHARACTER(LEN=6) :: yinmodel ! model from which buffer originates
62 REAL, DIMENSION(:,:), POINTER :: zfield ! field read
63 REAL, DIMENSION(:), POINTER :: zfield1d ! field read
64 REAL, DIMENSION(:,:), POINTER :: zd ! depth of field in the soil
65 INTEGER :: jvegtype ! loop counter on vegtypes
66 REAL(KIND=JPRB) :: zhook_handle
67 !
68 !-------------------------------------------------------------------------------------
69 !
70 !* 1. Reading of grid
71 ! ---------------
72 !
73 IF (lhook) CALL dr_hook('PREP_TEB_GARDEN_BUFFER',0,zhook_handle)
74  CALL prep_buffer_grid(kluout,yinmodel,tztime_buf)
75 
76 !
77 !* 2. Reading of field
78 ! ----------------
79 !
80 !* 3. Transformation into physical quantity to be interpolated
81 ! --------------------------------------------------------
82 !
83 SELECT CASE(hsurf)
84 !
85 !* 3.1 Profile of temperature in the soil
86 !
87  CASE('TG ')
88  !* reading of the profile and its depth definition
89  SELECT CASE(yinmodel)
90  CASE('ALADIN')
91  CALL read_buffer_tg(kluout,yinmodel,zfield,zd)
92  END SELECT
93 
95 
96  CASE('WG ')
97  !* reading of the profile and its depth definition
98  SELECT CASE(yinmodel)
99  CASE('ARPEGE','ALADIN','MOCAGE')
100  CALL read_buffer_wg(kluout,yinmodel,zfield,zd)
101  END SELECT
103 
104 
105 !* 3.3 Profile of soil ice content
106 
107  CASE('WGI ')
108  !* reading of the profile and its depth definition
109  SELECT CASE(yinmodel)
110  CASE('ALADIN')
111  CALL read_buffer_wgi(kluout,yinmodel,zfield,zd)
112  END SELECT
114 !
115 !* 3.4 Water content intercepted on leaves, LAI
116 !
117  CASE('WR ')
118  ALLOCATE(pfield(nni,1,nvegtype))
119  pfield(:,:,:) = xwr_def
120 !
121  CASE('LAI ')
122  ALLOCATE(pfield(nni,1,nvegtype))
123  pfield(:,:,:) = xundef
124 !
125 !
126 !* 3.5 Other fields
127 !
128  CASE('ZS ')
129 !GH
130 ! CALL READ_BUFFER_ZS_LAND(KLUOUT,YINMODEL,ZFIELD1D)
131  CALL read_buffer_zs(kluout,yinmodel,zfield1d)
132 !END GH
133  ALLOCATE(pfield(SIZE(zfield1d,1),1,1))
134  pfield(:,1,1)=zfield1d(:)
135  DEALLOCATE(zfield1d)
136 END SELECT
137 !
138 !* 4. Interpolation method
139 ! --------------------
140 !
141  cinterp_type='BUFFER'
142 !
143 !
144 !-------------------------------------------------------------------------------------
145 !-------------------------------------------------------------------------------------
146 !
147 IF (lhook) CALL dr_hook('PREP_TEB_GARDEN_BUFFER',1,zhook_handle)
148  CONTAINS
149 !
150 !-------------------------------------------------------------------------------------
151 !-------------------------------------------------------------------------------------
153 !-------------------------------------------------------------------------------------
154 !
155 REAL, DIMENSION(:,:), ALLOCATABLE :: zout ! work array
156 REAL(KIND=JPRB) :: zhook_handle
157 !
158 !-------------------------------------------------------------------------------------
159 !
160  !
161  !* interpolation on fine vertical grid
162  IF (lhook) CALL dr_hook('SOIL_PROFILE_BUFFER',0,zhook_handle)
163  ALLOCATE(zout(SIZE(zfield,1),SIZE(xgrid_soil)))
164  CALL interp_grid(zd,zfield,xgrid_soil,zout)
165  !
166  !* extends definition to all vegtypes.
167  ALLOCATE(pfield(SIZE(zfield,1),SIZE(xgrid_soil),nvegtype))
168  DO jvegtype=1,nvegtype
169  pfield(:,:,jvegtype)=zout(:,:)
170  END DO
171  !* end
172  DEALLOCATE(zout)
173  DEALLOCATE(zfield)
174  DEALLOCATE(zd)
175 IF (lhook) CALL dr_hook('SOIL_PROFILE_BUFFER',1,zhook_handle)
176 
177 END SUBROUTINE soil_profile_buffer
178 !
179 !-------------------------------------------------------------------------------------
180 END SUBROUTINE prep_teb_garden_buffer
subroutine read_buffer_wgi(KLUOUT, HINMODEL, PFIELD, PD)
subroutine read_buffer_tg(KLUOUT, HINMODEL, PFIELD, PD)
subroutine read_buffer_wg(KLUOUT, HINMODEL, PFIELD, PD)
subroutine prep_buffer_grid(KLUOUT, HINMODEL, TPTIME_BUF)
subroutine prep_teb_garden_buffer(HPROGRAM, HSURF, KLUOUT, PFIELD)
subroutine read_buffer_zs(KLUOUT, HINMODEL, PFIELD)
subroutine soil_profile_buffer