SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
put_on_all_vegtypes.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 put_on_all_vegtypes(KNI,KLAYER,KPATCH,KVEGTYPE,PFIELD_PATCH,PFIELD_VEGTYPE)
7 ! #######################
8 !
9 USE modi_vegtype_to_patch
10 !
11 !
12 USE yomhook ,ONLY : lhook, dr_hook
13 USE parkind1 ,ONLY : jprb
14 !
15 IMPLICIT NONE
16 !
17 !
18 !* dummy arguments
19 ! ---------------
20 !
21 INTEGER, INTENT(IN) :: kni ! number of points
22 INTEGER, INTENT(IN) :: klayer ! number of layers
23 INTEGER, INTENT(IN) :: kpatch ! number of patch
24 INTEGER, INTENT(IN) :: kvegtype ! number of vegtypes
25 REAL, DIMENSION(KNI,KLAYER,KPATCH ),INTENT(IN) :: pfield_patch ! field for each patch
26 REAL, DIMENSION(KNI,KLAYER,KVEGTYPE), INTENT(OUT) :: pfield_vegtype ! field for each vegtype
27 !
28 !
29 !* local variables
30 ! ---------------
31 !
32 INTEGER :: ipatch ! patch counter
33 INTEGER :: jvegtype ! vegtype counter
34 REAL(KIND=JPRB) :: zhook_handle
35 !
36 !-------------------------------------------------------------------
37 !
38 IF (lhook) CALL dr_hook('PUT_ON_ALL_VEGTYPES',0,zhook_handle)
39 IF (kvegtype==1) THEN
40  pfield_vegtype(:,:,1) = pfield_patch(:,:,1)
41 ELSE
42  DO jvegtype=1,kvegtype
43  ipatch = vegtype_to_patch(jvegtype,kpatch)
44  pfield_vegtype(:,:,jvegtype) = pfield_patch(:,:,ipatch)
45  END DO
46 END IF
47 IF (lhook) CALL dr_hook('PUT_ON_ALL_VEGTYPES',1,zhook_handle)
48 !-------------------------------------------------------------------
49 !
50 END SUBROUTINE put_on_all_vegtypes
integer function vegtype_to_patch(IVEGTYPE, INPATCH)
subroutine put_on_all_vegtypes(KNI, KLAYER, KPATCH, KVEGTYPE, PFIELD_PATCH, PFIELD_VEGTYPE)