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

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

  ViewVC Help
Powered by ViewVC 1.1.22