Ignore:
Timestamp:
2011-06-17T14:02:17+02:00 (13 years ago)
Author:
didier.solyga
Message:

Externalized version merged with the trunk

Location:
branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/AA_make

    r64 r257  
    11#- 
    2 #- $Id: AA_make,v 1.22 2010/04/20 13:59:56 ssipsl Exp $ 
     2#- $Id: AA_make 41 2011-01-01 19:56:53Z mmaipsl $ 
     3#- 
     4PARALLEL_LIB = $(LIBDIR)/libparallel.a 
     5SXPARALLEL_LIB = $(PARALLEL_LIB) 
     6#-Q- sxnec  SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a 
     7#-Q- sx6nec SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a 
     8#-Q- eshpux SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a 
     9#-Q- sx8brodie SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a 
    310#- 
    411PARAM_LIB = $(LIBDIR)/libparameters.a 
     
    815#-Q- eshpux SXPARAM_LIB = $(LIBDIR)/libsxparameters.a 
    916#-Q- sx8brodie SXPARAM_LIB = $(LIBDIR)/libsxparameters.a 
    10 #- 
    11 PARALLEL_LIB = $(LIBDIR)/libparallel.a 
    12 SXPARALLEL_LIB = $(PARALLEL_LIB) 
    13 #-Q- sxnec  SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a 
    14 #-Q- sx6nec SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a 
    15 #-Q- eshpux SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a 
    16 #-Q- sx8brodie SXPARALLEL_LIB = $(LIBDIR)/libsxparallel.a 
    1717#- 
    1818ORGLOB_LIB = $(LIBDIR)/liborglob.a 
     
    5454#- 
    5555all: 
     56        $(M_K) libparallel 
    5657        $(M_K) libparameters 
    57         $(M_K) libparallel 
     58        $(M_K) liborglob 
    5859        $(M_K) libstomate 
    5960        $(M_K) m_all 
     
    6364#-Q- intel m_all: WORK_MOD $(MODEL_LIB)($(OBJSMODS1)) 
    6465 
     66libparallel: 
     67        (cd ../src_parallel; $(M_K) -f Makefile) 
     68 
    6569libparameters: 
    6670        (cd ../src_parameters; $(M_K) -f Makefile) 
    67  
    68 libparallel: 
    69         (cd ../src_parallel; $(M_K) -f Makefile) 
    7071 
    7172liborglob: 
  • branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/AA_make.ldef

    r64 r257  
    11#- 
    2 #- $Id: AA_make.ldef,v 1.7 2008/01/08 11:49:07 ssipsl Exp $ 
     2#- $Id: AA_make.ldef 12 2010-11-05 15:42:13Z mmaipsl $ 
    33#- 
    44#--------------------------------------------------------------------- 
  • branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/condveg.f90

    r104 r257  
    66!! 
    77!! @author Marie-Alice Foujols and Jan Polcher 
    8 !! @Version : $Revision: 1.30 $, $Date: 2009/01/07 13:39:45 $ 
     8!! @Version : $Revision: 45 $, $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 
    99!!  
    10 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/condveg.f90,v 1.30 2009/01/07 13:39:45 ssipsl Exp $ 
     10!< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/condveg.f90 $ 
     11!< $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 
     12!< $Author: mmaipsl $ 
     13!< $Revision: 45 $ 
    1114!! IPSL (2006) 
    1215!!  This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC 
     
    210213    REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (in):: veget            !! Vegetation distribution 
    211214    REAL(r_std),DIMENSION (kjpindex,2), INTENT (in)  :: lalo             !! Geographical coordinates 
    212     INTEGER(i_std),DIMENSION (kjpindex,4), INTENT(in):: neighbours       !! neighoring grid points if land 
     215    INTEGER(i_std),DIMENSION (kjpindex,8), INTENT(in):: neighbours       !! neighoring grid points if land 
    213216    REAL(r_std), DIMENSION (kjpindex,2), INTENT(in)  :: resolution       !! size in x an y of the grid (m) 
    214217    REAL(r_std),DIMENSION (kjpindex), INTENT(in)     :: contfrac         ! Fraction of land in each grid box. 
     
    663666      ! snow albedo on vegetated surfaces 
    664667      ! 
    665       fraction_veg(:) = 1. - totfrac_nobio(:) 
    666       snowa_veg(:) = 0. 
     668      fraction_veg(:) = un - totfrac_nobio(:) 
     669      snowa_veg(:) = zero 
    667670      DO jv = 1, nvm 
    668671        DO ji = 1, kjpindex 
     
    11121115    ENDDO 
    11131116    ! 
    1114     WHERE ( sumveg(:) .GT. 0.0 ) z0(:) = z0(:) / sumveg(:) 
     1117    WHERE ( sumveg(:) .GT. zero ) z0(:) = z0(:) / sumveg(:) 
    11151118    ! 
    11161119    z0(:) = (un - totfrac_nobio(:)) * z0(:) 
     
    11661169    ! 
    11671170!!$    DS :Correction 11/02/2011 : update 2D parameters  
    1168 !!$      before the components were updated but not the  parameter itself! 
    11691171    alb_leaf(1:nvm) = alb_leaf_vis(:) 
    11701172    alb_leaf(nvm+1:2*nvm) = alb_leaf_nir(:) 
    1171 !!$ maybe we could use directly alb_leaf_vis and alb_leaf_nir in alb_leaf_temp 
    1172     ! 
    1173 !!$    alb_leaf_tmp(:,1) = alb_leaf_vis(:) 
    1174 !!$    alb_leaf_tmp(:,2) = alb_leaf_nir(:) 
    11751173    ! 
    11761174    alb_leaf_tmp(:,1) = alb_leaf(1:nvm) 
     
    11881186       ! 
    11891187       ! Correction Nathalie le 12 Avril 2006 - suppression de la dependance en deadleaf_cover 
    1190        !albedo(:,ks) = veget(:,1) * ( (1.-deadleaf_cover(:))*alb_bare(:) + & 
     1188       !albedo(:,ks) = veget(:,1) * ( (un-deadleaf_cover(:))*alb_bare(:) + & 
    11911189       !                              deadleaf_cover(:)*alb_deadleaf(ks)    ) 
    11921190       albedo(:,ks) = veget(:,1) * alb_bare(:,ks) 
  • branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/diffuco.f90

    r105 r257  
    33!! 
    44!! @author Marie-Alice Foujols and Jan Polcher 
    5 !! @Version : $Revision: 1.35 $, $Date: 2010/04/07 09:16:40 $ 
     5!! @Version : $Revision: 42 $, $Date: 2011-01-01 21:15:03 +0100 (Sat, 01 Jan 2011) $ 
    66!!  
    7 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/diffuco.f90,v 1.35 2010/04/07 09:16:40 ssipsl Exp $ 
     7!< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/diffuco.f90 $ 
     8!< $Date: 2011-01-01 21:15:03 +0100 (Sat, 01 Jan 2011) $ 
     9!< $Author: mmaipsl $ 
     10!< $Revision: 42 $ 
    811!! IPSL (2006) 
    912!!  This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC 
     
    3841  !! Nathalie le 28 mars 2006 - sur proposition de Fred Hourdin, ajout 
    3942  !! d'un potentiometre pour regler la resistance de la vegetation ( rveg is now in pft_parameters) 
    40  
    4143  ! MM 
    4244  REAL(r_std), ALLOCATABLE, SAVE, DIMENSION (:)      :: wind                     !! Wind norm 
     
    242244    ! beta coefficient for bare soil 
    243245    ! 
    244  
    245246    CALL diffuco_bare (kjpindex, dtradia, u, v, q_cdrag, rsol, evap_bare_lim, evapot, humrel, veget, vbeta4)  
    246247 
     
    744745                IF ( zrapp .LT. un ) THEN 
    745746                   ! Ajout Nathalie - Juin 2006 
    746                     vbeta23(ji,jv) = MAX(vbeta2(ji,jv) - vbeta2(ji,jv) * zrapp, 0.) 
     747                    vbeta23(ji,jv) = MAX(vbeta2(ji,jv) - vbeta2(ji,jv) * zrapp, zero) 
    747748                    ! Fin ajout Nathalie 
    748749                    vbeta2(ji,jv) = vbeta2(ji,jv) * zrapp 
     
    10041005    ! 
    10051006    DO jl = 1, nlai+1 
    1006       laitab(jl) = laimax*(EXP(lai_level_depth*REAL(jl-1,r_std))-1.)/(EXP(lai_level_depth*REAL(nlai,r_std))-1.) 
     1007      laitab(jl) = laimax*(EXP(lai_level_depth*REAL(jl-1,r_std))-1.)/(EXP(lai_level_depth*REAL(nlai,r_std))-un) 
    10071008    ENDDO 
    10081009    ! 
     
    11001101      ! 
    11011102      WHERE ( assimilate(:) ) 
    1102         water_lim(:) = MIN( 2.*humrel(:,jv), 1. ) 
     1103        water_lim(:) = MIN( 2.*humrel(:,jv), un ) 
    11031104      ENDWHERE 
    11041105      ! give a default value of ci for all pixel that do not assimilate 
     
    12551256          DO ji = 1, kjpindex 
    12561257            ! 
    1257             assimi(ji) = 0. 
     1258            assimi(ji) = zero 
    12581259            ! 
    12591260          ENDDO 
     
    12881289          DO ji = 1, kjpindex 
    12891290            ! 
    1290             assimi(ji) = 0. 
     1291            assimi(ji) = zero 
    12911292            ! 
    12921293          ENDDO 
     
    13831384        IF ( jl .EQ. 1 ) THEN 
    13841385          ! 
    1385           leaf_gs_top(:) = 0. 
     1386          leaf_gs_top(:) = zero 
    13861387          ! 
    13871388          IF ( nic .GT. 0 ) then 
     
    14371438              laitab(ilai(iainia)+1) 
    14381439          ! 
    1439           rveget(iainia,jv) = 1./gstop(iainia) 
     1440          rveget(iainia,jv) = un/gstop(iainia) 
    14401441          ! 
    14411442        ENDDO 
     
    14481449          ! 
    14491450          ! Correction Nathalie - le 27 Mars 2006 - Interdire a rstruct d'etre negatif 
    1450           !rstruct(iainia,jv) = 1./gstot(iainia) - & 
     1451          !rstruct(iainia,jv) = un/gstot(iainia) - & 
    14511452          !     rveget(iainia,jv) 
    1452           rstruct(iainia,jv) = MAX( 1./gstot(iainia) - & 
     1453          rstruct(iainia,jv) = MAX( un/gstot(iainia) - & 
    14531454               rveget(iainia,jv), min_sechiba) 
    14541455          ! 
     
    15561557    REAL(r_std)                                    :: coeff_dew_veg 
    15571558 
    1558     vbeta2sum(:) = 0. 
    1559     vbeta3sum(:) = 0. 
     1559    vbeta2sum(:) = zero 
     1560    vbeta3sum(:) = zero 
    15601561    DO jv = 1, nvm 
    15611562      vbeta2sum(:) = vbeta2sum(:) + vbeta2(:,jv) 
     
    15931594 
    15941595    ! for vectorization: some arrays 
    1595     vegetsum(:) = 0. 
     1596    vegetsum(:) = zero 
    15961597    DO jv = 1, nvm 
    15971598      vegetsum(:) = vegetsum(:) + veget(:,jv) 
    15981599    ENDDO 
    1599     vegetsum2(:) = 0. 
     1600    vegetsum2(:) = zero 
    16001601    DO jv = 2, nvm 
    16011602      vegetsum2(:) = vegetsum2(:) + veget(:,jv) 
     
    16671668                         & + dew_veg_poly_coeff(2)*lai(ji,jv) & 
    16681669                         & + dew_veg_poly_coeff(1) 
    1669  
    1670  
    16711670                 ELSE 
    1672                     coeff_dew_veg=1. 
     1671                    coeff_dew_veg=un 
    16731672                 ENDIF 
    16741673              ELSE 
  • branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/enerbil.f90

    r113 r257  
    33!! 
    44!! @author Marie-Alice Foujols and Jan Polcher 
    5 !! @Version : $Revision: 1.24 $, $Date: 2009/01/07 13:39:45 $ 
     5!! @Version : $Revision: 47 $, $Date: 2011-01-01 21:34:45 +0100 (Sat, 01 Jan 2011) $ 
    66!!  
    7 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/enerbil.f90,v 1.24 2009/01/07 13:39:45 ssipsl Exp $ 
     7!< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/enerbil.f90 $ 
     8!< $Date: 2011-01-01 21:34:45 +0100 (Sat, 01 Jan 2011) $ 
     9!< $Author: mmaipsl $ 
     10!< $Revision: 47 $ 
    811!! IPSL (2006) 
    912!!  This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC 
     
    121124    REAL(r_std),DIMENSION (kjpindex), INTENT (inout)   :: evapot           !! Soil Potential Evaporation 
    122125    REAL(r_std),DIMENSION (kjpindex), INTENT (inout)   :: evapot_corr !! Soil Potential Evaporation Correction 
     126    REAL(r_std),DIMENSION (kjpindex), INTENT (inout)   :: temp_sol         !! Soil temperature 
     127    REAL(r_std),DIMENSION (kjpindex), INTENT (inout)   :: qsurf            !! Surface specific humidity 
     128    REAL(r_std),DIMENSION (kjpindex), INTENT (inout)   :: fluxsens         !! Sensible chaleur flux 
     129    REAL(r_std),DIMENSION (kjpindex), INTENT (inout)   :: fluxlat          !! Latent chaleur flux 
     130    REAL(r_std),DIMENSION (kjpindex), INTENT (inout)   :: tsol_rad         !! Tsol_rad 
     131    REAL(r_std),DIMENSION (kjpindex), INTENT (inout)   :: vevapp           !! Total of evaporation 
     132    REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (inout) :: gpp              !! Assimilation, gC/m**2 total area. 
     133    REAL(r_std),DIMENSION (kjpindex), INTENT (inout)   :: temp_sol_new     !! New soil temperature 
    123134    ! output fields 
    124     REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: fluxsens         !! Sensible chaleur flux 
    125     REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: fluxlat          !! Latent chaleur flux 
    126     REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: vevapp           !! Total of evaporation 
    127135    REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: vevapnu          !! Bare soil evaporation 
    128136    REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: vevapsno         !! Snow evaporation 
    129     REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: tsol_rad         !! Tsol_rad 
    130     REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: temp_sol_new     !! New soil temperature 
    131     REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: temp_sol         !! Soil temperature 
    132     REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: qsurf            !! Surface specific humidity 
    133137    REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (out) :: transpir         !! Transpiration 
    134     REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (out) :: gpp              !! Assimilation, gC/m**2 total area. 
    135138    REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (out) :: vevapwet         !! Interception  
    136139    REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: t2mdiag          !! 2-meter temperature 
     
    281284    ! output fields, they need to initialized somehow for the model forcing ORCHIDEE. 
    282285    ! 
    283     REAL(r_std),DIMENSION (kjpindex), INTENT (out)           :: temp_sol           !! Soil temperature 
     286    REAL(r_std),DIMENSION (kjpindex), INTENT (inout)         :: temp_sol           !! Soil temperature 
    284287    REAL(r_std),DIMENSION (kjpindex), INTENT (out)           :: temp_sol_new       !! New soil temperature 
    285288    REAL(r_std),DIMENSION (kjpindex), INTENT (out)           :: qsurf              !! near surface specific humidity 
     
    423426        !Config        the model is started without a restart file.  
    424427        ! 
    425         CALL setvar_p (evapot, val_exp, 'ENERBIL_EVAPOT', 0.0_r_std) 
     428        CALL setvar_p (evapot, val_exp, 'ENERBIL_EVAPOT', zero) 
    426429        IF ( ok_var("evapot_corr") ) THEN 
    427            CALL setvar_p (evapot_corr, val_exp, 'ENERBIL_EVAPOT', 0.0_r_std) 
     430           CALL setvar_p (evapot_corr, val_exp, 'ENERBIL_EVAPOT', zero) 
    428431        ENDIF 
    429432        ! 
     
    778781    REAL(r_std)                                     :: correction 
    779782    REAL(r_std)                                     :: speed, qc 
     783    LOGICAL,DIMENSION (kjpindex)                   :: warning_correction 
    780784    ! initialisation 
    781785 
     
    840844!    grad_qsat(:)= (qsol_sat_new(:)- qsat_air(:)) / ((psnew(:) - epot_air(:)) / cp_air) ! * dtradia 
    841845    !- Penser a sortir evapot en meme temps qu'evapot_corr tdo. 
     846    warning_correction(:)=.FALSE. 
    842847    DO ji=1,kjpindex 
    843848 
     
    852857             correction = chalev0 * rau(ji) * qc * grad_qsat(ji) * (un - vevapp(ji)/evapot(ji)) / correction 
    853858          ELSE 
    854              WRITE(numout,*) "Denominateur de la correction de milly nul! Aucune correction appliquee" 
     859             warning_correction(ji)=.TRUE. 
    855860          ENDIF 
    856861       ELSE 
     
    862867        
    863868    ENDDO 
    864  
     869    IF ( ANY(warning_correction) ) THEN 
     870       DO ji=1,kjpindex 
     871          IF ( warning_correction(ji) ) THEN 
     872             WRITE(numout,*) ji,"Denominateur de la correction de milly nul! Aucune correction appliquee" 
     873          ENDIF 
     874       ENDDO 
     875    ENDIF 
    865876    IF (long_print) WRITE (numout,*) ' enerbil_flux done ' 
    866877 
     
    886897    REAL(r_std),DIMENSION (kjpindex), INTENT (in)            :: evapot           !! Soil Potential Evaporation 
    887898    REAL(r_std),DIMENSION (kjpindex, nvm), INTENT (in)       :: humrel           !! Relative humidity 
    888 !!$ DS 15022011 humrel was used in a previuos version of Orchidee, developped by Nathalie. Need to be discussed if it should be introduces again 
     899!!$ DS 15022011 humrel was used in a previous version of Orchidee, developped by Nathalie. Need to be discussed if it should be introduces again 
    889900    REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (in)        :: vbeta2           !! Interception resistance 
    890901    REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (in)        :: vbeta3           !! Vegetation resistance 
     
    969980    ELSEIF ( control%stomate_watchout ) THEN 
    970981 
    971       gpp(:,:) = 0.0 
     982      gpp(:,:) = zero 
    972983 
    973984    ENDIF 
     
    10011012 
    10021013    ! initialisation 
    1003    IF (long_print) WRITE (numout,*) ' enerbil_fusion start ', MINVAL(soilcap), MINLOC(soilcap),& 
     1014    IF (long_print) WRITE (numout,*) ' enerbil_fusion start ', MINVAL(soilcap), MINLOC(soilcap),& 
    10041015         & MAXVAL(soilcap), MAXLOC(soilcap) 
    10051016    ! 
  • branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/hydrol.f90

    r112 r257  
    33!! 
    44!! @author Marie-Alice Foujols and Jan Polcher 
    5 !! @Version : $Revision: 1.36 $, $Date: 2009/01/07 13:39:45 $ 
     5!! @Version : $Revision: 45 $, $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 
    66!! 
    7 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/hydrol.f90,v 1.36 2009/01/07 13:39:45 ssipsl Exp $ 
     7!< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/hydrol.f90 $ 
     8!< $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 
     9!< $Author: mmaipsl $ 
     10!< $Revision: 45 $ 
    811!! IPSL (2006) 
    912!!  This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC 
     
    224227    !! We consider that any water on the ice is snow and we only peforme a water balance to have consistency. 
    225228    !! The water balance is limite to + or - 10^6 so that accumulation is not endless 
     229    REAL(r_std),DIMENSION (kjpindex), INTENT (inout)     :: runoff           !! Complete runoff 
     230    REAL(r_std),DIMENSION (kjpindex), INTENT (inout)     :: drainage         !! Drainage 
     231    REAL(r_std),DIMENSION (kjpindex,nbdl), INTENT (inout):: shumdiag         !! relative soil moisture 
    226232    ! output fields 
    227     REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: runoff           !! Complete runoff 
    228     REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: drainage         !! Drainage 
    229233    REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (out) :: humrel           !! Relative humidity 
    230234    REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (out) :: vegstress        !! Veg. moisture stress (only for vegetation growth) 
    231235    REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: drysoil_frac     !! function of litter wetness 
    232     REAL(r_std),DIMENSION (kjpindex,nbdl), INTENT (out):: shumdiag         !! relative soil moisture 
    233236    REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: litterhumdiag    !! litter humidity 
    234237    REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: tot_melt         !! Total melt     
     
    10821085       ! 
    10831086       DO jsl=1,nslm 
    1084           CALL setvar_p (us(:,:,:,jsl), val_exp, 'US_INIT', 0.0_r_std) 
     1087          CALL setvar_p (us(:,:,:,jsl), val_exp, 'US_INIT', zero) 
    10851088       ENDDO 
    10861089       ! 
     
    11011104       !Config        started without a restart file. 
    11021105       ! 
    1103        CALL setvar_p (ae_ns, val_exp, 'EVAPNU_SOIL', 0.0_r_std) 
     1106       CALL setvar_p (ae_ns, val_exp, 'EVAPNU_SOIL', zero) 
    11041107       ! 
    11051108       !Config Key  = HYDROL_SNOW 
     
    11101113       !Config        started without a restart file. 
    11111114       ! 
    1112        CALL setvar_p (snow, val_exp, 'HYDROL_SNOW', 0.0_r_std) 
     1115       CALL setvar_p (snow, val_exp, 'HYDROL_SNOW', zero) 
    11131116       ! 
    11141117       !Config Key  = HYDROL_SNOWAGE 
     
    11191122       !Config        started without a restart file. 
    11201123       ! 
    1121        CALL setvar_p (snow_age, val_exp, 'HYDROL_SNOWAGE', 0.0_r_std) 
     1124       CALL setvar_p (snow_age, val_exp, 'HYDROL_SNOWAGE', zero) 
    11221125       ! 
    11231126       !Config Key  = HYDROL_SNOW_NOBIO 
     
    11281131       !Config        started without a restart file. 
    11291132       ! 
    1130        CALL setvar_p (snow_nobio, val_exp, 'HYDROL_SNOW_NOBIO', 0.0_r_std) 
     1133       CALL setvar_p (snow_nobio, val_exp, 'HYDROL_SNOW_NOBIO', zero) 
    11311134       ! 
    11321135       !Config Key  = HYDROL_SNOW_NOBIO_AGE 
     
    11371140       !Config        started without a restart file. 
    11381141       ! 
    1139        CALL setvar_p (snow_nobio_age, val_exp, 'HYDROL_SNOW_NOBIO_AGE', 0.0_r_std) 
     1142       CALL setvar_p (snow_nobio_age, val_exp, 'HYDROL_SNOW_NOBIO_AGE', zero) 
    11401143       ! 
    11411144       ! 
     
    11481151       !Config        the model is started without a restart file.  
    11491152       ! 
    1150        CALL setvar_p (qsintveg, val_exp, 'HYDROL_QSV', 0.0_r_std) 
     1153       CALL setvar_p (qsintveg, val_exp, 'HYDROL_QSV', zero) 
    11511154       ! 
    11521155       ! There is no need to configure the initialisation of resdist. If not available it is the vegetation map 
     
    17171720          IF (snow(ji).GT.sneige) THEN 
    17181721             ! 
    1719              snowmelt(ji) = (1. - frac_nobio(ji,iice))*(temp_sol_new(ji) - tp_00) * soilcap(ji) / chalfu0 
     1722             snowmelt(ji) = (un - frac_nobio(ji,iice))*(temp_sol_new(ji) - tp_00) * soilcap(ji) / chalfu0 
    17201723             ! 
    17211724             ! 1.3.1.1 enough snow for melting or not 
     
    18901893    REAL(r_std), DIMENSION (kjpindex,nvm)          :: zqsintvegnew 
    18911894    LOGICAL, SAVE                                  :: firstcall=.TRUE. 
    1892 !    REAL(r_std), SAVE, DIMENSION(nvm)              :: throughfall_by_pft 
    18931895 
    18941896    IF ( firstcall ) THEN 
     
    20782080    DO jv = 1, nvm 
    20792081      DO ji = 1, kjpindex 
    2080          IF ( ABS(qsintveg(ji,jv)) > 0. .AND. ABS(qsintveg(ji,jv)) < EPS1 ) THEN 
     2082         IF ( ABS(qsintveg(ji,jv)) > zero .AND. ABS(qsintveg(ji,jv)) < EPS1 ) THEN 
    20812083            qsintveg(ji,jv) = EPS1 
    20822084         ENDIF 
  • branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/hydrolc.f90

    r134 r257  
    33!! 
    44!! @author Marie-Alice Foujols and Jan Polcher 
    5 !! @Version : $Revision: 1.21 $, $Date: 2010/05/07 08:28:13 $ 
     5!! @Version : $Revision: 45 $, $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 
    66!!  
    7 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/hydrolc.f90,v 1.21 2010/05/07 08:28:13 ssipsl Exp $ 
     7!< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/hydrolc.f90 $ 
     8!< $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 
     9!< $Author: mmaipsl $ 
     10!< $Revision: 45 $ 
    811!! IPSL (2006) 
    912!!  This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC 
     
    145148    !! We consider that any water on the ice is snow and we only peforme a water balance to have consistency. 
    146149    !! The water balance is limite to + or - 10^6 so that accumulation is not endless 
     150    REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (inout) :: humrel        !! Relative humidity 
     151    REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (inout) :: vegstress     !! Veg. moisture stress (only for vegetation growth) 
     152    REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (inout) :: qsintveg      !! Water on vegetation due to interception 
    147153    ! output fields 
    148     REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: run_off_tot   !! Complete runoff 
    149     REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: drainage      !! Drainage 
    150     REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (out) :: humrel        !! Relative humidity 
    151     REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (out) :: vegstress     !! Veg. moisture stress (only for vegetation growth) 
     154    REAL(r_std),DIMENSION (kjpindex), INTENT (inout)     :: run_off_tot   !! Complete runoff 
     155    REAL(r_std),DIMENSION (kjpindex), INTENT (inout)     :: drainage      !! Drainage 
     156    REAL(r_std),DIMENSION (kjpindex,nbdl), INTENT (inout):: shumdiag      !! relative soil moisture 
     157 
    152158    REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: rsol          !! Resistence to bare soil evaporation 
    153159    REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: drysoil_frac  !! Fraction of visibly dry soil (between 0 and 1) 
    154     REAL(r_std),DIMENSION (kjpindex,nbdl), INTENT (out):: shumdiag      !! relative soil moisture 
    155160    REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: litterhumdiag !! litter humidity 
    156161    REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: tot_melt      !! Total melt     
    157     REAL(r_std),DIMENSION (kjpindex,nvm), INTENT (out) :: qsintveg      !! Water on vegetation due to interception 
    158162 
    159163    ! 
     
    293297       CALL hydrolc_alma(kjpindex, index, .FALSE., qsintveg, snow, snow_nobio, soilwet) 
    294298    ENDIF 
    295  
    296299 
    297300    ! 
     
    313316          DO ji = 1, kjpindex 
    314317             IF ( vegtot(ji) .GT. zero ) THEN 
    315                 histvar(ji)=histvar(ji)+veget(ji,jv)/vegtot(ji)*MAX((0.1-dss(ji,jv))*mx_eau_eau, 0.0) 
     318                histvar(ji)=histvar(ji)+veget(ji,jv)/vegtot(ji)*MAX((0.1-dss(ji,jv))*mx_eau_eau, zero) 
    316319             ENDIF 
    317320          ENDDO 
     
    322325       CALL histwrite(hist_id, 'mrso', kjit, histvar, kjpindex, index) 
    323326 
    324        histvar(:)=run_off_tot(:)/86400. 
     327       histvar(:)=run_off_tot(:)/one_day 
    325328       CALL histwrite(hist_id, 'mrros', kjit, histvar, kjpindex, index) 
    326329 
    327        histvar(:)=(run_off_tot(:)+drainage(:))/86400. 
     330       histvar(:)=(run_off_tot(:)+drainage(:))/one_day 
    328331       CALL histwrite(hist_id, 'mrro', kjit, histvar, kjpindex, index) 
    329332 
    330        histvar(:)=(precip_rain(:)-SUM(precisol(:,:),dim=2))/86400. 
     333       histvar(:)=(precip_rain(:)-SUM(precisol(:,:),dim=2))/one_day 
    331334       CALL histwrite(hist_id, 'prveg', kjit, histvar, kjpindex, index) 
    332335 
     
    369372             DO ji = 1, kjpindex 
    370373                IF ( vegtot(ji) .GT. zero ) THEN 
    371                    histvar(ji)=histvar(ji)+veget(ji,jv)/vegtot(ji)*MAX((0.1-dss(ji,jv))*mx_eau_eau, 0.0) 
     374                   histvar(ji)=histvar(ji)+veget(ji,jv)/vegtot(ji)*MAX((0.1-dss(ji,jv))*mx_eau_eau, zero) 
    372375                ENDIF 
    373376             ENDDO 
     
    375378          CALL histwrite(hist2_id, 'mrsos', kjit, histvar, kjpindex, index) 
    376379 
    377           histvar(:)=(run_off_tot(:)+drainage(:))/86400. 
     380          histvar(:)=(run_off_tot(:)+drainage(:))/one_day 
    378381          CALL histwrite(hist2_id, 'mrro', kjit, histvar, kjpindex, index) 
    379382 
     
    772775        !Config        started without a restart file. 
    773776        ! 
    774         CALL setvar_p (snow, val_exp, 'HYDROL_SNOW', 0.0_r_std) 
     777        CALL setvar_p (snow, val_exp, 'HYDROL_SNOW', zero) 
    775778        ! 
    776779        !Config Key  = HYDROL_SNOWAGE 
     
    781784        !Config        started without a restart file. 
    782785        ! 
    783         CALL setvar_p (snow_age, val_exp, 'HYDROL_SNOWAGE', 0.0_r_std) 
     786        CALL setvar_p (snow_age, val_exp, 'HYDROL_SNOWAGE', zero) 
    784787        ! 
    785788        !Config Key  = HYDROL_SNOW_NOBIO 
     
    790793        !Config        started without a restart file. 
    791794        ! 
    792         CALL setvar_p (snow_nobio, val_exp, 'HYDROL_SNOW_NOBIO', 0.0_r_std) 
     795        CALL setvar_p (snow_nobio, val_exp, 'HYDROL_SNOW_NOBIO', zero) 
    793796        ! 
    794797        !Config Key  = HYDROL_SNOW_NOBIO_AGE 
     
    799802        !Config        started without a restart file. 
    800803        ! 
    801         CALL setvar_p (snow_nobio_age, val_exp, 'HYDROL_SNOW_NOBIO_AGE', 0.0_r_std) 
     804        CALL setvar_p (snow_nobio_age, val_exp, 'HYDROL_SNOW_NOBIO_AGE', zero) 
    802805        ! 
    803806        !Config Key  = HYDROL_HUMR 
     
    808811        !Config        started without a restart file. 
    809812        ! 
    810         CALL setvar_p (humrel, val_exp,'HYDROL_HUMR', 1.0_r_std) 
    811         CALL setvar_p (vegstress, val_exp,'HYDROL_HUMR', 1.0_r_std) 
     813        CALL setvar_p (humrel, val_exp,'HYDROL_HUMR', un) 
     814        CALL setvar_p (vegstress, val_exp,'HYDROL_HUMR', un) 
    812815        ! 
    813816        !Config Key  = HYDROL_BQSB 
     
    827830        !Config        started without a restart file. 
    828831        ! 
    829         CALL setvar_p (gqsb, val_exp, 'HYDROL_GQSB', 0.0_r_std) 
     832        CALL setvar_p (gqsb, val_exp, 'HYDROL_GQSB', zero) 
    830833        ! 
    831834        !Config Key  = HYDROL_DSG 
     
    836839        !Config        started without a restart file. 
    837840        ! 
    838         CALL setvar_p (dsg, val_exp, 'HYDROL_DSG', 0.0_r_std) 
     841        CALL setvar_p (dsg, val_exp, 'HYDROL_DSG', zero) 
    839842 
    840843        ! set inital value for dsp if needed 
     
    872875        !Config        the model is started without a restart file.  
    873876        ! 
    874         CALL setvar_p (qsintveg, val_exp, 'HYDROL_QSV', 0.0_r_std) 
     877        CALL setvar_p (qsintveg, val_exp, 'HYDROL_QSV', zero) 
    875878        ! 
    876879        tmpdss = dsg - gqsb / mx_eau_eau 
     
    889892                    IF (.NOT. (dsg(ji,1).EQ. zero .OR. gqsb(ji,1).EQ.zero)) THEN 
    890893                       ! Ajouts Nathalie - Fred - le 28 Mars 2006 
    891                        a_subgrd(ji)=MIN(MAX(dsg(ji,1)-dss(ji,1),0.)/dsg_min,1.) 
     894                       a_subgrd(ji)=MIN(MAX(dsg(ji,1)-dss(ji,1),zero)/dsg_min,un) 
    892895                       ! 
    893896                    ENDIF 
     
    906909                 IF (.NOT. (dsg(ji,1).EQ. zero .OR. gqsb(ji,1).EQ.zero)) THEN 
    907910                    ! Ajouts Nathalie - Fred - le 28 Mars 2006 
    908                     a_subgrd(ji)=MIN(MAX(dsg(ji,1)-dss(ji,1),0.)/dsg_min,1.) 
     911                    a_subgrd(ji)=MIN(MAX(dsg(ji,1)-dss(ji,1),zero)/dsg_min,un) 
    909912                    ! 
    910913                 ENDIF 
     
    915918           ! Correction Nathalie - le 28 Mars 2006 - re-ecriture drysoil_frac/hdry - Fred Hourdin 
    916919           ! revu 22 novembre 2007 
    917            hdry(:) = a_subgrd(:)*dss(:,1) + (1.-a_subgrd(:))*dsp(:,1) 
     920           hdry(:) = a_subgrd(:)*dss(:,1) + (un-a_subgrd(:))*dsp(:,1) 
    918921        ENDIF 
    919922        ! 
     
    10901093 
    10911094    ! The fraction of soil which is visibly dry (dry when dss = 0.1 m) 
    1092     drysoil_frac(:) = MIN(MAX(dss(:,1),0.)*10._r_std, un) 
     1095    drysoil_frac(:) = MIN(MAX(dss(:,1),zero)*10._r_std, un) 
    10931096    ! 
    10941097    ! Compute the resistance to bare soil evaporation 
     
    11021105          ! du fond. En gros, rsol=hdry*rsol_cste pour hdry < 1m70 
    11031106          !rsol(ji) = dss(ji,1) * rsol_cste 
    1104           !rsol(ji) =  ( drysoil_frac(ji) + 1./(10.*(dpu_cste - drysoil_frac(ji))+1.e-10)**2 ) * rsol_cste 
    1105           rsol(ji) =  ( hdry(ji) + 1./(10.*(dpu_cste - hdry(ji))+1.e-10)**2 ) * rsol_cste 
     1107          !rsol(ji) =  ( drysoil_frac(ji) + un/(10.*(dpu_cste - drysoil_frac(ji))+1.e-10)**2 ) * rsol_cste 
     1108          rsol(ji) =  ( hdry(ji) + un/(10.*(dpu_cste - hdry(ji))+1.e-10)**2 ) * rsol_cste 
    11061109       ENDIF 
    11071110    ENDDO 
     
    11241127!!$            ( mean_dsg(ji) .GT. min_sechiba ) .AND. & 
    11251128!!$            ( mean_dsg(ji) .LT. 5.E-4 ) ) THEN 
    1126 !!$        litterhumdiag(ji) = 0.0 
     1129!!$        litterhumdiag(ji) = zero 
    11271130!!$      ENDIF 
    11281131!!$    ENDDO 
     
    12731276         IF (snow(ji).GT.sneige) THEN  
    12741277            ! 
    1275             snowmelt(ji) = (1. - frac_nobio(ji,iice))*(temp_sol_new(ji) - tp_00) * soilcap(ji) / chalfu0  
     1278            snowmelt(ji) = (un - frac_nobio(ji,iice))*(temp_sol_new(ji) - tp_00) * soilcap(ji) / chalfu0  
    12761279            ! 
    12771280            ! 1.3.1.1 enough snow for melting or not 
     
    14091412                    &  (un - snow_nobio_age(ji,iice)/max_snow_age) * dtradia/one_day ) * & 
    14101413                    &  EXP(-precip_snow(ji) / snow_trans) - snow_nobio_age(ji,iice) 
    1411         IF (d_age(ji) .GT. 0. ) THEN 
     1414        IF (d_age(ji) .GT. zero ) THEN 
    14121415          xx(ji) = MAX( tp_00 - temp_sol_new(ji), zero ) 
    14131416          xx(ji) = ( xx(ji) / 7._r_std ) ** 4._r_std 
     
    14561459    REAL(r_std), DIMENSION (kjpindex,nvm)          :: zqsintvegnew 
    14571460    LOGICAL, SAVE                                  :: firstcall=.TRUE. 
    1458 !    REAL(r_std), SAVE, DIMENSION(nvm)              :: throughfall_by_pft 
    14591461 
    14601462    IF ( firstcall ) THEN 
     
    15781580        ENDIF 
    15791581    ! 
    1580         IF (resdist(ji,jv) .GT. 0.) THEN 
     1582        IF (resdist(ji,jv) .GT. zero) THEN 
    15811583         qsintveg2(ji,jv) = qsintveg(ji,jv)/resdist(ji,jv) 
    15821584        ELSE 
     
    15861588    ENDDO 
    15871589    ! 
    1588     vegchtot(:) = 0. 
     1590    vegchtot(:) = zero 
    15891591    DO jv = 1, nvm 
    15901592      DO ji = 1, kjpindex 
     
    15951597    DO jv = 1, nvm 
    15961598      DO ji = 1, kjpindex 
    1597         IF ( vegchtot(ji) .GT. 0. ) THEN 
     1599        IF ( vegchtot(ji) .GT. zero ) THEN 
    15981600          gdq(ji,jv) = ABS(vmr(ji,jv)) * gqsb(ji,jv) 
    15991601          bdq(ji,jv) = ABS(vmr(ji,jv)) * bqsb(ji,jv) 
     
    16131615    DO jv = 1, nvm 
    16141616      DO ji = 1, kjpindex 
    1615         IF ( ( vegchtot(ji) .GT. 0. ) .AND. ( vmr(ji,jv) .LT. 0. ) ) THEN 
     1617        IF ( ( vegchtot(ji) .GT. zero ) .AND. ( vmr(ji,jv) .LT. zero ) ) THEN 
    16161618          gtr(ji) = gtr(ji) + gdq(ji,jv) 
    16171619          btr(ji) = btr(ji) + bdq(ji,jv) 
     
    16251627    DO jv = 1, nvm 
    16261628      DO ji = 1, kjpindex 
    1627         IF ( vegchtot(ji) .GT. 0. .AND. ABS(vtr(ji)) .GT. EPS1) THEN 
     1629        IF ( vegchtot(ji) .GT. zero .AND. ABS(vtr(ji)) .GT. EPS1) THEN 
    16281630            fra(ji) = vmr(ji,jv) / vtr(ji) 
    1629              IF ( vmr(ji,jv) .GT. 0.)  THEN 
    1630               IF (veget(ji,jv) .GT. 0.) THEN 
     1631             IF ( vmr(ji,jv) .GT. zero)  THEN 
     1632              IF (veget(ji,jv) .GT. zero) THEN 
    16311633               gqsb(ji,jv) = (resdist(ji,jv)*gqsb(ji,jv) + fra(ji)*gtr(ji))/veget(ji,jv) 
    16321634               bqsb(ji,jv) = (resdist(ji,jv)*bqsb(ji,jv) + fra(ji)*btr(ji))/veget(ji,jv) 
     
    20032005    IF (long_print) WRITE(numout,*)  'hydrolc_soil 3.0 : Vertical diffusion' 
    20042006 
    2005     mean_bqsb(:) = 0. 
    2006     mean_gqsb(:) = 0. 
     2007    mean_bqsb(:) = zero 
     2008    mean_gqsb(:) = zero 
    20072009    DO jv = 1, nvm 
    20082010      DO ji = 1, kjpindex 
     
    20302032        DO ji = 1, kjpindex 
    20312033           IF (lbad_ij(ji)) THEN 
    2032               IF ( veget(ji,jv) .GT. 0. ) THEN 
     2034              IF ( veget(ji,jv) .GT. zero ) THEN 
    20332035                 ! 
    20342036                 bqsb(ji,jv) = mean_bqsb(ji) 
     
    20562058!        ! 
    20572059!        DO ji = 1, kjpindex 
    2058 !          IF ( veget(ji,jv) .GT. 0. ) THEN 
     2060!          IF ( veget(ji,jv) .GT. zero ) THEN 
    20592061!            ! 
    20602062!            bqsb(ji,jv) = mean_bqsb(ji) 
     
    20822084      ENDDO 
    20832085      ! 
    2084       mean_bqsb(:) = 0. 
    2085       mean_gqsb(:) = 0. 
     2086      mean_bqsb(:) = zero 
     2087      mean_gqsb(:) = zero 
    20862088      DO jv = 1, nvm 
    20872089        DO ji = 1, kjpindex 
     
    21802182               zhumrel_up(ji) = EXP( - humcste(jv) * dss(ji,jv)) 
    21812183               ! Ajouts Nathalie - Fred - le 28 Mars 2006 
    2182                a_subgrd(ji,jv)=MIN(MAX(dsg(ji,jv)-dss(ji,jv),0.)/dsg_min,1.) 
    2183                humrel(ji,jv)=a_subgrd(ji,jv)*zhumrel_up(ji)+(1.-a_subgrd(ji,jv))*zhumrel_lo(ji) 
     2184               a_subgrd(ji,jv)=MIN(MAX(dsg(ji,jv)-dss(ji,jv),zero)/dsg_min,un) 
     2185               humrel(ji,jv)=a_subgrd(ji,jv)*zhumrel_up(ji)+(un-a_subgrd(ji,jv))*zhumrel_lo(ji) 
    21842186               ! 
    21852187               vegstress(ji,jv) = zhumrel_lo(ji) + zhumrel_up(ji) - EXP( - humcste(jv) * dsg(ji,jv) )  
     
    22212223 
    22222224    ! The fraction of visibly dry soil (dry when dss(:,1) = 0.1 m) 
    2223     drysoil_frac(:) = MIN(MAX(dss(:,1),0.)*10._r_std, un) 
     2225    drysoil_frac(:) = MIN(MAX(dss(:,1),zero)*10._r_std, un) 
    22242226 
    22252227    ! Correction Nathalie - le 28 Mars 2006 - re-ecriture drysoil_frac/hdry - Fred Hourdin 
    22262228    ! revu 22 novembre 2007 
    2227     hdry(:) = a_subgrd(:,1)*dss(:,1) + (1.-a_subgrd(:,1))*dsp(:,1) 
     2229    hdry(:) = a_subgrd(:,1)*dss(:,1) + (un-a_subgrd(:,1))*dsp(:,1) 
    22282230    ! 
    22292231    ! Compute the resistance to bare soil evaporation. 
     
    22372239          ! du fond. En gros, rsol=hdry*rsol_cste pour hdry < 1m70 
    22382240          !rsol(ji) = dss(ji,1) * rsol_cste 
    2239           rsol(ji) =  ( hdry(ji) + 1./(10.*(dpu_cste - hdry(ji))+1.e-10)**2 ) * rsol_cste 
     2241          rsol(ji) =  ( hdry(ji) + un/(10.*(dpu_cste - hdry(ji))+1.e-10)**2 ) * rsol_cste 
    22402242       ENDIF 
    22412243    ENDDO 
     
    23892391       IF ( ABS(delta_water(ji)-tot_flux(ji)) .GT. allowed_err ) THEN 
    23902392          WRITE(numout,*) 'HYDROL does not conserve water. The erroneous point is : ', ji 
    2391           WRITE(numout,*) 'The error in mm/d is :', (delta_water(ji)-tot_flux(ji))/dtradia, & 
     2393          WRITE(numout,*) 'The error in mm/d is :', (delta_water(ji)-tot_flux(ji))/dtradia*one_day, & 
    23922394               & ' and in mm/dt : ', delta_water(ji)-tot_flux(ji) 
    23932395          WRITE(numout,*) 'delta_water : ', delta_water(ji), ' tot_flux : ', tot_flux(ji) 
     
    25202522      !Config  Key  = HYDROL_TAU_HDIFF 
    25212523      !Config  Desc = time scale (s) for horizontal diffusion of water 
    2522       !Config  Def  = 86400. 
     2524      !Config  Def  = one_day 
    25232525      !Config  If   = HYDROL_OK_HDIFF 
    25242526      !Config  Help = Defines how fast diffusion occurs horizontally between 
     
    25262528      !Config         diffusion. 
    25272529 
    2528       tau_hdiff = 86400. 
     2530      tau_hdiff = one_day 
    25292531      CALL getin_p('HYDROL_TAU_HDIFF',tau_hdiff) 
    25302532 
  • branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/intersurf.f90

    r116 r257  
    77!! 
    88!! @call sechiba_main 
    9 !! @Version : $Revision: 1.85 $, $Date: 2010/07/29 15:58:19 $ 
     9!! @Version : $Revision: 221 $, $Date: 2011-05-16 17:26:17 +0200 (Mon, 16 May 2011) $ 
    1010!! 
    1111!! @author Marie-Alice Foujols and Jan Polcher 
    1212!!  
    13 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/intersurf.f90,v 1.85 2010/07/29 15:58:19 ssipsl Exp $ 
     13!< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/intersurf.f90 $ 
     14!< $Date: 2011-05-16 17:26:17 +0200 (Mon, 16 May 2011) $ 
     15!< $Author: martial.mancip $ 
     16!< $Revision: 221 $ 
    1417!! IPSL (2006) 
    1518!!  This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC 
     
    181184    ! 
    182185    CALL ipslnlf(new_number=numout,old_number=old_fileout) 
    183  
    184186    ! 
    185187    IF (l_first_intersurf) THEN 
     
    225227       IF ( ok_watchout ) THEN 
    226228          IF (is_root_prc) THEN 
    227              zlev_mean = 0. 
     229             zlev_mean = zero 
    228230             DO ik=1, nbp_glo 
    229231                j = ((index_g(ik)-1)/iim_g) + 1 
     
    391393!!$               dt_split_watch,dt_watch,one_day 
    392394!!$          CALL solarang (julian_watch, julian0, iim, jjm, lon, lat, sinang) 
    393 !!$          WHERE ( sinang(:,:) .LT. EPSILON(1.) )  
     395!!$          WHERE ( sinang(:,:) .LT. EPSILON(un) )  
    394396!!$             isinang(:,:) = isinang(:,:) - 1 
    395397!!$          ENDWHERE 
     
    529531          CALL histwrite (hist_id, 'riverflow',itau_sechiba, driver, kjpindex, kindex) 
    530532       !  
    531           CALL histwrite (hist_id, 'temp_sol', itau_sechiba, temp_sol_NEW, iim*jjm, kindex) 
    532           CALL histwrite (hist_id, 'tsol_max', itau_sechiba, temp_sol_NEW, iim*jjm, kindex) 
    533           CALL histwrite (hist_id, 'tsol_min', itau_sechiba, temp_sol_NEW, iim*jjm, kindex) 
    534           CALL histwrite (hist_id, 'fluxsens', itau_sechiba, fluxsens, iim*jjm, kindex) 
    535           CALL histwrite (hist_id, 'fluxlat',  itau_sechiba, fluxlat, iim*jjm, kindex) 
    536           CALL histwrite (hist_id, 'swnet',    itau_sechiba, dswnet, iim*jjm, kindex) 
    537           CALL histwrite (hist_id, 'swdown',   itau_sechiba, dswdown, iim*jjm, kindex) 
    538           CALL histwrite (hist_id, 'alb_vis',  itau_sechiba, albedo(:,:,1), iim*jjm, kindex) 
    539           CALL histwrite (hist_id, 'alb_nir',  itau_sechiba, albedo(:,:,2), iim*jjm, kindex) 
    540           CALL histwrite (hist_id, 'tair',     itau_sechiba, temp_air, iim*jjm, kindex) 
    541           CALL histwrite (hist_id, 'qair',     itau_sechiba, qair, iim*jjm, kindex) 
     533          CALL histwrite (hist_id, 'temp_sol', itau_sechiba, temp_sol_NEW, kjpindex, kindex) 
     534          CALL histwrite (hist_id, 'tsol_max', itau_sechiba, temp_sol_NEW, kjpindex, kindex) 
     535          CALL histwrite (hist_id, 'tsol_min', itau_sechiba, temp_sol_NEW, kjpindex, kindex) 
     536          CALL histwrite (hist_id, 'fluxsens', itau_sechiba, fluxsens, kjpindex, kindex) 
     537          CALL histwrite (hist_id, 'fluxlat',  itau_sechiba, fluxlat, kjpindex, kindex) 
     538          CALL histwrite (hist_id, 'swnet',    itau_sechiba, dswnet, kjpindex, kindex) 
     539          CALL histwrite (hist_id, 'swdown',   itau_sechiba, dswdown, kjpindex, kindex) 
     540          CALL histwrite (hist_id, 'alb_vis',  itau_sechiba, albedo(:,:,1), kjpindex, kindex) 
     541          CALL histwrite (hist_id, 'alb_nir',  itau_sechiba, albedo(:,:,2), kjpindex, kindex) 
     542          CALL histwrite (hist_id, 'tair',     itau_sechiba, temp_air, kjpindex, kindex) 
     543          CALL histwrite (hist_id, 'qair',     itau_sechiba, qair, kjpindex, kindex) 
    542544          ! Ajout Nathalie - Juin 2006 - on conserve q2m/t2m 
    543           CALL histwrite (hist_id, 'q2m',     itau_sechiba, qair, iim*jjm, kindex) 
    544           CALL histwrite (hist_id, 't2m',     itau_sechiba, temp_air, iim*jjm, kindex) 
     545          CALL histwrite (hist_id, 'q2m',     itau_sechiba, qair, kjpindex, kindex) 
     546          CALL histwrite (hist_id, 't2m',     itau_sechiba, temp_air, kjpindex, kindex) 
    545547          IF ( hist2_id > 0 ) THEN 
    546548             CALL histwrite (hist2_id, 'evap',     itau_sechiba, zvevapp, kjpindex, kindex) 
     
    548550             CALL histwrite (hist2_id, 'riverflow',itau_sechiba, driver, kjpindex, kindex) 
    549551             !  
    550              CALL histwrite (hist2_id, 'temp_sol', itau_sechiba, temp_sol_NEW, iim*jjm, kindex) 
    551              CALL histwrite (hist2_id, 'tsol_max', itau_sechiba, temp_sol_NEW, iim*jjm, kindex) 
    552              CALL histwrite (hist2_id, 'tsol_min', itau_sechiba, temp_sol_NEW, iim*jjm, kindex) 
    553              CALL histwrite (hist2_id, 'fluxsens', itau_sechiba, fluxsens, iim*jjm, kindex) 
    554              CALL histwrite (hist2_id, 'fluxlat',  itau_sechiba, fluxlat, iim*jjm, kindex) 
    555              CALL histwrite (hist2_id, 'swnet',    itau_sechiba, dswnet, iim*jjm, kindex) 
    556              CALL histwrite (hist2_id, 'swdown',   itau_sechiba, dswdown, iim*jjm, kindex) 
    557              CALL histwrite (hist2_id, 'alb_vis',  itau_sechiba, albedo(:,:,1), iim*jjm, kindex) 
    558              CALL histwrite (hist2_id, 'alb_nir',  itau_sechiba, albedo(:,:,2), iim*jjm, kindex) 
    559              CALL histwrite (hist2_id, 'tair',     itau_sechiba, temp_air, iim*jjm, kindex) 
    560              CALL histwrite (hist2_id, 'qair',     itau_sechiba, qair, iim*jjm, kindex) 
    561              CALL histwrite (hist2_id, 'q2m',     itau_sechiba, qair, iim*jjm, kindex) 
    562              CALL histwrite (hist2_id, 't2m',     itau_sechiba, temp_air, iim*jjm, kindex) 
     552             CALL histwrite (hist2_id, 'temp_sol', itau_sechiba, temp_sol_NEW, kjpindex, kindex) 
     553             CALL histwrite (hist2_id, 'tsol_max', itau_sechiba, temp_sol_NEW, kjpindex, kindex) 
     554             CALL histwrite (hist2_id, 'tsol_min', itau_sechiba, temp_sol_NEW, kjpindex, kindex) 
     555             CALL histwrite (hist2_id, 'fluxsens', itau_sechiba, fluxsens, kjpindex, kindex) 
     556             CALL histwrite (hist2_id, 'fluxlat',  itau_sechiba, fluxlat, kjpindex, kindex) 
     557             CALL histwrite (hist2_id, 'swnet',    itau_sechiba, dswnet, kjpindex, kindex) 
     558             CALL histwrite (hist2_id, 'swdown',   itau_sechiba, dswdown, kjpindex, kindex) 
     559             CALL histwrite (hist2_id, 'alb_vis',  itau_sechiba, albedo(:,:,1), kjpindex, kindex) 
     560             CALL histwrite (hist2_id, 'alb_nir',  itau_sechiba, albedo(:,:,2), kjpindex, kindex) 
     561             CALL histwrite (hist2_id, 'tair',     itau_sechiba, temp_air, kjpindex, kindex) 
     562             CALL histwrite (hist2_id, 'qair',     itau_sechiba, qair, kjpindex, kindex) 
     563             CALL histwrite (hist2_id, 'q2m',     itau_sechiba, qair, kjpindex, kindex) 
     564             CALL histwrite (hist2_id, 't2m',     itau_sechiba, temp_air, kjpindex, kindex) 
    563565          ENDIF 
    564566       ELSE 
    565567          CALL histwrite (hist_id, 'Evap', itau_sechiba, zvevapp, kjpindex, kindex) 
    566           CALL histwrite (hist_id, 'SWnet',    itau_sechiba, dswnet, iim*jjm, kindex) 
    567           CALL histwrite (hist_id, 'Qh', itau_sechiba, fluxsens, iim*jjm, kindex) 
    568           CALL histwrite (hist_id, 'Qle',  itau_sechiba, fluxlat, iim*jjm, kindex) 
    569           CALL histwrite (hist_id, 'AvgSurfT', itau_sechiba, temp_sol_NEW, iim*jjm, kindex) 
    570           CALL histwrite (hist_id, 'RadT', itau_sechiba, temp_sol_NEW, iim*jjm, kindex) 
     568          CALL histwrite (hist_id, 'SWnet',    itau_sechiba, dswnet, kjpindex, kindex) 
     569          CALL histwrite (hist_id, 'Qh', itau_sechiba, fluxsens, kjpindex, kindex) 
     570          CALL histwrite (hist_id, 'Qle',  itau_sechiba, fluxlat, kjpindex, kindex) 
     571          CALL histwrite (hist_id, 'AvgSurfT', itau_sechiba, temp_sol_NEW, kjpindex, kindex) 
     572          CALL histwrite (hist_id, 'RadT', itau_sechiba, temp_sol_NEW, kjpindex, kindex) 
    571573          IF ( hist2_id > 0 ) THEN 
    572574             CALL histwrite (hist2_id, 'Evap', itau_sechiba, zvevapp, kjpindex, kindex) 
    573              CALL histwrite (hist2_id, 'SWnet',    itau_sechiba, dswnet, iim*jjm, kindex) 
    574              CALL histwrite (hist2_id, 'Qh', itau_sechiba, fluxsens, iim*jjm, kindex) 
    575              CALL histwrite (hist2_id, 'Qle',  itau_sechiba, fluxlat, iim*jjm, kindex) 
    576              CALL histwrite (hist2_id, 'AvgSurfT', itau_sechiba, temp_sol_NEW, iim*jjm, kindex) 
    577              CALL histwrite (hist2_id, 'RadT', itau_sechiba, temp_sol_NEW, iim*jjm, kindex) 
     575             CALL histwrite (hist2_id, 'SWnet',    itau_sechiba, dswnet, kjpindex, kindex) 
     576             CALL histwrite (hist2_id, 'Qh', itau_sechiba, fluxsens, kjpindex, kindex) 
     577             CALL histwrite (hist2_id, 'Qle',  itau_sechiba, fluxlat, kjpindex, kindex) 
     578             CALL histwrite (hist2_id, 'AvgSurfT', itau_sechiba, temp_sol_NEW, kjpindex, kindex) 
     579             CALL histwrite (hist2_id, 'RadT', itau_sechiba, temp_sol_NEW, kjpindex, kindex) 
    578580          ENDIF 
    579581       ENDIF 
     
    780782       ! 
    781783       IF ( ok_watchout ) THEN 
    782           zlev_mean = 0. 
     784          zlev_mean = zero 
    783785          DO ik=1, kjpindex 
    784786 
     
    905907!!$          julian_watch = date0_shifted+((itau_sechiba-0.5)/dt_split_watch)*dt_watch/one_day 
    906908!!$          CALL solarang (julian_watch, julian0, iim, jjm, lon, lat, sinang) 
    907 !!$          WHERE ( sinang(:,:) .LT. EPSILON(1.) )  
     909!!$          WHERE ( sinang(:,:) .LT. EPSILON(un) )  
    908910!!$             isinang(:,:) = isinang(:,:) - 1 
    909911!!$          ENDWHERE 
     
    14481450       IF ( ok_watchout ) THEN 
    14491451          IF (is_root_prc) THEN 
    1450              zlev_mean = 0. 
     1452             zlev_mean = zero 
    14511453             DO ik=1, nbp_glo 
    14521454                j = ((index_g(ik)-1)/iim_g) + 1 
     
    16021604!!$          julian_watch = date0_shifted+((itau_sechiba-0.5)/dt_split_watch)*dt_watch/one_day 
    16031605!!$          CALL solarang (julian_watch, julian0, iim, jjm, tmp_lon, tmp_lat, sinang) 
    1604 !!$          WHERE ( sinang(:,:) .LT. EPSILON(1.) )  
     1606!!$          WHERE ( sinang(:,:) .LT. EPSILON(un) )  
    16051607!!$             isinang(:,:) = isinang(:,:) - 1 
    16061608!!$          ENDWHERE 
     
    21782180       IF ( ok_watchout ) THEN 
    21792181          IF (is_root_prc) THEN 
    2180              zlev_mean = 0. 
     2182             zlev_mean = zero 
    21812183             DO ik=1, nbp_glo 
    21822184                j = ((index_g(ik)-1)/iim_g) + 1 
     
    23322334!!$          julian_watch = date0_shifted+((itau_sechiba-0.5)/dt_split_watch)*dt_watch/one_day 
    23332335!!$          CALL solarang (julian_watch, julian0, iim, jjm, tmp_lon, tmp_lat, sinang) 
    2334 !!$          WHERE ( sinang(:,:) .LT. EPSILON(1.) ) 
     2336!!$          WHERE ( sinang(:,:) .LT. EPSILON(un) ) 
    23352337!!$             isinang(:,:) = isinang(:,:) - 1 
    23362338!!$          ENDWHERE 
     
    25862588       CALL tlen2itau('1Y',dt,date0,year_length) 
    25872589       IF ( TRIM(calendar_str) .EQ. 'gregorian' ) THEN   
    2588           year_spread=1.0 
     2590          year_spread=un 
    25892591       ELSE 
    25902592          year_spread = one_year/365.2425 
     
    26102612       ! Real date 
    26112613       CALL ju2ymds (in_julian, year, month, day, sec) 
    2612 !!$       jur=0. 
     2614!!$       jur=zero 
    26132615!!$       julian_diff = in_julian 
    26142616!!$       month_len = ioget_mon_len (year,month) 
     
    26302632       ENDIF 
    26312633    ELSE  
    2632 !!$       in_julian = itau2date(istp-1, 0., dt) 
     2634!!$       in_julian = itau2date(istp-1, zero, dt) 
    26332635!!$       CALL ju2ymds (in_julian, year, month, day, sec) 
    2634 !!$       jur=0. 
     2636!!$       jur=zero 
    26352637!!$       julian_diff = in_julian 
    26362638!!$       month_len = ioget_mon_len (year,month) 
     
    26932695    CALL getin_p('NVM',nvm) 
    26942696    WRITE(numout,*)'the number of pfts is : ', nvm 
    2695 !!$DS Debug 28/01/2011 
    26962697    ! 
    26972698    !Config Key  = LONGPRINT 
     
    27232724       ! 
    27242725       dt_watch = dt 
    2725        CALL getin('DT_WATCHOUT',dt_watch) 
     2726       CALL getin_p('DT_WATCHOUT',dt_watch) 
    27262727       dt_split_watch = dt_watch / dt 
    27272728       ! 
     
    27402741    ENDIF 
    27412742 
    2742  
    27432743!!$    DS : reading of IMPOSE_PARAM 
    27442744    ! Option : do you want to change the values of the parameters 
    27452745    CALL getin_p('IMPOSE_PARAM',impose_param) 
    2746     ! Calling pft_parameters 
    27472746    CALL pft_parameters_main   
    27482747    ! 
     
    27842783    IF ( control_flags%hydrol_cwrr ) THEN 
    27852784       CALL getin_hydrol_cwrr_parameters 
     2785    ELSE 
     2786       CALL getin_hydrolc_parameters 
     2787       ! we read the parameters for the choisnel hydrology 
    27862788    ENDIF 
    27872789 
     
    28002802       CALL getin_co2_parameters 
    28012803    ENDIF 
    2802  
    2803  
    2804  
    2805 !!$    DS : reading of IMPOSE_PARAM 
    2806 !!$    ! Option : do you want to change the values of the parameters 
    2807 !!$    CALL getin_p('IMPOS_PARAM',impos_param) 
    2808 !!$    ! Calling pft_parameters 
    2809 !!$    CALL pft_main   
    28102804 
    28112805    ! 
     
    28442838       WRITE(numout,*) 'It is not possible because it has to be modified ', & 
    28452839            ' to give correct values.' 
    2846        CALL ipslerr (3,'intsurf_config', & 
    2847          &          'Use of STOMATE_OK_DGVM not allowed with this version.',& 
    2848          &          'ORCHIDEE will stop.', & 
     2840       CALL ipslerr (2,'intsurf_config', & 
     2841         &          'Use of STOMATE_OK_DGVM is not stable for this version.',& 
     2842         &          'ORCHIDEE should not give correct results with this option activated.', & 
    28492843         &          'Please disable DGVM to use this version of ORCHIDEE.') 
    28502844    ENDIF 
     
    29652959    CALL getin_p('SECHIBA_reset_time', overwrite_time) 
    29662960    ! 
    2967     lev(:) = 0. 
     2961    lev(:) = zero 
    29682962    itau_dep = istp 
    29692963    in_julian = itau2date(istp, date0, dt) 
     
    31863180    !Config  Key  = WRITE_STEP 
    31873181    !Config  Desc = Frequency in seconds at which to WRITE output 
    3188     !Config  Def  = 86400.0 
     3182    !Config  Def  = one_day 
    31893183    !Config  Help = This variables gives the frequency the output of 
    31903184    !Config         the model should be written into the netCDF file. 
     
    31983192    ! 
    31993193    veg(1:nvm)   = (/ (REAL(i,r_std),i=1,nvm) /) 
    3200 !$$ DS DEBUG 
    3201     WRITE(numout,*)'nvm : = ', nvm 
    3202     WRITE(numout,*)'veg : =', veg 
    3203 !$$ nvm =13 (put the calling to getin before) 
    32043194    sol(1:ngrnd) = (/ (REAL(i,r_std),i=1,ngrnd) /)    
    32053195    soltyp(1:nstm) = (/ (REAL(i,r_std),i=1,nstm) /) 
     
    32163206    WRITE(flux_sc,'("ave(X*",F8.1,")")') one_day/dt 
    32173207    !WRITE(flux_sc,'("(ave(X)*",F8.1,")")') one_day/dt 
    3218     WRITE(flux_insec,'("ave(X*",F8.6,")")') 1.0/dt 
    3219     WRITE(flux_scinsec,'("ave(scatter(X*",F8.6,"))")') 1.0/dt 
     3208    WRITE(flux_insec,'("ave(X*",F8.6,")")') un/dt 
     3209    WRITE(flux_scinsec,'("ave(scatter(X*",F8.6,"))")') un/dt 
    32203210    WRITE(numout,*) flux_op, one_day/dt, dt, dw 
    32213211    !- 
     
    33713361               & iim,jjm, hori_id, 1,1,1, -99, 32, once(1), dt,dw)   
    33723362       ENDIF 
    3373        IF ( control_flags%ok_stomate .OR. control_flags%stomate_watchout ) THEN 
    3374           CALL histdef (hist_id,'CO2FLUX','Total output CO2 flux', 'gC/day/(m^2 tot)', & 
    3375                & iim,jjm, hori_id, nvm, 1, nvm, vegax_id, 32, avescatter(1), dt, dw) 
    3376        ENDIF 
    33773363       !- 
    33783364       !- SECHIBA_HISTLEVEL = 2 
     
    36923678       CALL histdef(hist_id, 'nobiofrac', 'Fraction of other surface types', '1', & 
    36933679            & iim,jjm, hori_id, nnobio, 1, nnobio, nobioax_id, 32, avescatter(3), dt,dw) 
    3694        IF ( control_flags%ok_stomate .OR. control_flags%stomate_watchout ) THEN 
    3695           ! Total output CO2 flux                              
    3696           CALL histdef (hist_id,'CO2FLUX','Total output CO2 flux', 'gC/day/(m^2 tot)', & 
    3697                & iim,jjm, hori_id, nvm, 1, nvm, vegax_id, 32, avescatter(1), dt, dw) 
    3698        ENDIF 
    36993680     !-  
    37003681     !-  General energy balance 
     
    40334014          CALL histdef(hist2_id, 'emis', 'Surface emissivity', '?', & 
    40344015               & iim,jjm, hori_id2, 1,1,1, -99, 32, fluxop2(2), dt, dw2) 
    4035           IF ( control_flags%ok_stomate .OR. control_flags%stomate_watchout ) THEN 
    4036              CALL histdef (hist2_id,'CO2FLUX','Total output CO2 flux', 'gC/day/(m^2 tot)', & 
    4037                   & iim,jjm, hori_id2, nvm, 1, nvm, vegax_id2, 32, avescatter2(2), dt, dw2) 
    4038           ENDIF 
    40394016          !- 
    40404017          !- SECHIBA_HISTLEVEL2 = 3 
     
    42984275          CALL histdef(hist2_id, 'nobiofrac', 'Fraction of other surface types', '1', & 
    42994276               & iim,jjm, hori_id2, nnobio, 1, nnobio, nobioax_id2, 32, avescatter2(3), dt, dw2) 
    4300           IF ( control_flags%ok_stomate .OR. control_flags%stomate_watchout ) THEN 
    4301              CALL histdef (hist2_id,'CO2FLUX','Total output CO2 flux', 'gC/day/(m^2 tot)', & 
    4302                   & iim,jjm, hori_id2, nvm, 1, nvm, vegax_id2, 32, avescatter2(1), dt, dw2) 
    4303           ENDIF 
    43044277          !-  
    43054278          !-  General energy balance 
     
    44654438       hist_days_stom = 10. 
    44664439       CALL getin_p('STOMATE_HIST_DT', hist_days_stom)        
    4467        IF ( hist_days_stom == -1. ) THEN 
    4468           hist_dt_stom = -1. 
     4440       IF ( hist_days_stom == moins_un ) THEN 
     4441          hist_dt_stom = moins_un 
    44694442          WRITE(numout,*) 'output frequency for STOMATE history file (d): one month.' 
    44704443       ELSE 
     
    44774450       dt_slow_ = one_day 
    44784451       CALL getin_p('DT_SLOW', dt_slow_) 
    4479        IF ( hist_days_stom /= -1. ) THEN 
     4452       IF ( hist_days_stom /= moins_un ) THEN 
    44804453          IF (dt_slow_ > hist_dt_stom) THEN 
    44814454             WRITE(numout,*) "DT_SLOW = ",dt_slow_,"  , STOMATE_HIST_DT = ",hist_dt_stom 
     
    45674540       !Config  Help = Time step of the STOMATE IPCC history file 
    45684541       !- 
    4569        hist_days_stom_ipcc = 0. 
     4542       hist_days_stom_ipcc = zero 
    45704543       CALL getin_p('STOMATE_IPCC_HIST_DT', hist_days_stom_ipcc)        
    4571        IF ( hist_days_stom_ipcc == -1. ) THEN 
    4572           hist_dt_stom_ipcc = -1. 
     4544       IF ( hist_days_stom_ipcc == moins_un ) THEN 
     4545          hist_dt_stom_ipcc = moins_un 
    45734546          WRITE(numout,*) 'output frequency for STOMATE IPCC history file (d): one month.' 
    45744547       ELSE 
     
    45814554       dt_slow_ = one_day 
    45824555       CALL getin_p('DT_SLOW', dt_slow_) 
    4583        IF ( hist_days_stom_ipcc > 0. ) THEN 
     4556       IF ( hist_days_stom_ipcc > zero ) THEN 
    45844557          IF (dt_slow_ > hist_dt_stom_ipcc) THEN 
    45854558             WRITE(numout,*) "DT_SLOW = ",dt_slow_,"  , STOMATE_IPCC_HIST_DT = ",hist_dt_stom_ipcc 
     
    48224795         &               1,1,1, -99,32, ave(5), dt, hist_dt) 
    48234796 
    4824     ! Monthly CO2 flux                                   
    4825     CALL histdef (hist_id_stom, & 
    4826          &               TRIM("CO2FLUX_MONTHLY     "), & 
    4827          &               TRIM("Monthly CO2 flux                                  "), & 
     4797    ! CO2 flux                                   
     4798    CALL histdef (hist_id_stom, & 
     4799         &               TRIM("CO2FLUX             "), & 
     4800         &               TRIM("CO2 flux                                          "), & 
    48284801         &               TRIM("gC/m^2/pft/mth      "), iim,jjm, hist_hori_id, & 
    48294802         &               nvm,1,nvm, hist_PFTaxis_id,32, ave(1), dt, hist_dt) 
    48304803 
    4831     CALL histdef(hist_id_stom, & 
    4832          &               TRIM("CO2FLUX_MONTHLY_SUM "), & 
    4833          &               TRIM("Monthly CO2 flux                                  "), & 
    4834          &               TRIM("PgC/m^2/mth          "), 1,1, hist_hori_id, & 
    4835          &               1,1,1, -99, 32, ave(1), dt, hist_dt) 
     4804!!$    CALL histdef(hist_id_stom, & 
     4805!!$         &               TRIM("CO2FLUX_MONTHLY_SUM "), & 
     4806!!$         &               TRIM("Monthly CO2 flux Sum                              "), & 
     4807!!$         &               TRIM("PgC/m^2/mth         "), iim,jjm, hist_hori_id, & 
     4808!!$         &               1,1,1, -99, 32, 'inst(scatter(X))', dt, hist_dt) 
    48364809 
    48374810    ! Output CO2 flux from fire                          
     
    51215094         &               TRIM("1/day               "), iim,jjm, hist_hori_id, & 
    51225095         &               nvm,1,nvm, hist_PFTaxis_id,32, ave(6), dt, hist_dt) 
     5096 
     5097    ! Establish tree 
     5098    CALL histdef (hist_id_stom, & 
     5099         &               TRIM("ESTABTREE           "), & 
     5100         &               TRIM("Rate of tree establishement                       "), & 
     5101         &               TRIM("1/day               "), iim,jjm, hist_hori_id, & 
     5102         &               1,1,1, -99,32, ave(6), dt, hist_dt) 
     5103 
     5104    ! Establish grass 
     5105    CALL histdef (hist_id_stom, & 
     5106         &               TRIM("ESTABGRASS          "), & 
     5107         &               TRIM("Rate of grass establishement                      "), & 
     5108         &               TRIM("1/day               "), iim,jjm, hist_hori_id, & 
     5109         &               1,1,1, -99,32, ave(6), dt, hist_dt) 
    51235110 
    51245111    ! Fraction of plants that dies (light competition)   
  • branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/sechiba.f90

    r142 r257  
    44!! 
    55!! @author Marie-Alice Foujols and Jan Polcher 
    6 !! @Version : $Revision: 1.46 $, $Date: 2010/05/07 08:28:13 $ 
     6!! @Version : $Revision: 45 $, $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 
    77!!  
    8 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/sechiba.f90,v 1.46 2010/05/07 08:28:13 ssipsl Exp $ 
     8!< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/sechiba.f90 $ 
     9!< $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 
     10!< $Author: mmaipsl $ 
     11!< $Revision: 45 $ 
    912!! IPSL (2006) 
    1013!!  This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC 
     
    239242    REAL(r_std),DIMENSION (kjpindex), INTENT (out)           :: tsol_rad         !! Radiative surface temperature 
    240243    REAL(r_std),DIMENSION (kjpindex), INTENT (out)           :: vevapp           !! Total of evaporation 
    241     REAL(r_std),DIMENSION (kjpindex), INTENT (out)           :: temp_sol_new     !! New soil temperature 
     244    REAL(r_std),DIMENSION (kjpindex), INTENT (inout)           :: temp_sol_new     !! New soil temperature 
    242245    REAL(r_std),DIMENSION (kjpindex), INTENT (out)           :: qsurf_out        !! Surface specific humidity 
    243246    REAL(r_std),DIMENSION (kjpindex), INTENT (out)           :: z0_out           !! Surface roughness (output diagnostic) 
     
    256259    REAL(r_std), DIMENSION(kjpindex) :: sum_treefrac, sum_grassfrac, sum_cropfrac 
    257260    INTEGER(i_std) :: jv 
    258  
    259  
    260  
    261261 
    262262    IF (long_print) WRITE(numout,*) ' kjpindex =',kjpindex 
     
    636636       ENDIF 
    637637 
    638        histvar(:)=SUM(vevapwet(:,:),dim=2)/86400 
     638       histvar(:)=SUM(vevapwet(:,:),dim=2)/one_day 
    639639       CALL histwrite(hist_id, 'evspsblveg', kjit, histvar, kjpindex, index) 
    640640 
    641        histvar(:)=(vevapnu(:)+vevapsno(:))/86400 
     641       histvar(:)=(vevapnu(:)+vevapsno(:))/one_day 
    642642       CALL histwrite(hist_id, 'evspsblsoi', kjit, histvar, kjpindex, index) 
    643643 
    644        histvar(:)=SUM(transpir(:,:),dim=2)/86400 
     644       histvar(:)=SUM(transpir(:,:),dim=2)/one_day 
    645645       CALL histwrite(hist_id, 'tran', kjit, histvar, kjpindex, index) 
    646  
    647 !------------------------------------ 
    648  
    649 !       histvar(:)=SUM(veget_max(:,2:9),dim=2)*100*contfrac(:) 
    650 !       CALL histwrite(hist_id, 'treeFrac', kjit, histvar, kjpindex, index) 
    651  
    652 !       histvar(:)=SUM(veget_max(:,10:11),dim=2)*100*contfrac(:) 
    653 !       CALL histwrite(hist_id, 'grassFrac', kjit, histvar, kjpindex, index) 
    654  
    655 !       histvar(:)=SUM(veget_max(:,12:13),dim=2)*100*contfrac(:) 
    656 !       CALL histwrite(hist_id, 'cropFrac', kjit, histvar, kjpindex, index) 
    657646 
    658647!$$ 25/10/10 Modif DS & NViovy 
     
    666655       histvar(:)= sum_cropfrac(:)*100*contfrac(:) 
    667656       CALL histwrite(hist_id, 'cropFrac', kjit, histvar, kjpindex, index) 
    668  
    669657 
    670658       histvar(:)=veget_max(:,1)*100*contfrac(:) 
     
    13471335    ENDDO 
    13481336 
    1349  
    13501337    ! 
    13511338    ! 2. restart value 
     
    13721359    ! 
    13731360 
     1361    control%river_routing = control_in%river_routing 
     1362    control%hydrol_cwrr = control_in%hydrol_cwrr 
    13741363    control%ok_co2 = control_in%ok_co2 
    13751364    control%ok_sechiba = control_in%ok_sechiba 
  • branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/sechiba_io.f90

    r64 r257  
    1010!! 
    1111!! @author Marie-Alice Foujols and Jan Polcher 
    12 !! @Version : $Revision: 1.8 $, $Date: 2008/03/21 13:56:12 $ 
     12!! @Version : $Revision: 12 $, $Date: 2010-11-05 16:42:13 +0100 (Fri, 05 Nov 2010) $ 
    1313!!  
    14 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/sechiba_io.f90,v 1.8 2008/03/21 13:56:12 ssipsl Exp $ 
     14!< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/sechiba_io.f90 $ 
     15!< $Date: 2010-11-05 16:42:13 +0100 (Fri, 05 Nov 2010) $ 
     16!< $Author: mmaipsl $ 
     17!< $Revision: 12 $ 
    1518!! IPSL (2006) 
    1619!!  This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC 
  • branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/sechiba_io_p.f90

    r64 r257  
    1010!! 
    1111!! @author Marie-Alice Foujols and Jan Polcher 
    12 !! @Version : $Revision: 1.4 $, $Date: 2008/03/21 13:56:12 $ 
     12!! @Version : $Revision: 12 $, $Date: 2010-11-05 16:42:13 +0100 (Fri, 05 Nov 2010) $ 
    1313!!  
    14 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/sechiba_io_p.f90,v 1.4 2008/03/21 13:56:12 ssipsl Exp $ 
     14!< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/sechiba_io_p.f90 $ 
     15!< $Date: 2010-11-05 16:42:13 +0100 (Fri, 05 Nov 2010) $ 
     16!< $Author: mmaipsl $ 
     17!< $Revision: 12 $ 
    1518!! IPSL (2006) 
    1619!!  This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC 
  • branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/slowproc.f90

    r143 r257  
    22! Daily update of leaf area index etc. 
    33! 
    4 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/slowproc.f90,v 1.48 2010/04/20 14:12:04 ssipsl Exp $ 
     4!< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/slowproc.f90 $ 
     5!< $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 
     6!< $Author: mmaipsl $ 
     7!< $Revision: 45 $ 
    58!! IPSL (2006) 
    69!!  This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC 
     
    5457  LOGICAL, SAVE                                   :: old_lai = .FALSE.         ! Old Lai Map interpolation 
    5558  LOGICAL, SAVE                                   :: impveg = .FALSE. 
     59  LOGICAL, SAVE                                   :: impsoilt = .FALSE. 
    5660  LOGICAL, SAVE                                   :: old_veget = .FALSE.         ! Old veget Map interpolation 
    5761  ! 
     
    143147    LOGICAL, PARAMETER                                 :: check = .FALSE. 
    144148 
    145     REAL(r_std), SAVE                                       :: sec_old = 0. 
     149    REAL(r_std), SAVE                                       :: sec_old = zero 
    146150    ! 
    147151    ! do initialisation 
     
    299303    ! Test each day and assert all slow processes (days and years) 
    300304    ! 
    301     IF ( sec_old >= one_day - dtradia .AND.  sec >= 0. ) THEN 
     305    IF ( sec_old >= one_day - dtradia .AND.  sec >= zero ) THEN 
    302306       ! 
    303307       ! reset counter 
     
    510514    LOGICAL, PARAMETER                                 :: check = .FALSE. 
    511515    ! 
    512     ! DS 15032011 add for replacing SUM(veget_max(ji,nvm-1:nvm  
     516    ! DS 15032011 add for replacing SUM(veget_max(ji,nvm-1:nvm))  
    513517    REAL(r_std)    :: sum_veget_max 
    514     ! 
    515  
    516518 
    517519    ! 
     
    582584    !Config        only done once a day. 
    583585    ! 
    584     CALL setvar_p (day_counter, val_exp, 'SECHIBA_DAY', 0.0_r_std) 
     586    CALL setvar_p (day_counter, val_exp, 'SECHIBA_DAY', zero) 
    585587    ! 
    586588    !Config Key  = LAI_MAP 
     
    733735       CALL restget_p (rest_id, var_name, nbp_glo, nvm, 12, kjit, .TRUE., laimap) 
    734736       ! 
     737    ELSE 
     738       ! 
     739       ALLOCATE (laimap(1,1,1)) 
    735740    ENDIF 
    736741    ! 
     
    806811    !Config  Key  = DT_SLOW 
    807812    !Config  Desc = Time step of STOMATE and other slow processes 
    808     !Config  Def  = 86400. 
     813    !Config  Def  = one_day 
    809814    !Config  Help = Time step (s) of regular update of vegetation 
    810815    !Config         cover, LAI etc. This is also the time step 
     
    905910       CALL setvar_p (lai, val_exp, 'SECHIBA_LAI', llaimax) 
    906911 
    907   
    908        !Config Key  = SOIL_FRACTIONS 
    909        !Config Desc = Fraction of the 3 soil types (0-dim mode) 
    910        !Config Def  = 0.28, 0.52, 0.20 
     912       ! 
     913       !Config Key  = IMPOSE_SOILT 
     914       !Config Desc = Should the soil typ be prescribed 
     915       !Config Def  = n 
    911916       !Config If   = IMPOSE_VEG 
    912        !Config Help = Determines the fraction for the 3 soil types 
    913        !Config        in the mesh in the following order : sand loam and clay. 
    914        ! 
    915        CALL setvar_p (soiltype, val_exp, 'SOIL_FRACTIONS', soiltype_default) 
    916  
    917  
    918        !Config Key  = CLAY_FRACTION 
    919        !Config Desc = Fraction of the clay fraction (0-dim mode) 
    920        !Config Def  = 0.2 
    921        !Config If   = IMPOSE_VEG 
    922        !Config Help = Determines the fraction of clay in the grid box. 
    923        ! 
    924        CALL setvar_p (clayfraction, val_exp, 'CLAY_FRACTION', clayfraction_default) 
    925  
     917       !Config Help = This flag allows the user to impose a soil type distribution. 
     918       !Config        It is espacially interesting for 0D 
     919       !Config        simulations. On the globe it does not make too much sense as 
     920       !Config        it imposes the same soil everywhere 
     921       ! 
     922       impsoilt = .FALSE. 
     923       CALL getin_p('IMPOSE_SOILT', impsoilt) 
     924       IF (impsoilt) THEN 
     925          !Config Key  = SOIL_FRACTIONS 
     926          !Config Desc = Fraction of the 3 soil types (0-dim mode) 
     927          !Config Def  = 0.28, 0.52, 0.20 
     928          !Config If   = IMPOSE_VEG 
     929          !Config If   = IMPOSE_SOILT 
     930          !Config Help = Determines the fraction for the 3 soil types 
     931          !Config        in the mesh in the following order : sand loam and clay. 
     932          ! 
     933          CALL setvar_p (soiltype, val_exp, 'SOIL_FRACTIONS', soiltype_default) 
     934 
     935          !Config Key  = CLAY_FRACTION 
     936          !Config Desc = Fraction of the clay fraction (0-dim mode) 
     937          !Config Def  = 0.2 
     938          !Config If   = IMPOSE_VEG 
     939          !Config If   = IMPOSE_SOILT 
     940          !Config Help = Determines the fraction of clay in the grid box. 
     941          ! 
     942          CALL setvar_p (clayfraction, val_exp, 'CLAY_FRACTION', clayfraction_default) 
     943       ELSE 
     944          IF ( MINVAL(soiltype) .EQ. MAXVAL(soiltype) .AND. MAXVAL(soiltype) .EQ. val_exp .OR.& 
     945               & MINVAL(clayfraction) .EQ. MAXVAL(clayfraction) .AND. MAXVAL(clayfraction) .EQ. val_exp) THEN 
     946 
     947             CALL slowproc_soilt(kjpindex, lalo, neighbours, resolution, contfrac, soiltype, clayfraction) 
     948          ENDIF 
     949       ENDIF 
    926950       ! 
    927951       !Config Key  = SLOWPROC_HEIGHT 
     
    10051029             ! If restart doesn't contain veget, then it is the first computation 
    10061030             CALL slowproc_update(kjpindex, lalo, neighbours, resolution, contfrac, & 
    1007                   &               veget_max, frac_nobio, veget_max, frac_nobio, veget_year, init=.TRUE.) 
     1031               &               veget_nextyear, frac_nobio_nextyear, veget_max, frac_nobio, veget_year, init=.TRUE.) 
    10081032             ! 
    10091033             IF ( control%ok_dgvm  ) THEN 
     
    11721196       ! 
    11731197    CASE('MAXR') 
    1174        pref_soil_veg(:,1) = pref_soil_veg_sand 
    1175        pref_soil_veg(:,2) = pref_soil_veg_loan       
    1176        pref_soil_veg(:,3) = pref_soil_veg_clay 
     1198       pref_soil_veg(:,1) = pref_soil_veg_sand(:) 
     1199       pref_soil_veg(:,2) = pref_soil_veg_loan(:)       
     1200       pref_soil_veg(:,3) = pref_soil_veg_clay(:) 
    11771201       ! 
    11781202       ! Current default : equidistribution. 
     
    13651389    ! 
    13661390 
    1367     IF ( ( tau .LT. dt ) .OR. ( dt .LE. 0. ) .OR. ( tau .LE. 0. ) ) THEN 
     1391    IF ( ( tau .LT. dt ) .OR. ( dt .LE. zero ) .OR. ( tau .LE. zero ) ) THEN 
    13681392       WRITE(numout,*) 'slowproc_long: Problem with time steps' 
    13691393       WRITE(numout,*) 'dt=',dt 
     
    14111435    ! 1.1 Sum up 
    14121436    ! 
    1413     fracsum(:) = 0. 
     1437    fracsum(:) = zero 
    14141438    DO jv = 1, nnobio 
    14151439       DO ji = 1, kjpindex 
     
    14771501       ENDDO 
    14781502    ENDDO 
    1479      
    14801503    ! 
    14811504    ! 3. if lai of a vegetation type (jv > 1) is small, increase soil part 
     
    15011524    ! Ajout Nouveau calcul (stomate-like)  
    15021525    DO ji = 1, kjpindex 
    1503        SUMveg = 0.0 
     1526       SUMveg = zero 
    15041527       veget(ji,1) = veget_max(ji,1) 
    15051528       DO jv = 2, nvm 
    1506           veget(ji,jv) = veget_max(ji,jv) * ( 1. - exp( - lai(ji,jv) * ext_coeff(jv) ) ) 
     1529          veget(ji,jv) = veget_max(ji,jv) * ( un - exp( - lai(ji,jv) * ext_coeff(jv) ) ) 
    15071530          veget(ji,1) = veget(ji,1) + (veget_max(ji,jv) - veget(ji,jv)) 
    15081531          SUMveg = SUMveg + veget(ji,jv) 
     
    15151538       ENDIF 
    15161539    ENDDO 
    1517  
    15181540    ! 
    15191541    ! 4. Sum up surface fractions and test if the sum is equal to 1 
     
    15231545    ! 4.1 Sum up 
    15241546    ! 
    1525     fracsum(:) = 0. 
     1547    fracsum(:) = zero 
    15261548    DO jv = 1, nnobio 
    15271549       DO ji = 1, kjpindex 
     
    15991621    REAL(r_std), DIMENSION (kjpindex,2), INTENT(in)     :: resolution !! size in x an y of the grid (m) 
    16001622 
    1601     REAL(r_std), DIMENSION(kjpindex,nvm,12), INTENT(in) :: laimap     !! LAI lue 
     1623    REAL(r_std), DIMENSION(:,:,:), INTENT(in)          :: laimap     !! LAI lue 
    16021624    LOGICAL, INTENT(in)                                :: read_lai 
    16031625    ! 0.2 Output 
     
    16101632    ! Test Nathalie. On impose LAI PFT 1 a 0 
    16111633    ! On boucle sur 2,nvm au lieu de 1,nvm 
    1612     lai(: ,1) = 0.0 
     1634    lai(: ,1) = zero 
    16131635    DO jv = 2,nvm 
    16141636!!$    DO jv = 1,nvm 
     
    17711793    ! 
    17721794    WHERE  ( laimaporig(:,:,:) .LT. 0 ) 
    1773        laimaporig(:,:,:) = 0. 
     1795       laimaporig(:,:,:) = zero 
    17741796    ENDWHERE 
    17751797    ! 
     
    18311853    ilast = 1 
    18321854    n_origlai(:) = 0 
    1833     laimap(:,:,:) = 0.     
     1855    laimap(:,:,:) = zero    
    18341856    ! 
    18351857    DO ip=1,ijml 
     
    19431965             ! Antartica 
    19441966             DO jv =1,nvm 
    1945                 laimap(ip,jv,:) = 0. 
     1967                laimap(ip,jv,:) = zero 
    19461968             ENDDO 
    19471969             ! 
     
    19491971             ! Artica 
    19501972             DO jv =1,nvm 
    1951                 laimap(ip,jv,:) = 0. 
     1973                laimap(ip,jv,:) = zero 
    19521974             ENDDO 
    19531975             ! 
     
    19551977             ! Greenland 
    19561978             DO jv =1,nvm 
    1957                 laimap(ip,jv,:) = 0. 
     1979                laimap(ip,jv,:) = zero 
    19581980             ENDDO 
    19591981             ! 
     
    25902612       DO ib = 1, nbpt 
    25912613          idi=1 
    2592           sumf=0. 
     2614          sumf=zero 
    25932615          DO WHILE ( sub_area(ib,idi) > zero )  
    25942616             ip = sub_index(ib,idi,1) 
     
    26222644             IF (PRESENT(init)) THEN 
    26232645                IF (init) THEN 
    2624 !                   veget_next(ib,:) = (/ 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. /) 
    2625                     veget_next(ib,1) = 1. 
     2646                    veget_next(ib,1) = un 
    26262647                    veget_next(ib,2:nvm) = zero 
    26272648                ELSE 
     
    26582679          ! 
    26592680          idi=1 
    2660           sumf=0. 
     2681          sumf=zero 
    26612682          DO WHILE ( sub_area(ib,idi) > zero )  
    26622683             ip = sub_index(ib,idi,1) 
     
    27632784          err=norm-un 
    27642785          IF (debug) & 
    2765              WRITE(numout,*) "ib ",ib," SUM(veget_next(ib,:)+frac_nobio_next(ib,:))-1., sumf",err,sumf 
    2766           IF (abs(err) > -EPSILON(1._r_std)) THEN 
     2786             WRITE(numout,*) "ib ",ib," SUM(veget_next(ib,:)+frac_nobio_next(ib,:))-un, sumf",err,sumf 
     2787          IF (abs(err) > -EPSILON(un)) THEN 
    27672788!MM 1.9.3 
    27682789!          IF (abs(err) > 0.) THEN 
     
    27752796             err=norm-un 
    27762797             IF (debug) & 
    2777                   WRITE(numout,*) "ib ",ib," SUM(veget_next(ib,:)+frac_nobio_next(ib,:))-1.",err 
    2778              IF (abs(err) > EPSILON(1._r_std)) THEN 
     2798                  WRITE(numout,*) "ib ",ib," SUM(veget_next(ib,:)+frac_nobio_next(ib,:))-un",err 
     2799             IF (abs(err) > EPSILON(un)) THEN 
    27792800!MM 1.9.3 
    27802801!             IF (abs(err) > 0.) THEN 
     
    29272948       ! 
    29282949       ! 
    2929        veget(ib,:) = 0.0 
    2930        frac_nobio (ib,:) = 0.0 
     2950       veget(ib,:) = zero 
     2951       frac_nobio (ib,:) = zero 
    29312952       ! 
    29322953    ENDDO 
     
    30633084        frac_origveg(:,vid) =  REAL(n_origveg(:,vid),r_std) /  REAL(n_found(:),r_std) 
    30643085      ELSEWHERE 
    3065          frac_origveg(:,vid) = 0. 
     3086         frac_origveg(:,vid) = zero 
    30663087      ENDWHERE 
    30673088    ENDDO 
     
    30993120          IF ( lalo(ib,1) .LT. -56.0) THEN 
    31003121             ! Antartica 
    3101              frac_nobio(ib,:) = 0.0 
    3102              frac_nobio(ib,iice) = 1.0 
    3103              veget(ib,:) = 0.0 
     3122             frac_nobio(ib,:) = zero 
     3123             frac_nobio(ib,iice) = un 
     3124             veget(ib,:) = zero 
    31043125             ! 
    31053126          ELSE IF ( lalo(ib,1) .GT. 70.0) THEN 
    31063127             ! Artica 
    3107              frac_nobio(ib,:) = 0.0 
    3108              frac_nobio(ib,iice) = 1.0 
    3109              veget(ib,:) = 0.0 
     3128             frac_nobio(ib,:) = zero 
     3129             frac_nobio(ib,iice) = un 
     3130             veget(ib,:) = zero 
    31103131             ! 
    31113132          ELSE IF ( lalo(ib,1) .GT. 55.0 .AND. lalo(ib,2) .GT. -65.0 .AND. lalo(ib,2) .LT. -20.0) THEN 
    31123133             ! Greenland 
    3113              frac_nobio(ib,:) = 0.0 
    3114              frac_nobio(ib,iice) = 1.0 
    3115              veget(ib,:) = 0.0 
     3134             frac_nobio(ib,:) = zero 
     3135             frac_nobio(ib,iice) = un 
     3136             veget(ib,:) = zero 
    31163137             ! 
    31173138          ELSE 
     
    31443165       DO vid = 1, nvm 
    31453166          IF ( veget(ib,vid) .LT. min_vegfrac ) THEN 
    3146              veget(ib,vid) = 0.0 
     3167             veget(ib,vid) = zero 
    31473168          ENDIF 
    31483169       ENDDO 
     
    33463367          frac_origveg(:,vid) = n_origveg(:,vid) / n_found(:) 
    33473368       ELSEWHERE 
    3348           frac_origveg(:,vid) = 0. 
     3369          frac_origveg(:,vid) = zero 
    33493370       ENDWHERE 
    33503371    ENDDO 
     
    33823403          IF ( lalo(ib,1) .LT. -56.0) THEN 
    33833404             ! Antartica 
    3384              frac_nobio(ib,:) = 0.0 
    3385              frac_nobio(ib,iice) = 1.0 
    3386              veget(ib,:) = 0.0 
     3405             frac_nobio(ib,:) = zero 
     3406             frac_nobio(ib,iice) = un 
     3407             veget(ib,:) = zero 
    33873408             ! 
    33883409          ELSE IF ( lalo(ib,1) .GT. 70.0) THEN 
    33893410             ! Artica 
    3390              frac_nobio(ib,:) = 0.0 
    3391              frac_nobio(ib,iice) = 1.0 
    3392              veget(ib,:) = 0.0 
     3411             frac_nobio(ib,:) = zero 
     3412             frac_nobio(ib,iice) = un 
     3413             veget(ib,:) = zero 
    33933414             ! 
    33943415          ELSE IF ( lalo(ib,1) .GT. 55.0 .AND. lalo(ib,2) .GT. -65.0 .AND. lalo(ib,2) .LT. -20.0) THEN 
    33953416             ! Greenland 
    3396              frac_nobio(ib,:) = 0.0 
    3397              frac_nobio(ib,iice) = 1.0 
    3398              veget(ib,:) = 0.0 
     3417             frac_nobio(ib,:) = zero 
     3418             frac_nobio(ib,iice) = un 
     3419             veget(ib,:) = zero 
    33993420             ! 
    34003421          ELSE 
     
    34273448       DO vid = 1, nvm 
    34283449          IF ( veget(ib,vid) .LT. min_vegfrac ) THEN 
    3429              veget(ib,vid) = 0.0 
     3450             veget(ib,vid) = zero 
    34303451          ENDIF 
    34313452       ENDDO 
     
    35543575       ! 
    35553576       ! 
    3556        veget(ib,:) = 0.0 
    3557        frac_nobio (ib,:) = 0.0 
     3577       veget(ib,:) = zero 
     3578       frac_nobio (ib,:) = zero 
    35583579       ! 
    35593580    ENDDO 
     
    36903711        frac_origveg(:,vid) =  REAL(n_origveg(:,vid),r_std) /  REAL(n_found(:),r_std) 
    36913712      ELSEWHERE 
    3692          frac_origveg(:,vid) = 0. 
     3713         frac_origveg(:,vid) = zero 
    36933714      ENDWHERE 
    36943715    ENDDO 
     
    37263747          IF ( lalo(ib,1) .LT. -56.0) THEN 
    37273748             ! Antartica 
    3728              frac_nobio(ib,:) = 0.0 
    3729              frac_nobio(ib,iice) = 1.0 
    3730              veget(ib,:) = 0.0 
     3749             frac_nobio(ib,:) = zero 
     3750             frac_nobio(ib,iice) = un 
     3751             veget(ib,:) = zero 
    37313752             ! 
    37323753          ELSE IF ( lalo(ib,1) .GT. 70.0) THEN 
    37333754             ! Artica 
    3734              frac_nobio(ib,:) = 0.0 
    3735              frac_nobio(ib,iice) = 1.0 
    3736              veget(ib,:) = 0.0 
     3755             frac_nobio(ib,:) = zero 
     3756             frac_nobio(ib,iice) = un 
     3757             veget(ib,:) = zero 
    37373758             ! 
    37383759          ELSE IF ( lalo(ib,1) .GT. 55.0 .AND. lalo(ib,2) .GT. -65.0 .AND. lalo(ib,2) .LT. -20.0) THEN 
    37393760             ! Greenland 
    3740              frac_nobio(ib,:) = 0.0 
    3741              frac_nobio(ib,iice) = 1.0 
    3742              veget(ib,:) = 0.0 
     3761             frac_nobio(ib,:) = zero 
     3762             frac_nobio(ib,iice) = un 
     3763             veget(ib,:) = zero 
    37433764             ! 
    37443765          ELSE 
     
    37713792       DO vid = 1, nvm 
    37723793          IF ( veget(ib,vid) .LT. min_vegfrac ) THEN 
    3773              veget(ib,vid) = 0.0 
     3794             veget(ib,vid) = zero 
    37743795          ENDIF 
    37753796       ENDDO 
     
    39623983          frac_origveg(:,vid) = n_origveg(:,vid) / n_found(:) 
    39633984       ELSEWHERE 
    3964           frac_origveg(:,vid) = 0. 
     3985          frac_origveg(:,vid) = zero 
    39653986       ENDWHERE 
    39663987    ENDDO 
     
    39984019          IF ( lalo(ib,1) .LT. -56.0) THEN 
    39994020             ! Antartica 
    4000              frac_nobio(ib,:) = 0.0 
    4001              frac_nobio(ib,iice) = 1.0 
    4002              veget(ib,:) = 0.0 
     4021             frac_nobio(ib,:) = zero 
     4022             frac_nobio(ib,iice) = un 
     4023             veget(ib,:) = zero 
    40034024             ! 
    40044025          ELSE IF ( lalo(ib,1) .GT. 70.0) THEN 
    40054026             ! Artica 
    4006              frac_nobio(ib,:) = 0.0 
    4007              frac_nobio(ib,iice) = 1.0 
    4008              veget(ib,:) = 0.0 
     4027             frac_nobio(ib,:) = zero 
     4028             frac_nobio(ib,iice) = un 
     4029             veget(ib,:) = zero 
    40094030             ! 
    40104031          ELSE IF ( lalo(ib,1) .GT. 55.0 .AND. lalo(ib,2) .GT. -65.0 .AND. lalo(ib,2) .LT. -20.0) THEN 
    40114032             ! Greenland 
    4012              frac_nobio(ib,:) = 0.0 
    4013              frac_nobio(ib,iice) = 1.0 
    4014              veget(ib,:) = 0.0 
     4033             frac_nobio(ib,:) = zero 
     4034             frac_nobio(ib,iice) = un 
     4035             veget(ib,:) = zero 
    40154036             ! 
    40164037          ELSE 
     
    40434064       DO vid = 1, nvm 
    40444065          IF ( veget(ib,vid) .LT. min_vegfrac ) THEN 
    4045              veget(ib,vid) = 0.0 
     4066             veget(ib,vid) = zero 
    40464067          ENDIF 
    40474068       ENDDO 
  • branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/thermosoil.f90

    r64 r257  
    33!! 
    44!! @author Marie-Alice Foujols and Jan Polcher 
    5 !! @Version : $Revision: 1.15 $, $Date: 2009/01/07 13:39:45 $ 
     5!! @Version : $Revision: 45 $, $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 
    66!!  
    7 !! $Header: /home/ssipsl/CVSREP/ORCHIDEE/src_sechiba/thermosoil.f90,v 1.15 2009/01/07 13:39:45 ssipsl Exp $ 
     7!< $HeadURL: http://forge.ipsl.jussieu.fr/orchidee/svn/trunk/ORCHIDEE/src_sechiba/thermosoil.f90 $ 
     8!< $Date: 2011-01-01 21:30:44 +0100 (Sat, 01 Jan 2011) $ 
     9!< $Author: mmaipsl $ 
     10!< $Revision: 45 $ 
    811!! IPSL (2006) 
    912!!  This software is governed by the CeCILL licence see ORCHIDEE/ORCHIDEE_CeCILL.LIC 
     
    98101    REAL(r_std),DIMENSION (kjpindex), INTENT (in)      :: temp_sol_new     !! New soil temperature 
    99102    REAL(r_std),DIMENSION (kjpindex), INTENT (in)      :: snow             !! Snow quantity 
     103    REAL(r_std),DIMENSION (kjpindex,nbdl), INTENT (in) :: shumdiag         !! Diagnostic of relative humidity 
    100104    ! output fields 
    101     REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: soilcap          !! Soil capacity 
    102     REAL(r_std),DIMENSION (kjpindex), INTENT (out)     :: soilflx           
    103     REAL(r_std),DIMENSION (kjpindex,nbdl), INTENT (in) :: shumdiag         !! Diagnostic of relative humidity 
    104     REAL(r_std),DIMENSION (kjpindex,nbdl), INTENT (out):: stempdiag        !! diagnostic temp profile 
     105    REAL(r_std),DIMENSION (kjpindex), INTENT (inout)     :: soilcap        !! Soil capacity 
     106    REAL(r_std),DIMENSION (kjpindex), INTENT (inout)     :: soilflx           
     107    REAL(r_std),DIMENSION (kjpindex,nbdl), INTENT (inout):: stempdiag        !! diagnostic temp profile 
    105108 
    106109    REAL(r_std),DIMENSION (kjpindex,ngrnd) :: temp 
     
    645648    REAL(r_std), DIMENSION (kjpindex), INTENT (out)          :: soilflx           !! 
    646649    REAL(r_std), DIMENSION (kjpindex), INTENT (out)          :: z1                !! 
    647     REAL(r_std), DIMENSION (kjpindex,ngrnd), INTENT(out)     :: pcapa             !! 
    648     REAL(r_std), DIMENSION (kjpindex,ngrnd), INTENT(out)     :: pcapa_en          !! 
    649     REAL(r_std), DIMENSION (kjpindex,ngrnd), INTENT(out)     :: pkappa            !! 
     650    REAL(r_std), DIMENSION (kjpindex,ngrnd), INTENT(inout)     :: pcapa             !! 
     651    REAL(r_std), DIMENSION (kjpindex,ngrnd), INTENT(inout)     :: pcapa_en          !! 
     652    REAL(r_std), DIMENSION (kjpindex,ngrnd), INTENT(inout)     :: pkappa            !! 
    650653    REAL(r_std), DIMENSION (kjpindex,ngrnd-1), INTENT(out)     :: cgrnd             !! 
    651654    REAL(r_std), DIMENSION (kjpindex,ngrnd-1), INTENT(out)     :: dgrnd             !! 
     
    837840                lev_prog = prev_prog + dz2(jg) 
    838841             ENDIF 
    839             intfact(jd,jg) = MAX(MIN(lev_diag,lev_prog)-MAX(prev_diag, prev_prog), 0.0)/(lev_diag-prev_diag) 
     842            intfact(jd,jg) = MAX(MIN(lev_diag,lev_prog)-MAX(prev_diag, prev_prog), zero)/(lev_diag-prev_diag) 
    840843            prev_prog = lev_prog 
    841844          ENDDO 
     
    857860    ENDIF 
    858861 
    859     stempdiag(:,:) = 0. 
     862    stempdiag(:,:) = zero 
    860863    DO jg = 1, ngrnd 
    861864      DO jd = 1, nbdl 
     
    907910                lev_prog = diaglev(jg) 
    908911             ENDIF 
    909              intfactw(jd,jg) = MAX(MIN(lev_diag,lev_prog)-MAX(prev_diag, prev_prog), 0.0)/(lev_diag-prev_diag) 
     912             intfactw(jd,jg) = MAX(MIN(lev_diag,lev_prog)-MAX(prev_diag, prev_prog), zero)/(lev_diag-prev_diag) 
    910913             prev_prog = lev_prog 
    911914          ENDDO 
     
    927930    ENDIF 
    928931 
    929     wetdiag(:,:) = 0. 
     932    wetdiag(:,:) = zero 
    930933    DO jg = 1, nbdl 
    931934      DO jd = 1, ngrnd 
  • branches/ORCHIDEE_EXT/ORCHIDEE/src_sechiba/watchout.f90

    r64 r257  
    33  USE defprec 
    44  USE parallel 
     5  USE constantes 
    56  USE netcdf 
    67 
     
    1011 
    1112  LOGICAL,SAVE,PUBLIC             :: ok_watchout = .FALSE. 
    12   REAL, SAVE,PUBLIC               :: dt_watch = 0. 
     13  REAL, SAVE,PUBLIC               :: dt_watch = zero 
    1314  INTEGER, SAVE,PUBLIC            :: last_action_watch = 0, & 
    1415       & last_check_watch = 0 
Note: See TracChangeset for help on using the changeset viewer.