/[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.92 by heimbach, Thu Dec 22 16:51:58 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 348  C/\  | | | |-GMREDI_DIAGS        :: GM d Line 368  C/\  | | | |-GMREDI_DIAGS        :: GM d
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  C/\  | | | |-SBO_CALC            :: SBO diags. see pkg/sbo
370  C/\  | | | |-SBO_DIAGS           :: SBO diags. see pkg/sbo  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 371  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 435  C     == Global variables === Line 459  C     == Global variables ===
459  #include "EEPARAMS.h"  #include "EEPARAMS.h"
460  #include "PARAMS.h"  #include "PARAMS.h"
461  #include "DYNVARS.h"  #include "DYNVARS.h"
 #ifdef ALLOW_NONHYDROSTATIC  
 #include "CG3D.h"  
 #endif  
462    
463  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
464  #include "tamc.h"  # include "tamc.h"
465    #endif
466    #ifdef ALLOW_CTRL
467    # include "ctrl.h"
468    # include "optim.h"
469  #endif  #endif
470    
471  C     !INPUT/OUTPUT PARAMETERS:  C     !INPUT/OUTPUT PARAMETERS:
# Line 462  C     myCurrentIter - Iteration counter Line 487  C     myCurrentIter - Iteration counter
487        logical  exst        logical  exst
488        logical  lastdiva        logical  lastdiva
489  CEOP  CEOP
490    c--   set default:
491          lastdiva = .TRUE.
492    
493    #ifdef ALLOW_DEBUG
494          IF (debugMode) CALL DEBUG_ENTER('THE_MODEL_MAIN',myThid)
495    #endif
496    
497    #ifdef USE_PAPI
498          CALL TIMER_CONTROL('','INIT','THE_MODEL_MAIN',myThid)
499    #endif
500  C--   This timer encompasses the whole code  C--   This timer encompasses the whole code
501        CALL TIMER_START('ALL                    [THE_MODEL_MAIN]',myThid)        CALL TIMER_START('ALL                    [THE_MODEL_MAIN]',myThid)
502    
503    #ifdef ALLOW_DEBUG
504          IF (debugMode) CALL DEBUG_CALL('INITIALISE_FIXED',myThid)
505    #endif
506    
507  C--   Set model configuration (fixed arrays)  C--   Set model configuration (fixed arrays)
508        CALL TIMER_START('INITIALISE_FIXED       [THE_MODEL_MAIN]',myThid)        CALL TIMER_START('INITIALISE_FIXED       [THE_MODEL_MAIN]',myThid)
509        CALL INITIALISE_FIXED( myThid )        CALL INITIALISE_FIXED( myThid )
# Line 474  C--   Set model configuration (fixed arr Line 512  C--   Set model configuration (fixed arr
512        myCurrentTime = startTime        myCurrentTime = startTime
513        myCurrentIter = nIter0        myCurrentIter = nIter0
514    
515  #if ( defined (ALLOW_ADJOINT_RUN) || \  #if ( defined (ALLOW_ADMTLM) )
516        defined (ALLOW_TANGENTLINEAR_RUN) || \  c
517        defined (ALLOW_GRADIENT_CHECK) || \        STOP 'should never get here; ADMTLM_DSVD calls ADMTLM_DRIVER'
518        defined (ALLOW_ECCO_OPTIMIZATION) )  c
519    #elif ( defined (ALLOW_AUTODIFF))
520    
521    # ifndef EXCLUDE_CTRL_PACK
522        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
523        IF (myProcId .eq. 0) THEN        IF (myProcId .eq. 0) THEN
524           inquire( file='costfinal', exist=exst )           inquire( file='costfinal', exist=exst )
525           IF ( .NOT. exst) THEN           IF ( .NOT. exst ) THEN
526              CALL TIMER_START('CTRL_UNPACK      [THE_MODEL_MAIN]',mythid)              IF ( optimcycle.NE.0 .AND. doMainUnpack ) THEN
527              CALL CTRL_UNPACK( mycurrentiter, mycurrenttime, mythid )                 CALL TIMER_START('CTRL_UNPACK   [THE_MODEL_MAIN]',mythid)
528              CALL TIMER_STOP ('CTRL_UNPACK      [THE_MODEL_MAIN]',mythid)                 CALL CTRL_UNPACK( .TRUE. , mythid )
529                   CALL TIMER_STOP ('CTRL_UNPACK   [THE_MODEL_MAIN]',mythid)
530                ENDIF
531           ENDIF           ENDIF
532        ENDIF        ENDIF
533        _END_MASTER( mythid )        _END_MASTER( mythid )
534        _BARRIER        _BARRIER
535    # endif /* EXCLUDE_CTRL_PACK */
536    
537    # ifdef ALLOW_COST
538        CALL COST_DEPENDENT_INIT ( mythid )        CALL COST_DEPENDENT_INIT ( mythid )
539        _BARRIER        _BARRIER
540    # endif
541    
542  #if ( defined (ALLOW_ADJOINT_RUN) || \  # if ( defined (ALLOW_TANGENTLINEAR_RUN) )
543        defined (ALLOW_ECCO_OPTIMIZATION) )  c
544  # ifdef ALLOW_DIVIDED_ADJOINT        CALL TIMER_START('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)
545          CALL G_THE_MAIN_LOOP ( myCurrentTime, myCurrentIter, myThid )
546          CALL TIMER_STOP ('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)
547    c
548    # elif ( defined (ALLOW_ADJOINT_RUN) || \
549             defined (ALLOW_ECCO_OPTIMIZATION) )
550    c
551    #  ifdef ALLOW_DIVIDED_ADJOINT
552  c-- The following assumes the TAF option '-pure'  c-- The following assumes the TAF option '-pure'
553        inquire( file='costfinal', exist=exst )        inquire( file='costfinal', exist=exst )
554        IF ( .NOT. exst) THEN        IF ( .NOT. exst) THEN
# Line 506  c-- The following assumes the TAF option Line 558  c-- The following assumes the TAF option
558           CALL COST_FINAL_STORE ( mythid, lastdiva )           CALL COST_FINAL_STORE ( mythid, lastdiva )
559        ELSE        ELSE
560           CALL TIMER_START('ADTHE_MAIN_LOOP       [ADJOINT RUN]', mythid)           CALL TIMER_START('ADTHE_MAIN_LOOP       [ADJOINT RUN]', mythid)
561           CALL ADTHE_MAIN_LOOP ( mythid )           CALL ADTHE_MAIN_LOOP ( myCurrentTime, myCurrentIter, mythid )
562           CALL TIMER_STOP ('ADTHE_MAIN_LOOP       [ADJOINT RUN]', mythid)           CALL TIMER_STOP ('ADTHE_MAIN_LOOP       [ADJOINT RUN]', mythid)
563           CALL COST_FINAL_RESTORE ( mythid, lastdiva )           CALL COST_FINAL_RESTORE ( mythid, lastdiva )
564        ENDIF        ENDIF
565  c--  c--
566  # else  #  else /* ALLOW_DIVIDED_ADJOINT undef */
567        CALL TIMER_START('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)        CALL TIMER_START('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)
568        CALL ADTHE_MAIN_LOOP ( mythid )        CALL ADTHE_MAIN_LOOP ( myCurrentTime, myCurrentIter, mythid )
569    cph      CALL ADTHE_MAIN_LOOP ( mythid )
570        CALL TIMER_STOP ('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)        CALL TIMER_STOP ('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)
571  # endif  #  endif /* ALLOW_DIVIDED_ADJOINT */
572  c--  c
573  #elif (defined (ALLOW_TANGENTLINEAR_RUN))  # else /* forward run only within AD setting */
574        CALL TIMER_START('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)  
575        CALL G_THE_MAIN_LOOP ( myCurrentTime, myCurrentIter, myThid )  #ifdef ALLOW_DEBUG
576        CALL TIMER_STOP ('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)        IF (debugMode) CALL DEBUG_CALL('THE_MAIN_LOOP',myThid)
577  #endif  #endif
578        _BARRIER  C--   Call time stepping loop of full model
579          CALL TIMER_START('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)
580          CALL THE_MAIN_LOOP( myCurrentTime, myCurrentIter, myThid )
581          CALL TIMER_STOP ('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)
582    
583    # endif
584    
585    # ifndef EXCLUDE_CTRL_PACK
586        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
587        IF ( myProcId .eq. 0 .AND. lastdiva ) THEN        IF ( myProcId .eq. 0 .AND. lastdiva .AND. doMainPack ) THEN
588           CALL TIMER_START('CTLR_PACK           [THE_MODEL_MAIN]',mythid)           CALL TIMER_START('CTRL_PACK           [THE_MODEL_MAIN]',mythid)
589           call CTRL_PACK( mycurrentiter, mycurrenttime, mythid )           CALL CTRL_PACK( .FALSE. , mythid )
590           CALL TIMER_STOP ('CTLR_PACK           [THE_MODEL_MAIN]',mythid)           CALL TIMER_STOP ('CTRL_PACK           [THE_MODEL_MAIN]',mythid)
591             IF ( ( optimcycle.EQ.0 .OR. (.NOT. doMainUnpack) )
592         &        .AND. mycurrentiter.EQ.niter0 ) THEN
593                CALL TIMER_START('CTRL_PACK     [THE_MODEL_MAIN]',mythid)
594                CALL CTRL_PACK( .TRUE. , mythid )
595                CALL TIMER_STOP ('CTRL_PACK     [THE_MODEL_MAIN]',mythid)
596             ENDIF
597        ENDIF        ENDIF
598        _END_MASTER( mythid )        _END_MASTER( mythid )
599        _BARRIER        _BARRIER
600    # endif /* EXCLUDE_CTRL_PACK */
601    
602  #ifdef ALLOW_GRADIENT_CHECK  
603    # ifdef ALLOW_GRDCHK
604        IF ( useGrdchk .AND. lastdiva ) THEN        IF ( useGrdchk .AND. lastdiva ) THEN
605           CALL TIMER_START('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)           CALL TIMER_START('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)
606           CALL GRDCHK_MAIN( mythid )           CALL GRDCHK_MAIN( mythid )
607           CALL TIMER_STOP ('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)           CALL TIMER_STOP ('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)
608           _BARRIER           _BARRIER
609        ENDIF        ENDIF
610  #endif  # endif
611    
612  #else /* ALLOW_ADJOINT_RUN undef */  #else /* ALL AD-related undef */
613    
614    #ifdef ALLOW_DEBUG
615          IF (debugMode) CALL DEBUG_CALL('THE_MAIN_LOOP',myThid)
616    #endif
617  C--   Call time stepping loop of full model  C--   Call time stepping loop of full model
618        CALL TIMER_START('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)        CALL TIMER_START('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)
619        CALL THE_MAIN_LOOP( myCurrentTime, myCurrentIter, myThid )        CALL THE_MAIN_LOOP( myCurrentTime, myCurrentIter, myThid )
620        CALL TIMER_STOP ('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)        CALL TIMER_STOP ('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)
621    
622  #endif /* ALLOW_ADJOINT_RUN */  #endif /* ALLOW_TANGENTLINEAR_RUN ALLOW_ADJOINT_RUN ALLOW_ADMTLM */
   
 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  
623    
624  C--   Final checkpoint (in case the in-loop checkpoint was missed)  C--   Final checkpoint (in case the in-loop checkpoint was missed)
625        CALL TIMER_START('WRITE_CHECKPOINT       [THE_MODEL_MAIN]',myThid)        CALL TIMER_START('WRITE_CHECKPOINT       [THE_MODEL_MAIN]',myThid)
626          CALL PACKAGES_WRITE_PICKUP(
627         I        .TRUE., myCurrentTime, myCurrentIter, myThid )
628        CALL WRITE_CHECKPOINT(        CALL WRITE_CHECKPOINT(
629       &        .TRUE., myCurrentTime, myCurrentIter, myThid )       I        .TRUE., myCurrentTime, myCurrentIter, myThid )
630        CALL TIMER_STOP ('WRITE_CHECKPOINT       [THE_MODEL_MAIN]',myThid)        CALL TIMER_STOP ('WRITE_CHECKPOINT       [THE_MODEL_MAIN]',myThid)
631    
632        CALL TIMER_STOP ('ALL                    [THE_MODEL_MAIN]',myThid)        CALL TIMER_STOP ('ALL                    [THE_MODEL_MAIN]',myThid)
633    
634    #ifdef ALLOW_DIAGNOSTICS
635          IF (useDiagnostics) THEN
636    C       Close all diagnostics output files
637            CALL DIAGSTATS_CLOSE_IO( myThid )
638          ENDIF
639    #endif
640    
641    #ifdef ALLOW_MNC
642          IF (useMNC) THEN
643    C       Close all open NetCDF files
644            _BEGIN_MASTER( mythid )
645            CALL MNC_FILE_CLOSE_ALL( myThid )
646            _END_MASTER( mythid )
647          ENDIF
648    #endif
649    
650  C--   Write timer statistics  C--   Write timer statistics
651        IF ( myThid .EQ. 1 ) THEN        IF ( myThid .EQ. 1 ) THEN
652         CALL TIMER_PRINTALL( myThid )         CALL TIMER_PRINTALL( myThid )
653         CALL COMM_STATS         CALL COMM_STATS
654        ENDIF        ENDIF
655    
656    #ifdef ALLOW_DEBUG
657          IF (debugMode) CALL DEBUG_LEAVE('THE_MODEL_MAIN',myThid)
658    #endif
659    
660        RETURN        RETURN
661        END        END

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

  ViewVC Help
Powered by ViewVC 1.1.22