SURFEX v7.3
General documentation of Surfex
 All Classes Files Functions Variables Typedefs
/home/dasprezs/EXPORT_v7_3/src/SURFEX/bldcode.F90
Go to the documentation of this file.
00001 FUNCTION BLDCODE(KTYPE,KAGE) RESULT(KCODE)
00002 !
00003 USE MODD_BLD_DESCRIPTION
00004 !
00005 IMPLICIT NONE
00006 INTEGER, DIMENSION(:), INTENT(IN) :: KTYPE ! Type of building
00007 INTEGER, DIMENSION(:), INTENT(IN) :: KAGE  ! date of construction (or total renovation) of building
00008 INTEGER, DIMENSION(SIZE(KTYPE))   :: KCODE ! Building code (merges type & age info).
00009 !
00010 INTEGER :: JL        ! loop counter on points
00011 INTEGER :: JAGE      ! loop counter on construction date ranges
00012 INTEGER :: ICODE_AGE ! code for the adequate construction date range
00013 !
00014 DO JL=1,SIZE(KTYPE)
00015   ICODE_AGE=NDESC_AGE_LIST(NDESC_AGE) ! default value is the more recent building
00016   DO JAGE=NDESC_AGE,1,-1
00017     IF (NDESC_AGE_DATE(JAGE)>=KAGE(JL)) ICODE_AGE = NDESC_AGE_LIST(JAGE)
00018   END DO
00019   KCODE(JL) = 100*KTYPE(JL)+ICODE_AGE
00020 END DO
00021 !
00022 END FUNCTION BLDCODE