next up previous contents
Next: lnd_final_mct Up: Fortran: Module Interface lnd_comp_mct Previous: lnd_init_mct   Contents

lnd_run_mct


INTERFACE:

   subroutine lnd_run_mct( EClock, cdata_l, x2l_l, l2x_l, &
                                   cdata_r,        r2x_r, &
                                   cdata_s, x2s_s, s2x_s )
DESCRIPTION:

Run clm model


USES:

     use shr_kind_mod    ,only : r8 => shr_kind_r8
     use clm_atmlnd      ,only : clm_mapl2a, clm_mapa2l
     use clm_atmlnd      ,only : clm_l2a, atm_l2a, atm_a2l, clm_a2l
     use clm_comp        ,only : clm_run1, clm_run2
     use clm_time_manager,only : get_curr_date, get_nstep, get_curr_calday, get_step_size, &
                                 advance_timestep, set_nextsw_cday,update_rad_dtime
     use domainMod       ,only : adomain
     use decompMod       ,only : get_proc_bounds_atm
     use abortutils      ,only : endrun
     use clm_varctl      ,only : iulog
     use shr_file_mod    ,only : shr_file_setLogUnit, shr_file_setLogLevel, &
                                 shr_file_getLogUnit, shr_file_getLogLevel
     use seq_cdata_mod   ,only : seq_cdata, seq_cdata_setptrs
     use seq_timemgr_mod ,only : seq_timemgr_EClockGetData, seq_timemgr_StopAlarmIsOn, &
                                 seq_timemgr_RestartAlarmIsOn, seq_timemgr_EClockDateInSync
     use seq_infodata_mod,only : seq_infodata_type, seq_infodata_GetData
     use spmdMod         ,only : masterproc, mpicom
     use perf_mod        ,only : t_startf, t_stopf, t_barrierf
     use mct_mod         ,only : mct_aVect, mct_aVect_accum, mct_aVect_copy, mct_aVect_avg, &
                                 mct_aVect_zero
     use mct_mod        , only : mct_gGrid, mct_gGrid_exportRAttr, mct_gGrid_lsize
     use aerdepMod      , only : aerdepini
     use ESMF_mod
     implicit none
ARGUMENTS:
     type(ESMF_Clock)            , intent(in)    :: EClock    ! Input synchronization clock from driver
     type(seq_cdata)             , intent(in)    :: cdata_l   ! Input driver data for land model
     type(mct_aVect)             , intent(inout) :: x2l_l     ! Import state to land model
     type(mct_aVect)             , intent(inout) :: l2x_l     ! Export state from land model
     type(seq_cdata)             , intent(in)    :: cdata_r   ! Input driver data for runoff model
     type(mct_aVect)             , intent(inout) :: r2x_r     ! Export state from runoff model
     type(seq_cdata),  optional,   intent(in)    :: cdata_s   ! Input driver data for snow model (land-ice)
     type(mct_aVect),  optional,   intent(inout) :: x2s_s     ! Import state for snow model
     type(mct_aVect),  optional,   intent(inout) :: s2x_s     ! Export state for snow model
LOCAL VARIABLES:
     integer :: ymd_sync                   ! Sync date (YYYYMMDD)
     integer :: yr_sync                    ! Sync current year
     integer :: mon_sync                   ! Sync current month
     integer :: day_sync                   ! Sync current day
     integer :: tod_sync                   ! Sync current time of day (sec)
     integer :: ymd                        ! CLM current date (YYYYMMDD)
     integer :: yr                         ! CLM current year
     integer :: mon                        ! CLM current month
     integer :: day                        ! CLM current day
     integer :: tod                        ! CLM current time of day (sec)
     integer :: dtime                      ! time step increment (sec)
     integer :: nstep                      ! time step index
     logical :: rstwr_sync                 ! .true. ==> write restart file before returning
     logical :: rstwr                      ! .true. ==> write restart file before returning
     logical :: nlend_sync                 ! Flag signaling last time-step
     logical :: nlend                      ! .true. ==> last time-step
     logical :: dosend                     ! true => send data back to driver
     logical :: doalb                      ! .true. ==> do albedo calculation on this time step
     real(r8):: nextsw_cday                ! calday from clock of next radiation computation
     real(r8):: caldayp1                   ! clm calday plus dtime offset
     integer :: shrlogunit,shrloglev       ! old values for share log unit and log level
     integer :: begg, endg                 ! Beginning and ending gridcell index numbers
     integer :: lbnum                      ! input to memory diagnostic
     type(seq_infodata_type),pointer :: infodata ! CCSM information from the driver
     type(mct_gGrid),        pointer :: dom_l    ! Land model domain data
     real(r8),               pointer :: data(:)  ! temporary
     integer :: g,i,lsize                        ! counters
     logical,save :: first_call = .true.         ! first call work
     character(len=32)            :: rdate       ! date char string for restart file names
     character(len=32), parameter :: sub = "lnd_run_mct"
REVISION HISTORY:
   Author: Mariana Vertenstein



Erik Kluzek 2010-06-21