SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
prep_teb_greenroof_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_greenroof_buffer(HPROGRAM,HSURF,KLUOUT,PFIELD)
7 ! #################################################################################
8 !
9 !!**** *PREP_TEB_GREENROOF_BUFFER* - initializes ISBA fields from operational BUFFER
10 !!
11 !! PURPOSE
12 !! -------
13 !
14 !!** METHOD
15 !! ------
16 !! Based on "prep_teb_garden_buffer"
17 !!
18 !! REFERENCE
19 !! ---------
20 !!
21 !!
22 !! AUTHOR
23 !! ------
24 !! A. Lemonsu & C. de Munck
25 !!
26 !! MODIFICATIONS
27 !! -------------
28 !! Original 07/2011
29 !!------------------------------------------------------------------
30 !
31 
32 !
34 !
36 !
37 USE modi_prep_buffer_grid
39 !
40 USE modd_prep, ONLY : cinterp_type
41 USE modd_prep_teb_greenroof, ONLY : xgrid_soil, xwr_def
42 USE modd_data_cover_par, ONLY : nvegtype
43 USE modd_surf_par, ONLY : xundef
44 USE modd_grid_buffer, ONLY : nni
45 !
46 !
47 USE yomhook ,ONLY : lhook, dr_hook
48 USE parkind1 ,ONLY : jprb
49 !
50 IMPLICIT NONE
51 !
52 !* 0.1 declarations of arguments
53 !
54  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! program calling surf. schemes
55  CHARACTER(LEN=7), INTENT(IN) :: hsurf ! type of field
56 INTEGER, INTENT(IN) :: kluout ! logical unit of output listing
57 REAL,DIMENSION(:,:,:), POINTER :: pfield ! field to interpolate horizontally
58 !
59 !* 0.2 declarations of local variables
60 !
61 TYPE (date_time) :: tztime_buf ! current date and time
62  CHARACTER(LEN=6) :: yinmodel ! model from which buffer originates
63 REAL, DIMENSION(:,:), POINTER :: zfield ! field read
64 REAL, DIMENSION(:), POINTER :: zfield1d ! field read
65 REAL, DIMENSION(:,:), POINTER :: zd ! depth of field in the soil
66 INTEGER :: jvegtype ! loop counter on vegtypes
67 REAL(KIND=JPRB) :: zhook_handle
68 !
69 !-------------------------------------------------------------------------------------
70 !
71 !* 1. Reading of grid
72 ! ---------------
73 !
74 IF (lhook) CALL dr_hook('PREP_TEB_GREENROOF_BUFFER',0,zhook_handle)
75  CALL prep_buffer_grid(kluout,yinmodel,tztime_buf)
76 
77 !
78 !* 2. Reading of field
79 ! ----------------
80 !
81 !* 3. Transformation into physical quantity to be interpolated
82 ! --------------------------------------------------------
83 !
84 SELECT CASE(hsurf)
85 !
86 !* 3.1 Profile of temperature in the soil
87 !
88  CASE('TG ')
89  !* reading of the profile and its depth definition
90  SELECT CASE(yinmodel)
91  CASE('ALADIN')
92  CALL read_buffer_tg(kluout,yinmodel,zfield,zd)
93  END SELECT
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  CALL read_buffer_zs(kluout,yinmodel,zfield1d)
130  ALLOCATE(pfield(SIZE(zfield1d,1),1,1))
131  pfield(:,1,1)=zfield1d(:)
132  DEALLOCATE(zfield1d)
133 END SELECT
134 !
135 !* 4. Interpolation method
136 ! --------------------
137 !
138  cinterp_type='BUFFER'
139 !
140 !
141 !-------------------------------------------------------------------------------------
142 !-------------------------------------------------------------------------------------
143 !
144 IF (lhook) CALL dr_hook('PREP_TEB_GREENROOF_BUFFER',1,zhook_handle)
145  CONTAINS
146 !
147 !-------------------------------------------------------------------------------------
148 !-------------------------------------------------------------------------------------
150 !-------------------------------------------------------------------------------------
151 !
152 REAL, DIMENSION(:,:), ALLOCATABLE :: zout ! work array
153 REAL(KIND=JPRB) :: zhook_handle
154 !
155 !-------------------------------------------------------------------------------------
156 !
157  !
158  !* interpolation on fine vertical grid
159  IF (lhook) CALL dr_hook('SOIL_PROFILE_BUFFER',0,zhook_handle)
160  ALLOCATE(zout(SIZE(zfield,1),SIZE(xgrid_soil)))
161  CALL interp_grid_nat(zd,zfield,xgrid_soil,zout)
162  !
163  !* extends definition to all vegtypes.
164  ALLOCATE(pfield(SIZE(zfield,1),SIZE(xgrid_soil),nvegtype))
165  DO jvegtype=1,nvegtype
166  pfield(:,:,jvegtype)=zout(:,:)
167  END DO
168  !* end
169  DEALLOCATE(zout)
170  DEALLOCATE(zfield)
171  DEALLOCATE(zd)
172 IF (lhook) CALL dr_hook('SOIL_PROFILE_BUFFER',1,zhook_handle)
173 
174 END SUBROUTINE soil_profile_buffer
175 !
176 !-------------------------------------------------------------------------------------
177 END SUBROUTINE prep_teb_greenroof_buffer
subroutine read_buffer_wgi(KLUOUT, HINMODEL, PFIELD, PD)
subroutine read_buffer_tg(KLUOUT, HINMODEL, PFIELD, PD)
subroutine prep_teb_greenroof_buffer(HPROGRAM, HSURF, KLUOUT, PFIELD)
subroutine read_buffer_wg(KLUOUT, HINMODEL, PFIELD, PD)
subroutine prep_buffer_grid(KLUOUT, HINMODEL, TPTIME_BUF)
subroutine read_buffer_zs(KLUOUT, HINMODEL, PFIELD)
subroutine soil_profile_buffer