/[MITgcm]/MITgcm/model/src/the_main_loop.F
ViewVC logotype

Annotation of /MITgcm/model/src/the_main_loop.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (hide annotations) (download)
Thu Feb 8 18:13:37 2001 UTC (23 years, 4 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint35
Changes since 1.2: +7 -11 lines
set initial Time & Iteration counter in the_model_main
 and pass them as argument to the_main_loop

1 jmc 1.3 C $Header: /u/gcmpack/models/MITgcmUV/model/src/the_main_loop.F,v 1.2 2001/02/04 14:38:48 cnh Exp $
2     C $Name: $
3 adcroft 1.1
4     #include "CPP_OPTIONS.h"
5    
6 jmc 1.3 SUBROUTINE THE_MAIN_LOOP(myCurrentTime, myCurrentIter, myThid )
7 adcroft 1.1 C /==========================================================\
8     C | SUBROUTINE THE_MAIN_LOOP |
9     C | o This contains the principal time loop |
10     C |==========================================================|
11     C | THE_MAIN_LOOP is invoked by THE_MODEL_MAIN |
12     C \==========================================================/
13     IMPLICIT NONE
14     C
15     C Call Tree
16     C =========
17     C
18     C |-THE_MODEL_MAIN
19     C | |
20     C | |-THE_MAIN_LOOP
21     C | | |
22     C | | |--INITIALISE_VARIA
23     C | | | o Set initial conditions (variable arrays)
24     C | | |
25     C ==> | | | ** Time stepping loop starts here **
26     C | | | |
27     C /|\ | | |
28     C | | | |--FORWARD_STEP
29     C /|\ | | |
30     C | | | |
31     C |<== | | | ** Time stepping loop finishes here **
32     C
33    
34     C == Global variables ===
35     #include "SIZE.h"
36     #include "EEPARAMS.h"
37     #include "PARAMS.h"
38     #include "DYNVARS.h"
39     #include "CG2D.h"
40     #ifdef ALLOW_NONHYDROSTATIC
41     #include "CG3D.h"
42     #endif
43    
44     C == Routine arguments ==
45 jmc 1.3 C myCurrentTime - Time counter for this thread
46     C myCurrentIter - Iteration counter for this thread
47 adcroft 1.1 C myThid - Thread number for this instance of the routine.
48 jmc 1.3 INTEGER myCurrentIter, myThid
49     _RL myCurrentTime
50 adcroft 1.1
51     C == Local variables ==
52     C Note: Under the multi-threaded model myCurrentIter and
53     C myCurrentTime are local variables passed around as routine
54     C arguments. Although this is fiddly it saves the need to
55     C impose additional synchronisation points when they are
56     C updated.
57     C ILOOP - Loop counter
58     INTEGER ILOOP
59    
60     CALL TIMER_START('SPIN-UP [THE_MAIN_LOOP]',myThid)
61    
62     C-- Set initial conditions (variable arrays)
63     CALL TIMER_START('INITIALISE_VARIA [THE_MAIN_LOOP]',myThid)
64     CALL INITIALISE_VARIA( myThid )
65     CALL TIMER_STOP ('INITIALISE_VARIA [THE_MAIN_LOOP]',myThid)
66    
67     C-- Dump starting state
68     CALL TIMER_START('I/O (WRITE) [THE_MAIN_LOOP]',myThid)
69     CALL WRITE_STATE( .TRUE., myCurrentTime, myCurrentIter, myThid )
70     CALL TIMER_STOP ('I/O (WRITE) [THE_MAIN_LOOP]',myThid)
71    
72     CALL TIMER_STOP ('SPIN-UP [THE_MAIN_LOOP]',myThid)
73    
74     C ===========================================================
75     C-- Begin time stepping loop
76     CALL TIMER_START('MAIN LOOP [THE_MAIN_LOOP]',myThid)
77     DO ILOOP=1, nTimeSteps
78    
79     C-- Step forward fields and calculate time tendency terms
80     CALL TIMER_START('FORWARD_STEP [THE_MAIN_LOOP]',myThid)
81     CALL FORWARD_STEP( .FALSE., ILOOP,
82     & myCurrentTime, myCurrentIter, myThid )
83     CALL TIMER_STOP ('FORWARD_STEP [THE_MAIN_LOOP]',myThid)
84    
85     ENDDO
86     CALL TIMER_STOP ('MAIN LOOP [THE_MAIN_LOOP]',myThid)
87     C ===========================================================
88    
89     CALL TIMER_START('SPIN-DOWN [THE_MAIN_LOOP]',myThid)
90    
91     C-- Final checkpoint (incase the in-loop checkpoint was missed)
92     CALL TIMER_START('I/O (WRITE) [THE_MAIN_LOOP]',myThid)
93     CALL WRITE_CHECKPOINT(
94     & .TRUE., myCurrentTime, myCurrentIter, myThid )
95     CALL TIMER_STOP ('I/O (WRITE) [THE_MAIN_LOOP]',myThid)
96    
97     C-- Step forward fields for purposes of final I/O processing
98     CALL TIMER_START('FORWARD_STEP [THE_MAIN_LOOP]',myThid)
99     CALL FORWARD_STEP( .TRUE., ILOOP,
100     & myCurrentTime, myCurrentIter, myThid )
101     CALL TIMER_STOP ('FORWARD_STEP [THE_MAIN_LOOP]',myThid)
102    
103     CALL TIMER_STOP ('SPIN-DOWN [THE_MAIN_LOOP]',myThid)
104    
105     RETURN
106     END

  ViewVC Help
Powered by ViewVC 1.1.22