SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
prep_isba_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_isba_ascllv (DTCO, UG, U, USS, &
7  hprogram,hsurf,kluout,pfield)
8 ! #################################################################################
9 !
10 !!**** *PREP_ISBA_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_isba, ONLY : ctype_hug , ctype_tg , &
47  cfile_hug_surf, cfile_tg_surf, &
48  cfile_hug_root, cfile_tg_root, &
49  cfile_hug_deep, cfile_tg_deep
50 USE modi_pgd_field
51 USE modi_get_latlonmask_n
52 USE modi_abor1_sfx
53 !
54 !
55 USE yomhook ,ONLY : lhook, dr_hook
56 USE parkind1 ,ONLY : jprb
57 !
58 USE modi_get_type_dim_n
59 !
60 IMPLICIT NONE
61 !
62 !* 0.1 declarations of arguments
63 !
64 !
65 TYPE(data_cover_t), INTENT(INOUT) :: dtco
66 TYPE(surf_atm_grid_t), INTENT(INOUT) :: ug
67 TYPE(surf_atm_t), INTENT(INOUT) :: u
68 TYPE(surf_atm_sso_t), INTENT(INOUT) :: uss
69 !
70  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! program calling surf. schemes
71  CHARACTER(LEN=7), INTENT(IN) :: hsurf ! type of field
72 INTEGER, INTENT(IN) :: kluout ! logical unit of output listing
73 REAL, POINTER, DIMENSION(:,:,:) :: pfield ! field to interpolate horizontally
74 !
75 !* 0.2 declarations of local variables
76 !
77 INTEGER :: jv ! loop counter
78 INTEGER :: jlayer
79 INTEGER :: il
80 !
81 REAL, ALLOCATABLE, DIMENSION(:,:) :: zfield
82 REAL(KIND=JPRB) :: zhook_handle
83 !
84 !-------------------------------------------------------------------------------------
85 !
86 IF (lhook) CALL dr_hook('PREP_ISBA_ASCLLV',0,zhook_handle)
87  catype = 'ARI'
88 !
89 !* 1. get full dimension of grid
90 !
91  CALL get_type_dim_n(dtco, u, &
92  'FULL ',nl)
93 !
94 !* 2. get nature dimension
95 !
96  CALL get_type_dim_n(dtco, u, &
97  'NATURE',il)
98 !
99 ALLOCATE(zfield(il,3))
100 !
101 !* 3. get grid informations known over full grid
102 !
103  CALL get_latlonmask_n(ug, &
104  llatlonmask,cgrid,xgrid_par,ngrid_par)
105 !
106 !
107 SELECT CASE(hsurf)
108 !
109 !
110 !* 4. Profile of soil relative humidity
111 !
112  CASE('WG ')
113 
114  CALL pgd_field(dtco, ug, u, uss, &
115  hprogram,'HUG_SURF: relative humidity','NAT',cfile_hug_surf, &
116  ctype_hug,xundef,zfield(:,1))
117  CALL pgd_field(dtco, ug, u, uss, &
118  hprogram,'HUG_ROOT: relative humidity','NAT',cfile_hug_root, &
119  ctype_hug,xundef,zfield(:,2))
120  CALL pgd_field(dtco, ug, u, uss, &
121  hprogram,'HUG_DEEP: relative humidity','NAT',cfile_hug_deep, &
122  ctype_hug,xundef,zfield(:,3))
123 
124  ALLOCATE(pfield(il,3,nvegtype))
125  DO jv=1,nvegtype
126  pfield(:,1,jv) = zfield(:,1)
127  pfield(:,2,jv) = zfield(:,2)
128  pfield(:,3,jv) = zfield(:,3)
129  END DO
130 
131 !* 5. Profile of temperatures
132 
133  CASE('TG ')
134 
135  CALL pgd_field(dtco, ug, u, uss, &
136  hprogram,'TG_SURF: temperature','NAT',cfile_tg_surf, &
137  ctype_tg,xundef,zfield(:,1))
138  CALL pgd_field(dtco, ug, u, uss, &
139  hprogram,'TG_ROOT: temperature','NAT',cfile_tg_root, &
140  ctype_tg,xundef,zfield(:,2))
141  CALL pgd_field(dtco, ug, u, uss, &
142  hprogram,'TG_DEEP: temperature','NAT',cfile_tg_deep, &
143  ctype_tg,xundef,zfield(:,3))
144 
145  ALLOCATE(pfield(il,3,nvegtype))
146  DO jv=1,nvegtype
147  pfield(:,1,jv) = zfield(:,1)
148  pfield(:,2,jv) = zfield(:,2)
149  pfield(:,3,jv) = zfield(:,3)
150  END DO
151 !
152  CASE default
153  CALL abor1_sfx('PREP_ISBA_ASCLLV: '//trim(hsurf)//" initialization not implemented !")
154 !
155 END SELECT
156 !
157 !* 6. Interpolation method
158 ! --------------------
159 !
160  cinterp_type='NONE '
161 DEALLOCATE(zfield)
162 !
163 IF (lhook) CALL dr_hook('PREP_ISBA_ASCLLV',1,zhook_handle)
164 !
165 !-------------------------------------------------------------------------------------
166 END SUBROUTINE prep_isba_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_isba_ascllv(DTCO, UG, U, USS, HPROGRAM, HSURF, KLUOUT, PFIELD)
subroutine abor1_sfx(YTEXT)
Definition: abor1_sfx.F90:6
subroutine get_latlonmask_n(UG, OLATLONMASK, HGRID, PGRID_PAR, KGRID_PAR)