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

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

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

revision 1.37 by heimbach, Sun Mar 25 22:33:53 2001 UTC revision 1.40 by heimbach, Mon Jul 30 20:39:18 2001 UTC
# Line 25  C     |      presently being developed. Line 25  C     |      presently being developed.
25  C     \==========================================================/  C     \==========================================================/
26        IMPLICIT NONE        IMPLICIT NONE
27  C  C
 C     Call Tree  
 C     =========  
 C      
 C      main ( eesupp )  
 C       |  
 C       .  
 C       .  
 C       . Generic environment initialisation ( see eesupp/src and  
 C       .                                      eesupp/inc )        
 C       . multiple threads and/or processes are created in here  
 C       .  
 C       .  
 C       .  
 C       |  
 C       |-THE_MODEL_MAIN - Begin specific model. One instance  
 C       |  |               of this codes exists for each thread  
 C       |  |               and/or instance. Each instance manages  
 C       |  |               a specifc set of tiles.                
 C       |  |  
 C       |  |--INITIALISE_FIXED  
 C       |  |   o Set model configuration (fixed arrays)  
 C       |  |     Topography, hydrography, timestep, grid, etc..  
 C       |  |  
 C       |  |--THE_MAIN_LOOP  
 C       |  |  |  
 C       |  |  |--INITIALISE_VARIA  
 C       |  |  |   o Set initial conditions (variable arrays)  
 C       |  |  |  
 C  ==>  |  |  | ** Time stepping loop starts here **  
 C  |    |  |  |  
 C /|\   |  |  |  
 C  |    |  |  |--FORWARD_STEP  
 C /|\   |  |  |  |  o Does a single forward step of the model  
 C  |    |  |  |  |  
 C /|\   |  |  |  |  
 C  |    |  |  |  |--LOAD_EXTERNAL_DATA  
 C /|\   |  |  |  |   o Load and/or set time dependent forcing fields  
 C  |    |  |  |  |  
 C /|\   |  |  |  |--DYNAMICS  
 C  |    |  |  |  |   o Evaluate "forward" terms  
 C /|\   |  |  |  |  
 C  |    |  |  |  |--SOLVE_FOR_PRESSURE  
 C /|\   |  |  |  |   o Find pressure field to keep flow non-divergent  
 C  |    |  |  |  |  
 C /|\   |  |  |  |--THE_CORRECTION_STEP  
 C  |    |  |  |  |   o Correct flow field with and cycle time-stepping arrays  
 C /|\   |  |  |  |  
 C  |    |  |  |  |--DO_GTERM_BLOCKING_EXCHANGES  
 C /|\   |  |  |  |   o Update overlap regions  
 C  |    |  |  |  |  
 C /|\   |  |  |  |--DO_THE_MODEL_IO  
 C  |    |  |  |  |   o Write model state  
 C /|\   |  |  |  |  
 C  |    |  |  |  |--WRITE_CHECKPOINT  
 C /|\   |  |  |  |   o Write restart file(s)  
 C  |    |  |  |  
 C /|\   |  |  |  
 C  |<== |  |  | ** Time stepping loop finishes here **  
 C       |  |  |  
 C       |  |  |--  
 C       |  |  
 C       |  |--WRITE_STATE  
 C       |  |--WRITE_CHECKPOINT  
 C       |  
 C       .  
 C       .  
 C       . Generic environment termination ( see eesupp/src and  
 C       .                                      eesupp/inc )        
 C       .  
 C       .  
   
28  C     == Global variables ===  C     == Global variables ===
29  #include "SIZE.h"  #include "SIZE.h"
30  #include "EEPARAMS.h"  #include "EEPARAMS.h"
# Line 138  C--   Set model configuration (fixed arr Line 67  C--   Set model configuration (fixed arr
67        myCurrentTime = startTime        myCurrentTime = startTime
68        myCurrentIter = nIter0        myCurrentIter = nIter0
69    
70  #ifdef ALLOW_MIT_ADJOINT_RUN  #if ( defined (ALLOW_ADJOINT_RUN) || \
71          defined (ALLOW_GRADIENT_CHECK) || \
72          defined (ALLOW_ECCO_OPTIMIZATION) )
73    
74        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
75        IF (myProcId .eq. 0) THEN        IF (myProcId .eq. 0) THEN
# Line 149  C--   Set model configuration (fixed arr Line 80  C--   Set model configuration (fixed arr
80    
81        fc   = 0.0        fc   = 0.0
82        adfc = 1.0        adfc = 1.0
83        CALL TIMER_START('ADTHE_MAIN_SENS          [ADJOINT RUN]', mythid)        CALL TIMER_START('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)
84        call ADTHE_MAIN_SENS ( mythid )        CALL ADTHE_MAIN_LOOP ( mythid )
85        call TIMER_STOP ('ADTHE_MAIN_SENS          [ADJOINT RUN]', mythid)        CALL TIMER_STOP ('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)
86        _BARRIER        _BARRIER
87    
88        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
# Line 161  C--   Set model configuration (fixed arr Line 92  C--   Set model configuration (fixed arr
92        _END_MASTER( mythid )        _END_MASTER( mythid )
93        _BARRIER        _BARRIER
94    
95  #else /* ALLOW_MIT_ADJOINT_RUN undef */  #ifdef ALLOW_GRADIENT_CHECK
96          if (useGrdchk) then
97             CALL TIMER_START('GRDCHK_MAIN          [ADJOINT RUN]', mythid)
98             CALL GRDCHK_MAIN( mythid )
99             CALL TIMER_STOP ('GRDCHK_MAIN          [ADJOINT RUN]', mythid)
100             _BARRIER
101          end if
102    #endif
103    
104    #else /* ALLOW_ADJOINT_RUN undef */
105    
106  C--   Call time stepping loop of full model  C--   Call time stepping loop of full model
107        CALL TIMER_START('THE_MAIN_LOOP      [THE_MODEL_MAIN]',myThid)        CALL TIMER_START('THE_MAIN_LOOP      [THE_MODEL_MAIN]',myThid)
108        CALL THE_MAIN_SENS(myCurrentTime, myCurrentIter, myThid )        CALL THE_MAIN_LOOP(myCurrentTime, myCurrentIter, myThid )
109        CALL TIMER_STOP ('THE_MAIN_LOOP      [THE_MODEL_MAIN]',myThid)        CALL TIMER_STOP ('THE_MAIN_LOOP      [THE_MODEL_MAIN]',myThid)
110    
111  #endif /* ALLOW_MIT_ADJOINT_RUN */  #endif /* ALLOW_ADJOINT_RUN */
112    
113    C--   Final checkpoint (incase the in-loop checkpoint was missed)
114          CALL TIMER_START('WRITE_CHECKPOINT   [THE_MODEL_MAIN]',myThid)
115          CALL WRITE_CHECKPOINT(
116         &        .TRUE., myCurrentTime, myCurrentIter, myThid )
117          CALL TIMER_STOP ('WRITE_CHECKPOINT   [THE_MODEL_MAIN]',myThid)
118    
119        CALL TIMER_STOP ('ALL                [THE_MODEL_MAIN]',myThid)        CALL TIMER_STOP ('ALL                [THE_MODEL_MAIN]',myThid)
120    

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.40

  ViewVC Help
Powered by ViewVC 1.1.22