timemgr_fex.tex

来自「CCSM Research Tools: Community Atmospher」· TEX 代码 · 共 51 行

TEX
51
字号
% $Id: TimeMgr_fex.tex,v 1.1.6.1 2002/04/24 03:25:50 erik Exp $The example below demonstrates usage of the {\tt TimeMgr} class.  Fora detailed description of the {\tt TimeMgr} class interface, see Appendix A.We initialize a {\tt TimeMgr} with a start date, an end date, and a timestep.  The {\tt TimeMgr} advances the model calendar until it recognizes that it is on the last timestep.  Since no memory is allocated from the heap when a {\tt TimeMgr} is initialized, there is no need to deallocate a {\tt TimeMgr} object.\begin{verbatim}        use ESMF_TimeMgmtMod  type(ESMF_Time) :: stepSize  type(ESMF_Date) :: startDate, endDate  type(ESMF_TimeMgr) :: timeMgr!-------------------------------------------------------------------------------    ! Initialize the model timestep to 1 day, 1800 seconds; the start date to ! December 1, 2001 and 0 seconds; and the end date to March 14, 2003 and ! 0 seconds.  Dates are represented in a YYYYMMDD format.  In this example! we use a Gregorian calendar. !-------------------------------------------------------------------------------  stepSize = ESMF_TimeInit(1, 1800)  startDate = ESMF_DateInit(ESMF_GREGORIAN, 20011201, 0)  endDate = ESMF_DateInit(ESMF_GREGORIAN, 20030314, 0)!-------------------------------------------------------------------------------    ! Initialize the time manager.!-------------------------------------------------------------------------------  timeMgr = ESMF_TimeMgrInit(stepSize, startDate, endDate)!-------------------------------------------------------------------------------    ! Advance the model until the end date.!-------------------------------------------------------------------------------  do while (.NOT. ESMF_TimeMgrLastStep(timeMgr))    ! Execute model code    call ESMF_TimeMgrAdvance(timeMgr)  end do\end{verbatim}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?