SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
bldcode.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 FUNCTION bldcode (BDD, KTYPE,KAGE) RESULT(KCODE)
6 !
7 !
8 !
10 !
11 IMPLICIT NONE
12 !
13 TYPE(bld_desc_t), INTENT(INOUT) :: bdd
14 !
15 INTEGER, DIMENSION(:), INTENT(IN) :: ktype ! Type of building
16 INTEGER, DIMENSION(:), INTENT(IN) :: kage ! date of construction (or total renovation) of building
17 INTEGER, DIMENSION(SIZE(KTYPE)) :: kcode ! Building code (merges type & age info).
18 !
19 INTEGER :: jl ! loop counter on points
20 INTEGER :: jage ! loop counter on construction date ranges
21 INTEGER :: icode_age ! code for the adequate construction date range
22 !
23 DO jl=1,SIZE(ktype)
24  icode_age=bdd%NDESC_AGE_LIST(bdd%NDESC_AGE) ! default value is the more recent building
25  DO jage=bdd%NDESC_AGE,1,-1
26  IF (bdd%NDESC_AGE_DATE(jage)>=kage(jl)) icode_age = bdd%NDESC_AGE_LIST(jage)
27  END DO
28  kcode(jl) = 100*ktype(jl)+icode_age
29 END DO
30 !
31 END FUNCTION bldcode
integer function, dimension(size(ktype)) bldcode(BDD, KTYPE, KAGE)
Definition: bldcode.F90:5