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" |
67 |
myCurrentTime = startTime |
myCurrentTime = startTime |
68 |
myCurrentIter = nIter0 |
myCurrentIter = nIter0 |
69 |
|
|
70 |
#ifdef ALLOW_MIT_ADJOINT_RUN |
#ifdef ALLOW_ADJOINT_RUN |
71 |
|
|
72 |
_BEGIN_MASTER( mythid ) |
_BEGIN_MASTER( mythid ) |
73 |
IF (myProcId .eq. 0) THEN |
IF (myProcId .eq. 0) THEN |
79 |
fc = 0.0 |
fc = 0.0 |
80 |
adfc = 1.0 |
adfc = 1.0 |
81 |
CALL TIMER_START('ADTHE_MAIN_LOOP [ADJOINT RUN]', mythid) |
CALL TIMER_START('ADTHE_MAIN_LOOP [ADJOINT RUN]', mythid) |
82 |
call ADTHE_MAIN_LOOP ( mythid ) |
CALL ADTHE_MAIN_LOOP ( mythid ) |
83 |
call TIMER_STOP ('ADTHE_MAIN_LOOP [ADJOINT RUN]', mythid) |
CALL TIMER_STOP ('ADTHE_MAIN_LOOP [ADJOINT RUN]', mythid) |
84 |
_BARRIER |
_BARRIER |
85 |
|
|
86 |
_BEGIN_MASTER( mythid ) |
_BEGIN_MASTER( mythid ) |
90 |
_END_MASTER( mythid ) |
_END_MASTER( mythid ) |
91 |
_BARRIER |
_BARRIER |
92 |
|
|
93 |
#else /* ALLOW_MIT_ADJOINT_RUN undef */ |
#ifdef ALLOW_GRADIENT_CHECK |
94 |
|
if (useGrdchk) then |
95 |
|
CALL TIMER_START('GRDCHK_MAIN [ADJOINT RUN]', mythid) |
96 |
|
CALL GRDCHK_MAIN( mythid ) |
97 |
|
CALL TIMER_STOP ('GRDCHK_MAIN [ADJOINT RUN]', mythid) |
98 |
|
_BARRIER |
99 |
|
end if |
100 |
|
#endif |
101 |
|
|
102 |
|
#else /* ALLOW_ADJOINT_RUN undef */ |
103 |
|
|
104 |
C-- Call time stepping loop of full model |
C-- Call time stepping loop of full model |
105 |
CALL TIMER_START('THE_MAIN_LOOP [THE_MODEL_MAIN]',myThid) |
CALL TIMER_START('THE_MAIN_LOOP [THE_MODEL_MAIN]',myThid) |
106 |
CALL THE_MAIN_LOOP(myCurrentTime, myCurrentIter, myThid ) |
CALL THE_MAIN_LOOP(myCurrentTime, myCurrentIter, myThid ) |
107 |
CALL TIMER_STOP ('THE_MAIN_LOOP [THE_MODEL_MAIN]',myThid) |
CALL TIMER_STOP ('THE_MAIN_LOOP [THE_MODEL_MAIN]',myThid) |
108 |
|
|
109 |
#endif /* ALLOW_MIT_ADJOINT_RUN */ |
#endif /* ALLOW_ADJOINT_RUN */ |
110 |
|
|
111 |
C-- Final checkpoint (incase the in-loop checkpoint was missed) |
C-- Final checkpoint (incase the in-loop checkpoint was missed) |
112 |
CALL TIMER_START('WRITE_CHECKPOINT [THE_MODEL_MAIN]',myThid) |
CALL TIMER_START('WRITE_CHECKPOINT [THE_MODEL_MAIN]',myThid) |