SURFEX v8.1
General documentation of Surfex
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:6