/[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.45 by heimbach, Mon Sep 16 18:11:58 2002 UTC revision 1.74 by dimitri, Tue Mar 2 08:45:46 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 142  C    | | | |-INI_VEL    :: Initialize 3D Line 145  C    | | | |-INI_VEL    :: Initialize 3D
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.
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
149  C    | | |  C    | | |
150  C    | | |-INI_TR1      :: Set initial tracer 1 distribution.  C    | | |-INI_TR1      :: Set initial tracer 1 distribution.
151  C    | | |  C    | | |
# Line 177  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 219  C/\  | | | |                    :: Simpl Line 225  C/\  | | | |                    :: Simpl
225  C/\  | | | |                    :: for forcing datasets.  C/\  | | | |                    :: for forcing datasets.
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 )
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/\  | | | |
234  C/\  | | | |-INTEGRATE_FOR_W :: Integrate for vertical velocity.  C/\  | | | |-INTEGRATE_FOR_W :: Integrate for vertical velocity.
235  C/\  | | | |-OBCS_APPLY_W    :: Open bndy. package ( see pkg/obcs ).  C/\  | | | |-OBCS_APPLY_W    :: Open bndy. package ( see pkg/obcs ).
236  C/\  | | | |-FIND_RHO        :: Calculates [rho(S,T,z)-Rhonil] of a slice  C/\  | | | |-FIND_RHO        :: Calculates [rho(S,T,z)-RhoConst] of a slice
237  C/\  | | | |-GRAD_SIGMA      :: Calculate isoneutral gradients  C/\  | | | |-GRAD_SIGMA      :: Calculate isoneutral gradients
238  C/\  | | | |-CALC_IVDC       :: Set Implicit Vertical Diffusivity for Convection  C/\  | | | |-CALC_IVDC       :: Set Implicit Vertical Diffusivity for Convection
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 248  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 258  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 269  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 334  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 344  C/\  | | | |-TIMEAVE_STATV_WRITE :: Time Line 376  C/\  | | | |-TIMEAVE_STATV_WRITE :: Time
376  C/\  | | | |-AIM_WRITE_DIAGS     :: Intermed. atmos diags. see pkg/aim  C/\  | | | |-AIM_WRITE_DIAGS     :: Intermed. atmos diags. see pkg/aim
377  C/\  | | | |-GMREDI_DIAGS        :: GM diags. see pkg/gmredi  C/\  | | | |-GMREDI_DIAGS        :: GM diags. see pkg/gmredi
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
380    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 367  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 432  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 453  C           impose additional synchronis Line 494  C           impose additional synchronis
494  C           updated.  C           updated.
495  C     myCurrentTime - Time counter for this thread  C     myCurrentTime - Time counter for this thread
496  C     myCurrentIter - Iteration counter for this thread  C     myCurrentIter - Iteration counter for this thread
       INTEGER I  
       INTEGER bi,bj  
497        INTEGER myCurrentIter        INTEGER myCurrentIter
498        _RL     myCurrentTime        _RL     myCurrentTime
499          logical  exst
500          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 470  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           CALL TIMER_START('CTRL_UNPACK         [THE_MODEL_MAIN]',mythid)           inquire( file='costfinal', exist=exst )
542           CALL CTRL_UNPACK( mycurrentiter, mycurrenttime, mythid )           IF ( .NOT. exst .AND. niter0 .EQ. 0 ) THEN
543           CALL TIMER_STOP ('CTRL_UNPACK         [THE_MODEL_MAIN]',mythid)              CALL TIMER_START('CTRL_UNPACK      [THE_MODEL_MAIN]',mythid)
544                CALL CTRL_UNPACK( .TRUE. , mythid )
545                CALL TIMER_STOP ('CTRL_UNPACK      [THE_MODEL_MAIN]',mythid)
546                IF ( optimcycle.EQ.0 .AND. mycurrentiter.EQ.niter0 ) THEN
547                   CALL TIMER_START('CTRL_PACK     [THE_MODEL_MAIN]',mythid)
548                   CALL CTRL_PACK( .TRUE. , mythid )
549                   CALL TIMER_STOP ('CTRL_PACK     [THE_MODEL_MAIN]',mythid)
550                ENDIF
551             ENDIF
552        ENDIF        ENDIF
553        _END_MASTER( mythid )        _END_MASTER( mythid )
554        _BARRIER        _BARRIER
555    # endif /* EXCLUDE_CTRL_PACK */
556    
557        CALL COST_DEPENDENT_INIT ( mythid )        CALL COST_DEPENDENT_INIT ( mythid )
558        _BARRIER        _BARRIER
559    
560  #if ( defined (ALLOW_ADJOINT_RUN) || \  # if ( defined (ALLOW_TANGENTLINEAR_RUN) )
561        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))  
562        CALL TIMER_START('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)        CALL TIMER_START('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)
563        CALL G_THE_MAIN_LOOP ( myCurrentTime, myCurrentIter, myThid )        CALL G_THE_MAIN_LOOP ( myCurrentTime, myCurrentIter, myThid )
564        CALL TIMER_STOP ('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)        CALL TIMER_STOP ('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)
565        _BARRIER  c
566  #endif  # elif ( defined (ALLOW_ADJOINT_RUN) || \
567             defined (ALLOW_ECCO_OPTIMIZATION) )
568    c
569    #  ifdef ALLOW_DIVIDED_ADJOINT
570    c-- The following assumes the TAF option '-pure'
571          inquire( file='costfinal', exist=exst )
572          IF ( .NOT. exst) THEN
573             CALL TIMER_START('MDTHE_MAIN_LOOP            [MD RUN]', mythid)
574             CALL MDTHE_MAIN_LOOP ( myCurrentTime, myCurrentIter, mythid )
575             CALL TIMER_STOP ('MDTHE_MAIN_LOOP            [MD RUN]', mythid)
576             CALL COST_FINAL_STORE ( mythid, lastdiva )
577          ELSE
578             CALL TIMER_START('ADTHE_MAIN_LOOP       [ADJOINT RUN]', mythid)
579             CALL ADTHE_MAIN_LOOP ( myCurrentTime, myCurrentIter, mythid )
580             CALL TIMER_STOP ('ADTHE_MAIN_LOOP       [ADJOINT RUN]', mythid)
581             CALL COST_FINAL_RESTORE ( mythid, lastdiva )
582          ENDIF
583    c--
584    #  else /* ALLOW_DIVIDED_ADJOINT undef */
585          CALL TIMER_START('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)
586          CALL ADTHE_MAIN_LOOP ( myCurrentTime, myCurrentIter, mythid )
587    cph      CALL ADTHE_MAIN_LOOP ( mythid )
588          CALL TIMER_STOP ('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)
589    #  endif /* ALLOW_DIVIDED_ADJOINT */
590    c
591    # endif
592    
593    # ifndef EXCLUDE_CTRL_PACK
594        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
595        IF (myProcId .eq. 0) THEN        IF ( myProcId .eq. 0 .AND. lastdiva ) THEN
596           CALL TIMER_START('CTLR_PACK           [THE_MODEL_MAIN]',mythid)           CALL TIMER_START('CTRL_PACK           [THE_MODEL_MAIN]',mythid)
597           call CTRL_PACK( mycurrentiter, mycurrenttime, mythid )           call CTRL_PACK( .FALSE. , mythid )
598           CALL TIMER_STOP ('CTLR_PACK           [THE_MODEL_MAIN]',mythid)           CALL TIMER_STOP ('CTRL_PACK           [THE_MODEL_MAIN]',mythid)
599        ENDIF        ENDIF
600        _END_MASTER( mythid )        _END_MASTER( mythid )
601        _BARRIER        _BARRIER
602    # endif /* EXCLUDE_CTRL_PACK */
603    
 #else /* ALLOW_ADJOINT_RUN undef */  
   
 C--   Call time stepping loop of full model  
       CALL TIMER_START('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)  
       CALL THE_MAIN_LOOP( myCurrentTime, myCurrentIter, myThid )  
       CALL TIMER_STOP ('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)  
   
 #endif /* ALLOW_ADJOINT_RUN */  
604    
605  #ifdef ALLOW_GRADIENT_CHECK  # ifdef ALLOW_GRDCHK
606        if (useGrdchk) then        IF ( useGrdchk .AND. lastdiva ) THEN
607           CALL TIMER_START('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)           CALL TIMER_START('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)
608           CALL GRDCHK_MAIN( mythid )           CALL GRDCHK_MAIN( mythid )
609           CALL TIMER_STOP ('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)           CALL TIMER_STOP ('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)
610           _BARRIER           _BARRIER
611        end if        ENDIF
612    # endif
613    
614    #else /* ALL AD-related undef */
615    
616    #ifdef ALLOW_DEBUG
617          IF (debugMode) CALL DEBUG_CALL('THE_MAIN_LOOP',myThid)
618  #endif  #endif
619    
620  C--   Final checkpoint (incase the in-loop checkpoint was missed)  C--   Call time stepping loop of full model
621          CALL TIMER_START('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)
622          CALL THE_MAIN_LOOP( myCurrentTime, myCurrentIter, myThid )
623          CALL TIMER_STOP ('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)
624    
625    #endif /* ALLOW_TANGENTLINEAR_RUN ALLOW_ADJOINT_RUN ALLOW_ADMTLM_RUN */
626    
627    C--   Final checkpoint (in case the in-loop checkpoint was missed)
628        CALL TIMER_START('WRITE_CHECKPOINT       [THE_MODEL_MAIN]',myThid)        CALL TIMER_START('WRITE_CHECKPOINT       [THE_MODEL_MAIN]',myThid)
629          CALL PACKAGES_WRITE_PICKUP(
630         I        .TRUE., myCurrentTime, myCurrentIter, myThid )
631        CALL WRITE_CHECKPOINT(        CALL WRITE_CHECKPOINT(
632       &        .TRUE., myCurrentTime, myCurrentIter, myThid )       I        .TRUE., myCurrentTime, myCurrentIter, myThid )
633        CALL TIMER_STOP ('WRITE_CHECKPOINT       [THE_MODEL_MAIN]',myThid)        CALL TIMER_STOP ('WRITE_CHECKPOINT       [THE_MODEL_MAIN]',myThid)
634    
635        CALL TIMER_STOP ('ALL                    [THE_MODEL_MAIN]',myThid)        CALL TIMER_STOP ('ALL                    [THE_MODEL_MAIN]',myThid)
636    
637    #ifdef ALLOW_MNC
638    C     Close all open NetCDF files
639          _BEGIN_MASTER( mythid )
640          CALL MNC_FILE_CLOSE_ALL()
641          _END_MASTER( mythid )
642    #endif
643    
644  C--   Write timer statistics  C--   Write timer statistics
645        IF ( myThid .EQ. 1 ) THEN        IF ( myThid .EQ. 1 ) THEN
646         CALL TIMER_PRINTALL( myThid )         CALL TIMER_PRINTALL( myThid )
647         CALL COMM_STATS         CALL COMM_STATS
648        ENDIF        ENDIF
649    
650    #ifdef ALLOW_DEBUG
651          IF (debugMode) CALL DEBUG_LEAVE('THE_MODEL_MAIN',myThid)
652    #endif
653    
654        RETURN        RETURN
655        END        END

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.74

  ViewVC Help
Powered by ViewVC 1.1.22