1d0
< MODULE Sfc_Ibis_Fiels
2a2,10
> ! Modified by Tarassova 2015
> !  Climate aerosol (Kinne, 2013) coarse mode included
> ! Fine aerosol mode is included
> !  Modifications (4) are marked by 
> !  !tar begin   and  !tar end
> 
> MODULE Sfc_Ibis_Fiels
>   USE Parallelism, ONLY:   &
>        MsgOne
10a19,22
> !tar begin
> !climate aerosol selection parameter
>        ifaeros, &
> !tar end
12,17c24,27
<        iglsm_w, mxiter,nftgz0,nfzol,&
<        nfsoiltp,nfvegtp,nfslmtp,nfsibi,isimp,intndvi,rootmode,&
<        nfprt  , nfctrl, nfsibd, nfalb,filta,ifndvi ,ifslmSib2,&
<        epsflt,istrt,Model1D,schemes,fNameTg3zrl,fNameRouLen,fNameSoilms,fNameSoilmsWkl,nfslm,&
<        nSite,UNDIMENSION,NMSOILM,type_veg,lon_site,lat_site,deltat_site,sand_site,clay_site,clmt_site,&
<        tgrnd_site,wsoil_site,zorol_site,gtsea_site
---
>        iglsm_w, mxiter,nftgz0,nfzol,NMSOILM,&
>        nfsoiltp,nfvegtp,nfslmtp,nfsibi,isimp,intndvi,intsoilm,ifco2flx,&
>        nfprt  , nfctrl, nfsibd, nfalb,filta,ifndvi ,ifslmSib2,iftracer,&
>        epsflt,istrt,Model1D,schemes,fNameTg3zrl,fNameRouLen,omlmodel,oml_hml0,co2val
26,28c36,58
<       gtsea,soilm,o3mix,tg1,tg2,tg3,ssib,wsib3d,gl0,Mmlen,tg0,tgm,&
<       tseam,z0,zorl,AlbVisDiff,sheleg,rVisDiff,gndvi,imask,MskAnt,tc0,&
<       ppli,ppci,capac0,capacm,td0,w0,wm,tdm,tcm,qsfc0,tsfc0,qsfcm,tsfcm,tkemyj
---
>        gtsea,gco2flx,soilm,o3mix,tg1,tg2,tg3,ssib,wsib3d,gl0,Mmlen,tg0,tgm,&
> !tar begin
> !climate aerosol optical parameters of coarse mode
>       aod,asy,ssa,z_aer, & 
> !tar end
> !
> !tar begin
> !climate aerosol optical parameters of fine mode
>       aodF,asyF,ssaF,z_aerF, & 
> !tar end     
>        tseam,z0,zorl,AlbVisDiff,sheleg,rVisDiff,gco2flx,gndvi,imask,SoilMask,MskAnt,tc0,&
>        ppli,ppci,capac0,capacm,td0,w0,wm,tdm,tcm,qsfc0,tsfc0,qsfcm,tsfcm,tkemyj,tracermix,&
>        HML,HUML,HVML,TSK,z0sea,mlsi,snow           , &  ! add solange 13-11-2012
>        laymld,       hbath,     tdeep,sdeep,     &
>        sm0 ,      sfc    ,PBL_CoefKm, PBL_CoefKh,tauresx,tauresy,poda ,tmin2m   ,tmax2m,cflxm            ! add solange 13-11-2012
> 
>   USE Sfc_SeaIceFlux_WRF_Model  , Only : &
>       TC_SeaIce     ,&
>       TGS_SeaIce ,&
>       TD_SeaIce  ,&
>       TA_SeaIce  ,&
>       SNOA_SeaIce,&
>       SNOB_SeaIce
29a60,61
> !  USE Mod_Sfc_SICE_FLUX  , Only : &
> !      Sfc_SICE_Flux
34,37c66
<        NearestIJtoIBJB, &
<        SeaMaskIJtoIBJB, &
<        SplineIJtoIBJB, &
<        AveBoxIJtoIBJB, &
---
>        NearestIJtoIBJB,&
45a75,76
> SAVE
> 
53,60c84,91
< ! -------------------------------
< ! state description configuration
< ! -------------------------------
< !
< !
< ! --------------------------
< ! typical ibis configuration
< ! --------------------------
---
>   ! -------------------------------
>   ! state description configuration
>   ! -------------------------------
>   !
>   !
>   ! --------------------------
>   ! typical ibis configuration
>   ! --------------------------
72,74c103,105
< ! --------------
< ! some constants
< ! --------------
---
>   ! --------------
>   ! some constants
>   ! --------------
78,80c109,111
< !
< ! Arguments (input)     
< !
---
>   !
>   ! Arguments (input)     
>   !
82c113
<    INTEGER, PUBLIC, PARAMETER :: isimco2 =1
---
>   INTEGER, PUBLIC            :: isimco2 =0
84c115
<    INTEGER, PUBLIC, PARAMETER :: isimveg = 1     ! 0 = static veg, 
---
>   INTEGER, PUBLIC            :: isimveg =0         ! 0 = static veg, 
91,94c122,125
< ! -------------------------------
< ! state description configuration
< ! -------------------------------
< !
---
>   ! -------------------------------
>   ! state description configuration
>   ! -------------------------------
>   !
96c127
<    INTEGER, PUBLIC, PARAMETER :: nsoilay=20        ! number of soil layers
---
>   INTEGER, PUBLIC, PARAMETER :: nsoilay=6        ! number of soil layers
102d132
<    INTEGER, PUBLIC, PARAMETER :: nVegClass=15
104,106c134,137
< ! ----------------------------------------
< ! Soil texture-related parameters for ibis
< ! ----------------------------------------
---
> 
>   ! ----------------------------------------
>   ! Soil texture-related parameters for ibis
>   ! ----------------------------------------
111,113c142,144
< !---------------------------------------------------------------------------------
< !  minimum density of woody biomass required for upper canopy closure (kg C m-2)
< !---------------------------------------------------------------------------------
---
>   !---------------------------------------------------------------------------------
>   !  minimum density of woody biomass required for upper canopy closure (kg C m-2)
>   !---------------------------------------------------------------------------------
115c146
<    REAL(KIND=r8), PARAMETER , PUBLIC :: woodnorm=10.5_r8 !  woodnorm  ! value of woody biomass for upper canopy closure (ie when 
---
>   REAL(KIND=r8), PARAMETER , PUBLIC :: woodnorm=7.5_r8 !  woodnorm  ! value of woody biomass for upper canopy closure (ie when 
117,121c148,152
< ! leaf optical properties from Sellers et al., 1996 and Bonan, 1995
< !-----------------------------------------------------------------------------------------
< ! leaf reflectance (rhoveg) and transmittance (tauveg), visible and NIR, for each canopy
< !-----------------------------------------------------------------------------------------
<    REAL(KIND=r8),ALLOCATABLE, PUBLIC :: tauwood  (:,:,:)      ! wood biomass turnover(rotatividade) time constant (years)
---
>   ! leaf optical properties from Sellers et al., 1996 and Bonan, 1995
>   !-----------------------------------------------------------------------------------------
>   ! leaf reflectance (rhoveg) and transmittance (tauveg), visible and NIR, for each canopy
>   !-----------------------------------------------------------------------------------------
>   REAL(KIND=r8),ALLOCATABLE, PUBLIC :: tauwood  (:,:,:)      ! wood biomass turnover time constant (years)
125,127c156,158
< !-----------------------------------------------------------------------
< ! linear dimensions for aerodynamic flux parameterization: dleaf, dstem
< !-----------------------------------------------------------------------
---
>   !-----------------------------------------------------------------------
>   ! linear dimensions for aerodynamic flux parameterization: dleaf, dstem
>   !-----------------------------------------------------------------------
130,132c161,163
< !--------------------------------------------------------------------
< ! normalization constants for canopy drag coefficients (m2 m-2)
< !---------------------------------------------------------------------
---
>   !--------------------------------------------------------------------
>   ! normalization constants for canopy drag coefficients (m2 m-2)
>   !---------------------------------------------------------------------
137,140c168,171
< !----------------------------------------------------------------------------
< ! empirical coefficients for aerodynamic transfer parameterization (m s-0.5) 
< ! From Pollard & Thompson (1995, eq. A39a)
< !----------------------------------------------------------------------------
---
>   !----------------------------------------------------------------------------
>   ! empirical coefficients for aerodynamic transfer parameterization (m s-0.5) 
>   ! From Pollard & Thompson (1995, eq. A39a)
>   !----------------------------------------------------------------------------
142c173
<    REAL(KIND=r8), PARAMETER   , PUBLIC :: cleaf  = 0.01_r8! cleaf  : upper canopy leaf-air          ! empirical constant in upper canopy leaf-air aerodynamic transfer
---
>   REAL(KIND=r8), PARAMETER   , PUBLIC :: cleaf= 0.01_r8  ! cleaf  : upper canopy leaf-air          ! empirical constant in upper canopy leaf-air aerodynamic transfer
148,234c179,188
< !----------------------------------------------------------------------------
< ! heat capacities of leaves and stems  (J kg-1 C-1 m-2)
< ! derived from specific heat of liquid water (ch2o = 4.218 J g-1) - 4218.0 J/kg 
< !
< !      chu = ch2o *  2.0      ! heat capacity of upper leaves
< !      chl = ch2o *  2.0      ! heat capacity of lower leaves
< !      chs = ch2o * 50.0      ! heat capacity of stems
< !            cice  = 2.106e+3_r8
< ! (Marvin Heidkamp,2018) Closing the energy balance using a canopy heat capacity and storage concept-
< !                        A physically based approach for the land component JSBACHv3.11
< ! DOI: 10.5194/gmd-11-3465-2018}
< ! Export this citation
< ! Spank et al. (2016),
< ! specific heat capacity of biomass can be approximated by cveg = 1700 J/(kgK)
< ! Cveg = cveg*mveg
< !   REAL(KIND=r8)   , PUBLIC :: cice   ! specific heat of ice (J deg-1 kg-1)
< ! specific heat of soil material (J kg-1 k-1):
< ! from Campbell and Norman, 1998
< !
< !          csoi(i,k,j) =  870.0_r8 * (1.0_r8 - forganic) +  1920.0_r8 * forganic 
< !
< !  mveg = 0.8kg/m3  zveg
< !----------------------------------------------------------------------------
< !  REAL(KIND=r8), PARAMETER   , PUBLIC :: chs = 2.109e+05_r8 !0.527e+05_r8! 0.125e+05_r8!2.109e+05_r8! heat capacity of upper canopy stems per unit stem area (J kg-1 m-2)  
<   REAL(KIND=r8), PARAMETER   , PUBLIC :: chs(nVegClass)  = RESHAPE ( (/ &
<    ! HEAT CAPACITIES                                         !  chs
<    2.109e+04_r8, &                                           !  1: tropical evergreen forest / woodland
<    2.109e+04_r8, &                                           !  2: tropical deciduous forest / woodland
<    2.109e+04_r8, &                                           !  3: temperate evergreen broadleaf forest / woodland 
<    2.109e+04_r8, &                                           !  4: temperate evergreen conifer forest / woodland
<    2.109e+04_r8, &                                           !  5: temperate deciduous forest / woodland
<    2.109e+04_r8, &                                           !  6: boreal evergreen forest / woodland
<    2.109e+04_r8, &                                           !  7: boreal deciduous forest / woodland
<    2.109e+04_r8, &                                           !  8: mixed forest / woodland 
<    2.109e+04_r8, &                                           !  9: savanna
<    2.109e+04_r8, &                                           ! 10: grassland / steppe 
<    2.109e+04_r8, &                                           ! 11: dense shrubland
<    2.109e+04_r8, &                                           ! 12: open shrubland
<    2.109e+04_r8, &                                           ! 13: tundra
<    0.880e+03_r8, &                                           ! 14: desert
<    2.106e+03_r8  &                                           ! 15: polar desert / rock / ice
<    /), (/nVegClass/) )!
< !
< !   REAL(KIND=r8), PARAMETER   , PUBLIC :: chu = 8.436e+03_r8!8.436e+03_r8! heat capacity of upper canopy leaves per unit leaf area (J kg-1 m-2) 
<   REAL(KIND=r8), PARAMETER   , PUBLIC :: chu(nVegClass)  = RESHAPE ( (/ &
<    ! HEAT CAPACITIES                                         !  chs
<    8.436e+03_r8, &                                           !  1: tropical evergreen forest / woodland
<    8.436e+03_r8, &                                           !  2: tropical deciduous forest / woodland
<    8.436e+03_r8, &                                           !  3: temperate evergreen broadleaf forest / woodland 
<    8.436e+03_r8, &                                           !  4: temperate evergreen conifer forest / woodland
<    8.436e+03_r8, &                                           !  5: temperate deciduous forest / woodland
<    8.436e+03_r8, &                                           !  6: boreal evergreen forest / woodland
<    8.436e+03_r8, &                                           !  7: boreal deciduous forest / woodland
<    8.436e+03_r8, &                                           !  8: mixed forest / woodland 
<    8.436e+03_r8, &                                           !  9: savanna
<    8.436e+03_r8, &                                           ! 10: grassland / steppe 
<    8.436e+03_r8, &                                           ! 11: dense shrubland
<    8.436e+03_r8, &                                           ! 12: open shrubland
<    8.436e+03_r8, &                                           ! 13: tundra
<    0.880e+03_r8, &                                           ! 14: desert
<    2.106e+03_r8  &                                           ! 15: polar desert / rock / ice
<    /), (/nVegClass/) )!
< !
< 
< !   REAL(KIND=r8), PARAMETER   , PUBLIC :: chl = 8.436e+03_r8!8.436e+03_r8! heat capacity of lower canopy leaves & stems per unit leaf/stem area (J kg-1 m-2)
<   REAL(KIND=r8), PARAMETER   , PUBLIC :: chl(nVegClass)  = RESHAPE ( (/ &
<    ! HEAT CAPACITIES                                         !  chs
<    8.436e+03_r8, &                                           !  1: tropical evergreen forest / woodland
<    8.436e+03_r8, &                                           !  2: tropical deciduous forest / woodland
<    8.436e+03_r8, &                                           !  3: temperate evergreen broadleaf forest / woodland 
<    8.436e+03_r8, &                                           !  4: temperate evergreen conifer forest / woodland
<    8.436e+03_r8, &                                           !  5: temperate deciduous forest / woodland
<    8.436e+03_r8, &                                           !  6: boreal evergreen forest / woodland
<    8.436e+03_r8, &                                           !  7: boreal deciduous forest / woodland
<    8.436e+03_r8, &                                           !  8: mixed forest / woodland 
<    8.436e+03_r8, &                                           !  9: savanna
<    8.436e+03_r8, &                                           ! 10: grassland / steppe 
<    8.436e+03_r8, &                                           ! 11: dense shrubland
<    8.436e+03_r8, &                                           ! 12: open shrubland
<    8.436e+03_r8, &                                           ! 13: tundra
<    0.880e+03_r8, &                                           ! 14: desert
<    2.106e+03_r8  &                                           ! 15: polar desert / rock / ice
<    /), (/nVegClass/) )!
< 
< !-----------------------------------------------------------------------
< ! intercepted water capacity (mm h2o per unit leaf area == kg m-2)
< !-----------------------------------------------------------------------
---
>   !----------------------------------------------------------------------------
>   ! heat capacities of leaves and stems  (J kg-1 C-1 m-2)
>   ! derived from specific heat of liquid water (ch2o = 4.218 J g-1)
>   !----------------------------------------------------------------------------
>   REAL(KIND=r8), PARAMETER   , PUBLIC :: chs = 0.125e+05_r8!2.109e+05_r8! heat capacity of upper canopy stems per unit stem area (J kg-1 m-2)  
>   REAL(KIND=r8), PARAMETER   , PUBLIC :: chu = 2.109e+03_r8!8.436e+03_r8! heat capacity of upper canopy leaves per unit leaf area (J kg-1 m-2) 
>   REAL(KIND=r8), PARAMETER   , PUBLIC :: chl = 8.436e+03_r8!8.436e+03_r8! heat capacity of lower canopy leaves & stems per unit leaf/stem area (J kg-1 m-2)
>   !-----------------------------------------------------------------------
>   ! intercepted water capacity (mm h2o per unit leaf area == kg m-2)
>   !-----------------------------------------------------------------------
238,240c192,194
< !-----------------------------------------------------------------------
< ! intercepted snow capacity (mm h2o per unit leaf area == kg m-2)
< !-----------------------------------------------------------------------
---
>   !-----------------------------------------------------------------------
>   ! intercepted snow capacity (mm h2o per unit leaf area == kg m-2)
>   !-----------------------------------------------------------------------
247,249c201,203
< !------------------------------------------------------------
< ! decay time for intercepted liquid dripoff (sec)
< !------------------------------------------------------------
---
>   !------------------------------------------------------------
>   ! decay time for intercepted liquid dripoff (sec)
>   !------------------------------------------------------------
253,255c207,209
< !------------------------------------------------------------
< ! decay time for snow blowoff (sec)
< !------------------------------------------------------------
---
>   !------------------------------------------------------------
>   ! decay time for snow blowoff (sec)
>   !------------------------------------------------------------
259,292d212
< !------------------------------------------------------------------------
< ! Vegetation type classifications (used in subroutine iniveg)
< !------------------------------------------------------------------------
< !  1: tropical evergreen forest / woodland
< !  2: tropical deciduous forest / woodland
< !  3: temperate evergreen broadleaf forest / woodland
< !  4: temperate evergreen conifer forest / woodland
< !  5: temperate deciduous forest / woodland
< !  6: boreal evergreen forest / woodland
< !  7: boreal deciduous forest / woodland
< !  8: mixed forest / woodland
< !  9: savanna
< ! 10: grassland / steppe
< ! 11: dense shrubland
< ! 12: open shrubland
< ! 13: tundra
< ! 14: desert
< ! 15: polar desert / rock / ice
< !------------------------------------------------------------------------
< ! PFTs (top to bottom)
< !------------------------------------------------------------------------
< !  1: tropical broadleaf evergreen trees
< !  2: tropical broadleaf drought-deciduous trees
< !  3: warm-temperate broadleaf evergreen trees
< !  4: temperate conifer evergreen trees
< !  5: temperate broadleaf cold-deciduous trees
< !  6: boreal conifer evergreen trees
< !  7: boreal broadleaf cold-deciduous trees
< !  8: boreal conifer cold-deciduous trees
< !  9: evergreen shrubs
< ! 10: cold-deciduous shrubs
< ! 11: warm (C4) grasses
< ! 12: cool (C3) grasses
< !========================================================================
294,336c214,256
< !
< !      INCLUDE 'compft.h'
< !
< !--------------------------------------------------
< ! Other properties of vegetation -- for 12 PFTs
< !--------------------------------------------------
< ! vmax_pft : max Rubisco activity at 15 C, at top of canopy (mol[CO2] m-2 s-1) 
< ! specla   : specific leaf area (m2 kg-1)
< ! tauleaf  : foliar biomass turnover(rotatividade) time constant (years)
< ! tauroot  : root biomass turnover(rotatividade) time constant (years)
< ! tauwood0 : wood biomass turnover(rotatividade) time constant (years)
< ! aleaf    : foliar allocation coefficient (fraction)
< ! aroot    : root allocation coefficient (fraction)
< ! awood    : wood allocation coefficient (fraction, = 1 - aleaf - aroot)
< !=================================================
< !--------------------------------------------------
< ! Other properties of vegetation -- for 12 PFTs
< !--------------------------------------------------
< ! vmax_pft : max Rubisco activity at 15 C, at top of canopy (mol[CO2] m-2 s-1) 
< ! specla   : specific leaf area (m2 kg-1)
< ! tauleaf  : foliar biomass turnover(rotatividade) time constant (years)
< ! tauroot  : root biomass turnover(rotatividade) time constant (years)
< ! tauwood  : wood biomass turnover(rotatividade) time constant (years)
< ! aleaf    : foliar allocation coefficient (fraction)
< ! aroot    : root allocation coefficient (fraction)
< ! awood    : wood allocation coefficient (fraction, = 1 - aleaf - aroot)
< !      dummyvarpk(1:96)=(/&
< !------------------------------------------------------------------------
< !         vmax_pft  specla   tauleaf  tauroot tauwood  aleaf  aroot  awood    PFT
< !------------------------------------------------------------------------
< !      65.0e-06_r8, 25.0_r8, 1.01_r8, 1.0_r8,  25.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   1 
< !      65.0e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8,  25.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   2 
< !      40.0e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8,  25.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   3 
< !      30.0e-06_r8, 12.5_r8, 2.00_r8, 1.0_r8,  50.0_r8, 0.30_r8, 0.40_r8, 0.30_r8,& !   4 
< !      30.0e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8,  50.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   5 
< !      25.0e-06_r8, 12.5_r8, 2.50_r8, 1.0_r8, 100.0_r8, 0.30_r8, 0.40_r8, 0.30_r8,& !   6 
< !      30.0e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8, 100.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   7 
< !      30.0e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8, 100.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   8 
< !      27.5e-06_r8, 12.5_r8, 1.50_r8, 1.0_r8,   5.0_r8, 0.45_r8, 0.40_r8, 0.15_r8,& !   9 
< !      27.5e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8,   5.0_r8, 0.45_r8, 0.35_r8, 0.20_r8,& !  10 
< !      15.0e-06_r8, 20.0_r8, 1.25_r8, 1.0_r8, 999.0_r8, 0.45_r8, 0.55_r8, 0.00_r8,& !  11 
< !      25.0e-06_r8, 20.0_r8, 1.50_r8, 1.0_r8, 999.0_r8, 0.45_r8, 0.55_r8, 0.00_r8/)  !  12 
< !========================================================================
---
>   !
>   !      INCLUDE 'compft.h'
>   !
>   !--------------------------------------------------
>   ! Other properties of vegetation -- for 12 PFTs
>   !--------------------------------------------------
>   ! vmax_pft : max Rubisco activity at 15 C, at top of canopy (mol[CO2] m-2 s-1) 
>   ! specla   : specific leaf area (m2 kg-1)
>   ! tauleaf  : foliar biomass turnover time constant (years)
>   ! tauroot  : root biomass turnover time constant (years)
>   ! tauwood0 : wood biomass turnover time constant (years)
>   ! aleaf    : foliar allocation coefficient (fraction)
>   ! aroot    : root allocation coefficient (fraction)
>   ! awood    : wood allocation coefficient (fraction, = 1 - aleaf - aroot)
>   !=================================================
>   !--------------------------------------------------
>   ! Other properties of vegetation -- for 12 PFTs
>   !--------------------------------------------------
>   ! vmax_pft : max Rubisco activity at 15 C, at top of canopy (mol[CO2] m-2 s-1) 
>   ! specla   : specific leaf area (m2 kg-1)
>   ! tauleaf  : foliar biomass turnover time constant (years)
>   ! tauroot  : root biomass turnover time constant (years)
>   ! tauwood  : wood biomass turnover time constant (years)
>   ! aleaf    : foliar allocation coefficient (fraction)
>   ! aroot    : root allocation coefficient (fraction)
>   ! awood    : wood allocation coefficient (fraction, = 1 - aleaf - aroot)
>   !      dummyvarpk(1:96)=(/&
>   !------------------------------------------------------------------------
>   !         vmax_pft  specla   tauleaf  tauroot tauwood  aleaf  aroot  awood    PFT
>   !------------------------------------------------------------------------
>   !      65.0e-06_r8, 25.0_r8, 1.01_r8, 1.0_r8,  25.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   1 
>   !      65.0e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8,  25.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   2 
>   !      40.0e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8,  25.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   3 
>   !      30.0e-06_r8, 12.5_r8, 2.00_r8, 1.0_r8,  50.0_r8, 0.30_r8, 0.40_r8, 0.30_r8,& !   4 
>   !      30.0e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8,  50.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   5 
>   !      25.0e-06_r8, 12.5_r8, 2.50_r8, 1.0_r8, 100.0_r8, 0.30_r8, 0.40_r8, 0.30_r8,& !   6 
>   !      30.0e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8, 100.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   7 
>   !      30.0e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8, 100.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   8 
>   !      27.5e-06_r8, 12.5_r8, 1.50_r8, 1.0_r8,   5.0_r8, 0.45_r8, 0.40_r8, 0.15_r8,& !   9 
>   !      27.5e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8,   5.0_r8, 0.45_r8, 0.35_r8, 0.20_r8,& !  10 
>   !      15.0e-06_r8, 20.0_r8, 1.25_r8, 1.0_r8, 999.0_r8, 0.45_r8, 0.55_r8, 0.00_r8,& !  11 
>   !      25.0e-06_r8, 20.0_r8, 1.50_r8, 1.0_r8, 999.0_r8, 0.45_r8, 0.55_r8, 0.00_r8/)  !  12 
>   !========================================================================
338,339c258,259
< !    vmax_pft        ! PFT
<    80.0e-06_r8,&     !   1   65.0e-06_r8   120.0e-06
---
>        !    vmax_pft        ! PFT
>        85.0e-06_r8,&     !   1   65.0e-06_r8   120.0e-06
352,366c272,286
< !  specla        ! PFT
<    15.0_r8,&	 !   1   25.0_r8  25.0
<    10.0_r8,&	 !   2   25.0_r8  25.0
<    20.0_r8,&	 !   3   25.0_r8  25.0
<    12.5_r8,&	 !   4   12.5_r8  12.5
<    20.0_r8,&	 !   5   25.0_r8  25.0
<    12.5_r8,&	 !   6   12.5_r8  12.5
<    20.0_r8,&	 !   7   25.0_r8  25.0
<    20.0_r8,&	 !   8   25.0_r8  25.0
<    12.5_r8,&	 !   9   12.5_r8  12.5
<    20.0_r8,&	 !  10   25.0_r8  25.0
<    20.0_r8,&	 !  11   20.0_r8  20.0
<    20.0_r8/)	 !  12	 20.0_r8  20.0
<    REAL(KIND=r8)   , PUBLIC  , PARAMETER :: tauleaf (1:npft)=(/&       ! foliar biomass turnover(rotatividade) time constant (years)
< !   tauleaf      ! PFT
---
>        !  specla        ! PFT
>        25.0_r8,& !   1   25.0_r8  25.0        !  1: tropical broadleaf evergreen trees
>        23.0_r8,& !   2   25.0_r8  25.0        !  2: tropical broadleaf drought-deciduous trees
>        25.0_r8,& !   3   25.0_r8  25.0        !  3: warm-temperate broadleaf evergreen trees
>        12.5_r8,& !   4   12.5_r8  12.5        !  4: temperate conifer evergreen trees
>        25.0_r8,& !   5   25.0_r8  25.0        !  5: temperate broadleaf cold-deciduous trees
>        12.5_r8,& !   6   12.5_r8  12.5        !  6: boreal conifer evergreen trees
>        25.0_r8,& !   7   25.0_r8  25.0        !  7: boreal broadleaf cold-deciduous trees
>        25.0_r8,& !   8   25.0_r8  25.0        !  8: boreal conifer cold-deciduous trees
>        12.5_r8,& !   9   12.5_r8  12.5        !  9: evergreen shrubs
>        25.0_r8,& !  10   25.0_r8  25.0        ! 10: cold-deciduous shrubs
>        20.0_r8,& !  11   20.0_r8  20.0        ! 11: warm (c4) grasses
>        20.0_r8/) !  12   20.0_r8  20.0        ! 12: cool (c3) grasses
>   REAL(KIND=r8)   , PUBLIC  , PARAMETER :: tauleaf (1:npft)=(/&       ! foliar biomass turnover time constant (years)
>        !   tauleaf      ! PFT
379,380c299,300
<    REAL(KIND=r8)   , PUBLIC  , PARAMETER :: tauroot(1:npft)=(/& ! fine root biomass turnover(rotatividade) time constant (years)
< !   tauroot      ! PFT        
---
>   REAL(KIND=r8)   , PUBLIC  , PARAMETER :: tauroot(1:npft)=(/& ! fine root biomass turnover time constant (years)
>        !   tauroot      ! PFT        
393,394c313,314
<    REAL(KIND=r8), PUBLIC  , PARAMETER :: tauwood0(1:npft)=(/& ! normal (unstressed) turnover(rotatividade) time for wood biomass (years)
< !   tauwood0      ! PFT    
---
>   REAL(KIND=r8), PUBLIC  , PARAMETER :: tauwood0(1:npft)=(/& ! normal (unstressed) turnover time for wood biomass (years)
>        !   tauwood0      ! PFT    
408c328
< !   aleaf      ! PFT    
---
>        !   aleaf      ! PFT    
422c342
< !   aroot      ! PFT    
---
>        !   aroot      ! PFT    
436c356
< !   awood      ! PFT    
---
>        !   awood      ! PFT    
449,455c369,375
< !------------------------------------------------------------------------
< !  Fundamental plant physiological parameters, name definitions
< ! ------------------------------------------------------------------------
< !      tau15 = 4500.0_r8    ! tau15 : co2/o2 specificity ratio at 15 degrees C (dimensionless)    
< !      kc15  = 1.5e-04_r8   ! kc15  : co2 kinetic parameter at 15 C (mol/mol)
< !      ko15  = 2.5e-01_r8   ! ko15  : o2 kinetic parameter at 15 C (mol/mol)
< !      cimax = 2000.e-06_r8 ! cimax : maximum value for ci (for model stability)
---
>   !-!------------------------------------------------------------------------
>   !  Fundamental plant physiological parameters, name definitions
>   ! ------------------------------------------------------------------------
>   !      tau15 = 4500.0_r8    ! tau15 : co2/o2 specificity ratio at 15 degrees C (dimensionless)    
>   !      kc15  = 1.5e-04_r8   ! kc15  : co2 kinetic parameter at 15 C (mol/mol)
>   !      ko15  = 2.5e-01_r8   ! ko15  : o2 kinetic parameter at 15 C (mol/mol)
>   !      cimax = 2000.e-06_r8 ! cimax : maximum value for ci (for model stability)
461,480c381,400
< !------------------------------------------------------------------------
< ! PFTs (top to bottom)
< !------------------------------------------------------------------------
< !  1: tropical broadleaf evergreen trees
< !  2: tropical broadleaf drought-deciduous trees
< !  3: warm-temperate broadleaf evergreen trees
< !  4: temperate conifer evergreen trees
< !  5: temperate broadleaf cold-deciduous trees
< !  6: boreal conifer evergreen trees
< !  7: boreal broadleaf cold-deciduous trees
< !  8: boreal conifer cold-deciduous trees
< !  9: evergreen shrubs
< ! 10: cold-deciduous shrubs
< ! 11: warm (C4) grasses
< ! 12: cool (C3) grasses
< !========================================================================
< 
< !--------------------------------------------------------------------
< ! C3 and C4 physiology-specific parameters
< !--------------------------------------------------------------------
---
>   !------------------------------------------------------------------------
>   ! PFTs (top to bottom)
>   !------------------------------------------------------------------------
>   !  1: tropical broadleaf evergreen trees
>   !  2: tropical broadleaf drought-deciduous trees
>   !  3: warm-temperate broadleaf evergreen trees
>   !  4: temperate conifer evergreen trees
>   !  5: temperate broadleaf cold-deciduous trees
>   !  6: boreal conifer evergreen trees
>   !  7: boreal broadleaf cold-deciduous trees
>   !  8: boreal conifer cold-deciduous trees
>   !  9: evergreen shrubs
>   ! 10: cold-deciduous shrubs
>   ! 11: warm (C4) grasses
>   ! 12: cool (C3) grasses
>   !========================================================================
> 
>   !--------------------------------------------------------------------
>   ! C3 and C4 physiology-specific parameters
>   !--------------------------------------------------------------------
487,498c407,418
< !--------------------------------------------------------------------
< ! Plant physiological properties - 5 classes
< !--------------------------------------------------------------------
< ! gamma    : leaf respiration coefficients 
< ! coefm    : 'm' coefficients for stomatal conductance relationship
< ! coefb    : 'b' coefficients for stomatal conductance relationship
< ! gsmin    : absolute minimum stomatal conductances
< !-------------------------------------------------
< ! gamma  coefm  coefb    gsmin   Physiol. Class
< !-------------------------------------------------
<     REAL(KIND=r8)   ,PUBLIC, PARAMETER :: gammaub = 0.015_r8   ! Broadleaf trees! leaf respiration coefficient
<     REAL(KIND=r8)   ,PUBLIC, PARAMETER :: coefmub = 18.0_r8    !7! pk 10.0_r8    ! Broadleaf trees 'm' coefficient for stomatal conductance relationship
---
>   !--------------------------------------------------------------------
>   ! Plant physiological properties - 5 classes
>   !--------------------------------------------------------------------
>   ! gamma    : leaf respiration coefficients 
>   ! coefm    : 'm' coefficients for stomatal conductance relationship
>   ! coefb    : 'b' coefficients for stomatal conductance relationship
>   ! gsmin    : absolute minimum stomatal conductances
>   !-------------------------------------------------
>   ! gamma  coefm  coefb    gsmin   Physiol. Class
>   !-------------------------------------------------
>   REAL(KIND=r8)   ,PUBLIC, PARAMETER :: gammaub = 0.039_r8   ! Broadleaf trees
>   REAL(KIND=r8)   ,PUBLIC, PARAMETER :: coefmub = 11.0_r8    !10.0_r8    ! Broadleaf trees 'm' coefficient for stomatal conductance relationship
502,505c422,425
<     REAL(KIND=r8)   ,PUBLIC, PARAMETER :: gammauc = 0.015_r8   !conifer trees! leaf respiration coefficient
<     REAL(KIND=r8)   ,PUBLIC, PARAMETER :: coefmuc = 6.0_r8     !conifer trees!'m' coefficient for stomatal conductance relationship 
<     REAL(KIND=r8)   ,PUBLIC, PARAMETER :: coefbuc = 0.01_r8    !conifer trees!'b' coefficient for stomatal conductance relationship  
<     REAL(KIND=r8)   ,PUBLIC, PARAMETER :: gsucmin = 0.00001_r8 !conifer trees! absolute minimum stomatal conductance
---
>   REAL(KIND=r8)   ,PUBLIC, PARAMETER :: gammauc = 0.039_r8   ! leaf respiration coefficient
>   REAL(KIND=r8)   ,PUBLIC, PARAMETER :: coefmuc = 6.0_r8     !'m' coefficient for stomatal conductance relationship 
>   REAL(KIND=r8)   ,PUBLIC, PARAMETER :: coefbuc = 0.01_r8    !'b' coefficient for stomatal conductance relationship  
>   REAL(KIND=r8)   ,PUBLIC, PARAMETER :: gsucmin = 0.00001_r8 ! absolute minimum stomatal conductance
507c427
<     REAL(KIND=r8)   ,PUBLIC, PARAMETER :: gammals = 0.015_r8  ! Shrubs ! leaf respiration coefficient
---
>   REAL(KIND=r8)   ,PUBLIC, PARAMETER :: gammals = 0.040_r8  ! Shrubs ! leaf respiration coefficient
512c432
<     REAL(KIND=r8)   ,PUBLIC, PARAMETER :: gammal4 = 0.030_r8  ! C4 grasses ! leaf respiration coefficient
---
>   REAL(KIND=r8)   ,PUBLIC, PARAMETER :: gammal4 = 0.050_r8  ! C4 grasses ! leaf respiration coefficient
517c437
<     REAL(KIND=r8)   ,PUBLIC, PARAMETER :: gammal3 = 0.015_r8  ! C3 grasses ! leaf respiration coefficient
---
>   REAL(KIND=r8)   ,PUBLIC, PARAMETER :: gammal3 = 0.040_r8  ! C3 grasses ! leaf respiration coefficient
521,526c441,446
< !-----------------------------------------------------------------
< ! leaf orientation factors (-1 vertical, 0 random, 1 horizontal)
< !-----------------------------------------------------------------
< ! chifuz : upper canopy leaf orientation
< ! chiflz : lower canopy leaf orientation
< !-----------------------------------------
---
>   !-----------------------------------------------------------------
>   ! leaf orientation factors (-1 vertical, 0 random, 1 horizontal)
>   !-----------------------------------------------------------------
>   ! chifuz : upper canopy leaf orientation
>   ! chiflz : lower canopy leaf orientation
>   !-----------------------------------------
529,556c449,476
< !------------------------------------------------------------------------
< ! PFTs (top to bottom)
< !------------------------------------------------------------------------
< !  1: tropical broadleaf evergreen trees
< !  2: tropical broadleaf drought-deciduous trees
< !  3: warm-temperate broadleaf evergreen trees
< !  4: temperate conifer evergreen trees
< !  5: temperate broadleaf cold-deciduous trees
< !  6: boreal conifer evergreen trees
< !  7: boreal broadleaf cold-deciduous trees
< !  8: boreal conifer cold-deciduous trees
< !  9: evergreen shrubs
< ! 10: cold-deciduous shrubs
< ! 11: warm (c4) grasses
< ! 12: cool (c3) grasses
< 
< !--------------------------------------------------------------------------
< ! PFT climatic constraint definitions (left to right)
< !--------------------------------------------------------------------------
< ! TminL  : absolute minimum temperature (lower limit, C) 
< ! TminU  : absolute minimum temperature (upper limit, C) 
< ! Twarm  : temperature of the warmest month (mean??, C) [C4 only]
< ! GDD    : min growing degree days above 5 C threshold [upper canopy], or
< !          min growing degree days above 0 C threshold [lower canopy]
< 
< ! DTP 2001/06/07: Changed this after studying code in climate.f. 
< !      Values of 9999 indicate this constraint is not used to 
< !      determine existence of the PFT.  
---
>   !------------------------------------------------------------------------
>   ! PFTs (top to bottom)
>   !------------------------------------------------------------------------
>   !  1: tropical broadleaf evergreen trees
>   !  2: tropical broadleaf drought-deciduous trees
>   !  3: warm-temperate broadleaf evergreen trees
>   !  4: temperate conifer evergreen trees
>   !  5: temperate broadleaf cold-deciduous trees
>   !  6: boreal conifer evergreen trees
>   !  7: boreal broadleaf cold-deciduous trees
>   !  8: boreal conifer cold-deciduous trees
>   !  9: evergreen shrubs
>   ! 10: cold-deciduous shrubs
>   ! 11: warm (c4) grasses
>   ! 12: cool (c3) grasses
> 
>   !--------------------------------------------------------------------------
>   ! PFT climatic constraint definitions (left to right)
>   !--------------------------------------------------------------------------
>   ! TminL  : absolute minimum temperature (lower limit, C) 
>   ! TminU  : absolute minimum temperature (upper limit, C) 
>   ! Twarm  : temperature of the warmest month (mean??, C) [C4 only]
>   ! GDD    : min growing degree days above 5 C threshold [upper canopy], or
>   !          min growing degree days above 0 C threshold [lower canopy]
> 
>   ! DTP 2001/06/07: Changed this after studying code in climate.f. 
>   !      Values of 9999 indicate this constraint is not used to 
>   !      determine existence of the PFT.  
558c478
< !        TminL     PFT
---
>        !        TminL     PFT
573c493
< !        TminU     PFT
---
>        !        TminU     PFT
601c521
< !           GDD    PFT
---
>        !           GDD    PFT
616c536
<    REAL(KIND=r8)   , PUBLIC :: plai_init(4,nVegClass)     ! initial total LAI for each vegtype (used in iniveg)
---
>   REAL(KIND=r8)   , PUBLIC :: plai_init(4,15)     ! initial total LAI for each vegtype (used in iniveg)
618,625c538,545
< !------------------------------------------------------------------------
< ! Other miscellaneous variables needed for initializing plant LAI.
< !------------------------------------------------------------------------
< ! plaiupper    : Potental LAI of upper canopy (uniform initial vegetation) 
< ! plailower    : Potental LAI of lower canopy (uniform initial vegetation) 
< ! xminlai      : Minimum LAI for each existing PFT
< ! sapfrac_init : Initial value of sapwood fraction used for all woody PFTs
< !------------------------------------------------------------------------
---
>   !------------------------------------------------------------------------
>   ! Other miscellaneous variables needed for initializing plant LAI.
>   !------------------------------------------------------------------------
>   ! plaiupper    : Potental LAI of upper canopy (uniform initial vegetation) 
>   ! plailower    : Potental LAI of lower canopy (uniform initial vegetation) 
>   ! xminlai      : Minimum LAI for each existing PFT
>   ! sapfrac_init : Initial value of sapwood fraction used for all woody PFTs
>   !------------------------------------------------------------------------
631,696c551,616
< ! ************************************************************************
< ! define rooting profiles
< ! ************************************************************************
< !
< ! define rooting profiles based upon data published in:
< !
< ! Jackson et al., 1996:  A global analysis of root distributions
< ! for terrestrial biomes, Oecologia, 108, 389-411.
< !
< ! and
< !
< ! Jackson et al., 1997:  A global budget for fine root biomass, 
< ! surface area, and nutrient contents, Proceedings of the National
< ! Academy of Sciences, 94, 7362-7366.
< !
< ! rooting profiles are defined by the "beta" parameter
< !
< ! beta1 is assigned to the lower vegetation layer (grasses and shrubs)
< ! beta2 is assigned to the upper vegetation layer (trees)
< !
< ! according to Jackson et al. (1996, 1997), the values of beta
< ! typically fall in the following range
< !
< ! note that the 1997 paper specifically discusses the distribution
< ! of *fine roots* (instead of total root biomass), which may be more
< ! important for water and nutrient uptake
< !
< ! --------------                 ------------   ------------
< ! forest systems                 beta2 (1996)   beta2 (1997)
< ! --------------                 ------------   ------------
< ! tropical evergreen forest:        0.962          0.972
< ! tropical deciduous forest:        0.961          0.982
< ! temperate conifer forest:         0.976          0.980
< ! temperate broadleaf forest:       0.966          0.967
< ! all tropical/temperate forest:    0.970  
< ! boreal forest:                    0.943          0.943
< ! all trees:                                       0.976
< !
< ! -------------------------      ------------   ------------
< ! grassland / shrub systems      beta1 (1996)   beta1 (1997)
< ! -------------------------      ------------   ------------
< ! tropical grassland / savanna:     0.972          0.972
< ! temperate grassland:              0.943          0.943
< ! all grasses:                      0.952          0.952
< ! schlerophyllous shrubs:           0.964          0.950
< ! all shrubs:                       0.978          0.975
< ! crops:                            0.961
< ! desert:                           0.975          0.970
< ! tundra:                           0.914
< !
< ! --------------                 ------------
< ! all ecosystems                 beta  (1996)
< ! --------------                 ------------
< ! all ecosystems:                   0.966
< !
< ! for global simulations, we typically assign the following
< ! values to the beta parameters
< !
< ! beta1 = 0.950, which is typical for tropical/temperate grasslands
< ! beta2 = 0.970, which is typical for tropical/temperate forests
< !
< ! however, these values could be (and should be) further refined
< ! when using the model for specific regions
< ! 
< ! beta1: for lower layer herbaceous plants
< ! beta2: for upper layer trees      
---
>   ! ************************************************************************
>   ! define rooting profiles
>   ! ************************************************************************
>   !
>   ! define rooting profiles based upon data published in:
>   !
>   ! Jackson et al., 1996:  A global analysis of root distributions
>   ! for terrestrial biomes, Oecologia, 108, 389-411.
>   !
>   ! and
>   !
>   ! Jackson et al., 1997:  A global budget for fine root biomass, 
>   ! surface area, and nutrient contents, Proceedings of the National
>   ! Academy of Sciences, 94, 7362-7366.
>   !
>   ! rooting profiles are defined by the "beta" parameter
>   !
>   ! beta1 is assigned to the lower vegetation layer (grasses and shrubs)
>   ! beta2 is assigned to the upper vegetation layer (trees)
>   !
>   ! according to Jackson et al. (1996, 1997), the values of beta
>   ! typically fall in the following range
>   !
>   ! note that the 1997 paper specifically discusses the distribution
>   ! of *fine roots* (instead of total root biomass), which may be more
>   ! important for water and nutrient uptake
>   !
>   ! --------------                 ------------   ------------
>   ! forest systems                 beta2 (1996)   beta2 (1997)
>   ! --------------                 ------------   ------------
>   ! tropical evergreen forest:        0.962          0.972
>   ! tropical deciduous forest:        0.961          0.982
>   ! temperate conifer forest:         0.976          0.980
>   ! temperate broadleaf forest:       0.966          0.967
>   ! all tropical/temperate forest:    0.970  
>   ! boreal forest:                    0.943          0.943
>   ! all trees:                                       0.976
>   !
>   ! -------------------------      ------------   ------------
>   ! grassland / shrub systems      beta1 (1996)   beta1 (1997)
>   ! -------------------------      ------------   ------------
>   ! tropical grassland / savanna:     0.972          0.972
>   ! temperate grassland:              0.943          0.943
>   ! all grasses:                      0.952          0.952
>   ! schlerophyllous shrubs:           0.964          0.950
>   ! all shrubs:                       0.978          0.975
>   ! crops:                            0.961
>   ! desert:                           0.975          0.970
>   ! tundra:                           0.914
>   !
>   ! --------------                 ------------
>   ! all ecosystems                 beta  (1996)
>   ! --------------                 ------------
>   ! all ecosystems:                   0.966
>   !
>   ! for global simulations, we typically assign the following
>   ! values to the beta parameters
>   !
>   ! beta1 = 0.950, which is typical for tropical/temperate grasslands
>   ! beta2 = 0.970, which is typical for tropical/temperate forests
>   !
>   ! however, these values could be (and should be) further refined
>   ! when using the model for specific regions
>   ! 
>   ! beta1: for lower layer herbaceous plants
>   ! beta2: for upper layer trees     
719c639
<   REAL(KIND=r8), PARAMETER   , PUBLIC :: beta1(nVegClass)     = RESHAPE ( (/ &
---
>   REAL(KIND=r8), PARAMETER   , PUBLIC :: beta1(15)     = RESHAPE ( (/ &
734,736c654,656
<    0.910_r8, &    ! 14: desert                                               0.970
<    0.920_r8  &    ! 15: polar desert / rock / ice                            0.970
<    /), (/nVegClass/) )   !---->  grassland / shrub systems  
---
>    0.961_r8, &    ! 14: desert                                               0.970
>    0.966_r8  &    ! 15: polar desert / rock / ice                            0.970
>    /), (/15/) )!---->  grassland / shrub systems  
740c660
<   REAL(KIND=r8), PARAMETER   , PUBLIC :: beta2(nVegClass)     = RESHAPE ( (/ &
---
>   REAL(KIND=r8), PARAMETER   , PUBLIC :: beta2(15)     = RESHAPE ( (/ &
755,810c675,720
<    0.910_r8, &    ! 14: desert                                               0.970
<    0.920_r8  &    ! 15: polar desert / rock / ice                            0.970
<    /), (/nVegClass/) )   !----> forest systems    !
< !
< !========================================================================
< ! params.soi : soil parameters....
< !========================================================================
< !
< !   6    ! nsoilayBase : number of soil layers (actually a constant in comsoi.h)
< !        !           could be read in here, if a new constant, maxsoilay,
< !        !           was introduced to dimension the soil layer arrays  
< !------------------------------------------------------
< ! Soil layer thicknesses (m) 
< ! N.B. Number of layers must equal nsoilayBase!!!
< !------------------------------------------------------
< !     ! sand
< !     ! loamy sand
< !     ! sandy loam
< !     ! loam
< !     ! silt loam (combined with silt)
< !     ! sandy clay loam
< !     ! clay loam
< !     ! silty clay loam
< !     ! sandy clay
< !     ! silty clay 
< !     ! clay
< !
< !
< ! Rawls et al. (1992) soil properties data
< !
< !      ------------------
< !	sand  silt  clay
< !      ------------------
< !
< !      data texdat /
< !     >  0.92, 0.05, 0.03,  ! sand
< !     >  0.81, 0.12, 0.07,  ! loamy sand
< !     >  0.65, 0.25, 0.10,  ! sandy loam
< !     >  0.42, 0.40, 0.18,  ! loam
< !     >  0.20, 0.65, 0.15,  ! silt loam
< !     >  0.60, 0.13, 0.27,  ! sandy clay loam
< !     >  0.32, 0.34, 0.34,  ! clay loam
< !     >  0.09, 0.58, 0.33,  ! silty clay loam
< !     >  0.53, 0.07, 0.40,  ! sandy clay
< !     >  0.10, 0.45, 0.45,  ! silty clay
< !     >  0.20, 0.20, 0.60   ! clay
< !     >  /
< !
< !   REAL(KIND=r8), PARAMETER   , PUBLIC :: hsoi_in(nsoilay+1, ndat)=RESHAPE ((/&
< !      0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8,&  ! hsoi(1)
< !      0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8,&  ! hsoi(2)
< !      0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8,&  ! hsoi(3)
< !      0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8,&  ! hsoi(4)
< !      2.00_r8, 2.00_r8, 2.00_r8, 2.00_r8, 2.00_r8, 2.00_r8, 2.00_r8, 2.00_r8, 2.00_r8, 2.00_r8, 2.00_r8,&  ! hsoi(5)
< !      5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8,&  ! hsoi(6)
< !      6.00_r8, 6.00_r8, 6.00_r8, 6.00_r8, 6.00_r8, 6.00_r8, 6.00_r8, 6.00_r8, 6.00_r8, 6.00_r8, 6.00_r8/), (/nsoilay+1, ndat/) ) ! hsoi(6)
---
>    0.982_r8, &    ! 14: desert                                               0.970
>    0.966_r8  &    ! 15: polar desert / rock / ice                            0.970
>    /), (/15/) )!----> forest systems    
>   !
>   !========================================================================
>   ! params.soi : soil parameters....
>   !========================================================================
>   !
>   !   6    ! nsoilayBase : number of soil layers (actually a constant in comsoi.h)
>   !        !           could be read in here, if a new constant, maxsoilay,
>   !        !           was introduced to dimension the soil layer arrays  
>   !------------------------------------------------------
>   ! Soil layer thicknesses (m) 
>   ! N.B. Number of layers must equal nsoilayBase!!!
>   !------------------------------------------------------
>   !     ! sand
>   !     ! loamy sand
>   !     ! sandy loam
>   !     ! loam
>   !     ! silt loam (combined with silt)
>   !     ! sandy clay loam
>   !     ! clay loam
>   !     ! silty clay loam
>   !     ! sandy clay
>   !     ! silty clay 
>   !     ! clay
>   !
>   ! Rawls et al. (1992) soil properties data
>   !
>   !      ------------------
>   !       sand  silt  clay
>   !      ------------------
>   !
>   !      data texdat /
>   !     >  0.92, 0.05, 0.03,  ! sand
>   !     >  0.81, 0.12, 0.07,  ! loamy sand
>   !     >  0.65, 0.25, 0.10,  ! sandy loam
>   !     >  0.42, 0.40, 0.18,  ! loam
>   !     >  0.20, 0.65, 0.15,  ! silt loam
>   !     >  0.60, 0.13, 0.27,  ! sandy clay loam
>   !     >  0.32, 0.34, 0.34,  ! clay loam
>   !     >  0.09, 0.58, 0.33,  ! silty clay loam
>   !     >  0.53, 0.07, 0.40,  ! sandy clay
>   !     >  0.10, 0.45, 0.45,  ! silty clay
>   !     >  0.20, 0.20, 0.60   ! clay
>   !     >  /
813,820c723,730
< !       1        2        3        4        5        6        7        8        9       10      11         12
< !  0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, & ! 1
< !  0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 2
< !  0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, & ! 3
< !  0.30_r8, 0.30_r8, 0.30_r8, 0.30_r8, 0.30_r8, 0.30_r8, 0.30_r8, 0.30_r8, 0.30_r8, 0.30_r8, 0.30_r8, 0.30_r8, & ! 4
< !  0.70_r8, 0.70_r8, 0.70_r8, 0.70_r8, 0.70_r8, 0.70_r8, 0.70_r8, 0.70_r8, 0.70_r8, 0.70_r8, 0.70_r8, 0.70_r8, & ! 5
< !  1.00_r8, 1.00_r8, 1.00_r8, 1.00_r8, 1.00_r8, 1.00_r8, 1.00_r8, 1.00_r8, 1.00_r8, 1.00_r8, 1.00_r8, 1.00_r8, & ! 6
< !  1.20_r8, 1.20_r8, 1.20_r8, 1.20_r8, 1.20_r8, 1.20_r8, 1.20_r8, 1.20_r8, 1.20_r8, 1.20_r8, 1.20_r8, 1.20_r8  & ! 7
---
> !!       1        2        3        4        5        6        7        8        9       10      11         12 
> !  0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.20_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8,& ! 1
> !  0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.40_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8,& ! 2
> !  0.25_r8, 0.25_r8, 0.30_r8, 0.25_r8, 0.25_r8, 0.25_r8, 0.65_r8, 0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8,& ! 3
> !  0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8, 2.80_r8, 2.50_r8, 2.50_r8, 2.50_r8, 2.50_r8, 2.50_r8,& ! 4
> !  0.80_r8, 0.80_r8, 1.50_r8, 1.00_r8, 1.00_r8, 1.00_r8, 5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8,& ! 5
> !  1.00_r8, 1.50_r8, 2.00_r8, 2.00_r8, 2.00_r8, 2.00_r8,10.00_r8,11.00_r8,12.00_r8,13.00_r8,14.00_r8,10.00_r8,& ! 6
> ! 16.00_r8,16.00_r8,16.00_r8,16.00_r8,16.00_r8,16.00_r8,16.00_r8,16.00_r8,16.00_r8,16.00_r8,16.00_r8,16.00_r8 & ! 7
823c733,744
<   REAL(KIND=r8)   , PARAMETER :: soil_layer_thickness(nVegClass,nsoilay+1) = RESHAPE ( (/ &
---
>   REAL(KIND=r8)   , PARAMETER :: soil_layer_thickness(15,nsoilay+1) = RESHAPE ( (/ &
> !!       1        2        3        4        5        6        7        8        9       10      11         12
>   0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8,& ! 1
>   0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8, 0.15_r8,& ! 2
>   0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8, 0.25_r8,& ! 3
>   0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8, 0.50_r8,& ! 4
>   5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8, 5.00_r8,& ! 5
>  10.00_r8,10.00_r8,10.00_r8,10.00_r8,10.00_r8,10.00_r8,10.00_r8,10.00_r8,10.00_r8,10.00_r8,10.00_r8,10.00_r8,10.00_r8,10.00_r8,10.00_r8,& ! 6
>  16.00_r8,16.00_r8,16.00_r8,16.00_r8,16.00_r8,16.00_r8,16.00_r8,16.00_r8,16.00_r8,16.00_r8,16.00_r8,16.00_r8,16.00_r8,16.00_r8,16.00_r8 & ! 7
>   /), (/ 15, nsoilay+1 /) )
> 
> !  REAL(KIND=r8)   , PARAMETER :: soil_layer_thickness(15,nsoilay+1) = RESHAPE ( (/ &
825,846c746,768
<  0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, & ! 1
<  0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 2
<  0.15_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 3
<  0.20_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 4
<  0.25_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 5
<  0.30_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 6
<  0.34_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 7
<  0.40_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 8
<  0.45_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 9
<  0.50_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 10
<  0.55_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 11
<  0.60_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 12
<  0.65_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 13
<  0.70_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 14
<  0.75_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 15
<  0.80_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 16
<  0.85_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 17
<  0.90_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 18
<  0.95_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 19
<  1.00_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 20
<  1.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8  & ! 21
<   /), (/ nVegClass, nsoilay+1/) )  
---
> !   0.11_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, 0.05_r8, & ! 1
> !   0.14_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 2
> !   0.19_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 3
> !   0.24_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 4
> !   0.31_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 5
> !   0.40_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 6
> !   0.52_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 7
> !   0.67_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 8
> !   0.86_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 9
> !   1.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 10
> !   1.41_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 11
> !   1.82_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 12
> !   2.33_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 13
> !   3.00_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 14
> !   3.85_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 15
> !   4.95_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 16
> !   6.35_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 17
> !   8.16_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 18
> !  10.48_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 19
> !  13.46_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, & ! 20
> !  17.28_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8, 0.10_r8  & ! 21
> !  /), (/ 15, nsoilay+1/) )  
> 
873d794
< 
896,950c817,819
< !------------------------------------------------------
< ! TO CALCULATE MOISTURE STRESS FACTOR (ROOT PARAMETERS)
< !------------------------------------------------------
< !streaafac        wilt                        mois_ref=0.5
< !-5.0                  0.92414182
< !-4.8                  0.916827304
< !-4.6                  0.908877039
< !-4.4                  0.900249511
< !-4.2                  0.890903179
< !-4.0                  0.880797078
< !-3.8                  0.869891526
< !-3.6                  0.858148935
< !-3.4                  0.845534735
< !-3.2                  0.832018385
< !-3.0                  0.817574476
< !-2.8                  0.802183889
< !-2.6                  0.785834983
< !-2.4                  0.768524783
< !-2.2                  0.750260106
< !-2.0                  0.731058579
< !-1.8                  0.710949503
< !-1.6                  0.689974481
< !-1.4                  0.668187772
< !-1.2                  0.645656306
< !-1.0                  0.622459331
< !-0.8                  0.59868766
< !-0.6                  0.574442517
< !-0.4                  0.549833997
< !-0.2                  0.524979187
< !------------------------------------------------------
< ! TO CALCULATE MOISTURE STRESS FACTOR (ROOT PARAMETERS)
< !------------------------------------------------------
< !                                                           beta1
<   REAL(KIND=r8),PARAMETER, PUBLIC :: stressfac(nVegClass)  = RESHAPE ( (/ &
<    ! CALCULATE MOISTURE STRESS FACTOR (ROOT PARAMETERS) !                                                           beta2
<    -5.0_r8, &                                                !  1: tropical evergreen forest / woodland
<    -4.0_r8, &                                                !  2: tropical deciduous forest / woodland
<    -4.0_r8, &                                                !  3: temperate evergreen broadleaf forest / woodland 
<    -4.5_r8, &                                                !  4: temperate evergreen conifer forest / woodland
<    -4.5_r8, &                                                !  5: temperate deciduous forest / woodland
<    -4.5_r8, &                                                !  6: boreal evergreen forest / woodland
<    -4.5_r8, &                                                !  7: boreal deciduous forest / woodland
<    -4.5_r8, &                                                !  8: mixed forest / woodland 
<    -4.0_r8, &                                                !  9: savanna
<    -3.0_r8, &                                                ! 10: grassland / steppe 
<    -3.5_r8, &                                                ! 11: dense shrubland
<    -3.5_r8, &                                                ! 12: open shrubland
<    -2.2_r8, &                                                ! 13: tundra
<    -1.0_r8, &                                                ! 14: desert
<    -1.0_r8  &                                                ! 15: polar desert / rock / ice
<    /), (/nVegClass/) )! lower b.c. for soil profile drainage        !
< 
< !------------------------------------------------------
< ! Other miscellaneous soil parameters
< !------------------------------------------------------
---
>   !------------------------------------------------------
>   ! Other miscellaneous soil parameters
>   !------------------------------------------------------
952,969c821,823
<   REAL(KIND=r8), PARAMETER   , PUBLIC :: bperm_in(nVegClass)     = RESHAPE ( (/ &
< !      
<    0.10_r8,  &                                                !  1: tropical evergreen forest / woodland 
<    0.10_r8,  &                                                !  2: tropical deciduous forest / woodland
<    0.10_r8,  &                                                !  3: temperate evergreen broadleaf forest / woodland
<    0.10_r8,  &                                                !  4: temperate evergreen conifer forest / woodland
<    0.10_r8,  &                                                !  5: temperate deciduous forest / woodland
<    0.10_r8,  &                                                !  6: boreal evergreen forest / woodland 
<    0.10_r8,  &                                                !  7: boreal deciduous forest / woodland
<    0.10_r8,  &                                                !  8: mixed forest / woodland
<    0.10_r8,  &                                                !  9: savanna
<    0.10_r8,  &                                                ! 10: grassland / steppe
<    0.10_r8,  &                                                ! 11: dense shrubland
<    0.10_r8,  &                                                ! 12: open shrubland
<    0.10_r8,  &                                                ! 13: tundra
<    0.10_r8,  &                                                ! 14: desert
<    0.10_r8   &                                                ! 15: polar desert / rock / ice
<    /), (/nVegClass/) )! lower b.c. for soil profile drainage 
---
>   REAL(KIND=r8), PARAMETER   , PUBLIC :: bperm_in(15)     = RESHAPE ( (/ &
> !     1        2        3        4        5        6        7        8        9       10       11       12       13       14       15 
>    1.0_r8, 1.00_r8, 1.00_r8, 1.00_r8, 1.00_r8, 1.00_r8, 1.00_r8, 1.00_r8, 1.00_r8, 1.00_r8, 1.00_r8, 1.00_r8, 1.00_r8, 1.00_r8, 1.00_r8 /), (/15/) )! lower b.c. for soil profile drainage 
974,990c828,844
< !------------------------------------------------------
< ! Soil properties data from Rawls et al. (1992)
< ! Organic properties data compiled by Mustapha El Maayar (2000)
< ! Organic FC and WP taken from Nijssen et al., 1997 (JGR; table 3 OBS-top)
< 
< !------------------------------------------------------
< ! Variable column header definitions
< !------------------------------------------------------
< ! Sand     : sand fraction
< ! Silt     : silt fraction
< ! Clay     : clay fraction
< ! Porosity : porosity (volume fraction)
< ! FC       : field capacity (volume fraction)
< ! WP       : wilting point (volume fraction)
< ! bexp     : Campbell's 'b' exponent
< ! AEP      : air entry potential (m-H20)
< ! SHC      : saturated hydraulic conductivity (m s-1)
---
>   !------------------------------------------------------
>   ! Soil properties data from Rawls et al. (1992)
>   ! Organic properties data compiled by Mustapha El Maayar (2000)
>   ! Organic FC and WP taken from Nijssen et al., 1997 (JGR; table 3 OBS-top)
> 
>   !------------------------------------------------------
>   ! Variable column header definitions
>   !------------------------------------------------------
>   ! Sand     : sand fraction
>   ! Silt     : silt fraction
>   ! Clay     : clay fraction
>   ! Porosity : porosity (volume fraction)
>   ! FC       : field capacity (volume fraction)
>   ! WP       : wilting point (volume fraction)
>   ! bexp     : Campbell's 'b' exponent
>   ! AEP      : air entry potential (m-H20)
>   ! SHC      : saturated hydraulic conductivity (m s-1)
999,1006c853,860
< !----------------------------------------------------------------------
< ! Decomposition pool/transformation parameters (see also Kucharik 
< ! et al. 2000)
< 
< !----------------------------------------------------------------------
< ! lig_frac: split of lignified litter material between protected and
< ! non-protected slow OM pools
< !----------------------------------------------------------------------
---
>   !----------------------------------------------------------------------
>   ! Decomposition pool/transformation parameters (see also Kucharik 
>   ! et al. 2000)
> 
>   !----------------------------------------------------------------------
>   ! lig_frac: split of lignified litter material between protected and
>   ! non-protected slow OM pools
>   !----------------------------------------------------------------------
1010,1013c864,867
< !----------------------------------------------------------------------
< ! fbsom: protected biomass as a fraction of total soil organic carbon
< ! from Verberne et al., 1990
< !----------------------------------------------------------------------
---
>   !----------------------------------------------------------------------
>   ! fbsom: protected biomass as a fraction of total soil organic carbon
>   ! from Verberne et al., 1990
>   !----------------------------------------------------------------------
1016,1019c870,873
< !----------------------------------------------------------------------
< ! effac: efficiency of microbial biomass reincorporated into biomass
< ! pool (from NCSOIL parameterizations; Molina et al., 1983)
< !----------------------------------------------------------------------
---
>   !----------------------------------------------------------------------
>   ! effac: efficiency of microbial biomass reincorporated into biomass
>   ! pool (from NCSOIL parameterizations; Molina et al., 1983)
>   !----------------------------------------------------------------------
1024,1035c878,889
< !======================================================================
< ! Define C:N ratios of substrate pools and biomass: 
< ! Values for metabolic and structural plant material and for lignin are 
< ! from Parton et al., 1987 and Whitmore and Parry, 1988, indexed as follows:
< !      cnr(1): c:n ratio of microbial biomass
< !      cnr(2): c:n ratio of passive soil carbon
< !      cnr(3): c:n ratio of protected slow soil carbon
< !      cnr(4): c:n ratio of non-protected slow soil C
< !      cnr(5): c:n ratio of resistant litter lignin
< !      cnr(6): c:n ratio of structural plant (leaf and root) litter
< !      cnr(7): c:n ratio of metabolic (plant and root) litter
< !      cnr(8): c:n ratio of woody biomass components
---
>   !======================================================================
>   ! Define C:N ratios of substrate pools and biomass: 
>   ! Values for metabolic and structural plant material and for lignin are 
>   ! from Parton et al., 1987 and Whitmore and Parry, 1988, indexed as follows:
>   !      cnr(1): c:n ratio of microbial biomass
>   !      cnr(2): c:n ratio of passive soil carbon
>   !      cnr(3): c:n ratio of protected slow soil carbon
>   !      cnr(4): c:n ratio of non-protected slow soil C
>   !      cnr(5): c:n ratio of resistant litter lignin
>   !      cnr(6): c:n ratio of structural plant (leaf and root) litter
>   !      cnr(7): c:n ratio of metabolic (plant and root) litter
>   !      cnr(8): c:n ratio of woody biomass components
1039,1041c893,895
< !---------------------------------------------------------------------
< !   cnr(1)  cnr(2)  cnr(3)  cnr(4)  cnr(5)  cnr(6)  cnr(7)  cnr(8)  cnr(9)  cnr(10)
< !---------------------------------------------------------------------
---
>        !---------------------------------------------------------------------
>        !   cnr(1)  cnr(2)  cnr(3)  cnr(4)  cnr(5)  cnr(6)  cnr(7)  cnr(8)  cnr(9)  cnr(10)
>        !---------------------------------------------------------------------
1044,1049c898,903
< ! Miscellaneous other C:N factors...
< !      fmax  : maximum fraction allowed in resistant fraction
< !      rconst: rconst is a constant defined as 1200 [Huh?]
< !      cnleaf: average c:n ratio for leaf litterfall 
< !      cnroot: average c:n ratio for root turnover(rotatividade)
< !      cnwood: average c:n ratio for woody debris
---
>   ! Miscellaneous other C:N factors...
>   !      fmax  : maximum fraction allowed in resistant fraction
>   !      rconst: rconst is a constant defined as 1200 [Huh?]
>   !      cnleaf: average c:n ratio for leaf litterfall 
>   !      cnroot: average c:n ratio for root turnover
>   !      cnwood: average c:n ratio for woody debris
1054c908
<    REAL(KIND=r8), PARAMETER   , PUBLIC :: cnroot=   60.0_r8                  ! average c:n ratio for root turnover(rotatividade)
---
>   REAL(KIND=r8), PARAMETER   , PUBLIC :: cnroot=   60.0_r8                  ! average c:n ratio for root turnover
1056c910
< !--------------------------------------------------------------------------------------
---
>   !--------------------------------------------------------------------------------------
1058,1078c912,932
< ! Specific maximum decay rate or growth constants; rates are per day.
< ! Constants are taken from Parton et al., 1987 and Verberne et al., 1990
< ! and special issue of Geoderma (comparison of 9 organic matter models) in Dec. 1997
< 
< ! Leaching parameterization was changed to agree with field data, and led to 
< ! changes in the values of the constants given below.  
< 
< ! Approximate factors for Verberne et al. model where efficiencies are 100%
< ! for some of the transformations: one problem was that their rate constants were
< ! based on 25C, and our modifying functions are based on 15 C...thus the rate constants
< ! are somewhat smaller compared to the Verberne et al. (1990) model parameters.
< ! Rates are based on a daily decomposition timestep (per day)
< !      klm: dpm leaf litter --> microbial biomass
< !      kls: spm leaf litter --> microbial biomass
< !      kll: rpm leaf litter --> non or protected om
< !      krm: dpm root litter --> microbial biomass
< !      krs: spm root litter --> microbial biomass
< !      krl: rpm root litter --> non or protected om 
< !      kwm: dpm woody litter --> microbial biomass
< !      kws: spm woody litter --> microbial biomass
< !      kwl: rpm woody litter --> non or protected om 
---
>   ! Specific maximum decay rate or growth constants; rates are per day.
>   ! Constants are taken from Parton et al., 1987 and Verberne et al., 1990
>   ! and special issue of Geoderma (comparison of 9 organic matter models) in Dec. 1997
> 
>   ! Leaching parameterization was changed to agree with field data, and led to 
>   ! changes in the values of the constants given below.  
> 
>   ! Approximate factors for Verberne et al. model where efficiencies are 100%
>   ! for some of the transformations: one problem was that their rate constants were
>   ! based on 25C, and our modifying functions are based on 15 C...thus the rate constants
>   ! are somewhat smaller compared to the Verberne et al. (1990) model parameters.
>   ! Rates are based on a daily decomposition timestep (per day)
>   !      klm: dpm leaf litter --> microbial biomass
>   !      kls: spm leaf litter --> microbial biomass
>   !      kll: rpm leaf litter --> non or protected om
>   !      krm: dpm root litter --> microbial biomass
>   !      krs: spm root litter --> microbial biomass
>   !      krl: rpm root litter --> non or protected om 
>   !      kwm: dpm woody litter --> microbial biomass
>   !      kws: spm woody litter --> microbial biomass
>   !      kwl: rpm woody litter --> non or protected om 
1089,1097c943,951
< !----------------------------------------------------------------------
< !
< !      kbn: biomass --> non protected organic matter 
< !      kbp: biomass --> protected organic matter
< !      knb: non-protected om --> biomass
< !      kns: non-protected om --> stabilized om
< !      kpb: protected om --> biomass
< !      kps: protected om --> stabilized om
< !      ksb: stabilized om --> biomass
---
>   !----------------------------------------------------------------------
>   !
>   !      kbn: biomass --> non protected organic matter 
>   !      kbp: biomass --> protected organic matter
>   !      knb: non-protected om --> biomass
>   !      kns: non-protected om --> stabilized om
>   !      kpb: protected om --> biomass
>   !      kps: protected om --> stabilized om
>   !      ksb: stabilized om --> biomass
1107,1122c961,976
< !
< ! Yields (efficiencies) with which microbes gain biomass from C 
< ! source; the rest is driven off as CO2 (microbial respiration). All 
< ! microbial CO2 is assumed to leave the soil profile over the course 
< ! of a year. Values are taken primarily from the models of Verberne 
< ! and from CENTURY.
< !----------------------------------------------------------------------
< !      ylm: efficiency for metabolic plant material - leaf matter
< !      yrm: efficiency for metabolic plant material - root matter
< !      ywm: efficiency for metabolic plant material - woody matter
< !      yls: efficiency for structural plant material - leaf matter
< !      yrs: efficiency for structural plant material - root matter
< !      yws: efficiency for structural plant material - woody matter
< !      yll: plant material resistant fraction - leaf matter
< !      yrl: plant material resistant fraction - root matter
< !      ywl: plant material resistant fraction - woody matter
---
>   !
>   ! Yields (efficiencies) with which microbes gain biomass from C 
>   ! source; the rest is driven off as CO2 (microbial respiration). All 
>   ! microbial CO2 is assumed to leave the soil profile over the course 
>   ! of a year. Values are taken primarily from the models of Verberne 
>   ! and from CENTURY.
>   !----------------------------------------------------------------------
>   !      ylm: efficiency for metabolic plant material - leaf matter
>   !      yrm: efficiency for metabolic plant material - root matter
>   !      ywm: efficiency for metabolic plant material - woody matter
>   !      yls: efficiency for structural plant material - leaf matter
>   !      yrs: efficiency for structural plant material - root matter
>   !      yws: efficiency for structural plant material - woody matter
>   !      yll: plant material resistant fraction - leaf matter
>   !      yrl: plant material resistant fraction - root matter
>   !      ywl: plant material resistant fraction - woody matter
1135,1141c989,995
< !      ybn: biomass       --> non-protected pool
< !      ybp: biomass       --> protected pool
< !      yps: protected     --> passive
< !      yns: non-protected --> passive
< !      ysb: passive pool  --> biomass
< !      ypb: protected     --> biomass
< !      ynb: non-protected --> biomass
---
>   !      ybn: biomass       --> non-protected pool
>   !      ybp: biomass       --> protected pool
>   !      yps: protected     --> passive
>   !      yns: non-protected --> passive
>   !      ysb: passive pool  --> biomass
>   !      ypb: protected     --> biomass
>   !      ynb: non-protected --> biomass
1150,1157c1004,1011
< !
< !    #    #    #     #     #####     #      ##    #
< !    #    ##   #     #       #       #     #  #   #
< !    #    # #  #     #       #       #    #    #  #
< !    #    #  # #     #       #       #    ######  #
< !    #    #   ##     #       #       #    #    #  #
< !    #    #    #     #       #       #    #    #  ######
< !
---
>   !
>   !    #    #    #     #     #####     #      ##    #
>   !    #    ##   #     #       #       #     #  #   #
>   !    #    # #  #     #       #       #    #    #  #
>   !    #    #  # #     #       #       #    ######  #
>   !    #    #   ##     #       #       #    #    #  #
>   !    #    #    #     #       #       #    #    #  ######
>   !
1194a1049
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE :: wisoim(:,:,:)! fraction of soil pore space containing ice
1195a1051
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE :: wisoi0(:,:,:)! fraction of soil pore space containing ice
1206a1063
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE :: tim   (:,:)  ! snow skin temperature (K)
1207a1065,1066
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE :: ti0   (:,:)  ! snow skin temperature (K)
> 
1237a1097,1098
> 
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE :: tsnom   (:,:,:) ! temperature of snow layers (K)
1238a1100,1101
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE :: tsno0   (:,:,:) ! temperature of snow layers (K)
> 
1247,1249c1110,1112
< !
< !      INCLUDE 'comhyd.h'
< !
---
>   !
>   !      INCLUDE 'comhyd.h'
>   !
1260,1262c1123,1125
< !
< !      INCLUDE 'comsum.h'
< !
---
>   !
>   !      INCLUDE 'comsum.h'
>   !
1393a1257
> 
1396a1261,1262
> 
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE :: tsm       (:,:)! temperature of upper canopy stems (K)
1397a1264,1266
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE :: ts0       (:,:)! temperature of upper canopy stems (K)
> 
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE :: tlm       (:,:)! temperature of lower canopy leaves & stems(K)
1398a1268,1269
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE :: tl0       (:,:)! temperature of lower canopy leaves & stems(K)
> 
1448c1319
<   REAL(KIND=r8), PUBLIC  , ALLOCATABLE :: totfall  (:,:)! total litterfall and root turnover(rotatividade) (kg_C m-2/year)
---
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE :: totfall  (:,:)! total litterfall and root turnover (kg_C m-2/year)
1467,1469c1338,1341
< !
< !      include 'comveg.h'
< !
---
>   !
>   !      include 'comveg.h'
>   !
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE  :: wliqum   (:,:)! intercepted liquid h2o on upper canopy leaf area (kg m-2)
1470a1343,1345
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE  :: wliqu0   (:,:)! intercepted liquid h2o on upper canopy leaf area (kg m-2)
> 
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE  :: wliqsm   (:,:)! intercepted liquid h2o on upper canopy stem area (kg m-2)
1471a1347,1349
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE  :: wliqs0   (:,:)! intercepted liquid h2o on upper canopy stem area (kg m-2)
> 
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE  :: wliqlm   (:,:)! intercepted liquid h2o on lower canopy leaf and stem area (kg m-2)
1472a1351,1353
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE  :: wliql0   (:,:)! intercepted liquid h2o on lower canopy leaf and stem area (kg m-2)
> 
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE  :: wsnoum   (:,:)! intercepted frozen h2o (snow) on upper canopy leaf area (kg m-2)
1473a1355,1357
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE  :: wsnou0   (:,:)! intercepted frozen h2o (snow) on upper canopy leaf area (kg m-2)
> 
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE  :: wsnosm   (:,:)! intercepted frozen h2o (snow) on upper canopy stem area (kg m-2)
1474a1359,1361
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE  :: wsnos0   (:,:)! intercepted frozen h2o (snow) on upper canopy stem area (kg m-2)
> 
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE  :: wsnolm   (:,:)! intercepted frozen h2o (snow) on lower canopy leaf & stem area (kg m-2)
1475a1363,1364
>   REAL(KIND=r8), PUBLIC  , ALLOCATABLE  :: wsnol0   (:,:)! intercepted frozen h2o (snow) on lower canopy leaf & stem area (kg m-2)
> 
1512c1401
<   REAL(KIND=r8), PUBLIC  , ALLOCATABLE :: fu       (:,:)  ! fraction of overall area covered by upper canopy
---
>   REAL(KIND=r8), TARGET  , PUBLIC  , ALLOCATABLE :: fu       (:,:)  ! fraction of overall area covered by upper canopy
1520a1410
> 
1528,1529c1418,1419
<   REAL(KIND=r8), PUBLIC   :: co2conc                      ! co2 concentration (mol/mol)
<   REAL(KIND=r8), PARAMETER, PUBLIC    ::  co2init =0.000350_r8  ! initial co2 concentration in mol/mol
---
>   REAL(KIND=r8), PUBLIC,  ALLOCATABLE   :: co2conc  (:,:)                      ! co2 concentration (mol/mol)
>   !REAL(KIND=r8), PUBLIC    ::  co2init =0.000350_r8  ! initial co2 concentration in mol/mol
1535d1424
<   REAL(KIND=r8), PUBLIC   , ALLOCATABLE :: brf    (:,:)     ! baffer 
1540c1429,1431
<   REAL(KIND=r8), PUBLIC   , ALLOCATABLE :: deltat (:,:)     ! absolute minimum temperature - temp on average of coldest month (C)
---
>   REAL(KIND=r8), PUBLIC   , ALLOCATABLE :: deltat (:,:)     ! absolute minimum temperature -
> 
>   ! temp on average of coldest month (C)
1585,1596c1476,1503
<   REAL(KIND=r8), PUBLIC   , ALLOCATABLE :: ynleach_p (:,:) ! annual total amount P leached from soil profile (kg_N m-2/yr)
<   REAL(KIND=r8), PUBLIC   , ALLOCATABLE :: tnmin_p   (:,:)   ! instantaneous phosphorus mineralization         (kg_N m-2/timestep)
<   REAL(KIND=r8), PUBLIC   , ALLOCATABLE :: totnmic_p (:,:)   ! total phosphorus residing in microbial pool     (kg_N m-2)
<   REAL(KIND=r8), PUBLIC   , ALLOCATABLE :: totnlit_p (:,:)   ! total phosphorus in all litter pools            (kg_N m-2)
<   REAL(KIND=r8), PUBLIC   , ALLOCATABLE :: totanlit_p(:,:)   ! total standing aboveground phosphorus in litter (kg_N m-2)
<   REAL(KIND=r8), PUBLIC   , ALLOCATABLE :: totrnlit_p(:,:)   ! total root litter phosphorus belowground        (kg_N m-2)
<   REAL(KIND=r8), PUBLIC   , ALLOCATABLE :: totnsoi_p (:,:)   ! total phosphorus in soil                        (kg_N m-2)
<   REAL(KIND=r8), PUBLIC   , ALLOCATABLE :: storedn_p (:,:)   ! total storage of P in soil profile (kg_N m-2) 
<   REAL(KIND=r8), PUBLIC   , ALLOCATABLE :: depth(:)   ! soil layer depth (cm)
< 
< 
<   INTEGER, PUBLIC :: ndaypm (1:12)=(/31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31/)
---
>   !
>   ! Include this variable due phosphorus cycle
>   !
>   REAL(KIND=r8), PUBLIC   , ALLOCATABLE :: ynleach_p (:,:)   ! annual total amount P leached from soil profile (kg_P m-2/yr)
>   REAL(KIND=r8), PUBLIC   , ALLOCATABLE :: tnmin_p   (:,:)   ! instantaneous phosphorus mineralization         (kg_P m-2/timestep)
>   REAL(KIND=r8), PUBLIC   , ALLOCATABLE :: totnmic_p (:,:)   ! total phosphorus residing in microbial pool     (kg_P m-2)
>   REAL(KIND=r8), PUBLIC   , ALLOCATABLE :: totnlit_p (:,:)   ! total phosphorus in all litter pools            (kg_P m-2)
>   REAL(KIND=r8), PUBLIC   , ALLOCATABLE :: totanlit_p(:,:)   ! total standing aboveground phosphorus in litter (kg_P m-2)
>   REAL(KIND=r8), PUBLIC   , ALLOCATABLE :: totrnlit_p(:,:)   ! total root litter phosphorus belowground        (kg_P m-2)
>   REAL(KIND=r8), PUBLIC   , ALLOCATABLE :: totnsoi_p (:,:)   ! total phosphorus in soil                        (kg_P m-2)
>   REAL(KIND=r8), PUBLIC   , ALLOCATABLE :: storedn_p (:,:)   ! total storage of P in soil profile              (kg_P m-2) 
> 
> 
>   INTEGER, PARAMETER, PUBLIC :: ndaypm (1:12)=(/31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31/)
> 
>   !  REAL(KIND=r8), PUBLIC, PARAMETER :: lati2(96)=(/ &
>   !       -88.57217_r8, -86.72253_r8, -84.86197_r8, -82.99894_r8, -81.13498_r8,-79.27056_r8,-77.40589_r8,-75.54106_r8,&
>   !       -73.67613_r8, -71.81113_r8, -69.94608_r8, -68.08099_r8, -66.21587_r8,-64.35073_r8,-62.48557_r8,-60.62040_r8,&
>   !       -58.75521_r8, -56.89001_r8, -55.02481_r8, -53.15960_r8, -51.29438_r8,-49.42915_r8,-47.56393_r8,-45.69869_r8,&
>   !       -43.83346_r8, -41.96822_r8, -40.10298_r8, -38.23774_r8, -36.37249_r8,-34.50724_r8,-32.64199_r8,-30.77674_r8,&
>   !       -28.91149_r8, -27.04624_r8, -25.18099_r8, -23.31573_r8, -21.45048_r8,-19.58522_r8,-17.71996_r8,-15.85470_r8,&
>   !       -13.98945_r8, -12.12419_r8, -10.25893_r8,  -8.39367_r8,  -6.52841_r8, -4.66315_r8, -2.79789_r8, -0.93263_r8,&
>   !         0.93263_r8,   2.79789_r8,   4.66315_r8,   6.52841_r8,   8.39367_r8, 10.25893_r8, 12.12419_r8, 13.98945_r8,&
>   !        15.85470_r8,  17.71996_r8,  19.58522_r8,  21.45048_r8,  23.31573_r8, 25.18099_r8, 27.04624_r8, 28.91149_r8,&
>   !        30.77674_r8,  32.64199_r8,  34.50724_r8,  36.37249_r8,  38.23774_r8, 40.10298_r8, 41.96822_r8, 43.83346_r8,&
>   !        45.69869_r8,  47.56393_r8,  49.42915_r8,  51.29438_r8,  53.15960_r8, 55.02481_r8, 56.89001_r8, 58.75521_r8,&
>   !        60.62040_r8,  62.48557_r8,  64.35073_r8,  66.21587_r8,  68.08099_r8, 69.94608_r8, 71.81113_r8, 73.67613_r8,&
>   !        75.54106_r8,  77.40589_r8,  79.27056_r8,  81.13498_r8,  82.99894_r8, 84.86197_r8, 86.72253_r8, 88.57217_r8/)
1603,1605c1510,1512
<                                  yres_in,idate,idatec,path_in,nfsibd,nfprt,nfsibt,fNameSibVeg,&
<                                  fNameSibmsk,ifday ,ibMaxPerJB,tod ,fNameIBISMask,fNameSSTAOI,&
<                                  fNameIBISDeltaTemp,fNameSandMask,fNameClayMask,fNameClimaTemp,RESTART   )
---
>        yres_in,idate,idatec,nfsibd,nfprt,nfsibt,fNameSibVeg,&
>        fNameSibmsk,isimveg_in,isimco2_in,ifday ,ibMaxPerJB,tod ,fNameIBISMask,&
>        fNameIBISDeltaTemp,fNameSandMask,fNameClayMask,fNameClimaTemp,RESTART,fgtmp,fgq ,topoi  )
1617d1523
<          CHARACTER(LEN=*), INTENT(IN   ) ::  path_in
1622a1529,1530
>     INTEGER         , INTENT(IN   ) :: isimveg_in
>     INTEGER         , INTENT(IN   ) :: isimco2_in
1624c1532
<          INTEGER         , INTENT(IN   ) :: ibMaxPerJB(:)
---
>     INTEGER         , INTENT(IN   ) :: ibMaxPerJB(jbMax_in)
1627d1534
<          CHARACTER(LEN=*), INTENT(IN   ) ::  fNameSSTAOI  
1632a1540,1542
>     REAL(KIND=r8)   , INTENT(IN   ) :: fgtmp(ibMax_in,kMax_in,jbMax_in)
>     REAL(KIND=r8)   , INTENT(IN   ) :: fgq  (ibMax_in,kMax_in,jbMax_in)
>     REAL(KIND=r8)   , INTENT(IN   ) :: topoi(ibMax_in,jbMax_in)
1637a1548,1550
>      
>     isimveg=isimveg_in 
>     isimco2=isimco2_in
1648c1561
<          ALLOCATE(iMaskIBIS(ibMax,       jbMax));iMaskIBIS=0
---
>     ALLOCATE(iMaskIBIS(ibMax,       jbMax));iMaskIBIS=0_i8
1651d1563
<          ALLOCATE(brf     (ibMax,        jbMax));brf=0.0_r8
1690c1602
<          ALLOCATE(iMaskSSiB(ibMax,         jbMax));iMaskSSiB=0.0_r8
---
>     ALLOCATE(iMaskSSiB(ibMax,       jbMax));iMaskSSiB=0_i8
1704a1617
>     ALLOCATE(wisoim   (ibMax,nsoilay,jbMax));wisoim=0.0_r8
1705a1619
>     ALLOCATE(wisoi0   (ibMax,nsoilay,jbMax));wisoi0=0.0_r8
1711a1626
>     ALLOCATE(ti0      (ibMax,        jbMax));ti0=0.0_r8
1712a1628,1629
>     ALLOCATE(tim      (ibMax,        jbMax));tim=0.0_r8
> 
1733a1651
>     ALLOCATE(tsnom    (ibMax,nsnolay,jbMax));tsnom=0.0_r8
1734a1653
>     ALLOCATE(tsno0    (ibMax,nsnolay,jbMax));tsno0=0.0_r8
1735a1655
> 
1770c1690
<          ALLOCATE(addrainage(ibMax ,jbMax));addrainage =0.0_r8
---
>     ALLOCATE(addrainage   (ibMax ,jbMax));addrainage =0.0_r8
1812c1732
<          ALLOCATE(tauwood   (ibMax, npft,jbMax));tauwood =0.0_r8    ! wood biomass turnover(rotatividade) time constant (years)
---
>     ALLOCATE(tauwood   (ibMax, npft,jbMax));tauwood =0.0_r8    ! wood biomass turnover time constant (years)
1878a1799
>     ALLOCATE(tsm        (ibMax ,jbMax));tsm =0.0_r8
1879a1801,1803
>     ALLOCATE(ts0        (ibMax ,jbMax));ts0 =0.0_r8
> 
>     ALLOCATE(tlm        (ibMax ,jbMax));tlm =0.0_r8
1880a1805,1806
>     ALLOCATE(tl0        (ibMax ,jbMax));tl0 =0.0_r8
> 
1945a1872
>     ALLOCATE(wliqum          (ibMax ,jbMax));wliqum     =0.0_r8
1946a1874,1875
>     ALLOCATE(wliqu0          (ibMax ,jbMax));wliqu0     =0.0_r8
>     ALLOCATE(wliqsm          (ibMax ,jbMax));wliqsm     =0.0_r8
1947a1877,1878
>     ALLOCATE(wliqs0          (ibMax ,jbMax));wliqs0     =0.0_r8
>     ALLOCATE(wliql0          (ibMax ,jbMax));wliql0     =0.0_r8
1948a1880,1881
>     ALLOCATE(wliqlm          (ibMax ,jbMax));wliqlm     =0.0_r8
>     ALLOCATE(wsnou0          (ibMax ,jbMax));wsnou0     =0.0_r8
1949a1883,1884
>     ALLOCATE(wsnoum          (ibMax ,jbMax));wsnoum     =0.0_r8
>     ALLOCATE(wsnosm          (ibMax ,jbMax));wsnosm     =0.0_r8
1950a1886,1887
>     ALLOCATE(wsnos0          (ibMax ,jbMax));wsnos0     =0.0_r8
>     ALLOCATE(wsnolm          (ibMax ,jbMax));wsnolm     =0.0_r8
1951a1889
>     ALLOCATE(wsnol0          (ibMax ,jbMax));wsnol0     =0.0_r8
1979a1918
>     sfc%vcover=>fu
1988c1927
<          ALLOCATE(hsoi     (ibMax,nsoilay+1,jbMax)); hsoi=0.0_r8        
---
>     ALLOCATE(hsoi     (ibMax,nsoilay+1,jbMax));hsoi=0.0_r8
1991,2000c1930,1938
< 
<          ALLOCATE( ynleach_p (ibMax ,jbMax));ynleach_p =0.0_r8  ! annual total amount P leached from soil profile (kg_N m-2/yr)
<          ALLOCATE( tnmin_p   (ibMax ,jbMax));tnmin_p   =0.0_r8  ! instantaneous phosphorus mineralization              (kg_N m-2/timestep)
<          ALLOCATE( totnmic_p (ibMax ,jbMax));totnmic_p =0.0_r8  ! total phosphorus residing in microbial pool     (kg_N m-2)
<          ALLOCATE( totnlit_p (ibMax ,jbMax));totnlit_p =0.0_r8  ! total phosphorus in all litter pools       (kg_N m-2)
<          ALLOCATE( totanlit_p(ibMax ,jbMax));totanlit_p=0.0_r8  ! total standing aboveground phosphorus in litter (kg_N m-2)
<          ALLOCATE( totrnlit_p(ibMax ,jbMax));totrnlit_p=0.0_r8  ! total root litter phosphorus belowground              (kg_N m-2)
<          ALLOCATE( totnsoi_p (ibMax ,jbMax));totnsoi_p =0.0_r8  ! total phosphorus in soil                              (kg_N m-2)
<          ALLOCATE( storedn_p (ibMax ,jbMax));storedn_p =0.0_r8  ! total storage of P in soil profile (kg_N m-2) 
<          ALLOCATE( depth(nsoilay)); depth=0.0_r8        
---
>     ALLOCATE( ynleach_p (ibMax ,jbMax));ynleach_p =0.0_r8  ! annual total amount P leached from soil profile (kg_P m-2/yr)
>     ALLOCATE( tnmin_p   (ibMax ,jbMax));tnmin_p   =0.0_r8  ! instantaneous phosphorus mineralization         (kg_P m-2/timestep)
>     ALLOCATE( totnmic_p (ibMax ,jbMax));totnmic_p =0.0_r8  ! total phosphorus residing in microbial pool     (kg_P m-2)
>     ALLOCATE( totnlit_p (ibMax ,jbMax));totnlit_p =0.0_r8  ! total phosphorus in all litter pools            (kg_P m-2)
>     ALLOCATE( totanlit_p(ibMax ,jbMax));totanlit_p=0.0_r8  ! total standing aboveground phosphorus in litter (kg_P m-2)
>     ALLOCATE( totrnlit_p(ibMax ,jbMax));totrnlit_p=0.0_r8  ! total root litter phosphorus belowground        (kg_P m-2)
>     ALLOCATE( totnsoi_p (ibMax ,jbMax));totnsoi_p =0.0_r8  ! total phosphorus in soil  (1 meter of soil deep)(kg_P m-2)
>     ALLOCATE( storedn_p (ibMax ,jbMax));storedn_p =0.0_r8  ! total storage of P in soil profile              (kg_P m-2) 
>     ALLOCATE( co2conc(ibMax ,jbMax));co2conc =0.0_r8 
2006c1944,1946
<          co2conc = co2init
---
>     !co2conc = co2init
>     !co2init = co2val*0.000001_r8
>     co2conc = co2val*0.000001_r8
2010c1950
<          CALL readit(fNameIBISMask,fNameSSTAOI,fNameIBISDeltaTemp,fNameSandMask,fNameClayMask,fNameClimaTemp)
---
>     CALL readit(fNameIBISMask,fNameIBISDeltaTemp,fNameSandMask,fNameClayMask,fNameClimaTemp)
2014,2016c1954,1956
< !
< ! check if diagnostic output is requested, if so read info from 'diag.infile'
< !
---
>     !
>     ! check if diagnostic output is requested, if so read info from 'diag.infile'
>     !
2020,2022c1960,1962
< !
< ! preliminary analysis of climate data
< !
---
>     !
>     ! preliminary analysis of climate data
>     !
2050c1990,1994
<                       idatec )! INTENT(IN   ))
---
>          idatec , & ! INTENT(IN   ))    
>          fgtmp  , &
>          fgq    , &
>          topoi  )
> 
2069,2076c2013,2020
< ! ---------------------------------------------------------------------
< !
< ! this subsroutine is only used to initialize growing degree days,
< ! coldest temp, and warmest temp at very beginning - provides a
< ! climate 'history' based on monthly mean values
< !
< ! common blocks
< !
---
>     ! ---------------------------------------------------------------------
>     !
>     ! this subsroutine is only used to initialize growing degree days,
>     ! coldest temp, and warmest temp at very beginning - provides a
>     ! climate 'history' based on monthly mean values
>     !
>     ! common blocks
>     !
2078c2022
< !
---
>     !
2096,2098c2040,2042
< !
< ! Local variables
< !
---
>     !
>     ! Local variables
>     !
2106c2050
< !
---
>     !
2111,2113c2055,2057
< !
< ! initialize values
< !
---
>     !
>     ! initialize values
>     !
2116c2060
< !
---
>     !
2120c2064
<             IF (iMaskIBIS(i,j) >= 1) THEN
---
>           IF (iMaskIBIS(i,j) >= 1_i8) THEN
2122,2124c2066,2068
< !
< ! coldest monthly temperature (year 0) in deg c
< !
---
>              !
>              ! coldest monthly temperature (year 0) in deg c
>              !
2129,2131c2073,2075
< !
< ! warmest monthly temperature (year 0) in deg c
< !
---
>              !
>              ! warmest monthly temperature (year 0) in deg c
>              !
2136c2080
< !
---
>              !
2138c2082
< !
---
>              !
2142,2144c2086,2088
< !
< ! interpolating climatological monthly input values to daily
< !
---
>     !
>     ! interpolating climatological monthly input values to daily
>     !
2147c2091
< !
---
>           !
2149,2151c2093,2095
< !
<                rwork = 1.0_r8 / float(ndaypm(k))
< !
---
>              !
>              rwork = 1.0_r8 / REAL(ndaypm(k),kind=r8)
>              !
2153,2154c2097,2098
< !
<                   IF (float(lda).lt.float(ndaypm(k)+1)*0.5_r8) THEN
---
>                 !
>                 IF (REAL(lda,kind=r8).LT.REAL(ndaypm(k)+1,kind=r8)*0.5_r8) THEN
2157c2101
<                      dt   = (float(lda) - 0.5_r8) * rwork + 0.5_r8
---
>                    dt   = (REAL(lda,kind=r8) - 0.5_r8) * rwork + 0.5_r8
2161c2105
<                      dt   = (float(lda) - 0.5_r8) * rwork - 0.5_r8
---
>                    dt   = (REAL(lda,kind=r8) - 0.5_r8) * rwork - 0.5_r8
2163c2107
< !
---
>                 !
2166c2110
< !
---
>                 !
2168,2170c2112,2114
< !
< ! growing degree days, using deg c
< !
---
>                 !
>                 ! growing degree days, using deg c
>                 !
2173c2117
< !
---
>                 !
2175c2119
< !
---
>              !
2177c2121
< !
---
>           !
2180,2182c2124,2126
< !
< ! call routine to determine pft existence arrays
< !
---
>     !
>     ! call routine to determine pft existence arrays
>     !
2197,2202c2141,2146
< ! ---------------------------------------------------------------------
<       SUBROUTINE readit ( fNameIBISMask,fNameSSTAOI,fNameIBISDeltaTemp,fNameSandMask,fNameClayMask,fNameClimaTemp)
< ! ---------------------------------------------------------------------
< !
< ! reads in initialization files and initializes some fields
< !
---
>   ! ---------------------------------------------------------------------
>   SUBROUTINE readit ( fNameIBISMask,fNameIBISDeltaTemp,fNameSandMask,fNameClayMask,fNameClimaTemp)
>     ! ---------------------------------------------------------------------
>     !
>     ! reads in initialization files and initializes some fields
>     !
2204c2148
< !
---
>     !
2209d2152
<       REAL(KIND=r4)    :: xmask(iMax,jMax)
2213d2155
<       CHARACTER(LEN=*), INTENT(IN   ) :: fNameSSTAOI
2218,2221c2160,2162
< 
< !
< ! Local variables
< !
---
>     !
>     ! Local variables
>     !
2225c2166,2167
<       INTEGER :: k ,kk! loop indices
---
>     INTEGER :: k ! loop indices
>     INTEGER :: kk
2231c2173
<       INTEGER   :: arrayi(iMax,jMax)
---
>     INTEGER(i4)   :: arrayi(iMax,jMax)
2233c2175
<       REAL(KIND=r4) ::  bfr(imax,jMax)
---
>     REAL(KIND=r8) :: brf     (ibMax,jbMax)
2235,2241c2177,2191
< 
< !
<       CHARACTER*80 :: filen
< !
< !
< ! 2-d surface and vegetation arrays
< !
---
>     imask_in =0_i8
>     mskant_in=0_i8
>     ier =0
>     lonscale_in =0.0_r8
>     latscale_in =0.0_r8
>     array2 =0.0_r8
>     array=0.0_r4
>     arrayi =0
>     ibMask=0
>     !
>     !CHARACTER*80 :: filen
>     !
>     !
>     ! 2-d surface and vegetation arrays
>     !
2243,2247c2193,2197
< !
< ! land mask, latitudes, and longitudes
< !      
<       IF(.NOT.UNDIMENSION)THEN
<         INQUIRE (IOLENGTH=LRecIn)arrayi(1,1)
---
>     !
>     ! land mask, latitudes, and longitudes
>     !    
>     arrayi=0  
>     INQUIRE (IOLENGTH=LRecIn)arrayi
2258,2259d2207
<         DO j=1,jMax
<            DO i=1,iMax
2261c2209
<               READ(2,rec=irec, IOSTAT=ierr)arrayi(i,j)
---
>     READ(2,rec=irec, IOSTAT=ierr)arrayi
2267,2268d2214
<            END DO
<         END DO     
2270a2217,2220
>     imask_in=arrayi
> 
>     IF (reducedGrid) THEN
>        CALL FreqBoxIJtoIBJB(imask_in,iMaskIBIS)
2272,2276c2222
<          DO j = 1, jMax
<             DO i = 1, iMax
<                arrayi(i,j) = type_veg(i)
<             END DO
<          END DO
---
>        CALL IJtoIBJB( imask_in,iMaskIBIS)
2279,2282c2225,2228
<       DO j = 1, jMax
<           DO i = 1, iMax
<             IF(arrayi(i,j) >=1 )THEN
<                 imask_in(i,j) = 1
---
>     DO j = 1, jbMax
>        DO i = 1, ibMax
>            IF(iMaskIBIS(i,j) >=1 )THEN
>               ibMask(i,j) = 1_i8
2284c2230
<                 imask_in(i,j) = 0
---
>               ibMask(i,j) = 0_i8
2289,2294c2235
<       IF (reducedGrid) THEN
<          CALL FreqBoxIJtoIBJB(imask_in,iMaskIBIS)
<       ELSE
<          CALL IJtoIBJB( imask_in,iMaskIBIS)
<       END IF
<       ibMask = iMaskIBIS
---
> !    ibMask = iMaskIBIS
2296,2298d2236
< 
<       IF(.NOT.UNDIMENSION)THEN
< 
2302,2306d2239
<       ELSE
<          DO i=1,iMax
<             lonscale_in(i,1) = lon_site(i)
<          END DO     
<       END IF 
2315c2248
<          CALL AveBoxIJtoIBJB(lonscale_in,lonscale)
---
>        CALL NearestIJtoIBJB(lonscale_in,lonscale)
2322c2255
<       !    y = 180*x/pi   ! degree
---
>     !    y = 180*x/pi
2324d2256
<       IF(.NOT.UNDIMENSION)THEN
2326c2258
<             latscale_in(1,j)        =(lati (j)-(pi/2.0_r8))*(180.0_r8/pi)
---
>        latscale_in(1,j) =(lati(jMax+1-j)-(pi/2.0_r8))*(180.0_r8/pi)
2333,2343d2264
<       ELSE
<          DO i=1,iMax
<             latscale_in(i,1) = lat_site(i)
<          END DO     
<          DO j=1,jMax
<             DO i=2,iMax
<                latscale_in(i,j) =latscale_in(i,j)
<             END DO
<          END DO     
<       END IF 
<     
2345c2266
<          CALL AveBoxIJtoIBJB(latscale_in,latscale)
---
>        CALL NearestIJtoIBJB(latscale_in,latscale)
2370c2291
<          CALL AveBoxIJtoIBJB(array2,brf)
---
>        CALL LinearIJtoIBJB(array2,brf)
2383,2387c2304,2307
< !
< ! fixed vegetation map
< !
<       IF(.NOT.UNDIMENSION)THEN
<          INQUIRE (IOLENGTH=LRecIn)arrayi(1,1)
---
>     !
>     ! fixed vegetation map
>     !
>     INQUIRE (IOLENGTH=LRecIn)arrayi
2398,2399d2317
<          DO j=1,jMax
<             DO i=1,iMax
2401c2319
<                READ(2,rec=irec, IOSTAT=ierr)arrayi(i,j)
---
>     READ(2,rec=irec, IOSTAT=ierr)arrayi
2407,2408d2324
<             END DO
<          END DO     
2411,2417d2326
<       ELSE
<          DO j = 1, jMax
<             DO i = 1, iMax
<                arrayi(i,j) = type_veg(i)
<             END DO
<          END DO       
<       END IF
2437c2346
<                  IF (iMaskIBIS(i,j) >= 1) THEN
---
>              IF (iMaskIBIS(i,j) >= 1_i8) THEN
2443,2452d2351
<       ELSE
<              DO j = 1, jbMax
<                nLndPts=0
<                DO  i = 1, ibMax
<                  IF (iMaskIBIS(i,j) >= 1) THEN
<                     nLndPts=nLndPts+1
<                     xinveg(nLndPts,j) = 14_r8
<                  END IF
<                END DO
<              END DO
2481,2489c2380,2387
< !
< ! 2-d soil array
< !
< !
< ! delta t
< !            
<       IF(.NOT.UNDIMENSION)THEN
< 
<          INQUIRE (IOLENGTH=LRecIn)array(1,1)
---
>     !
>     ! 2-d soil array
>     !
>     !
>     ! delta t
>     !     
>     array=0.0_r4 
>     INQUIRE (IOLENGTH=LRecIn)array
2499,2500d2396
<          DO j=1,jMax
<             DO i=1,iMax
2502c2398
<                READ(2,rec=irec, IOSTAT=ierr)array(i,j)
---
>     READ(2,rec=irec, IOSTAT=ierr)array
2508,2510c2404
<                array2(i,j) = REAL(array(i,j),KIND=r8)
<            END DO
<          END DO     
---
>     array2 = REAL(array,KIND=r8)
2512,2518d2405
<       ELSE
<          DO j = 1, jMax
<             DO i = 1, iMax
<                array2(i,j) = deltat_site(i)
<             END DO
<          END DO       
<       END IF
2521c2408
<          CALL AveBoxIJtoIBJB(array2,brf)
---
>        CALL LinearIJtoIBJB(array2,brf)
2529c2416
<           IF (iMaskIBIS(i,j) >= 1) THEN
---
>           IF (iMaskIBIS(i,j) >= 1_i8) THEN
2535,2541c2422,2426
< !
< ! 3-d soil texture array
< !
< ! icount(3) is the 6 layers used in soita.sand.nc soita.clay.nc
< !
<       IF(.NOT.UNDIMENSION)THEN
< 
---
>     !
>     ! 3-d soil texture array
>     !
>     ! icount(3) is the 6 layers used in soita.sand.nc soita.clay.nc
>     !
2550,2551d2434
<       END IF 
<       IF(.NOT.UNDIMENSION)THEN
2568c2451
<          CLOSE(2)
---
> 
2581,2614c2464
<       ELSE
<          irec=0
<          DO k=1,nsoilay
<             kk=idx(nsoilay,nsoilayBase,k)
<             DO j=1,jMax
<                DO i=1,iMax
<                   if(kk<=1)THEN
<                      irec=1
<                   elseif(kk>=nsoilayBase)THEN
<                      irec=1+(nSite)*(kk-1)
<                   else
<                      irec=1+(nSite)*(kk-1)
<                   endif
<                   array2(i,j) = sand_site(irec)
<                END DO
<             END DO   
<             IF (reducedGrid) THEN
<                CALL AveBoxIJtoIBJB(array2,brf)
<             ELSE
<                CALL IJtoIBJB(array2 ,brf )
<             END IF
< 
<             DO j = 1, jbMax
<                nLndPts=0
<                DO i = 1, ibMax
<                   IF (iMaskIBIS(i,j) >= 1) THEN
<                      nLndPts=nLndPts+1
<                      sand(nLndPts,k,j) = brf(i,j)
<                   END IF
<                END DO
<             END DO
< 
<          END DO
<       END IF 
---
>     CLOSE(2)
2619d2468
<       IF(.NOT.UNDIMENSION)THEN
2628,2629d2476
<       END IF
<       IF(.NOT.UNDIMENSION)THEN
2636c2483
<                     TRIM(fNameSandMask), ierr
---
>                TRIM(fNameClayMask), ierr
2641c2488
<                CALL FreqBoxIJtoIBJB(array2(1:iMax,1:jMax), brf_soil(1:ibMax,1:jbMax,k))
---
>           CALL FreqBoxIJtoIBJB(array2(1:iMax,1:jMax) ,brf_soil(1:ibMax,1:jbMax,k))
2643c2490
<                CALL IJtoIBJB       (array2(1:iMax,1:jMax), brf_soil(1:ibMax,1:jbMax,k))
---
>           CALL IJtoIBJB       (array2(1:iMax,1:jMax) ,brf_soil(1:ibMax,1:jbMax,k))
2646c2493
<          CLOSE(2)
---
> 
2659,2724c2506,2537
<       ELSE
<          irec=0
<          DO k=1,nsoilay
<             kk=idx(nsoilay,nsoilayBase,k)
<             DO j=1,jMax
<                DO i=1,iMax
<                   if(kk<=1)THEN
<                     irec=1
<                   elseif(kk>=nsoilayBase)THEN
<                     irec=1+(nSite)*(kk-1)
<                   else
<                     irec=1+(nSite)*(kk-1)
<                   endif
<                   array2(i,j) = clay_site(irec)
<                END DO
<             END DO   
<             IF (reducedGrid) THEN
<                CALL AveBoxIJtoIBJB(array2,brf)
<             ELSE
<                CALL IJtoIBJB(array2 ,brf )
<             END IF
< 
<             DO j = 1, jbMax
<                nLndPts=0
<                DO i = 1, ibMax
<                    IF (iMaskIBIS(i,j) >= 1) THEN
<                      nLndPts=nLndPts+1
<                      clay(nLndPts,k,j) = brf(i,j)
<                    END IF
<                END DO
<             END DO
<          END DO
<       END IF 
< 
< !
< ! 3-d climate arrays
< !
< !     filen = 'input/wetd.mon.nc'
< !     OPEN(2,file='input/wetd.mon.bin',ACCESS='DIRECT', &
< !    &  FORM='UNFORMATTED',RECL=1,ACTION='READ')
< !      irec=0
< !     DO k=1,12
< !        DO j=1,jMax
< !          DO i=1,iMax
< !              irec=irec+1
< !              READ(2,rec=irec)array(i,j)
< !          END DO
< !        END DO
< !        DO j = 1, jbMax
< !           DO i = 1, ibMax
< !               brf(i,j) = array(i,j)
< !           END DO
< !        END DO
< !        DO j = 1, jbMax
< !            nLndPts=0
< !           DO i = 1, ibMax
< !              IF (ibMask(i,j) == 1) THEN
< !                  nLndPts=nLndPts+1
< !                 clmwet(nLndPts,k,j) = brf(i,j)
< !              END IF
< !           END DO
< !        END DO
< !     END DO     
< !     CLOSE(2)
< !
<       IF(.NOT.UNDIMENSION)THEN
---
>     CLOSE(2)
>     !
>     ! 3-d climate arrays
>     !
>     !     filen = 'input/wetd.mon.nc'
>     !     OPEN(2,file='input/wetd.mon.bin',ACCESS='DIRECT', &
>     !    &  FORM='UNFORMATTED',RECL=1,ACTION='READ')
>     !      irec=0
>     !     DO k=1,12
>     !        DO j=1,jMax
>     !          DO i=1,iMax
>     !              irec=irec+1
>     !              READ(2,rec=irec)array(i,j)
>     !          END DO
>     !        END DO
>     !        DO j = 1, jbMax
>     !           DO i = 1, ibMax
>     !               brf(i,j) = array(i,j)
>     !           END DO
>     !        END DO
>     !        DO j = 1, jbMax
>     !            nLndPts=0
>     !           DO i = 1, ibMax
>     !              IF (ibMask(i,j) == 1) THEN
>     !                  nLndPts=nLndPts+1
>     !                 clmwet(nLndPts,k,j) = brf(i,j)
>     !              END IF
>     !           END DO
>     !        END DO
>     !     END DO     
>     !     CLOSE(2)
>     !
2733d2545
<       END IF
2736d2547
<          IF(.NOT.UNDIMENSION)THEN
2743a2555
> 
2745,2754c2557
<          ELSE
<             DO j=1,jMax
<                DO i=1,iMax
<                   irec=irec+1
<                   array2(i,j) = clmt_site(irec)
<                END DO
<                irec=irec+(nSite-iMax)
<             END DO
<          END IF
< !,sand_site,clay_site,clmt_site
---
> 
2756c2559
<             CALL AveBoxIJtoIBJB(array2,brf)
---
>           CALL LinearIJtoIBJB(array2,brf)
2763c2566
<                IF (iMaskIBIS(i,j) >= 1) THEN
---
>              IF (iMaskIBIS(i,j) >= 1_i8) THEN
2765a2569
>                 xint(nLndPts,k,j) = brf(i,j)
2772,2798c2576,2715
< !     filen = 'input/trange.mon.nc'
< !     OPEN(2,file='input/trange.mon.bin',ACCESS='DIRECT', &
< !    &  FORM='UNFORMATTED',RECL=1,ACTION='READ')
< !      irec=0
< !     DO k=1,12
< !        DO j=1,jMax
< !          DO i=1,iMax
< !              irec=irec+1
< !              READ(2,rec=irec)array(i,j)
< !          END DO
< !        END DO
< !        DO j = 1, jbMax
< !           DO i = 1, ibMax
< !               brf(i,j) = array(i,j)
< !           END DO
< !        END DO
< !        DO j = 1, jbMax
< !            nLndPts=0
< !           DO i = 1, ibMax
< !              IF (ibMask(i,j) == 1) THEN
< !                  nLndPts=nLndPts+1
< !                 clmtrng(nLndPts,k,j) = brf(i,j)
< !              END IF
< !           END DO
< !        END DO
< !     END DO     
< !     CLOSE(2)
---
>     !     filen = 'input/trange.mon.nc'
>     !     OPEN(2,file='input/trange.mon.bin',ACCESS='DIRECT', &
>     !    &  FORM='UNFORMATTED',RECL=1,ACTION='READ')
>     !      irec=0
>     !     DO k=1,12
>     !        DO j=1,jMax
>     !          DO i=1,iMax
>     !              irec=irec+1
>     !              READ(2,rec=irec)array(i,j)
>     !          END DO
>     !        END DO
>     !        DO j = 1, jbMax
>     !           DO i = 1, ibMax
>     !               brf(i,j) = array(i,j)
>     !           END DO
>     !        END DO
>     !        DO j = 1, jbMax
>     !            nLndPts=0
>     !           DO i = 1, ibMax
>     !              IF (ibMask(i,j) == 1) THEN
>     !                  nLndPts=nLndPts+1
>     !                 clmtrng(nLndPts,k,j) = brf(i,j)
>     !              END IF
>     !           END DO
>     !        END DO
>     !     END DO     
>     !     CLOSE(2)
> 
>     !     filen = 'input/prec.mon.nc'
>     !     OPEN(2,file='input/prec.mon.bin',ACCESS='DIRECT', &
>     !    &  FORM='UNFORMATTED',RECL=1,ACTION='READ')
>     !      irec=0
>     !     DO k=1,12
>     !        DO j=1,jMax
>     !          DO i=1,iMax
>     !              irec=irec+1
>     !              READ(2,rec=irec)array(i,j)
>     !          END DO
>     !        END DO
>     !        DO j = 1, jbMax
>     !           DO i = 1, ibMax
>     !               brf(i,j) = array(i,j)
>     !           END DO
>     !        END DO
>     !        DO j = 1, jbMax
>     !            nLndPts=0
>     !           DO i = 1, ibMax
>     !              IF (ibMask(i,j) == 1) THEN
>     !                  nLndPts=nLndPts+1
>     !                 clmprec(nLndPts,k,j) = brf(i,j)
>     !              END IF
>     !           END DO
>     !        END DO
>     !     END DO     
>     !     CLOSE(2)
> 
>     !     filen = 'input/wspd.mon.nc'
>     !     OPEN(2,file='input/wspd.mon.bin',ACCESS='DIRECT', &
>     !    &  FORM='UNFORMATTED',RECL=1,ACTION='READ')
>     !      irec=0
>     !     DO k=1,12
>     !        DO j=1,jMax
>     !          DO i=1,iMax
>     !              irec=irec+1
>     !              READ(2,rec=irec)array(i,j)
>     !          END DO
>     !        END DO
>     !        DO j = 1, jbMax
>     !           DO i = 1, ibMax
>     !               brf(i,j) = array(i,j)
>     !           END DO
>     !        END DO
>     !        DO j = 1, jbMax
>     !            nLndPts=0
>     !           DO i = 1, ibMax
>     !              IF (ibMask(i,j) == 1) THEN
>     !                  nLndPts=nLndPts+1
>     !                 xinwind(nLndPts,k,j) = brf(i,j)
>     !              END IF
>     !           END DO
>     !        END DO
>     !     END DO     
>     !     CLOSE(2)
>     !
>     !     filen = 'input/cld.mon.nc'
>     !     OPEN(2,file='input/cld.mon.bin',ACCESS='DIRECT', &
>     !    &  FORM='UNFORMATTED',RECL=1,ACTION='READ')
>     !      irec=0
>     !     DO k=1,12
>     !        DO j=1,jMax
>     !          DO i=1,iMax
>     !              irec=irec+1
>     !              READ(2,rec=irec)array(i,j)
>     !          END DO
>     !        END DO
>     !        DO j = 1, jbMax
>     !           DO i = 1, ibMax
>     !               brf(i,j) = array(i,j)
>     !           END DO
>     !        END DO
>     !        DO j = 1, jbMax
>     !            nLndPts=0
>     !           DO i = 1, ibMax
>     !              IF (ibMask(i,j) == 1) THEN
>     !                  nLndPts=nLndPts+1
>     !                 clmcld(nLndPts,k,j) = brf(i,j)
>     !              END IF
>     !           END DO
>     !        END DO
>     !     END DO     
>     !     CLOSE(2)
>     !
>     !     filen = 'input/rh.mon.nc'
>     !     OPEN(2,file='input/rh.mon.bin',ACCESS='DIRECT', &
>     !    &  FORM='UNFORMATTED',RECL=1,ACTION='READ')
>     !      irec=0
>     !     DO k=1,12
>     !        DO j=1,jMax
>     !          DO i=1,iMax
>     !              irec=irec+1
>     !              READ(2,rec=irec)array(i,j)
>     !          END DO
>     !        END DO
>     !         
>     !        DO j = 1, jbMax
>     !           DO i = 1, ibMax
>     !               brf(i,j) = array(i,j)
>     !           END DO
>     !        END DO
>     !        DO j = 1, jbMax
>     !            nLndPts=0
>     !           DO i = 1, ibMax
>     !              IF (ibMask(i,j) == 1) THEN
>     !                  nLndPts=nLndPts+1
>     !                 clmq(nLndPts,k,j) = brf(i,j)
>     !              END IF
>     !           END DO
>     !        END DO
>     !     END DO     
>     !     CLOSE(2)
2800,2803d2716
< !     filen = 'input/prec.mon.nc'
< !     OPEN(2,file='input/prec.mon.bin',ACCESS='DIRECT', &
< !    &  FORM='UNFORMATTED',RECL=1,ACTION='READ')
< !      irec=0
2805,2810d2717
< !        DO j=1,jMax
< !          DO i=1,iMax
< !              irec=irec+1
< !              READ(2,rec=irec)array(i,j)
< !          END DO
< !        END DO
2812,2822c2719,2725
< !           DO i = 1, ibMax
< !               brf(i,j) = array(i,j)
< !           END DO
< !        END DO
< !        DO j = 1, jbMax
< !            nLndPts=0
< !           DO i = 1, ibMax
< !              IF (ibMask(i,j) == 1) THEN
< !                  nLndPts=nLndPts+1
< !                 clmprec(nLndPts,k,j) = brf(i,j)
< !              END IF
---
> !          DO i = 1, nlpoints(j)
> !             xint   (i,k,j) = clmt   (i,k,j)
>              !xintrng(i,k,j) = clmtrng(i,k,j)
>              !xinprec(i,k,j) = clmprec(i,k,j)
>              !xincld (i,k,j) = clmcld (i,k,j)
>              !xinq   (i,k,j) = clmq   (i,k,j)
>              !xinwet (i,k,j) = clmwet (i,k,j)
2826,2930c2729,2734
< !     CLOSE(2)
< 
< !     filen = 'input/wspd.mon.nc'
< !     OPEN(2,file='input/wspd.mon.bin',ACCESS='DIRECT', &
< !    &  FORM='UNFORMATTED',RECL=1,ACTION='READ')
< !      irec=0
< !     DO k=1,12
< !        DO j=1,jMax
< !          DO i=1,iMax
< !              irec=irec+1
< !              READ(2,rec=irec)array(i,j)
< !          END DO
< !        END DO
< !        DO j = 1, jbMax
< !           DO i = 1, ibMax
< !               brf(i,j) = array(i,j)
< !           END DO
< !        END DO
< !        DO j = 1, jbMax
< !            nLndPts=0
< !           DO i = 1, ibMax
< !              IF (ibMask(i,j) == 1) THEN
< !                  nLndPts=nLndPts+1
< !                 xinwind(nLndPts,k,j) = brf(i,j)
< !              END IF
< !           END DO
< !        END DO
< !     END DO     
< !     CLOSE(2)
< !
< !     filen = 'input/cld.mon.nc'
< !     OPEN(2,file='input/cld.mon.bin',ACCESS='DIRECT', &
< !    &  FORM='UNFORMATTED',RECL=1,ACTION='READ')
< !      irec=0
< !     DO k=1,12
< !        DO j=1,jMax
< !          DO i=1,iMax
< !              irec=irec+1
< !              READ(2,rec=irec)array(i,j)
< !          END DO
< !        END DO
< !        DO j = 1, jbMax
< !           DO i = 1, ibMax
< !               brf(i,j) = array(i,j)
< !           END DO
< !        END DO
< !        DO j = 1, jbMax
< !            nLndPts=0
< !           DO i = 1, ibMax
< !              IF (ibMask(i,j) == 1) THEN
< !                  nLndPts=nLndPts+1
< !                 clmcld(nLndPts,k,j) = brf(i,j)
< !              END IF
< !           END DO
< !        END DO
< !     END DO     
< !     CLOSE(2)
< !
< !     filen = 'input/rh.mon.nc'
< !     OPEN(2,file='input/rh.mon.bin',ACCESS='DIRECT', &
< !    &  FORM='UNFORMATTED',RECL=1,ACTION='READ')
< !      irec=0
< !     DO k=1,12
< !        DO j=1,jMax
< !          DO i=1,iMax
< !              irec=irec+1
< !              READ(2,rec=irec)array(i,j)
< !          END DO
< !        END DO
< !         
< !        DO j = 1, jbMax
< !           DO i = 1, ibMax
< !               brf(i,j) = array(i,j)
< !           END DO
< !        END DO
< !        DO j = 1, jbMax
< !            nLndPts=0
< !           DO i = 1, ibMax
< !              IF (ibMask(i,j) == 1) THEN
< !                  nLndPts=nLndPts+1
< !                 clmq(nLndPts,k,j) = brf(i,j)
< !              END IF
< !           END DO
< !        END DO
< !     END DO     
< !     CLOSE(2)
< 
<       DO k=1,12
<          DO j = 1, jbMax
<             DO i = 1, nlpoints(j)
<                   xint   (i,k,j) = clmt   (i,k,j)
<                   !xintrng(i,k,j) = clmtrng(i,k,j)
<                   !xinprec(i,k,j) = clmprec(i,k,j)
<                   !xincld (i,k,j) = clmcld (i,k,j)
<                   !xinq   (i,k,j) = clmq   (i,k,j)
<                   !xinwet (i,k,j) = clmwet (i,k,j)
<             END DO
<          END DO
<       END DO 
< !
<  9000 format (1x,'ERROR in subroutine readit')
<  9010 format (1x,' ')
<  9020 format (1x,'number of land points: ', i10)
< !
< ! return to main program
---
>     !
> !9000 FORMAT (1x,'ERROR in subroutine readit')
> !9010 FORMAT (1x,' ')
> !9020 FORMAT (1x,'number of land points: ', i10)
>     !
>     ! return to main program
2933,2934c2737,2738
< !
< ! ---------------------------------------------------------------------
---
>   !
>   ! ---------------------------------------------------------------------
2939,2947c2743,2751
< ! ---------------------------------------------------------------------
< !
< ! The land surface model works by gathering all the land points on the
< ! CCM3 [iMax] x [jMax] grid into a vector of [lpt] land points.
< !
< ! This subroutine finds [ixy] and [jxy], which are indices for the 
< ! mapping: [iMax] x [jMax] grid <-> [lpt] vector of land points 
< !
< ! ---------------------------------------------------------------------
---
>     ! ---------------------------------------------------------------------
>     !
>     ! The land surface model works by gathering all the land points on the
>     ! CCM3 [iMax] x [jMax] grid into a vector of [lpt] land points.
>     !
>     ! This subroutine finds [ixy] and [jxy], which are indices for the 
>     ! mapping: [iMax] x [jMax] grid <-> [lpt] vector of land points 
>     !
>     ! ---------------------------------------------------------------------
2952,2953c2756,2757
< !-----------------------------Arguments---------------------------------
< ! Input arguments
---
>     !-----------------------------Arguments---------------------------------
>     ! Input arguments
2957c2761
< ! Output arguments
---
>     ! Output arguments
2959,2960c2763,2764
< !
< !------------------------------Local variables--------------------------
---
>     !
>     !------------------------------Local variables--------------------------
2975,2979c2779,2783
< !
< !     180 --- pi
< !      y      x 
< !-----------------------------------------------------------------------
< !
---
>     !
>     !     180 --- pi
>     !      y      x 
>     !-----------------------------------------------------------------------
>     !
2982,2984c2786,2788
< !
< ! lonscale and latscale are used by the netcdf input/output subroutine
< !
---
>     !
>     ! lonscale and latscale are used by the netcdf input/output subroutine
>     !
2989c2793
< !         latscale(j) = clat(1,j) * 180._r8 /pi
---
>        !         latscale(j) = clat(1,j) * 180._r8 /pi
2992,2994c2796,2798
< !
< !     the area of each grid cell is calculated following Gordon's
< !     subroutines
---
>     !
>     !     the area of each grid cell is calculated following Gordon's
>     !     subroutines
2998,2999c2802,2803
<       edgew = -float(iMax)/(2.0_r8*360.0_r8)
<       edgee = 360.0_r8-float(iMax)/(2.0_r8*360.0_r8)
---
>     edgew = -REAL(iMax,kind=r8)/(2.0_r8*360.0_r8)
>     edgee = 360.0_r8-REAL(iMax,kind=r8)/(2.0_r8*360.0_r8)
3003c2807
< !
---
>     !
3034c2838
< ! --------------------------------------------------------------------
---
>   ! --------------------------------------------------------------------
3046c2850
< ! --------------------------------------------------------------------
---
>     ! --------------------------------------------------------------------
3048,3055c2852,2859
< ! ------------------------ code history ------------------------------
< ! source file       : cellbox.F
< ! purpose           : southern and western edges of grid cells
< ! date first created: March 1996 - lsm version 1 (dataset generation code)
< ! by whom           : Gordon Bonan
< ! date last revised : December 1998 - lsm version 2
< ! by whom           : Gordon Bonan
< ! --------------------------------------------------------------------
---
>     ! ------------------------ code history ------------------------------
>     ! source file       : cellbox.F
>     ! purpose           : southern and western edges of grid cells
>     ! date first created: March 1996 - lsm version 1 (dataset generation code)
>     ! by whom           : Gordon Bonan
>     ! date last revised : December 1998 - lsm version 2
>     ! by whom           : Gordon Bonan
>     ! --------------------------------------------------------------------
3059c2863
< ! ------------------------ input variables ---------------------------
---
>     ! ------------------------ input variables ---------------------------
3067,3068c2871,2872
< !      REAL(KIND=r8)*8 longxy(lon,lat)    !longitude at center of grid cell
< !      REAL(KIND=r8)*8 latixy(lon,lat)    !latitude at center of grid cell
---
>     !      REAL(KIND=r8)*8 longxy(lon,lat)    !longitude at center of grid cell
>     !      REAL(KIND=r8)*8 latixy(lon,lat)    !latitude at center of grid cell
3072c2876
< ! --------------------------------------------------------------------
---
>     ! --------------------------------------------------------------------
3074c2878
< ! ------------------- output variables ----------------------------
---
>     ! ------------------- output variables ----------------------------
3077c2881
< ! --------------------------------------------------------------------
---
>     ! --------------------------------------------------------------------
3079c2883
< ! ------------------- local variables -----------------------------
---
>     ! ------------------- local variables -----------------------------
3083c2887
< ! --------------------------------------------------------------------
---
>     ! --------------------------------------------------------------------
3085,3091c2889,2895
< ! --------------------------------------------------------------------
< ! Latitudes -- southern edges for each latitude strip. The southern
< ! and northern edges of latitude strip j are:
< !        southern = lats(j  )
< !        northern = lats(j+1)
< ! Hence, [lats] is dimensioned lats(lat+1)
< ! --------------------------------------------------------------------     
---
>     ! --------------------------------------------------------------------
>     ! Latitudes -- southern edges for each latitude strip. The southern
>     ! and northern edges of latitude strip j are:
>     !        southern = lats(j  )
>     !        northern = lats(j+1)
>     ! Hence, [lats] is dimensioned lats(lat+1)
>     ! --------------------------------------------------------------------     
3094c2898
< !        lats(j) = (latixy(1,j-1) + latixy(1,j)) / 2.
---
>        !        lats(j) = (latixy(1,j-1) + latixy(1,j)) / 2.
3099,3126c2903,2930
< ! --------------------------------------------------------------------
< ! Longitudes -- western edges. Longitudes for the western edge of the 
< ! cells must increase continuously and span 360 degrees. Three types of 
< ! grids are valid:
< !
< ! 1: grid starts at Dateline  with western edge on Dateline
< ! 2: grid starts at Greenwich with western edge on Greenwich
< ! 3: grid starts at Greenwich with center on Greenwich
< !
< ! For Grid 1 (Dateline)          , western edges range from:  -180 to 180
< ! For Grid 2 (Greenwich)         , western edges range from:     0 to 360
< ! For Grid 3 (Greenwich centered), western edges range from: -dx/2 to -dx/2 + 360 
< !
< ! Western edges correspond to [longxy] (longitude at center of cell) for
< ! Grid 1 only. In this case, western edges range from -180 to 180 with
< ! negative longitudes west of Greenwich. Hence, this is the preferred
< ! grid type. Grids 2 and 3 are supported because some data sets start
< ! at Greenwich rather than Dateline (Grid 2) and the NCAR CCM starts
< ! at Greenwich, centered on Greenwich (Grid 3). 
< !
< ! Partial grids that do not span 360 degrees are allowed so long as they
< ! have the convention of Grid 1 with 
< !      western edge of grid: >= -180 and < 180
< !      eastern edge of grid: > western edge  and <= 180
< !
< ! [lonw] must be dimensioned lonw(lon+1,lat) because each latitude
< ! strip can have variable longitudinal resolution
< ! --------------------------------------------------------------------
---
>     ! --------------------------------------------------------------------
>     ! Longitudes -- western edges. Longitudes for the western edge of the 
>     ! cells must increase continuously and span 360 degrees. Three types of 
>     ! grids are valid:
>     !
>     ! 1: grid starts at Dateline  with western edge on Dateline
>     ! 2: grid starts at Greenwich with western edge on Greenwich
>     ! 3: grid starts at Greenwich with center on Greenwich
>     !
>     ! For Grid 1 (Dateline)          , western edges range from:  -180 to 180
>     ! For Grid 2 (Greenwich)         , western edges range from:     0 to 360
>     ! For Grid 3 (Greenwich centered), western edges range from: -dx/2 to -dx/2 + 360 
>     !
>     ! Western edges correspond to [longxy] (longitude at center of cell) for
>     ! Grid 1 only. In this case, western edges range from -180 to 180 with
>     ! negative longitudes west of Greenwich. Hence, this is the preferred
>     ! grid type. Grids 2 and 3 are supported because some data sets start
>     ! at Greenwich rather than Dateline (Grid 2) and the NCAR CCM starts
>     ! at Greenwich, centered on Greenwich (Grid 3). 
>     !
>     ! Partial grids that do not span 360 degrees are allowed so long as they
>     ! have the convention of Grid 1 with 
>     !      western edge of grid: >= -180 and < 180
>     !      eastern edge of grid: > western edge  and <= 180
>     !
>     ! [lonw] must be dimensioned lonw(lon+1,lat) because each latitude
>     ! strip can have variable longitudinal resolution
>     ! --------------------------------------------------------------------
3132c2936
< ! western edge of first grid cell
---
>        ! western edge of first grid cell
3134c2938
< !         lonw(1,j) = longxy(1,j) - dx/2.
---
>        !         lonw(1,j) = longxy(1,j) - dx/2.
3137c2941
< ! remaining grid cells
---
>        ! remaining grid cells
3143c2947
< ! set unused longitudes to non-valid number
---
>        ! set unused longitudes to non-valid number
3154c2958
< ! --------------------------------------------------------------------
---
>   ! --------------------------------------------------------------------
3165c2969
< ! --------------------------------------------------------------------
---
>     ! --------------------------------------------------------------------
3167,3174c2971,2978
< ! ------------------------ code history ------------------------------
< ! source file       : cellarea.F
< ! purpose           : area of grid cells (square kilometers)
< ! date first created: March 1996 - lsm version 1 (dataset generation code)
< ! by whom           : Gordon Bonan
< ! date last revised : December 1998 - lsm version 2
< ! by whom           : Gordon Bonan
< ! --------------------------------------------------------------------
---
>     ! ------------------------ code history ------------------------------
>     ! source file       : cellarea.F
>     ! purpose           : area of grid cells (square kilometers)
>     ! date first created: March 1996 - lsm version 1 (dataset generation code)
>     ! by whom           : Gordon Bonan
>     ! date last revised : December 1998 - lsm version 2
>     ! by whom           : Gordon Bonan
>     ! --------------------------------------------------------------------
3178c2982
< ! ------------------------ input variables ---------------------------
---
>     ! ------------------------ input variables ---------------------------
3188c2992
< ! --------------------------------------------------------------------
---
>     ! --------------------------------------------------------------------
3190c2994
< ! ------------------------ output variables --------------------------
---
>     ! ------------------------ output variables --------------------------
3192c2996
< ! --------------------------------------------------------------------
---
>     ! --------------------------------------------------------------------
3194c2998
< ! ------------------------ local variables ---------------------------
---
>     ! ------------------------ local variables ---------------------------
3203c3007
< ! --------------------------------------------------------------------
---
>     ! --------------------------------------------------------------------
3218,3219c3022,3023
< ! make sure total area from grid cells is same as area of grid
< ! as defined by its edges
---
>     ! make sure total area from grid cells is same as area of grid
>     ! as defined by its edges
3224c3028
< !
---
>     !
3235,3247d3038
<  INTEGER FUNCTION idx(xMax,yMax,x)
<   IMPLICIT NONE
<   INTEGER, INTENT(IN   ) :: xMax
<   INTEGER, INTENT(IN   ) :: yMax
<   INTEGER, INTENT(IN   ) :: x
<   REAL :: tag_alfa,a
< 
<   tag_alfa=REAL(yMax - 1 )/ REAL(xMax - 1)
<   ! x=1 ; y=1
<   a=1.0 - tag_alfa
<   idx = a + tag_alfa*x
<  END FUNCTION idx
< 
3249,3257c3040,3048
< !
< !    #    #    #     #     #####     #      ##    #
< !    #    ##   #     #       #       #     #  #   #
< !    #    # #  #     #       #       #    #    #  #
< !    #    #  # #     #       #       #    ######  #
< !    #    #   ##     #       #       #    #    #  #
< !    #    #    #     #       #       #    #    #  ######
< !
< ! ---------------------------------------------------------------------
---
>   !
>   !    #    #    #     #     #####     #      ##    #
>   !    #    ##   #     #       #       #     #  #   #
>   !    #    # #  #     #       #       #    #    #  #
>   !    #    #  # #     #       #       #    ######  #
>   !    #    #   ##     #       #       #    #    #  #
>   !    #    #    #     #       #       #    #    #  ######
>   !
>   ! ---------------------------------------------------------------------
3267,3269c3058,3063
<                           idatec   )! INTENT(IN   ))
< ! ---------------------------------------------------------------------
< !
---
>        idatec , &
>        fgtmp  , &
>        fgq    , & 
>        topoi   )! INTENT(IN   ))
>     ! ---------------------------------------------------------------------
>     !
3277c3071
<       INTEGER         , INTENT(IN   ) :: ibMaxPerJB(:)
---
>     INTEGER         , INTENT(IN   ) :: ibMaxPerJB(jbMax)
3279,3282c3073,3079
<       INTEGER         , INTENT(IN   ) :: idate(:)  
<       INTEGER         , INTENT(IN   ) :: idatec (:)! INTENT(IN  )
< !
< !
---
>     INTEGER         , INTENT(IN   ) :: idate(4)  
>     INTEGER         , INTENT(IN   ) :: idatec (4)! INTENT(IN  )
>     REAL(KIND=r8)   , INTENT(IN   ) :: fgtmp(ibMax,kMax,jbMax)
>     REAL(KIND=r8)   , INTENT(IN   ) :: fgq  (ibMax,kMax,jbMax)
>     REAL(KIND=r8)   , INTENT(IN   ) :: topoi(ibMax,jbMax)
>     !
>     !
3284c3081,3082
<         CALL coldstart (iMax   , &
---
>        CALL coldstart (&
>             iMax   , &
3295a3094,3095
>             fgtmp  , &! INTENT(IN        )
>             fgq    , &! INTENT(IN        )
3297a3098
>             tsnom   , &! INTENT(OUT  )
3302c3103,3105
<                         wisoi    )! INTENT(OUT  )
---
>             wisoi  , &! INTENT(OUT  )
>             wisoim    )! INTENT(OUT  )
> 
3304a3108,3117
>             iMax   , &
>             jMax   , &
>             kMax   , &
>             ibMax  , &
>             jbMax  , &
>             ifday  , &
>             ibMaxPerJB, &
>             tod    , &            
>             idate  , &
>             idatec , &! INTENT(IN        )
3307a3121
>             tsnom           ,&! INTENT(OUT  ) :: 
3313a3128
>             wisoim           ,&! INTENT(OUT  ) :: 
3370c3185,3187
<                       GDD            )! INTENT(IN   ) :: 
---
>             GDD             ,&! INTENT(IN   ) :: 
>             tcthis          ,&! INTENT(OUT  ) :: 
>             twthis           )! INTENT(OUT  ) :: 
3372,3374c3189,3191
< !
< ! initialize physical consts, dimensions, unit numbers, lsx model
< !
---
>     !
>     ! initialize physical consts, dimensions, unit numbers, lsx model
>     !
3375a3193,3198
>          jbMax                  , &! INTENT(IN   )
>          ibMax                  , &! INTENT(IN   )
>          kMax                   , &! INTENT(IN   )
>          ibMaxPerJB             , &! INTENT(IN   )
>          fgtmp                  , &! INTENT(IN   )
>          fgq                   , &! INTENT(IN   )
3381a3205
>          tum       , &! INTENT(OUT  ) :: tu      (npoi)         
3382a3207
>          tsm       , &! INTENT(OUT  ) :: tu      (npoi)         
3383a3209
>          tlm       , &! INTENT(OUT  ) :: tu      (npoi)         
3437a3264
>          wliqum    , &! INTENT(OUT  ) :: wliqu        (npoi)
3438a3266
>          wliqsm    , &! INTENT(OUT  ) :: wliqs        (npoi)
3439a3268
>          wliqlm    , &! INTENT(OUT  ) :: wliql        (npoi)
3440a3270
>          wsnoum    , &! INTENT(OUT  ) :: wsnou        (npoi)
3441a3272
>          wsnosm    , &! INTENT(OUT  ) :: wsnos        (npoi)
3442a3274
>          wsnolm    , &! INTENT(OUT  ) :: wsnol        (npoi)
3475,3477c3307,3309
< !
< ! initialize snow model
< !
---
>     !
>     ! initialize snow model
>     !
3488,3490c3320,3322
< !
< ! initialize soil model
< !
---
>     !
>     ! initialize soil model
>     !
3491a3324,3327
>          jbMax     , &! INTENT(IN   )
>          ibMax     , &! INTENT(IN   )
>          ibMaxPerJB, &! INTENT(IN   )
>          topoi     , &! INTENT(IN   )
3506a3343
>          wisoim     , &! INTENT(INOUT)
3509a3347
>          tsnom      , &! INTENT(INOUT)
3512a3351
>          tim        , &! INTENT(OUT  )
3525a3365
>          hsoi      , &! INTENT(OUT  )
3529,3531c3369,3371
< !
< ! initialize vegetation parameters
< !
---
>     !
>     ! initialize vegetation parameters
>     !
3588,3589c3428,3429
< 		   a10scalparamu, &! INTENT(OUT  )
< 		   a10scalparaml, &! INTENT(OUT  )
---
>          a10scalparamu   , &! INTENT(OUT  )
>          a10scalparaml   , &! INTENT(OUT  )
3604,3606c3444,3446
< !
< ! initialize variables for time averaging
< !
---
>     !
>     ! initialize variables for time averaging
>     !
3711,3713c3551,3553
< !
< ! return to main program
< !
---
>     !
>     ! return to main program
>     !
3716,3718c3556,3561
< ! ---------------------------------------------------------------------
<       SUBROUTINE restart (npft         ,fi           ,  &            
<                           tsno         ,hsno         ,tsoi         ,tsoim         , &
---
>   ! ---------------------------------------------------------------------
>   SUBROUTINE restart (&
>        iMax         ,jMax         ,kMax         ,ibMax       , &
>        jbMax        ,ifday        ,ibMaxPerJB   ,tod         , &
>        idate        ,idatec       ,npft         ,fi           ,  &
>        tsno         ,tsnom,hsno         ,tsoi         ,tsoim        , &
3720,3721c3563,3564
<                           wisoi        ,cbiol        ,adcbiol      , cbiow        , &
<                           adcbiow      ,cbior        ,adcbior      ,&
---
>        wisoi        ,wisoim       ,cbiol        ,adcbiol      , &
>        cbiow        ,adcbiow      ,cbior        ,adcbior      ,&
3735,3802c3578,3656
<                           TminU        ,Twarm        ,GDD          )
< ! ---------------------------------------------------------------------
< !
< ! reads in restart files, initializes some variables
< !
< ! this subroutine reads the restart values of:
< !
< !  fsnocov = fractional snow cover
< !  tsno    = temperature of snow
< !  hsno    = snow depth
< !  tsoi    = soil temperature
< !  wisoi   = soil ice content
< !  wsoi    = soil moisture content
< !  cbiol   = carbon in leaf biomass pool
< !  adcbiol   = carbon in leaf biomass pool
< !  cbiow   = carbon in woody biomass pool
< !  adcbiow   = carbon in woody biomass pool
< !  cbior   = carbon in fine root biomass pool
< !  adcbior   = carbon in fine root biomass pool
< !  sapfrac = sapwood fraction
< !  clitlm  = leaf metabolic litter
< !  clitls  = leaf structural litter
< !  clitll  = leaf lignin litter
< !  clitrm  = root metabolic litter
< !  clitrs  = root structural litter
< !  clitrl  = root lignin litter
< !  clitwm  = woody metabolic litter
< !  clitws  = woody structural litter
< !  clitwl  = woody lignin litter
< !  falll   = annual leaf litterfall 
< !  fallr   = annual fine root turnover(rotatividade)
< !  fallw   = annual woody turnover(rotatividade)
< !  totcmic = total microbial carbon
< !  csoislop= slow soil carbon, protected humus
< !  csoislon= slow soil carbon, nonprotected humus
< !  csoipas = passive soil carbon
< !  gdd0    = growing degree days 0
< !  gdd5    = growing degree days 5
< !  tc      = coldest monthly temperature
< !  tw      = warmest monthly temperature
< !  wipud   = ice content of puddles per soil area
< !  wpud    = liquid content of puddles per soil area
< !  agddu   = annual accumulated growing degree days for bud burst, upper canopy
< !  agddl   = annual accumulated growing degree days for bud burst, lower canopy
< !  tempu   = cold-phenology trigger for trees
< !  templ   = cold-phenology trigger for grasses/shrubs
< !  adnpp  = 10-day avg daily npp
< !  a10td    = 10-day avg daily temp
< !  a10ancub = 10-day average canopy photosynthesis rate - broadleaf
< !  a10ancuc = 10-day average canopy photosynthesis rate - conifer
< !  a10ancls = 10-day average canopy photosynthesis rate - shrubs
< !  a10ancl4 = 10-day average canopy photosynthesis rate - c4 grasses
< !  a10ancl3 = 10-day average canopy photosynthesis rate - c3 grasses
< !  a10scalparamu = 10-day average canopy scaling parameter - upper canopy
< !  a10scalparaml = 10-day average canopy scaling parameter - lower canopy
< !  a10daylightu = 10-day average daylight - upper canopy
< !  a10daylightl = 10-day average daylight - lower canopy
< !  dropu   = drought-phenology trigger for trees
< !  dropls  = drought-phenology trigger for shrubs
< !  dropl4  = drought-phenology trigger for c4 grasses
< !  dropl3  = drought-phenology trigger for c3 grasses
< ! (NOTE: a10ancuc is not used at this point, so its restart entry 
< ! is commented out)
< !
< !
< ! Arguments
< !
<       INTEGER, INTENT(IN   ) :: npft  	 
---
>        TminU        ,Twarm        ,GDD          ,tcthis       , &
>        twthis)
>     ! ---------------------------------------------------------------------
>     !
>     ! reads in restart files, initializes some variables
>     !
>     ! this subroutine reads the restart values of:
>     !
>     !  fsnocov = fractional snow cover
>     !  tsno    = temperature of snow
>     !  hsno    = snow depth
>     !  tsoi    = soil temperature
>     !  wisoi   = soil ice content
>     !  wsoi    = soil moisture content
>     !  cbiol   = carbon in leaf biomass pool
>     !  adcbiol   = carbon in leaf biomass pool
>     !  cbiow   = carbon in woody biomass pool
>     !  adcbiow   = carbon in woody biomass pool
>     !  cbior   = carbon in fine root biomass pool
>     !  adcbior   = carbon in fine root biomass pool
>     !  sapfrac = sapwood fraction
>     !  clitlm  = leaf metabolic litter
>     !  clitls  = leaf structural litter
>     !  clitll  = leaf lignin litter
>     !  clitrm  = root metabolic litter
>     !  clitrs  = root structural litter
>     !  clitrl  = root lignin litter
>     !  clitwm  = woody metabolic litter
>     !  clitws  = woody structural litter
>     !  clitwl  = woody lignin litter
>     !  falll   = annual leaf litterfall 
>     !  fallr   = annual fine root turnover
>     !  fallw   = annual woody turnover
>     !  totcmic = total microbial carbon
>     !  csoislop= slow soil carbon, protected humus
>     !  csoislon= slow soil carbon, nonprotected humus
>     !  csoipas = passive soil carbon
>     !  gdd0    = growing degree days 0
>     !  gdd5    = growing degree days 5
>     !  tc      = coldest monthly temperature
>     !  tw      = warmest monthly temperature
>     !  wipud   = ice content of puddles per soil area
>     !  wpud    = liquid content of puddles per soil area
>     !  agddu   = annual accumulated growing degree days for bud burst, upper canopy
>     !  agddl   = annual accumulated growing degree days for bud burst, lower canopy
>     !  tempu   = cold-phenology trigger for trees
>     !  templ   = cold-phenology trigger for grasses/shrubs
>     !  adnpp  = 10-day avg daily npp
>     !  a10td    = 10-day avg daily temp
>     !  a10ancub = 10-day average canopy photosynthesis rate - broadleaf
>     !  a10ancuc = 10-day average canopy photosynthesis rate - conifer
>     !  a10ancls = 10-day average canopy photosynthesis rate - shrubs
>     !  a10ancl4 = 10-day average canopy photosynthesis rate - c4 grasses
>     !  a10ancl3 = 10-day average canopy photosynthesis rate - c3 grasses
>     !  a10scalparamu = 10-day average canopy scaling parameter - upper canopy
>     !  a10scalparaml = 10-day average canopy scaling parameter - lower canopy
>     !  a10daylightu = 10-day average daylight - upper canopy
>     !  a10daylightl = 10-day average daylight - lower canopy
>     !  dropu   = drought-phenology trigger for trees
>     !  dropls  = drought-phenology trigger for shrubs
>     !  dropl4  = drought-phenology trigger for c4 grasses
>     !  dropl3  = drought-phenology trigger for c3 grasses
>     ! (NOTE: a10ancuc is not used at this point, so its restart entry 
>     ! is commented out)
>     !
>     !
>     ! Arguments
>     !
>     INTEGER         , INTENT(IN   ) :: iMax  
>     INTEGER         , INTENT(IN   ) :: jMax  
>     INTEGER         , INTENT(IN   ) :: kMax  
>     INTEGER         , INTENT(IN   ) :: ibMax 
>     INTEGER         , INTENT(IN   ) :: jbMax 
>     INTEGER         , INTENT(IN   ) :: ifday 
>     INTEGER         , INTENT(IN   ) :: ibMaxPerJB(jbMax)
>     REAL(KIND=r8)   , INTENT(IN   ) :: tod    
>     INTEGER         , INTENT(IN   ) :: idate(4)  
>     INTEGER         , INTENT(IN   ) :: idatec(4) ! INTENT(IN  )
>     INTEGER         , INTENT(IN   ) :: npft           
3804a3659
>     REAL(KIND=r8)   , INTENT(OUT  ) :: tsnom         (ibMax,nsnolay,jbMax)! temperature of snow layers (K)
3810a3666
>     REAL(KIND=r8)   , INTENT(OUT  ) :: wisoim       (ibMax,nsoilay,jbMax)! fraction of soil pore space containing ice
3878,3886c3734,3748
< !
< ! Local variables
< !
< !
< !
<       integer  :: i,j,nLndPts
< !
< ! ---------------------------------------------------------------------
< !
---
>     REAL(KIND=r8)   , INTENT(OUT  ) :: tcthis       (ibMax,jbMax)
>     REAL(KIND=r8)   , INTENT(OUT  ) :: twthis       (ibMax,jbMax)    
>     REAL(KIND=r8)   , PARAMETER     :: t0 =271.17_r8
>     REAL(KIND=r4) ::   brf (iMax,jMax)
>     REAL(KIND=r8) ::   buf (iMax,jMax,4)
> 
>     !
>     ! Local variables
>     !
>     !
>     !
>     INTEGER  :: i,j,jb,nLndPts,ierr,LRecIN
>     !
>     ! ---------------------------------------------------------------------
>     !
3906,3907c3768,3769
<       READ(UNIT=nfsibi)totanlit,totanlit_p
<       READ(UNIT=nfsibi)totrnlit,totrnlit_p
---
>     READ(UNIT=nfsibi)totanlit, totanlit_p
>     READ(UNIT=nfsibi)totrnlit, totrnlit_p
3911c3773
<       READ(UNIT=nfsibi)totnsoi,totnsoi_p
---
>     READ(UNIT=nfsibi)totnsoi ,totnsoi_p
3923,3926c3785,3789
< 
< !
< !  daily average variables 
< !
---
>     READ(UNIT=nfsibi)tcthis
>     READ(UNIT=nfsibi)twthis
>     !
>     !  daily average variables 
>     !
3955,3957c3818,3820
< !
< !  monthly average variables 
< !
---
>     !
>     !  monthly average variables 
>     !
3997,3999c3860,3862
< !
< !  annual total variables 
< !
---
>     !
>     !  annual total variables 
>     !
4040d3902
<       
4061,4072c3923,3936
<       READ(UNIT=nfsibi)wliqu
<       READ(UNIT=nfsibi)wliqs
<       READ(UNIT=nfsibi)wliql
<       READ(UNIT=nfsibi)wsnou
<       READ(UNIT=nfsibi)wsnos
<       READ(UNIT=nfsibi)wsnol
<                   
<       READ(UNIT=nfsibi)fi,fu,fl,tu,ts,tl,tg,ti
< 
< !
< ! nsnolay variables: tsno and hsno
< !
---
>     READ(UNIT=nfsibi)wliqum,wliqu,wliqu0
>     READ(UNIT=nfsibi)wliqsm,wliqs,wliqs0
>     READ(UNIT=nfsibi)wliqlm,wliql,wliql0
>     READ(UNIT=nfsibi)wsnoum,wsnou,wsnou0
>     READ(UNIT=nfsibi)wsnosm,wsnos,wsnos0
>     READ(UNIT=nfsibi)wsnolm,wsnol,wsnol0
>     READ(UNIT=nfsibi)tum,tu,tu0
>     READ(UNIT=nfsibi)tsm,ts,ts0
>     READ(UNIT=nfsibi)tlm,tl,tl0
>     READ(UNIT=nfsibi)tim,ti,ti0
>     READ(UNIT=nfsibi)fi,fu,fl,tg
>     !
>     ! nsnolay variables: tsno and hsno
>     !
4074,4075c3938,3939
< !
<       READ(UNIT=nfsibi)tsno
---
>     !
>     READ(UNIT=nfsibi)tsnom,tsno,tsno0
4079,4081c3943,3945
< !
< ! nsoilay variables: tsoi, wisoi, wsoi
< !
---
>     !
>     ! nsoilay variables: tsoi, wisoi, wsoi
>     !
4083c3947
<       READ(UNIT=nfsibi)tsoim,tsoi
---
>     READ(UNIT=nfsibi)tsoim,tsoi,tsoi0
4085c3949
<       READ(UNIT=nfsibi)wisoi
---
>     READ(UNIT=nfsibi)wisoim,wisoi,wisoi0
4087c3951
<       READ(UNIT=nfsibi)wsoim,wsoi
---
>     READ(UNIT=nfsibi)wsoim,wsoi,wsoi0
4089,4091c3953,3955
< !
< ! npft variables
< !
---
>     !
>     ! npft variables
>     !
4105,4107c3969,3971
< !
< ! single level variables
< !
---
>     !
>     ! single level variables
>     !
4208c4072
<       READ(UNIT=nfsibi)  ppli,ppci
---
>     READ(UNIT=nfsibi)  ppli,ppci,snow
4210c4074,4075
<       READ(UNIT=nfsibi) gl0 ,zorl,gtsea,tseam,qsfc0,tsfc0,qsfcm,tsfcm,tkemyj
---
>     READ(UNIT=nfsibi) gl0 ,zorl,gtsea,gco2flx,tseam,qsfc0,tsfc0,qsfcm,tsfcm,tkemyj,HML,HUML,HVML,TSK,z0sea,&
>       TC_SeaIce,TGS_SeaIce,TD_SeaIce,TA_SeaIce,SNOA_SeaIce,SNOB_SeaIce,cflxm
4234c4099,4105
<       READ(UNIT=nfsibi) vegtype0,froot
---
>     READ(UNIT=nfsibi) vegtype0,froot,csoi
>     
>     READ(UNIT=nfsibi) PBL_CoefKm, PBL_CoefKh,tauresx,tauresy,sheleg,poda,tmin2m   ,tmax2m 
> 
>     READ(UNIT=nfsibi)  laymld,       hbath,     tdeep,sdeep
> 
>     REWIND nfsibi
4237,4246c4108,4165
<       RETURN
< !
< ! calculate tcmin
< !
<       DO j = 1,jbMax
<          nLndPts=0
<          DO i = 1, ibMax
<             IF (iMaskIBIS(i,j) >= 1) THEN
< 	       nLndPts=nLndPts+1
<                tcmin(nLndPts,j) = tc(nLndPts,j) + deltat(nLndPts,j)
---
> 
> 
>     CLOSE(nftgz0)
>     brf=0.0_r4
>     INQUIRE (IOLENGTH=LRecIN) brf
>     OPEN (UNIT=nftgz0,FILE=TRIM(fNameTg3zrl), FORM='UNFORMATTED', ACCESS='DIRECT', RECL=LRecIN, &
>          ACTION='read', STATUS='OLD', IOSTAT=ierr) 
>     IF (ierr /= 0) THEN
>        WRITE(UNIT=nfprt,FMT="('**(ERROR)** Open file ',a,' returned iostat=',i4)") &
>             TRIM(fNameTg3zrl), ierr
>        STOP "**(ERROR)**"
>     END IF
>     CLOSE(nfzol)
>     buf=0.0_r8
>     INQUIRE (IOLENGTH=LRecIN) brf
>     OPEN (UNIT=nfzol,FILE=TRIM(fNameRouLen),FORM='UNFORMATTED', ACCESS='DIRECT', RECL=LRecIN, &
>          ACTION='READ', STATUS='OLD', IOSTAT=ierr)
>     IF (ierr /= 0) THEN
>        WRITE(UNIT=nfprt,FMT="('**(ERROR)** Open file ',a,' returned iostat=',i4)") &
>             TRIM(fNameRouLen), ierr
>        STOP "**(ERROR)**"
>     END IF
> 
>     IF (initlz < 0 .AND. initlz >= -3 )THEN
>        IF(initlz == -2 .or. initlz == -3 )ifsst=-1
>        IF(ifco2flx == -2 .or. ifco2flx == -3 )ifco2flx=-1
>        CALL getsbc (iMax ,jMax  ,kMax, AlbVisDiff,gtsea,gco2flx,gndvi,soilm,sheleg,o3mix,tracermix,wsib3d,&
> !tar begin 
> !climate aerosol parameters of coarse mode
>          aod,asy,ssa,z_aer,ifaeros,&
> !tar end
> !
> !tar begin 
> !climate aerosol parameters of fine mode
>          aodF,asyF,ssaF,z_aerF,&
> !tar end
>          ifday , tod  ,idate ,idatec,&
>          ifalb,ifsst,ifco2flx,ifndvi,ifslm ,ifslmSib2,ifsnw,ifozone,iftracer, &
>          sstlag,intsst,intndvi,intsoilm,fint ,tice  , &
>          yrl22 ,monl,ibMax,jbMax,ibMaxPerJB)
>        IF( initlz == -2  .or. initlz == -3 ) THEN
>           !$OMP PARALLEL DO PRIVATE(i)
>            DO j=1,jbMax
>               DO i=1,ibMaxPerJB(j)
>                  IF(iMaskIBIS(i,j) >= 1_i8) gtsea(i,j)=290.0_r8
>                  IF(iMaskIBIS(i,j) >= 1_i8) gco2flx(i,j)=0.0_r8
> !                 tseam(i,j) = gtsea(i,j)
>                  TSK  (I,J) = ABS(gtsea(i,j))
>                  IF (omlmodel) THEN
>                    HML  (i,j) = oml_hml0 - 13.5_r8*log(MAX(ABS(TSK(i,j))-tice+0.01_r8,1.0_r8))
>                    HUML (I,J)=0.0_r8
>                    HVML (I,J)=0.0_r8
>                  END IF
>                  IF(iMaskIBIS(i,j) == 0_i8) THEN
>                     IF(-gtsea(i,j) .LT. t0) THEN
>                        iMaskIBIS(i,j)=-1_i8
>                        iMask(i,j)=-1_i8
>                     END IF
4250,4252c4169,4189
< !
<       CALL existence(TminL, &
<                      TminU, &
---
>            !$OMP END PARALLEL DO
>        END IF
>     END IF
> 
> 
>     RETURN
>     !
>     ! calculate tcmin
>     !
>     DO j = 1,jbMax
>        nLndPts=0
>        DO i = 1, ibMax
>           IF (iMaskIBIS(i,j) >= 1_i8) THEN
>              nLndPts=nLndPts+1
>              tcmin(nLndPts,j) = tc(nLndPts,j) + deltat(nLndPts,j)
>           END IF
>        END DO
>     END DO
>     !
>     CALL existence(TminL, &
>          TminU, &
4261c4198
< !
---
>     !
4264,4266c4201,4203
< !
< !
< ! ---------------------------------------------------------------------
---
>   !
>   !
>   ! ---------------------------------------------------------------------
4277,4301c4214,4238
< ! ---------------------------------------------------------------------
< !
< ! this routine determines which plant functional types (pft's) are allowed
< ! to exist in each gridcell, based on a simple set of climatic criteria
< !
< ! the logic here is based on the biome3 model of haxeltine and prentice
< !
< ! plant functional types:
< !
< ! 1)  tropical broadleaf evergreen trees
< ! 2)  tropical broadleaf drought-deciduous trees
< ! 3)  warm-temperate broadleaf evergreen trees
< ! 4)  temperate conifer evergreen trees
< ! 5)  temperate broadleaf cold-deciduous trees
< ! 6)  boREAL(KIND=r8) conifer evergreen trees
< ! 7)  boREAL(KIND=r8) broadleaf cold-deciduous trees
< ! 8)  boREAL(KIND=r8) conifer cold-deciduous trees
< ! 9)  evergreen shrubs
< ! 10) deciduous shrubs
< ! 11) warm (c4) grasses
< ! 12) cool (c3) grasses
< !
< !
< ! common blocks
< !
---
>     ! ---------------------------------------------------------------------
>     !
>     ! this routine determines which plant functional types (pft's) are allowed
>     ! to exist in each gridcell, based on a simple set of climatic criteria
>     !
>     ! the logic here is based on the biome3 model of haxeltine and prentice
>     !
>     ! plant functional types:
>     !
>     ! 1)  tropical broadleaf evergreen trees
>     ! 2)  tropical broadleaf drought-deciduous trees
>     ! 3)  warm-temperate broadleaf evergreen trees
>     ! 4)  temperate conifer evergreen trees
>     ! 5)  temperate broadleaf cold-deciduous trees
>     ! 6)  boREAL(KIND=r8) conifer evergreen trees
>     ! 7)  boREAL(KIND=r8) broadleaf cold-deciduous trees
>     ! 8)  boREAL(KIND=r8) conifer cold-deciduous trees
>     ! 9)  evergreen shrubs
>     ! 10) deciduous shrubs
>     ! 11) warm (c4) grasses
>     ! 12) cool (c3) grasses
>     !
>     !
>     ! common blocks
>     !
4303c4240
< !
---
>     !
4317,4319c4254,4256
< !
< ! Local variables
< !
---
>     !
>     ! Local variables
>     !
4321,4323c4258,4260
< !
< ! ---------------------------------------------------------------------
< !
---
>     !
>     ! ---------------------------------------------------------------------
>     !
4327c4264
<             IF (iMaskIBIS(i,j) >= 1) THEN
---
>           IF (iMaskIBIS(i,j) >= 1_i8) THEN
4329,4331c4266,4268
< !
< ! determine which plant types can exist in a given gridcell
< !
---
>              !
>              ! determine which plant types can exist in a given gridcell
>              !
4344,4458c4281,4395
< !
< ! 1) tropical broadleaf evergreen trees
< !
< !  - tcmin > 0.0
< !
< !        IF (tcmin(i).gt.0.0_r8)           exist(i,1) = 1.0_r8
< !
< ! 2) tropical broadleaf drought-deciduous trees
< !
< !  - tcmin > 0.0_r8
< !
< !        IF (tcmin(i).gt.0.0_r8)           exist(i,2) = 1.0_r8
< !
< ! 3) warm-temperate broadleaf evergreen trees
< !
< !  - tcmin <   0.0_r8 and
< !  - tcmin > -10.0_r8
< !
< !        IF ((tcmin(i).lt.0.0_r8).and. &
< !           (tcmin(i).gt.-10.0_r8))       exist(i,3) = 1.0_r8
< !
< ! 4) temperate conifer evergreen trees
< !
< !  - tcmin <    0.0_r8 and
< !  - tcmin >  -45.0_r8 and
< !  - gdd5  > 1200.0_r8
< !
< !        IF ((tcmin(i).lt.0.0_r8).and. &
< !           (tcmin(i).gt.-45.0_r8).and. &
< !           (gdd5(i).gt.1200.0_r8))       exist(i,4) = 1.0_r8
< !
< ! 5) temperate broadleaf cold-deciduous trees
< !
< !  - tcmin <    0.0 and
< !  - tcmin >  -45.0 and
< !  - gdd5  > 1200.0
< !
< !        IF ((tcmin(i).lt.0.0_r8).and.   &
< !           (tcmin(i).gt.-45.0_r8).and.  &
< !           (gdd5(i).gt.1200.0_r8))       exist(i,5) = 1.0_r8
< !
< ! 6) boREAL(KIND=r8) conifer evergreen trees
< !
< !  - tcmin <  -45.0_r8 or gdd5 < 1200.0_r8, and
< !  - tcmin >  -57.5_r8 and
< !  - gdd5  >  350.0_r8
< !
< !        IF (((tcmin(i).lt.-45.0_r8).or.(gdd5(i).lt.1200.0_r8)).and. &
< !            (tcmin(i).gt.-57.5_r8).and. &
< !            (gdd5(i).gt.350.0_r8))       exist(i,6) = 1.0_r8
< !
< ! 7) boREAL(KIND=r8) broadleaf cold-deciduous trees
< !
< !  - tcmin <  -45.0 or gdd5 < 1200.0, and
< !  - tcmin >  -57.5 and
< !  - gdd5  >  350.0
< !
< !        IF (((tcmin(i).lt.-45.0_r8).or.(gdd5(i).lt.1200.0_r8)).and. &
< !            (tcmin(i).gt.-57.5_r8).and. &
< !            (gdd5(i).gt.350.0_r8))       exist(i,7) = 1.0_r8
< !
< ! 8) boREAL(KIND=r8) conifer cold-deciduous trees
< !
< !  - tcmin <  -45.0 or gdd5 < 1200.0, and
< !  - gdd5  >  350.0
< !
< !        IF (((tcmin(i).lt.-45.0_r8).or.(gdd5(i).lt.1200.0_r8)).and. &
< !            (gdd5(i).gt.350.0_r8))       exist(i,8) = 1.0_r8
< !
< ! 9) evergreen shrubs
< !
< !  - gdd0 > 100.0
< !
< !        IF (gdd0(i).gt.100.0_r8)          exist(i,9) = 1.0_r8
< !
< ! 10) deciduous shrubs
< !
< !  - gdd0 > 100.0
< !
< !        IF (gdd0(i).gt.100.0_r8)          exist(i,10) = 1.0_r8
< !
< ! 11) warm (c4) grasses
< !
< !  - tw   >  22.0 and
< !  - gdd0 > 100.0
< !
< !        IF ((tw(i).gt.22.0_r8).and. &
< !            (gdd0(i).gt.100.0_r8))        exist(i,11) = 1.0_r8
< !
< ! 12) cool (c3) grasses
< !
< !  - gdd0 > 100.0
< !
< !        IF (gdd0(i).gt.100.0_r8)          exist(i,12) = 1.0_r8
< !
< !
< !*** DTP 2001/06/07: Modified version of above code reads in PFT
< !    existence criteria from external parameter file "params.veg"
< !    These are copied here for reference.... 
< !------------------------------------------------------------------
< !  TminL    TminU    Twarm    GDD    PFT
< !------------------------------------------------------------------
< !    0.0   9999.0   9999.0   9999  !   1
< !    0.0   9999.0   9999.0   9999  !   2
< !  -10.0      0.0   9999.0   9999  !   3
< !  -45.0      0.0   9999.0   1200  !   4
< !  -45.0      0.0   9999.0   1200  !   5
< !  -57.5    -45.0   9999.0    350  !   6
< !  -57.5    -45.0   9999.0    350  !   7
< ! 9999.0    -45.0   9999.0    350  !   8
< ! 9999.0   9999.0   9999.0    100  !   9
< ! 9999.0   9999.0   9999.0    100  !  10
< ! 9999.0   9999.0     22.0    100  !  11
< ! 9999.0   9999.0   9999.0    100  !  12
< !------------------------------------------------------------------
---
>              !
>              ! 1) tropical broadleaf evergreen trees
>              !
>              !  - tcmin > 0.0
>              !
>              !        IF (tcmin(i).gt.0.0_r8)           exist(i,1) = 1.0_r8
>              !
>              ! 2) tropical broadleaf drought-deciduous trees
>              !
>              !  - tcmin > 0.0_r8
>              !
>              !        IF (tcmin(i).gt.0.0_r8)           exist(i,2) = 1.0_r8
>              !
>              ! 3) warm-temperate broadleaf evergreen trees
>              !
>              !  - tcmin <   0.0_r8 and
>              !  - tcmin > -10.0_r8
>              !
>              !        IF ((tcmin(i).lt.0.0_r8).and. &
>              !           (tcmin(i).gt.-10.0_r8))       exist(i,3) = 1.0_r8
>              !
>              ! 4) temperate conifer evergreen trees
>              !
>              !  - tcmin <    0.0_r8 and
>              !  - tcmin >  -45.0_r8 and
>              !  - gdd5  > 1200.0_r8
>              !
>              !        IF ((tcmin(i).lt.0.0_r8).and. &
>              !           (tcmin(i).gt.-45.0_r8).and. &
>              !           (gdd5(i).gt.1200.0_r8))       exist(i,4) = 1.0_r8
>              !
>              ! 5) temperate broadleaf cold-deciduous trees
>              !
>              !  - tcmin <    0.0 and
>              !  - tcmin >  -45.0 and
>              !  - gdd5  > 1200.0
>              !
>              !        IF ((tcmin(i).lt.0.0_r8).and.   &
>              !           (tcmin(i).gt.-45.0_r8).and.  &
>              !           (gdd5(i).gt.1200.0_r8))       exist(i,5) = 1.0_r8
>              !
>              ! 6) boREAL(KIND=r8) conifer evergreen trees
>              !
>              !  - tcmin <  -45.0_r8 or gdd5 < 1200.0_r8, and
>              !  - tcmin >  -57.5_r8 and
>              !  - gdd5  >  350.0_r8
>              !
>              !        IF (((tcmin(i).lt.-45.0_r8).or.(gdd5(i).lt.1200.0_r8)).and. &
>              !            (tcmin(i).gt.-57.5_r8).and. &
>              !            (gdd5(i).gt.350.0_r8))       exist(i,6) = 1.0_r8
>              !
>              ! 7) boREAL(KIND=r8) broadleaf cold-deciduous trees
>              !
>              !  - tcmin <  -45.0 or gdd5 < 1200.0, and
>              !  - tcmin >  -57.5 and
>              !  - gdd5  >  350.0
>              !
>              !        IF (((tcmin(i).lt.-45.0_r8).or.(gdd5(i).lt.1200.0_r8)).and. &
>              !            (tcmin(i).gt.-57.5_r8).and. &
>              !            (gdd5(i).gt.350.0_r8))       exist(i,7) = 1.0_r8
>              !
>              ! 8) boREAL(KIND=r8) conifer cold-deciduous trees
>              !
>              !  - tcmin <  -45.0 or gdd5 < 1200.0, and
>              !  - gdd5  >  350.0
>              !
>              !        IF (((tcmin(i).lt.-45.0_r8).or.(gdd5(i).lt.1200.0_r8)).and. &
>              !            (gdd5(i).gt.350.0_r8))       exist(i,8) = 1.0_r8
>              !
>              ! 9) evergreen shrubs
>              !
>              !  - gdd0 > 100.0
>              !
>              !        IF (gdd0(i).gt.100.0_r8)          exist(i,9) = 1.0_r8
>              !
>              ! 10) deciduous shrubs
>              !
>              !  - gdd0 > 100.0
>              !
>              !        IF (gdd0(i).gt.100.0_r8)          exist(i,10) = 1.0_r8
>              !
>              ! 11) warm (c4) grasses
>              !
>              !  - tw   >  22.0 and
>              !  - gdd0 > 100.0
>              !
>              !        IF ((tw(i).gt.22.0_r8).and. &
>              !            (gdd0(i).gt.100.0_r8))        exist(i,11) = 1.0_r8
>              !
>              ! 12) cool (c3) grasses
>              !
>              !  - gdd0 > 100.0
>              !
>              !        IF (gdd0(i).gt.100.0_r8)          exist(i,12) = 1.0_r8
>              !
>              !
>              !*** DTP 2001/06/07: Modified version of above code reads in PFT
>              !    existence criteria from external parameter file "params.veg"
>              !    These are copied here for reference.... 
>              !------------------------------------------------------------------
>              !  TminL    TminU    Twarm    GDD    PFT
>              !------------------------------------------------------------------
>              !    0.0   9999.0   9999.0   9999  !   1
>              !    0.0   9999.0   9999.0   9999  !   2
>              !  -10.0      0.0   9999.0   9999  !   3
>              !  -45.0      0.0   9999.0   1200  !   4
>              !  -45.0      0.0   9999.0   1200  !   5
>              !  -57.5    -45.0   9999.0    350  !   6
>              !  -57.5    -45.0   9999.0    350  !   7
>              ! 9999.0    -45.0   9999.0    350  !   8
>              ! 9999.0   9999.0   9999.0    100  !   9
>              ! 9999.0   9999.0   9999.0    100  !  10
>              ! 9999.0   9999.0     22.0    100  !  11
>              ! 9999.0   9999.0   9999.0    100  !  12
>              !------------------------------------------------------------------
4460,4463c4397,4400
< ! 1) tropical broadleaf evergreen trees
< !
< !  - tcmin > 0.0
< !
---
>              ! 1) tropical broadleaf evergreen trees
>              !
>              !  - tcmin > 0.0
>              !
4465,4469c4402,4406
< !
< ! 2) tropical broadleaf drought-deciduous trees
< !
< !  - tcmin > 0.0
< !
---
>              !
>              ! 2) tropical broadleaf drought-deciduous trees
>              !
>              !  - tcmin > 0.0
>              !
4471,4476c4408,4413
< !
< ! 3) warm-temperate broadleaf evergreen trees
< !
< !  - tcmin <   0.0 and
< !  - tcmin > -10.0
< !
---
>              !
>              ! 3) warm-temperate broadleaf evergreen trees
>              !
>              !  - tcmin <   0.0 and
>              !  - tcmin > -10.0
>              !
4479,4485c4416,4422
< !
< ! 4) temperate conifer evergreen trees
< !
< !  - tcmin <    0.0 and
< !  - tcmin >  -45.0 and
< !  - gdd5  > 1200.0
< !
---
>              !
>              ! 4) temperate conifer evergreen trees
>              !
>              !  - tcmin <    0.0 and
>              !  - tcmin >  -45.0 and
>              !  - gdd5  > 1200.0
>              !
4489,4495c4426,4432
< !
< ! 5) temperate broadleaf cold-deciduous trees
< !
< !  - tcmin <    0.0 and
< !  - tcmin >  -45.0 and
< !  - gdd5  > 1200.0
< !
---
>              !
>              ! 5) temperate broadleaf cold-deciduous trees
>              !
>              !  - tcmin <    0.0 and
>              !  - tcmin >  -45.0 and
>              !  - gdd5  > 1200.0
>              !
4499,4505c4436,4442
< !
< ! 6) boreal conifer evergreen trees
< !
< !  - tcmin <  -45.0 or gdd5 < 1200.0, and
< !  - tcmin >  -57.5 and
< !  - gdd5  >  350.0
< !
---
>              !
>              ! 6) boreal conifer evergreen trees
>              !
>              !  - tcmin <  -45.0 or gdd5 < 1200.0, and
>              !  - tcmin >  -57.5 and
>              !  - gdd5  >  350.0
>              !
4510,4516c4447,4453
< !
< ! 7) boreal broadleaf cold-deciduous trees
< !
< !  - tcmin <  -45.0 or gdd5 < 1200.0, and
< !  - tcmin >  -57.5 and
< !  - gdd5  >  350.0
< !
---
>              !
>              ! 7) boreal broadleaf cold-deciduous trees
>              !
>              !  - tcmin <  -45.0 or gdd5 < 1200.0, and
>              !  - tcmin >  -57.5 and
>              !  - gdd5  >  350.0
>              !
4521,4526c4458,4463
< !
< ! 8) boreal conifer cold-deciduous trees
< !
< !  - tcmin <  -45.0 or gdd5 < 1200.0, and
< !  - gdd5  >  350.0
< !
---
>              !
>              ! 8) boreal conifer cold-deciduous trees
>              !
>              !  - tcmin <  -45.0 or gdd5 < 1200.0, and
>              !  - gdd5  >  350.0
>              !
4530,4534c4467,4471
< !
< ! 9) evergreen shrubs
< !
< !  - gdd0 > 100.0
< !
---
>              !
>              ! 9) evergreen shrubs
>              !
>              !  - gdd0 > 100.0
>              !
4536,4540c4473,4477
< !
< ! 10) deciduous shrubs
< !
< !  - gdd0 > 100.0
< !
---
>              !
>              ! 10) deciduous shrubs
>              !
>              !  - gdd0 > 100.0
>              !
4542,4547c4479,4484
< !
< ! 11) warm (c4) grasses
< !
< !  - tw   >  22.0 and
< !  - gdd0 > 100.0
< !
---
>              !
>              ! 11) warm (c4) grasses
>              !
>              !  - tw   >  22.0 and
>              !  - gdd0 > 100.0
>              !
4550,4554c4487,4491
< !
< ! 12) cool (c3) grasses
< !
< !  - gdd0 > 100.0
< !
---
>              !
>              ! 12) cool (c3) grasses
>              !
>              !  - gdd0 > 100.0
>              !
4560c4497
< !
---
>     !
4564,4565c4501,4503
< ! ---------------------------------------------------------------------
<       SUBROUTINE coldstart(iMax   , &
---
>   ! ---------------------------------------------------------------------
>   SUBROUTINE coldstart( &
>        iMax   , &
4576a4515,4516
>        fgtmp  , &! INTENT(IN        )
>        fgq    , &! INTENT(IN        )
4578a4519
>        tsnom   , &! INTENT(OUT  )
4583,4585c4524,4527
< 			   wisoi    )! INTENT(OUT  )
< ! ---------------------------------------------------------------------
< !  
---
>        wisoi  , &! INTENT(OUT  )
>        wisoim    )! INTENT(OUT  )
>     ! ---------------------------------------------------------------------
>     !  
4587c4529
< !
---
>     !
4594c4536
<       INTEGER         , INTENT(IN   ) :: ibMaxPerJB(:)
---
>     INTEGER         , INTENT(IN   ) :: ibMaxPerJB(jbMax)
4596,4597c4538,4539
<       INTEGER         , INTENT(IN   ) :: idate(:)  
<       INTEGER         , INTENT(IN   ) :: idatec(:) ! INTENT(IN  )
---
>     INTEGER         , INTENT(IN   ) :: idate(4)  
>     INTEGER         , INTENT(IN   ) :: idatec(4) ! INTENT(IN  )
4599a4542,4543
>     REAL(KIND=r8)   , INTENT(IN   ) :: fgtmp  (ibMax,kMax,jbMax)
>     REAL(KIND=r8)   , INTENT(IN   ) :: fgq    (ibMax,kMax,jbMax)
4601a4546
>     REAL(KIND=r8)   , INTENT(OUT  ) :: tsnom   (ibMax,nsnolay,jbMax)! temperature of snow layers (K)
4606a4552
>     REAL(KIND=r8)   , INTENT(OUT  ) :: wisoim  (ibMax,nsoilay,jbMax)! fraction of soil pore space containing ice
4616d4561
<       IF(.NOT.UNDIMENSION)THEN
4618a4564
>     brf=0.0_r4
4628c4574,4575
<          INQUIRE (IOLENGTH=LRecIN) buf
---
>     buf=0.0_r8
>     INQUIRE (IOLENGTH=LRecIN) brf
4637,4645c4584,4598
< !      CALL getsbc (iMax ,jMax  ,AlbVisDiff,gtsea,gndvi,soilm,sheleg,o3mix,wsib3d,&
< !               ifday , tod  ,idate ,idatec, &
< !               ifalb,ifsst,ifndvi,ifslm ,ifslmSib2,ifsnw,ifozone, &
< !               sstlag,intsst,intndvi,fint ,tice  , &
< !               yrl22  ,monl,ibMax,jbMax,ibMaxPerJB)
< 
<          CALL getsbc &
< 	      (iMax,jMax,ibMax,jbMax,ibMaxPerJB,idate,idatec,tod,ifday,ifsst,&
<                          ifslm,nfslm,nfslmtp,intsst,nfprt,nfctrl,fNameSoilms,fNameSoilmsWkl,reducedGrid,fint,soilm,wsib3d)
---
>     CALL getsbc (iMax ,jMax  ,kMax, AlbVisDiff,gtsea,gco2flx,gndvi,soilm,sheleg,o3mix,tracermix,wsib3d,&
> !tar begin  
> !climate aerosol parameters of coarse mode
>          aod,asy,ssa,z_aer,ifaeros,&
> !tar end
> !
> !tar begin  
> !climate aerosol parameters of fine mode
>          aodF,asyF,ssaF,z_aerF,&
> !tar end 
>          ifday , tod  ,idate ,idatec, &
>          ifalb,ifsst,ifco2flx,ifndvi,ifslm ,ifslmSib2,ifsnw,ifozone,iftracer, &
>          sstlag,intsst,intndvi,intsoilm,fint ,tice  , &
>          yrl22  ,monl,ibMax,jbMax,ibMaxPerJB)
> 
4647c4600
<          CALL ReadGetNFTGZ(nftgz0,irec,buf(:,:,1),buf(:,:,2),buf(:,:,3))
---
>     CALL ReadGetNFTGZ(nftgz0,irec,buf(1:iMax,1:jMax,1),buf(1:iMax,1:jMax,2),buf(1:iMax,1:jMax,3))
4653c4606,4607
<             CALL AveBoxIJtoIBJB(buf(:,:,1),tg1)
---
>              CALL LinearIJtoIBJB(buf(1:iMax,1:jMax,1),tg1)
>             !CALL AveBoxIJtoIBJB(buf(1:iMax,1:jMax,1),tg1)
4655c4609
<             CALL IJtoIBJB(buf(:,:,1) ,tg1 )
---
>        CALL IJtoIBJB(buf(1:iMax,1:jMax,1) ,tg1 )
4657d4610
< 
4659c4612,4613
<             CALL AveBoxIJtoIBJB(buf(:,:,2) ,tg2)
---
>             CALL LinearIJtoIBJB(buf(1:iMax,1:jMax,2),tg2)
>             !CALL AveBoxIJtoIBJB(buf(1:iMax,1:jMax,2),tg2)
4661c4615
<             CALL IJtoIBJB(buf(:,:,2) ,tg2 )
---
>        CALL IJtoIBJB(buf(1:iMax,1:jMax,2) ,tg2 )
4663d4616
< 
4665c4618,4619
<             CALL AveBoxIJtoIBJB(buf(:,:,3) ,tg3)
---
>              CALL LinearIJtoIBJB(buf(1:iMax,1:jMax,3),tg3)
>             !CALL AveBoxIJtoIBJB(buf(1:iMax,1:jMax,3),tg3)
4667c4621
<             CALL IJtoIBJB(buf(:,:,3) ,tg3 )
---
>        CALL IJtoIBJB(buf(1:iMax,1:jMax,3) ,tg3 )
4669d4622
<  
4671c4624,4625
<             CALL AveBoxIJtoIBJB(buf(:,:,4),zorl)
---
>             CALL LinearIJtoIBJB(buf(1:iMax,1:jMax,4),zorl)
>             !CALL AveBoxIJtoIBJB(buf(1:iMax,1:jMax,4),zorl)
4673c4627
<             CALL IJtoIBJB(buf(:,:,4),zorl )
---
>        CALL IJtoIBJB(buf(1:iMax,1:jMax,4),zorl )
4674a4629,4641
>     DO j=1,jbMax
>        DO i=1,ibMaxPerJB(j)
>           !IF(iMaskIBIS(i,j) == 15_i8)THEN
>           !   tg1(i,j)=273.15_r8
>           !   tg2(i,j)=273.15_r8
>           !   tg3(i,j)=273.15_r8
>           !ELSE
>              tg1(i,j)=fgtmp(i,1,j)
>              tg2(i,j)=fgtmp(i,1,j)
>              tg3(i,j)=fgtmp(i,1,j)
>           !END IF   
>        END DO
>     END DO
4689,4705d4655
<       ELSE
<          DO j=1,jbMax
<             DO i=1,ibMax
<                tg1  (i,j) = tgrnd_site(i)
<                tg2  (i,j) = tgrnd_site(i)
<                tg3  (i,j) = tgrnd_site(i)
<                zorl (i,j) = zorol_site(i)
<                z0   (i,j) = zorol_site(i)
< 	       soilm(i,j) = wsoil_site(i)
<                wsib (i,j) = wsoil_site(i)
<                ssib (i,j) = wsoil_site(i)
<                tseam(i,j) = gtsea_site(i)
<                gtsea(i,j) = gtsea_site(i)
< 	       sheleg(i,j) = 0.0_r8
<             END DO
< 	 END DO 
<       END IF
4722c4672,4673
<             IF(iMaskIBIS(i,j) .ne. 0)gtsea(i,j)=290.0_r8
---
>           IF(iMaskIBIS(i,j) >= 1_i8)gtsea(i,j)=290.0_r8
>           IF(iMaskIBIS(i,j) >= 1_i8)gco2flx(i,j)=0.0_r8
4724c4675,4682
<             IF(iMaskIBIS(i,j).EQ.0) THEN
---
>           TSK (I,J)=ABS(gtsea(i,j))
>           IF (omlmodel) THEN
>              HML  (i,j) = oml_hml0 - 13.5_r8*log(MAX(ABS(TSK(i,j))-tice+0.01_r8,1.0_r8))
>              HUML (I,J)=0.0_r8
>              HVML (I,J)=0.0_r8
>           END IF
> 
>           IF(iMaskIBIS(i,j) == 0_i8) THEN
4726c4684,4685
<         	  iMaskIBIS(i,j)=-1
---
>                 iMaskIBIS(i,j)=-1_i8
>                 iMask(i,j)=-1_i8
4740a4700,4702
>              sm0(ncount,1,j)=w0(ncount,1,j)*poros(ncount,1,j)
>              sm0(ncount,2,j)=w0(ncount,2,j)*poros(ncount,3,j)
>              sm0(ncount,3,j)=w0(ncount,3,j)*poros(ncount,3,j)
4771,4773c4733,4735
< !
< ! initialize some model variables for cold start conditions
< ! 
---
>     !
>     ! initialize some model variables for cold start conditions
>     ! 
4779c4741
<             IF (iMaskIBIS(i,j) >= 1) THEN
---
>           IF (iMaskIBIS(i,j) >= 1_i8) THEN
4794c4756
<                IF (iMaskIBIS(i,j) >= 1) THEN
---
>              IF (iMaskIBIS(i,j) >= 1_i8) THEN
4800a4763
>                 tsnom (nLndPts,k,j) = 273.16_r8                     
4811c4774
<                IF (iMaskIBIS(i,j) >= 1) THEN
---
>              IF (iMaskIBIS(i,j) >= 1_i8) THEN
4825,4827c4788,4790
<                   IF (iMaskIBIS(i,j) == 15_i8) wisoi(nLndPts,k,j) = 1.0_r8
<                   IF (iMaskIBIS(i,j) == 15_i8) wisoi(nLndPts,k,j) = 1.0_r8
< 
---
>                 IF (iMaskIBIS(i,j) >= 15_i8) wisoi0(nLndPts,k,j) = 1.0_r8
>                 IF (iMaskIBIS(i,j) >= 15_i8) wisoi(nLndPts,k,j) = 1.0_r8
>                 IF (iMaskIBIS(i,j) >= 15_i8) wisoim(nLndPts,k,j) = 1.0_r8
4832,4837c4795,4801
< !     
< !     Initialize temperature and snow depths in Antarctica and Groenland
< !     
< !      IF (rdlsf) THEN 
< !lonscale
< !latscale
---
> 
>     !     
>     !     Initialize temperature and snow depths in Antarctica and Groenland
>     !     
>     !      IF (rdlsf) THEN 
>     !lonscale
>     !latscale
4841c4805
<                IF (iMaskIBIS(i,j) >= 1) THEN
---
>           IF (iMaskIBIS(i,j) >= 1_i8) THEN
4843,4845c4807,4809
< !
< !                 Antarctica
< !
---
>              !
>              !                 Antarctica
>              !
4850a4815
>                    wisoim(nLndPts,k,j) = 1.0_r8
4862,4864c4827,4829
< !
< !                 Greenland
< !
---
>              !
>              !                 Greenland
>              !
4870a4836
>                    wisoim(nLndPts,k,j) = 1.00_r8
4887a4854
>                    wisoim(nLndPts,k,j) = 1.00_r8
4889c4856
<                       tg(nLndPts,j) = tg3 (i,j)!xint(nLndPts,1,j) + 273.16_r8
---
>                 tg  (nLndPts  ,j) = tg3 (i,j)!xint(nLndPts,1,j) + 273.16_r8
4896c4863
<                       fi(nLndPts,j) = 1.0_r8    
---
>                 fi  (nLndPts  ,j) = 1.0_r8    
4901c4868
< !      END IF
---
>     !      END IF
4903,4955c4870,4922
< !	 do k=lbeg, lend
< ! Antarctica
< !           if (lati(k)*180./pi .le. -60.) then
< !     
< !              do l = 1, nsoilay
< !                 tsoi(k,l) = xint(k,1) + 273.16
< !                 wisoi(k,l) = 1.0
< !              end do
< !              tg(k) = xint(k,1) + 273.16
< !              hsno(k,1) = 0.05
< !              hsno(k,2) = 2.
< !              hsno(k,3) = 2.
< !              fi(k) = 1.
< !
< !           end if
< ! Greenland
< !          if (lati(k)*180/pi .ge. 60  .and. 
< !    >         lati(k)*180/pi .le. 85  .and.
< !    >         loni(k)*180/pi .le. 330 .and. 
< !    >         loni(k)*180/pi .gt. 285      ) then
< !     
< !             do l = 1, nsoilay
< !                tsoi(k,l) = xint(k,1) + 273.16
< !                wisoi(k,l) = 1.0
< !             end do
< !             tg(k) = xint(k,1) + 273.16
< !             hsno(k,1) = 0.05
< !             hsno(k,2) = 2.
< !             hsno(k,3) = 2.
< !             fi(k) = 1.
< !     
< !          end if
< !     
< !          if (lati(k)*180/pi .ge. 66  .and. 
< !    >         lati(k)*180/pi .le. 85  .and.
< !    >         loni(k)*180/pi .le. 345 .and. 
< !    >         loni(k)*180/pi .gt. 330      ) then
< !     
< !             do l = 1, nsoilay
< !                tsoi(k,l) = xint(k,1) + 273.16
< !                wisoi(k,l) = 1.0
< !             end do
< !             tg(k) = xint(k,1) + 273.16
< !             hsno(k,1) = 0.05
< !             hsno(k,2) = 2.
< !             hsno(k,3) = 2.
< !              fi(k) = 1.
< !     
< !           end if
< !
< !        end do
< !     
< !      end if
---
>     !         do k=lbeg, lend
>     ! Antarctica
>     !           if (lati(k)*180./pi .le. -60.) then
>     !     
>     !              do l = 1, nsoilay
>     !                 tsoi(k,l) = xint(k,1) + 273.16
>     !                 wisoi(k,l) = 1.0
>     !              end do
>     !              tg(k) = xint(k,1) + 273.16
>     !              hsno(k,1) = 0.05
>     !              hsno(k,2) = 2.
>     !              hsno(k,3) = 2.
>     !              fi(k) = 1.
>     !
>     !           end if
>     ! Greenland
>     !          if (lati(k)*180/pi .ge. 60  .and. 
>     !    >         lati(k)*180/pi .le. 85  .and.
>     !    >         loni(k)*180/pi .le. 330 .and. 
>     !    >         loni(k)*180/pi .gt. 285      ) then
>     !     
>     !             do l = 1, nsoilay
>     !                tsoi(k,l) = xint(k,1) + 273.16
>     !                wisoi(k,l) = 1.0
>     !             end do
>     !             tg(k) = xint(k,1) + 273.16
>     !             hsno(k,1) = 0.05
>     !             hsno(k,2) = 2.
>     !             hsno(k,3) = 2.
>     !             fi(k) = 1.
>     !     
>     !          end if
>     !     
>     !          if (lati(k)*180/pi .ge. 66  .and. 
>     !    >         lati(k)*180/pi .le. 85  .and.
>     !    >         loni(k)*180/pi .le. 345 .and. 
>     !    >         loni(k)*180/pi .gt. 330      ) then
>     !     
>     !             do l = 1, nsoilay
>     !                tsoi(k,l) = xint(k,1) + 273.16
>     !                wisoi(k,l) = 1.0
>     !             end do
>     !             tg(k) = xint(k,1) + 273.16
>     !             hsno(k,1) = 0.05
>     !             hsno(k,2) = 2.
>     !             hsno(k,3) = 2.
>     !              fi(k) = 1.
>     !     
>     !           end if
>     !
>     !        end do
>     !     
>     !      end if
4957,4959c4924,4926
< !
< ! return to main program
< !
---
>     !
>     ! return to main program
>     !
4985c4952
<     INTEGER ::  ibuf (iMax,jMax)
---
>     INTEGER(KIND=i4) ::  ibuf (iMax,jMax)
5016,5020c4983,4987
<     INTEGER :: jcg
<     INTEGER :: jmon
<     INTEGER :: jtyp
<     INTEGER :: iv
<     INTEGER :: im
---
>     !INTEGER :: jcg
>     !INTEGER :: jmon
>     !INTEGER :: jtyp
>     !INTEGER :: iv
>     !INTEGER :: im
5033c5000
<      IF(.NOT.UNDIMENSION) THEN
---
> 
5069c5036
< 
---
>     ibuf=0
5088d5054
<     END IF
5131c5097
<     INTEGER, INTENT(in   ) :: ibMaxPerJB(:)
---
>     INTEGER, INTENT(in   ) :: ibMaxPerJB(jbMax)
5350c5316
<              wsib(lon,lat) = sm(is,iter) / sibmax(is)
---
>              wsib(lon,lat) = MIN(0.98_r8,MAX(0.2_r8,sm(is,iter) / sibmax(is)))
5359c5325
< !
---
>   !
5432,5433c5398,5399
< !
< ! ---------------------------------------------------------------------
---
>   !
>   ! ---------------------------------------------------------------------
5434a5401,5406
>        jbMax                  , &! INTENT(IN   )
>        ibMax                  , &! INTENT(IN   )
>        kMax                   , &! INTENT(IN   )
>        ibMaxPerJB             , &! INTENT(IN   )
>        fgtmp                  , &! INTENT(IN   )
>        fgq                   , &! INTENT(IN   )
5440a5413
>        tum       , &! INTENT(OUT  ) :: tu        (npoi)    
5441a5415
>        tsm       , &! INTENT(OUT  ) :: ts        (npoi)    
5442a5417
>        tlm          , &! INTENT(OUT  ) :: tl        (npoi)    
5496a5472
>        wliqum    , &! INTENT(OUT  ) :: wliqu         (npoi)
5497a5474
>        wliqsm    , &! INTENT(OUT  ) :: wliqs         (npoi)
5498a5476
>        wliqlm          , &! INTENT(OUT  ) :: wliql         (npoi)
5499a5478
>        wsnoum    , &! INTENT(OUT  ) :: wsnou         (npoi)
5500a5480
>        wsnosm    , &! INTENT(OUT  ) :: wsnos         (npoi)
5501a5482
>        wsnolm    , &! INTENT(OUT  ) :: wsnol         (npoi)
5534,5537c5515,5518
< ! ---------------------------------------------------------------------
< !
< ! does initialization for model
< !
---
>     ! ---------------------------------------------------------------------
>     !
>     ! does initialization for model
>     !
5539c5520
< !
---
>     !
5540a5522,5527
>     INTEGER, INTENT(IN   ) :: jbMax
>     INTEGER, INTENT(IN   ) :: ibMax
>     INTEGER, INTENT(IN   ) :: kMax
>     INTEGER         , INTENT(IN   ) :: ibMaxPerJB(jbMax)
>     REAL(KIND=r8)   , INTENT(IN   ) :: fgtmp(ibMax,kMax,jbMax)
>     REAL(KIND=r8)   , INTENT(IN   ) :: fgq  (ibMax,kMax,jbMax)
5579a5567,5568
>     REAL(KIND=r8)   , INTENT(OUT  ) :: tum       (ibMax,jbMax)! temperature of upper canopy leaves (K)
> 
5580a5570,5571
>     REAL(KIND=r8)   , INTENT(OUT  ) :: tsm       (ibMax,jbMax)! temperature of upper canopy stems (K)
> 
5581a5573,5574
>     REAL(KIND=r8)   , INTENT(OUT  ) :: tlm       (ibMax,jbMax)! temperature of lower canopy leaves & stems(K)
> 
5617c5610
<       REAL(KIND=r8)   , INTENT(OUT  ) :: totfall  (ibMax,jbMax)! total litterfall and root turnover(rotatividade) (kg_C m-2/year)
---
>     REAL(KIND=r8)   , INTENT(OUT  ) :: totfall  (ibMax,jbMax)! total litterfall and root turnover (kg_C m-2/year)
5636a5630,5631
>     REAL(KIND=r8)   , INTENT(OUT  ) :: wliqum    (ibMax,jbMax)! intercepted liquid h2o on upper canopy leaf area (kg m-2)
> 
5637a5633,5634
>     REAL(KIND=r8)   , INTENT(OUT  ) :: wliqsm    (ibMax,jbMax)! intercepted liquid h2o on upper canopy stem area (kg m-2)
> 
5638a5636,5637
>     REAL(KIND=r8)   , INTENT(OUT  ) :: wliqlm    (ibMax,jbMax)! intercepted liquid h2o on lower canopy leaf and stem area (kg m-2)
> 
5639a5639,5640
>     REAL(KIND=r8)   , INTENT(OUT  ) :: wsnoum    (ibMax,jbMax)! intercepted frozen h2o (snow) on upper canopy leaf area (kg m-2)
> 
5640a5642,5643
>     REAL(KIND=r8)   , INTENT(OUT  ) :: wsnosm    (ibMax,jbMax)! intercepted frozen h2o (snow) on upper canopy stem area (kg m-2)
> 
5641a5645,5646
>     REAL(KIND=r8)   , INTENT(OUT  ) :: wsnolm    (ibMax,jbMax)! intercepted frozen h2o (snow) on lower canopy leaf & stem area (kg m-2)
> 
5648,5653c5653,5658
< !
< ! Arguments (input)     
< !
< !
< ! local variables
< !
---
>     !
>     ! Arguments (input)     
>     !
>     !
>     ! local variables
>     !
5657,5659c5662,5665
< !
< ! set physical constants (mks)
< !
---
>     INTEGER :: ncount
>     !
>     ! set physical constants (mks)
>     !
5675,5678c5681,5684
< !
< ! -----------------------------------------------------------------
< ! constant atmospheric co2 and o2
< ! -----------------------------------------------------------------
---
>     !
>     ! -----------------------------------------------------------------
>     ! constant atmospheric co2 and o2
>     ! -----------------------------------------------------------------
5680c5686,5688
<       co2conc = 0.000350_r8
---
>     !co2conc = 0.000350_r8
>     !co2init = co2val*0.000001_r8
>     co2conc = co2val*0.000001_r8
5682c5690
< !
---
>     !
5686,5688c5694,5696
< !
< ! specify the epsilon value for the model
< !
---
>     !
>     ! specify the epsilon value for the model
>     !
5690,5694c5698,5702
< !
< ! initialize integer variables (can't use const for this)
< !
< ! wet day / dry day flag initialized to dry day (0)
< !      
---
>     !
>     ! initialize integer variables (can't use const for this)
>     !
>     ! wet day / dry day flag initialized to dry day (0)
>     !      
5706,5708c5714,5716
< !
< ! zero flux arrays, and global diagnostic arrays
< !
---
>        !
>        ! zero flux arrays, and global diagnostic arrays
>        !
5713,5715c5721
<                   IF(k==1)asurd (i,k,j)= 0.03_r8
<                   IF(k==2)asurd (i,k,j)= 0.2_r8
< 
---
>                 asurd (i,k,j)= 0.0_r8
5717,5718c5723
<                   IF(k==1)asuri (i,k,j)=0.02_r8
<                   IF(k==2)asuri (i,k,j)=0.12_r8
---
>                 asuri (i,k,j)=0.0_r8
5724c5729
< !asuri
---
>              !asuri
5726c5731
<                totcondub(i,j) =   0.003_r8
---
>              totcondub(i,j) =   0.0_r8
5728c5733
<                totconduc(i,j)=   0.0006_r8
---
>              totconduc(i,j)=   0.0_r8
5730c5735
<                totcondls(i,j)=   0.001_r8
---
>              totcondls(i,j)=   0.0_r8
5732c5737
<                totcondl3(i,j)=   0.001_r8
---
>              totcondl3(i,j)=   0.0_r8
5734,5735c5739,5740
<                totcondl4(i,j)=   0.001_r8
< !ginvap
---
>              totcondl4(i,j)=   0.0_r8
>              !ginvap
5746,5751c5751,5759
< !
< ! initialize vegetation prognostic variables
< !
< ! initialize all temperature fields to 10 degrees C
< !
<              IF(.NOT.UNDIMENSION)THEN
---
>              !
>              ! initialize vegetation prognostic variables
>              !
>              ! initialize all temperature fields to 10 degrees C
>              !tu    (npoi)     ! temperature of upper canopy leaves (K)
>              !ts    (npoi)     ! temperature of upper canopy stems (K)
>              !tl    (npoi)     ! temperature of lower canopy leaves & stems(K)
>  
>              !
5754c5762,5763
<                !tum (i,j)= 283.16_r8
---
>              tum (i,j)= 283.16_r8
> 
5757c5766
<                !tsm (i,j)= 283.16_r8
---
>              tsm (i,j)= 283.16_r8
5760c5769
<                !tlm (i,j)= 283.16_r8
---
>              tlm (i,j)= 283.16_r8
5762,5769d5770
<             ELSE 
<                !CALL const (tu,    npoi, 283.16_r8)
<                tu (i,j)= tgrnd_site(i)
<                !CALL const (ts,    npoi, 283.16_r8)
<                ts (i,j)= tgrnd_site(i)
<                !CALL const (tl,    npoi, 283.16_r8)
<                tl (i,j)= tgrnd_site(i)
<             END IF
5772c5773
< !      END IF    
---
>        !      END IF    
5774,5776c5775,5777
< !
< ! initialize weather generator 'memory'
< !
---
>        !
>        ! initialize weather generator 'memory'
>        !
5778c5779
< !      IF (irestart == 0) THEN
---
>        !      IF (irestart == 0) THEN
5789,5793c5790,5793
< !
< ! initialize temperature of lower canopy buried by
< ! snow to 0 degrees C
< !
< 
---
>              !
>              ! initialize temperature of lower canopy buried by
>              ! snow to 0 degrees C
>              !
5796,5799c5796,5798
< !
< ! initialize canopy air conditions (used in turvap)
< !
<              IF(.NOT.UNDIMENSION)THEN
---
>              !
>              ! initialize canopy air conditions (used in turvap)
>              !
5804,5810c5803
<              ELSE
<                 !CALL const (t12, npoi, 283.16) 
<                 t12(i,j) = tgrnd_site(i)
<                 !CALL const (t34, npoi, 283.16) 
<                 t34(i,j) = tgrnd_site(i)
<              END IF
< !
---
>              !
5812c5805
<              q12(i,j) = 0.016_r8
---
>              q12(i,j) = 0.0_r8
5814,5817c5807,5810
<              q34(i,j) = 0.016_r8
< !
< ! initialize all co2 concentrations (mol/mol)
< !
---
>              q34(i,j) = 0.0_r8
>              !
>              ! initialize all co2 concentrations (mol/mol)
>              !
5828c5821
< !
---
>              !
5839,5841c5832,5834
< !
< ! initialize stomatal conductance (mol-h2o/m**2/sec)
< !       
---
>              !
>              ! initialize stomatal conductance (mol-h2o/m**2/sec)
>              !       
5854,5858c5847,5851
< !      END IF
< !
< ! initialize soil biogeochemistry variables
< !
< !      IF (irestart == 0) THEN
---
>        !      END IF
>        !
>        ! initialize soil biogeochemistry variables
>        !
>        !      IF (irestart == 0) THEN
5893c5886
<                totlit(i,j) =     249.0_r8*0.0_r8
---
>              totlit(i,j) =     0.0_r8
5895c5888
<                totnlit(i,j) =    2.0_r8*0.0_r8
---
>              totnlit(i,j) =    0.0_r8
5897c5890
<                totfall(i,j) =    1.2_r8*0.0_r8
---
>              totfall(i,j) =    0.0_r8
5899c5892
<                totalit(i,j) =    4.0_r8*0.0_r8
---
>              totalit(i,j) =    0.0_r8
5901c5894
<                totrlit(i,j) =    200.0_r8*0.0_r8
---
>              totrlit(i,j) =    0.0_r8
5903c5896
<                totanlit(i,j) =   0.02_r8*0.0_r8
---
>              totanlit(i,j) =   0.0_r8
5905c5898
<                totrnlit(i,j) =   1.8_r8*0.0_r8
---
>              totrnlit(i,j) =   0.0_r8
5907c5900
<                totcsoi(i,j) =    160.0_r8*0.0_r8
---
>              totcsoi(i,j) =    0.0_r8
5909c5902
<                totnmic(i,j) =    0.0_r8*0.0_r8
---
>              totnmic(i,j) =    0.0_r8
5911c5904
<                tco2mic(i,j) =    0.0_r8*0.0_r8
---
>              tco2mic(i,j) =    0.0_r8
5913c5906
<                tnpptot(i,j) =    1.0e-5_r8*0.0_r8
---
>              tnpptot(i,j) =    0.0_r8
5915c5908
<                tneetot(i,j) =    1.0e-5_r8*0.0_r8
---
>              tneetot(i,j) =    0.0_r8
5918,5921c5911,5914
< !
< ! initialize carbon lost to atmosphere due
< ! to biomass burning
< !
---
>              !
>              ! initialize carbon lost to atmosphere due
>              ! to biomass burning
>              !
5926c5919
< !      END IF
---
>        !      END IF
5928,5931c5921,5924
< !
< ! initialize phenology flags
< !
< !      IF (irestart == 0) THEN
---
>        !
>        ! initialize phenology flags
>        !
>        !      IF (irestart == 0) THEN
5948,5953c5941,5945
< !      END IF
< !
< ! initialize water and snow interception fractions
< !          
< !      IF (irestart == 0) THEN
< 
---
>        !      END IF
>        !
>        ! initialize water and snow interception fractions
>        !          
>        !      IF (irestart == 0) THEN
5958c5950,5951
<             wliqu(i,j) = 0.0_r8
---
>              wliqu(i,j) = 0.0_r8    ! wliqu     (ibMax,jbMax)! intercepted liquid h2o on upper canopy leaf area (kg m-2)
>              wliqum(i,j) = 0.0_r8    ! wliqu     (ibMax,jbMax)! intercepted liquid h2o on upper canopy leaf area (kg m-2)
5960c5953,5955
<             wliqs(i,j) = 0.0_r8
---
>              wliqs(i,j) = 0.0_r8    !wliqs  (ibMax,jbMax)! intercepted liquid h2o on upper canopy stem area (kg m-2)
>              wliqsm(i,j) = 0.0_r8    !wliqs  (ibMax,jbMax)! intercepted liquid h2o on upper canopy stem area (kg m-2)
> 
5962,5963c5957,5959
<             wliql(i,j) = 0.0_r8
< !
---
>              wliql(i,j) = 0.0_r8    !wliql  (ibMax,jbMax)! intercepted liquid h2o on lower canopy leaf and stem area (kg m-2)
>              wliqlm(i,j) = 0.0_r8    !wliql  (ibMax,jbMax)! intercepted liquid h2o on lower canopy leaf and stem area (kg m-2)
>              !
5965c5961,5963
<             wsnou(i,j) = 0.0_r8
---
>              wsnou(i,j) = 0.0_r8 ! intercepted frozen h2o (snow) on upper canopy leaf area (kg m-2)
>              wsnoum(i,j) = 0.0_r8 ! intercepted frozen h2o (snow) on upper canopy leaf area (kg m-2)
> 
5967c5965,5967
<             wsnos(i,j) = 0.0_r8
---
>              wsnos(i,j) = 0.0_r8 ! wsnos  (ibMax,jbMax)! intercepted frozen h2o (snow) on upper canopy stem area (kg m-2)
>              wsnosm(i,j) = 0.0_r8 ! wsnos  (ibMax,jbMax)! intercepted frozen h2o (snow) on upper canopy stem area (kg m-2)
> 
5969,5970c5969,5972
<             wsnol(i,j) = 0.0_r8
< !
---
>              wsnol(i,j) = 0.0_r8  ! wsnol  (ibMax,jbMax)! intercepted frozen h2o (snow) on lower canopy leaf & stem area (kg m-2)
>              wsnolm(i,j) = 0.0_r8  ! wsnol  (ibMax,jbMax)! intercepted frozen h2o (snow) on lower canopy leaf & stem area (kg m-2)
> 
>              !
5979a5982,6054
> 
>        DO j = 1,jbMax 
>           ncount=0
>           DO i=1,ibMaxPerJB(j) 
>              IF(iMaskIBIS(i,j) > 0_i8) THEN
>                  ncount=ncount+1
>                  !
>                  ! initialize vegetation prognostic variables
>                  !
>                  ! initialize all temperature fields to 10 degrees C
>                  !tu    (npoi)     ! temperature of upper canopy leaves (K)
>                  !ts    (npoi)     ! temperature of upper canopy stems (K)
>                  !tl    (npoi)     ! temperature of lower canopy leaves & stems(K)
>                  !
>                  IF(iMaskIBIS(i,j) == 15_i8)THEN
>                     tu (ncount,j)= 273.15_r8
>                     ts (ncount,j)= 273.15_r8
>                     tl (ncount,j)= 273.15_r8
>                     tum (ncount,j)= 273.15_r8
>                     tsm (ncount,j)= 273.15_r8
>                     tlm (ncount,j)= 273.15_r8
> 
>                  ELSE
>                     tu (ncount,j)= fgtmp(i,1,j)!283.16_r8
>                     ts (ncount,j)= fgtmp(i,1,j)!283.16_r8
>                     tl (ncount,j)= fgtmp(i,1,j)!283.16_r8
>                     tum (ncount,j)= fgtmp(i,1,j)!283.16_r8
>                     tsm (ncount,j)= fgtmp(i,1,j)!283.16_r8
>                     tlm (ncount,j)= fgtmp(i,1,j)!283.16_r8
>                  END IF
>                  !
>                  ! initialize temperature of lower canopy buried by
>                  ! snow to 0 degrees C
>                  !
>                  IF(iMaskIBIS(i,j) == 15_i8)THEN
>                     tlsub(ncount,j) =273.16_r8
>                  ELSE
>                     tlsub(ncount,j) =fgtmp(i,1,j)!273.16_r8
>                  END IF 
>                  !
>                  ! initialize canopy air conditions (used in turvap)
>                  !
>                  IF(iMaskIBIS(i,j) == 15_i8)THEN
>                     t12(ncount,j) = 273.16_r8
>                     t34(ncount,j) = 273.16_r8
>                  ELSE
>                     t12(ncount,j) = fgtmp(i,1,j)!283.16_r8
>                     t34(ncount,j) = fgtmp(i,1,j)!283.16_r8
>                  END IF 
>                  !
>                  q12(ncount,j) = fgq(i,1,j)!0.0_r8
>                  q34(ncount,j) = fgq(i,1,j)!0.0_r8
>                  !
>                  !
>                  ! initialize water and snow interception fractions
>                  !          
>                  IF(sheleg(i,j) > 0.0_r8) THEN
>                     wsnou(ncount,j) = sheleg (i,j) ! intercepted frozen h2o (snow) on upper canopy leaf area (kg m-2)
>                     wsnoum(ncount,j) = sheleg (i,j) ! intercepted frozen h2o (snow) on upper canopy leaf area (kg m-2)
>                     wsnos(ncount,j) = sheleg (i,j)  ! wsnos  (ibMax,jbMax)! intercepted frozen h2o (snow) on upper canopy stem area (kg m-2)
>                     wsnosm(ncount,j) = sheleg (i,j)  ! wsnos  (ibMax,jbMax)! intercepted frozen h2o (snow) on upper canopy stem area (kg m-2)
>                     wsnol(ncount,j) = sheleg (i,j) ! wsnol  (ibMax,jbMax)! intercepted frozen h2o (snow) on lower canopy leaf & stem area (kg m-2)
>                     wsnolm(ncount,j) = sheleg (i,j) ! wsnol  (ibMax,jbMax)! intercepted frozen h2o (snow) on lower canopy leaf & stem area (kg m-2)
>                     tlsub(ncount,j) = 273.16_r8
>                  END IF
>              END IF
>           END DO
>        END DO   
> 
> 
> 
> 
> 
5982,5984c6057,6059
< !
< ! return to main program
< !
---
>     !
>     ! return to main program
>     !
5987,5989c6062,6064
< !
< !
< ! ---------------------------------------------------------------------
---
>   !
>   !
>   ! ---------------------------------------------------------------------
6093,6096c6168,6171
< ! ---------------------------------------------------------------------
< ! 
< ! does initialization for time averaging
< !
---
>     ! ---------------------------------------------------------------------
>     ! 
>     ! does initialization for time averaging
>     !
6098c6173
< !
---
>     !
6212,6214c6287,6289
< !
< ! local variables
< !
---
>     !
>     ! local variables
>     !
6219,6221c6294,6296
< !
< ! initialize total water content in soil+snow+vegetation (for mass conservation check)
< !
---
>     !
>     ! initialize total water content in soil+snow+vegetation (for mass conservation check)
>     !
6229c6304
< !
---
>           !
6231c6306
< !
---
>           !
6237c6312
< !
---
>           !
6243,6245c6318,6320
< !
< ! Daily means
< !
---
>     !
>     ! Daily means
>     !
6302,6304c6377,6379
< !
< ! monthly mean quanties
< !
---
>     !
>     ! monthly mean quanties
>     !
6368,6370c6443,6445
< !
< ! Annual mean quantities
< !
---
>     !
>     ! Annual mean quantities
>     !
6448,6450c6523,6525
< !
< !
< ! ---------------------------------------------------------------------
---
>   !
>   !
>   ! ---------------------------------------------------------------------
6461,6464c6536,6539
< ! ---------------------------------------------------------------------
< !
< ! does initialization for snow model
< !
---
>     ! ---------------------------------------------------------------------
>     !
>     ! does initialization for snow model
>     !
6466c6541
< !
---
>     !
6478,6480c6553,6555
< !
< ! rhos is density of snow
< !
---
>     !
>     ! rhos is density of snow
>     !
6482,6484c6557,6559
< !
< ! consno is thermal conductivity of snow
< !
---
>     !
>     ! consno is thermal conductivity of snow
>     !
6486,6488c6561,6563
< !
< ! hsnotop is "adaptive-grid" thickness of top snow layer
< !
---
>     !
>     ! hsnotop is "adaptive-grid" thickness of top snow layer
>     !
6490,6494c6565,6569
< !
< ! hsnomin is minimum total snow thickness. total thickness
< ! is constrained to hsnomin for less than 100% cover. (hsnomin
< ! should be ge nsnolay*hsnotop for vadapt to work properly.)
< !
---
>     !
>     ! hsnomin is minimum total snow thickness. total thickness
>     ! is constrained to hsnomin for less than 100% cover. (hsnomin
>     ! should be ge nsnolay*hsnotop for vadapt to work properly.)
>     !
6496,6498c6571,6573
< !
< ! fimin and fimax are minimum and maximum snowcover fractions
< !
---
>     !
>     ! fimin and fimax are minimum and maximum snowcover fractions
>     !
6501,6503c6576,6578
< !
< ! z0sno is roughness lenth of snow cover
< !
---
>     !
>     ! z0sno is roughness lenth of snow cover
>     !
6505c6580
< !
---
>     !
6508,6510c6583,6585
< !
< !
< ! ---------------------------------------------------------------------
---
>   !
>   !
>   ! ---------------------------------------------------------------------
6511a6587,6590
>        jbMax     , &! INTENT(IN   )
>        ibMax     , &! INTENT(IN   )
>        ibMaxPerJB, &! INTENT(IN   )
>        topoi     , &! INTENT(IN   )
6526a6606
>        wisoim     , &! INTENT(INOUT)
6529a6610
>        tsnom      , &! INTENT(INOUT)
6532a6614
>        tim            , &! INTENT(OUT  )
6545a6628
>        hsoi      , &! INTENT(OUT  )
6549,6552c6632,6635
< ! ---------------------------------------------------------------------
< !
< ! does initialization for soil database
< !
---
>     ! ---------------------------------------------------------------------
>     !
>     ! does initialization for soil database
>     !
6554c6637
< !
---
>     !
6558a6642,6644
>     INTEGER, INTENT(IN   ) :: jbMax
>     INTEGER, INTENT(IN   ) :: ibMax
>     INTEGER         , INTENT(IN   ) :: ibMaxPerJB(jbMax)
6559a6646
>     REAL(KIND=r8)   , INTENT(IN   ) :: topoi(ibMax,jbMax)
6565a6653
>     REAL(KIND=r8)   , INTENT(INOUT) :: wisoim   (ibMax,nsoilay,jbMax)! fraction of soil pore space containing ice
6568a6657
>     REAL(KIND=r8)   , INTENT(INOUT) :: tsnom    (ibMax,nsnolay,jbMax) ! temperature of snow layers (K)
6571a6661
>     REAL(KIND=r8)   , INTENT(OUT  ) :: tim      (ibMax,jbMax)  ! snow skin temperature (K)
6582c6672
<       INTEGER, INTENT(OUT  ) :: ibex    (ibMax,nsoilay,jbMax)! nint(bex), used for cpu speed
---
>     INTEGER         , INTENT(OUT  ) :: ibex    (ibMax,nsoilay,jbMax)! nint(bex), used for cpu speed
6584a6675
>     REAL(KIND=r8)   , INTENT(OUT  ) :: hsoi    (ibMax,nsoilay+1,jbMax)! saturated hydraulic conductivity (m/s)
6595,6600c6686,6691
< !
< ! Arguments (input)     
< !
< !
< ! local variables
< !
---
>     !
>     ! Arguments (input)     
>     !
>     !
>     ! local variables
>     !
6602c6693,6694
<       INTEGER :: k,kk,inveg
---
>     INTEGER :: k
>     INTEGER :: kk
6606c6698
< !     INTEGER :: ndat,    ! number of textural classes
---
>     !     INTEGER :: ndat,    ! number of textural classes
6610d6701
<                           ! grid point
6627,6628c6718,6720
< !     INTEGER :: textcls  ! textural class assignment (1..11)
< !
---
>     !      INTEGER :: textcls  ! textural class assignment (1..11)
>     !
>     INTEGER :: inveg
6633,6635c6725,6729
< !
< ! M. El Maayar modified this....
< !     >     dmin               ! small number
---
>     REAL(KIND=r8)    :: aa
>     REAL(KIND=r8)    :: bb
>     !
>     ! M. El Maayar modified this....
>     !     >     dmin               ! small number
6637,6645c6731,6739
< !      parameter (ndat=11)
< !
< !     REAL(KIND=r8)    :: texdat(3,ndat)    ! % of sand, silt, clay in each textural class
< !     REAL(KIND=r8)    :: porosdat(ndat)    ! porosity in fraction of soil depth
< !     REAL(KIND=r8)    :: sfielddat(ndat)   ! field capacity in fraction of soil depth
< !     REAL(KIND=r8)    :: swiltdat(ndat)    ! wilting point in fraction of soil depth
< !     REAL(KIND=r8)    :: bexdat(ndat)      ! 'b' exponent in moisture release equation
< !     REAL(KIND=r8)    :: suctiondat(ndat)  ! saturated (air entry) potential (m-h2o)
< !     REAL(KIND=r8)    :: hydrauldat(ndat)  ! saturated hydraulic conductivity (m s-1)
---
>     !      parameter (ndat=11)
>     !
>     !     REAL(KIND=r8)    :: texdat(3,ndat)    ! % of sand, silt, clay in each textural class
>     !     REAL(KIND=r8)    :: porosdat(ndat)    ! porosity in fraction of soil depth
>     !     REAL(KIND=r8)    :: sfielddat(ndat)   ! field capacity in fraction of soil depth
>     !     REAL(KIND=r8)    :: swiltdat(ndat)    ! wilting point in fraction of soil depth
>     !     REAL(KIND=r8)    :: bexdat(ndat)      ! 'b' exponent in moisture release equation
>     !     REAL(KIND=r8)    :: suctiondat(ndat)  ! saturated (air entry) potential (m-h2o)
>     !     REAL(KIND=r8)    :: hydrauldat(ndat)  ! saturated hydraulic conductivity (m s-1)
6649,6768c6743,6866
< !
< !
< ! Rawls et al. (1992) soil properties data
< !
< !      ------------------
< !       sand  silt  clay
< !      ------------------
< !
< !      data texdat /
< !     >  0.92, 0.05, 0.03,  ! sand
< !     >  0.81, 0.12, 0.07,  ! loamy sand
< !     >  0.65, 0.25, 0.10,  ! sandy loam
< !     >  0.42, 0.40, 0.18,  ! loam
< !     >  0.20, 0.65, 0.15,  ! silt loam
< !     >  0.60, 0.13, 0.27,  ! sandy clay loam
< !     >  0.32, 0.34, 0.34,  ! clay loam
< !     >  0.09, 0.58, 0.33,  ! silty clay loam
< !     >  0.53, 0.07, 0.40,  ! sandy clay
< !     >  0.10, 0.45, 0.45,  ! silty clay
< !     >  0.20, 0.20, 0.60   ! clay
< !     >  /
< !
< ! porosity (fraction)
< !
< !      data porosdat /
< !     >  0.437,             ! sand
< !     >  0.437,             ! loamy sand
< !     >  0.453,             ! sandy loam
< !     >  0.463,             ! loam
< !     >  0.501,             ! silt loam
< !     >  0.398,             ! sandy clay loam
< !     >  0.464,             ! clay loam
< !     >  0.471,             ! silty clay loam
< !     >  0.430,             ! sandy clay
< !     >  0.479,             ! silty clay
< !     >  0.475              ! clay
< !     >  /
< !
< ! field capacity (fraction)
< !
< !      data sfielddat /
< !     >  0.091,             ! sand
< !     >  0.125,             ! loamy sand
< !     >  0.207,             ! sandy loam
< !     >  0.270,             ! loam
< !     >  0.330,             ! silt loam
< !     >  0.255,             ! sandy clay loam
< !     >  0.318,             ! clay loam
< !     >  0.366,             ! silty clay loam
< !     >  0.339,             ! sandy clay
< !     >  0.387,             ! silty clay
< !     >  0.396              ! clay
< !     >  /
< !
< ! wilting point (fraction)
< !
< !      data swiltdat /
< !     >  0.033,             ! sand
< !     >  0.055,             ! loamy sand
< !     >  0.095,             ! sandy loam
< !     >  0.117,             ! loam
< !     >  0.133,             ! silt loam
< !     >  0.148,             ! sandy clay loam
< !     >  0.197,             ! clay loam
< !     >  0.208,             ! silty clay loam
< !     >  0.239,             ! sandy clay
< !     >  0.250,             ! silty clay
< !     >  0.272              ! clay
< !     >  /
< !
< ! "b" exponent for the Campbell moisture-release equation
< !
< !      data bexdat /
< !     >  1.7,               ! sand
< !     >  2.1,               ! loamy sand
< !     >  3.1,               ! sandy loam
< !     >  4.5,               ! loam
< !     >  4.7,               ! silt loam
< !     >  4.0,               ! sandy clay loam
< !     >  5.2,               ! clay loam
< !     >  6.6,               ! silty clay loam
< !     >  6.0,               ! sandy clay
< !     >  7.9,               ! silty clay
< !     >  7.6                ! clay
< !     >  /
< !
< ! saturated (air entry) potential (m-h2o)
< !
< !      data suctiondat /
< !     >  0.070,             ! sand
< !     >  0.090,             ! loamy sand
< !     >  0.150,             ! sandy loam
< !     >  0.110,             ! loam
< !     >  0.210,             ! silt loam
< !     >  0.280,             ! sandy clay loam
< !     >  0.260,             ! clay loam
< !     >  0.330,             ! silty clay loam
< !     >  0.290,             ! sandy clay
< !     >  0.340,             ! silty clay
< !     >  0.370              ! clay
< !     >  /
< !
< ! saturated hydraulic conductivity (m s-1)
< !
< !      data hydrauldat /
< !     >  5.8330e-05,        ! sand
< !     >  1.6972e-05,        ! loamy sand
< !     >  7.1944e-06,        ! sandy loam
< !     >  3.6667e-06,        ! loam
< !     >  1.8889e-06,        ! silt loam
< !     >  1.1944e-06,        ! sandy clay loam
< !     >  6.3889e-07,        ! clay loam
< !     >  4.1667e-07,        ! silty clay loam
< !     >  3.3333e-07,        ! sandy clay
< !     >  2.5000e-07,        ! silty clay
< !     >  1.6667e-07         ! clay
< !     >  /
< !
< ! set sand/silt/clay vectors (xdat,ydat,zdat) for 11 data points
< !
---
>     !
>     !
>     ! Rawls et al. (1992) soil properties data
>     !
>     !      ------------------
>     !       sand  silt  clay
>     !      ------------------
>     !
>     !      data texdat /
>     !     >  0.92, 0.05, 0.03,  ! sand
>     !     >  0.81, 0.12, 0.07,  ! loamy sand
>     !     >  0.65, 0.25, 0.10,  ! sandy loam
>     !     >  0.42, 0.40, 0.18,  ! loam
>     !     >  0.20, 0.65, 0.15,  ! silt loam
>     !     >  0.60, 0.13, 0.27,  ! sandy clay loam
>     !     >  0.32, 0.34, 0.34,  ! clay loam
>     !     >  0.09, 0.58, 0.33,  ! silty clay loam
>     !     >  0.53, 0.07, 0.40,  ! sandy clay
>     !     >  0.10, 0.45, 0.45,  ! silty clay
>     !     >  0.20, 0.20, 0.60   ! clay
>     !     >  /
>     !
>     ! porosity (fraction)
>     !
>     !      data porosdat /
>     !     >  0.437,             ! sand
>     !     >  0.437,             ! loamy sand
>     !     >  0.453,             ! sandy loam
>     !     >  0.463,             ! loam
>     !     >  0.501,             ! silt loam
>     !     >  0.398,             ! sandy clay loam
>     !     >  0.464,             ! clay loam
>     !     >  0.471,             ! silty clay loam
>     !     >  0.430,             ! sandy clay
>     !     >  0.479,             ! silty clay
>     !     >  0.475              ! clay
>     !     >  /
>     !
>     ! field capacity (fraction)
>     !
>     !      data sfielddat /
>     !     >  0.091,             ! sand
>     !     >  0.125,             ! loamy sand
>     !     >  0.207,             ! sandy loam
>     !     >  0.270,             ! loam
>     !     >  0.330,             ! silt loam
>     !     >  0.255,             ! sandy clay loam
>     !     >  0.318,             ! clay loam
>     !     >  0.366,             ! silty clay loam
>     !     >  0.339,             ! sandy clay
>     !     >  0.387,             ! silty clay
>     !     >  0.396              ! clay
>     !     >  /
>     !
>     ! wilting point (fraction)
>     !
>     !      data swiltdat /
>     !     >  0.033,             ! sand
>     !     >  0.055,             ! loamy sand
>     !     >  0.095,             ! sandy loam
>     !     >  0.117,             ! loam
>     !     >  0.133,             ! silt loam
>     !     >  0.148,             ! sandy clay loam
>     !     >  0.197,             ! clay loam
>     !     >  0.208,             ! silty clay loam
>     !     >  0.239,             ! sandy clay
>     !     >  0.250,             ! silty clay
>     !     >  0.272              ! clay
>     !     >  /
>     !
>     ! "b" exponent for the Campbell moisture-release equation
>     !
>     !      data bexdat /
>     !     >  1.7,               ! sand
>     !     >  2.1,               ! loamy sand
>     !     >  3.1,               ! sandy loam
>     !     >  4.5,               ! loam
>     !     >  4.7,               ! silt loam
>     !     >  4.0,               ! sandy clay loam
>     !     >  5.2,               ! clay loam
>     !     >  6.6,               ! silty clay loam
>     !     >  6.0,               ! sandy clay
>     !     >  7.9,               ! silty clay
>     !     >  7.6                ! clay
>     !     >  /
>     !
>     ! saturated (air entry) potential (m-h2o)
>     !
>     !      data suctiondat /
>     !     >  0.070,             ! sand
>     !     >  0.090,             ! loamy sand
>     !     >  0.150,             ! sandy loam
>     !     >  0.110,             ! loam
>     !     >  0.210,             ! silt loam
>     !     >  0.280,             ! sandy clay loam
>     !     >  0.260,             ! clay loam
>     !     >  0.330,             ! silty clay loam
>     !     >  0.290,             ! sandy clay
>     !     >  0.340,             ! silty clay
>     !     >  0.370              ! clay
>     !     >  /
>     !
>     ! saturated hydraulic conductivity (m s-1)
>     !
>     !      data hydrauldat /
>     !     >  5.8330e-05,        ! sand
>     !     >  1.6972e-05,        ! loamy sand
>     !     >  7.1944e-06,        ! sandy loam
>     !     >  3.6667e-06,        ! loam
>     !     >  1.8889e-06,        ! silt loam
>     !     >  1.1944e-06,        ! sandy clay loam
>     !     >  6.3889e-07,        ! clay loam
>     !     >  4.1667e-07,        ! silty clay loam
>     !     >  3.3333e-07,        ! sandy clay
>     !     >  2.5000e-07,        ! silty clay
>     !     >  1.6667e-07         ! clay
>     !     >  /
>     !
>     ! set sand/silt/clay vectors (xdat,ydat,zdat) for 11 data points
>     !
>     i=nband
>     tsno=tsno
>     tsnom=tsnom
>     
6774,6778c6872,6876
< !
< ! initialization and normalization constant for puddle model (kg m-2)
< !
< !      wpudmax = 4.5
< !
---
>     !
>     ! initialization and normalization constant for puddle model (kg m-2)
>     !
>     !      wpudmax = 4.5
>     !
6789,6800c6887,6898
< !
< ! set prescribed soil layer thicknesses
< !
< !      hsoi(1)  = 0.10
< !      hsoi(2)  = 0.15
< !      hsoi(3)  = 0.25
< !      hsoi(4)  = 0.50
< !      hsoi(5)  = 1.00
< !      hsoi(6)  = 2.00
< !
< ! set physical parameters of soil
< !
---
>     !
>     ! set prescribed soil layer thicknesses
>     !
>     !      hsoi(1)  = 0.10
>     !      hsoi(2)  = 0.15
>     !      hsoi(3)  = 0.25
>     !      hsoi(4)  = 0.50
>     !      hsoi(5)  = 1.00
>     !      hsoi(6)  = 2.00
>     !
>     ! set physical parameters of soil
>     !
6807,6809c6905,6907
< !
< ! initialize soil water and soil temperature fields
< !
---
>     !
>     ! initialize soil water and soil temperature fields
>     !
6811c6909
< !
---
>        !
6817c6915
<                   IF (iMaskIBIS(i,j) >= 1) THEN
---
>                 IF (iMaskIBIS(i,j) >= 1_i8) THEN
6818a6917,6922
>                    IF(TRIM(NMSOILM) == 'soilmwkl') THEN
>                       wsoi0(nLndPts,k,j) = wsib3d(i,j,kk)
>                       wsoi (nLndPts,k,j) = wsib3d(i,j,kk)
>                       wsoim(nLndPts,k,j) = wsib3d(i,j,kk)
>                    ELSE
>                       wsoi0(nLndPts,k,j) = wsib(i,j)
6821c6925,6928
<                      IF (iMaskIBIS(i,j) >= 15) wisoi(nLndPts,k,j) = 1.00_r8
---
>                    END IF
>                    IF (iMaskIBIS(i,j) >= 15_i8) wisoi0(nLndPts,k,j) = 1.00_r8
>                    IF (iMaskIBIS(i,j) >= 15_i8) wisoi(nLndPts,k,j) = 1.00_r8
>                    IF (iMaskIBIS(i,j) >= 15_i8) wisoim(nLndPts,k,j) = 1.00_r8
6832c6939
<                IF (iMaskIBIS(i,j) >= 1) THEN
---
>              IF (iMaskIBIS(i,j) >= 1_i8) THEN
6837a6945
>                 tim (nLndPts,j) = 273.13_r8
6850,6852c6958,6960
< !
< ! set soil surface parameters for the global domain
< !
---
>     !
>     ! set soil surface parameters for the global domain
>     !
6854,6860c6962,6972
<          DO i = 1, nlpoints(j) 
< !
< ! Convert input sand and clay percents to fractions
< !
<         msand = nint(sand(i,1,j))
<         mclay = nint(clay(i,1,j)) 
< !
---
> !       DO i = 1, nlpoints(j) 
>        nLndPts=0
>        DO i = 1, ibMax
>           IF (iMaskIBIS(i,j) >= 1_i8) THEN
>              nLndPts=nLndPts+1
>              !
>              ! Convert input sand and clay percents to fractions
>              !
>              msand = NINT(sand(nLndPts,1,j))
>              mclay = NINT(clay(nLndPts,1,j)) 
>              !
6863,6871c6975,6984
<         fsilt = 0.01_r8 * (100 - msand - mclay)
< ! M. El Maayar modified this.
< !        forganic = 1. - fsand - fclay - fsilt
< !
< ! soil surface albedo:
< !
< ! from bats table 3.ii assuming albedo depends on texture
< !
<         albsav(i,j) = fsand * 0.120_r8 +  &
---
>              fsilt = MAX(0.01_r8 * (100 - msand - mclay),0.0007_r8)
>              !IF(topoi(i,j) > 1500.0_r8) THEN 
>                 ! M. El Maayar modified this.
>                 !        forganic = 1. - fsand - fclay - fsilt
>                 !
>                 ! soil surface albedo:
>                 !
>                 ! from bats table 3.ii assuming albedo depends on texture
>                 !
>                 albsav(nLndPts,j) = fsand * 0.110_r8 +  &
6874,6882c6987,7005
< !
< !
< ! M. El Maayar modified this.
< !      if (nint(forganic).eq.1) then
< !        albsan(i) = 1.0
< !      else
<         albsan(i,j) = 2.0_r8 * albsav(i,j)
< !      endif
< !
---
>              !ELSE 
>              !   !Endre Dobos 
>              !   !University of Miskolc, Miskolc-Egyetemvaros, Hungary DOI: 10.1081/E-ESS 120014334
>              !   albsav(nLndPts,j) = fsand * (0.200_r8+0.400_r8)*0.5_r8 +  & ! 0.30  
>              !                       fsilt * (0.100_r8+0.200_r8)*0.5_r8 +  & ! 0.15
>              !                       fclay * (0.200_r8+0.400_r8)*0.5_r8      ! 0.25
>              !                                                               !-----
>              !   !                                                             0.75  / 3  = 0.25
>              !   !
>              !END IF 
>              !
>              ! M. El Maayar modified this.
>              !      if (nint(forganic).eq.1) then
>              !        albsan(i) = 1.0
>              !      else
>              albsan(nLndPts,j) = 2.0_r8 * albsav(nLndPts,j)
>              !      endif
>              !
>              END IF
6885,6895c7008,7018
< !
< ! create soil properties look-up table
< !
< ! set soil parameters at each layer for the global domain
< ! soita.nc file is for layers only to 4 m; currently this
< ! is for a total of six layers. If there are any remaining  
< ! layers below that, set texture to be equal to that of the
< ! last layer (layer 6)
< ! analysis of the current WISE-IGBP soil textural dataset
< ! reveals very little information below 4 m.
< !
---
>     !
>     ! create soil properties look-up table
>     !
>     ! set soil parameters at each layer for the global domain
>     ! soita.nc file is for layers only to 4 m; currently this
>     ! is for a total of six layers. If there are any remaining  
>     ! layers below that, set texture to be equal to that of the
>     ! last layer (layer 6)
>     ! analysis of the current WISE-IGBP soil textural dataset
>     ! reveals very little information below 4 m.
>     !
6901,6903c7024,7026
< !
< ! Convert input sand and clay percents to fractions
< !
---
>              !
>              ! Convert input sand and clay percents to fractions
>              !
6911,6918c7034,7041
< !
< ! M. El Maayar modified this
< !       if ((msand.ge.99).AND.(mclay.ge.99)) then
< !          fsand = 0.
< !          fclay = 0.
< !          fsilt = 0.
< !          forganic = 1.
< !       else
---
>              !
>              ! M. El Maayar modified this
>              !       if ((msand.ge.99).AND.(mclay.ge.99)) then
>              !          fsand = 0.
>              !          fclay = 0.
>              !          fsilt = 0.
>              !          forganic = 1.
>              !       else
6921,6926c7044,7049
<           fsilt = 0.01_r8 * (100 - msand - mclay)
< !
< ! for now, we assume that all soils have a 1% organic content -- 
< ! this is just a place holder until we couple the soil carbon
< ! dynamics to the soil physical properties
< !
---
>              fsilt = MAX(0.01_r8 * (100 - msand - mclay),0.0007_r8)
>              !
>              ! for now, we assume that all soils have a 1% organic content -- 
>              ! this is just a place holder until we couple the soil carbon
>              ! dynamics to the soil physical properties
>              !
6929,6933c7052,7056
< !       endif
< !
< ! density of soil material (without pores, not bulk) (kg m-3)
< ! from Campbell and Norman, 1998
< !
---
>              !       endif
>              !
>              ! density of soil material (without pores, not bulk) (kg m-3)
>              ! from Campbell and Norman, 1998
>              !
6936,6955c7059,7088
< !
< ! specific heat of soil material (J kg-1 k-1):
< ! from Campbell and Norman, 1998
< !
<           csoi(i,k,j) =  870.0_r8 * (1.0_r8 - forganic) +  1920.0_r8 * forganic 
< 
< !  real(r8) :: om_frac      = 1.0_r8   ! organic matter fraction
< !  real(r8) :: om_csol      = 2.5_r8   ! heat capacity of peat soil *10^6 (J/K m3) (Farouki, 1986)
< !          PRINT*,'csoi1(i,k,j)=',csoi(i,k,j),forganic
<           csoi (i,k,j)   = (((1._r8-om_frac)*(2.128_r8*msand+2.385_r8*mclay) / (msand+mclay) + om_csol*om_frac)*1.e6_r8 )/rhosoi(i,k,j) ! J/(m3 K)  
< 
< !          PRINT*,'csoi2(i,k,j)=',csoi(i,k,j),om_frac,msand,mclay
< 
< !
< ! cjk
< ! match textural fractions with soil textural class 
< ! calls two functions to match sand and clay fractions
< ! with proper soil textural class based on the usda
< ! classification system
< !
---
>              !
>              ! specific heat of soil material (j kg-1 k-1):
>              ! from Campbell and Norman, 1998
>              !
>              !PK csoi(i,k,j) =  870.0_r8 * (1.0_r8 - forganic) +  &
>              !PK      1920.0_r8 * forganic 
>              !
>              !  real(r8) :: om_frac      = 1.0_r8   ! organic matter fraction
>              !  real(r8) :: om_csol      = 2.5_r8   ! heat capacity of peat soil *10^6 (J/K m3) (Farouki, 1986)
>              IF( NINT (xinveg(i,j)) == 15 )THEN
> !                csoi(i,k,j) =  870.0_r8 * (1.0_r8 - forganic) + 1920.0_r8 * forganic 
>                 !REAL(KIND=r8), PARAMETER :: cice = 2.106e+3_r8  ! specific heat of ice (J deg-1 kg-1) 
>                 csoi(i,k,j) = 152.5 + 7.122*(tg(i,j))!Yen (1981)
>                 csoi(i,k,j) = 2.106e+3_r8  ! specific heat of ice (J deg-1 kg-1) 
>              ELSE
>                ! aa=((1-0.01)*(1.128*(vegm.2/100)+2.385*(vegm.1/100))/((vegm.2+vegm.1)/100) + 2.5*0.01)*950e3)/(2650*(1-0.001) + 1300*0.01)
>                ! aa=aa*1.2
>                bb              = 870.0_r8 * (1.0_r8 - forganic) + 1920.0_r8 * forganic
>                aa              = (((1.0_r8-om_frac)*(2.128_r8*fsand+2.385_r8*fclay) / (fsand+fclay) + om_csol*om_frac)*bb*1.e3_r8)/rhosoi(i,k,j)
>                csoi (i,k,j)    = aa*1.3_r8
>                ! csoi (i,k,j)   = (((1._r8-om_frac)*(2.128_r8*msand+2.385_r8*mclay) / (msand+mclay) + om_csol*om_frac)*1.e6_r8 )/rhosoi(i,k,j) ! J/(m3 K)  
>                ! csoi (i,k,j)   = 870.0_r8 * (1.0_r8 - forganic) + 1920.0_r8 * forganic
>              END IF
>              !
>              ! cjk
>              ! match textural fractions with soil textural class 
>              ! calls two functions to match sand and clay fractions
>              ! with proper soil textural class based on the usda
>              ! classification system
>              !
6958,6960c7091,7094
< !
< ! porosity (fraction):
< ! 
---
>              SoilMask(i,j)=INT(texture(i,1,j))
>              !
>              ! porosity (fraction):
>              ! 
6962,6964c7096,7098
< !
< ! field capacity (defined relative to the porosity):
< !
---
>              !
>              ! field capacity (defined relative to the porosity):
>              !
6966,6968c7100,7102
< !
< ! wilting point (defined relative to the porosity):
< !
---
>              !
>              ! wilting point (defined relative to the porosity):
>              !
6970,6972c7104,7106
< !
< ! "b" exponent for the Campbell moisture-release equation:
< !
---
>              !
>              ! "b" exponent for the Campbell moisture-release equation:
>              !
6974,6976c7108,7110
< !
< ! nearest integer of "b" exponent (for computational efficiency):
< !
---
>              !
>              ! nearest integer of "b" exponent (for computational efficiency):
>              !
6978,6980c7112,7114
< !
< ! saturated matric (air entry) potential (m-h2o):
< !
---
>              !
>              ! saturated matric (air entry) potential (m-h2o):
>              !
6982,6985c7116,7120
< !
< ! saturated hydraulic conductivity (m s-1):
< !
< !PK          hydraul(i,k,j) = hydrauldat(lmin)
---
>              !
>              ! saturated hydraulic conductivity (m s-1):
>              !
>              !PK hydraul(i,k,j) = hydrauldat(lmin)
> 
6988c7123,7124
<           zsoi=soil_layer_thickness(inveg,k)
---
>              zsoi=soil_layer_thickness(1,k)
> 
7009,7017c7145,7152
< 
<           hydraul(i,k,j)  = (uncon_frac*uncon_hksat + (perc_frac*om_frac)*om_hksat)! mm/s 
< !          PRINT*,hydraul(i,k,j), hydrauldat(lmin)
< !
< ! soil layer thickness (m)   :
< 
<           hsoi(i,k,j)        = soil_layer_thickness(inveg,k)
<           hsoi(i,nsoilay+1,j)= soil_layer_thickness(inveg,nsoilay+1)
< 
---
>              !hydraul(i,k,j)  = (uncon_frac*uncon_hksat + (perc_frac*om_frac)*om_hksat)! mm/s 
>              !
>              ! saturated hydraulic conductivity (m s-1):
>              !
>              hydraul(i,k,j) = hydrauldat(lmin)
>              !  
>              hsoi(i,k,j)        = soil_layer_thickness(1,k)
>              hsoi(i,nsoilay+1,j)= soil_layer_thickness(1,nsoilay+1)
7021,7024c7156,7158
< !
< 
< ! return to main program
< !
---
>     !
>     ! return to main program
>     !
7028c7162
< !-------------------------------------------------------------------------
---
>   !-------------------------------------------------------------------------
7030,7053c7164,7187
< !
< ! adapted for ibis by cjk 01/11/01
< !-------------------------------------------------------------------------
< ! |
< ! |                         T R I A N G L E
< ! | Main program that calls WHAT_TEXTURE, a function that classifies soil
< ! | in the USDA textural triangle using sand and clay %
< ! +-----------------------------------------------------------------------
< ! | Created by: aris gerakis, apr. 98 with help from brian baer
< ! | Modified by: aris gerakis, july 99: now all borderline cases are valid
< ! | Modified by: aris gerakis, 30 nov 99: moved polygon initialization to
< ! |              main program
< ! +-----------------------------------------------------------------------
< ! | COMMENTS
< ! | o Supply a data file with two columns, in free format:  1st column sand,
< ! |   2nd column clay %, no header.  The output is a file with the classes.
< ! +-----------------------------------------------------------------------
< ! | You may use, distribute and modify this code provided you maintain
< ! ! this header and give appropriate credit.
< ! +-----------------------------------------------------------------------
< !
< ! code adapted for IBIS by cjk 01-11-01
< !
< !
---
>     !
>     ! adapted for ibis by cjk 01/11/01
>     !-------------------------------------------------------------------------
>     ! |
>     ! |                         T R I A N G L E
>     ! | Main program that calls WHAT_TEXTURE, a function that classifies soil
>     ! | in the USDA textural triangle using sand and clay %
>     ! +-----------------------------------------------------------------------
>     ! | Created by: aris gerakis, apr. 98 with help from brian baer
>     ! | Modified by: aris gerakis, july 99: now all borderline cases are valid
>     ! | Modified by: aris gerakis, 30 nov 99: moved polygon initialization to
>     ! |              main program
>     ! +-----------------------------------------------------------------------
>     ! | COMMENTS
>     ! | o Supply a data file with two columns, in free format:  1st column sand,
>     ! |   2nd column clay %, no header.  The output is a file with the classes.
>     ! +-----------------------------------------------------------------------
>     ! | You may use, distribute and modify this code provided you maintain
>     ! ! this header and give appropriate credit.
>     ! +-----------------------------------------------------------------------
>     !
>     ! code adapted for IBIS by cjk 01-11-01
>     !
>     !
7056,7058c7190,7192
< !
< !      LOGICAL :: inpoly
< !
---
>     !
>     !      LOGICAL :: inpoly
>     !
7069c7203
< !     REAL(KIND=r8)    :: silt           (1:7,1:2) 
---
>     !     REAL(KIND=r8)    :: silt           (1:7,1:2) 
7071,7074c7205,7208
< !
< ! initalize polygon coordinates:
< ! each textural class reads in the sand coordinates (1,7) first, and
< ! then the corresponding clay coordinates (1,7)
---
>     !
>     ! initalize polygon coordinates:
>     ! each textural class reads in the sand coordinates (1,7) first, and
>     ! then the corresponding clay coordinates (1,7)
7076,7080c7210,7214
< !     data silty_loam/0, 0, 23, 50, 20, 8, 0, 12, 27, 27, 0, 0, 12, 0/
< !
< ! because we do not have a separate silt category, have to redefine the
< ! polygon boundaries for the silt loam  
< !
---
>     !     data silty_loam/0, 0, 23, 50, 20, 8, 0, 12, 27, 27, 0, 0, 12, 0/
>     !
>     ! because we do not have a separate silt category, have to redefine the
>     ! polygon boundaries for the silt loam  
>     !
7091c7225
< !     DATA silt            /0, 0, 8, 20, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0/
---
>     !     DATA silt            /0, 0, 8, 20, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0/
7104,7146c7238,7280
< !
< ! polygon coordinates  
< !
< !     sand
< !
< !     >  85, 90, 100, 0, 0, 0, 0,       ! sand
< !     >  70, 85, 90, 85, 0, 0, 0,       ! loamy sand
< !     >  50, 43, 52, 52, 80, 85, 70,    ! sandy loam
< !     >  43, 23, 45, 52, 52, 0, 0,      ! loam
< !     >   0, 0, 23, 50, 0, 0, 0,        ! silt loam (combined with silt)
< !     >  52, 45, 45, 65, 80, 0, 0,      ! sandy clay loam
< !     >  20, 20, 45, 45, 0, 0, 0,       ! clay loam
< !     >   0, 0, 20, 20, 0, 0, 0,        ! silty clay loam
< !     >  45, 45, 65, 0, 0, 0, 0,        ! sandy clay
< !     >   0, 0, 20, 0, 0, 0, 0,         ! silty clay 
< !     >  20, 0, 0, 45, 45, 0, 0         ! clay
< !
< !      clay
< !
< !     > 0, 10, 0, 0, 0, 0, 0,           ! sand
< !     > 0, 15, 10, 0, 0, 0, 0,          ! loamy sand
< !     > 0, 7, 7, 20, 20, 15, 0,         ! sandy loam 
< !     > 7, 27, 27, 20, 7, 0, 0,         ! loam
< !     > 0, 27, 27, 0, 0, 0, 0,          ! silt loam (combined with silt)
< !     > 20, 27, 35, 35, 20, 0, 0,       ! sandy clay loam
< !     > 27, 40, 40, 27, 0, 0, 0,        ! clay loam
< !     > 27, 40, 40, 27, 0, 0, 0,        ! silty clay loam
< !     > 35, 55, 35, 0, 0, 0, 0,         ! sandy clay
< !     > 40, 60, 40, 0, 0, 0, 0,         ! silty clay
< !     > 40, 60, 100, 55, 40, 0, 0       ! clay
< !
< ! +-----------------------------------------------------------------------
< ! | figure out what texture grid cell and layer are part of  
< ! | classify a soil in the triangle based on sand and clay %
< ! +-----------------------------------------------------------------------
< ! | Created by: aris gerakis, apr. 98
< ! | Modified by: aris gerakis, june 99.  Now check all polygons instead of
< ! | stopping when a right solution is found.  This to cover all borderline 
< ! | cases.
< ! +-----------------------------------------------------------------------
< !
< ! find polygon(s) where the point is.  
< !
---
>     !
>     ! polygon coordinates  
>     !
>     !     sand
>     !
>     !     >  85, 90, 100, 0, 0, 0, 0,       ! sand
>     !     >  70, 85, 90, 85, 0, 0, 0,       ! loamy sand
>     !     >  50, 43, 52, 52, 80, 85, 70,    ! sandy loam
>     !     >  43, 23, 45, 52, 52, 0, 0,      ! loam
>     !     >   0, 0, 23, 50, 0, 0, 0,        ! silt loam (combined with silt)
>     !     >  52, 45, 45, 65, 80, 0, 0,      ! sandy clay loam
>     !     >  20, 20, 45, 45, 0, 0, 0,       ! clay loam
>     !     >   0, 0, 20, 20, 0, 0, 0,        ! silty clay loam
>     !     >  45, 45, 65, 0, 0, 0, 0,        ! sandy clay
>     !     >   0, 0, 20, 0, 0, 0, 0,         ! silty clay 
>     !     >  20, 0, 0, 45, 45, 0, 0         ! clay
>     !
>     !      clay
>     !
>     !     > 0, 10, 0, 0, 0, 0, 0,           ! sand
>     !     > 0, 15, 10, 0, 0, 0, 0,          ! loamy sand
>     !     > 0, 7, 7, 20, 20, 15, 0,         ! sandy loam 
>     !     > 7, 27, 27, 20, 7, 0, 0,         ! loam
>     !     > 0, 27, 27, 0, 0, 0, 0,          ! silt loam (combined with silt)
>     !     > 20, 27, 35, 35, 20, 0, 0,       ! sandy clay loam
>     !     > 27, 40, 40, 27, 0, 0, 0,        ! clay loam
>     !     > 27, 40, 40, 27, 0, 0, 0,        ! silty clay loam
>     !     > 35, 55, 35, 0, 0, 0, 0,         ! sandy clay
>     !     > 40, 60, 40, 0, 0, 0, 0,         ! silty clay
>     !     > 40, 60, 100, 55, 40, 0, 0       ! clay
>     !
>     ! +-----------------------------------------------------------------------
>     ! | figure out what texture grid cell and layer are part of  
>     ! | classify a soil in the triangle based on sand and clay %
>     ! +-----------------------------------------------------------------------
>     ! | Created by: aris gerakis, apr. 98
>     ! | Modified by: aris gerakis, june 99.  Now check all polygons instead of
>     ! | stopping when a right solution is found.  This to cover all borderline 
>     ! | cases.
>     ! +-----------------------------------------------------------------------
>     !
>     ! find polygon(s) where the point is.  
>     !
7148c7282
< !
---
>     !
7184c7318
< !
---
>     !
7187,7189c7321,7323
< !
< !        write (*, 1000) msand, mclay
< ! 1000   format (/, 1x, 'Texture not found for ', f5.1, ' sand and ', f5.1, ' clay')
---
>        !
>        !        write (*, 1000) msand, mclay
>        ! 1000   format (/, 1x, 'Texture not found for ', f5.1, ' sand and ', f5.1, ' clay')
7191c7325
< !
---
>     !
7194,7195c7328,7329
< !
< !---------------------------------------------------------------------------
---
>   !
>   !---------------------------------------------------------------------------
7197,7237c7331,7371
< !
< ! adapted for ibis by cjk 01/11/01
< !---------------------------------------------------------------------------
< !
< !                            INPOLY
< !   Function to tell if a point is inside a polygon or not.
< !--------------------------------------------------------------------------
< !   Copyright (c) 1995-1996 Galacticomm, Inc.  Freeware source code.
< !
< !   Please feel free to use this source code for any purpose, commercial
< !   or otherwise, as long as you don't restrict anyone else's use of
< !   this source code.  Please give credit where credit is due.
< !
< !   Point-in-polygon algorithm, created especially for World-Wide Web
< !   servers to process image maps with mouse-clickable regions.
< !
< !   Home for this file:  http://www.gcomm.com/develop/inpoly.c
< !
< !                                       6/19/95 - Bob Stein & Craig Yap
< !                                       stein@gcomm.com
< !                                       craig@cse.fau.edu
< !--------------------------------------------------------------------------
< !   Modified by:
< !   Aris Gerakis, apr. 1998: 1.  translated to Fortran
< !                            2.  made it work with REAL(KIND=r8) coordinates
< !                            3.  now resolves the case where point falls
< !                                on polygon border.
< !   Aris Gerakis, nov. 1998: Fixed error caused by hardware arithmetic
< !   Aris Gerakis, july 1999: Now all borderline cases are valid
< !--------------------------------------------------------------------------
< !   Glossary:
< !   function inpoly: true=inside, false=outside (is target point inside
< !                    a 2D polygon?)
< !   poly(*,2):  polygon points, [0]=x, [1]=y
< !   npoints: number of points in polygon
< !   xt: x (horizontal) of target point
< !   yt: y (vertical) of target point
< !--------------------------------------------------------------------------
< !
< ! declare arguments  
< !
---
>     !
>     ! adapted for ibis by cjk 01/11/01
>     !---------------------------------------------------------------------------
>     !
>     !                            INPOLY
>     !   Function to tell if a point is inside a polygon or not.
>     !--------------------------------------------------------------------------
>     !   Copyright (c) 1995-1996 Galacticomm, Inc.  Freeware source code.
>     !
>     !   Please feel free to use this source code for any purpose, commercial
>     !   or otherwise, as long as you don't restrict anyone else's use of
>     !   this source code.  Please give credit where credit is due.
>     !
>     !   Point-in-polygon algorithm, created especially for World-Wide Web
>     !   servers to process image maps with mouse-clickable regions.
>     !
>     !   Home for this file:  http://www.gcomm.com/develop/inpoly.c
>     !
>     !                                       6/19/95 - Bob Stein & Craig Yap
>     !                                       stein@gcomm.com
>     !                                       craig@cse.fau.edu
>     !--------------------------------------------------------------------------
>     !   Modified by:
>     !   Aris Gerakis, apr. 1998: 1.  translated to Fortran
>     !                            2.  made it work with REAL(KIND=r8) coordinates
>     !                            3.  now resolves the case where point falls
>     !                                on polygon border.
>     !   Aris Gerakis, nov. 1998: Fixed error caused by hardware arithmetic
>     !   Aris Gerakis, july 1999: Now all borderline cases are valid
>     !--------------------------------------------------------------------------
>     !   Glossary:
>     !   function inpoly: true=inside, false=outside (is target point inside
>     !                    a 2D polygon?)
>     !   poly(*,2):  polygon points, [0]=x, [1]=y
>     !   npoints: number of points in polygon
>     !   xt: x (horizontal) of target point
>     !   yt: y (vertical) of target point
>     !--------------------------------------------------------------------------
>     !
>     ! declare arguments  
>     !
7241c7375
< !
---
>     !
7243,7245c7377,7379
< !
< ! local variables
< !
---
>     !
>     ! local variables
>     !
7254c7388
< !
---
>     !
7256c7390
< !
---
>     !
7262c7396
< !
---
>     !
7267c7401
< !
---
>     !
7287,7288c7421,7422
< ! the outer IF is the 'straddle' test and the 'vertical border' test.
< ! the inner IF is the 'non-vertical border' test and the 'north' test.  
---
>        ! the outer IF is the 'straddle' test and the 'vertical border' test.
>        ! the inner IF is the 'non-vertical border' test and the 'north' test.  
7290,7294c7424,7428
< ! the first statement checks whether a north pointing vector crosses  
< ! (stradles) the straight segment.  There are two possibilities, depe-
< ! nding on whether xnew < xold or xnew > xold.  The '<' is because edge 
< ! must be "open" at left, which is necessary to keep correct count when 
< ! vector 'licks' a vertix of a polygon.  
---
>        ! the first statement checks whether a north pointing vector crosses  
>        ! (stradles) the straight segment.  There are two possibilities, depe-
>        ! nding on whether xnew < xold or xnew > xold.  The '<' is because edge 
>        ! must be "open" at left, which is necessary to keep correct count when 
>        ! vector 'licks' a vertix of a polygon.  
7299,7301c7433,7435
< !
< ! the test point lies on a non-vertical border:
< !
---
>           !
>           ! the test point lies on a non-vertical border:
>           !
7305,7309c7439,7443
< !
< ! check if segment is north of test point.  If yes, reverse the 
< ! value of INSIDE.  The +0.001 was necessary to avoid errors due   
< ! arithmetic (e.g., when clay = 98.87 and sand = 1.13):   
< !
---
>              !
>              ! check if segment is north of test point.  If yes, reverse the 
>              ! value of INSIDE.  The +0.001 was necessary to avoid errors due   
>              ! arithmetic (e.g., when clay = 98.87 and sand = 1.13):   
>              !
7315,7322c7449,7456
< !
< ! this is the rare case when test point falls on vertical border or  
< ! left edge of non-vertical border. The left x-coordinate must be  
< ! common.  The slope requirement must be met, but also point must be
< ! between the lower and upper y-coordinate of border segment.  There 
< ! are two possibilities,  depending on whether ynew < yold or ynew > 
< ! yold:
< !
---
>           !
>           ! this is the rare case when test point falls on vertical border or  
>           ! left edge of non-vertical border. The left x-coordinate must be  
>           ! common.  The slope requirement must be met, but also point must be
>           ! between the lower and upper y-coordinate of border segment.  There 
>           ! are two possibilities,  depending on whether ynew < yold or ynew > 
>           ! yold:
>           !
7332c7466
< !
---
>        !
7335c7469
< !
---
>        !
7337,7341c7471,7475
< !
< ! If test point is not on a border, the function result is the last state 
< ! of INSIDE variable.  Otherwise, INSIDE doesn't matter.  The point is
< ! inside the polygon if it falls on any of its borders:
< !
---
>     !
>     ! If test point is not on a border, the function result is the last state 
>     ! of INSIDE variable.  Otherwise, INSIDE doesn't matter.  The point is
>     ! inside the polygon if it falls on any of its borders:
>     !
7347c7481
< !
---
>     !
7350,7351c7484,7485
< !
< ! ---------------------------------------------------------------------
---
>   !
>   ! ---------------------------------------------------------------------
7421,7422c7555,7556
< ! ---------------------------------------------------------------------
< !
---
>     ! ---------------------------------------------------------------------
>     !
7424c7558
< !
---
>     !
7455a7590
>     ! burst, lower canopy (day-degrees)
7499,7500c7634,7635
<       REAL(KIND=r8)   , INTENT(INOUT) :: froot   (ibMax,nsoilay,2,jbMax)   ! fraction of root in soil layer 
<       REAL(KIND=r8)   , INTENT(IN   ) :: plai_init   (4,nVegClass)    ! initial total LAI for each vegtype (used in iniveg)
---
>     REAL(KIND=r8)   , INTENT(OUT  ) :: froot   (ibMax,nsoilay,2,jbMax)   ! fraction of root in soil layer 
>     REAL(KIND=r8)   , INTENT(IN   ) :: plai_init   (4,15)    ! initial total LAI for each vegtype (used in iniveg)
7507,7511c7642,7646
<       REAL(KIND=r8)   , INTENT(IN   ) :: beta1(nVegClass)                 ! parameter for Jackson rooting profile, lower canopy
<       REAL(KIND=r8)   , INTENT(IN   ) :: beta2(nVegClass)                 ! parameter for Jackson rooting profile, upper canopy
< !
< ! Arguments (input)
< !
---
>     REAL(KIND=r8)   , INTENT(IN   ) :: beta1 (15)                ! parameter for Jackson rooting profile, lower canopy
>     REAL(KIND=r8)   , INTENT(IN   ) :: beta2 (15)                ! parameter for Jackson rooting profile, upper canopy
>     !
>     ! Arguments (input)
>     !
7514,7516c7649,7651
< !
< ! local variables
< !
---
>     !
>     ! local variables
>     !
7527c7662
< !
---
>     !
7532,7534c7667,7669
< !      REAL(KIND=r8)    :: plaiupper   ! potential lai of upper canopy (uniform initial veg)
< !      REAL(KIND=r8)    :: plailower   ! potential lai of lower canopy (uniform initial veg)
< !      REAL(KIND=r8)    :: xminlai     ! minimum lai for each existing plant type
---
>     !      REAL(KIND=r8)    :: plaiupper   ! potential lai of upper canopy (uniform initial veg)
>     !      REAL(KIND=r8)    :: plailower   ! potential lai of lower canopy (uniform initial veg)
>     !      REAL(KIND=r8)    :: xminlai     ! minimum lai for each existing plant type
7536c7671
< !      REAL(KIND=r8)    :: chiflz      ! lower canopy leaf orientation factor 
---
>     !      REAL(KIND=r8)    :: chiflz      ! lower canopy leaf orientation factor 
7538,7540c7673,7675
< !      REAL(KIND=r8)    :: chifuz      ! uppuer canopy leaf orientation factor 
< !      REAL(KIND=r8)    :: beta1       ! parameter for Jackson rooting profile, lower canopy
< !      REAL(KIND=r8)    :: beta2       ! parameter for Jackson rooting profile, upper canopy
---
>     !      REAL(KIND=r8)    :: chifuz      ! uppuer canopy leaf orientation factor 
>     !      REAL(KIND=r8)    :: beta1       ! parameter for Jackson rooting profile, lower canopy
>     !      REAL(KIND=r8)    :: beta2       ! parameter for Jackson rooting profile, upper canopy
7542c7677
<       REAL(KIND=r8)    :: frootnorm1(ibMax,jbMax)    ! normalization factor for Jackson rooting profile,low
---
>     REAL(KIND=r8)    :: frootnorm1 (ibMax,jbMax)  ! normalization factor for Jackson rooting profile,low
7545c7680,7681
< !
---
>     !
>     REAL(KIND=r8)    :: depth(nsoilay)   ! soil layer depth (cm)
7547,7565d7682
< !
< ! initialize specific leaf area values
< !
< !      data specla  / 25.0,  ! tropical broadleaf evergreen trees
< !     >               25.0,  ! tropical broadleaf drought-deciduous trees
< !     >               25.0,  ! warm-temperate broadleaf evergreen trees
< !     >               12.5,  ! temperate conifer evergreen trees
< !     >               25.0,  ! temperate broadleaf cold-deciduous trees
< !     >               12.5,  ! boREAL(KIND=r8) conifer evergreen trees
< !     >               25.0,  ! boreal broadleaf cold-deciduous trees  
< !     >               25.0,  ! boreal conifer cold-deciduous trees
< !     >               12.5,  ! evergreen shrubs 
< !     >               25.0,  ! deciduous shrubs 
< !     >               20.0,  ! warm (c4) grasses
< !     >               20.0 / ! cool (c3) grasses
< !
< !      woodnorm = 7.5
< !
< ! set c allocation coefficients for natural vegetation
7567,7618c7684,7755
< !      aleaf(1)  = 0.30
< !      aroot(1)  = 0.20
< !      awood(1)  = 1. - aleaf(1) - aroot(1)
< !
< !      aleaf(2)  = 0.30
< !      aroot(2)  = 0.20
< !      awood(2)  = 1. - aleaf(2) - aroot(2)
< !
< !      aleaf(3)  = 0.30
< !      aroot(3)  = 0.20
< !      awood(3)  = 1. - aleaf(3) - aroot(3)
< !
< !      aleaf(4)  = 0.30
< !      aroot(4)  = 0.40
< !      awood(4)  = 1. - aleaf(4) - aroot(4)
< !
< !      aleaf(5)  = 0.30
< !      aroot(5)  = 0.20
< !      awood(5)  = 1. - aleaf(5) - aroot(5)
< !
< !      aleaf(6)  = 0.30
< !      aroot(6)  = 0.40
< !      awood(6)  = 1. - aleaf(6) - aroot(6)
< !
< !      aleaf(7)  = 0.30
< !      aroot(7)  = 0.20
< !      awood(7)  = 1. - aleaf(7) - aroot(7)
< !
< !      aleaf(8)  = 0.30
< !      aroot(8)  = 0.20
< !      awood(8)  = 1. - aleaf(8) - aroot(8)
< !
< ! allocation coefficients for shrubs
< !
< !      aleaf(9)  = 0.45
< !      aroot(9)  = 0.40
< !      awood(9)  = 1. - aleaf(9) - aroot(9)
< !
< !      aleaf(10) = 0.45
< !      aroot(10) = 0.35
< !      awood(10) = 1. - aleaf(10) - aroot(10)
< !
< ! allocation coefficients for grasses
< !
< !      aleaf(11) = 0.45
< !      aroot(11) = 0.55
< !      awood(11) = 0.00
< !
< !      aleaf(12) = 0.45
< !      aroot(12) = 0.55
< !      awood(12) = 0.00
< !
---
>     !
>     ! initialize specific leaf area values
>     !
>     !      data specla  / 25.0,  ! tropical broadleaf evergreen trees
>     !     >               25.0,  ! tropical broadleaf drought-deciduous trees
>     !     >               25.0,  ! warm-temperate broadleaf evergreen trees
>     !     >               12.5,  ! temperate conifer evergreen trees
>     !     >               25.0,  ! temperate broadleaf cold-deciduous trees
>     !     >               12.5,  ! boREAL(KIND=r8) conifer evergreen trees
>     !     >               25.0,  ! boreal broadleaf cold-deciduous trees  
>     !     >               25.0,  ! boreal conifer cold-deciduous trees
>     !     >               12.5,  ! evergreen shrubs 
>     !     >               25.0,  ! deciduous shrubs 
>     !     >               20.0,  ! warm (c4) grasses
>     !     >               20.0 / ! cool (c3) grasses
>     !
>     !      woodnorm = 7.5
>     !
>     ! set c allocation coefficients for natural vegetation
> 
>     !      aleaf(1)  = 0.30
>     !      aroot(1)  = 0.20
>     !      awood(1)  = 1. - aleaf(1) - aroot(1)
>     !
>     !      aleaf(2)  = 0.30
>     !      aroot(2)  = 0.20
>     !      awood(2)  = 1. - aleaf(2) - aroot(2)
>     !
>     !      aleaf(3)  = 0.30
>     !      aroot(3)  = 0.20
>     !      awood(3)  = 1. - aleaf(3) - aroot(3)
>     !
>     !      aleaf(4)  = 0.30
>     !      aroot(4)  = 0.40
>     !      awood(4)  = 1. - aleaf(4) - aroot(4)
>     !
>     !      aleaf(5)  = 0.30
>     !      aroot(5)  = 0.20
>     !      awood(5)  = 1. - aleaf(5) - aroot(5)
>     !
>     !      aleaf(6)  = 0.30
>     !      aroot(6)  = 0.40
>     !      awood(6)  = 1. - aleaf(6) - aroot(6)
>     !
>     !      aleaf(7)  = 0.30
>     !      aroot(7)  = 0.20
>     !      awood(7)  = 1. - aleaf(7) - aroot(7)
>     !
>     !      aleaf(8)  = 0.30
>     !      aroot(8)  = 0.20
>     !      awood(8)  = 1. - aleaf(8) - aroot(8)
>     !
>     ! allocation coefficients for shrubs
>     !
>     !      aleaf(9)  = 0.45
>     !      aroot(9)  = 0.40
>     !      awood(9)  = 1. - aleaf(9) - aroot(9)
>     !
>     !      aleaf(10) = 0.45
>     !      aroot(10) = 0.35
>     !      awood(10) = 1. - aleaf(10) - aroot(10)
>     !
>     ! allocation coefficients for grasses
>     !
>     !      aleaf(11) = 0.45
>     !      aroot(11) = 0.55
>     !      awood(11) = 0.00
>     !
>     !      aleaf(12) = 0.45
>     !      aroot(12) = 0.55
>     !      awood(12) = 0.00
>     !
7622,7624c7759,7761
< !
< ! initialize a few climatic variables needed for vegetation
< !
---
>           !
>           ! initialize a few climatic variables needed for vegetation
>           !
7628,7630c7765,7767
< !
< ! initialize the moisture stress factors
< !
---
>              !
>              ! initialize the moisture stress factors
>              !
7633c7770
< !
---
>              !
7635,7636c7772,7773
<              stressl(i,k,j) = 0.0_r8
<              stressu(i,k,j) = 0.0_r8
---
>                 stressl(i,k,j) = 1.0_r8
>                 stressu(i,k,j) = 1.0_r8
7639,7643c7776,7779
< !
< ! initialize running-mean air temperature
< !
< !
<            IF(.NOT.UNDIMENSION)THEN
---
>              !
>              ! initialize running-mean air temperature
>              !
>              !
7646,7652c7782,7784
<            ELSE
<               td   (i,j)    = tgrnd_site(i)
<               a10td(i,j)    = tgrnd_site(i)
<            END IF
< !
< ! initialize running-mean values of canopy photosynthesis rates
< !
---
>              !
>              ! initialize running-mean values of canopy photosynthesis rates
>              !
7658,7660c7790,7792
< ! 
< ! initialize running-mean values of the scaling parameter
< !
---
>              ! 
>              ! initialize running-mean values of the scaling parameter
>              !
7665,7667c7797,7799
< !
< ! initialize litter fall
< !
---
>              !
>              ! initialize litter fall
>              !
7675,7679c7807,7811
< !
< !     initialize this year's growing degree days and temperature of the
< !     warmest and coldest month for existence of pfts (in off-line IBIS,
< !     done in weather.f)
< ! 
---
>              !
>              !     initialize this year's growing degree days and temperature of the
>              !     warmest and coldest month for existence of pfts (in off-line IBIS,
>              !     done in weather.f)
>              ! 
7685c7817
< !
---
>              !
7687,7689c7819,7821
< !
< ! reset counters
< !
---
>              !
>              ! reset counters
>              !
7696,7698c7828,7830
< !
< ! determine number of evergreen plant functional types
< !
---
>              !
>              ! determine number of evergreen plant functional types
>              !
7703,7705c7835,7837
< !
< ! determine number of deciduous plant functional types
< !
---
>              !
>              ! determine number of deciduous plant functional types
>              !
7710,7712c7842,7844
< !
< ! make sure counter is at least 1 (to avoid division by zero)
< !
---
>              !
>              ! make sure counter is at least 1 (to avoid division by zero)
>              !
7715,7717c7847,7849
< !
< ! determine number of shrub functional types
< !
---
>              !
>              ! determine number of shrub functional types
>              !
7720,7722c7852,7854
< !
< ! determine number of herbaceous plant functional types
< !
---
>              !
>              ! determine number of herbaceous plant functional types
>              !
7725,7727c7857,7859
< !
< ! make sure counter is at least 1 (to avoid division by zero)
< !
---
>              !
>              ! make sure counter is at least 1 (to avoid division by zero)
>              !
7730,7732c7862,7864
< !
< ! total number of possible pfts for each canopy
< !
---
>              !
>              ! total number of possible pfts for each canopy
>              !
7735,7737c7867,7869
< !
< ! make sure counter is at least 1 (to avoid division by zero)
< !
---
>              !
>              ! make sure counter is at least 1 (to avoid division by zero)
>              !
7740,7742c7872,7874
< !
< ! cold start of the vegetation
< !
---
>              !
>              ! cold start of the vegetation
>              !
7744,7756c7876,7888
< !
< !
< ! ************************************************************************
< ! case (0) assign vegetation characteristics for static vegetation
< ! ************************************************************************
< !
< ! and
< !
< ! ************************************************************************
< ! case (1) assign vegetation characteristics for dynamic vegtation
< !          that is initialized with fixed vegetation map
< ! ************************************************************************
< !
---
>              !
>              !
>              ! ************************************************************************
>              ! case (0) assign vegetation characteristics for static vegetation
>              ! ************************************************************************
>              !
>              ! and
>              !
>              ! ************************************************************************
>              ! case (1) assign vegetation characteristics for dynamic vegtation
>              !          that is initialized with fixed vegetation map
>              ! ************************************************************************
>              !
7758,7760c7890,7892
< !
< ! translate vegetation type (real) to nearest integer
< !
---
>                 !
>                 ! translate vegetation type (real) to nearest integer
>                 !
7762,7765c7894,7897
< !
< ! for initialization purposes, set the predicted vegetation type
< ! to the initial vegetation type
< !
---
>                 !
>                 ! for initialization purposes, set the predicted vegetation type
>                 ! to the initial vegetation type
>                 !
7767,7813c7899,7945
< !
< ! ---------------------------------------------------
< !  1: tropical evergreen forest / woodland
< !  2: tropical deciduous forest / woodland
< !  3: temperate evergreen broadleaf forest / woodland
< !  4: temperate evergreen conifer forest / woodland
< !  5: temperate deciduous forest / woodland
< !  6: boreal evergreen forest / woodland
< !  7: boreal deciduous forest / woodland
< !  8: mixed forest / woodland
< !  9: savanna
< ! 10: grassland / steppe
< ! 11: dense shrubland
< ! 12: open shrubland
< ! 13: tundra
< ! 14: desert
< ! 15: polar desert / rock / ice
< ! ---------------------------------------------------
< !
< ! these classes consist of some combination of 
< ! plant functional types:
< !
< ! ---------------------------------------------------
< !  1: tropical broadleaf evergreen trees
< !  2: tropical broadleaf drought-deciduous trees
< !  3: warm-temperate broadleaf evergreen trees
< !  4: temperate conifer evergreen trees
< !  5: temperate broadleaf cold-deciduous trees
< !  6: boreal conifer evergreen trees
< !  7: boreal broadleaf cold-deciduous trees
< !  8: boreal conifer cold-deciduous trees
< !  9: evergreen shrubs
< ! 10: cold-deciduous shrubs
< ! 11: warm (c4) grasses
< ! 12: cool (c3) grasses
< ! ---------------------------------------------------
< 
< !*** DTP 2001/05/25. The following code replaces the 450+
< !    lines of stuff that follows it (hence the temporary goto
< !    statement). Note that values of plai_init are read in as
< !    parameters from params.veg. Note also that the declarations
< !    of the four local variables plaievgr, plaideci, plaishrub 
< !    and plaigrass can all be dropped.
< !
< !
< ! initially all values are set to zero
< !
---
>                 !
>                 ! ---------------------------------------------------
>                 !  1: tropical evergreen forest / woodland
>                 !  2: tropical deciduous forest / woodland
>                 !  3: temperate evergreen broadleaf forest / woodland
>                 !  4: temperate evergreen conifer forest / woodland
>                 !  5: temperate deciduous forest / woodland
>                 !  6: boreal evergreen forest / woodland
>                 !  7: boreal deciduous forest / woodland
>                 !  8: mixed forest / woodland
>                 !  9: savanna
>                 ! 10: grassland / steppe
>                 ! 11: dense shrubland
>                 ! 12: open shrubland
>                 ! 13: tundra
>                 ! 14: desert
>                 ! 15: polar desert / rock / ice
>                 ! ---------------------------------------------------
>                 !
>                 ! these classes consist of some combination of 
>                 ! plant functional types:
>                 !
>                 ! ---------------------------------------------------
>                 !  1: tropical broadleaf evergreen trees
>                 !  2: tropical broadleaf drought-deciduous trees
>                 !  3: warm-temperate broadleaf evergreen trees
>                 !  4: temperate conifer evergreen trees
>                 !  5: temperate broadleaf cold-deciduous trees
>                 !  6: boreal conifer evergreen trees
>                 !  7: boreal broadleaf cold-deciduous trees
>                 !  8: boreal conifer cold-deciduous trees
>                 !  9: evergreen shrubs
>                 ! 10: cold-deciduous shrubs
>                 ! 11: warm (c4) grasses
>                 ! 12: cool (c3) grasses
>                 ! ---------------------------------------------------
> 
>                 !*** DTP 2001/05/25. The following code replaces the 450+
>                 !    lines of stuff that follows it (hence the temporary goto
>                 !    statement). Note that values of plai_init are read in as
>                 !    parameters from params.veg. Note also that the declarations
>                 !    of the four local variables plaievgr, plaideci, plaishrub 
>                 !    and plaigrass can all be dropped.
>                 !
>                 !
>                 ! initially all values are set to zero
>                 !
7828,7839c7960,7971
<            plai(i,1,j)  = exist(i,1,j)  / float(ievgr)  * plai_init(1,inveg)
<            plai(i,2,j)  = exist(i,2,j)  / float(ideci)  * plai_init(2,inveg)
<            plai(i,3,j)  = exist(i,3,j)  / float(ievgr)  * plai_init(1,inveg)
<            plai(i,4,j)  = exist(i,4,j)  / float(ievgr)  * plai_init(1,inveg)
<            plai(i,5,j)  = exist(i,5,j)  / float(ideci)  * plai_init(2,inveg)
<            plai(i,6,j)  = exist(i,6,j)  / float(ievgr)  * plai_init(1,inveg)
<            plai(i,7,j)  = exist(i,7,j)  / float(ideci)  * plai_init(2,inveg)
<            plai(i,8,j)  = exist(i,8,j)  / float(ideci)  * plai_init(2,inveg)
<            plai(i,9,j)  = exist(i,9,j)  / float(ishrub) * plai_init(3,inveg)
<            plai(i,10,j) = exist(i,10,j) / float(ishrub) * plai_init(3,inveg)
<            plai(i,11,j) = exist(i,11,j) / float(igrass) * plai_init(4,inveg)
<            plai(i,12,j) = exist(i,12,j) / float(igrass) * plai_init(4,inveg)
---
>                 plai(i,1,j)  = exist(i,1,j)  / REAL(ievgr,kind=r8)  * plai_init(1,inveg)
>                 plai(i,2,j)  = exist(i,2,j)  / REAL(ideci,kind=r8)  * plai_init(2,inveg)
>                 plai(i,3,j)  = exist(i,3,j)  / REAL(ievgr,kind=r8)  * plai_init(1,inveg)
>                 plai(i,4,j)  = exist(i,4,j)  / REAL(ievgr,kind=r8)  * plai_init(1,inveg)
>                 plai(i,5,j)  = exist(i,5,j)  / REAL(ideci,kind=r8)  * plai_init(2,inveg)
>                 plai(i,6,j)  = exist(i,6,j)  / REAL(ievgr,kind=r8)  * plai_init(1,inveg)
>                 plai(i,7,j)  = exist(i,7,j)  / REAL(ideci,kind=r8)  * plai_init(2,inveg)
>                 plai(i,8,j)  = exist(i,8,j)  / REAL(ideci,kind=r8)  * plai_init(2,inveg)
>                 plai(i,9,j)  = exist(i,9,j)  / REAL(ishrub,kind=r8) * plai_init(3,inveg)
>                 plai(i,10,j) = exist(i,10,j) / REAL(ishrub,kind=r8) * plai_init(3,inveg)
>                 plai(i,11,j) = exist(i,11,j) / REAL(igrass,kind=r8) * plai_init(4,inveg)
>                 plai(i,12,j) = exist(i,12,j) / REAL(igrass,kind=r8) * plai_init(4,inveg)
7849,7850c7981,7982
<              plai(i,11,j) = exist(i,11,j) / float(igrass) * plai_init(4,inveg)
<              plai(i,12,j) = exist(i,12,j) / float(igrass) * plai_init(4,inveg)
---
>                    plai(i,11,j) = exist(i,11,j) / REAL(igrass,kind=r8) * plai_init(4,inveg)
>                    plai(i,12,j) = exist(i,12,j) / REAL(igrass,kind=r8) * plai_init(4,inveg)
7859,7861c7991,7993
< !
< ! initially all values are set to zero
< !
---
>                 !
>                 ! initially all values are set to zero
>                 !
7874,7878c8006,8010
< !
< ! ---------------------------------------------------
< !  1: tropical evergreen forest / woodland
< ! ---------------------------------------------------
< !
---
>                 !
>                 ! ---------------------------------------------------
>                 !  1: tropical evergreen forest / woodland
>                 ! ---------------------------------------------------
>                 !
7880c8012
< !
---
>                    !
7885,7898c8017,8030
< !
<               plai(i,1,j)  = exist(i,1,j)  / float(ievgr)  * plaievgr
<               plai(i,2,j)  = exist(i,2,j)  / float(ideci)  * plaideci
<               plai(i,3,j)  = exist(i,3,j)  / float(ievgr)  * plaievgr
<               plai(i,4,j)  = exist(i,4,j)  / float(ievgr)  * plaievgr
<               plai(i,5,j)  = exist(i,5,j)  / float(ideci)  * plaideci
<               plai(i,6,j)  = exist(i,6,j)  / float(ievgr)  * plaievgr
<               plai(i,7,j)  = exist(i,7,j)  / float(ideci)  * plaideci
<               plai(i,8,j)  = exist(i,8,j)  / float(ideci)  * plaideci
<               plai(i,9,j)  = exist(i,9,j)  / float(ishrub) * plaishrub
<               plai(i,10,j) = exist(i,10,j) / float(ishrub) * plaishrub
<               plai(i,11,j) = exist(i,11,j) / float(igrass) * plaigrass
<               plai(i,12,j) = exist(i,12,j) / float(igrass) * plaigrass
< !
---
>                    !
>                    plai(i,1,j)  = exist(i,1,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,2,j)  = exist(i,2,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,3,j)  = exist(i,3,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,4,j)  = exist(i,4,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,5,j)  = exist(i,5,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,6,j)  = exist(i,6,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,7,j)  = exist(i,7,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,8,j)  = exist(i,8,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,9,j)  = exist(i,9,j)  / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,10,j) = exist(i,10,j) / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,11,j) = exist(i,11,j) / REAL(igrass,kind=r8) * plaigrass
>                    plai(i,12,j) = exist(i,12,j) / REAL(igrass,kind=r8) * plaigrass
>                    !
7900,7904c8032,8036
< !
< ! ---------------------------------------------------
< !  2: tropical deciduous forest / woodland
< ! ---------------------------------------------------
< !
---
>                 !
>                 ! ---------------------------------------------------
>                 !  2: tropical deciduous forest / woodland
>                 ! ---------------------------------------------------
>                 !
7906c8038
< !
---
>                    !
7911,7924c8043,8056
< !
<               plai(i,1,j)  = exist(i,1,j)  / float(ievgr)  * plaievgr
<               plai(i,2,j)  = exist(i,2,j)  / float(ideci)  * plaideci
<               plai(i,3,j)  = exist(i,3,j)  / float(ievgr)  * plaievgr
<               plai(i,4,j)  = exist(i,4,j)  / float(ievgr)  * plaievgr
<               plai(i,5,j)  = exist(i,5,j)  / float(ideci)  * plaideci
<               plai(i,6,j)  = exist(i,6,j)  / float(ievgr)  * plaievgr
<               plai(i,7,j)  = exist(i,7,j)  / float(ideci)  * plaideci
<               plai(i,8,j)  = exist(i,8,j)  / float(ideci)  * plaideci
<               plai(i,9,j)  = exist(i,9,j)  / float(ishrub) * plaishrub
<               plai(i,10,j) = exist(i,10,j) / float(ishrub) * plaishrub
<               plai(i,11,j) = exist(i,11,j) / float(igrass) * plaigrass
<               plai(i,12,j) = exist(i,12,j) / float(igrass) * plaigrass
< !
---
>                    !
>                    plai(i,1,j)  = exist(i,1,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,2,j)  = exist(i,2,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,3,j)  = exist(i,3,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,4,j)  = exist(i,4,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,5,j)  = exist(i,5,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,6,j)  = exist(i,6,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,7,j)  = exist(i,7,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,8,j)  = exist(i,8,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,9,j)  = exist(i,9,j)  / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,10,j) = exist(i,10,j) / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,11,j) = exist(i,11,j) / REAL(igrass,kind=r8) * plaigrass
>                    plai(i,12,j) = exist(i,12,j) / REAL(igrass,kind=r8) * plaigrass
>                    !
7926,7930c8058,8062
< !
< ! ---------------------------------------------------
< !  3: temperate evergreen broadleaf forest / woodland
< ! ---------------------------------------------------
< !
---
>                 !
>                 ! ---------------------------------------------------
>                 !  3: temperate evergreen broadleaf forest / woodland
>                 ! ---------------------------------------------------
>                 !
7932c8064
< !
---
>                    !
7937,7950c8069,8082
< !
<               plai(i,1,j)  = exist(i,1,j)  / float(ievgr)  * plaievgr
<               plai(i,2,j)  = exist(i,2,j)  / float(ideci)  * plaideci
<               plai(i,3,j)  = exist(i,3,j)  / float(ievgr)  * plaievgr
<               plai(i,4,j)  = exist(i,4,j)  / float(ievgr)  * plaievgr
<               plai(i,5,j)  = exist(i,5,j)  / float(ideci)  * plaideci
<               plai(i,6,j)  = exist(i,6,j)  / float(ievgr)  * plaievgr
<               plai(i,7,j)  = exist(i,7,j)  / float(ideci)  * plaideci
<               plai(i,8,j)  = exist(i,8,j)  / float(ideci)  * plaideci
<               plai(i,9,j)  = exist(i,9,j)  / float(ishrub) * plaishrub
<               plai(i,10,j) = exist(i,10,j) / float(ishrub) * plaishrub
<               plai(i,11,j) = exist(i,11,j) / float(igrass) * plaigrass
<               plai(i,12,j) = exist(i,12,j) / float(igrass) * plaigrass
< !
---
>                    !
>                    plai(i,1,j)  = exist(i,1,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,2,j)  = exist(i,2,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,3,j)  = exist(i,3,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,4,j)  = exist(i,4,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,5,j)  = exist(i,5,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,6,j)  = exist(i,6,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,7,j)  = exist(i,7,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,8,j)  = exist(i,8,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,9,j)  = exist(i,9,j)  / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,10,j) = exist(i,10,j) / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,11,j) = exist(i,11,j) / REAL(igrass,kind=r8) * plaigrass
>                    plai(i,12,j) = exist(i,12,j) / REAL(igrass,kind=r8) * plaigrass
>                    !
7952,7956c8084,8088
< !
< ! ---------------------------------------------------
< !  4: temperate evergreen conifer forest / woodland
< ! ---------------------------------------------------
< !
---
>                 !
>                 ! ---------------------------------------------------
>                 !  4: temperate evergreen conifer forest / woodland
>                 ! ---------------------------------------------------
>                 !
7958c8090
< !
---
>                    !
7963,7976c8095,8108
< !
<               plai(i,1,j)  = exist(i,1,j)  / float(ievgr)  * plaievgr
<               plai(i,2,j)  = exist(i,2,j)  / float(ideci)  * plaideci
<               plai(i,3,j)  = exist(i,3,j)  / float(ievgr)  * plaievgr
<               plai(i,4,j)  = exist(i,4,j)  / float(ievgr)  * plaievgr
<               plai(i,5,j)  = exist(i,5,j)  / float(ideci)  * plaideci
<               plai(i,6,j)  = exist(i,6,j)  / float(ievgr)  * plaievgr
<               plai(i,7,j)  = exist(i,7,j)  / float(ideci)  * plaideci
<               plai(i,8,j)  = exist(i,8,j)  / float(ideci)  * plaideci
<               plai(i,9,j)  = exist(i,9,j)  / float(ishrub) * plaishrub
<               plai(i,10,j) = exist(i,10,j) / float(ishrub) * plaishrub
<               plai(i,11,j) = exist(i,11,j) / float(igrass) * plaigrass
<               plai(i,12,j) = exist(i,12,j) / float(igrass) * plaigrass
< !
---
>                    !
>                    plai(i,1,j)  = exist(i,1,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,2,j)  = exist(i,2,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,3,j)  = exist(i,3,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,4,j)  = exist(i,4,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,5,j)  = exist(i,5,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,6,j)  = exist(i,6,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,7,j)  = exist(i,7,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,8,j)  = exist(i,8,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,9,j)  = exist(i,9,j)  / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,10,j) = exist(i,10,j) / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,11,j) = exist(i,11,j) / REAL(igrass,kind=r8) * plaigrass
>                    plai(i,12,j) = exist(i,12,j) / REAL(igrass,kind=r8) * plaigrass
>                    !
7978,7982c8110,8114
< !
< ! ---------------------------------------------------
< !  5: temperate deciduous forest / woodland
< ! ---------------------------------------------------
< !
---
>                 !
>                 ! ---------------------------------------------------
>                 !  5: temperate deciduous forest / woodland
>                 ! ---------------------------------------------------
>                 !
7984c8116
< !
---
>                    !
7989,8002c8121,8134
< !
<               plai(i,1,j)  = exist(i,1,j)  / float(ievgr)  * plaievgr
<               plai(i,2,j)  = exist(i,2,j)  / float(ideci)  * plaideci
<               plai(i,3,j)  = exist(i,3,j)  / float(ievgr)  * plaievgr
<               plai(i,4,j)  = exist(i,4,j)  / float(ievgr)  * plaievgr
<               plai(i,5,j)  = exist(i,5,j)  / float(ideci)  * plaideci
<               plai(i,6,j)  = exist(i,6,j)  / float(ievgr)  * plaievgr
<               plai(i,7,j)  = exist(i,7,j)  / float(ideci)  * plaideci
<               plai(i,8,j)  = exist(i,8,j)  / float(ideci)  * plaideci
<               plai(i,9,j)  = exist(i,9,j)  / float(ishrub) * plaishrub
<               plai(i,10,j) = exist(i,10,j) / float(ishrub) * plaishrub
<               plai(i,11,j) = exist(i,11,j) / float(igrass) * plaigrass
<               plai(i,12,j) = exist(i,12,j) / float(igrass) * plaigrass
< !
---
>                    !
>                    plai(i,1,j)  = exist(i,1,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,2,j)  = exist(i,2,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,3,j)  = exist(i,3,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,4,j)  = exist(i,4,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,5,j)  = exist(i,5,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,6,j)  = exist(i,6,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,7,j)  = exist(i,7,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,8,j)  = exist(i,8,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,9,j)  = exist(i,9,j)  / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,10,j) = exist(i,10,j) / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,11,j) = exist(i,11,j) / REAL(igrass,kind=r8) * plaigrass
>                    plai(i,12,j) = exist(i,12,j) / REAL(igrass,kind=r8) * plaigrass
>                    !
8004,8008c8136,8140
< !
< ! ---------------------------------------------------
< !  6: boreal evergreen forest / woodland
< ! ---------------------------------------------------
< !
---
>                 !
>                 ! ---------------------------------------------------
>                 !  6: boreal evergreen forest / woodland
>                 ! ---------------------------------------------------
>                 !
8010c8142
< !
---
>                    !
8015,8028c8147,8160
< !
<               plai(i,1,j)  = exist(i,1,j)  / float(ievgr)  * plaievgr
<               plai(i,2,j)  = exist(i,2,j)  / float(ideci)  * plaideci
<               plai(i,3,j)  = exist(i,3,j)  / float(ievgr)  * plaievgr
<               plai(i,4,j)  = exist(i,4,j)  / float(ievgr)  * plaievgr
<               plai(i,5,j)  = exist(i,5,j)  / float(ideci)  * plaideci
<               plai(i,6,j)  = exist(i,6,j)  / float(ievgr)  * plaievgr
<               plai(i,7,j)  = exist(i,7,j)  / float(ideci)  * plaideci
<               plai(i,8,j)  = exist(i,8,j)  / float(ideci)  * plaideci
<               plai(i,9,j)  = exist(i,9,j)  / float(ishrub) * plaishrub
<               plai(i,10,j) = exist(i,10,j) / float(ishrub) * plaishrub
<               plai(i,11,j) = exist(i,11,j) / float(igrass) * plaigrass
<               plai(i,12,j) = exist(i,12,j) / float(igrass) * plaigrass
< !
---
>                    !
>                    plai(i,1,j)  = exist(i,1,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,2,j)  = exist(i,2,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,3,j)  = exist(i,3,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,4,j)  = exist(i,4,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,5,j)  = exist(i,5,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,6,j)  = exist(i,6,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,7,j)  = exist(i,7,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,8,j)  = exist(i,8,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,9,j)  = exist(i,9,j)  / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,10,j) = exist(i,10,j) / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,11,j) = exist(i,11,j) / REAL(igrass,kind=r8) * plaigrass
>                    plai(i,12,j) = exist(i,12,j) / REAL(igrass,kind=r8) * plaigrass
>                    !
8030,8034c8162,8166
< !
< ! ---------------------------------------------------
< !  7: boreal deciduous forest / woodland
< ! ---------------------------------------------------
< !
---
>                 !
>                 ! ---------------------------------------------------
>                 !  7: boreal deciduous forest / woodland
>                 ! ---------------------------------------------------
>                 !
8036c8168
< !
---
>                    !
8041,8054c8173,8186
< !
<               plai(i,1,j)  = exist(i,1,j)  / float(ievgr)  * plaievgr
<               plai(i,2,j)  = exist(i,2,j)  / float(ideci)  * plaideci
<               plai(i,3,j)  = exist(i,3,j)  / float(ievgr)  * plaievgr
<               plai(i,4,j)  = exist(i,4,j)  / float(ievgr)  * plaievgr
<               plai(i,5,j)  = exist(i,5,j)  / float(ideci)  * plaideci
<               plai(i,6,j)  = exist(i,6,j)  / float(ievgr)  * plaievgr
<               plai(i,7,j)  = exist(i,7,j)  / float(ideci)  * plaideci
<               plai(i,8,j)  = exist(i,8,j)  / float(ideci)  * plaideci
<               plai(i,9,j)  = exist(i,9,j)  / float(ishrub) * plaishrub
<               plai(i,10,j) = exist(i,10,j) / float(ishrub) * plaishrub
<               plai(i,11,j) = exist(i,11,j) / float(igrass) * plaigrass
<               plai(i,12,j) = exist(i,12,j) / float(igrass) * plaigrass
< !
---
>                    !
>                    plai(i,1,j)  = exist(i,1,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,2,j)  = exist(i,2,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,3,j)  = exist(i,3,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,4,j)  = exist(i,4,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,5,j)  = exist(i,5,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,6,j)  = exist(i,6,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,7,j)  = exist(i,7,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,8,j)  = exist(i,8,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,9,j)  = exist(i,9,j)  / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,10,j) = exist(i,10,j) / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,11,j) = exist(i,11,j) / REAL(igrass,kind=r8) * plaigrass
>                    plai(i,12,j) = exist(i,12,j) / REAL(igrass,kind=r8) * plaigrass
>                    !
8056,8060c8188,8192
< !
< ! ---------------------------------------------------
< !  8: mixed forest / woodland
< ! ---------------------------------------------------
< !
---
>                 !
>                 ! ---------------------------------------------------
>                 !  8: mixed forest / woodland
>                 ! ---------------------------------------------------
>                 !
8062c8194
< !
---
>                    !
8067,8080c8199,8212
< !
<               plai(i,1,j)  = exist(i,1,j)  / float(ievgr)  * plaievgr
<               plai(i,2,j)  = exist(i,2,j)  / float(ideci)  * plaideci
<               plai(i,3,j)  = exist(i,3,j)  / float(ievgr)  * plaievgr
<               plai(i,4,j)  = exist(i,4,j)  / float(ievgr)  * plaievgr
<               plai(i,5,j)  = exist(i,5,j)  / float(ideci)  * plaideci
<               plai(i,6,j)  = exist(i,6,j)  / float(ievgr)  * plaievgr
<               plai(i,7,j)  = exist(i,7,j)  / float(ideci)  * plaideci
<               plai(i,8,j)  = exist(i,8,j)  / float(ideci)  * plaideci
<               plai(i,9,j)  = exist(i,9,j)  / float(ishrub) * plaishrub
<               plai(i,10,j) = exist(i,10,j) / float(ishrub) * plaishrub
<               plai(i,11,j) = exist(i,11,j) / float(igrass) * plaigrass
<               plai(i,12,j) = exist(i,12,j) / float(igrass) * plaigrass
< !
---
>                    !
>                    plai(i,1,j)  = exist(i,1,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,2,j)  = exist(i,2,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,3,j)  = exist(i,3,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,4,j)  = exist(i,4,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,5,j)  = exist(i,5,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,6,j)  = exist(i,6,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,7,j)  = exist(i,7,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,8,j)  = exist(i,8,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,9,j)  = exist(i,9,j)  / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,10,j) = exist(i,10,j) / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,11,j) = exist(i,11,j) / REAL(igrass,kind=r8) * plaigrass
>                    plai(i,12,j) = exist(i,12,j) / REAL(igrass,kind=r8) * plaigrass
>                    !
8082,8086c8214,8218
< !
< ! ---------------------------------------------------
< !  9: savanna
< ! ---------------------------------------------------
< !
---
>                 !
>                 ! ---------------------------------------------------
>                 !  9: savanna
>                 ! ---------------------------------------------------
>                 !
8088c8220
< !
---
>                    !
8093,8106c8225,8238
< !
<               plai(i,1,j)  = exist(i,1,j)  / float(ievgr)  * plaievgr
<               plai(i,2,j)  = exist(i,2,j)  / float(ideci)  * plaideci
<               plai(i,3,j)  = exist(i,3,j)  / float(ievgr)  * plaievgr
<               plai(i,4,j)  = exist(i,4,j)  / float(ievgr)  * plaievgr
<               plai(i,5,j)  = exist(i,5,j)  / float(ideci)  * plaideci
<               plai(i,6,j)  = exist(i,6,j)  / float(ievgr)  * plaievgr
<               plai(i,7,j)  = exist(i,7,j)  / float(ideci)  * plaideci
<               plai(i,8,j)  = exist(i,8,j)  / float(ideci)  * plaideci
<               plai(i,9,j)  = exist(i,9,j)  / float(ishrub) * plaishrub
<               plai(i,10,j) = exist(i,10,j) / float(ishrub) * plaishrub
< !
< ! determine if c4/c3 dominated grassland
< !
---
>                    !
>                    plai(i,1,j)  = exist(i,1,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,2,j)  = exist(i,2,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,3,j)  = exist(i,3,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,4,j)  = exist(i,4,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,5,j)  = exist(i,5,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,6,j)  = exist(i,6,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,7,j)  = exist(i,7,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,8,j)  = exist(i,8,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,9,j)  = exist(i,9,j)  / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,10,j) = exist(i,10,j) / REAL(ishrub,kind=r8) * plaishrub
>                    !
>                    ! determine if c4/c3 dominated grassland
>                    !
8114c8246
< !
---
>                    !
8116,8120c8248,8252
< !
< ! ---------------------------------------------------
< ! 10: grassland / steppe
< ! ---------------------------------------------------
< !
---
>                 !
>                 ! ---------------------------------------------------
>                 ! 10: grassland / steppe
>                 ! ---------------------------------------------------
>                 !
8122c8254
< !
---
>                    !
8127,8140c8259,8272
< !
<               plai(i,1,j)  = exist(i,1,j)  / float(ievgr)  * plaievgr
<               plai(i,2,j)  = exist(i,2,j)  / float(ideci)  * plaideci
<               plai(i,3,j)  = exist(i,3,j)  / float(ievgr)  * plaievgr
<               plai(i,4,j)  = exist(i,4,j)  / float(ievgr)  * plaievgr
<               plai(i,5,j)  = exist(i,5,j)  / float(ideci)  * plaideci
<               plai(i,6,j)  = exist(i,6,j)  / float(ievgr)  * plaievgr
<               plai(i,7,j)  = exist(i,7,j)  / float(ideci)  * plaideci
<               plai(i,8,j)  = exist(i,8,j)  / float(ideci)  * plaideci
<               plai(i,9,j)  = exist(i,9,j)  / float(ishrub) * plaishrub
<               plai(i,10,j) = exist(i,10,j) / float(ishrub) * plaishrub
< !
< ! determine if c4/c3 dominated savanna
< !
---
>                    !
>                    plai(i,1,j)  = exist(i,1,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,2,j)  = exist(i,2,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,3,j)  = exist(i,3,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,4,j)  = exist(i,4,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,5,j)  = exist(i,5,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,6,j)  = exist(i,6,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,7,j)  = exist(i,7,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,8,j)  = exist(i,8,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,9,j)  = exist(i,9,j)  / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,10,j) = exist(i,10,j) / REAL(ishrub,kind=r8) * plaishrub
>                    !
>                    ! determine if c4/c3 dominated savanna
>                    !
8148c8280
< !
---
>                    !
8150,8154c8282,8286
< !
< ! ---------------------------------------------------
< ! 11: dense shrubland
< ! ---------------------------------------------------
< !
---
>                 !
>                 ! ---------------------------------------------------
>                 ! 11: dense shrubland
>                 ! ---------------------------------------------------
>                 !
8156c8288
< !
---
>                    !
8161,8174c8293,8306
< !
<               plai(i,1,j)  = exist(i,1,j)  / float(ievgr)  * plaievgr
<               plai(i,2,j)  = exist(i,2,j)  / float(ideci)  * plaideci
<               plai(i,3,j)  = exist(i,3,j)  / float(ievgr)  * plaievgr
<               plai(i,4,j)  = exist(i,4,j)  / float(ievgr)  * plaievgr
<               plai(i,5,j)  = exist(i,5,j)  / float(ideci)  * plaideci
<               plai(i,6,j)  = exist(i,6,j)  / float(ievgr)  * plaievgr
<               plai(i,7,j)  = exist(i,7,j)  / float(ideci)  * plaideci
<               plai(i,8,j)  = exist(i,8,j)  / float(ideci)  * plaideci
<               plai(i,9,j)  = exist(i,9,j)  / float(ishrub) * plaishrub
<               plai(i,10,j) = exist(i,10,j) / float(ishrub) * plaishrub
<               plai(i,11,j) = exist(i,11,j) / float(igrass) * plaigrass
<               plai(i,12,j) = exist(i,12,j) / float(igrass) * plaigrass
< !
---
>                    !
>                    plai(i,1,j)  = exist(i,1,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,2,j)  = exist(i,2,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,3,j)  = exist(i,3,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,4,j)  = exist(i,4,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,5,j)  = exist(i,5,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,6,j)  = exist(i,6,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,7,j)  = exist(i,7,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,8,j)  = exist(i,8,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,9,j)  = exist(i,9,j)  / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,10,j) = exist(i,10,j) / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,11,j) = exist(i,11,j) / REAL(igrass,kind=r8) * plaigrass
>                    plai(i,12,j) = exist(i,12,j) / REAL(igrass,kind=r8) * plaigrass
>                    !
8176,8180c8308,8312
< !
< ! ---------------------------------------------------
< ! 12: open shrubland
< ! ---------------------------------------------------
< !
---
>                 !
>                 ! ---------------------------------------------------
>                 ! 12: open shrubland
>                 ! ---------------------------------------------------
>                 !
8182c8314
< !
---
>                    !
8187,8200c8319,8332
< !
<               plai(i,1,j)  = exist(i,1,j)  / float(ievgr)  * plaievgr
<               plai(i,2,j)  = exist(i,2,j)  / float(ideci)  * plaideci
<               plai(i,3,j)  = exist(i,3,j)  / float(ievgr)  * plaievgr
<               plai(i,4,j)  = exist(i,4,j)  / float(ievgr)  * plaievgr
<               plai(i,5,j)  = exist(i,5,j)  / float(ideci)  * plaideci
<               plai(i,6,j)  = exist(i,6,j)  / float(ievgr)  * plaievgr
<               plai(i,7,j)  = exist(i,7,j)  / float(ideci)  * plaideci
<               plai(i,8,j)  = exist(i,8,j)  / float(ideci)  * plaideci
<               plai(i,9,j)  = exist(i,9,j)  / float(ishrub) * plaishrub
<               plai(i,10,j) = exist(i,10,j) / float(ishrub) * plaishrub
<               plai(i,11,j) = exist(i,11,j) / float(igrass) * plaigrass
<               plai(i,12,j) = exist(i,12,j) / float(igrass) * plaigrass
< !
---
>                    !
>                    plai(i,1,j)  = exist(i,1,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,2,j)  = exist(i,2,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,3,j)  = exist(i,3,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,4,j)  = exist(i,4,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,5,j)  = exist(i,5,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,6,j)  = exist(i,6,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,7,j)  = exist(i,7,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,8,j)  = exist(i,8,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,9,j)  = exist(i,9,j)  / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,10,j) = exist(i,10,j) / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,11,j) = exist(i,11,j) / REAL(igrass,kind=r8) * plaigrass
>                    plai(i,12,j) = exist(i,12,j) / REAL(igrass,kind=r8) * plaigrass
>                    !
8202,8206c8334,8338
< !
< ! ---------------------------------------------------
< ! 13: tundra
< ! ---------------------------------------------------
< !
---
>                 !
>                 ! ---------------------------------------------------
>                 ! 13: tundra
>                 ! ---------------------------------------------------
>                 !
8208c8340
< !
---
>                    !
8213,8226c8345,8358
< !
<               plai(i,1,j)  = exist(i,1,j)  / float(ievgr)  * plaievgr
<               plai(i,2,j)  = exist(i,2,j)  / float(ideci)  * plaideci
<               plai(i,3,j)  = exist(i,3,j)  / float(ievgr)  * plaievgr
<               plai(i,4,j)  = exist(i,4,j)  / float(ievgr)  * plaievgr
<               plai(i,5,j)  = exist(i,5,j)  / float(ideci)  * plaideci
<               plai(i,6,j)  = exist(i,6,j)  / float(ievgr)  * plaievgr
<               plai(i,7,j)  = exist(i,7,j)  / float(ideci)  * plaideci
<               plai(i,8,j)  = exist(i,8,j)  / float(ideci)  * plaideci
<               plai(i,9,j)  = exist(i,9,j)  / float(ishrub) * plaishrub
<               plai(i,10,j) = exist(i,10,j) / float(ishrub) * plaishrub
<               plai(i,11,j) = exist(i,11,j) / float(igrass) * plaigrass
<               plai(i,12,j) = exist(i,12,j) / float(igrass) * plaigrass
< !
---
>                    !
>                    plai(i,1,j)  = exist(i,1,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,2,j)  = exist(i,2,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,3,j)  = exist(i,3,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,4,j)  = exist(i,4,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,5,j)  = exist(i,5,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,6,j)  = exist(i,6,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,7,j)  = exist(i,7,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,8,j)  = exist(i,8,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,9,j)  = exist(i,9,j)  / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,10,j) = exist(i,10,j) / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,11,j) = exist(i,11,j) / REAL(igrass,kind=r8) * plaigrass
>                    plai(i,12,j) = exist(i,12,j) / REAL(igrass,kind=r8) * plaigrass
>                    !
8228,8232c8360,8364
< !
< ! ---------------------------------------------------
< ! 14: desert
< ! ---------------------------------------------------
< !
---
>                 !
>                 ! ---------------------------------------------------
>                 ! 14: desert
>                 ! ---------------------------------------------------
>                 !
8234c8366
< !
---
>                    !
8239,8252c8371,8384
< !
<               plai(i,1,j)  = exist(i,1,j)  / float(ievgr)  * plaievgr
<               plai(i,2,j)  = exist(i,2,j)  / float(ideci)  * plaideci
<               plai(i,3,j)  = exist(i,3,j)  / float(ievgr)  * plaievgr
<               plai(i,4,j)  = exist(i,4,j)  / float(ievgr)  * plaievgr
<               plai(i,5,j)  = exist(i,5,j)  / float(ideci)  * plaideci
<               plai(i,6,j)  = exist(i,6,j)  / float(ievgr)  * plaievgr
<               plai(i,7,j)  = exist(i,7,j)  / float(ideci)  * plaideci
<               plai(i,8,j)  = exist(i,8,j)  / float(ideci)  * plaideci
<               plai(i,9,j)  = exist(i,9,j)  / float(ishrub) * plaishrub
<               plai(i,10,j) = exist(i,10,j) / float(ishrub) * plaishrub
<               plai(i,11,j) = exist(i,11,j) / float(igrass) * plaigrass
<               plai(i,12,j) = exist(i,12,j) / float(igrass) * plaigrass
< !
---
>                    !
>                    plai(i,1,j)  = exist(i,1,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,2,j)  = exist(i,2,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,3,j)  = exist(i,3,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,4,j)  = exist(i,4,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,5,j)  = exist(i,5,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,6,j)  = exist(i,6,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,7,j)  = exist(i,7,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,8,j)  = exist(i,8,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,9,j)  = exist(i,9,j)  / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,10,j) = exist(i,10,j) / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,11,j) = exist(i,11,j) / REAL(igrass,kind=r8) * plaigrass
>                    plai(i,12,j) = exist(i,12,j) / REAL(igrass,kind=r8) * plaigrass
>                    !
8254,8258c8386,8390
< !
< ! ---------------------------------------------------
< ! 15: polar desert / rock / ice
< ! ---------------------------------------------------
< !
---
>                 !
>                 ! ---------------------------------------------------
>                 ! 15: polar desert / rock / ice
>                 ! ---------------------------------------------------
>                 !
8260c8392
< !
---
>                    !
8265,8278c8397,8410
< !
<               plai(i,1,j)  = exist(i,1,j)  / float(ievgr)  * plaievgr
<               plai(i,2,j)  = exist(i,2,j)  / float(ideci)  * plaideci
<               plai(i,3,j)  = exist(i,3,j)  / float(ievgr)  * plaievgr
<               plai(i,4,j)  = exist(i,4,j)  / float(ievgr)  * plaievgr
<               plai(i,5,j)  = exist(i,5,j)  / float(ideci)  * plaideci
<               plai(i,6,j)  = exist(i,6,j)  / float(ievgr)  * plaievgr
<               plai(i,7,j)  = exist(i,7,j)  / float(ideci)  * plaideci
<               plai(i,8,j)  = exist(i,8,j)  / float(ideci)  * plaideci
<               plai(i,9,j)  = exist(i,9,j)  / float(ishrub) * plaishrub
<               plai(i,10,j) = exist(i,10,j) / float(ishrub) * plaishrub
<               plai(i,11,j) = exist(i,11,j) / float(igrass) * plaigrass
<               plai(i,12,j) = exist(i,12,j) / float(igrass) * plaigrass
< !
---
>                    !
>                    plai(i,1,j)  = exist(i,1,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,2,j)  = exist(i,2,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,3,j)  = exist(i,3,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,4,j)  = exist(i,4,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,5,j)  = exist(i,5,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,6,j)  = exist(i,6,j)  / REAL(ievgr,kind=r8)  * plaievgr
>                    plai(i,7,j)  = exist(i,7,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,8,j)  = exist(i,8,j)  / REAL(ideci,kind=r8)  * plaideci
>                    plai(i,9,j)  = exist(i,9,j)  / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,10,j) = exist(i,10,j) / REAL(ishrub,kind=r8) * plaishrub
>                    plai(i,11,j) = exist(i,11,j) / REAL(igrass,kind=r8) * plaigrass
>                    plai(i,12,j) = exist(i,12,j) / REAL(igrass,kind=r8) * plaigrass
>                    !
8280c8412
< !
---
>                 !
8287,8294c8419,8426
< !
< ! ************************************************************************
< ! case (2) assign vegetation characteristics for dynamic vegtation
< !          that is initialized with uniform vegetation conditions
< ! ************************************************************************
< !
< ! specify uniform initial conditions
< !
---
>              !
>              ! ************************************************************************
>              ! case (2) assign vegetation characteristics for dynamic vegtation
>              !          that is initialized with uniform vegetation conditions
>              ! ************************************************************************
>              !
>              ! specify uniform initial conditions
>              !
8296,8312c8428,8444
< !
< !            plaiupper = 0.5
< !            plailower = 0.5
< !
<             plai(i,1,j)  = exist(i,1,j)  / float(iupper) * plaiupper
<             plai(i,2,j)  = exist(i,2,j)  / float(iupper) * plaiupper
<             plai(i,3,j)  = exist(i,3,j)  / float(iupper) * plaiupper
<             plai(i,4,j)  = exist(i,4,j)  / float(iupper) * plaiupper
<             plai(i,5,j)  = exist(i,5,j)  / float(iupper) * plaiupper
<             plai(i,6,j)  = exist(i,6,j)  / float(iupper) * plaiupper
<             plai(i,7,j)  = exist(i,7,j)  / float(iupper) * plaiupper
<             plai(i,8,j)  = exist(i,8,j)  / float(iupper) * plaiupper
<             plai(i,9,j)  = exist(i,9,j)  / float(ilower) * plailower
<             plai(i,10,j) = exist(i,10,j) / float(ilower) * plailower
<             plai(i,11,j) = exist(i,11,j) / float(ilower) * plailower
<             plai(i,12,j) = exist(i,12,j) / float(ilower) * plailower
< !
---
>                 !
>                 !            plaiupper = 0.5
>                 !            plailower = 0.5
>                 !
>                 plai(i,1,j)  = exist(i,1,j)  / REAL(iupper,kind=r8) * plaiupper
>                 plai(i,2,j)  = exist(i,2,j)  / REAL(iupper,kind=r8) * plaiupper
>                 plai(i,3,j)  = exist(i,3,j)  / REAL(iupper,kind=r8) * plaiupper
>                 plai(i,4,j)  = exist(i,4,j)  / REAL(iupper,kind=r8) * plaiupper
>                 plai(i,5,j)  = exist(i,5,j)  / REAL(iupper,kind=r8) * plaiupper
>                 plai(i,6,j)  = exist(i,6,j)  / REAL(iupper,kind=r8) * plaiupper
>                 plai(i,7,j)  = exist(i,7,j)  / REAL(iupper,kind=r8) * plaiupper
>                 plai(i,8,j)  = exist(i,8,j)  / REAL(iupper,kind=r8) * plaiupper
>                 plai(i,9,j)  = exist(i,9,j)  / REAL(ilower,kind=r8) * plailower
>                 plai(i,10,j) = exist(i,10,j) / REAL(ilower,kind=r8) * plailower
>                 plai(i,11,j) = exist(i,11,j) / REAL(ilower,kind=r8) * plailower
>                 plai(i,12,j) = exist(i,12,j) / REAL(ilower,kind=r8) * plailower
>                 !
8318,8326c8450,8458
< !
< ! ************************************************************************
< ! for both cases (1) and (2)
< ! ************************************************************************
< !
< ! set minimum lai for each existing plant type
< !
< !          xminlai = 0.010
< !
---
>              !
>              ! ************************************************************************
>              ! for both cases (1) and (2)
>              ! ************************************************************************
>              !
>              ! set minimum lai for each existing plant type
>              !
>              !          xminlai = 0.010
>              !
8342,8347c8474,8478
< 
< !
< !
< ! set sapwood fraction and biomass characteristics
< !
< !          sapfrac(i) = 0.1
---
>              !
>              !
>              ! set sapwood fraction and biomass characteristics
>              !
>              !          sapfrac(i) = 0.1
8349c8480
< !
---
>              !
8351c8482
< !
---
>              !
8353c8484
< !
---
>              !
8359c8490
< !
---
>                 !
8362c8493
< !
---
>                 !
8365c8496
< !
---
>                 !
8368c8499
< !
---
>                 !
8370,8376c8501,8507
< !
< ! ************************************************************************
< ! determine basic vegetation structure characteristics
< ! ************************************************************************
< ! 
< ! total leaf area for upper and lower canopies
< !
---
>              !
>              ! ************************************************************************
>              ! determine basic vegetation structure characteristics
>              ! ************************************************************************
>              ! 
>              ! total leaf area for upper and lower canopies
>              !
8381c8512
< !
---
>              !
8384c8515
< !
---
>              !
8393c8524
< !
---
>              !
8398,8421c8529,8537
< !
< ! fractional cover
< !  woodnorm=7.5_r8 !  woodnorm  ! value of woody biomass for upper canopy closure (ie when 
< !                               !wood = woodnorm fu = 1.0) (kg_C m-2)
< !                               leaf optical properties from Sellers et al., 1996 and Bonan, 1995
< 
< !
< !       fu(i) = wood / woodnorm
< !
< !PK        fu(i,j) = (1.0_r8 - exp(-wood)) / (1.0_r8 - exp(-woodnorm))
< !PK        fl(i,j) = totlail(i,j) / 1.0_r8
< 
< !PK         PRINT*,'pkubota',totlaiu(i,j),totlaiu(i,j),totlail(i,j), NINT (xinveg(i,j))
<         IF((totlaiu(i,j)+totlail(i,j)) <= 0.0_r8)THEN
<            fu(i,j) = 0.0_r8
<            fl(i,j) = 0.0_r8
<         ELSE
<            fu(i,j) = (1.0_r8 - exp(-totlaiu(i,j))) / (1.0_r8 - exp(-(totlaiu(i,j)+totlail(i,j))))
<            fl(i,j) = (1.0_r8 - exp(-totlail(i,j))) / (1.0_r8 - exp(-(totlaiu(i,j)+totlail(i,j))))
<         END IF
< 
< !PRINT*,'step2','fu(i,j)=',fu(i,j),'fl(i,j)=',fl(i,j),'wood=',wood,'totbiou(i,j)=',totbiou(i,j),'totbiol(i,j)=',totbiol(i,j)
< 
< !
---
>              !
>              ! fractional cover
>              !
>              !       fu(i) = wood / woodnorm
>              !
>              fu(i,j) = (1.0_r8 - EXP(-wood)) / (1.0_r8 - EXP(-woodnorm))
>              !
>              fl(i,j) = totlail(i,j) / 1.0_r8
>              !
8424,8428c8540,8542
< !PRINT*,'step2','fu(i,j)=',fu(i,j),'fl(i,j)=',fl(i,j)
< !STOP
< !
< ! initial single-sided sai for upper and lower canopies
< !
---
>              !
>              ! initial single-sided sai for upper and lower canopies
>              !
8432,8434c8546,8548
< !
< ! initial lai for canopy physics
< !
---
>              !
>              ! initial lai for canopy physics
>              !
8437,8441c8551,8555
< !
< ! specify canopy height parameters
< ! calculated as a function of only the vegetative fraction
< ! of each grid cell
< !
---
>              !
>              ! specify canopy height parameters
>              ! calculated as a function of only the vegetative fraction
>              ! of each grid cell
>              !
8443c8557
< !       ztop(i,1,j) =  max (0.25_r8, totlail(i) * 0.25_r8)
---
>              !       ztop(i,1,j) =  max (0.25_r8, totlail(i) * 0.25_r8)
8445,8450c8559,8564
< !
< !PK        zbot(i,2,j) =  ztop(i,1,j) + 1.0_r8 
< !       ztop(i,2,j) =  max (zbot(i,2,j) + 1.00_r8, 2.50_r8 * totbiou(i,j) * 0.75_r8)
< !PK        ztop(i,2,j) =  max (zbot(i,2,j) + 1.00_r8,    &
< !PK                          2.50_r8 * totbiou(i,j) / fu(i,j) * 0.75_r8)
< !
---
>              !
>              !PK        zbot(i,2,j) =  ztop(i,1,j) + 1.0_r8 
>              !       ztop(i,2,j) =  max (zbot(i,2,j) + 1.00_r8, 2.50_r8 * totbiou(i,j) * 0.75_r8)
>              !PK        ztop(i,2,j) =  max (zbot(i,2,j) + 1.00_r8,    &
>              !PK                          2.50_r8 * totbiou(i,j) / fu(i,j) * 0.75_r8)
>              !
8453,8456c8567,8570
< !
< ! constrain ztop of lower canopy to be at least 0.5 meter lower than
< ! zbot for upper canopy
< !
---
>              !
>              ! constrain ztop of lower canopy to be at least 0.5 meter lower than
>              ! zbot for upper canopy
>              !
8459,8684d8572
< !
< ! ************************************************************************
< ! case (3) assign vegetation characteristics for model restart
< ! ************************************************************************
< !
< !        ELSE    ! else for restart if loop
< !
< !          DO k = 1, npft
< !
< !            plai(i,k,j) = cbiol(i,k,j) * specla(k)
< !            biomass(i,k,j) = cbiol(i,k,j) + cbiow(i,k,j) + cbior(i,k,j)
< !
< !          END DO
< ! ************************************************************************
< ! determine basic vegetation structure characteristics
< ! ************************************************************************
< ! 
< ! total leaf area for upper and lower canopies
< !
< !          totlaiu(i,j)  =  plai(i,1,j) + plai(i,2,j) +  &
< !                           plai(i,3,j) + plai(i,4,j) +  &
< !                           plai(i,5,j) + plai(i,6,j) +  &
< !                           plai(i,7,j) + plai(i,8,j) 
< !
< !          totlail(i,j)  =  plai(i,9,j)  + plai(i,10,j) + &
< !                           plai(i,11,j) + plai(i,12,j) 
< !
< !          totbiou(i,j)  = biomass(i,1,j) + &
< !     		          biomass(i,2,j) + &
< !     		          biomass(i,3,j) + &
< !     		          biomass(i,4,j) + &
< !     		          biomass(i,5,j) + &
< !     		          biomass(i,6,j) + &
< !     		          biomass(i,7,j) + &
< !     		          biomass(i,8,j) 
< !
< !          totbiol(i,j)  = biomass(i,9,j)  + &
< !      		          biomass(i,10,j) + &
< !     		          biomass(i,11,j) + &
< !      		          biomass(i,12,j) 
< !!
< ! initial single-sided sai for upper and lower canopies
< !
< !          sai(i,1,j)  =  0.050_r8 * totlail(i,j)
< !          sai(i,2,j)  =  0.250_r8 * totlaiu(i,j)
< !
< ! Lai read from restart file
< !
< ! specify canopy height parameters
< ! calculated as a function of only the vegetative fraction
< ! of each grid cell
< !
< !        zbot(i,1,j) =  0.05_r8
< !       ztop(i,1,j) =  max (0.25_r8, totlail(i) * 0.25_r8)
< !        ztop(i,1,j) =  max (0.25_r8, lai(i,1,j) * 0.25_r8)
< !
< !        zbot(i,2,j) =  3.0_r8
< !        ztop(i,2,j) =  max (zbot(i,2,j) + 1.0_r8, 2.5_r8*totbiou(i,j) / fu(i,j) * 0.75_r8)
< !
< ! constrain ztop of lower canopy to be at least 0.5 meter lower than
< ! zbot for upper canopy
< !
< !        ztop(i,1,j) = min (ztop(i,1,j), zbot(i,2,j) - 0.5_r8)
< 
<         END IF  ! end restart if loop
< !
<       END DO !DO i=1,npoi
<       END DO
<       
< !
< ! ************************************************************************
< ! assign some physical properties of vegetation
< ! ************************************************************************
< !
< ! leaf optical properties were taken from Sellers et al., 1996
< ! and Bonan, 1995
< !
< !      rhoveg(1,1) = 0.10     ! vis leaf reflectance, lower story
< !      rhoveg(1,2) = 0.10     ! vis leaf reflectance, upper story 
< !
< !      rhoveg(2,1) = 0.60     ! nir leaf reflectance, lower story
< !      rhoveg(2,2) = 0.40     ! nir leaf reflectance, upper story
< !
< !      tauveg(1,1) = 0.07     ! vis leaf transmittance, lower story
< !      tauveg(1,2) = 0.05     ! vis leaf transmittance, upper story
< !
< !      tauveg(2,1) = 0.25     ! nir leaf transmittance, lower story
< !      tauveg(2,2) = 0.20     ! nir leaf transmittance, upper story
< !
< !      chiflz = -0.5          ! leaf orientation factors (-1 vertical, 0 random, 1 horizontal)
< !      chifuz =  0.0          ! leaf orientation factors (-1 vertical, 0 random, 1 horizontal)
< !
<       oriev(1) = max (-chiflz, 0.0_r8)
<       oriev(2) = max (-chifuz, 0.0_r8)
< !
<       orieh(1) = max ( chiflz, 0.0_r8)
<       orieh(2) = max ( chifuz, 0.0_r8)
< !
< !      dleaf(1) = 0.10        ! linear dimensions for aerodynamic flux parameterization
< !      dstem(1) = 0.10        ! linear dimensions for aerodynamic flux parameterization
< !
< !      dleaf(2) = 0.10        ! linear dimensions for aerodynamic flux parameterization
< !      dstem(2) = 0.10        ! linear dimensions for aerodynamic flux parameterization
< !
< !      chu = ch2o *  2.0      ! heat capacity of upper leaves
< !      chl = ch2o *  2.0      ! heat capacity of lower leaves
< !      chs = ch2o * 50.0      ! heat capacity of stems
< !
< !      alaimu = 8.0           ! normalization constant for upper canopy aerodynamics
< !      alaiml = 8.0           ! normalization constant for lower canopy aerodynamics
< !
< !      cleaf  = 0.01          ! constant in leaf-air aero transfer parameterization
< !      cgrass = 0.01          ! constant in leaf-air aero transfer parameterization
< !      cstem  = 0.01          ! constant in leaf-air aero transfer parameterization
< !
< !      wliqumax = 0.20        ! intercepted water capacity (mm h2o per unit leaf area)
< !      wliqsmax = 0.40        ! intercepted water capacity (mm h2o per unit leaf area)
< !      wliqlmax = 0.20        ! intercepted water capacity (mm h2o per unit leaf area)
< !
< !      wsnoumax = 2.00        ! intercepted snow capacity (mm h2o per unit leaf area)
< !      wsnosmax = 4.00        ! intercepted snow capacity (mm h2o per unit leaf area)
< !      wsnolmax = 2.00        ! intercepted snow capacity (mm h2o per unit leaf area)
< !
< !      tdripu =  2.0 * 3600.0 ! decay time for intercepted liquid dripoff (sec)
< !      tdrips =  2.0 * 3600.0 ! decay time for intercepted liquid dripoff (sec)
< !      tdripl =  2.0 * 3600.0 ! decay time for intercepted liquid dripoff (sec)
< !
< !      tblowu = 12.0 * 3600.0 ! decay time for snow blowoff (sec)
< !      tblows = 12.0 * 3600.0 ! decay time for snow blowoff (sec)
< !      tblowl = 12.0 * 3600.0 ! decay time for snow blowoff (sec)
< !
< ! ************************************************************************
< ! define rooting profiles
< ! ************************************************************************
< !
< ! define rooting profiles based upon data published in:
< !
< ! Jackson et al., 1996:  A global analysis of root distributions
< ! for terrestrial biomes, Oecologia, 108, 389-411.
< !
< ! and
< !
< ! Jackson et al., 1997:  A global budget for fine root biomass, 
< ! surface area, and nutrient contents, Proceedings of the National
< ! Academy of Sciences, 94, 7362-7366.
< !
< ! rooting profiles are defined by the "beta" parameter
< !
< ! beta1 is assigned to the lower vegetation layer (grasses and shrubs)
< ! beta2 is assigned to the upper vegetation layer (trees)
< !
< ! according to Jackson et al. (1996, 1997), the values of beta
< ! typically fall in the following range
< !
< ! note that the 1997 paper specifically discusses the distribution
< ! of *fine roots* (instead of total root biomass), which may be more
< ! important for water and nutrient uptake
< !
< ! --------------                 ------------   ------------
< ! forest systems                 beta2 (1996)   beta2 (1997)
< ! --------------                 ------------   ------------
< ! tropical evergreen forest:        0.962          0.972
< ! tropical deciduous forest:        0.961          0.982
< ! temperate conifer forest:         0.976          0.980
< ! temperate broadleaf forest:       0.966          0.967
< ! all tropical/temperate forest:    0.970  
< ! boreal forest:                    0.943          0.943
< ! all trees:                                       0.976
< !
< ! -------------------------      ------------   ------------
< ! grassland / shrub systems      beta1 (1996)   beta1 (1997)
< ! -------------------------      ------------   ------------
< ! tropical grassland / savanna:     0.972          0.972
< ! temperate grassland:              0.943          0.943
< ! all grasses:                      0.952          0.952
< ! schlerophyllous shrubs:           0.964          0.950
< ! all shrubs:                       0.978          0.975
< ! crops:                            0.961
< ! desert:                           0.975          0.970
< ! tundra:                           0.914
< !
< ! --------------                 ------------
< ! all ecosystems                 beta  (1996)
< ! --------------                 ------------
< ! all ecosystems:                   0.966
< !
< ! for global simulations, we typically assign the following
< ! values to the beta parameters
< !
< ! beta1 = 0.950, which is typical for tropical/temperate grasslands
< ! beta2 = 0.970, which is typical for tropical/temperate forests
< !
< ! however, these values could be (and should be) further refined
< ! when using the model for specific regions
< ! 
< !      beta1 = 0.950  ! for lower layer herbaceous plants
< !      beta2 = 0.975  ! for upper layer trees
< !
< ! calculate total depth in centimeters
< !
< !
< !   totdepth = 0.0_r8
< !   DO k = 1, nsoilay
< !      DO j=1,jbMax
< !         DO i=1,nlpoints(j) 
< !            totdepth(i,j) = totdepth(i,j) + hsoi(i,k,j) * 100.0_r8
< !         END DO  
< !      END DO 
< !   END DO
< !   !
< !   ! normalization factors
< !   !
< !   DO j=1,jbMax
< !      DO i=1,nlpoints(j) 
< !         inveg = NINT (xinveg(i,j))
< !         frootnorm1(i,j) = 1.0_r8 - beta1(inveg) ** totdepth(i,j)
< !         frootnorm2(i,j) = 1.0_r8 - beta2(inveg) ** totdepth(i,j)
< !      END DO 
< !   END DO
< !
< !
< !
< ! calculate rooting profiles
< !
< 
<    DO k = 1, nsoilay
8686,8742c8574,8576
<       DO j=1,jbMax
<          DO i=1,nlpoints(j) 
< 
<                inveg = NINT (xinveg(i,j))
< 
< !              IF (k.eq.1) THEN
< !
< !                 depth(k) = hsoi(i,k,j) * 100.0_r8 
< !                 depth_aux(i,k,j) = hsoi(i,k,j) * 100.0_r8
< !
< !                 froot(i,k,1,j) = 1.0_r8 - beta1(inveg) ** depth_aux(i,k,j)
< !                 froot(i,k,2,j) = 1.0_r8 - beta2(inveg) ** depth_aux(i,k,j)
< !
< !              ELSE
< !
< !                 depth(k)         = depth(k-1)         + hsoi(i,k,j) * 100.0_r8
< !                 depth_aux(i,k,j) = depth_aux(i,k-1,j) + hsoi(i,k,j) * 100.0_r8
< 
< !
< !                 froot(i,k,1,j) = (1.0_r8 - beta1(inveg) ** depth_aux(i,k,j)) -  &
< !                                  (1.0_r8 - beta1(inveg) ** depth_aux(i,k-1,j)) 
< !
< !                 froot(i,k,2,j) = (1.0_r8 - beta2(inveg) ** depth_aux(i,k,j)) -   & 
< !                                  (1.0_r8 - beta2(inveg) ** depth_aux(i,k-1,j)) 
< !
< !              END IF
< !
< !              froot(i,k,1,j) = froot(i,k,1,j) / frootnorm1(i,j)
< !              froot(i,k,2,j) = froot(i,k,2,j) / frootnorm2(i,j)
< !
<                bperm(i,j) =bperm_in(inveg)
<             END DO
<          END DO
<       END DO
<       IF(TRIM(rootmode) == 'JACKSON')THEN
<          CALL RootingProfilesJackson(nVegClass,nsoilay,ibMax,jbMax,hsoi,xinveg,beta1,beta2,froot)
<       ELSE  IF(TRIM(rootmode) == 'MILENA')THEN
<          CALL RootingProfilesMilenaFixed(nsoilay,ibMax,jbMax,hsoi,xinveg,froot)
<       ELSE
<          PRINT*, 'ERROR at rootmode parameter',TRIM(rootmode)
<          STOP
<       END IF 
< !
< ! return to main program
< !
<       RETURN
<       END SUBROUTINE iniveg
< !
<       SUBROUTINE RootingProfilesMilenaFixed(nsoilay,ibMax,jbMax,hsoi,xinveg,froot)
<         IMPLICIT  NONE
<         INTEGER, INTENT(IN   ) :: ibMax
<         INTEGER, INTENT(IN   ) :: jbMax
<         INTEGER, INTENT(IN   ) :: nsoilay
<         REAL(KIND=r8), INTENT(IN   ) :: hsoi         (ibMax,nsoilay+1,jbMax)! soil layer thickness (m)
<         REAL(KIND=r8), INTENT(IN   ) :: xinveg       (ibMax,jbMax) ! fixed vegetation map
<         REAL(KIND=r8), INTENT(INOUT) :: froot    (ibMax,nsoilay,2,jbMax)! global! fraction of root in soil layer 
< 
---
>              ! ************************************************************************
>              ! case (3) assign vegetation characteristics for model restart
>              ! ************************************************************************
8744c8578
<         ! LOCAL VARIABEL
---
>              !        ELSE    ! else for restart if loop
8746,8866c8580,8585
<         REAL(KIND=r8)    :: totdepth  (ibMax,jbMax)  ! total soil depth
<         REAL(KIND=r8)    :: frootnorm1(ibMax,jbMax)  ! normalization factor for Jackson rooting profile,low
<         REAL(KIND=r8)    :: frootnorm2 (ibMax,jbMax) ! normalization factor for Jackson rooting profile, up
<         !REAL(KIND=r8)    :: depth(nsoilay)   ! soil layer depth (cm)
<         REAL(KIND=r8)    :: depth_aux(ibMax,nsoilay,jbMax)   ! soil layer depth (cm)
< 
<         REAL(KIND=r8), PARAMETER    :: beta_lw_canopy(nVegClass)     = RESHAPE ( (/ &
<         !  beta_lw_canopy        !                                                  beta_lw_canopy
<         2.100_r8, &    !  1: tropical evergreen forest / woodland                 0.962
<         1.800_r8, &    !  2: tropical deciduous forest / woodland                 0.961
<         2.000_r8, &    !  3: temperate evergreen broadleaf forest / woodland      0.966
<         2.700_r8, &    !  4: temperate evergreen conifer forest / woodland        0.966
<         2.100_r8, &    !  5: temperate deciduous forest / woodland                0.965
<         1.500_r8, &    !  6: boreal evergreen forest / woodland                   0.960
<         1.400_r8, &    !  7: boreal deciduous forest / woodland                   0.950
<         1.800_r8, &    !  8: mixed forest / woodland                              0.960
<         1.300_r8, &    !  9: savanna                                              0.962
<         1.000_r8, &    ! 10: grassland / steppe                                   0.952
<         1.200_r8, &    ! 11: dense shrubland                                      0.970
<         1.100_r8, &    ! 12: open shrubland                                       0.950
<         1.000_r8, &    ! 13: tundra                                               0.914
<         2.000_r8, &    ! 14: desert                                               0.970
<         1.900_r8  &    ! 15: polar desert / rock / ice                            0.970
<         /), (/nVegClass/) )!---->  grassland / shrub systems  
< 
<         REAL(KIND=r8), PARAMETER    :: beta_up_canopy(nVegClass)     = RESHAPE ( (/ &
<         !  beta_up_canopy        !                                                 beta_up_canopy
<         2.600_r8, &    !  1: tropical evergreen forest / woodland                 0.962
<         2.300_r8, &    !  2: tropical deciduous forest / woodland                 0.961
<         2.300_r8, &    !  3: temperate evergreen broadleaf forest / woodland      0.966
<         2.400_r8, &    !  4: temperate evergreen conifer forest / woodland        0.966
<         2.200_r8, &    !  5: temperate deciduous forest / woodland                0.965
<         1.300_r8, &    !  6: boreal evergreen forest / woodland                   0.960
<         1.300_r8, &    !  7: boreal deciduous forest / woodland                   0.950
<         2.500_r8, &    !  8: mixed forest / woodland                              0.960
<         1.500_r8, &    !  9: savanna                                              0.962
<         1.200_r8, &    ! 10: grassland / steppe                                   0.952
<         1.200_r8, &    ! 11: dense shrubland                                      0.970
<         1.100_r8, &    ! 12: open shrubland                                       0.950
<         1.000_r8, &    ! 13: tundra                                               0.914
<         2.100_r8, &    ! 14: desert                                               0.970
<         2.000_r8  &    ! 15: polar desert / rock / ice                            0.970
<         /), (/nVegClass/) )!---->  grassland / shrub systems  
< 
<         REAL(KIND=r8), PARAMETER    :: theta_lw_canopy(nVegClass)     = RESHAPE ( (/ &
<         !  theta_lw_canopy        !                                                theta_lw_canopy
<         50.0_r8, &    !  1: tropical evergreen forest / woodland                 0.962
<         40.0_r8, &    !  2: tropical deciduous forest / woodland                 0.961
<         45.0_r8, &    !  3: temperate evergreen broadleaf forest / woodland      0.966
<         33.0_r8, &    !  4: temperate evergreen conifer forest / woodland        0.966
<         28.0_r8, &    !  5: temperate deciduous forest / woodland                0.965
<         29.0_r8, &    !  6: boreal evergreen forest / woodland                   0.960
<         27.0_r8, &    !  7: boreal deciduous forest / woodland                   0.950
<         28.0_r8, &    !  8: mixed forest / woodland                              0.960
<         50.0_r8, &    !  9: savanna                                              0.962
<         18.0_r8, &    ! 10: grassland / steppe                                   0.952
<         40.0_r8, &    ! 11: dense shrubland                                      0.970
<         40.0_r8, &    ! 12: open shrubland                                       0.950
<         15.0_r8, &    ! 13: tundra                                               0.914
<         13.0_r8, &    ! 14: desert                                               0.970
<         13.0_r8  &    ! 15: polar desert / rock / ice                            0.970
<         /), (/nVegClass/) )!---->  grassland / shrub systems  
< 
<         REAL(KIND=r8), PARAMETER    :: theta_up_canopy(nVegClass)     = RESHAPE ( (/ &
<         !  theta_up_canopy        !                                                theta_up_canopy
<         200.0_r8, &    !  1: tropical evergreen forest / woodland                 0.962
<         150.0_r8, &    !  2: tropical deciduous forest / woodland                 0.961
<         150.0_r8, &    !  3: temperate evergreen broadleaf forest / woodland      0.966
<         120.0_r8, &    !  4: temperate evergreen conifer forest / woodland        0.966
<          60.0_r8, &    !  5: temperate deciduous forest / woodland                0.965
<          35.0_r8, &    !  6: boreal evergreen forest / woodland                   0.960
<          40.0_r8, &    !  7: boreal deciduous forest / woodland                   0.950
<          50.0_r8, &    !  8: mixed forest / woodland                              0.960
<          70.0_r8, &    !  9: savanna                                              0.962
<          23.0_r8, &    ! 10: grassland / steppe                                   0.952
<          60.0_r8, &    ! 11: dense shrubland                                      0.970
<          50.0_r8, &    ! 12: open shrubland                                       0.950
<          16.0_r8, &    ! 13: tundra                                               0.914
<          13.0_r8, &    ! 14: desert                                               0.970
<          13.0_r8  &    ! 15: polar desert / rock / ice                            0.970
<          /), (/nVegClass/) )!---->  grassland / shrub systems  
< 
<          REAL(KIND=r8), PARAMETER    :: delta_lw_canopy(nVegClass)     = RESHAPE ( (/ &
<          !  delta_lw_canopy        !                                                delta_lw_canopy
<          1.000_r8, &    !  1: tropical evergreen forest / woodland                 0.962
<          1.000_r8, &    !  2: tropical deciduous forest / woodland                 0.961
<          1.000_r8, &    !  3: temperate evergreen broadleaf forest / woodland      0.966
<          1.000_r8, &    !  4: temperate evergreen conifer forest / woodland        0.966
<          1.000_r8, &    !  5: temperate deciduous forest / woodland                0.965
<          1.000_r8, &    !  6: boreal evergreen forest / woodland                   0.960
<          1.000_r8, &    !  7: boreal deciduous forest / woodland                   0.950
<          1.000_r8, &    !  8: mixed forest / woodland                              0.960
<          1.000_r8, &    !  9: savanna                                              0.962
<          1.000_r8, &    ! 10: grassland / steppe                                   0.952
<          1.000_r8, &    ! 11: dense shrubland                                      0.970
<          1.000_r8, &    ! 12: open shrubland                                       0.950
<          1.000_r8, &    ! 13: tundra                                               0.914
<          1.000_r8, &    ! 14: desert                                               0.970
<          1.000_r8  &    ! 15: polar desert / rock / ice                            0.970
<          /), (/nVegClass/) )!---->  grassland / shrub systems  
< 
<          REAL(KIND=r8), PARAMETER    :: delta_up_canopy(nVegClass)     = RESHAPE ( (/ &
<          !  delta_up_canopy        !                                                delta_up_canopy
<          1.000_r8, &    !  1: tropical evergreen forest / woodland                 0.962
<          1.000_r8, &    !  2: tropical deciduous forest / woodland                 0.961
<          1.000_r8, &    !  3: temperate evergreen broadleaf forest / woodland      0.966
<          1.000_r8, &    !  4: temperate evergreen conifer forest / woodland        0.966
<          1.000_r8, &    !  5: temperate deciduous forest / woodland                0.965
<          1.000_r8, &    !  6: boreal evergreen forest / woodland                   0.960
<          1.000_r8, &    !  7: boreal deciduous forest / woodland                   0.950
<          1.000_r8, &    !  8: mixed forest / woodland                              0.960
<          1.000_r8, &    !  9: savanna                                              0.962
<          1.000_r8, &    ! 10: grassland / steppe                                   0.952
<          1.000_r8, &    ! 11: dense shrubland                                      0.970
<          1.000_r8, &    ! 12: open shrubland                                       0.950
<          1.000_r8, &    ! 13: tundra                                               0.914
<          1.000_r8, &    ! 14: desert                                               0.970
<          1.000_r8  &    ! 15: polar desert / rock / ice                            0.970
<          /), (/nVegClass/) )!---->  grassland / shrub systems  
<          REAL(KIND=r8)    :: x,maxdepth
<          INTEGER :: i,j,k,inveg,lrec
---
>              !          DO k = 1, npft
>              !
>              !            plai(i,k,j) = cbiol(i,k,j) * specla(k)
>              !            biomass(i,k,j) = cbiol(i,k,j) + cbiow(i,k,j) + cbior(i,k,j)
>              !
>              !          END DO
8868c8587
<          ! define rooting profiles
---
>              ! determine basic vegetation structure characteristics
8871c8590
<          ! define rooting profiles based upon data published in:
---
>              ! total leaf area for upper and lower canopies
8873c8592,8627
<          ! Milena Dantas., 2020: 
---
>              !          totlaiu(i,j)  =  plai(i,1,j) + plai(i,2,j) +  &
>              !                           plai(i,3,j) + plai(i,4,j) +  &
>              !                           plai(i,5,j) + plai(i,6,j) +  &
>              !                           plai(i,7,j) + plai(i,8,j) 
>              !
>              !          totlail(i,j)  =  plai(i,9,j)  + plai(i,10,j) + &
>              !                           plai(i,11,j) + plai(i,12,j) 
>              !
>              !          totbiou(i,j)  = biomass(i,1,j) + &
>              !                               biomass(i,2,j) + &
>              !                               biomass(i,3,j) + &
>              !                               biomass(i,4,j) + &
>              !                               biomass(i,5,j) + &
>              !                               biomass(i,6,j) + &
>              !                               biomass(i,7,j) + &
>              !                               biomass(i,8,j) 
>              !
>              !          totbiol(i,j)  = biomass(i,9,j)  + &
>              !                                biomass(i,10,j) + &
>              !                               biomass(i,11,j) + &
>              !                                biomass(i,12,j) 
>              !!
>              ! initial single-sided sai for upper and lower canopies
>              !
>              !          sai(i,1,j)  =  0.050_r8 * totlail(i,j)
>              !          sai(i,2,j)  =  0.250_r8 * totlaiu(i,j)
>              !
>              ! Lai read from restart file
>              !
>              ! specify canopy height parameters
>              ! calculated as a function of only the vegetative fraction
>              ! of each grid cell
>              !
>              !        zbot(i,1,j) =  0.05_r8
>              !       ztop(i,1,j) =  max (0.25_r8, totlail(i) * 0.25_r8)
>              !        ztop(i,1,j) =  max (0.25_r8, lai(i,1,j) * 0.25_r8)
8875c8629,8630
<          ! and
---
>              !        zbot(i,2,j) =  3.0_r8
>              !        ztop(i,2,j) =  max (zbot(i,2,j) + 1.0_r8, 2.5_r8*totbiou(i,j) / fu(i,j) * 0.75_r8)
8877,8879c8632,8633
<          ! Jackson et al., 1997:  A global budget for fine root biomass, 
<          ! surface area, and nutrient contents, Proceedings of the National
<          ! Academy of Sciences, 94, 7362-7366.
---
>              ! constrain ztop of lower canopy to be at least 0.5 meter lower than
>              ! zbot for upper canopy
8881,8899c8635
<          DO k = 1, nsoilay
<             !
<             DO j=1,jbMax
<                DO i=1,nlpoints(j) 
<                   inveg = NINT (xinveg(i,j))
<                   IF (k.eq.1) THEN
<                      depth(k) = hsoi(i,k,j) * 100.0_r8
<                      depth_aux(i,k,j) = hsoi(i,k,j) * 100.0_r8
<                   ELSE
<                      depth(k) = depth(k-1) + hsoi(i,k,j) * 100.0_r8
<                      depth_aux(i,k,j) = depth_aux(i,k-1,j) + hsoi(i,k,j) * 100.0_r8
<                   END IF
<                   ! beta_lw_canopy   o parametro de forma
<                   ! theta_lw_canopy  o parametro de escala 
<                   ! delta_lw_canopy  o parametro de localizao
<                   maxdepth= depth(k)
<                END DO
<             END DO
<          END DO
---
>              !        ztop(i,1,j) = min (ztop(i,1,j), zbot(i,2,j) - 0.5_r8)
8901,8903c8637
<          frootnorm1=0.0
<          frootnorm2=0.0
<          DO k = 1, nsoilay
---
>           END IF  ! end restart if loop
8905,8923c8639
<             DO j=1,jbMax
<                DO i=1,nlpoints(j) 
<                   inveg = NINT (xinveg(i,j))
<                   IF (k.eq.1) THEN
<                      depth(k) = hsoi(i,k,j) * 100.0_r8
<                      depth_aux(i,k,j) = hsoi(i,k,j) * 100.0_r8
<                   ELSE
<                      depth(k) = depth(k-1) + hsoi(i,k,j) * 100.0_r8
<                      depth_aux(i,k,j) = depth_aux(i,k-1,j) + hsoi(i,k,j) * 100.0_r8
<                   END IF
<                   ! beta_lw_canopy   o parametro de forma
<                   ! theta_lw_canopy  o parametro de escala 
<                   ! delta_lw_canopy  o parametro de localizao
<                   x=depth_aux(i,k,j)
<                   IF( x < delta_lw_canopy (inveg))STOP 'ERROR depth < delta_lw_canopy (inveg)'
<                   frootnorm1(i,j) =frootnorm1(i,j) +  (beta_lw_canopy(inveg)/theta_lw_canopy(inveg))*(((x-delta_lw_canopy(inveg))/theta_lw_canopy(inveg))**(beta_lw_canopy(inveg)-1.0))*(exp(-(((x-delta_lw_canopy(inveg))/theta_lw_canopy(inveg))**beta_lw_canopy(inveg))))
<                   frootnorm2(i,j) =frootnorm2(i,j) +  (beta_up_canopy(inveg)/theta_up_canopy(inveg))*(((x-delta_up_canopy(inveg))/theta_up_canopy(inveg))**(beta_up_canopy(inveg)-1.0))*(exp(-(((x-delta_up_canopy(inveg))/theta_up_canopy(inveg))**beta_up_canopy(inveg))))
<                END DO
<             END DO
---
>        END DO !DO i=1,npoi
8926d8641
<          DO k = 1, nsoilay
8928,8945c8643,8645
<             DO j=1,jbMax
<                DO i=1,nlpoints(j) 
<                   inveg = NINT (xinveg(i,j))
<                   IF (k.eq.1) THEN
<                      depth(k) = hsoi(i,k,j) * 100.0_r8
<                   ELSE
<                      depth(k) = depth(k-1) + hsoi(i,k,j) * 100.0_r8
<                   END IF
<                   ! beta_lw_canopy   o parametro de forma
<                   ! theta_lw_canopy  o parametro de escala 
<                   ! delta_lw_canopy  o parametro de localizao
<                   x=depth(k)
<                   IF( x < delta_lw_canopy (inveg))STOP 'ERROR depth < delta_lw_canopy (inveg)'
<                   froot(i,k,1,j) = (beta_lw_canopy(inveg)/theta_lw_canopy(inveg))*(((x-delta_lw_canopy(inveg))/theta_lw_canopy(inveg))**(beta_lw_canopy(inveg)-1.0))*(exp(-(((x-delta_lw_canopy(inveg))/theta_lw_canopy(inveg))**beta_lw_canopy(inveg))))
<                   froot(i,k,2,j) = (beta_up_canopy(inveg)/theta_up_canopy(inveg))*(((x-delta_up_canopy(inveg))/theta_up_canopy(inveg))**(beta_up_canopy(inveg)-1.0))*(exp(-(((x-delta_up_canopy(inveg))/theta_up_canopy(inveg))**beta_up_canopy(inveg))))
< 
<                   froot(i,k,1,j) = froot(i,k,1,j) / frootnorm1(i,j)
<                   froot(i,k,2,j) = froot(i,k,2,j) / frootnorm2(i,j)
---
>     ! ************************************************************************
>     ! assign some physical properties of vegetation
>     ! ************************************************************************
8947,8949c8647,8648
<                END DO
<             END DO
<          END DO
---
>     ! leaf optical properties were taken from Sellers et al., 1996
>     ! and Bonan, 1995
8951c8650,8651
<       ! return to main program
---
>     !      rhoveg(1,1) = 0.10     ! vis leaf reflectance, lower story
>     !      rhoveg(1,2) = 0.10     ! vis leaf reflectance, upper story 
8953c8653,8654
<       END SUBROUTINE RootingProfilesMilenaFixed
---
>     !      rhoveg(2,1) = 0.60     ! nir leaf reflectance, lower story
>     !      rhoveg(2,2) = 0.40     ! nir leaf reflectance, upper story
8955,8966c8656,8669
< 
<       SUBROUTINE RootingProfilesJackson(nVegClass,nsoilay,ibMax,jbMax,hsoi,xinveg,beta1,beta2,froot)
<        IMPLICIT  NONE
<        INTEGER      , INTENT(IN   ) :: nVegClass
<        INTEGER      , INTENT(IN   ) :: nsoilay
<        INTEGER      , INTENT(IN   ) :: ibMax
<        INTEGER      , INTENT(IN   ) :: jbMax
<        REAL(KIND=r8), INTENT(IN   ) :: xinveg       (ibMax,jbMax) ! fixed vegetation map
<        REAL(KIND=r8), INTENT(IN   ) :: hsoi         (ibMax,nsoilay+1,jbMax)! soil layer thickness (m)
<        REAL(KIND=r8), INTENT(IN   ) :: beta1    (nVegClass)
<        REAL(KIND=r8), INTENT(IN   ) :: beta2    (nVegClass)
<        REAL(KIND=r8), INTENT(INOUT) :: froot    (ibMax,nsoilay,2,jbMax)! global! fraction of root in soil layer 
---
>     !      tauveg(1,1) = 0.07     ! vis leaf transmittance, lower story
>     !      tauveg(1,2) = 0.05     ! vis leaf transmittance, upper story
>     !
>     !      tauveg(2,1) = 0.25     ! nir leaf transmittance, lower story
>     !      tauveg(2,2) = 0.20     ! nir leaf transmittance, upper story
>     !
>     !      chiflz = -0.5          ! leaf orientation factors (-1 vertical, 0 random, 1 horizontal)
>     !      chifuz =  0.0          ! leaf orientation factors (-1 vertical, 0 random, 1 horizontal)
>     !
>     oriev(1) = MAX (-chiflz, 0.0_r8)
>     oriev(2) = MAX (-chifuz, 0.0_r8)
>     !
>     orieh(1) = MAX ( chiflz, 0.0_r8)
>     orieh(2) = MAX ( chifuz, 0.0_r8)
8968c8671,8702
<        ! LOCAL VARIABEL
---
>     !      dleaf(1) = 0.10        ! linear dimensions for aerodynamic flux parameterization
>     !      dstem(1) = 0.10        ! linear dimensions for aerodynamic flux parameterization
>     !
>     !      dleaf(2) = 0.10        ! linear dimensions for aerodynamic flux parameterization
>     !      dstem(2) = 0.10        ! linear dimensions for aerodynamic flux parameterization
>     !      ch2o = 4.218 J g-1     ! cu =4204.8-1.768*T + 0.0264*T*T  !J/(kg K)
>     !      chu = ch2o *  2.0      ! heat capacity of upper leaves
>     !      chl = ch2o *  2.0      ! heat capacity of lower leaves
>     !      chs = ch2o * 50.0      ! heat capacity of stems
>     !
>     !      alaimu = 8.0           ! normalization constant for upper canopy aerodynamics
>     !      alaiml = 8.0           ! normalization constant for lower canopy aerodynamics
>     !
>     !      cleaf  = 0.01          ! constant in leaf-air aero transfer parameterization
>     !      cgrass = 0.01          ! constant in leaf-air aero transfer parameterization
>     !      cstem  = 0.01          ! constant in leaf-air aero transfer parameterization
>     !
>     !      wliqumax = 0.20        ! intercepted water capacity (mm h2o per unit leaf area)
>     !      wliqsmax = 0.40        ! intercepted water capacity (mm h2o per unit leaf area)
>     !      wliqlmax = 0.20        ! intercepted water capacity (mm h2o per unit leaf area)
>     !
>     !      wsnoumax = 2.00        ! intercepted snow capacity (mm h2o per unit leaf area)
>     !      wsnosmax = 4.00        ! intercepted snow capacity (mm h2o per unit leaf area)
>     !      wsnolmax = 2.00        ! intercepted snow capacity (mm h2o per unit leaf area)
>     !
>     !      tdripu =  2.0 * 3600.0 ! decay time for intercepted liquid dripoff (sec)
>     !      tdrips =  2.0 * 3600.0 ! decay time for intercepted liquid dripoff (sec)
>     !      tdripl =  2.0 * 3600.0 ! decay time for intercepted liquid dripoff (sec)
>     !
>     !      tblowu = 12.0 * 3600.0 ! decay time for snow blowoff (sec)
>     !      tblows = 12.0 * 3600.0 ! decay time for snow blowoff (sec)
>     !      tblowl = 12.0 * 3600.0 ! decay time for snow blowoff (sec)
8970,8976d8703
<       REAL(KIND=r8)    :: totdepth  (ibMax,jbMax)    ! total soil depth
<       REAL(KIND=r8)    :: frootnorm1(ibMax,jbMax)    ! normalization factor for Jackson rooting profile,low
<       REAL(KIND=r8)    :: frootnorm2 (ibMax,jbMax)   ! normalization factor for Jackson rooting profile, up
<       REAL(KIND=r8)    :: depth_aux(ibMax,nsoilay,jbMax)   ! soil layer depth (cm)
< 
<       INTEGER :: i,j,k,inveg
< 
9064a8792
> 
9072d8799
< 
9074d8800
< 
9076c8802
< !
---
>                 !
9079c8805
< !
---
>                 !
9082c8808
< !
---
>                 !
9084c8810
< !
---
>                 !
9087,9088c8813
< 
< !
---
>                 !
9091c8816
< !
---
>                 !
9094c8819
< !
---
>                 !
9096c8821
< !
---
>              !
9099c8824,8825
< !
---
>              !
>              bperm(i,j) =bperm_in(inveg)
9106,9107c8832,8834
< END SUBROUTINE RootingProfilesJackson
< 
---
>     RETURN
>   END SUBROUTINE iniveg
>   !
9110,9117c8837,8844
< !
< ! #####   #####    ##    #####   #####     ##    #####    ####   
< ! #    #  #       #  #   #    #  #    #   #  #   #    #  #      
< ! #    #  #      #    #  #    #  #    #  #    #  #    #   ####       
< ! #####   #####  ######  #    #  #####   ######  #####        #  
< ! #   #   #      #    #  #    #  #       #    #  #   #   #    # 
< ! #    #  #####  #    #  #####   #       #    #  #    #   ####  
< !
---
>   !
>   ! #####   #####    ##    #####   #####     ##    #####    ####   
>   ! #    #  #       #  #   #    #  #    #   #  #   #    #  #      
>   ! #    #  #      #    #  #    #  #    #  #    #  #    #   ####       
>   ! #####   #####  ######  #    #  #####   ######  #####        #  
>   ! #   #   #      #    #  #    #  #       #    #  #   #   #    # 
>   ! #    #  #####  #    #  #####   #       #    #  #    #   ####  
>   !
9119c8846
< !----------------------------------------------------------
---
>   !----------------------------------------------------------
9121,9124c8848,8851
< !----------------------------------------------------------
< !
< !  Read various parameters from ibis.params
< ! 
---
>     !----------------------------------------------------------
>     !
>     !  Read various parameters from ibis.params
>     ! 
9126,9128c8853,8855
< !  
< ! Local variables
< !      
---
>     !  
>     ! Local variables
>     !      
9130d8856
<       INTEGER :: j 	    ! PFT number (in range 1 to npftu)
9135,9136d8860
<       REAL(KIND=r8)    :: dummyvarpk(500)
<       INTEGER :: i
9138,9139c8862,8863
< !      co2init =0.000350_r8  ! co2init    initial co2 concentration in mol/mol (REAL(KIND=r8))
< !      o2init  =0.209000_r8  ! o2init     initial o2 concentration in mol/mol (real)
---
>     !      co2init =0.000350_r8  ! co2init    initial co2 concentration in mol/mol (REAL(KIND=r8))
>     !      o2init  =0.209000_r8  ! o2init     initial o2 concentration in mol/mol (real)
9142,9148c8866,8872
< !------------------------------------------------------------------------
< !  Fundamental plant physiological parameters, name definitions
< ! ------------------------------------------------------------------------
< !      tau15 = 4500.0_r8    ! tau15 : co2/o2 specificity ratio at 15 degrees C (dimensionless)    
< !      kc15  = 1.5e-04_r8   ! kc15  : co2 kinetic parameter at 15 C (mol/mol)
< !      ko15  = 2.5e-01_r8   ! ko15  : o2 kinetic parameter at 15 C (mol/mol)
< !      cimax = 2000.e-06_r8 ! cimax : maximum value for ci (for model stability)
---
>     !------------------------------------------------------------------------
>     !  Fundamental plant physiological parameters, name definitions
>     ! ------------------------------------------------------------------------
>     !      tau15 = 4500.0_r8    ! tau15 : co2/o2 specificity ratio at 15 degrees C (dimensionless)    
>     !      kc15  = 1.5e-04_r8   ! kc15  : co2 kinetic parameter at 15 C (mol/mol)
>     !      ko15  = 2.5e-01_r8   ! ko15  : o2 kinetic parameter at 15 C (mol/mol)
>     !      cimax = 2000.e-06_r8 ! cimax : maximum value for ci (for model stability)
9150,9151c8874,8875
< !------------------------------------------------------------------------
< !========================================================================
---
>     !------------------------------------------------------------------------
>     !========================================================================
9153c8877
< !------------------------------------------------------------------------
---
>     !------------------------------------------------------------------------
9172,9315c8896,9039
< !------------------------------------------------------------------------
< ! PFTs (top to bottom)
< !------------------------------------------------------------------------
< !  1: tropical broadleaf evergreen trees
< !  2: tropical broadleaf drought-deciduous trees
< !  3: warm-temperate broadleaf evergreen trees
< !  4: temperate conifer evergreen trees
< !  5: temperate broadleaf cold-deciduous trees
< !  6: boreal conifer evergreen trees
< !  7: boreal broadleaf cold-deciduous trees
< !  8: boreal conifer cold-deciduous trees
< !  9: evergreen shrubs
< ! 10: cold-deciduous shrubs
< ! 11: warm (C4) grasses
< ! 12: cool (C3) grasses
< !========================================================================
< 
< !--------------------------------------------------------------------
< ! C3 and C4 physiology-specific parameters
< !--------------------------------------------------------------------
< !      alpha3 =0.080_r8 ! alpha3 - C3 intrinsic quantum efficiency (dimensionless)
< !      theta3 =0.950_r8 ! theta3 - C3 photosynthesis coupling coefficient
< !      beta3  =0.990_r8 ! beta3  - C3 photosynthesis coupling coefficient
< !      alpha4 =0.050_r8 ! alpha4 - C4 intrinsic quantum efficiency (dimensionless)
< !      theta4 =0.970_r8 ! theta4 - C4 photosynthesis coupling coefficient
< !      beta4  =0.800_r8 ! beta4  - C4 photosynthesis coupling coefficient 
< !====================================================================
< !--------------------------------------------------------------------
< ! Plant physiological properties - 5 classes
< !--------------------------------------------------------------------
< ! gamma    : leaf respiration coefficients 
< ! coefm    : 'm' coefficients for stomatal conductance relationship
< ! coefb    : 'b' coefficients for stomatal conductance relationship
< ! gsmin    : absolute minimum stomatal conductances
< !-------------------------------------------------
< ! gamma  coefm  coefb    gsmin   Physiol. Class
< !-------------------------------------------------
< !      gammaub = 0.015_r8   ! Broadleaf trees
< !      coefmub = 10.0_r8    ! Broadleaf trees
< !      coefbub = 0.01_r8    ! Broadleaf trees
< !      gsubmin = 0.00001_r8 ! Broadleaf trees
< !      gammauc = 0.015_r8
< !      coefmuc = 6.0_r8
< !      coefbuc = 0.01_r8
< !      gsucmin = 0.00001_r8
< !      gammals = 0.015_r8  ! Shrubs
< !      coefmls = 9.0_r8    ! Shrubs
< !      coefbls = 0.01_r8   ! Shrubs
< !      gslsmin = 0.00001_r8! Shrubs
< !      gammal4 = 0.030_r8  ! C4 grasses
< !      coefml4 = 4.0_r8    ! C4 grasses
< !      coefbl4 = 0.04_r8   ! C4 grasses
< !      gsl4min = 0.00001_r8! C4 grasses
< !      gammal3 = 0.015_r8  ! C3 grasses
< !      coefml3 = 9.0_r8    ! C3 grasses
< !      coefbl3 = 0.01_r8   ! C3 grasses
< !      gsl3min = 0.00001_r8! C3 grasses
< 
< !=================================================
< !--------------------------------------------------
< ! Other properties of vegetation -- for 12 PFTs
< !--------------------------------------------------
< ! vmax_pft : max Rubisco activity at 15 C, at top of canopy (mol[CO2] m-2 s-1) 
< ! specla   : specific leaf area (m2 kg-1)
< ! tauleaf  : foliar biomass turnover(rotatividade) time constant (years)
< ! tauroot  : root biomass turnover(rotatividade) time constant (years)
< ! tauwood  : wood biomass turnover(rotatividade) time constant (years)
< ! aleaf    : foliar allocation coefficient (fraction)
< ! aroot    : root allocation coefficient (fraction)
< ! awood    : wood allocation coefficient (fraction, = 1 - aleaf - aroot)
< !      dummyvarpk(1:96)=(/&
< !------------------------------------------------------------------------
< ! vmax_pft  specla  tauleaf  tauroot tauwood  aleaf  aroot  awood    PFT
< !------------------------------------------------------------------------
< !      65.0e-06_r8, 25.0_r8, 1.01_r8, 1.0_r8,  25.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   1 
< !      65.0e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8,  25.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   2 
< !      40.0e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8,  25.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   3 
< !      30.0e-06_r8, 12.5_r8, 2.00_r8, 1.0_r8,  50.0_r8, 0.30_r8, 0.40_r8, 0.30_r8,& !   4 
< !      30.0e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8,  50.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   5 
< !      25.0e-06_r8, 12.5_r8, 2.50_r8, 1.0_r8, 100.0_r8, 0.30_r8, 0.40_r8, 0.30_r8,& !   6 
< !      30.0e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8, 100.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   7 
< !      30.0e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8, 100.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   8 
< !      27.5e-06_r8, 12.5_r8, 1.50_r8, 1.0_r8,   5.0_r8, 0.45_r8, 0.40_r8, 0.15_r8,& !   9 
< !      27.5e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8,   5.0_r8, 0.45_r8, 0.35_r8, 0.20_r8,& !  10 
< !      15.0e-06_r8, 20.0_r8, 1.25_r8, 1.0_r8, 999.0_r8, 0.45_r8, 0.55_r8, 0.00_r8,& !  11 
< !      25.0e-06_r8, 20.0_r8, 1.50_r8, 1.0_r8, 999.0_r8, 0.45_r8, 0.55_r8, 0.00_r8/)  !  12 
< !========================================================================
< !      i=0
< !      DO j = 1, npft 
< !      
< !         vmax_pft(j) = dummyvarpk(j+0+i)
< !         specla(j)   = dummyvarpk(j+1+i)
< !         tauleaf(j)  = dummyvarpk(j+2+i)
< !         tauroot(j)  = dummyvarpk(j+3+i)
< !         tauwood0(j) = dummyvarpk(j+4+i)
< !         aleaf(j)    = dummyvarpk(j+5+i)
< !         aroot(j)    = dummyvarpk(j+6+i)
< !         awood(j)    = dummyvarpk(j+7+i)
< !	 i=i+7
< !      END DO
< !!---------------------------------------------------------------------------------
< !  minimum density of woody biomass required for upper canopy closure (kg C m-2)
< !---------------------------------------------------------------------------------
< !      woodnorm=7.5_r8 !  woodnorm 
< !================================================================================= 
< 
< ! leaf optical properties from Sellers et al., 1996 and Bonan, 1995
< !      dummyvarpk(1:8)=(/ &
< !-----------------------------------------------------------------------------------------
< ! leaf reflectance (rhoveg) and transmittance (tauveg), visible and NIR, for each canopy
< !-----------------------------------------------------------------------------------------
< !     lower        upper  
< !---------------------------------------------------------
< !      0.10_r8,        0.10_r8,&    ! rhoveg(1,1); rhoveg(1,2) vis   
< !      0.60_r8,        0.40_r8,&    ! rhoveg(2,1); rhoveg(2,2) NIR
< !      0.07_r8,        0.05_r8,&    ! tauveg(1,1); tauveg(1,2) vis
< !      0.25_r8,        0.20_r8 /)   ! tauveg(2,1); tauveg(2,2) NIR  
< !---------------------------------------------------------
< !     0.10        0.60    ! rhoveg(1,1); rhoveg(1,2) vis   
< !     0.10        0.40    ! rhoveg(2,1); rhoveg(2,2) NIR
< !     0.07        0.25    ! tauveg(1,1); tauveg(1,2) vis
< !     0.05        0.20    ! tauveg(2,1); tauveg(2,2) NIR  
< !========================================================= 
< !
< !      i=0
< !      DO j = 1, nband 
< !         rhoveg(j,1) = dummyvarpk(j+0+i)
< !         rhoveg(j,2) = dummyvarpk(j+1+i)
< !	 i=i+1
< !      END DO  
< !      i=i+2
< !      DO j = 1, nband 
< !         tauveg(j,1) = dummyvarpk(j+0+i)
< !         tauveg(j,2) = dummyvarpk(j+1+i)
< !	 i=i+1
< !      END DO
< ! *********************************************
< ! assign some physical properties of vegetation
< ! *********************************************
< !
< ! leaf optical properties were taken from Sellers et al., 1996
< ! and Bonan, 1995
< !
<       rhoveg(1,1) = 0.062_r8    !0.10_r8      ! vis leaf reflectance, lower story
---
>     !------------------------------------------------------------------------
>     ! PFTs (top to bottom)
>     !------------------------------------------------------------------------
>     !  1: tropical broadleaf evergreen trees
>     !  2: tropical broadleaf drought-deciduous trees
>     !  3: warm-temperate broadleaf evergreen trees
>     !  4: temperate conifer evergreen trees
>     !  5: temperate broadleaf cold-deciduous trees
>     !  6: boreal conifer evergreen trees
>     !  7: boreal broadleaf cold-deciduous trees
>     !  8: boreal conifer cold-deciduous trees
>     !  9: evergreen shrubs
>     ! 10: cold-deciduous shrubs
>     ! 11: warm (C4) grasses
>     ! 12: cool (C3) grasses
>     !========================================================================
> 
>     !--------------------------------------------------------------------
>     ! C3 and C4 physiology-specific parameters
>     !--------------------------------------------------------------------
>     !      alpha3 =0.080_r8 ! alpha3 - C3 intrinsic quantum efficiency (dimensionless)
>     !      theta3 =0.950_r8 ! theta3 - C3 photosynthesis coupling coefficient
>     !      beta3  =0.990_r8 ! beta3  - C3 photosynthesis coupling coefficient
>     !      alpha4 =0.050_r8 ! alpha4 - C4 intrinsic quantum efficiency (dimensionless)
>     !      theta4 =0.970_r8 ! theta4 - C4 photosynthesis coupling coefficient
>     !      beta4  =0.800_r8 ! beta4  - C4 photosynthesis coupling coefficient 
>     !====================================================================
>     !--------------------------------------------------------------------
>     ! Plant physiological properties - 5 classes
>     !--------------------------------------------------------------------
>     ! gamma    : leaf respiration coefficients 
>     ! coefm    : 'm' coefficients for stomatal conductance relationship
>     ! coefb    : 'b' coefficients for stomatal conductance relationship
>     ! gsmin    : absolute minimum stomatal conductances
>     !-------------------------------------------------
>     ! gamma  coefm  coefb    gsmin   Physiol. Class
>     !-------------------------------------------------
>     !      gammaub = 0.015_r8   ! Broadleaf trees
>     !      coefmub = 10.0_r8    ! Broadleaf trees
>     !      coefbub = 0.01_r8    ! Broadleaf trees
>     !      gsubmin = 0.00001_r8 ! Broadleaf trees
>     !      gammauc = 0.015_r8
>     !      coefmuc = 6.0_r8
>     !      coefbuc = 0.01_r8
>     !      gsucmin = 0.00001_r8
>     !      gammals = 0.015_r8  ! Shrubs
>     !      coefmls = 9.0_r8    ! Shrubs
>     !      coefbls = 0.01_r8   ! Shrubs
>     !      gslsmin = 0.00001_r8! Shrubs
>     !      gammal4 = 0.030_r8  ! C4 grasses
>     !      coefml4 = 4.0_r8    ! C4 grasses
>     !      coefbl4 = 0.04_r8   ! C4 grasses
>     !      gsl4min = 0.00001_r8! C4 grasses
>     !      gammal3 = 0.015_r8  ! C3 grasses
>     !      coefml3 = 9.0_r8    ! C3 grasses
>     !      coefbl3 = 0.01_r8   ! C3 grasses
>     !      gsl3min = 0.00001_r8! C3 grasses
> 
>     !=================================================
>     !--------------------------------------------------
>     ! Other properties of vegetation -- for 12 PFTs
>     !--------------------------------------------------
>     ! vmax_pft : max Rubisco activity at 15 C, at top of canopy (mol[CO2] m-2 s-1) 
>     ! specla   : specific leaf area (m2 kg-1)
>     ! tauleaf  : foliar biomass turnover time constant (years)
>     ! tauroot  : root biomass turnover time constant (years)
>     ! tauwood  : wood biomass turnover time constant (years)
>     ! aleaf    : foliar allocation coefficient (fraction)
>     ! aroot    : root allocation coefficient (fraction)
>     ! awood    : wood allocation coefficient (fraction, = 1 - aleaf - aroot)
>     !      dummyvarpk(1:96)=(/&
>     !------------------------------------------------------------------------
>     ! vmax_pft  specla  tauleaf  tauroot tauwood  aleaf  aroot  awood    PFT
>     !------------------------------------------------------------------------
>     !      65.0e-06_r8, 25.0_r8, 1.01_r8, 1.0_r8,  25.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   1 
>     !      65.0e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8,  25.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   2 
>     !      40.0e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8,  25.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   3 
>     !      30.0e-06_r8, 12.5_r8, 2.00_r8, 1.0_r8,  50.0_r8, 0.30_r8, 0.40_r8, 0.30_r8,& !   4 
>     !      30.0e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8,  50.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   5 
>     !      25.0e-06_r8, 12.5_r8, 2.50_r8, 1.0_r8, 100.0_r8, 0.30_r8, 0.40_r8, 0.30_r8,& !   6 
>     !      30.0e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8, 100.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   7 
>     !      30.0e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8, 100.0_r8, 0.30_r8, 0.20_r8, 0.50_r8,& !   8 
>     !      27.5e-06_r8, 12.5_r8, 1.50_r8, 1.0_r8,   5.0_r8, 0.45_r8, 0.40_r8, 0.15_r8,& !   9 
>     !      27.5e-06_r8, 25.0_r8, 1.00_r8, 1.0_r8,   5.0_r8, 0.45_r8, 0.35_r8, 0.20_r8,& !  10 
>     !      15.0e-06_r8, 20.0_r8, 1.25_r8, 1.0_r8, 999.0_r8, 0.45_r8, 0.55_r8, 0.00_r8,& !  11 
>     !      25.0e-06_r8, 20.0_r8, 1.50_r8, 1.0_r8, 999.0_r8, 0.45_r8, 0.55_r8, 0.00_r8/)  !  12 
>     !========================================================================
>     !      i=0
>     !      DO j = 1, npft 
>     !      
>     !         vmax_pft(j) = dummyvarpk(j+0+i)
>     !         specla(j)   = dummyvarpk(j+1+i)
>     !         tauleaf(j)  = dummyvarpk(j+2+i)
>     !         tauroot(j)  = dummyvarpk(j+3+i)
>     !         tauwood0(j) = dummyvarpk(j+4+i)
>     !         aleaf(j)    = dummyvarpk(j+5+i)
>     !         aroot(j)    = dummyvarpk(j+6+i)
>     !         awood(j)    = dummyvarpk(j+7+i)
>     !         i=i+7
>     !      END DO
>     !!---------------------------------------------------------------------------------
>     !  minimum density of woody biomass required for upper canopy closure (kg C m-2)
>     !---------------------------------------------------------------------------------
>     !      woodnorm=7.5_r8 !  woodnorm 
>     !================================================================================= 
> 
>     ! leaf optical properties from Sellers et al., 1996 and Bonan, 1995
>     !      dummyvarpk(1:8)=(/ &
>     !-----------------------------------------------------------------------------------------
>     ! leaf reflectance (rhoveg) and transmittance (tauveg), visible and NIR, for each canopy
>     !-----------------------------------------------------------------------------------------
>     !     lower        upper  
>     !---------------------------------------------------------
>     !      0.10_r8,        0.10_r8,&    ! rhoveg(1,1); rhoveg(1,2) vis   
>     !      0.60_r8,        0.40_r8,&    ! rhoveg(2,1); rhoveg(2,2) NIR
>     !      0.07_r8,        0.05_r8,&    ! tauveg(1,1); tauveg(1,2) vis
>     !      0.25_r8,        0.20_r8 /)   ! tauveg(2,1); tauveg(2,2) NIR  
>     !---------------------------------------------------------
>     !     0.10        0.60    ! rhoveg(1,1); rhoveg(1,2) vis   
>     !     0.10        0.40    ! rhoveg(2,1); rhoveg(2,2) NIR
>     !     0.07        0.25    ! tauveg(1,1); tauveg(1,2) vis
>     !     0.05        0.20    ! tauveg(2,1); tauveg(2,2) NIR  
>     !========================================================= 
>     !
>     !      i=0
>     !      DO j = 1, nband 
>     !         rhoveg(j,1) = dummyvarpk(j+0+i)
>     !         rhoveg(j,2) = dummyvarpk(j+1+i)
>     !         i=i+1
>     !      END DO  
>     !      i=i+2
>     !      DO j = 1, nband 
>     !         tauveg(j,1) = dummyvarpk(j+0+i)
>     !         tauveg(j,2) = dummyvarpk(j+1+i)
>     !         i=i+1
>     !      END DO
>     ! *********************************************
>     ! assign some physical properties of vegetation
>     ! *********************************************
>     !
>     ! leaf optical properties were taken from Sellers et al., 1996
>     ! and Bonan, 1995
>     !
>     rhoveg(1,1) =  0.062_r8!0.10_r8     ! vis leaf reflectance, lower story
9317c9041
< !
---
>     !
9320c9044
< !
---
>     !
9323c9047
< !
---
>     !
9326,9467c9050,9191
< !-----------------------------------------------------------------
< ! leaf orientation factors (-1 vertical, 0 random, 1 horizontal)
< !-----------------------------------------------------------------
< ! chifuz : upper canopy leaf orientation
< ! chiflz : lower canopy leaf orientation
< !-----------------------------------------
< !      chifuz=   0.0_r8	   ! chifuz 
< !      chiflz=  -0.5_r8	   ! chiflz	      
< !=========================================
< !      dummyvarpk(1:4)=(/ &
< !-----------------------------------------------------------------------
< ! linear dimensions for aerodynamic flux parameterization: dleaf, dstem
< !-----------------------------------------------------------------------
< !    upper?     lower?
< !-----------------------------------------
< !      0.10_r8,	 0.10_r8,	&  ! dleaf
< !      0.10_r8,   0.10_r8/)	   ! dstem
< !=========================================
< !      i=0
< !      DO j = 1 ,1 
< !         dleaf(1) = dummyvarpk(j+0+i)
< !         dleaf(2) = dummyvarpk(j+1+i)
< !	 i=i+1
< !      END DO  
< !      i=i+1
< !      DO j = 1, 1 
< !         dstem(1) = dummyvarpk(j+0+i)
< !         dstem(2) = dummyvarpk(j+1+i)
< !	 i=i+1
< !      END DO      
< !
< !--------------------------------------------------------------------
< ! normalization constants for canopy drag coefficients (m2 m-2)
< !---------------------------------------------------------------------
< !      alaimu=8.0_r8   ! alaimu : upper canopy leaf & stem area (2 sided)
< !      alaiml=8.0_r8   ! alaiml : lower canopy leaf & stem maximum area (2 sided)
< !======================================================================
< 
< !----------------------------------------------------------------------------
< ! empirical coefficients for aerodynamic transfer parameterization (m s-0.5) 
< ! From Pollard & Thompson (1995, eq. A39a)
< !----------------------------------------------------------------------------
< !      cleaf  = 0.01_r8! cleaf  : upper canopy leaf-air 
< !      cstem  = 0.01_r8! cstem  : upper canopy stem-air 
< !      cgrass = 0.01_r8! cgrass : lower canopy-air
< !===========================================================================
< 
< !----------------------------------------------------------------------------
< ! heat capacities of leaves and stems  (J kg-1 C-1 m-2)
< ! derived from specific heat of liquid water (ch2o = 4.218 J g-1)
< !----------------------------------------------------------------------------
< !      chs= 2.109e+05_r8 ! chs : upper canopy stems per unit stem area
< !      chu= 8.436e+03_r8 ! chu : upper canopy leaves per unit leaf area
< !      chl= 8.436e+03_r8 ! chl : lower canopy leaves & stems per unit leaf/stem area
< !----------------------------------------------------------------------------
< 
< !-----------------------------------------------------------------------
< ! intercepted water capacity (mm h2o per unit leaf area == kg m-2)
< !-----------------------------------------------------------------------
< !           ! wliqmin  : minimum per unit vegetated area
< !      wliqumax = 0.20_r8  ! wliqumax : maximum per unit upper canopy leaf area 
< !      wliqsmax = 0.40_r8  ! wliqsmax : maximum per unit upper canopy stem area
< !      wliqlmax = 0.20_r8  ! wliqlmax : maximum per unit lower canopy stem & leaf area
< !=======================================================================
< 
< !-----------------------------------------------------------------------
< ! intercepted snow capacity (mm h2o per unit leaf area == kg m-2)
< !-----------------------------------------------------------------------
< !           ! wsnomin  : minimum per unit vegetated area 
< !      wsnoumax = 2.00_r8  ! wsnoumax : maximum per unit upper canopy leaf area 
< !      wsnosmax = 4.00_r8  ! wsnosmax : maximum per unit upper canopy stem area
< !      wsnolmax = 2.00_r8  ! wsnolmax : maximum per unit lower canopy stem & leaf area
< !=======================================================================
< 
< !------------------------------------------------------------
< ! decay time for intercepted liquid dripoff (sec)
< !------------------------------------------------------------
< !      tdripu = 7200.0_r8  ! tdripu : upper canopy leaves (2 hours)
< !      tdrips = 7200.0_r8  ! tdrips : upper canopy stems (2 hours)
< !      tdripl = 7200.0_r8  ! tdripl : lower canopy leaves & stems (2 hours)
< !============================================================
< 
< !------------------------------------------------------------
< ! decay time for snow blowoff (sec)
< !------------------------------------------------------------
< !      tblowu = 43200.0_r8 ! tblowu : upper canopy leaves (12 hours)
< !      tblows = 43200.0_r8 ! tblows : upper canopy stems (12 hours)
< !      tblowl = 43200.0_r8 ! tblowl : lower canopy leaves & stems (12 hours)
< !============================================================
< !------------------------------------------------------------------------
< ! PFTs (top to bottom)
< !------------------------------------------------------------------------
< !  1: tropical broadleaf evergreen trees
< !  2: tropical broadleaf drought-deciduous trees
< !  3: warm-temperate broadleaf evergreen trees
< !  4: temperate conifer evergreen trees
< !  5: temperate broadleaf cold-deciduous trees
< !  6: boreal conifer evergreen trees
< !  7: boreal broadleaf cold-deciduous trees
< !  8: boreal conifer cold-deciduous trees
< !  9: evergreen shrubs
< ! 10: cold-deciduous shrubs
< ! 11: warm (c4) grasses
< ! 12: cool (c3) grasses
< 
< !--------------------------------------------------------------------------
< ! PFT climatic constraint definitions (left to right)
< !--------------------------------------------------------------------------
< ! TminL  : absolute minimum temperature (lower limit, C) 
< ! TminU  : absolute minimum temperature (upper limit, C) 
< ! Twarm  : temperature of the warmest month (mean??, C) [C4 only]
< ! GDD    : min growing degree days above 5 C threshold [upper canopy], or
< !          min growing degree days above 0 C threshold [lower canopy]
< 
< ! DTP 2001/06/07: Changed this after studying code in climate.f. 
< !      Values of 9999 indicate this constraint is not used to 
< !      determine existence of the PFT.  
< !      dummyvarpk(1:48)=(/ &
< !------------------------------------------------------------------------
< ! TminL    TminU    Twarm    GDD    PFT
< !------------------------------------------------------------------------
< !       	  0.0_r8,  9999.0_r8,   9999.0_r8,   9999.0_r8,&  !   1
< !      	  0.0_r8,  9999.0_r8,   9999.0_r8,   9999.0_r8,&  !   2
< !        -10.0_r8,     0.0_r8,   9999.0_r8,   9999.0_r8,&  !   3
< !        -45.0_r8,     0.0_r8,   9999.0_r8,   1200.0_r8,&  !   4
< !        -45.0_r8,     0.0_r8,   9999.0_r8,   1200.0_r8,&  !   5
< !        -57.5_r8,   -45.0_r8,   9999.0_r8,    350.0_r8,&  !   6
< !        -57.5_r8,   -45.0_r8,   9999.0_r8,    350.0_r8,&  !   7
< !       9999.0_r8,   -45.0_r8,   9999.0_r8,    350.0_r8,&  !   8
< !       9999.0_r8,  9999.0_r8,   9999.0_r8,    100.0_r8,&  !   9
< !       9999.0_r8,  9999.0_r8,   9999.0_r8,    100.0_r8,&  !  10
< !       9999.0_r8,  9999.0_r8,     22.0_r8,    100.0_r8,&  !  11
< !       9999.0_r8,  9999.0_r8,   9999.0_r8,    100.0_r8/)   !  12
< !!========================================================================
< !      i=0
< !      DO j = 1, npft 
< !         TminL(j) =  dummyvarpk(j+0+i)
< !	 TminU(j) =  dummyvarpk(j+1+i)
< !	 Twarm(j) =  dummyvarpk(j+2+i)
< !	 GDD(j)   =  dummyvarpk(j+3+i)
< !	 i=i+3
< !      END DO
---
>     !-----------------------------------------------------------------
>     ! leaf orientation factors (-1 vertical, 0 random, 1 horizontal)
>     !-----------------------------------------------------------------
>     ! chifuz : upper canopy leaf orientation
>     ! chiflz : lower canopy leaf orientation
>     !-----------------------------------------
>     !      chifuz=   0.0_r8           ! chifuz 
>     !      chiflz=  -0.5_r8           ! chiflz              
>     !=========================================
>     !      dummyvarpk(1:4)=(/ &
>     !-----------------------------------------------------------------------
>     ! linear dimensions for aerodynamic flux parameterization: dleaf, dstem
>     !-----------------------------------------------------------------------
>     !    upper?     lower?
>     !-----------------------------------------
>     !      0.10_r8,         0.10_r8,        &  ! dleaf
>     !      0.10_r8,   0.10_r8/)           ! dstem
>     !=========================================
>     !      i=0
>     !      DO j = 1 ,1 
>     !         dleaf(1) = dummyvarpk(j+0+i)
>     !         dleaf(2) = dummyvarpk(j+1+i)
>     !         i=i+1
>     !      END DO  
>     !      i=i+1
>     !      DO j = 1, 1 
>     !         dstem(1) = dummyvarpk(j+0+i)
>     !         dstem(2) = dummyvarpk(j+1+i)
>     !         i=i+1
>     !      END DO      
>     !
>     !--------------------------------------------------------------------
>     ! normalization constants for canopy drag coefficients (m2 m-2)
>     !---------------------------------------------------------------------
>     !      alaimu=8.0_r8   ! alaimu : upper canopy leaf & stem area (2 sided)
>     !      alaiml=8.0_r8   ! alaiml : lower canopy leaf & stem maximum area (2 sided)
>     !======================================================================
> 
>     !----------------------------------------------------------------------------
>     ! empirical coefficients for aerodynamic transfer parameterization (m s-0.5) 
>     ! From Pollard & Thompson (1995, eq. A39a)
>     !----------------------------------------------------------------------------
>     !      cleaf  = 0.01_r8! cleaf  : upper canopy leaf-air 
>     !      cstem  = 0.01_r8! cstem  : upper canopy stem-air 
>     !      cgrass = 0.01_r8! cgrass : lower canopy-air
>     !===========================================================================
> 
>     !----------------------------------------------------------------------------
>     ! heat capacities of leaves and stems  (J kg-1 C-1 m-2)
>     ! derived from specific heat of liquid water (ch2o = 4.218 J g-1)
>     !----------------------------------------------------------------------------
>     !      chs= 2.109e+05_r8 ! chs : upper canopy stems per unit stem area
>     !      chu= 8.436e+03_r8 ! chu : upper canopy leaves per unit leaf area
>     !      chl= 8.436e+03_r8 ! chl : lower canopy leaves & stems per unit leaf/stem area
>     !----------------------------------------------------------------------------
> 
>     !-----------------------------------------------------------------------
>     ! intercepted water capacity (mm h2o per unit leaf area == kg m-2)
>     !-----------------------------------------------------------------------
>     !           ! wliqmin  : minimum per unit vegetated area
>     !      wliqumax = 0.20_r8  ! wliqumax : maximum per unit upper canopy leaf area 
>     !      wliqsmax = 0.40_r8  ! wliqsmax : maximum per unit upper canopy stem area
>     !      wliqlmax = 0.20_r8  ! wliqlmax : maximum per unit lower canopy stem & leaf area
>     !=======================================================================
> 
>     !-----------------------------------------------------------------------
>     ! intercepted snow capacity (mm h2o per unit leaf area == kg m-2)
>     !-----------------------------------------------------------------------
>     !           ! wsnomin  : minimum per unit vegetated area 
>     !      wsnoumax = 2.00_r8  ! wsnoumax : maximum per unit upper canopy leaf area 
>     !      wsnosmax = 4.00_r8  ! wsnosmax : maximum per unit upper canopy stem area
>     !      wsnolmax = 2.00_r8  ! wsnolmax : maximum per unit lower canopy stem & leaf area
>     !=======================================================================
> 
>     !------------------------------------------------------------
>     ! decay time for intercepted liquid dripoff (sec)
>     !------------------------------------------------------------
>     !      tdripu = 7200.0_r8  ! tdripu : upper canopy leaves (2 hours)
>     !      tdrips = 7200.0_r8  ! tdrips : upper canopy stems (2 hours)
>     !      tdripl = 7200.0_r8  ! tdripl : lower canopy leaves & stems (2 hours)
>     !============================================================
> 
>     !------------------------------------------------------------
>     ! decay time for snow blowoff (sec)
>     !------------------------------------------------------------
>     !      tblowu = 43200.0_r8 ! tblowu : upper canopy leaves (12 hours)
>     !      tblows = 43200.0_r8 ! tblows : upper canopy stems (12 hours)
>     !      tblowl = 43200.0_r8 ! tblowl : lower canopy leaves & stems (12 hours)
>     !============================================================
>     !------------------------------------------------------------------------
>     ! PFTs (top to bottom)
>     !------------------------------------------------------------------------
>     !  1: tropical broadleaf evergreen trees
>     !  2: tropical broadleaf drought-deciduous trees
>     !  3: warm-temperate broadleaf evergreen trees
>     !  4: temperate conifer evergreen trees
>     !  5: temperate broadleaf cold-deciduous trees
>     !  6: boreal conifer evergreen trees
>     !  7: boreal broadleaf cold-deciduous trees
>     !  8: boreal conifer cold-deciduous trees
>     !  9: evergreen shrubs
>     ! 10: cold-deciduous shrubs
>     ! 11: warm (c4) grasses
>     ! 12: cool (c3) grasses
> 
>     !--------------------------------------------------------------------------
>     ! PFT climatic constraint definitions (left to right)
>     !--------------------------------------------------------------------------
>     ! TminL  : absolute minimum temperature (lower limit, C) 
>     ! TminU  : absolute minimum temperature (upper limit, C) 
>     ! Twarm  : temperature of the warmest month (mean??, C) [C4 only]
>     ! GDD    : min growing degree days above 5 C threshold [upper canopy], or
>     !          min growing degree days above 0 C threshold [lower canopy]
> 
>     ! DTP 2001/06/07: Changed this after studying code in climate.f. 
>     !      Values of 9999 indicate this constraint is not used to 
>     !      determine existence of the PFT.  
>     !      dummyvarpk(1:48)=(/ &
>     !------------------------------------------------------------------------
>     ! TminL    TminU    Twarm    GDD    PFT
>     !------------------------------------------------------------------------
>     !                 0.0_r8,  9999.0_r8,   9999.0_r8,   9999.0_r8,&  !   1
>     !                0.0_r8,  9999.0_r8,   9999.0_r8,   9999.0_r8,&  !   2
>     !        -10.0_r8,     0.0_r8,   9999.0_r8,   9999.0_r8,&  !   3
>     !        -45.0_r8,     0.0_r8,   9999.0_r8,   1200.0_r8,&  !   4
>     !        -45.0_r8,     0.0_r8,   9999.0_r8,   1200.0_r8,&  !   5
>     !        -57.5_r8,   -45.0_r8,   9999.0_r8,    350.0_r8,&  !   6
>     !        -57.5_r8,   -45.0_r8,   9999.0_r8,    350.0_r8,&  !   7
>     !       9999.0_r8,   -45.0_r8,   9999.0_r8,    350.0_r8,&  !   8
>     !       9999.0_r8,  9999.0_r8,   9999.0_r8,    100.0_r8,&  !   9
>     !       9999.0_r8,  9999.0_r8,   9999.0_r8,    100.0_r8,&  !  10
>     !       9999.0_r8,  9999.0_r8,     22.0_r8,    100.0_r8,&  !  11
>     !       9999.0_r8,  9999.0_r8,   9999.0_r8,    100.0_r8/)   !  12
>     !!========================================================================
>     !      i=0
>     !      DO j = 1, npft 
>     !         TminL(j) =  dummyvarpk(j+0+i)
>     !         TminU(j) =  dummyvarpk(j+1+i)
>     !         Twarm(j) =  dummyvarpk(j+2+i)
>     !         GDD(j)   =  dummyvarpk(j+3+i)
>     !         i=i+3
>     !      END DO
9469c9193
< !========================================================================
---
>     !========================================================================
9471c9195
<       nveg = nVegClass  ! Number of allowed Vegetation Types in this parameter set   
---
>     nveg = 15  ! Number of allowed Vegetation Types in this parameter set   
9473,9528c9197,9252
< !------------------------------------------------------------------------
< ! Vegetation type classifications (used in subroutine iniveg)
< !------------------------------------------------------------------------
< !  1: tropical evergreen forest / woodland
< !  2: tropical deciduous forest / woodland
< !  3: temperate evergreen broadleaf forest / woodland
< !  4: temperate evergreen conifer forest / woodland
< !  5: temperate deciduous forest / woodland
< !  6: boreal evergreen forest / woodland
< !  7: boreal deciduous forest / woodland
< !  8: mixed forest / woodland
< !  9: savanna
< ! 10: grassland / steppe
< ! 11: dense shrubland
< ! 12: open shrubland
< ! 13: tundra
< ! 14: desert
< ! 15: polar desert / rock / ice
< 
< !------------------------------------------------------------------------
< ! Variable name definitions (left to right)
< !------------------------------------------------------------------------
< ! plaievgr   : initial total LAI of evergreen tree (upper canopy) PFTs
< ! plaideci   : initial total LAI of deciduous tree (upper canopy) PFTs
< ! plaishrub  : initial total LAI of shrub (lower canopy) PFTs
< ! plaigrass  : initial total LAI of grass (lower canopy) PFTs
< ! NOTE: These data are read in to array plai_init. 
< !       The original variable names could be dropped. 
< !      dummyvarpk(1:60)=(/ &
< !------------------------------------------------------------------------
< !      plaievgr     plaideci    plaishrub    plaigrass      Veg Type
< !------------------------------------------------------------------------
< !       5.00_r8,     1.00_r8,     0.25_r8,     0.25_r8,&	!  1
< !       1.00_r8,     5.00_r8,     0.25_r8,     0.25_r8,&	!  2
< !       4.00_r8,     1.00_r8,     0.25_r8,     0.25_r8,&	!  3
< !       3.00_r8,     1.00_r8,     0.25_r8,     0.25_r8,&	!  4
< !       1.00_r8,     3.00_r8,     0.25_r8,     0.25_r8,&	!  5
< !       3.00_r8,     1.00_r8,     0.25_r8,     0.25_r8,&	!  6
< !       1.00_r8,     3.00_r8,     0.25_r8,     0.25_r8,&	!  7
< !       2.00_r8,     2.00_r8,     0.25_r8,     0.25_r8,&	!  8
< !       0.50_r8,     1.00_r8,     0.50_r8,     2.00_r8,&	!  9
< !       0.25_r8,     0.25_r8,     0.50_r8,     2.50_r8,&	! 10
< !       0.10_r8,     0.10_r8,     1.00_r8,     0.50_r8,&	! 11
< !       0.00_r8,     0.00_r8,     0.25_r8,     0.25_r8,&	! 12
< !       0.00_r8,     0.00_r8,     1.00_r8,     1.00_r8,&	! 13
< !       0.00_r8,     0.00_r8,     0.05_r8,     0.05_r8,&	! 14
< !       0.00_r8,     0.00_r8,     0.05_r8,     0.05_r8/)	! 15
< !========================================================================
< !      i=0
< !      DO j = 1, nVegClass 
< !         plai_init(1,j)=  dummyvarpk(j+0+i)
< !         plai_init(2,j)=  dummyvarpk(j+1+i)
< !         plai_init(3,j)=  dummyvarpk(j+2+i)
< !         plai_init(4,j)=  dummyvarpk(j+3+i)
< !         i=i+3
< !      END DO
---
>     !------------------------------------------------------------------------
>     ! Vegetation type classifications (used in subroutine iniveg)
>     !------------------------------------------------------------------------
>     !  1: tropical evergreen forest / woodland
>     !  2: tropical deciduous forest / woodland
>     !  3: temperate evergreen broadleaf forest / woodland
>     !  4: temperate evergreen conifer forest / woodland
>     !  5: temperate deciduous forest / woodland
>     !  6: boreal evergreen forest / woodland
>     !  7: boreal deciduous forest / woodland
>     !  8: mixed forest / woodland
>     !  9: savanna
>     ! 10: grassland / steppe
>     ! 11: dense shrubland
>     ! 12: open shrubland
>     ! 13: tundra
>     ! 14: desert
>     ! 15: polar desert / rock / ice
> 
>     !------------------------------------------------------------------------
>     ! Variable name definitions (left to right)
>     !------------------------------------------------------------------------
>     ! plaievgr   : initial total LAI of evergreen tree (upper canopy) PFTs
>     ! plaideci   : initial total LAI of deciduous tree (upper canopy) PFTs
>     ! plaishrub  : initial total LAI of shrub (lower canopy) PFTs
>     ! plaigrass  : initial total LAI of grass (lower canopy) PFTs
>     ! NOTE: These data are read in to array plai_init. 
>     !       The original variable names could be dropped. 
>     !      dummyvarpk(1:60)=(/ &
>     !------------------------------------------------------------------------
>     !      plaievgr     plaideci    plaishrub    plaigrass      Veg Type
>     !------------------------------------------------------------------------
>     !       5.00_r8,     1.00_r8,     0.25_r8,     0.25_r8,&        !  1
>     !       1.00_r8,     5.00_r8,     0.25_r8,     0.25_r8,&        !  2
>     !       4.00_r8,     1.00_r8,     0.25_r8,     0.25_r8,&        !  3
>     !       3.00_r8,     1.00_r8,     0.25_r8,     0.25_r8,&        !  4
>     !       1.00_r8,     3.00_r8,     0.25_r8,     0.25_r8,&        !  5
>     !       3.00_r8,     1.00_r8,     0.25_r8,     0.25_r8,&        !  6
>     !       1.00_r8,     3.00_r8,     0.25_r8,     0.25_r8,&        !  7
>     !       2.00_r8,     2.00_r8,     0.25_r8,     0.25_r8,&        !  8
>     !       0.50_r8,     1.00_r8,     0.50_r8,     2.00_r8,&        !  9
>     !       0.25_r8,     0.25_r8,     0.50_r8,     2.50_r8,&        ! 10
>     !       0.10_r8,     0.10_r8,     1.00_r8,     0.50_r8,&        ! 11
>     !       0.00_r8,     0.00_r8,     0.25_r8,     0.25_r8,&        ! 12
>     !       0.00_r8,     0.00_r8,     1.00_r8,     1.00_r8,&        ! 13
>     !       0.00_r8,     0.00_r8,     0.05_r8,     0.05_r8,&        ! 14
>     !       0.00_r8,     0.00_r8,     0.05_r8,     0.05_r8/)        ! 15
>     !========================================================================
>     !      i=0
>     !      DO j = 1, nveg 
>     !          plai_init(1,j)=  dummyvarpk(j+0+i)
>     !         plai_init(2,j)=  dummyvarpk(j+1+i)
>     !          plai_init(3,j)=  dummyvarpk(j+2+i)
>     !          plai_init(4,j)=  dummyvarpk(j+3+i)
>     !        i=i+3
>     !      END DO
9530c9254
<       plai_init(1:4,1:nVegClass) =RESHAPE ((/&
---
>     plai_init(1:4,1:15) =RESHAPE ((/&
9545,9547c9269,9271
<       0.00_r8,     0.00_r8,	0.05_r8,     0.05_r8/), (/4, nVegClass/) )! 15
< !
< !
---
>          0.00_r8,     0.00_r8,        0.05_r8,     0.05_r8/), (/4, nveg/) )! 15
>     !
>     !
9549,9652c9273,9376
< !------------------------------------------------------------------------
< ! Other miscellaneous variables needed for initializing plant LAI.
< !------------------------------------------------------------------------
< ! plaiupper    : Potental LAI of upper canopy (uniform initial vegetation) 
< ! plailower    : Potental LAI of lower canopy (uniform initial vegetation) 
< ! xminlai      : Minimum LAI for each existing PFT
< ! sapfrac_init : Initial value of sapwood fraction used for all woody PFTs
< !------------------------------------------------------------------------
< !      plaiupper    = 0.5_r8  ! plaiupper
< !      plailower    = 0.5_r8  ! plailower
< !      xminlai      = 0.01_r8 ! xminlai 
< !      sapfrac_init = 0.1_r8  ! sapfrac_init
< !========================================================================
< 
< ! ************************************************************************
< ! define rooting profiles
< ! ************************************************************************
< !
< ! define rooting profiles based upon data published in:
< !
< ! Jackson et al., 1996:  A global analysis of root distributions
< ! for terrestrial biomes, Oecologia, 108, 389-411.
< !
< ! and
< !
< ! Jackson et al., 1997:  A global budget for fine root biomass, 
< ! surface area, and nutrient contents, Proceedings of the National
< ! Academy of Sciences, 94, 7362-7366.
< !
< ! rooting profiles are defined by the "beta" parameter
< !
< ! beta1 is assigned to the lower vegetation layer (grasses and shrubs)
< ! beta2 is assigned to the upper vegetation layer (trees)
< !
< ! according to Jackson et al. (1996, 1997), the values of beta
< ! typically fall in the following range
< !
< ! note that the 1997 paper specifically discusses the distribution
< ! of *fine roots* (instead of total root biomass), which may be more
< ! important for water and nutrient uptake
< !
< ! --------------                 ------------   ------------
< ! forest systems                 beta2 (1996)   beta2 (1997)
< ! --------------                 ------------   ------------
< ! tropical evergreen forest:        0.962          0.972
< ! tropical deciduous forest:        0.961          0.982
< ! temperate conifer forest:         0.976          0.980
< ! temperate broadleaf forest:       0.966          0.967
< ! all tropical/temperate forest:    0.970  
< ! boreal forest:                    0.943          0.943
< ! all trees:                                       0.976
< !
< ! -------------------------      ------------   ------------
< ! grassland / shrub systems      beta1 (1996)   beta1 (1997)
< ! -------------------------      ------------   ------------
< ! tropical grassland / savanna:     0.972          0.972
< ! temperate grassland:              0.943          0.943
< ! all grasses:                      0.952          0.952
< ! schlerophyllous shrubs:           0.964          0.950
< ! all shrubs:                       0.978          0.975
< ! crops:                            0.961
< ! desert:                           0.975          0.970
< ! tundra:                           0.914
< !
< ! --------------                 ------------
< ! all ecosystems                 beta  (1996)
< ! --------------                 ------------
< ! all ecosystems:                   0.966
< !
< ! for global simulations, we typically assign the following
< ! values to the beta parameters
< !
< ! beta1 = 0.950, which is typical for tropical/temperate grasslands
< ! beta2 = 0.970, which is typical for tropical/temperate forests
< !
< ! however, these values could be (and should be) further refined
< ! when using the model for specific regions
< ! 
< !      beta1 = 0.950_r8  ! beta1: for lower layer herbaceous plants
< !      beta2 = 0.975_r8  ! beta2: for upper layer trees      
< ! ******************************************************************************
< !
< !========================================================================
< ! params.soi : soil parameters....
< !========================================================================
< !
< !   6    ! nsoilay : number of soil layers (actually a constant in comsoi.h)
< !        !           could be read in here, if a new constant, maxsoilay,
< !        !           was introduced to dimension the soil layer arrays  
< !      dummyvarpk(1:6)=(/  &
< !------------------------------------------------------
< ! Soil layer thicknesses (m) 
< ! N.B. Number of layers must equal nsoilay!!!
< !------------------------------------------------------
< !         0.10_r8,&  ! hsoi(1)
< !         0.15_r8,&  ! hsoi(2)
< !         0.25_r8,&  ! hsoi(3)
< !         0.50_r8,&  ! hsoi(4)
< !         1.00_r8,&  ! hsoi(5)
< !         2.00_r8/)  ! hsoi(6)
< !======================================================
< !      DO j = 1, nsoilay
< !        hsoi(j) = dummyvarpk(j)
< !      END DO
---
>     !------------------------------------------------------------------------
>     ! Other miscellaneous variables needed for initializing plant LAI.
>     !------------------------------------------------------------------------
>     ! plaiupper    : Potental LAI of upper canopy (uniform initial vegetation) 
>     ! plailower    : Potental LAI of lower canopy (uniform initial vegetation) 
>     ! xminlai      : Minimum LAI for each existing PFT
>     ! sapfrac_init : Initial value of sapwood fraction used for all woody PFTs
>     !------------------------------------------------------------------------
>     !      plaiupper    = 0.5_r8  ! plaiupper
>     !      plailower    = 0.5_r8  ! plailower
>     !      xminlai      = 0.01_r8 ! xminlai 
>     !      sapfrac_init = 0.1_r8  ! sapfrac_init
>     !========================================================================
> 
>     ! ************************************************************************
>     ! define rooting profiles
>     ! ************************************************************************
>     !
>     ! define rooting profiles based upon data published in:
>     !
>     ! Jackson et al., 1996:  A global analysis of root distributions
>     ! for terrestrial biomes, Oecologia, 108, 389-411.
>     !
>     ! and
>     !
>     ! Jackson et al., 1997:  A global budget for fine root biomass, 
>     ! surface area, and nutrient contents, Proceedings of the National
>     ! Academy of Sciences, 94, 7362-7366.
>     !
>     ! rooting profiles are defined by the "beta" parameter
>     !
>     ! beta1 is assigned to the lower vegetation layer (grasses and shrubs)
>     ! beta2 is assigned to the upper vegetation layer (trees)
>     !
>     ! according to Jackson et al. (1996, 1997), the values of beta
>     ! typically fall in the following range
>     !
>     ! note that the 1997 paper specifically discusses the distribution
>     ! of *fine roots* (instead of total root biomass), which may be more
>     ! important for water and nutrient uptake
>     !
>     ! --------------                 ------------   ------------
>     ! forest systems                 beta2 (1996)   beta2 (1997)
>     ! --------------                 ------------   ------------
>     ! tropical evergreen forest:        0.962          0.972
>     ! tropical deciduous forest:        0.961          0.982
>     ! temperate conifer forest:         0.976          0.980
>     ! temperate broadleaf forest:       0.966          0.967
>     ! all tropical/temperate forest:    0.970  
>     ! boreal forest:                    0.943          0.943
>     ! all trees:                                       0.976
>     !
>     ! -------------------------      ------------   ------------
>     ! grassland / shrub systems      beta1 (1996)   beta1 (1997)
>     ! -------------------------      ------------   ------------
>     ! tropical grassland / savanna:     0.972          0.972
>     ! temperate grassland:              0.943          0.943
>     ! all grasses:                      0.952          0.952
>     ! schlerophyllous shrubs:           0.964          0.950
>     ! all shrubs:                       0.978          0.975
>     ! crops:                            0.961
>     ! desert:                           0.975          0.970
>     ! tundra:                           0.914
>     !
>     ! --------------                 ------------
>     ! all ecosystems                 beta  (1996)
>     ! --------------                 ------------
>     ! all ecosystems:                   0.966
>     !
>     ! for global simulations, we typically assign the following
>     ! values to the beta parameters
>     !
>     ! beta1 = 0.950, which is typical for tropical/temperate grasslands
>     ! beta2 = 0.970, which is typical for tropical/temperate forests
>     !
>     ! however, these values could be (and should be) further refined
>     ! when using the model for specific regions
>     ! 
>     !      beta1 = 0.950_r8  ! beta1: for lower layer herbaceous plants
>     !      beta2 = 0.975_r8  ! beta2: for upper layer trees      
>     ! ******************************************************************************
>     !
>     !========================================================================
>     ! params.soi : soil parameters....
>     !========================================================================
>     !
>     !   6    ! nsoilay : number of soil layers (actually a constant in comsoi.h)
>     !        !           could be read in here, if a new constant, maxsoilay,
>     !        !           was introduced to dimension the soil layer arrays  
>     !      dummyvarpk(1:6)=(/  &
>     !------------------------------------------------------
>     ! Soil layer thicknesses (m) 
>     ! N.B. Number of layers must equal nsoilay!!!
>     !------------------------------------------------------
>     !         0.10_r8,&  ! hsoi(1)
>     !         0.15_r8,&  ! hsoi(2)
>     !         0.25_r8,&  ! hsoi(3)
>     !         0.50_r8,&  ! hsoi(4)
>     !         1.00_r8,&  ! hsoi(5)
>     !         2.00_r8/)  ! hsoi(6)
>     !======================================================
>     !      DO j = 1, nsoilay
>     !        hsoi(j) = dummyvarpk(j)
>     !      END DO
9654,9660c9378,9384
< !------------------------------------------------------
< ! Other miscellaneous soil parameters
< !------------------------------------------------------
< 
< !      bperm    = 0.10_r8  ! bperm   : soil hydraulic diffusivity lower b.c. (units???)
< !      wpudmax  = 4.5_r8   ! wpudmax : normalization constant for puddles (kg m-2) 
< !      zwpmax   = 0.5_r8   ! zwpmax  : maximum value of zwpud (currently assumed to be 0.5)
---
>     !------------------------------------------------------
>     ! Other miscellaneous soil parameters
>     !------------------------------------------------------
> 
>     !      bperm    = 0.10_r8  ! bperm   : soil hydraulic diffusivity lower b.c. (units???)
>     !      wpudmax  = 4.5_r8   ! wpudmax : normalization constant for puddles (kg m-2) 
>     !      zwpmax   = 0.5_r8   ! zwpmax  : maximum value of zwpud (currently assumed to be 0.5)
9664c9388
< !======================================================
---
>     !======================================================
9673,9720c9397,9444
< !------------------------------------------------------
< ! Soil properties data from Rawls et al. (1992)
< ! Organic properties data compiled by Mustapha El Maayar (2000)
< ! Organic FC and WP taken from Nijssen et al., 1997 (JGR; table 3 OBS-top)
< 
< !------------------------------------------------------
< ! Variable column header definitions
< !------------------------------------------------------
< ! Sand     : sand fraction
< ! Silt     : silt fraction
< ! Clay     : clay fraction
< ! Porosity : porosity (volume fraction)
< ! FC       : field capacity (volume fraction)
< ! WP       : wilting point (volume fraction)
< ! bexp     : Campbell's 'b' exponent
< ! AEP      : air entry potential (m-H20)
< ! SHC      : saturated hydraulic conductivity (m s-1)
< !      ! dummyvarpk=0.0_r8
< !      dummyvarpk(1:108)=(/ &
< !------------------------------------------------------------------------------------------------------
< !  Sand   Silt   Clay  Porosity    FC      WP    bexp    AEP       SHC        Texture class
< !------------------------------------------------------------------------------------------------------
< !      0.92_r8,0.05_r8,0.03_r8,0.437_r8,0.091_r8,0.033_r8,1.7_r8,0.07_r8,5.83300E-05_r8,&  ! Sand
< !      0.81_r8,0.12_r8,0.07_r8,0.437_r8,0.125_r8,0.055_r8,2.1_r8,0.09_r8,1.69720E-05_r8,&  ! Loamy Sand
< !      0.65_r8,0.25_r8,0.10_r8,0.453_r8,0.207_r8,0.095_r8,3.1_r8,0.15_r8,7.19440E-06_r8,&  ! Sandy Loam
< !      0.42_r8,0.40_r8,0.18_r8,0.463_r8,0.270_r8,0.117_r8,4.5_r8,0.11_r8,3.66670E-06_r8,&  ! Loam
< !      0.20_r8,0.65_r8,0.15_r8,0.501_r8,0.330_r8,0.133_r8,4.7_r8,0.21_r8,1.88890E-06_r8,&  ! Silty Loam
< !      0.60_r8,0.13_r8,0.27_r8,0.398_r8,0.255_r8,0.148_r8,4.0_r8,0.28_r8,1.19440E-06_r8,&  ! Sandy Clay Loam
< !      0.32_r8,0.34_r8,0.34_r8,0.464_r8,0.318_r8,0.197_r8,5.2_r8,0.26_r8,6.38890E-07_r8,&  ! Clay Loam
< !      0.09_r8,0.58_r8,0.33_r8,0.471_r8,0.366_r8,0.208_r8,6.6_r8,0.33_r8,4.16670E-07_r8,&  ! Silty Clay Loam
< !      0.53_r8,0.07_r8,0.40_r8,0.430_r8,0.339_r8,0.239_r8,6.0_r8,0.29_r8,3.33330E-07_r8,&  ! Sandy Clay
< !      0.10_r8,0.45_r8,0.45_r8,0.479_r8,0.387_r8,0.250_r8,7.9_r8,0.34_r8,2.50000E-07_r8,&  ! Silty Clay
< !      0.20_r8,0.20_r8,0.60_r8,0.475_r8,0.396_r8,0.272_r8,7.6_r8,0.37_r8,1.66670E-07_r8,&  ! Clay
< !      0.00_r8,0.00_r8,0.00_r8,0.800_r8,0.600_r8,0.200_r8,7.6_r8,0.37_r8,1.00000E-05_r8/)  ! Organic - TBA
< !====================================================================
< !      i=0
< !      DO j = 1, ndat
< !          texdat  (1,j)= dummyvarpk(j+0+i)
< !          texdat  (2,j)= dummyvarpk(j+1+i)
< !          texdat  (3,j)= dummyvarpk(j+2+i)
< !          porosdat  (j)= dummyvarpk(j+3+i)
< !          sfielddat (j)= dummyvarpk(j+4+i)
< !          swiltdat  (j)= dummyvarpk(j+5+i)
< !          bexdat    (j)= dummyvarpk(j+6+i)
< !          suctiondat(j)= dummyvarpk(j+7+i)
< !          hydrauldat(j)= dummyvarpk(j+8+i)
< !	  i=i+8
< !      END DO
---
>     !------------------------------------------------------
>     ! Soil properties data from Rawls et al. (1992)
>     ! Organic properties data compiled by Mustapha El Maayar (2000)
>     ! Organic FC and WP taken from Nijssen et al., 1997 (JGR; table 3 OBS-top)
> 
>     !------------------------------------------------------
>     ! Variable column header definitions
>     !------------------------------------------------------
>     ! Sand     : sand fraction
>     ! Silt     : silt fraction
>     ! Clay     : clay fraction
>     ! Porosity : porosity (volume fraction)
>     ! FC       : field capacity (volume fraction)
>     ! WP       : wilting point (volume fraction)
>     ! bexp     : Campbell's 'b' exponent
>     ! AEP      : air entry potential (m-H20)
>     ! SHC      : saturated hydraulic conductivity (m s-1)
>     !      ! dummyvarpk=0.0_r8
>     !      dummyvarpk(1:108)=(/ &
>     !------------------------------------------------------------------------------------------------------
>     !  Sand   Silt   Clay  Porosity    FC      WP    bexp    AEP       SHC        Texture class
>     !------------------------------------------------------------------------------------------------------
>     !      0.92_r8,0.05_r8,0.03_r8,0.437_r8,0.091_r8,0.033_r8,1.7_r8,0.07_r8,5.83300E-05_r8,&  ! Sand
>     !      0.81_r8,0.12_r8,0.07_r8,0.437_r8,0.125_r8,0.055_r8,2.1_r8,0.09_r8,1.69720E-05_r8,&  ! Loamy Sand
>     !      0.65_r8,0.25_r8,0.10_r8,0.453_r8,0.207_r8,0.095_r8,3.1_r8,0.15_r8,7.19440E-06_r8,&  ! Sandy Loam
>     !      0.42_r8,0.40_r8,0.18_r8,0.463_r8,0.270_r8,0.117_r8,4.5_r8,0.11_r8,3.66670E-06_r8,&  ! Loam
>     !      0.20_r8,0.65_r8,0.15_r8,0.501_r8,0.330_r8,0.133_r8,4.7_r8,0.21_r8,1.88890E-06_r8,&  ! Silty Loam
>     !      0.60_r8,0.13_r8,0.27_r8,0.398_r8,0.255_r8,0.148_r8,4.0_r8,0.28_r8,1.19440E-06_r8,&  ! Sandy Clay Loam
>     !      0.32_r8,0.34_r8,0.34_r8,0.464_r8,0.318_r8,0.197_r8,5.2_r8,0.26_r8,6.38890E-07_r8,&  ! Clay Loam
>     !      0.09_r8,0.58_r8,0.33_r8,0.471_r8,0.366_r8,0.208_r8,6.6_r8,0.33_r8,4.16670E-07_r8,&  ! Silty Clay Loam
>     !      0.53_r8,0.07_r8,0.40_r8,0.430_r8,0.339_r8,0.239_r8,6.0_r8,0.29_r8,3.33330E-07_r8,&  ! Sandy Clay
>     !      0.10_r8,0.45_r8,0.45_r8,0.479_r8,0.387_r8,0.250_r8,7.9_r8,0.34_r8,2.50000E-07_r8,&  ! Silty Clay
>     !      0.20_r8,0.20_r8,0.60_r8,0.475_r8,0.396_r8,0.272_r8,7.6_r8,0.37_r8,1.66670E-07_r8,&  ! Clay
>     !      0.00_r8,0.00_r8,0.00_r8,0.800_r8,0.600_r8,0.200_r8,7.6_r8,0.37_r8,1.00000E-05_r8/)  ! Organic - TBA
>     !====================================================================
>     !      i=0
>     !      DO j = 1, ndat
>     !          texdat  (1,j)= dummyvarpk(j+0+i)
>     !          texdat  (2,j)= dummyvarpk(j+1+i)
>     !          texdat  (3,j)= dummyvarpk(j+2+i)
>     !          porosdat  (j)= dummyvarpk(j+3+i)
>     !          sfielddat (j)= dummyvarpk(j+4+i)
>     !          swiltdat  (j)= dummyvarpk(j+5+i)
>     !          bexdat    (j)= dummyvarpk(j+6+i)
>     !          suctiondat(j)= dummyvarpk(j+7+i)
>     !          hydrauldat(j)= dummyvarpk(j+8+i)
>     !          i=i+8
>     !      END DO
9722,9727c9446,9451
< !
< ! Rawls et al. (1992) soil properties data
< !
< !      ------------------
< !       sand  silt  clay
< !      ------------------
---
>     !
>     ! Rawls et al. (1992) soil properties data
>     !
>     !      ------------------
>     !       sand  silt  clay
>     !      ------------------
9742,9756c9466,9481
< !------------------------------------------------------------------------------------------------------
< !      Porosity        Texture class
< !------------------------------------------------------------------------------------------------------ 
<       0.437_r8,&  ! Sand
<       0.437_r8,&  ! Loamy Sand
<       0.453_r8,&  ! Sandy Loam
<       0.463_r8,&  ! Loam
<       0.501_r8,&  ! Silty Loam
<       0.398_r8,&  ! Sandy Clay Loam
<       0.464_r8,&  ! Clay Loam
<       0.471_r8,&  ! Silty Clay Loam
<       0.430_r8,&  ! Sandy Clay
<       0.479_r8,&  ! Silty Clay
<       0.475_r8,&  ! Clay
<       0.800_r8/), (/ndat/) )     ! Organic - TBA
---
>          !------------------------------------------------------------------------------------------------------
>          !      Porosity        Texture class                                                        SIB2     IBIS
>          !------------------------------------------------------------------------------------------------------ 
>          !                                                    Soil  Name            % clay  % sand    Poros     Poros
>          0.373_r8,&  ! Sand                             1    sand                      3       92    0.373     0.437
>          0.386_r8,&  ! Loamy Sand                       2    loamy sand                5       82    0.386     0.437
>          0.407_r8,&  ! Sandy Loam                       3    sandy loam               10       65    0.407     0.453
>          0.436_r8,&  ! Loam                             6    loam                     18       42    0.436     0.463
>          0.461_r8,&  ! Silty Loam                       4    silt loam                13       22    0.461     0.501
>          0.416_r8,&  ! Sandy Clay Loam                  7    sandy clay loam          28       58    0.416     0.398
>          0.449_r8,&  ! Clay Loam                        9    clay loam                39       32    0.449     0.464
>          0.476_r8,&  ! Silty Clay Loam                 10    silty clay loam          39       10    0.476     0.471
>          0.423_r8,&  ! Sandy Clay                       8    sandy clay               40       52    0.423     0.430
>          0.480_r8,&  ! Silty Clay                      11    silty clay               41        7    0.480     0.479
>          0.465_r8,&  ! Clay                            12    clay                     65       19    0.465     0.475
>          0.800_r8/), (/ndat/) )     ! Organic - TBA     5    silt                      7        7    0.436     0.800
9759,9773c9484,9499
< !------------------------------------------------------------------------------------------------------
< !      FC        Texture class
< !------------------------------------------------------------------------------------------------------ 
<       0.091_r8,&  ! Sand
<       0.125_r8,&  ! Loamy Sand
<       0.207_r8,&  ! Sandy Loam
<       0.270_r8,&  ! Loam
<       0.330_r8,&  ! Silty Loam
<       0.255_r8,&  ! Sandy Clay Loam
<       0.318_r8,&  ! Clay Loam
<       0.366_r8,&  ! Silty Clay Loam
<       0.339_r8,&  ! Sandy Clay
<       0.387_r8,&  ! Silty Clay
<       0.396_r8,&  ! Clay
<       0.600_r8/), (/ndat/) )   ! Organic - TBA
---
>          !------------------------------------------------------------------------------------------------------
>          !      FC        Texture class                                                           SIB2       IBIS
>          !------------------------------------------------------------------------------------------------------ 
>          !                                                 Soil  Name               % clay  % sand        PhiSat       PhiSat
>          0.047_r8,&  ! Sand                                1    sand                  3          92        0.047       0.091
>          0.064_r8,&  ! Loamy Sand                          2    loamy sand            5          82        0.064       0.125
>          0.107_r8,&  ! Sandy Loam                          3    sandy loam           10          65        0.107       0.207
>          0.214_r8,&  ! Loam                                6    loam                 18          42        0.214       0.270
>          0.391_r8,&  ! Silty Loam                          4    silt loam            13          22        0.391       0.330
>          0.132_r8,&  ! Sandy Clay Loam                     7    sandy clay loam      28          58        0.132       0.255
>          0.289_r8,&  ! Clay Loam                           9    clay loam            39          32        0.289       0.318
>          0.561_r8,&  ! Silty Clay Loam                    10    silty clay loam      39          10        0.561       0.366
>          0.158_r8,&  ! Sandy Clay                          8    sandy clay           40          52        0.158       0.339
>          0.614_r8,&  ! Silty Clay                         11    silty clay           41           7        0.614       0.387
>          0.428_r8,&  ! Clay                               12    clay                 65          19        0.428       0.396
>          0.214_r8/), (/ndat/) )   ! Organic - TBA          5    silt                  7           7        0.214       0.600
9777,9779c9503,9505
< !------------------------------------------------------------------------------------------------------
< !      WP        Texture class
< !------------------------------------------------------------------------------------------------------ 
---
>          !------------------------------------------------------------------------------------------------------
>          !      WP        Texture class
>          !------------------------------------------------------------------------------------------------------ 
9794,9808c9520,9535
< !------------------------------------------------------------------------------------------------------ 
< !      bexp        Texture class
< !------------------------------------------------------------------------------------------------------ 
<       1.7_r8,&  ! Sand
<       2.1_r8,&  ! Loamy Sand
<       3.1_r8,&  ! Sandy Loam
<       4.5_r8,&  ! Loam
<       4.7_r8,&  ! Silty Loam
<       4.0_r8,&  ! Sandy Clay Loam
<       5.2_r8,&  ! Clay Loam
<       6.6_r8,&  ! Silty Clay Loam
<       6.0_r8,&  ! Sandy Clay
<       7.9_r8,&  ! Silty Clay
<       7.6_r8,&  ! Clay
<       7.6_r8/), (/ndat/) )  ! Organic - TBA
---
>          !------------------------------------------------------------------------------------------------------
>          !      bexp        Texture class                                                         SIB2       IBIS
>          !------------------------------------------------------------------------------------------------------ 
>          !                                              Soil  Name            % clay  % sand         BEE       BEE 
>          3.387_r8,&  ! Sand                              1    sand               3         92       3.387     1.7
>          3.705_r8,&  ! Loamy Sand                        2    loamy sand         5         82       3.705     2.1
>          4.500_r8,&  ! Sandy Loam                        3    sandy loam        10         65       4.500     3.1
>          5.772_r8,&  ! Loam                              6    loam              18         42       5.772     4.5
>          4.977_r8,&  ! Silty Loam                        4    silt loam         13         22       4.977     4.7
>          7.362_r8,&  ! Sandy Clay Loam                   7    sandy clay loam   28         58       7.362     4.0
>          9.111_r8,&  ! Clay Loam                         9    clay loam         39         32       9.111     5.2
>          9.111_r8,&  ! Silty Clay Loam                  10    silty clay loam   39         10       9.111     6.6
>          9.270_r8,&  ! Sandy Clay                        8    sandy clay        40         52       9.270     6.0
>          9.429_r8,&  ! Silty Clay                       11    silty clay        41          7       9.429     7.9
>          13.245_r8,&  ! Clay                            12     clay             65         19      13.245     7.6
>          7.6_r8/), (/ndat/) )  ! Organic - TBA           5    silt               7          7       5.772     7.6
9811,9813c9538,9540
< !------------------------------------------------------------------------------------------------------
< !      AEP        Texture class
< !------------------------------------------------------------------------------------------------------ 
---
>          !------------------------------------------------------------------------------------------------------
>          !      AEP        Texture class
>          !------------------------------------------------------------------------------------------------------ 
9828,9886c9555,9614
< !------------------------------------------------------------------------------------------------------
< !      SHC        Texture class           sib2            ibis
< !------------------------------------------------------------------------------------------------------ 
<       0.236E-04_r8,&  ! Sand		0.236E-04     5.83300E-05_r8
<       0.166E-04_r8,&  ! Loamy Sand	0.166E-04     1.69720E-05_r8
<       0.910E-05_r8,&  ! Sandy Loam	0.910E-05     7.19440E-06_r8
<       0.405E-05_r8,&  ! Loam		0.405E-05     3.66670E-06_r8
<       0.200E-05_r8,&  ! Silty Loam	0.200E-05     1.88890E-06_r8
<       0.711E-05_r8,&  ! Sandy Clay Loam 0.711E-05     1.19440E-06_r8
<       0.285E-05_r8,&  ! Clay Loam	0.285E-05     6.38890E-07_r8
<       0.131E-05_r8,&  ! Silty Clay Loam 0.131E-05     4.16670E-07_r8
<       0.576E-05_r8,&  ! Sandy Clay	0.576E-05     3.33330E-07_r8
<       0.118E-05_r8,&  ! Silty Clay	0.118E-05     2.50000E-07_r8
<       0.180E-05_r8,&  ! Clay		0.180E-05     1.66670E-07_r8
<       1.00000E-05_r8/), (/ndat/) )  ! Organic - TBA 1.00000E-05
<       
< !----------------------------------------------------------------------
< ! Decomposition pool/transformation parameters (see also Kucharik 
< ! et al. 2000)
< 
< !----------------------------------------------------------------------
< ! lig_frac: split of lignified litter material between protected and
< ! non-protected slow OM pools
< !----------------------------------------------------------------------
< !      lig_frac =  0.50_r8 
< 
< !----------------------------------------------------------------------
< ! fbsom: protected biomass as a fraction of total soil organic carbon
< ! from Verberne et al., 1990
< !----------------------------------------------------------------------
< !      fbsom   = 0.017_r8
< 
< !----------------------------------------------------------------------
< ! effac: efficiency of microbial biomass reincorporated into biomass
< ! pool (from NCSOIL parameterizations; Molina et al., 1983)
< !----------------------------------------------------------------------
< !      effac =  0.40_r8 
<      
< !======================================================================
< ! Define C:N ratios of substrate pools and biomass: 
< ! Values for metabolic and structural plant material and for lignin are 
< ! from Parton et al., 1987 and Whitmore and Parry, 1988, indexed as follows:
< !      cnr(1): c:n ratio of microbial biomass
< !      cnr(2): c:n ratio of passive soil carbon
< !      cnr(3): c:n ratio of protected slow soil carbon
< !      cnr(4): c:n ratio of non-protected slow soil C
< !      cnr(5): c:n ratio of resistant litter lignin
< !      cnr(6): c:n ratio of structural plant (leaf and root) litter
< !      cnr(7): c:n ratio of metabolic (plant and root) litter
< !      cnr(8): c:n ratio of woody biomass components
< !      dummyvarpk(1:8)=(/ &
< !---------------------------------------------------------------------
< !   cnr(1)  cnr(2)  cnr(3)  cnr(4)  cnr(5)  cnr(6)  cnr(7)  cnr(8)
< !---------------------------------------------------------------------
< !      8.0_r8,   15.0_r8,   10.0_r8,   15.0_r8,  100.0_r8,  150.0_r8,    6.0_r8,   250.0_r8/)
< !=====================================================================
< !      DO j=1,8
< !         cnr(j) = dummyvarpk(j)
< !      END DO
---
>          !------------------------------------------------------------------------------------------------------
>          !      SHC        Texture class           sib2            ibis
>          !------------------------------------------------------------------------------------------------------ 
>          !                                                                             Soil    Name            % clay  % sand      SatCo  
>          0.236E-04_r8,&  ! Sand                0.236E-04     5.83300E-05_r8         1    sand               3       92    0.236E-04 
>          0.166E-04_r8,&  ! Loamy Sand          0.166E-04     1.69720E-05_r8         2    loamy sand         5       82    0.166E-04 
>          0.910E-05_r8,&  ! Sandy Loam          0.910E-05     7.19440E-06_r8         3    sandy loam         10      65    0.910E-05 
>          0.405E-05_r8,&  ! Loam                0.405E-05     3.66670E-06_r8         6    loam               18      42    0.405E-05 
>          0.200E-05_r8,&  ! Silty Loam          0.200E-05     1.88890E-06_r8         4    silt loam          13      22    0.200E-05 
>          0.711E-05_r8,&  ! Sandy Clay Loam     0.711E-05     1.19440E-06_r8         7    sandy clay loam    28      58    0.711E-05 
>          0.285E-05_r8,&  ! Clay Loam           0.285E-05     6.38890E-07_r8         9    clay loam          39      32    0.285E-05 
>          0.131E-05_r8,&  ! Silty Clay Loam     0.131E-05     4.16670E-07_r8        10    silty clay loam    39      10    0.131E-05 
>          0.576E-05_r8,&  ! Sandy Clay          0.576E-05     3.33330E-07_r8         8    sandy clay         40      52    0.576E-05 
>          0.118E-05_r8,&  ! Silty Clay          0.118E-05     2.50000E-07_r8        11    silty clay         41      7     0.118E-05 
>          0.180E-05_r8,&  ! Clay                0.180E-05     1.66670E-07_r8        12    clay               65      19    0.180E-05 
>          1.00000E-05_r8/), (/ndat/) )   ! Organic - TBA 1.00000E-05                 5    silt               7       7     0.405E-05 
> 
>     !----------------------------------------------------------------------
>     ! Decomposition pool/transformation parameters (see also Kucharik 
>     ! et al. 2000)
> 
>     !----------------------------------------------------------------------
>     ! lig_frac: split of lignified litter material between protected and
>     ! non-protected slow OM pools
>     !----------------------------------------------------------------------
>     !      lig_frac =  0.50_r8 
> 
>     !----------------------------------------------------------------------
>     ! fbsom: protected biomass as a fraction of total soil organic carbon
>     ! from Verberne et al., 1990
>     !----------------------------------------------------------------------
>     !      fbsom   = 0.017_r8
> 
>     !----------------------------------------------------------------------
>     ! effac: efficiency of microbial biomass reincorporated into biomass
>     ! pool (from NCSOIL parameterizations; Molina et al., 1983)
>     !----------------------------------------------------------------------
>     !      effac =  0.40_r8 
> 
>     !======================================================================
>     ! Define C:N ratios of substrate pools and biomass: 
>     ! Values for metabolic and structural plant material and for lignin are 
>     ! from Parton et al., 1987 and Whitmore and Parry, 1988, indexed as follows:
>     !      cnr(1): c:n ratio of microbial biomass
>     !      cnr(2): c:n ratio of passive soil carbon
>     !      cnr(3): c:n ratio of protected slow soil carbon
>     !      cnr(4): c:n ratio of non-protected slow soil C
>     !      cnr(5): c:n ratio of resistant litter lignin
>     !      cnr(6): c:n ratio of structural plant (leaf and root) litter
>     !      cnr(7): c:n ratio of metabolic (plant and root) litter
>     !      cnr(8): c:n ratio of woody biomass components
>     !      dummyvarpk(1:8)=(/ &
>     !---------------------------------------------------------------------
>     !   cnr(1)  cnr(2)  cnr(3)  cnr(4)  cnr(5)  cnr(6)  cnr(7)  cnr(8)
>     !---------------------------------------------------------------------
>     !      8.0_r8,   15.0_r8,   10.0_r8,   15.0_r8,  100.0_r8,  150.0_r8,    6.0_r8,   250.0_r8/)
>     !=====================================================================
>     !      DO j=1,8
>     !         cnr(j) = dummyvarpk(j)
>     !      END DO
9888,10024c9616,9752
< ! Miscellaneous other C:N factors...
< !      fmax  : maximum fraction allowed in resistant fraction
< !      rconst: rconst is a constant defined as 1200 [Huh?]
< !      cnleaf: average c:n ratio for leaf litterfall 
< !      cnroot: average c:n ratio for root turnover(rotatividade)
< !      cnwood: average c:n ratio for woody debris
< !      dummyvarpk(1:5)=(/ &
< !---------------------------------------------------------------------
< !      fmax    rconst    cnleaf    cnroot   cnwood
< !---------------------------------------------------------------------
< !       0.45_r8,   1200.0_r8,     40.0_r8,     60.0_r8,    200.0_r8/)
< !=====================================================================
< !      fmax   = dummyvarpk(1)
< !      rconst = dummyvarpk(2)
< !      cnleaf = dummyvarpk(3)
< !      cnroot = dummyvarpk(4)
< !      cnwood = dummyvarpk(5)
<       
< 
< !--------------------------------------------------------------------------------------
< 
< ! Specific maximum decay rate or growth constants; rates are per day.
< ! Constants are taken from Parton et al., 1987 and Verberne et al., 1990
< ! and special issue of Geoderma (comparison of 9 organic matter models) in Dec. 1997
< 
< ! Leaching parameterization was changed to agree with field data, and led to 
< ! changes in the values of the constants given below.  
< 
< ! Approximate factors for Verberne et al. model where efficiencies are 100%
< ! for some of the transformations: one problem was that their rate constants were
< ! based on 25C, and our modifying functions are based on 15 C...thus the rate constants
< ! are somewhat smaller compared to the Verberne et al. (1990) model parameters.
< ! Rates are based on a daily decomposition timestep (per day)
< !--------------------------------------------------------------------------------------
< 
< !      klm: dpm leaf litter --> microbial biomass
< !      kls: spm leaf litter --> microbial biomass
< !      kll: rpm leaf litter --> non or protected om
< !      krm: dpm root litter --> microbial biomass
< !      krs: spm root litter --> microbial biomass
< !      krl: rpm root litter --> non or protected om 
< !      kwm: dpm woody litter --> microbial biomass
< !      kws: spm woody litter --> microbial biomass
< !      kwl: rpm woody litter --> non or protected om 
< !      dummyvarpk(1:9)=(/ &
< !---------------------------------------------------------------------
< !     klm    kls    kll    krm    krs    krl    kwm    kws    kwl
< !---------------------------------------------------------------------
< !      0.150_r8, 0.010_r8,0.010_r8,0.100_r8,0.005_r8,0.005_r8,0.001_r8,0.001_r8,0.001_r8/)
< !=====================================================================
< !
< !      klm  = dummyvarpk(1)
< !      kls  = dummyvarpk(2)
< !      kll  = dummyvarpk(3)
< !      krm  = dummyvarpk(4)
< !      krs  = dummyvarpk(5)
< !      krl  = dummyvarpk(6)
< !      kwm  = dummyvarpk(7)
< !      kws  = dummyvarpk(8)
< !      kwl  = dummyvarpk(9)
< !----------------------------------------------------------------------
< !
< !      kbn: biomass --> non protected organic matter 
< !      kbp: biomass --> protected organic matter
< !      knb: non-protected om --> biomass
< !      kns: non-protected om --> stabilized om
< !      kpb: protected om --> biomass
< !      kps: protected om --> stabilized om
< !      ksb: stabilized om --> biomass
< !       dummyvarpk(1:7)=(/ &
< !---------------------------------------------------------------------
< !      kbn     kbp     knb     kns     kpb     kps     ksb
< !---------------------------------------------------------------------
< !      0.045_r8,   0.005_r8,   0.001_r8, 1.0e-06_r8,  0.0001_r8, 1.0e-06_r8, 8.0e-07_r8/)
< !=====================================================================
< !       kbn  = dummyvarpk(1)
< !       kbp  = dummyvarpk(2)
< !       knb  = dummyvarpk(3)
< !       kns  = dummyvarpk(4)
< !       kpb  = dummyvarpk(5)
< !       kps  = dummyvarpk(6)
< !       ksb  = dummyvarpk(7)
< !
< ! Yields (efficiencies) with which microbes gain biomass from C 
< ! source; the rest is driven off as CO2 (microbial respiration). All 
< ! microbial CO2 is assumed to leave the soil profile over the course 
< ! of a year. Values are taken primarily from the models of Verberne 
< ! and from CENTURY.
< !----------------------------------------------------------------------
< !      ylm: efficiency for metabolic plant material - leaf matter
< !      yrm: efficiency for metabolic plant material - root matter
< !      ywm: efficiency for metabolic plant material - woody matter
< !      yls: efficiency for structural plant material - leaf matter
< !      yrs: efficiency for structural plant material - root matter
< !      yws: efficiency for structural plant material - woody matter
< !      yll: plant material resistant fraction - leaf matter
< !      yrl: plant material resistant fraction - root matter
< !      ywl: plant material resistant fraction - woody matter
< !      dummyvarpk(1:9)=(/ &
< !---------------------------------------------------------------------
< !   ylm    yrm    ywm    yls    yrs    yws    yll    yrl    ywl
< !---------------------------------------------------------------------
< !      0.40_r8,0.40_r8,0.40_r8,0.30_r8,0.30_r8,0.30_r8,1.00_r8,1.00_r8,1.00_r8/)
< !=====================================================================       
< !      ylm = dummyvarpk(1)
< !      yrm = dummyvarpk(2)
< !      ywm = dummyvarpk(3)
< !      yls = dummyvarpk(4)
< !      yrs = dummyvarpk(5)
< !      yws = dummyvarpk(6)
< !      yll = dummyvarpk(7)
< !      yrl = dummyvarpk(8)
< !      ywl = dummyvarpk(9)
<       
<  
< !      ybn: biomass       --> non-protected pool
< !      ybp: biomass       --> protected pool
< !      yps: protected     --> passive
< !      yns: non-protected --> passive
< !      ysb: passive pool  --> biomass
< !      ypb: protected     --> biomass
< !      ynb: non-protected --> biomass
< !      dummyvarpk(1:7)=(/ &
< !---------------------------------------------------------------------
< !      ybn     ybp     yps     yns     ysb     ypb     ynb
< !---------------------------------------------------------------------
< !      1.00_r8,   1.00_r8,   1.00_r8,   1.00_r8,   0.20_r8,   0.20_r8,    0.25_r8/)
< !=====================================================================
< !
< !      ybn  = dummyvarpk(1)
< !      ybp  = dummyvarpk(2)
< !      yps  = dummyvarpk(3)
< !      yns  = dummyvarpk(4)
< !      ysb  = dummyvarpk(5)
< !      ypb  = dummyvarpk(6)
< !      ynb  = dummyvarpk(7)
< !
---
>     ! Miscellaneous other C:N factors...
>     !      fmax  : maximum fraction allowed in resistant fraction
>     !      rconst: rconst is a constant defined as 1200 [Huh?]
>     !      cnleaf: average c:n ratio for leaf litterfall 
>     !      cnroot: average c:n ratio for root turnover
>     !      cnwood: average c:n ratio for woody debris
>     !      dummyvarpk(1:5)=(/ &
>     !---------------------------------------------------------------------
>     !      fmax    rconst    cnleaf    cnroot   cnwood
>     !---------------------------------------------------------------------
>     !       0.45_r8,   1200.0_r8,     40.0_r8,     60.0_r8,    200.0_r8/)
>     !=====================================================================
>     !      fmax   = dummyvarpk(1)
>     !      rconst = dummyvarpk(2)
>     !      cnleaf = dummyvarpk(3)
>     !      cnroot = dummyvarpk(4)
>     !      cnwood = dummyvarpk(5)
> 
> 
>     !--------------------------------------------------------------------------------------
> 
>     ! Specific maximum decay rate or growth constants; rates are per day.
>     ! Constants are taken from Parton et al., 1987 and Verberne et al., 1990
>     ! and special issue of Geoderma (comparison of 9 organic matter models) in Dec. 1997
> 
>     ! Leaching parameterization was changed to agree with field data, and led to 
>     ! changes in the values of the constants given below.  
> 
>     ! Approximate factors for Verberne et al. model where efficiencies are 100%
>     ! for some of the transformations: one problem was that their rate constants were
>     ! based on 25C, and our modifying functions are based on 15 C...thus the rate constants
>     ! are somewhat smaller compared to the Verberne et al. (1990) model parameters.
>     ! Rates are based on a daily decomposition timestep (per day)
>     !--------------------------------------------------------------------------------------
> 
>     !      klm: dpm leaf litter --> microbial biomass
>     !      kls: spm leaf litter --> microbial biomass
>     !      kll: rpm leaf litter --> non or protected om
>     !      krm: dpm root litter --> microbial biomass
>     !      krs: spm root litter --> microbial biomass
>     !      krl: rpm root litter --> non or protected om 
>     !      kwm: dpm woody litter --> microbial biomass
>     !      kws: spm woody litter --> microbial biomass
>     !      kwl: rpm woody litter --> non or protected om 
>     !      dummyvarpk(1:9)=(/ &
>     !---------------------------------------------------------------------
>     !     klm    kls    kll    krm    krs    krl    kwm    kws    kwl
>     !---------------------------------------------------------------------
>     !      0.150_r8, 0.010_r8,0.010_r8,0.100_r8,0.005_r8,0.005_r8,0.001_r8,0.001_r8,0.001_r8/)
>     !=====================================================================
>     !
>     !      klm  = dummyvarpk(1)
>     !      kls  = dummyvarpk(2)
>     !      kll  = dummyvarpk(3)
>     !      krm  = dummyvarpk(4)
>     !      krs  = dummyvarpk(5)
>     !      krl  = dummyvarpk(6)
>     !      kwm  = dummyvarpk(7)
>     !      kws  = dummyvarpk(8)
>     !      kwl  = dummyvarpk(9)
>     !----------------------------------------------------------------------
>     !
>     !      kbn: biomass --> non protected organic matter 
>     !      kbp: biomass --> protected organic matter
>     !      knb: non-protected om --> biomass
>     !      kns: non-protected om --> stabilized om
>     !      kpb: protected om --> biomass
>     !      kps: protected om --> stabilized om
>     !      ksb: stabilized om --> biomass
>     !       dummyvarpk(1:7)=(/ &
>     !---------------------------------------------------------------------
>     !      kbn     kbp     knb     kns     kpb     kps     ksb
>     !---------------------------------------------------------------------
>     !      0.045_r8,   0.005_r8,   0.001_r8, 1.0e-06_r8,  0.0001_r8, 1.0e-06_r8, 8.0e-07_r8/)
>     !=====================================================================
>     !       kbn  = dummyvarpk(1)
>     !       kbp  = dummyvarpk(2)
>     !       knb  = dummyvarpk(3)
>     !       kns  = dummyvarpk(4)
>     !       kpb  = dummyvarpk(5)
>     !       kps  = dummyvarpk(6)
>     !       ksb  = dummyvarpk(7)
>     !
>     ! Yields (efficiencies) with which microbes gain biomass from C 
>     ! source; the rest is driven off as CO2 (microbial respiration). All 
>     ! microbial CO2 is assumed to leave the soil profile over the course 
>     ! of a year. Values are taken primarily from the models of Verberne 
>     ! and from CENTURY.
>     !----------------------------------------------------------------------
>     !      ylm: efficiency for metabolic plant material - leaf matter
>     !      yrm: efficiency for metabolic plant material - root matter
>     !      ywm: efficiency for metabolic plant material - woody matter
>     !      yls: efficiency for structural plant material - leaf matter
>     !      yrs: efficiency for structural plant material - root matter
>     !      yws: efficiency for structural plant material - woody matter
>     !      yll: plant material resistant fraction - leaf matter
>     !      yrl: plant material resistant fraction - root matter
>     !      ywl: plant material resistant fraction - woody matter
>     !      dummyvarpk(1:9)=(/ &
>     !---------------------------------------------------------------------
>     !   ylm    yrm    ywm    yls    yrs    yws    yll    yrl    ywl
>     !---------------------------------------------------------------------
>     !      0.40_r8,0.40_r8,0.40_r8,0.30_r8,0.30_r8,0.30_r8,1.00_r8,1.00_r8,1.00_r8/)
>     !=====================================================================       
>     !      ylm = dummyvarpk(1)
>     !      yrm = dummyvarpk(2)
>     !      ywm = dummyvarpk(3)
>     !      yls = dummyvarpk(4)
>     !      yrs = dummyvarpk(5)
>     !      yws = dummyvarpk(6)
>     !      yll = dummyvarpk(7)
>     !      yrl = dummyvarpk(8)
>     !      ywl = dummyvarpk(9)
> 
> 
>     !      ybn: biomass       --> non-protected pool
>     !      ybp: biomass       --> protected pool
>     !      yps: protected     --> passive
>     !      yns: non-protected --> passive
>     !      ysb: passive pool  --> biomass
>     !      ypb: protected     --> biomass
>     !      ynb: non-protected --> biomass
>     !      dummyvarpk(1:7)=(/ &
>     !---------------------------------------------------------------------
>     !      ybn     ybp     yps     yns     ysb     ypb     ynb
>     !---------------------------------------------------------------------
>     !      1.00_r8,   1.00_r8,   1.00_r8,   1.00_r8,   0.20_r8,   0.20_r8,    0.25_r8/)
>     !=====================================================================
>     !
>     !      ybn  = dummyvarpk(1)
>     !      ybp  = dummyvarpk(2)
>     !      yps  = dummyvarpk(3)
>     !      yns  = dummyvarpk(4)
>     !      ysb  = dummyvarpk(5)
>     !      ypb  = dummyvarpk(6)
>     !      ynb  = dummyvarpk(7)
>     !
10029,10037c9757,9765
< ! ******************************************************************************
< !open the parameter file 'params.hyd' for input; read in vegetation PFT parameters...
< !
< !      parm_file = 'params.hyd' ! What is this file supposed to contain???
< !
< !      open(UNIT=parm_unit, FILE=parm_file, STATUS='OLD', ERR=9001)
< !      close (parm_unit) 
< !
< !******************************************************************************
---
>     ! ******************************************************************************
>     !open the parameter file 'params.hyd' for input; read in vegetation PFT parameters...
>     !
>     !      parm_file = 'params.hyd' ! What is this file supposed to contain???
>     !
>     !      open(UNIT=parm_unit, FILE=parm_file, STATUS='OLD', ERR=9001)
>     !      close (parm_unit) 
>     !
>     !******************************************************************************
10044c9772
< 9000  WRITE (nfprt,2003) parm_file, parm_unit
---
>     WRITE (nfprt,2003) parm_file, parm_unit
10049c9777
< 9001  WRITE (nfprt,2001) parm_file, parm_unit 
---
>     WRITE (nfprt,2001) parm_file, parm_unit 
10054c9782
< 9002  WRITE (nfprt,2002) parm_file, parm_unit 
---
>     WRITE (nfprt,2002) parm_file, parm_unit 
10064a9793,9805
>  INTEGER FUNCTION idx(xMax,yMax,x)
>   IMPLICIT NONE
>   INTEGER, INTENT(IN   ) :: xMax
>   INTEGER, INTENT(IN   ) :: yMax
>   INTEGER, INTENT(IN   ) :: x
>   REAL :: tag_alfa,a
> 
>   tag_alfa=REAL(yMax - 1 )/ REAL(xMax - 1)
>   ! x=1 ; y=1
>   a=1.0 - tag_alfa
>   idx = a + tag_alfa*x
>  END FUNCTION idx
> 
10066,10067c9807
<       SUBROUTINE ReStartIBIS (jbMax,ifday,tod,idate ,idatec, &
<        nfsibo,ibMaxPerJB)
---
>   SUBROUTINE ReStartIBIS (nfsibo)
10069,10073c9809,9813
<         INTEGER           ,INTENT(IN   ) :: jbMax
<         INTEGER           ,INTENT(IN   ) :: ifday
<         REAL(KIND=r8)     ,INTENT(IN   ) :: tod
<         INTEGER           ,INTENT(IN   ) :: idate(:)
<         INTEGER           ,INTENT(IN   ) :: idatec(:)
---
>     !INTEGER           ,INTENT(IN   ) :: jbMax
>     !INTEGER           ,INTENT(IN   ) :: ifday
>     !REAL(KIND=r8)     ,INTENT(IN   ) :: tod
>     !INTEGER           ,INTENT(IN   ) :: idate(:)
>     !INTEGER           ,INTENT(IN   ) :: idatec(:)
10075,10078c9815,9816
<         INTEGER           ,INTENT(IN   ) :: ibMaxPerJB(:)
<         INTEGER                         :: i
<         INTEGER                         :: j
<         INTEGER                         :: ncount
---
>     !INTEGER           ,INTENT(IN   ) :: ibMaxPerJB(:)
>     !INTEGER                         :: i
10084c9822
< 
---
>     !$OMP SINGLE
10107c9845
<       WRITE(UNIT=nfsibo)totnsoi,totnsoi_p
---
>     WRITE(UNIT=nfsibo)totnsoi ,totnsoi_p
10119,10124c9857,9862
< !
< ! ---------------------------------------------------------------------
< !
< !
< !  daily average variables 
< !
---
>     WRITE(UNIT=nfsibo)tcthis
>     WRITE(UNIT=nfsibo)twthis
> 
>     !
>     !  daily average variables 
>     !
10150c9888
<       WRITE(UNIT=nfsibo)storedn,storedn_p
---
>     WRITE(UNIT=nfsibo)storedn, storedn_p
10153,10156c9891,9893
< 
< !
< !  monthly average variables 
< !
---
>     !
>     !  monthly average variables 
>     !
10196,10198c9933,9935
< !
< !  annual total variables 
< !
---
>     !
>     !  annual total variables 
>     !
10259,10264c9996,10005
<       WRITE(UNIT=nfsibo)wliqu
<       WRITE(UNIT=nfsibo)wliqs
<       WRITE(UNIT=nfsibo)wliql
<       WRITE(UNIT=nfsibo)wsnou
<       WRITE(UNIT=nfsibo)wsnos
<       WRITE(UNIT=nfsibo)wsnol
---
>     WRITE(UNIT=nfsibo)wliqum,wliqu,wliqu0
>     WRITE(UNIT=nfsibo)wliqsm,wliqs,wliqs0
>     WRITE(UNIT=nfsibo)wliqlm,wliql,wliql0
>     WRITE(UNIT=nfsibo)wsnoum,wsnou,wsnou0
>     WRITE(UNIT=nfsibo)wsnosm,wsnos,wsnos0
>     WRITE(UNIT=nfsibo)wsnolm,wsnol,wsnol0
>     WRITE(UNIT=nfsibo)tum,tu,tu0
>     WRITE(UNIT=nfsibo)tsm,ts,ts0
>     WRITE(UNIT=nfsibo)tlm,tl,tl0
>     WRITE(UNIT=nfsibo)tim,ti,ti0
10266,10269c10007,10010
<       WRITE(UNIT=nfsibo)fi,fu,fl,tu,ts,tl,tg,ti
< !
< ! nsnolay variables: tsno and hsno
< !
---
>     WRITE(UNIT=nfsibo)fi,fu,fl,tg
>     !
>     ! nsnolay variables: tsno and hsno
>     !
10271,10272c10012,10013
< !
<       WRITE(UNIT=nfsibo)tsno
---
>     !
>     WRITE(UNIT=nfsibo)tsnom,tsno,tsno0
10276,10278c10017,10019
< !
< ! nsoilay variables: tsoi, wisoi, wsoi
< !
---
>     !
>     ! nsoilay variables: tsoi, wisoi, wsoi
>     !
10280c10021
<       WRITE(UNIT=nfsibo)tsoim,tsoi
---
>     WRITE(UNIT=nfsibo)tsoim,tsoi,tsoi0
10282c10023
<       WRITE(UNIT=nfsibo)wisoi
---
>     WRITE(UNIT=nfsibo)wisoim,wisoi,wisoi0
10284c10025
<       WRITE(UNIT=nfsibo)wsoim,wsoi
---
>     WRITE(UNIT=nfsibo)wsoim,wsoi,wsoi0
10286,10288c10027,10029
< !
< ! npft variables
< !
---
>     !
>     ! npft variables
>     !
10302,10304c10043,10045
< !
< ! single level variables
< !
---
>     !
>     ! single level variables
>     !
10404c10145
<       WRITE(UNIT=nfsibo) ppli,ppci
---
>     WRITE(UNIT=nfsibo) ppli,ppci,snow
10406c10147,10148
<       WRITE(UNIT=nfsibo) gl0 ,zorl,gtsea,tseam,qsfc0,tsfc0,qsfcm,tsfcm,tkemyj
---
>     WRITE(UNIT=nfsibo) gl0 ,zorl,gtsea,gco2flx,tseam,qsfc0,tsfc0,qsfcm,tsfcm,tkemyj ,HML,HUML,HVML,TSK,z0sea,&
>       TC_SeaIce,TGS_SeaIce,TD_SeaIce,TA_SeaIce,SNOA_SeaIce,SNOB_SeaIce,cflxm
10429a10172,10174
>     WRITE(UNIT=nfsibo) vegtype0,froot,csoi
> 
>     WRITE(UNIT=nfsibo)  PBL_CoefKm, PBL_CoefKh,tauresx,tauresy,sheleg,poda,tmin2m   ,tmax2m 
10431c10176,10178
<       WRITE(UNIT=nfsibo) vegtype0,froot
---
>     WRITE(UNIT=nfsibo)  laymld,       hbath,     tdeep,sdeep
> 
>        !$OMP END SINGLE
10440c10187
<          DEALLOCATE(brf     )
---
>     !DEALLOCATE(brf     )
10476a10224
> 
10492a10241
>     DEALLOCATE(wisoim    )
10493a10243
>     DEALLOCATE(wisoi0    )
10499a10250
>     DEALLOCATE(ti0      )
10500a10252,10253
>     DEALLOCATE(tim      )
> 
10521a10275
>     DEALLOCATE(tsnom    )
10522a10277
>     DEALLOCATE(tsno0    )
10663a10419
>     DEALLOCATE(tsm            )
10664a10421,10422
>     DEALLOCATE(ts0            )
>     DEALLOCATE(tlm            )
10665a10424
>     DEALLOCATE(tl0            )
10730a10490
>     DEALLOCATE(wliqu0           )
10731a10492,10493
>     DEALLOCATE(wliqum           )
>     DEALLOCATE(wliqsm           )
10732a10495,10496
>     DEALLOCATE(wliqs0           )
>     DEALLOCATE(wliqlm           )
10733a10498,10499
>     DEALLOCATE(wliql0           )
>     DEALLOCATE(wsnou0           )
10734a10501,10502
>     DEALLOCATE(wsnoum           )
>     DEALLOCATE(wsnos0           )
10735a10504,10505
>     DEALLOCATE(wsnosm           )
>     DEALLOCATE(wsnolm           )
10736a10507
>     DEALLOCATE(wsnol0           )
10776d10546
< 	 DEALLOCATE(hsoi    )
10779d10548
< 
10787a10557
> 
10794,10797c10564,10567
< ! ---------------------------------------------------------------------
< !
< ! sets all elements of real vector arr to value
< !
---
>     ! ---------------------------------------------------------------------
>     !
>     ! sets all elements of real vector arr to value
>     !
10799,10801c10569,10571
< !
< ! Arguments
< !
---
>     !
>     ! Arguments
>     !
10805,10807c10575,10577
< !
< ! Local variables
< !
---
>     !
>     ! Local variables
>     !
10809c10579
< !
---
>     !
10813c10583
< !
---
>     !
