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

Contents of /MITgcm/model/src/the_model_main.F

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


Revision 1.4 - (show annotations) (download)
Fri Apr 24 03:24:29 1998 UTC (26 years ago) by cnh
Branch: MAIN
Changes since 1.3: +2 -1 lines
Minor formatting change

1 C $Header: /u/gcmpack/models/MITgcmUV/model/src/the_model_main.F,v 1.3 1998/04/24 02:10:21 cnh Exp $
2
3 #include "CPP_EEOPTIONS.h"
4
5 SUBROUTINE THE_MODEL_MAIN(myThid)
6 C /==========================================================\
7 C | SUBROUTINE THE_MODEL_MAIN |
8 C | o Master controlling routine for model using the MITgcm |
9 C | UV parallel wrapper. |
10 C |==========================================================|
11 C | THE_MODEL_MAIN is invoked by the MITgcm UV parallel |
12 C | wrapper with a single integer argument "myThid". This |
13 C | variable identifies the thread number of an instance of |
14 C | THE_MODEL_MAIN. Each instance of THE_MODEL_MAIN works |
15 C | on a particular region of the models domain and |
16 C | synchronises with other instances as necessary. The |
17 C | routine has to "understand" the MITgcm parallel |
18 C | environment and the numerical algorithm. Editing this |
19 C | routine is best done with some knowledge of both aspects.|
20 C | Notes |
21 C | ===== |
22 C | C*P* comments indicating place holders for which code is |
23 C | presently being developed. |
24 C \==========================================================/
25
26 C == Global variables ===
27 #include "SIZE.h"
28 #include "EEPARAMS.h"
29 #include "PARAMS.h"
30 #include "CG2D.h"
31 #include "DYNVARS.h"
32
33 C == Routine arguments ==
34 C myThid - Thread number for this instance of the routine.
35 INTEGER myThid
36
37 C == Local variables ==
38 C Note: Under the multi-threaded model myCurrentIter and myCurrentTime
39 C are local variables passed around as routine arguments. Although
40 C this is fiddly it saves the need to impose additional synchronisation
41 C points when they are updated.
42 C myCurrentIter - Iteration counter for this thread
43 C myCurrentTime - Time counter for this thread
44 C I - Loop counter
45 INTEGER I, myCurrentIter
46 REAL myCurrentTime
47
48 C-- Set model initial conditions
49 CALL INITIALISE( myThid )
50 myCurrentTime = startTime
51 myCurrentIter = nIter0
52
53 C-- Begin time stepping loop
54 DO I=1, nTimeSteps
55
56 C-- Do IO if needed.
57 CALL DO_THE_MODEL_IO( myCurrentIter, myThid )
58
59 C-- Load offline tracer fields
60 IF ( MOD(myCurrentIter,numStepsPerPickup) .EQ. 1 ) THEN
61 C I/O
62 C o Writes to arrays are performed by their own thread (to ensure
63 C physical memory allocation will pair with thread).
64 C o Thread 1 reads into a buffer.
65 C CALL LOAD_OFFLINE_FIELDS( myCurrentTime, myCurrentIter, myThid )
66 ENDIF
67
68 C-- Step forward fields and calculate time tendency terms
69 CALL DYNAMICS( myThid )
70
71 C-- Solve elliptic equation(s).
72 C Two-dimensional only for conventional hydrostatic or three-dimensional
73 C for non-hydrostatic and/or IGW scheme.
74 CALL SOLVE_FOR_PRESSURE( myThid )
75
76 C-- Do "blocking" sends and receives for tendency "overlap" terms
77 CALL DO_GTERM_BLOCKING_EXCHANGES( myThid )
78
79 myCurrentIter = myCurrentIter + 1
80 myCurrentTime = myCurrentTime + deltaTtracer
81
82 C-- Save state for restarts
83 C*P* CALL CHECKPOINT( myThid )
84
85 ENDDO
86
87 RETURN
88 END

  ViewVC Help
Powered by ViewVC 1.1.22