/[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.52 by heimbach, Wed Mar 5 23:39:53 2003 UTC revision 1.78 by edhill, Sun Jul 25 03:00:16 2004 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    | | | |-READ_CHECKPOINT :: Read the checkpoint
150  C    | | |  C    | | |
151  C    | | |-INI_TR1      :: Set initial tracer 1 distribution.  C    | | |-INI_TR1      :: Set initial tracer 1 distribution.
152  C    | | |  C    | | |
# Line 178  C    | | | |-GMREDI_INIT          :: GM Line 182  C    | | | |-GMREDI_INIT          :: GM
182  C    | | | |-KPP_INIT             :: KPP package. ( see pkg/kpp )  C    | | | |-KPP_INIT             :: KPP package. ( see pkg/kpp )
183  C    | | | |-KPP_OPEN_DIAGS      C    | | | |-KPP_OPEN_DIAGS    
184  C    | | | |-OBCS_INIT_VARIABLES  :: Open bndy. package. ( see pkg/obcs )  C    | | | |-OBCS_INIT_VARIABLES  :: Open bndy. package. ( see pkg/obcs )
185    C    | | | |-PTRACERS_INIT        :: multi. tracer package,(see pkg/ptracers)
186    C    | | | |-GCHEM_INIT           : : tracer interface pkg (see pkh/gchem)
187  C    | | | |-AIM_INIT             :: Interm. atmos package. ( see pkg/aim )  C    | | | |-AIM_INIT             :: Interm. atmos package. ( see pkg/aim )
188  C    | | | |-CTRL_MAP_INI         :: Control vector package.( see pkg/ctrl )  C    | | | |-CTRL_MAP_INI         :: Control vector package.( see pkg/ctrl )
189  C    | | | |-COST_INIT            :: Cost function package. ( see pkg/cost )  C    | | | |-COST_INIT            :: Cost function package. ( see pkg/cost )
# Line 221  C/\  | | | |                    :: for f Line 227  C/\  | | | |                    :: for f
227  C/\  | | | |                    C/\  | | | |                  
228  C/\  | | | |-EXCH :: Sync forcing. in overlap regions.  C/\  | | | |-EXCH :: Sync forcing. in overlap regions.
229  C/\  | | |-SEAICE_MODEL   :: Compute sea-ice terms. ( pkg/seaice )  C/\  | | |-SEAICE_MODEL   :: Compute sea-ice terms. ( pkg/seaice )
230    C/\  | | |-FREEZE         :: Limit surface temperature.
231    C/\  | | |-GCHEM_FIELD_LOAD :: load tracer forcing fields (pkg/gchem)
232  C/\  | | |  C/\  | | |
233  C/\  | | |-THERMODYNAMICS :: theta, salt + tracer equations driver.  C/\  | | |-THERMODYNAMICS :: theta, salt + tracer equations driver.
234  C/\  | | | |  C/\  | | | |
# Line 232  C/\  | | | |-CALC_IVDC       :: Set Impl Line 240  C/\  | | | |-CALC_IVDC       :: Set Impl
240  C/\  | | | |  C/\  | | | |
241  C/\  | | | |-OBCS_CALC            :: Open bndy. package ( see pkg/obcs ).  C/\  | | | |-OBCS_CALC            :: Open bndy. package ( see pkg/obcs ).
242  C/\  | | | |-EXTERNAL_FORCING_SURF:: Accumulates appropriately dimensioned  C/\  | | | |-EXTERNAL_FORCING_SURF:: Accumulates appropriately dimensioned
243  C/\  | | | |                      :: forcing terms.  C/\  | | | | |                    :: forcing terms.
244    C/\  | | | | |-PTRACERS_FORCING_SURF :: Tracer package ( see pkg/ptracers ).
245  C/\  | | | |  C/\  | | | |
246  C/\  | | | |-GMREDI_CALC_TENSOR   :: GM package ( see pkg/gmredi ).  C/\  | | | |-GMREDI_CALC_TENSOR   :: GM package ( see pkg/gmredi ).
247  C/\  | | | |-GMREDI_CALC_TENSOR_DUMMY :: GM package ( see pkg/gmredi ).  C/\  | | | |-GMREDI_CALC_TENSOR_DUMMY :: GM package ( see pkg/gmredi ).
# Line 250  C/\  | | | | Line 259  C/\  | | | |
259  C/\  | | | |-CALC_GT              :: Calculate the temperature tendency terms  C/\  | | | |-CALC_GT              :: Calculate the temperature tendency terms
260  C/\  | | | | |  C/\  | | | | |
261  C/\  | | | | |-GAD_CALC_RHS       :: Generalised advection package  C/\  | | | | |-GAD_CALC_RHS       :: Generalised advection package
262  C/\  | | | | |                    :: ( see pkg/gad )  C/\  | | | | | |                  :: ( see pkg/gad )
263    C/\  | | | | | |-KPP_TRANSPORT_T  :: KPP non-local transport ( see pkg/kpp ).
264    C/\  | | | | |
265  C/\  | | | | |-EXTERNAL_FORCING_T :: Problem specific forcing for temperature.  C/\  | | | | |-EXTERNAL_FORCING_T :: Problem specific forcing for temperature.
266  C/\  | | | | |-ADAMS_BASHFORTH2   :: Extrapolate tendencies forward in time.  C/\  | | | | |-ADAMS_BASHFORTH2   :: Extrapolate tendencies forward in time.
267  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 271  C/\  | | | |
271  C/\  | | | |-CALC_GS              :: Calculate the salinity tendency terms  C/\  | | | |-CALC_GS              :: Calculate the salinity tendency terms
272  C/\  | | | | |  C/\  | | | | |
273  C/\  | | | | |-GAD_CALC_RHS       :: Generalised advection package  C/\  | | | | |-GAD_CALC_RHS       :: Generalised advection package
274  C/\  | | | | |                    :: ( see pkg/gad )  C/\  | | | | | |                  :: ( see pkg/gad )
275    C/\  | | | | | |-KPP_TRANSPORT_S  :: KPP non-local transport ( see pkg/kpp ).
276    C/\  | | | | |
277  C/\  | | | | |-EXTERNAL_FORCING_S :: Problem specific forcing for salt.  C/\  | | | | |-EXTERNAL_FORCING_S :: Problem specific forcing for salt.
278  C/\  | | | | |-ADAMS_BASHFORTH2   :: Extrapolate tendencies forward in time.  C/\  | | | | |-ADAMS_BASHFORTH2   :: Extrapolate tendencies forward in time.
279  C/\  | | | | |-FREESURF_RESCALE_G :: Re-scale Gs for free-surface height.  C/\  | | | | |-FREESURF_RESCALE_G :: Re-scale Gs for free-surface height.
# Line 271  C/\  | | | |-CALC_GTR1            :: Cal Line 284  C/\  | | | |-CALC_GTR1            :: Cal
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/\  | | | | |
288  C/\  | | | | |-EXTERNAL_FORCING_TR:: Problem specific forcing for tracer.  C/\  | | | | |-EXTERNAL_FORCING_TR:: Problem specific forcing for tracer.
289  C/\  | | | | |-ADAMS_BASHFORTH2   :: Extrapolate tendencies forward in time.  C/\  | | | | |-ADAMS_BASHFORTH2   :: Extrapolate tendencies forward in time.
290  C/\  | | | | |-FREESURF_RESCALE_G :: Re-scale Gs for free-surface height.  C/\  | | | | |-FREESURF_RESCALE_G :: Re-scale Gs for free-surface height.
291  C/\  | | | |  C/\  | | | |
292  C/\  | | | |-TIMESTEP_TRACER      :: Step tracer field forward in time  C/\  | | | |-TIMESTEP_TRACER      :: Step tracer field forward in time
293    C/\  | | | |
294    C/\  | | | |-PTRACERS_INTEGRATE   :: Integrate other tracer(s) ( see pkg/ptracers ).
295    C/\  | | | | |
296    C/\  | | | | |-GAD_CALC_RHS       :: Generalised advection package
297    C/\  | | | | | |                  :: ( see pkg/gad )
298    C/\  | | | | | |-KPP_TRANSPORT_PTR:: KPP non-local transport ( see pkg/kpp ).
299    C/\  | | | | |
300    C/\  | | | | |-PTRACERS_FORCING   :: Problem specific forcing for tracer.
301    C/\  | | | | |-GCHEM_FORCING_INT  :: tracer forcing for gchem pkg (if all
302    C/\  | | | | |                       tendancy terms calcualted together)
303    C/\  | | | | |-ADAMS_BASHFORTH2   :: Extrapolate tendencies forward in time.
304    C/\  | | | | |-FREESURF_RESCALE_G :: Re-scale Gs for free-surface height.
305    C/\  | | | | |-TIMESTEP_TRACER    :: Step tracer field forward in time
306    C/\  | | | |
307  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.  
308  C/\  | | | |  C/\  | | | |
309  C/\  | | | |-IMPLDIFF             :: Solve vertical implicit diffusion equation.  C/\  | | | |-IMPLDIFF             :: Solve vertical implicit diffusion equation.
310  C/\  | | | |-OBCS_APPLY_TS        :: Open bndy. package (see pkg/obcs ).  C/\  | | | |-OBCS_APPLY_TS        :: Open bndy. package (see pkg/obcs ).
# Line 336  C/\  | | | Line 363  C/\  | | |
363  C/\  | | |-DO_FIELDS_BLOCKING_EXCHANGES :: Sync up overlap regions.  C/\  | | |-DO_FIELDS_BLOCKING_EXCHANGES :: Sync up overlap regions.
364  C/\  | | | |-EXCH                                                    C/\  | | | |-EXCH                                                  
365  C/\  | | |  C/\  | | |
366    C/\  | | |-GCHEM_FORCING_SEP :: tracer forcing for gchem pkg (if
367    C/\  | | |                      tracer dependent tendencies calculated
368    C/\  | | |                      separatly)
369    C/\  | | |
370  C/\  | | |-FLT_MAIN         :: Float package ( pkg/flt ).  C/\  | | |-FLT_MAIN         :: Float package ( pkg/flt ).
371  C/\  | | |  C/\  | | |
372  C/\  | | |-MONITOR          :: Monitor package ( pkg/monitor ).  C/\  | | |-MONITOR          :: Monitor package ( pkg/monitor ).
# Line 348  C/\  | | | |-GMREDI_DIAGS        :: GM d Line 379  C/\  | | | |-GMREDI_DIAGS        :: GM d
379  C/\  | | | |-KPP_DO_DIAGS        :: KPP diags. see pkg/kpp  C/\  | | | |-KPP_DO_DIAGS        :: KPP diags. see pkg/kpp
380  C/\  | | | |-SBO_CALC            :: SBO diags. see pkg/sbo  C/\  | | | |-SBO_CALC            :: SBO diags. see pkg/sbo
381  C/\  | | | |-SBO_DIAGS           :: SBO diags. see pkg/sbo  C/\  | | | |-SBO_DIAGS           :: SBO diags. see pkg/sbo
382    C/\  | | | |-SEAICE_DO_DIAGS     :: SEAICE diags. see pkg/seaice
383    C/\  | | | |-GCHEM_DIAGS         :: gchem diags. see pkg/gchem
384  C/\  | | |  C/\  | | |
385  C/\  | | |-WRITE_CHECKPOINT :: Do I/O for restart files.  C/\  | | |-WRITE_CHECKPOINT :: Do I/O for restart files.
386  C/\  | |  C/\  | |
# Line 371  C Line 404  C
404  CEOI  CEOI
405    
406    
407    #include "AD_CONFIG.h"
408    #include "PACKAGES_CONFIG.h"
409  #include "CPP_OPTIONS.h"  #include "CPP_OPTIONS.h"
410    
411  CBOP  CBOP
# Line 436  C     == Global variables === Line 471  C     == Global variables ===
471  #include "PARAMS.h"  #include "PARAMS.h"
472  #include "DYNVARS.h"  #include "DYNVARS.h"
473  #ifdef ALLOW_NONHYDROSTATIC  #ifdef ALLOW_NONHYDROSTATIC
474  #include "CG3D.h"  # include "CG3D.h"
475  #endif  #endif
476    
477    #ifdef ALLOW_ECCO_OPTIMIZATION
478    # include "optim.h"
479    #endif
480  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
481  #include "tamc.h"  # include "tamc.h"
482  #endif  #endif
483    
484  C     !INPUT/OUTPUT PARAMETERS:  C     !INPUT/OUTPUT PARAMETERS:
# Line 461  C     myCurrentIter - Iteration counter Line 499  C     myCurrentIter - Iteration counter
499        _RL     myCurrentTime        _RL     myCurrentTime
500        logical  exst        logical  exst
501        logical  lastdiva        logical  lastdiva
502    #ifndef ALLOW_ECCO_OPTIMIZATION
503          integer optimcycle
504    #endif
505  CEOP  CEOP
506    c--   set default:
507    #ifndef ALLOW_ECCO_OPTIMIZATION
508          optimcycle = 0
509    #endif
510          lastdiva = .TRUE.
511    
512    #ifdef ALLOW_DEBUG
513          IF (debugMode) CALL DEBUG_ENTER('THE_MODEL_MAIN',myThid)
514    #endif
515    
516  C--   This timer encompasses the whole code  C--   This timer encompasses the whole code
517        CALL TIMER_START('ALL                    [THE_MODEL_MAIN]',myThid)        CALL TIMER_START('ALL                    [THE_MODEL_MAIN]',myThid)
518    
519    #ifdef ALLOW_DEBUG
520          IF (debugMode) CALL DEBUG_CALL('INITIALISE_FIXED',myThid)
521    #endif
522    
523  C--   Set model configuration (fixed arrays)  C--   Set model configuration (fixed arrays)
524        CALL TIMER_START('INITIALISE_FIXED       [THE_MODEL_MAIN]',myThid)        CALL TIMER_START('INITIALISE_FIXED       [THE_MODEL_MAIN]',myThid)
525        CALL INITIALISE_FIXED( myThid )        CALL INITIALISE_FIXED( myThid )
# Line 474  C--   Set model configuration (fixed arr Line 528  C--   Set model configuration (fixed arr
528        myCurrentTime = startTime        myCurrentTime = startTime
529        myCurrentIter = nIter0        myCurrentIter = nIter0
530    
531  #if ( defined (ALLOW_ADJOINT_RUN) || \  #if ( defined (ALLOW_ADMTLM) )
532        defined (ALLOW_TANGENTLINEAR_RUN) || \  c
533        defined (ALLOW_GRADIENT_CHECK) || \        CALL TIMER_START('ADMTLM_DRIVER          [THE_MODEL_MAIN]',mythid)
534        defined (ALLOW_ECCO_OPTIMIZATION) )        CALL ADMTLM_DRIVER ( myThid )
535          CALL TIMER_STOP ('ADMTLM_DRIVER          [THE_MODEL_MAIN]',mythid)
536    c
537    #elif ( defined (ALLOW_AUTODIFF))
538    
539    # ifndef EXCLUDE_CTRL_PACK
540        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
541        IF (myProcId .eq. 0) THEN        IF (myProcId .eq. 0) THEN
542           inquire( file='costfinal', exist=exst )           inquire( file='costfinal', exist=exst )
543           IF ( .NOT. exst) THEN           IF ( .NOT. exst .AND. niter0 .EQ. 0 ) THEN
544              CALL TIMER_START('CTRL_UNPACK      [THE_MODEL_MAIN]',mythid)              IF ( optimcycle.NE.0 ) THEN
545              CALL CTRL_UNPACK( mycurrentiter, mycurrenttime, mythid )                 CALL TIMER_START('CTRL_UNPACK   [THE_MODEL_MAIN]',mythid)
546              CALL TIMER_STOP ('CTRL_UNPACK      [THE_MODEL_MAIN]',mythid)                 CALL CTRL_UNPACK( .TRUE. , mythid )
547                   CALL TIMER_STOP ('CTRL_UNPACK   [THE_MODEL_MAIN]',mythid)
548                ENDIF
549                IF ( optimcycle.EQ.0 .AND. mycurrentiter.EQ.niter0 ) THEN
550                   CALL TIMER_START('CTRL_PACK     [THE_MODEL_MAIN]',mythid)
551                   CALL CTRL_PACK( .TRUE. , mythid )
552                   CALL TIMER_STOP ('CTRL_PACK     [THE_MODEL_MAIN]',mythid)
553                ENDIF
554           ENDIF           ENDIF
555        ENDIF        ENDIF
556        _END_MASTER( mythid )        _END_MASTER( mythid )
557        _BARRIER        _BARRIER
558    # endif /* EXCLUDE_CTRL_PACK */
559    
560        CALL COST_DEPENDENT_INIT ( mythid )        CALL COST_DEPENDENT_INIT ( mythid )
561        _BARRIER        _BARRIER
562    
563  #if ( defined (ALLOW_ADJOINT_RUN) || \  # if ( defined (ALLOW_TANGENTLINEAR_RUN) )
564        defined (ALLOW_ECCO_OPTIMIZATION) )  c
565  # ifdef ALLOW_DIVIDED_ADJOINT        CALL TIMER_START('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)
566          CALL G_THE_MAIN_LOOP ( myCurrentTime, myCurrentIter, myThid )
567          CALL TIMER_STOP ('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)
568    c
569    # elif ( defined (ALLOW_ADJOINT_RUN) || \
570             defined (ALLOW_ECCO_OPTIMIZATION) )
571    c
572    #  ifdef ALLOW_DIVIDED_ADJOINT
573  c-- The following assumes the TAF option '-pure'  c-- The following assumes the TAF option '-pure'
574        inquire( file='costfinal', exist=exst )        inquire( file='costfinal', exist=exst )
575        IF ( .NOT. exst) THEN        IF ( .NOT. exst) THEN
# Line 506  c-- The following assumes the TAF option Line 579  c-- The following assumes the TAF option
579           CALL COST_FINAL_STORE ( mythid, lastdiva )           CALL COST_FINAL_STORE ( mythid, lastdiva )
580        ELSE        ELSE
581           CALL TIMER_START('ADTHE_MAIN_LOOP       [ADJOINT RUN]', mythid)           CALL TIMER_START('ADTHE_MAIN_LOOP       [ADJOINT RUN]', mythid)
582           CALL ADTHE_MAIN_LOOP ( mythid )           CALL ADTHE_MAIN_LOOP ( myCurrentTime, myCurrentIter, mythid )
583           CALL TIMER_STOP ('ADTHE_MAIN_LOOP       [ADJOINT RUN]', mythid)           CALL TIMER_STOP ('ADTHE_MAIN_LOOP       [ADJOINT RUN]', mythid)
584           CALL COST_FINAL_RESTORE ( mythid, lastdiva )           CALL COST_FINAL_RESTORE ( mythid, lastdiva )
585        ENDIF        ENDIF
586  c--  c--
587  # else  #  else /* ALLOW_DIVIDED_ADJOINT undef */
588        CALL TIMER_START('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)        CALL TIMER_START('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)
589        CALL ADTHE_MAIN_LOOP ( mythid )        CALL ADTHE_MAIN_LOOP ( myCurrentTime, myCurrentIter, mythid )
590    cph      CALL ADTHE_MAIN_LOOP ( mythid )
591        CALL TIMER_STOP ('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)        CALL TIMER_STOP ('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)
592    #  endif /* ALLOW_DIVIDED_ADJOINT */
593    c
594  # endif  # endif
 c--  
 #elif (defined (ALLOW_TANGENTLINEAR_RUN))  
       CALL TIMER_START('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)  
       CALL G_THE_MAIN_LOOP ( myCurrentTime, myCurrentIter, myThid )  
       CALL TIMER_STOP ('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)  
 #endif  
       _BARRIER  
595    
596    # ifndef EXCLUDE_CTRL_PACK
597        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
598        IF ( myProcId .eq. 0 .AND. lastdiva ) THEN        IF ( myProcId .eq. 0 .AND. lastdiva ) THEN
599           CALL TIMER_START('CTLR_PACK           [THE_MODEL_MAIN]',mythid)           CALL TIMER_START('CTRL_PACK           [THE_MODEL_MAIN]',mythid)
600           call CTRL_PACK( mycurrentiter, mycurrenttime, mythid )           call CTRL_PACK( .FALSE. , mythid )
601           CALL TIMER_STOP ('CTLR_PACK           [THE_MODEL_MAIN]',mythid)           CALL TIMER_STOP ('CTRL_PACK           [THE_MODEL_MAIN]',mythid)
602        ENDIF        ENDIF
603        _END_MASTER( mythid )        _END_MASTER( mythid )
604        _BARRIER        _BARRIER
605    # endif /* EXCLUDE_CTRL_PACK */
606    
607  #ifdef ALLOW_GRADIENT_CHECK  
608    # ifdef ALLOW_GRDCHK
609        IF ( useGrdchk .AND. lastdiva ) THEN        IF ( useGrdchk .AND. lastdiva ) THEN
610           CALL TIMER_START('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)           CALL TIMER_START('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)
611           CALL GRDCHK_MAIN( mythid )           CALL GRDCHK_MAIN( mythid )
612           CALL TIMER_STOP ('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)           CALL TIMER_STOP ('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)
613           _BARRIER           _BARRIER
614        ENDIF        ENDIF
615  #endif  # endif
616    
617    #else /* ALL AD-related undef */
618    
619  #else /* ALLOW_ADJOINT_RUN undef */  #ifdef ALLOW_DEBUG
620          IF (debugMode) CALL DEBUG_CALL('THE_MAIN_LOOP',myThid)
621    #endif
622    
623  C--   Call time stepping loop of full model  C--   Call time stepping loop of full model
624        CALL TIMER_START('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)        CALL TIMER_START('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)
625        CALL THE_MAIN_LOOP( myCurrentTime, myCurrentIter, myThid )        CALL THE_MAIN_LOOP( myCurrentTime, myCurrentIter, myThid )
626        CALL TIMER_STOP ('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)        CALL TIMER_STOP ('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)
627    
628  #endif /* ALLOW_ADJOINT_RUN */  #endif /* ALLOW_TANGENTLINEAR_RUN ALLOW_ADJOINT_RUN ALLOW_ADMTLM_RUN */
   
 C--   Sea-ice checkpoint (in case the in-loop checkpoint was missed)  
 #ifdef ALLOW_SEAICE  
       IF ( useSEAICE )  
      &     CALL SEAICE_WRITE_PICKUP(  
      &     .TRUE., myCurrentTime, myCurrentIter, myThid )  
 #endif  
629    
630  C--   Final checkpoint (in case the in-loop checkpoint was missed)  C--   Final checkpoint (in case the in-loop checkpoint was missed)
631        CALL TIMER_START('WRITE_CHECKPOINT       [THE_MODEL_MAIN]',myThid)        CALL TIMER_START('WRITE_CHECKPOINT       [THE_MODEL_MAIN]',myThid)
632          CALL PACKAGES_WRITE_PICKUP(
633         I        .TRUE., myCurrentTime, myCurrentIter, myThid )
634        CALL WRITE_CHECKPOINT(        CALL WRITE_CHECKPOINT(
635       &        .TRUE., myCurrentTime, myCurrentIter, myThid )       I        .TRUE., myCurrentTime, myCurrentIter, myThid )
636        CALL TIMER_STOP ('WRITE_CHECKPOINT       [THE_MODEL_MAIN]',myThid)        CALL TIMER_STOP ('WRITE_CHECKPOINT       [THE_MODEL_MAIN]',myThid)
637    
638        CALL TIMER_STOP ('ALL                    [THE_MODEL_MAIN]',myThid)        CALL TIMER_STOP ('ALL                    [THE_MODEL_MAIN]',myThid)
639    
640    #ifdef ALLOW_MNC
641          IF (useMNC) THEN
642    C       Close all open NetCDF files
643            _BEGIN_MASTER( mythid )
644            CALL MNC_FILE_CLOSE_ALL( myThid )
645            _END_MASTER( mythid )
646          ENDIF
647    #endif
648    
649  C--   Write timer statistics  C--   Write timer statistics
650        IF ( myThid .EQ. 1 ) THEN        IF ( myThid .EQ. 1 ) THEN
651         CALL TIMER_PRINTALL( myThid )         CALL TIMER_PRINTALL( myThid )
652         CALL COMM_STATS         CALL COMM_STATS
653        ENDIF        ENDIF
654    
655    #ifdef ALLOW_DEBUG
656          IF (debugMode) CALL DEBUG_LEAVE('THE_MODEL_MAIN',myThid)
657    #endif
658    
659        RETURN        RETURN
660        END        END

Legend:
Removed from v.1.52  
changed lines
  Added in v.1.78

  ViewVC Help
Powered by ViewVC 1.1.22