SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
prep_teb_greenroof_ascllv.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_ascllv (DTCO, UG, U, USS, &
7  hprogram,hsurf,kluout,pfield)
8 ! #################################################################################
9 !
10 !!**** *PREP_TEB_GREENROOF_ASCLLV* - prepares ISBA field from prescribed values
11 !!
12 !! PURPOSE
13 !! -------
14 !
15 !!** METHOD
16 !! ------
17 !!
18 !! Based on "prep_teb_garden_ASCLLV"
19 !!
20 !! REFERENCE
21 !! ---------
22 !!
23 !!
24 !! AUTHOR
25 !! ------
26 !! A. Lemonsu & C. de Munck
27 !!
28 !! MODIFICATIONS
29 !! -------------
30 !! Original 07/2011
31 !!------------------------------------------------------------------
32 !
33 !
34 !
35 !
36 !
37 !
40 USE modd_surf_atm_n, ONLY : surf_atm_t
42 !
43 USE modd_prep, ONLY : cinterp_type
44 USE modd_pgd_grid, ONLY : nl,llatlonmask,cgrid,xgrid_par,ngrid_par
45 USE modd_pgdwork, ONLY : catype
46 USE modd_data_cover_par, ONLY : nvegtype
47 USE modd_surf_par, ONLY : xundef
48 USE modd_prep_teb_greenroof,ONLY : ctype_hug , ctype_tg , &
49  cfile_hug_surf_gr, cfile_tg_surf_gr, &
50  cfile_hug_root_gr, cfile_tg_root_gr, &
51  cfile_hug_deep_gr, cfile_tg_deep_gr
52 USE modi_pgd_field
53 USE modi_get_latlonmask_n
54 !
55 !
56 USE yomhook ,ONLY : lhook, dr_hook
57 USE parkind1 ,ONLY : jprb
58 !
59 USE modi_get_type_dim_n
60 !
61 IMPLICIT NONE
62 !
63 !* 0.1 declarations of arguments
64 !
65 !
66 TYPE(data_cover_t), INTENT(INOUT) :: dtco
67 TYPE(surf_atm_grid_t), INTENT(INOUT) :: ug
68 TYPE(surf_atm_t), INTENT(INOUT) :: u
69 TYPE(surf_atm_sso_t), INTENT(INOUT) :: uss
70 !
71  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! program calling surf. schemes
72  CHARACTER(LEN=7), INTENT(IN) :: hsurf ! type of field
73 INTEGER, INTENT(IN) :: kluout ! logical unit of output listing
74 REAL, POINTER, DIMENSION(:,:,:) :: pfield ! field to interpolate horizontally
75 !
76 !* 0.2 declarations of local variables
77 !
78 INTEGER :: jv ! loop counter
79 INTEGER :: jlayer
80 INTEGER :: il
81 !
82 REAL, ALLOCATABLE, DIMENSION(:,:) :: zfield
83 REAL(KIND=JPRB) :: zhook_handle
84 !
85 !-------------------------------------------------------------------------------------
86 !
87 IF (lhook) CALL dr_hook('PREP_TEB_GREENROOF_ASCLLV',0,zhook_handle)
88  catype = 'ARI'
89 !
90 !* 1. get full dimension of grid
91 !
92  CALL get_type_dim_n(dtco, u, &
93  'FULL ',nl)
94 !
95 !* 2. get nature dimension
96 !
97  CALL get_type_dim_n(dtco, u, &
98  'TOWN ',il)
99 !
100 ALLOCATE(zfield(il,3))
101 !
102 !* 3. get grid informations known over full grid
103 !
104  CALL get_latlonmask_n(ug, &
105  llatlonmask,cgrid,xgrid_par,ngrid_par)
106 !
107 !
108 SELECT CASE(hsurf)
109 !
110 !
111 !* 4. Profile of soil relative humidity
112 !
113  CASE('WG ')
114 
115  CALL pgd_field(dtco, ug, u, uss, &
116  hprogram,'HUG_SURF: relative humidity','TWN',cfile_hug_surf_gr, &
117  ctype_hug,xundef,zfield(:,1))
118  CALL pgd_field(dtco, ug, u, uss, &
119  hprogram,'HUG_ROOT: relative humidity','TWN',cfile_hug_root_gr, &
120  ctype_hug,xundef,zfield(:,2))
121  CALL pgd_field(dtco, ug, u, uss, &
122  hprogram,'HUG_DEEP: relative humidity','TWN',cfile_hug_deep_gr, &
123  ctype_hug,xundef,zfield(:,3))
124 
125  ALLOCATE(pfield(il,3,nvegtype))
126  DO jv=1,nvegtype
127  pfield(:,1,jv) = zfield(:,1)
128  pfield(:,2,jv) = zfield(:,2)
129  pfield(:,3,jv) = zfield(:,3)
130  END DO
131 
132 !* 5. Profile of temperatures
133 
134  CASE('TG ')
135 
136  CALL pgd_field(dtco, ug, u, uss, &
137  hprogram,'TG_SURF: temperature','TWN',cfile_tg_surf_gr, &
138  ctype_tg,xundef,zfield(:,1))
139  CALL pgd_field(dtco, ug, u, uss, &
140  hprogram,'TG_ROOT: temperature','TWN',cfile_tg_root_gr, &
141  ctype_tg,xundef,zfield(:,2))
142  CALL pgd_field(dtco, ug, u, uss, &
143  hprogram,'TG_DEEP: temperature','TWN',cfile_tg_deep_gr, &
144  ctype_tg,xundef,zfield(:,3))
145 
146  ALLOCATE(pfield(il,3,nvegtype))
147  DO jv=1,nvegtype
148  pfield(:,1,jv) = zfield(:,1)
149  pfield(:,2,jv) = zfield(:,2)
150  pfield(:,3,jv) = zfield(:,3)
151  END DO
152 
153 END SELECT
154 !
155 !* 6. Interpolation method
156 ! --------------------
157 !
158  cinterp_type='NONE '
159 DEALLOCATE(zfield)
160 IF (lhook) CALL dr_hook('PREP_TEB_GREENROOF_ASCLLV',1,zhook_handle)
161 !
162 !-------------------------------------------------------------------------------------
163 END SUBROUTINE prep_teb_greenroof_ascllv
subroutine get_type_dim_n(DTCO, U, HTYPE, KDIM)
subroutine pgd_field(DTCO, UG, U, USS, HPROGRAM, HFIELD, HAREA, HFILE, HFILETYPE, PUNIF, PFIELD, OPRESENT)
Definition: pgd_field.F90:6
subroutine prep_teb_greenroof_ascllv(DTCO, UG, U, USS, HPROGRAM, HSURF, KLUOUT, PFIELD)
subroutine get_latlonmask_n(UG, OLATLONMASK, HGRID, PGRID_PAR, KGRID_PAR)