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