next up previous contents index
Next: write_diagnostic Up: ProTEX Source Code Documentation Previous: do_restwrite (File: do_restwrite.F90)   Contents   Index


driver (Source File: driver.F90)


INTERFACE:

 subroutine driver (doalb, eccen, obliqr, lambm0, mvelpp)
DESCRIPTION:

This subroutine provides the main CLM driver calling sequence. Most computations occurs over ``clumps'' of gridcells (and associated subgrid scale entities) assigned to each MPI process. Computation is further parallelized by looping over clumps on each process using shared memory OpenMP or Cray Streaming Directives.

The main CLM driver calling sequence is as follows:

   * Communicate with flux coupler [COUP_CSM]
   + interpMonthlyVeg      interpolate monthly vegetation data [!DGVM]
     + readMonthlyVegetation read vegetation data for two months [!DGVM]
   ==== Begin Loop 1 over clumps ====
    -> DriverInit          save of variables from previous time step
    -> Hydrology1          canopy interception and precip on ground
       -> FracWet          fraction of wet vegetated surface and dry elai
    -> SurfaceRadiation    surface solar radiation
    -> Biogeophysics1      leaf temperature and surface fluxes
    -> BareGroundFluxes    surface fluxes for bare soil or snow-covered
                           vegetation patches
       -> MoninObukIni     first-guess Monin-Obukhov length and wind speed
       -> FrictionVelocity friction velocity and potential temperature and
                           humidity profiles
    -> CanopyFluxes        leaf temperature and surface fluxes for vegetated
                           patches
       -> QSat             saturated vapor pressure, specific humidity, &
                           derivatives at leaf surface
       -> MoninObukIni     first-guess Monin-Obukhov length and wind speed
       -> FrictionVelocity friction velocity and potential temperature and
                           humidity profiles
       -> Stomata          stomatal resistance and photosynthesis for
                           sunlit leaves
       -> Stomata          stomatal resistance and photosynthesis for
                           shaded leaves
       -> QSat             recalculation of saturated vapor pressure,
                           specific humidity, & derivatives at leaf surface
    -> Biogeophysics_Lake  lake temperature and surface fluxes
     + DustEmissions       compute dust mobilization [DUST]
     + DustDryDep          compute dust dry deposition [DUST]
     + VOCEmission         compute VOC emission [VOC]
     + DGVMRespiration     CO2 respriation and plant production [DGVM]
     + DGVMEcosystemDyn    DGVM ecosystem dynamics: vegetation phenology [!DGV
    -> EcosystemDyn        "static" ecosystem dynamics: vegetation phenology
                           and soil carbon [!DGVM]
    -> SurfaceAlbedo       albedos for next time step
    -> Biogeophysics2      soil/snow & ground temp and update surface fluxes
    -> pft2col             Average from PFT level to column level
    ====  End Loop 1 over clumps  ====
   * Average fluxes over time interval and send to flux coupler [COUP_CSM]
    ==== Begin Loop 2 over clumps ====
    -> Hydrology2          surface and soil hydrology
    -> Hydrology_Lake      lake hydrology
    -> SnowAge             update snow age for surface albedo calcualtion
    -> BalanceCheck        check for errors in energy and water balances
    ====  End Loop 2 over clumps  ====
    -> write_diagnostic    output diagnostic if appropriate
     + Rtmriverflux        calls RTM river routing model [RTM]
    -> updateAccFlds       update accumulated fields
    -> update_hbuf         accumulate history fields for time interval
    Begin DGVM calculations at end of model year [DGVM]
      ==== Begin Loop over clumps ====
       + lpj                 LPJ ecosystem dynamics: reproduction, turnover,
                             kill, allocation, light, mortality, fire
       + lpjreset1           reset variables & initialize for next year
      ====  End Loop over clumps  ====
    End DGVM calculations at end of model year [DGVM]
    -> htapes_wrapup       write history tapes if appropriate
    Begin DGVM calculations at end of model year [DGVM]
      ==== Begin Loop over clumps ====
       + lpjreset2           reset variables and patch weights
      ====  End Loop over clumps  ====
    End DGVM calculations at end of model year [DGVM]
    -> restart             write restart file if appropriate
    -> inicfile            write initial file if appropriate
Optional subroutines are denoted by an plus (+) with the associated CPP variable in brackets at the end of the line. Coupler communication when coupled with CCSM components is denoted by an asterisk (*).


USES:

   use shr_kind_mod, only: r8 => shr_kind_r8
   use clmtype
 #if (defined COUP_CSM)
   use clm_varctl          , only : wrtdia, fsurdat, csm_doflxave
 #else
   use clm_varctl          , only : wrtdia, fsurdat, nsrest
 #endif
   use spmdMod             , only : masterproc
   use decompMod           , only : get_proc_clumps, get_clump_bounds
   use filterMod           , only : filter
   use clm_varcon          , only : zlnd
 #if (defined COUP_CAM)
   use time_manager        , only : get_step_size, get_curr_calday, &
                                    get_curr_date, get_ref_date, get_nstep, &
                                    is_perpetual
 #else
   use time_manager        , only : get_step_size, get_curr_calday, &
                                    get_curr_date, get_ref_date, get_nstep
 #endif
   use histFileMod         , only : update_hbuf, htapes_wrapup
   use restFileMod         , only : restart
 #if (defined COUP_CAM)
   use inicFileMod         , only : inicfile, do_inicwrite, inicperp
 #else
   use inicFileMod         , only : inicfile, do_inicwrite
 #endif
   use DriverInitMod       , only : DriverInit
   use BalanceCheckMod     , only : BalanceCheck
   use SurfaceRadiationMod , only : SurfaceRadiation
   use Hydrology1Mod       , only : Hydrology1
   use Hydrology2Mod       , only : Hydrology2
   use HydrologyLakeMod    , only : HydrologyLake
   use Biogeophysics1Mod   , only : Biogeophysics1
   use BareGroundFluxesMod , only : BareGroundFluxes
   use CanopyFluxesMod     , only : CanopyFluxes
   use Biogeophysics2Mod   , only : Biogeophysics2
   use BiogeophysicsLakeMod, only : BiogeophysicsLake
   use SurfaceAlbedoMod    , only : SurfaceAlbedo, Snowage
   use pft2colMod          , only : pft2col
   use accFldsMod          , only : updateAccFlds
 #if (defined DGVM)
   use DGVMEcosystemDynMod , only : DGVMEcosystemDyn, DGVMRespiration
   use DGVMMod             , only : lpj, lpjreset1, lpjreset2, &
                                    gatherWeightsDGVM, histDGVM
 #else
   use STATICEcosysDynMod  , only : EcosystemDyn, interpMonthlyVeg
 #endif
 #if (defined DUST)
   use DUSTMod             , only : DustDryDep, DustEmission
 #endif
 #if (defined VOC)
   use VOCEmissionMod      , only : VOCEmission
 #endif
 #if (defined RTM)
   use RtmMod              , only : Rtmriverflux
 #endif
 #if (defined COUP_CSM)
   use clm_csmMod          , only : csm_dosndrcv, csm_recv, csm_send, &
                                    csm_flxave, dorecv, dosend, csmstop_now
 #endif
   use lnd2atmMod          , only : lnd2atm
   use abortutils          , only : endrun
ARGUMENTS:
   implicit none
   logical , intent(in) :: doalb  !true if time for surface albedo
                                  !calculation
   real(r8), intent(in) :: eccen  !Earth's orbital eccentricity
   real(r8), intent(in) :: obliqr !Earth's obliquity in radians
   real(r8), intent(in) :: lambm0 !Mean longitude of perihelion at the
                                  !vernal equinox (radians)
   real(r8), intent(in) :: mvelpp !Earth's moving vernal equinox longitude
                                  !of perihelion + pi (radians)
CALLED FROM:
   program program_off (if COUP_OFFLINE cpp variable is defined)
   program program_csm (if COUP_CSM cpp variable is defined)
   subroutine atm_lnddrv in module atm_lndMod (if COUP_CAM cpp variable
     is defined)
REVISION HISTORY:
   2002.10.01  Mariana Vertenstein latest update to new data structures



Subsections

Mariana Vertenstein 2004-06-21