/[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.87 by heimbach, Wed Jan 26 14:39:20 2005 UTC revision 1.106 by jmc, Thu Oct 15 00:38:21 2009 UTC
# Line 34  C  : Line 34  C  :
34  C  |  C  |
35  C  |-THE_MODEL_MAIN :: Primary driver for the MITgcm algorithm  C  |-THE_MODEL_MAIN :: Primary driver for the MITgcm algorithm
36  C    |              :: Called from WRAPPER level numerical  C    |              :: Called from WRAPPER level numerical
37  C    |              :: code innvocation routine. On entry  C    |              :: code invocation routine. On entry
38  C    |              :: to THE_MODEL_MAIN separate thread and  C    |              :: to THE_MODEL_MAIN separate thread and
39  C    |              :: separate processes will have been established.  C    |              :: separate processes will have been established.
40  C    |              :: Each thread and process will have a unique ID  C    |              :: Each thread and process will have a unique ID
# Line 43  C    |              :: specific region i Line 43  C    |              :: specific region i
43  C    |  C    |
44  C    |-INITIALISE_FIXED :: Set fixed model arrays such as topography,  C    |-INITIALISE_FIXED :: Set fixed model arrays such as topography,
45  C    | |                :: grid, solver matrices etc..  C    | |                :: grid, solver matrices etc..
46  C    | |                C    | |
47  C    | |-INI_PARMS :: Routine to set kernel model parameters.  C    | |-INI_PARMS :: Routine to set kernel model parameters.
48  C    | |           :: By default kernel parameters are read from file  C    | |           :: By default kernel parameters are read from file
49  C    | |           :: "data" in directory in which code executes.  C    | |           :: "data" in directory in which code executes.
50  C    | |  C    | |
51  C    | |-MON_INIT :: Initialises monitor pacakge ( see pkg/monitor )  C    | |-MON_INIT :: Initializes monitor package ( see pkg/monitor )
52  C    | |  C    | |
53  C    | |-INI_GRID :: Control grid array (vert. and hori.) initialisation.  C    | |-INI_GRID :: Control grid array (vert. and hori.) initialization.
54  C    | | |        :: Grid arrays are held and described in GRID.h.  C    | | |        :: Grid arrays are held and described in GRID.h.
55  C    | | |  C    | | |
56  C    | | |-INI_VERTICAL_GRID        :: Initialise vertical grid arrays.  C    | | |-INI_VERTICAL_GRID        :: Initialize vertical grid arrays.
57  C    | | |  C    | | |
58  C    | | |-INI_CARTESIAN_GRID       :: Cartesian horiz. grid initialisation  C    | | |-INI_CARTESIAN_GRID       :: Cartesian horiz. grid initialization
59  C    | | |                          :: (calculate grid from kernel parameters).  C    | | |                          :: (calculate grid from kernel parameters).
60  C    | | |  C    | | |
61  C    | | |-INI_SPHERICAL_POLAR_GRID :: Spherical polar horiz. grid  C    | | |-INI_SPHERICAL_POLAR_GRID :: Spherical polar horiz. grid
62  C    | | |                          :: initialisation (calculate grid from  C    | | |                          :: initialization (calculate grid from
63  C    | | |                          :: kernel parameters).  C    | | |                          :: kernel parameters).
64  C    | | |  C    | | |
65  C    | | |-INI_CURVILINEAR_GRID     :: General orthogonal, structured horiz.  C    | | |-INI_CURVILINEAR_GRID     :: General orthogonal, structured horiz.
66  C    | |                            :: grid initialisations. ( input from raw  C    | |                            :: grid initializations. ( input from raw
67  C    | |                            :: grid files, LONC.bin, DXF.bin etc... )  C    | |                            :: grid files, LONC.bin, DXF.bin etc... )
68  C    | |  C    | |
69  C    | |-INI_DEPTHS    :: Read (from "bathyFile") or set bathymetry/orgography.  C    | |-INI_DEPTHS    :: Read (from "bathyFile") or set bathymetry/orgography.
# Line 74  C    | | Line 74  C    | |
74  C    | |-INI_LINEAR_PHSURF :: Set ref. surface Bo_surf  C    | |-INI_LINEAR_PHSURF :: Set ref. surface Bo_surf
75  C    | |  C    | |
76  C    | |-INI_CORI          :: Set coriolis term. zero, f-plane, beta-plane,  C    | |-INI_CORI          :: Set coriolis term. zero, f-plane, beta-plane,
77  C    | |                   :: sphere optins are coded.  C    | |                   :: sphere options are coded.
78  C    | |  C    | |
79  C    | |-PACAKGES_BOOT      :: Start up the optional package environment.  C    | |-PACAKGES_BOOT      :: Start up the optional package environment.
80  C    | |                    :: Runtime selection of active packages.  C    | |                    :: Runtime selection of active packages.
# Line 107  C    | | |-GCHEM_INIT_FIXED    :: tracer Line 107  C    | | |-GCHEM_INIT_FIXED    :: tracer
107  C    | |  C    | |
108  C    | |-ZONAL_FILT_INIT       :: FFT filter Package. see pkg/zonal_filt  C    | |-ZONAL_FILT_INIT       :: FFT filter Package. see pkg/zonal_filt
109  C    | |  C    | |
110  C    | |-INI_CG2D              :: 2d con. grad solver initialisation.  C    | |-INI_CG2D              :: 2d con. grad solver initialization.
111  C    | |  C    | |
112  C    | |-INI_CG3D              :: 3d con. grad solver initialisation.  C    | |-INI_CG3D              :: 3d con. grad solver initialization.
113  C    | |  C    | |
114  C    | |-CONFIG_SUMMARY        :: Provide synopsis of kernel setup.  C    | |-CONFIG_SUMMARY        :: Provide synopsis of kernel setup.
115  C    |                         :: Includes annotated table of kernel  C    |                         :: Includes annotated table of kernel
# Line 118  C    | Line 118  C    |
118  C    |-CTRL_UNPACK :: Control vector support package. see pkg/ctrl  C    |-CTRL_UNPACK :: Control vector support package. see pkg/ctrl
119  C    |  C    |
120  C    |-ADTHE_MAIN_LOOP :: Derivative evaluating form of main time stepping loop  C    |-ADTHE_MAIN_LOOP :: Derivative evaluating form of main time stepping loop
121  C    !                 :: Auotmatically gerenrated by TAMC/TAF.  C    !                 :: Auotmatically generated by TAMC/TAF.
122  C    |  C    |
123  C    |-CTRL_PACK   :: Control vector support package. see pkg/ctrl  C    |-CTRL_PACK   :: Control vector support package. see pkg/ctrl
124  C    |  C    |
# Line 132  C    | | | Line 132  C    | | |
132  C    | | |-INI_LINEAR_PHISURF :: Set ref. surface Bo_surf  C    | | |-INI_LINEAR_PHISURF :: Set ref. surface Bo_surf
133  C    | | |  C    | | |
134  C    | | |-INI_CORI     :: Set coriolis term. zero, f-plane, beta-plane,  C    | | |-INI_CORI     :: Set coriolis term. zero, f-plane, beta-plane,
135  C    | | |              :: sphere optins are coded.  C    | | |              :: sphere options are coded.
136  C    | | |  C    | | |
137  C    | | |-INI_CG2D     :: 2d con. grad solver initialisation.  C    | | |-INI_CG2D     :: 2d con. grad solver initialization.
138  C    | | |-INI_CG3D     :: 3d con. grad solver initialisation.  C    | | |-INI_CG3D     :: 3d con. grad solver initialization.
139  C    | | |-INI_MIXING   :: Initialise diapycnal diffusivity.  C    | | |-INI_MIXING   :: Initialize diapycnal diffusivity.
140  C    | | |-INI_DYNVARS  :: Initialise to zero all DYNVARS.h arrays (dynamical  C    | | |-INI_DYNVARS  :: Initialize to zero all DYNVARS.h arrays (dynamical
141  C    | | |              :: fields).  C    | | |              :: fields).
142  C    | | |  C    | | |
143  C    | | |-INI_FIELDS   :: Control initialising model fields to non-zero  C    | | |-INI_FIELDS   :: Control initializing model fields to non-zero
144  C    | | | |-INI_VEL    :: Initialize 3D flow field.  C    | | | |-INI_VEL    :: Initialize 3D flow field.
145  C    | | | |-INI_THETA  :: Set model initial temperature field.  C    | | | |-INI_THETA  :: Set model initial temperature field.
146  C    | | | |-INI_SALT   :: Set model initial salinity field.  C    | | | |-INI_SALT   :: Set model initial salinity field.
# Line 163  C    | | | |-CONVECTIVE_ADJUSTMENT :: Co Line 163  C    | | | |-CONVECTIVE_ADJUSTMENT :: Co
163  C    | | | | |-FIND_RHO  :: Find adjacent densities.  C    | | | | |-FIND_RHO  :: Find adjacent densities.
164  C    | | | | |-CONVECT   :: Mix static instability.  C    | | | | |-CONVECT   :: Mix static instability.
165  C    | | | | |-TIMEAVE_CUMULATE :: Update convection statistics.  C    | | | | |-TIMEAVE_CUMULATE :: Update convection statistics.
166  C    | | | |  C    | | | |
167  C    | | | |-CALC_EXACT_ETA        :: Change SSH to flow divergence.      C    | | | |-CALC_EXACT_ETA        :: Change SSH to flow divergence.
168  C    | | |  C    | | |
169  C    | | |-CONVECTIVE_ADJUSTMENT_INI :: Control static instability mixing  C    | | |-CONVECTIVE_ADJUSTMENT_INI :: Control static instability mixing
170  C    | | | |                         :: Extra time history interactions.  C    | | | |                         :: Extra time history interactions.
171  C    | | | |                        C    | | | |
172  C    | | | |-FIND_RHO  :: Find adjacent densities.  C    | | | |-FIND_RHO  :: Find adjacent densities.
173  C    | | | |-CONVECT   :: Mix static instability.  C    | | | |-CONVECT   :: Mix static instability.
174  C    | | | |-TIMEAVE_CUMULATE :: Update convection statistics.  C    | | | |-TIMEAVE_CUMULATE :: Update convection statistics.
175  C    | | |  C    | | |
176  C    | | |-PACKAGES_INIT_VARIABLES :: Does initialisation of time evolving  C    | | |-PACKAGES_INIT_VARIABLES :: Does initialization of time evolving
177  C    | | | |                       :: package data.  C    | | | |                       :: package data.
178  C    | | | |  C    | | | |
179  C    | | | |-GMREDI_INIT          :: GM package. ( see pkg/gmredi )  C    | | | |-GMREDI_INIT          :: GM package. ( see pkg/gmredi )
180  C    | | | |-KPP_INIT             :: KPP package. ( see pkg/kpp )  C    | | | |-KPP_INIT             :: KPP package. ( see pkg/kpp )
181  C    | | | |-KPP_OPEN_DIAGS      C    | | | |-KPP_OPEN_DIAGS
182  C    | | | |-OBCS_INIT_VARIABLES  :: Open bndy. package. ( see pkg/obcs )  C    | | | |-OBCS_INIT_VARIABLES  :: Open bndy. package. ( see pkg/obcs )
183  C    | | | |-PTRACERS_INIT        :: multi. tracer package,(see pkg/ptracers)  C    | | | |-PTRACERS_INIT        :: multi. tracer package,(see pkg/ptracers)
184  C    | | | |-GCHEM_INIT           : : tracer interface pkg (see pkh/gchem)  C    | | | |-GCHEM_INIT           :: tracer interface pkg (see pkh/gchem)
185  C    | | | |-AIM_INIT             :: Interm. atmos package. ( see pkg/aim )  C    | | | |-AIM_INIT             :: Interm. atmos package. ( see pkg/aim )
186  C    | | | |-CTRL_MAP_INI         :: Control vector package.( see pkg/ctrl )  C    | | | |-CTRL_MAP_INI         :: Control vector package.( see pkg/ctrl )
187  C    | | | |-COST_INIT            :: Cost function package. ( see pkg/cost )  C    | | | |-COST_INIT            :: Cost function package. ( see pkg/cost )
# Line 220  C/\  | | |-CALC_EXACT_ETA :: Change SSH Line 220  C/\  | | |-CALC_EXACT_ETA :: Change SSH
220  C/\  | | |-CALC_SURF_DR   :: Calculate the new surface level thickness.  C/\  | | |-CALC_SURF_DR   :: Calculate the new surface level thickness.
221  C/\  | | |-EXF_GETFORCING :: External forcing package. ( pkg/exf )  C/\  | | |-EXF_GETFORCING :: External forcing package. ( pkg/exf )
222  C/\  | | |-EXTERNAL_FIELDS_LOAD :: Control loading time dep. external data.  C/\  | | |-EXTERNAL_FIELDS_LOAD :: Control loading time dep. external data.
223  C/\  | | | |                    :: Simple interpolcation between end-points  C/\  | | | |                    :: Simple interpolation between end-points
224  C/\  | | | |                    :: for forcing datasets.  C/\  | | | |                    :: for forcing datasets.
225  C/\  | | | |                    C/\  | | | |
226  C/\  | | | |-EXCH :: Sync forcing. in overlap regions.  C/\  | | | |-EXCH :: Sync forcing. in overlap regions.
227  C/\  | | |-SEAICE_MODEL   :: Compute sea-ice terms. ( pkg/seaice )  C/\  | | |-SEAICE_MODEL   :: Compute sea-ice terms. ( pkg/seaice )
228  C/\  | | |-FREEZE         :: Limit surface temperature.  C/\  | | |-FREEZE         :: Limit surface temperature.
# Line 280  C/\  | | | |-TIMESTEP_TRACER      :: Ste Line 280  C/\  | | | |-TIMESTEP_TRACER      :: Ste
280  C/\  | | | |  C/\  | | | |
281  C/\  | | | |-TIMESTEP_TRACER      :: Step tracer field forward in time  C/\  | | | |-TIMESTEP_TRACER      :: Step tracer field forward in time
282  C/\  | | | |  C/\  | | | |
283  C/\  | | | |-PTRACERS_INTEGRATE   :: Integrate other tracer(s) ( see pkg/ptracers ).  C/\  | | | |-PTRACERS_INTEGRATE   :: Integrate other tracer(s) (see pkg/ptracers).
284  C/\  | | | | |  C/\  | | | | |
285  C/\  | | | | |-GAD_CALC_RHS       :: Generalised advection package  C/\  | | | | |-GAD_CALC_RHS       :: Generalised advection package
286  C/\  | | | | | |                  :: ( see pkg/gad )  C/\  | | | | | |                  :: ( see pkg/gad )
# Line 288  C/\  | | | | | |-KPP_TRANSPORT_PTR:: KPP Line 288  C/\  | | | | | |-KPP_TRANSPORT_PTR:: KPP
288  C/\  | | | | |  C/\  | | | | |
289  C/\  | | | | |-PTRACERS_FORCING   :: Problem specific forcing for tracer.  C/\  | | | | |-PTRACERS_FORCING   :: Problem specific forcing for tracer.
290  C/\  | | | | |-GCHEM_FORCING_INT  :: tracer forcing for gchem pkg (if all  C/\  | | | | |-GCHEM_FORCING_INT  :: tracer forcing for gchem pkg (if all
291  C/\  | | | | |                       tendancy terms calcualted together)  C/\  | | | | |                       tendency terms calcualted together)
292  C/\  | | | | |-ADAMS_BASHFORTH2   :: Extrapolate tendencies forward in time.  C/\  | | | | |-ADAMS_BASHFORTH2   :: Extrapolate tendencies forward in time.
293  C/\  | | | | |-FREESURF_RESCALE_G :: Re-scale Gs for free-surface height.  C/\  | | | | |-FREESURF_RESCALE_G :: Re-scale Gs for free-surface height.
294  C/\  | | | | |-TIMESTEP_TRACER    :: Step tracer field forward in time  C/\  | | | | |-TIMESTEP_TRACER    :: Step tracer field forward in time
# Line 307  C/\  | | | |-CALC_GRAD_PHI_SURF :: Calcu Line 307  C/\  | | | |-CALC_GRAD_PHI_SURF :: Calcu
307  C/\  | | | |                       Potential anomaly.  C/\  | | | |                       Potential anomaly.
308  C/\  | | | |-CALC_VISCOSITY     :: Calculate net vertical viscosity  C/\  | | | |-CALC_VISCOSITY     :: Calculate net vertical viscosity
309  C/\  | | | | |-KPP_CALC_VISC    :: KPP package ( see pkg/kpp ).  C/\  | | | | |-KPP_CALC_VISC    :: KPP package ( see pkg/kpp ).
310  C/\  | | | |                                                        C/\  | | | |
311  C/\  | | | |-CALC_PHI_HYD       :: Integrate the hydrostatic relation.  C/\  | | | |-CALC_PHI_HYD       :: Integrate the hydrostatic relation.
312  C/\  | | | |-MOM_FLUXFORM       :: Flux form mom eqn. package ( see  C/\  | | | |-MOM_FLUXFORM       :: Flux form mom eqn. package ( see
313  C/\  | | | |                       pkg/mom_fluxform ).  C/\  | | | |                       pkg/mom_fluxform ).
314    C/\  | | | | |-MOM_CALC_VISC    :: Calculate Horizontal Viscosities
315  C/\  | | | |-MOM_VECINV         :: Vector invariant form mom eqn. package ( see  C/\  | | | |-MOM_VECINV         :: Vector invariant form mom eqn. package ( see
316  C/\  | | | |                       pkg/mom_vecinv   ).  C/\  | | | |                       pkg/mom_vecinv   ).
317    C/\  | | | | |-MOM_CALC_VISC    :: Calculate Horizontal Viscosities
318  C/\  | | | |-TIMESTEP           :: Step momentum fields forward in time  C/\  | | | |-TIMESTEP           :: Step momentum fields forward in time
319  C/\  | | | |-OBCS_APPLY_UV      :: Open bndy. package (see pkg/obcs ).  C/\  | | | |-OBCS_APPLY_UV      :: Open bndy. package (see pkg/obcs ).
320  C/\  | | | |  C/\  | | | |
# Line 347  C/\  | | | | |-FIND_RHO  :: Find adjacen Line 349  C/\  | | | | |-FIND_RHO  :: Find adjacen
349  C/\  | | | | |-CONVECT   :: Mix static instability.  C/\  | | | | |-CONVECT   :: Mix static instability.
350  C/\  | | | | |-TIMEAVE_CUMULATE :: Update convection statistics.  C/\  | | | | |-TIMEAVE_CUMULATE :: Update convection statistics.
351  C/\  | | | |  C/\  | | | |
352  C/\  | | | |-CALC_EXACT_ETA        :: Change SSH to flow divergence.      C/\  | | | |-CALC_EXACT_ETA        :: Change SSH to flow divergence.
353  C/\  | | |  C/\  | | |
354  C/\  | | |-DO_FIELDS_BLOCKING_EXCHANGES :: Sync up overlap regions.  C/\  | | |-DO_FIELDS_BLOCKING_EXCHANGES :: Sync up overlap regions.
355  C/\  | | | |-EXCH                                                    C/\  | | | |-EXCH
356  C/\  | | |  C/\  | | |
357  C/\  | | |-GCHEM_FORCING_SEP :: tracer forcing for gchem pkg (if  C/\  | | |-GCHEM_FORCING_SEP :: tracer forcing for gchem pkg (if
358  C/\  | | |                      tracer dependent tendencies calculated  C/\  | | |                      tracer dependent tendencies calculated
# Line 387  C    |-TIMER_PRINTALL :: Computational t Line 389  C    |-TIMER_PRINTALL :: Computational t
389  C    |  C    |
390  C    |-COMM_STATS     :: Summarise inter-proc and inter-thread communication  C    |-COMM_STATS     :: Summarise inter-proc and inter-thread communication
391  C                     :: events.  C                     :: events.
392    C
393  C \ev  C \ev
394  C  C
395  C  C
# Line 407  C     !INTERFACE: Line 410  C     !INTERFACE:
410    
411  C     !DESCRIPTION: \bv  C     !DESCRIPTION: \bv
412  C     *==========================================================*  C     *==========================================================*
413  C     | SUBROUTINE THE_MODEL_MAIN                                  C     | SUBROUTINE THE_MODEL_MAIN
414  C     | o Master controlling routine for model using the MITgcm    C     | o Master controlling routine for model using the MITgcm
415  C     |   UV parallel wrapper.                                      C     |   UV parallel wrapper.
416  C     *==========================================================*  C     *==========================================================*
417  C     | THE_MODEL_MAIN is invoked by the MITgcm UV parallel        C     | THE_MODEL_MAIN is invoked by the MITgcm UV parallel
418  C     | wrapper with a single integer argument "myThid". This      C     | wrapper with a single integer argument "myThid". This
419  C     | variable identifies the thread number of an instance of    C     | variable identifies the thread number of an instance of
420  C     | THE_MODEL_MAIN. Each instance of THE_MODEL_MAIN works      C     | THE_MODEL_MAIN. Each instance of THE_MODEL_MAIN works
421  C     | on a particular region of the models domain and            C     | on a particular region of the models domain and
422  C     | synchronises with other instances as necessary. The        C     | synchronises with other instances as necessary. The
423  C     | routine has to "understand" the MITgcm parallel            C     | routine has to "understand" the MITgcm parallel
424  C     | environment and the numerical algorithm. Editing this      C     | environment and the numerical algorithm. Editing this
425  C     | routine is best done with some knowledge of both aspects.  C     | routine is best done with some knowledge of both aspects.
426  C     | Notes                                                      C     | Notes
427  C     | =====                                                      C     | =====
428  C     | C*P* comments indicating place holders for which code is    C     | C*P* comments indicating place holders for which code is
429  C     |      presently being developed.                            C     |      presently being developed.
430  C     *==========================================================*  C     *==========================================================*
431  C     \ev  C     \ev
432    
# Line 459  C     == Global variables === Line 462  C     == Global variables ===
462  #include "EEPARAMS.h"  #include "EEPARAMS.h"
463  #include "PARAMS.h"  #include "PARAMS.h"
464  #include "DYNVARS.h"  #include "DYNVARS.h"
 #ifdef ALLOW_NONHYDROSTATIC  
 # include "CG3D.h"  
 #endif  
465    
466  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
467  # include "tamc.h"  # include "tamc.h"
468  #endif  #endif
469  #ifdef ALLOW_CTRL  #ifdef ALLOW_CTRL
470    # include "ctrl.h"
471  # include "optim.h"  # include "optim.h"
472  #endif  #endif
473    
474  C     !INPUT/OUTPUT PARAMETERS:  C     !INPUT/OUTPUT PARAMETERS:
475  C     == Routine arguments ==  C     == Routine arguments ==
476  C     myThid - Thread number for this instance of the routine.  C     myThid - Thread number for this instance of the routine.
477        INTEGER myThid          INTEGER myThid
478    
479  C     !LOCAL VARIABLES:  C     !LOCAL VARIABLES:
480  C     == Local variables ==  C     == Local variables ==
# Line 493  c--   set default: Line 494  c--   set default:
494        lastdiva = .TRUE.        lastdiva = .TRUE.
495    
496  #ifdef ALLOW_DEBUG  #ifdef ALLOW_DEBUG
497        IF (debugMode) CALL DEBUG_ENTER('THE_MODEL_MAIN',myThid)  C-    cannot test for debugMode which has not yet been set
498          CALL DEBUG_ENTER('THE_MODEL_MAIN',myThid)
499  #endif  #endif
500    
501    #if defined(USE_PAPI) || defined(USE_PCL_FLOPS_SFP) || defined(USE_PCL_FLOPS) || defined(USE_PCL)
502          CALL TIMER_CONTROL('','INIT','THE_MODEL_MAIN',myThid)
503    #endif
504  C--   This timer encompasses the whole code  C--   This timer encompasses the whole code
505        CALL TIMER_START('ALL                    [THE_MODEL_MAIN]',myThid)        CALL TIMER_START('ALL                    [THE_MODEL_MAIN]',myThid)
506    
507  #ifdef ALLOW_DEBUG  #ifdef ALLOW_DEBUG
508        IF (debugMode) CALL DEBUG_CALL('INITIALISE_FIXED',myThid)  C-    cannot test for debugMode which has not yet been set
509          CALL DEBUG_CALL('INITIALISE_FIXED',myThid)
510  #endif  #endif
511    
512  C--   Set model configuration (fixed arrays)  C--   Set model configuration (fixed arrays)
# Line 508  C--   Set model configuration (fixed arr Line 514  C--   Set model configuration (fixed arr
514        CALL INITIALISE_FIXED( myThid )        CALL INITIALISE_FIXED( myThid )
515        CALL TIMER_STOP ('INITIALISE_FIXED       [THE_MODEL_MAIN]',myThid)        CALL TIMER_STOP ('INITIALISE_FIXED       [THE_MODEL_MAIN]',myThid)
516    
517    #ifdef ALLOW_DEBUG
518          IF (debugMode) CALL DEBUG_LEAVE('INITIALISE_FIXED',myThid)
519    #endif
520    
521        myCurrentTime = startTime        myCurrentTime = startTime
522        myCurrentIter = nIter0        myCurrentIter = nIter0
523    
# Line 521  c Line 531  c
531        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
532        IF (myProcId .eq. 0) THEN        IF (myProcId .eq. 0) THEN
533           inquire( file='costfinal', exist=exst )           inquire( file='costfinal', exist=exst )
534           IF ( .NOT. exst .AND. niter0 .EQ. 0 ) THEN           IF ( .NOT. exst ) THEN
535              IF ( optimcycle.NE.0 ) THEN              IF ( optimcycle.NE.0 .AND. doMainUnpack ) THEN
536                 CALL TIMER_START('CTRL_UNPACK   [THE_MODEL_MAIN]',mythid)                 CALL TIMER_START('CTRL_UNPACK   [THE_MODEL_MAIN]',mythid)
537                 CALL CTRL_UNPACK( .TRUE. , mythid )                 CALL CTRL_UNPACK( .TRUE. , mythid )
538                 CALL TIMER_STOP ('CTRL_UNPACK   [THE_MODEL_MAIN]',mythid)                 CALL TIMER_STOP ('CTRL_UNPACK   [THE_MODEL_MAIN]',mythid)
# Line 540  c Line 550  c
550    
551  # if ( defined (ALLOW_TANGENTLINEAR_RUN) )  # if ( defined (ALLOW_TANGENTLINEAR_RUN) )
552  c  c
553    #ifdef ALLOW_DEBUG
554          IF (debugMode) CALL DEBUG_CALL('G_THE_MAIN_LOOP',myThid)
555    #endif
556        CALL TIMER_START('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)        CALL TIMER_START('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)
557        CALL G_THE_MAIN_LOOP ( myCurrentTime, myCurrentIter, myThid )        CALL G_THE_MAIN_LOOP ( myCurrentTime, myCurrentIter, myThid )
558        CALL TIMER_STOP ('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)        CALL TIMER_STOP ('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)
# Line 551  c Line 564  c
564  c-- The following assumes the TAF option '-pure'  c-- The following assumes the TAF option '-pure'
565        inquire( file='costfinal', exist=exst )        inquire( file='costfinal', exist=exst )
566        IF ( .NOT. exst) THEN        IF ( .NOT. exst) THEN
567    #ifdef ALLOW_DEBUG
568             IF (debugMode) CALL DEBUG_CALL('MDTHE_MAIN_LOOP',myThid)
569    #endif
570           CALL TIMER_START('MDTHE_MAIN_LOOP            [MD RUN]', mythid)           CALL TIMER_START('MDTHE_MAIN_LOOP            [MD RUN]', mythid)
571           CALL MDTHE_MAIN_LOOP ( myCurrentTime, myCurrentIter, mythid )           CALL MDTHE_MAIN_LOOP ( myCurrentTime, myCurrentIter, mythid )
572           CALL TIMER_STOP ('MDTHE_MAIN_LOOP            [MD RUN]', mythid)           CALL TIMER_STOP ('MDTHE_MAIN_LOOP            [MD RUN]', mythid)
573           CALL COST_FINAL_STORE ( mythid, lastdiva )           CALL COST_FINAL_STORE ( mythid, lastdiva )
574        ELSE        ELSE
575    #ifdef ALLOW_DEBUG
576             IF (debugMode) CALL DEBUG_CALL('ADTHE_MAIN_LOOP',myThid)
577    #endif
578           CALL TIMER_START('ADTHE_MAIN_LOOP       [ADJOINT RUN]', mythid)           CALL TIMER_START('ADTHE_MAIN_LOOP       [ADJOINT RUN]', mythid)
579           CALL ADTHE_MAIN_LOOP ( myCurrentTime, myCurrentIter, mythid )           CALL ADTHE_MAIN_LOOP (  mythid )
580           CALL TIMER_STOP ('ADTHE_MAIN_LOOP       [ADJOINT RUN]', mythid)           CALL TIMER_STOP ('ADTHE_MAIN_LOOP       [ADJOINT RUN]', mythid)
581           CALL COST_FINAL_RESTORE ( mythid, lastdiva )           CALL COST_FINAL_RESTORE ( mythid, lastdiva )
582        ENDIF        ENDIF
583  c--  c--
584  #  else /* ALLOW_DIVIDED_ADJOINT undef */  #  else /* ALLOW_DIVIDED_ADJOINT undef */
585    #ifdef ALLOW_DEBUG
586          IF (debugMode) CALL DEBUG_CALL('ADTHE_MAIN_LOOP',myThid)
587    #endif
588        CALL TIMER_START('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)        CALL TIMER_START('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)
589        CALL ADTHE_MAIN_LOOP ( myCurrentTime, myCurrentIter, mythid )  #ifdef ALLOW_ECCO
590  cph      CALL ADTHE_MAIN_LOOP ( mythid )        CALL ADTHE_MAIN_LOOP ( myCurrentTime, mythid )
591    #else
592          CALL ADTHE_MAIN_LOOP ( mythid )
593    #endif
594        CALL TIMER_STOP ('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)        CALL TIMER_STOP ('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)
595  #  endif /* ALLOW_DIVIDED_ADJOINT */  #  endif /* ALLOW_DIVIDED_ADJOINT */
596  c  c
# Line 575  c Line 600  c
600        IF (debugMode) CALL DEBUG_CALL('THE_MAIN_LOOP',myThid)        IF (debugMode) CALL DEBUG_CALL('THE_MAIN_LOOP',myThid)
601  #endif  #endif
602  C--   Call time stepping loop of full model  C--   Call time stepping loop of full model
603    #ifdef ALLOW_DEBUG
604          IF (debugMode) CALL DEBUG_CALL('THE_MAIN_LOOP',myThid)
605    #endif
606        CALL TIMER_START('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)        CALL TIMER_START('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)
607        CALL THE_MAIN_LOOP( myCurrentTime, myCurrentIter, myThid )        CALL THE_MAIN_LOOP( myCurrentTime, myCurrentIter, myThid )
608        CALL TIMER_STOP ('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)        CALL TIMER_STOP ('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)
# Line 583  C--   Call time stepping loop of full mo Line 611  C--   Call time stepping loop of full mo
611    
612  # ifndef EXCLUDE_CTRL_PACK  # ifndef EXCLUDE_CTRL_PACK
613        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
614        IF ( myProcId .eq. 0 .AND. lastdiva ) THEN        IF ( myProcId .eq. 0 .AND. lastdiva .AND. doMainPack ) THEN
615           CALL TIMER_START('CTRL_PACK           [THE_MODEL_MAIN]',mythid)           CALL TIMER_START('CTRL_PACK           [THE_MODEL_MAIN]',mythid)
616           call CTRL_PACK( .FALSE. , mythid )           CALL CTRL_PACK( .FALSE. , mythid )
617           CALL TIMER_STOP ('CTRL_PACK           [THE_MODEL_MAIN]',mythid)           CALL TIMER_STOP ('CTRL_PACK           [THE_MODEL_MAIN]',mythid)
618           IF ( optimcycle.EQ.0 .AND. mycurrentiter.EQ.niter0 ) THEN           IF ( ( optimcycle.EQ.0 .OR. (.NOT. doMainUnpack) )
619         &        .AND. mycurrentiter.EQ.niter0 ) THEN
620              CALL TIMER_START('CTRL_PACK     [THE_MODEL_MAIN]',mythid)              CALL TIMER_START('CTRL_PACK     [THE_MODEL_MAIN]',mythid)
621              CALL CTRL_PACK( .TRUE. , mythid )              CALL CTRL_PACK( .TRUE. , mythid )
622              CALL TIMER_STOP ('CTRL_PACK     [THE_MODEL_MAIN]',mythid)              CALL TIMER_STOP ('CTRL_PACK     [THE_MODEL_MAIN]',mythid)
# Line 619  C--   Call time stepping loop of full mo Line 648  C--   Call time stepping loop of full mo
648    
649  #endif /* ALLOW_TANGENTLINEAR_RUN ALLOW_ADJOINT_RUN ALLOW_ADMTLM */  #endif /* ALLOW_TANGENTLINEAR_RUN ALLOW_ADJOINT_RUN ALLOW_ADMTLM */
650    
651  C--   Final checkpoint (in case the in-loop checkpoint was missed)  #ifdef ALLOW_DIAGNOSTICS
652        CALL TIMER_START('WRITE_CHECKPOINT       [THE_MODEL_MAIN]',myThid)        IF (useDiagnostics) THEN
653        CALL PACKAGES_WRITE_PICKUP(  C       Close all diagnostics output files
654       I        .TRUE., myCurrentTime, myCurrentIter, myThid )          CALL DIAGSTATS_CLOSE_IO( myThid )
655        CALL WRITE_CHECKPOINT(        ENDIF
656       I        .TRUE., myCurrentTime, myCurrentIter, myThid )  #endif
       CALL TIMER_STOP ('WRITE_CHECKPOINT       [THE_MODEL_MAIN]',myThid)  
   
       CALL TIMER_STOP ('ALL                    [THE_MODEL_MAIN]',myThid)  
657    
658  #ifdef ALLOW_MNC  #ifdef ALLOW_MNC
659        IF (useMNC) THEN        IF (useMNC) THEN
# Line 638  C       Close all open NetCDF files Line 664  C       Close all open NetCDF files
664        ENDIF        ENDIF
665  #endif  #endif
666    
667    C--   This timer encompasses the whole code
668          CALL TIMER_STOP ('ALL                    [THE_MODEL_MAIN]',myThid)
669    
670  C--   Write timer statistics  C--   Write timer statistics
671        IF ( myThid .EQ. 1 ) THEN        IF ( myThid .EQ. 1 ) THEN
672         CALL TIMER_PRINTALL( myThid )         CALL TIMER_PRINTALL( myThid )
673         CALL COMM_STATS         CALL COMM_STATS
674        ENDIF        ENDIF
675    
676    C--   Check threads synchronization :
677          CALL BAR_CHECK( 9, myThid )
678    
679  #ifdef ALLOW_DEBUG  #ifdef ALLOW_DEBUG
680        IF (debugMode) CALL DEBUG_LEAVE('THE_MODEL_MAIN',myThid)        IF (debugMode) CALL DEBUG_LEAVE('THE_MODEL_MAIN',myThid)
681  #endif  #endif

Legend:
Removed from v.1.87  
changed lines
  Added in v.1.106

  ViewVC Help
Powered by ViewVC 1.1.22