/[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.48 by dimitri, Sat Dec 28 10:11:10 2002 UTC revision 1.88 by heimbach, Wed Feb 23 21:15:59 2005 UTC
# Line 91  C    | | |-CTRL_INIT           :: Contro Line 91  C    | | |-CTRL_INIT           :: Contro
91  C    | | |-OPTIM_READPARMS     :: Optimisation support package. see pkg/ctrl  C    | | |-OPTIM_READPARMS     :: Optimisation support package. see pkg/ctrl
92  C    | | |-GRDCHK_READPARMS    :: Gradient check package. see pkg/grdchk  C    | | |-GRDCHK_READPARMS    :: Gradient check package. see pkg/grdchk
93  C    | | |-ECCO_READPARMS      :: ECCO Support Package. see pkg/ecco  C    | | |-ECCO_READPARMS      :: ECCO Support Package. see pkg/ecco
94    C    | | |-PTRACERS_READPARMS  :: multiple tracer package, see pkg/ptracers
95    C    | | |-GCHEM_READPARMS     :: tracer interface package, see pkg/gchem
96  C    | |  C    | |
97  C    | |-PACKAGES_CHECK  C    | |-PACKAGES_CHECK
98  C    | | |  C    | | |
# Line 101  C    | | Line 103  C    | |
103  C    | |-PACKAGES_INIT_FIXED  C    | |-PACKAGES_INIT_FIXED
104  C    | | |-OBCS_INIT_FIXED     :: Open bndy Package. see pkg/obcs  C    | | |-OBCS_INIT_FIXED     :: Open bndy Package. see pkg/obcs
105  C    | | |-FLT_INIT            :: Floats Package. see pkg/flt  C    | | |-FLT_INIT            :: Floats Package. see pkg/flt
106    C    | | |-GCHEM_INIT_FIXED    :: tracer interface pachage, see pkg/gchem
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    | |
# Line 143  C    | | | |-INI_THETA  :: Set model ini Line 146  C    | | | |-INI_THETA  :: Set model ini
146  C    | | | |-INI_SALT   :: Set model initial salinity field.  C    | | | |-INI_SALT   :: Set model initial salinity field.
147  C    | | | |-INI_PSURF  :: Set model initial free-surface height/pressure.  C    | | | |-INI_PSURF  :: Set model initial free-surface height/pressure.
148  C    | | | |-INI_PRESSURE :: Compute model initial hydrostatic pressure  C    | | | |-INI_PRESSURE :: Compute model initial hydrostatic pressure
149  C    | | |  C    | | | |-READ_CHECKPOINT :: Read the checkpoint
 C    | | |-INI_TR1      :: Set initial tracer 1 distribution.  
150  C    | | |  C    | | |
151  C    | | |-THE_CORRECTION_STEP :: Step forward to next time step.  C    | | |-THE_CORRECTION_STEP :: Step forward to next time step.
152  C    | | | |                   :: Here applied to move restart conditions  C    | | | |                   :: Here applied to move restart conditions
# Line 178  C    | | | |-GMREDI_INIT          :: GM Line 180  C    | | | |-GMREDI_INIT          :: GM
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)
184    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 221  C/\  | | | |                    :: for f Line 225  C/\  | | | |                    :: for f
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.
229    C/\  | | |-GCHEM_FIELD_LOAD :: load tracer forcing fields (pkg/gchem)
230  C/\  | | |  C/\  | | |
231  C/\  | | |-THERMODYNAMICS :: theta, salt + tracer equations driver.  C/\  | | |-THERMODYNAMICS :: theta, salt + tracer equations driver.
232  C/\  | | | |  C/\  | | | |
# Line 232  C/\  | | | |-CALC_IVDC       :: Set Impl Line 238  C/\  | | | |-CALC_IVDC       :: Set Impl
238  C/\  | | | |  C/\  | | | |
239  C/\  | | | |-OBCS_CALC            :: Open bndy. package ( see pkg/obcs ).  C/\  | | | |-OBCS_CALC            :: Open bndy. package ( see pkg/obcs ).
240  C/\  | | | |-EXTERNAL_FORCING_SURF:: Accumulates appropriately dimensioned  C/\  | | | |-EXTERNAL_FORCING_SURF:: Accumulates appropriately dimensioned
241  C/\  | | | |                      :: forcing terms.  C/\  | | | | |                    :: forcing terms.
242    C/\  | | | | |-PTRACERS_FORCING_SURF :: Tracer package ( see pkg/ptracers ).
243  C/\  | | | |  C/\  | | | |
244  C/\  | | | |-GMREDI_CALC_TENSOR   :: GM package ( see pkg/gmredi ).  C/\  | | | |-GMREDI_CALC_TENSOR   :: GM package ( see pkg/gmredi ).
245  C/\  | | | |-GMREDI_CALC_TENSOR_DUMMY :: GM package ( see pkg/gmredi ).  C/\  | | | |-GMREDI_CALC_TENSOR_DUMMY :: GM package ( see pkg/gmredi ).
# Line 250  C/\  | | | | Line 257  C/\  | | | |
257  C/\  | | | |-CALC_GT              :: Calculate the temperature tendency terms  C/\  | | | |-CALC_GT              :: Calculate the temperature tendency terms
258  C/\  | | | | |  C/\  | | | | |
259  C/\  | | | | |-GAD_CALC_RHS       :: Generalised advection package  C/\  | | | | |-GAD_CALC_RHS       :: Generalised advection package
260  C/\  | | | | |                    :: ( see pkg/gad )  C/\  | | | | | |                  :: ( see pkg/gad )
261    C/\  | | | | | |-KPP_TRANSPORT_T  :: KPP non-local transport ( see pkg/kpp ).
262    C/\  | | | | |
263  C/\  | | | | |-EXTERNAL_FORCING_T :: Problem specific forcing for temperature.  C/\  | | | | |-EXTERNAL_FORCING_T :: Problem specific forcing for temperature.
264  C/\  | | | | |-ADAMS_BASHFORTH2   :: Extrapolate tendencies forward in time.  C/\  | | | | |-ADAMS_BASHFORTH2   :: Extrapolate tendencies forward in time.
265  C/\  | | | | |-FREESURF_RESCALE_G :: Re-scale Gt for free-surface height.  C/\  | | | | |-FREESURF_RESCALE_G :: Re-scale Gt for free-surface height.
# Line 260  C/\  | | | | Line 269  C/\  | | | |
269  C/\  | | | |-CALC_GS              :: Calculate the salinity tendency terms  C/\  | | | |-CALC_GS              :: Calculate the salinity tendency terms
270  C/\  | | | | |  C/\  | | | | |
271  C/\  | | | | |-GAD_CALC_RHS       :: Generalised advection package  C/\  | | | | |-GAD_CALC_RHS       :: Generalised advection package
272  C/\  | | | | |                    :: ( see pkg/gad )  C/\  | | | | | |                  :: ( see pkg/gad )
273    C/\  | | | | | |-KPP_TRANSPORT_S  :: KPP non-local transport ( see pkg/kpp ).
274    C/\  | | | | |
275  C/\  | | | | |-EXTERNAL_FORCING_S :: Problem specific forcing for salt.  C/\  | | | | |-EXTERNAL_FORCING_S :: Problem specific forcing for salt.
276  C/\  | | | | |-ADAMS_BASHFORTH2   :: Extrapolate tendencies forward in time.  C/\  | | | | |-ADAMS_BASHFORTH2   :: Extrapolate tendencies forward in time.
277  C/\  | | | | |-FREESURF_RESCALE_G :: Re-scale Gs for free-surface height.  C/\  | | | | |-FREESURF_RESCALE_G :: Re-scale Gs for free-surface height.
278  C/\  | | | |  C/\  | | | |
279  C/\  | | | |-TIMESTEP_TRACER      :: Step tracer field forward in time  C/\  | | | |-TIMESTEP_TRACER      :: Step tracer field forward in time
280  C/\  | | | |  C/\  | | | |
281  C/\  | | | |-CALC_GTR1            :: Calculate other tracer(s) tendency terms  C/\  | | | |-TIMESTEP_TRACER      :: Step tracer field forward in time
282    C/\  | | | |
283    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 )
287  C/\  | | | | |-EXTERNAL_FORCING_TR:: Problem specific forcing for tracer.  C/\  | | | | | |-KPP_TRANSPORT_PTR:: KPP non-local transport ( see pkg/kpp ).
288    C/\  | | | | |
289    C/\  | | | | |-PTRACERS_FORCING   :: Problem specific forcing for tracer.
290    C/\  | | | | |-GCHEM_FORCING_INT  :: tracer forcing for gchem pkg (if all
291    C/\  | | | | |                       tendancy 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
295  C/\  | | | |  C/\  | | | |
 C/\  | | | |-TIMESTEP_TRACER      :: Step tracer field forward in time  
296  C/\  | | | |-OBCS_APPLY_TS        :: Open bndy. package (see pkg/obcs ).  C/\  | | | |-OBCS_APPLY_TS        :: Open bndy. package (see pkg/obcs ).
 C/\  | | | |-FREEZE               :: Limit range of temperature.  
297  C/\  | | | |  C/\  | | | |
298  C/\  | | | |-IMPLDIFF             :: Solve vertical implicit diffusion equation.  C/\  | | | |-IMPLDIFF             :: Solve vertical implicit diffusion equation.
299  C/\  | | | |-OBCS_APPLY_TS        :: Open bndy. package (see pkg/obcs ).  C/\  | | | |-OBCS_APPLY_TS        :: Open bndy. package (see pkg/obcs ).
# Line 336  C/\  | | | Line 352  C/\  | | |
352  C/\  | | |-DO_FIELDS_BLOCKING_EXCHANGES :: Sync up overlap regions.  C/\  | | |-DO_FIELDS_BLOCKING_EXCHANGES :: Sync up overlap regions.
353  C/\  | | | |-EXCH                                                    C/\  | | | |-EXCH                                                  
354  C/\  | | |  C/\  | | |
355    C/\  | | |-GCHEM_FORCING_SEP :: tracer forcing for gchem pkg (if
356    C/\  | | |                      tracer dependent tendencies calculated
357    C/\  | | |                      separatly)
358    C/\  | | |
359  C/\  | | |-FLT_MAIN         :: Float package ( pkg/flt ).  C/\  | | |-FLT_MAIN         :: Float package ( pkg/flt ).
360  C/\  | | |  C/\  | | |
361  C/\  | | |-MONITOR          :: Monitor package ( pkg/monitor ).  C/\  | | |-MONITOR          :: Monitor package ( pkg/monitor ).
# Line 346  C/\  | | | |-TIMEAVE_STATV_WRITE :: Time Line 366  C/\  | | | |-TIMEAVE_STATV_WRITE :: Time
366  C/\  | | | |-AIM_WRITE_DIAGS     :: Intermed. atmos diags. see pkg/aim  C/\  | | | |-AIM_WRITE_DIAGS     :: Intermed. atmos diags. see pkg/aim
367  C/\  | | | |-GMREDI_DIAGS        :: GM diags. see pkg/gmredi  C/\  | | | |-GMREDI_DIAGS        :: GM diags. see pkg/gmredi
368  C/\  | | | |-KPP_DO_DIAGS        :: KPP diags. see pkg/kpp  C/\  | | | |-KPP_DO_DIAGS        :: KPP diags. see pkg/kpp
369    C/\  | | | |-SBO_CALC            :: SBO diags. see pkg/sbo
370    C/\  | | | |-SBO_DIAGS           :: SBO diags. see pkg/sbo
371    C/\  | | | |-SEAICE_DO_DIAGS     :: SEAICE diags. see pkg/seaice
372    C/\  | | | |-GCHEM_DIAGS         :: gchem diags. see pkg/gchem
373  C/\  | | |  C/\  | | |
374  C/\  | | |-WRITE_CHECKPOINT :: Do I/O for restart files.  C/\  | | |-WRITE_CHECKPOINT :: Do I/O for restart files.
375  C/\  | |  C/\  | |
# Line 369  C Line 393  C
393  CEOI  CEOI
394    
395    
396    #include "AD_CONFIG.h"
397    #include "PACKAGES_CONFIG.h"
398  #include "CPP_OPTIONS.h"  #include "CPP_OPTIONS.h"
399    
400  CBOP  CBOP
# Line 434  C     == Global variables === Line 460  C     == Global variables ===
460  #include "PARAMS.h"  #include "PARAMS.h"
461  #include "DYNVARS.h"  #include "DYNVARS.h"
462  #ifdef ALLOW_NONHYDROSTATIC  #ifdef ALLOW_NONHYDROSTATIC
463  #include "CG3D.h"  # include "CG3D.h"
464  #endif  #endif
465    
466  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
467  #include "tamc.h"  # include "tamc.h"
468    #endif
469    #ifdef ALLOW_CTRL
470    # include "optim.h"
471  #endif  #endif
472    
473  C     !INPUT/OUTPUT PARAMETERS:  C     !INPUT/OUTPUT PARAMETERS:
# Line 457  C     myCurrentTime - Time counter for t Line 486  C     myCurrentTime - Time counter for t
486  C     myCurrentIter - Iteration counter for this thread  C     myCurrentIter - Iteration counter for this thread
487        INTEGER myCurrentIter        INTEGER myCurrentIter
488        _RL     myCurrentTime        _RL     myCurrentTime
489          logical  exst
490          logical  lastdiva
491  CEOP  CEOP
492    c--   set default:
493          lastdiva = .TRUE.
494    
495    #ifdef ALLOW_DEBUG
496          IF (debugMode) CALL DEBUG_ENTER('THE_MODEL_MAIN',myThid)
497    #endif
498    
499  C--   This timer encompasses the whole code  C--   This timer encompasses the whole code
500        CALL TIMER_START('ALL                    [THE_MODEL_MAIN]',myThid)        CALL TIMER_START('ALL                    [THE_MODEL_MAIN]',myThid)
501    
502    #ifdef ALLOW_DEBUG
503          IF (debugMode) CALL DEBUG_CALL('INITIALISE_FIXED',myThid)
504    #endif
505    
506  C--   Set model configuration (fixed arrays)  C--   Set model configuration (fixed arrays)
507        CALL TIMER_START('INITIALISE_FIXED       [THE_MODEL_MAIN]',myThid)        CALL TIMER_START('INITIALISE_FIXED       [THE_MODEL_MAIN]',myThid)
508        CALL INITIALISE_FIXED( myThid )        CALL INITIALISE_FIXED( myThid )
# Line 470  C--   Set model configuration (fixed arr Line 511  C--   Set model configuration (fixed arr
511        myCurrentTime = startTime        myCurrentTime = startTime
512        myCurrentIter = nIter0        myCurrentIter = nIter0
513    
514  #if ( defined (ALLOW_ADJOINT_RUN) || \  #if ( defined (ALLOW_ADMTLM) )
515        defined (ALLOW_TANGENTLINEAR_RUN) || \  c
516        defined (ALLOW_GRADIENT_CHECK) || \        STOP 'should never get here; ADMTLM_DSVD calls ADMTLM_DRIVER'
517        defined (ALLOW_ECCO_OPTIMIZATION) )  c
518    #elif ( defined (ALLOW_AUTODIFF))
519    
520    # ifndef EXCLUDE_CTRL_PACK
521        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
522        IF (myProcId .eq. 0) THEN        IF (myProcId .eq. 0) THEN
523           CALL TIMER_START('CTRL_UNPACK         [THE_MODEL_MAIN]',mythid)           inquire( file='costfinal', exist=exst )
524           CALL CTRL_UNPACK( mycurrentiter, mycurrenttime, mythid )           IF ( .NOT. exst ) THEN
525           CALL TIMER_STOP ('CTRL_UNPACK         [THE_MODEL_MAIN]',mythid)              IF ( optimcycle.NE.0 ) THEN
526                   CALL TIMER_START('CTRL_UNPACK   [THE_MODEL_MAIN]',mythid)
527                   CALL CTRL_UNPACK( .TRUE. , mythid )
528                   CALL TIMER_STOP ('CTRL_UNPACK   [THE_MODEL_MAIN]',mythid)
529                ENDIF
530             ENDIF
531        ENDIF        ENDIF
532        _END_MASTER( mythid )        _END_MASTER( mythid )
533        _BARRIER        _BARRIER
534    # endif /* EXCLUDE_CTRL_PACK */
535    
536    # ifdef ALLOW_COST
537        CALL COST_DEPENDENT_INIT ( mythid )        CALL COST_DEPENDENT_INIT ( mythid )
538        _BARRIER        _BARRIER
539    # endif
540    
541  #if ( defined (ALLOW_ADJOINT_RUN) || \  # if ( defined (ALLOW_TANGENTLINEAR_RUN) )
542        defined (ALLOW_ECCO_OPTIMIZATION) )  c
       CALL TIMER_START('ADTHE_MAIN_LOOP           [ADJOINT RUN]',mythid)  
       CALL ADTHE_MAIN_LOOP ( mythid )  
       CALL TIMER_STOP ('ADTHE_MAIN_LOOP           [ADJOINT RUN]',mythid)  
       _BARRIER  
 #elif (defined (ALLOW_TANGENTLINEAR_RUN))  
543        CALL TIMER_START('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)        CALL TIMER_START('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)
544        CALL G_THE_MAIN_LOOP ( myCurrentTime, myCurrentIter, myThid )        CALL G_THE_MAIN_LOOP ( myCurrentTime, myCurrentIter, myThid )
545        CALL TIMER_STOP ('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)        CALL TIMER_STOP ('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)
546        _BARRIER  c
547  #endif  # elif ( defined (ALLOW_ADJOINT_RUN) || \
548             defined (ALLOW_ECCO_OPTIMIZATION) )
549        _BEGIN_MASTER( mythid )  c
550        IF (myProcId .eq. 0) THEN  #  ifdef ALLOW_DIVIDED_ADJOINT
551           CALL TIMER_START('CTLR_PACK           [THE_MODEL_MAIN]',mythid)  c-- The following assumes the TAF option '-pure'
552           call CTRL_PACK( mycurrentiter, mycurrenttime, mythid )        inquire( file='costfinal', exist=exst )
553           CALL TIMER_STOP ('CTLR_PACK           [THE_MODEL_MAIN]',mythid)        IF ( .NOT. exst) THEN
554             CALL TIMER_START('MDTHE_MAIN_LOOP            [MD RUN]', mythid)
555             CALL MDTHE_MAIN_LOOP ( myCurrentTime, myCurrentIter, mythid )
556             CALL TIMER_STOP ('MDTHE_MAIN_LOOP            [MD RUN]', mythid)
557             CALL COST_FINAL_STORE ( mythid, lastdiva )
558          ELSE
559             CALL TIMER_START('ADTHE_MAIN_LOOP       [ADJOINT RUN]', mythid)
560             CALL ADTHE_MAIN_LOOP ( myCurrentTime, myCurrentIter, mythid )
561             CALL TIMER_STOP ('ADTHE_MAIN_LOOP       [ADJOINT RUN]', mythid)
562             CALL COST_FINAL_RESTORE ( mythid, lastdiva )
563        ENDIF        ENDIF
564        _END_MASTER( mythid )  c--
565        _BARRIER  #  else /* ALLOW_DIVIDED_ADJOINT undef */
566          CALL TIMER_START('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)
567  #else /* ALLOW_ADJOINT_RUN undef */        CALL ADTHE_MAIN_LOOP ( myCurrentTime, myCurrentIter, mythid )
568    cph      CALL ADTHE_MAIN_LOOP ( mythid )
569          CALL TIMER_STOP ('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)
570    #  endif /* ALLOW_DIVIDED_ADJOINT */
571    c
572    # else /* forward run only within AD setting */
573    
574    #ifdef ALLOW_DEBUG
575          IF (debugMode) CALL DEBUG_CALL('THE_MAIN_LOOP',myThid)
576    #endif
577  C--   Call time stepping loop of full model  C--   Call time stepping loop of full model
578        CALL TIMER_START('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)        CALL TIMER_START('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)
579        CALL THE_MAIN_LOOP( myCurrentTime, myCurrentIter, myThid )        CALL THE_MAIN_LOOP( myCurrentTime, myCurrentIter, myThid )
580        CALL TIMER_STOP ('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)        CALL TIMER_STOP ('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)
581    
582  #endif /* ALLOW_ADJOINT_RUN */  # endif
583    
584  #ifdef ALLOW_GRADIENT_CHECK  # ifndef EXCLUDE_CTRL_PACK
585        if (useGrdchk) then        _BEGIN_MASTER( mythid )
586          IF ( myProcId .eq. 0 .AND. lastdiva ) THEN
587             CALL TIMER_START('CTRL_PACK           [THE_MODEL_MAIN]',mythid)
588             call CTRL_PACK( .FALSE. , mythid )
589             CALL TIMER_STOP ('CTRL_PACK           [THE_MODEL_MAIN]',mythid)
590             IF ( optimcycle.EQ.0 .AND. mycurrentiter.EQ.niter0 ) THEN
591                CALL TIMER_START('CTRL_PACK     [THE_MODEL_MAIN]',mythid)
592                CALL CTRL_PACK( .TRUE. , mythid )
593                CALL TIMER_STOP ('CTRL_PACK     [THE_MODEL_MAIN]',mythid)
594             ENDIF
595          ENDIF
596          _END_MASTER( mythid )
597          _BARRIER
598    # endif /* EXCLUDE_CTRL_PACK */
599    
600    
601    # ifdef ALLOW_GRDCHK
602          IF ( useGrdchk .AND. lastdiva ) THEN
603           CALL TIMER_START('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)           CALL TIMER_START('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)
604           CALL GRDCHK_MAIN( mythid )           CALL GRDCHK_MAIN( mythid )
605           CALL TIMER_STOP ('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)           CALL TIMER_STOP ('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)
606           _BARRIER           _BARRIER
607        end if        ENDIF
608    # endif
609    
610    #else /* ALL AD-related undef */
611    
612    #ifdef ALLOW_DEBUG
613          IF (debugMode) CALL DEBUG_CALL('THE_MAIN_LOOP',myThid)
614  #endif  #endif
615    C--   Call time stepping loop of full model
616          CALL TIMER_START('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)
617          CALL THE_MAIN_LOOP( myCurrentTime, myCurrentIter, myThid )
618          CALL TIMER_STOP ('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)
619    
620    #endif /* ALLOW_TANGENTLINEAR_RUN ALLOW_ADJOINT_RUN ALLOW_ADMTLM */
621    
622  C--   Final checkpoint (incase the in-loop checkpoint was missed)  C--   Final checkpoint (in case the in-loop checkpoint was missed)
623        CALL TIMER_START('WRITE_CHECKPOINT       [THE_MODEL_MAIN]',myThid)        CALL TIMER_START('WRITE_CHECKPOINT       [THE_MODEL_MAIN]',myThid)
624          CALL PACKAGES_WRITE_PICKUP(
625         I        .TRUE., myCurrentTime, myCurrentIter, myThid )
626        CALL WRITE_CHECKPOINT(        CALL WRITE_CHECKPOINT(
627       &        .TRUE., myCurrentTime, myCurrentIter, myThid )       I        .TRUE., myCurrentTime, myCurrentIter, myThid )
628        CALL TIMER_STOP ('WRITE_CHECKPOINT       [THE_MODEL_MAIN]',myThid)        CALL TIMER_STOP ('WRITE_CHECKPOINT       [THE_MODEL_MAIN]',myThid)
629    
630        CALL TIMER_STOP ('ALL                    [THE_MODEL_MAIN]',myThid)        CALL TIMER_STOP ('ALL                    [THE_MODEL_MAIN]',myThid)
631    
632    #ifdef ALLOW_MNC
633          IF (useMNC) THEN
634    C       Close all open NetCDF files
635            _BEGIN_MASTER( mythid )
636            CALL MNC_FILE_CLOSE_ALL( myThid )
637            _END_MASTER( mythid )
638          ENDIF
639    #endif
640    
641  C--   Write timer statistics  C--   Write timer statistics
642        IF ( myThid .EQ. 1 ) THEN        IF ( myThid .EQ. 1 ) THEN
643         CALL TIMER_PRINTALL( myThid )         CALL TIMER_PRINTALL( myThid )
644         CALL COMM_STATS         CALL COMM_STATS
645        ENDIF        ENDIF
646    
647    #ifdef ALLOW_DEBUG
648          IF (debugMode) CALL DEBUG_LEAVE('THE_MODEL_MAIN',myThid)
649    #endif
650    
651        RETURN        RETURN
652        END        END

Legend:
Removed from v.1.48  
changed lines
  Added in v.1.88

  ViewVC Help
Powered by ViewVC 1.1.22