/[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.74 by dimitri, Tue Mar 2 08:45:46 2004 UTC revision 1.85 by heimbach, Sat Dec 4 17:57:06 2004 UTC
# Line 146  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 279  C/\  | | | | |-FREESURF_RESCALE_G :: Re- Line 278  C/\  | | | | |-FREESURF_RESCALE_G :: Re-
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/\  | | | |
 C/\  | | | |-CALC_GTR1            :: Calculate other tracer(s) tendency terms  
 C/\  | | | | |  
 C/\  | | | | |-GAD_CALC_RHS       :: Generalised advection package  
 C/\  | | | | |                    :: ( see pkg/gad )  
 C/\  | | | | |  
 C/\  | | | | |-EXTERNAL_FORCING_TR:: Problem specific forcing for tracer.  
 C/\  | | | | |-ADAMS_BASHFORTH2   :: Extrapolate tendencies forward in time.  
 C/\  | | | | |-FREESURF_RESCALE_G :: Re-scale Gs for free-surface height.  
 C/\  | | | |  
281  C/\  | | | |-TIMESTEP_TRACER      :: Step tracer field forward in time  C/\  | | | |-TIMESTEP_TRACER      :: Step tracer field forward in time
282  C/\  | | | |  C/\  | | | |
283  C/\  | | | |-PTRACERS_INTEGRATE   :: Integrate other tracer(s) ( see pkg/ptracers ).  C/\  | | | |-PTRACERS_INTEGRATE   :: Integrate other tracer(s) ( see pkg/ptracers ).
# Line 473  C     == Global variables === Line 463  C     == Global variables ===
463  # include "CG3D.h"  # include "CG3D.h"
464  #endif  #endif
465    
 #ifdef ALLOW_ECCO_OPTIMIZATION  
 # include "optim.h"  
 #endif  
466  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
467  # include "tamc.h"  # include "tamc.h"
468  #endif  #endif
469    #ifdef ALLOW_CTRL
470    # include "optim.h"
471    #endif
472    
473  C     !INPUT/OUTPUT PARAMETERS:  C     !INPUT/OUTPUT PARAMETERS:
474  C     == Routine arguments ==  C     == Routine arguments ==
# Line 498  C     myCurrentIter - Iteration counter Line 488  C     myCurrentIter - Iteration counter
488        _RL     myCurrentTime        _RL     myCurrentTime
489        logical  exst        logical  exst
490        logical  lastdiva        logical  lastdiva
 #ifndef ALLOW_ECCO_OPTIMIZATION  
       integer optimcycle  
 #endif  
491  CEOP  CEOP
492  c--   set default:  c--   set default:
 #ifndef ALLOW_ECCO_OPTIMIZATION  
       optimcycle = 0  
 #endif  
493        lastdiva = .TRUE.        lastdiva = .TRUE.
494    
495  #ifdef ALLOW_DEBUG  #ifdef ALLOW_DEBUG
# Line 529  C--   Set model configuration (fixed arr Line 513  C--   Set model configuration (fixed arr
513    
514  #if ( defined (ALLOW_ADMTLM) )  #if ( defined (ALLOW_ADMTLM) )
515  c  c
516        CALL TIMER_START('ADMTLM_DRIVER          [THE_MODEL_MAIN]',mythid)        STOP 'should never get here; ADMTLM_DSVD calls ADMTLM_DRIVER'
       CALL ADMTLM_DRIVER ( myThid )  
       CALL TIMER_STOP ('ADMTLM_DRIVER          [THE_MODEL_MAIN]',mythid)  
517  c  c
518  #elif ( defined (ALLOW_AUTODIFF))  #elif ( defined (ALLOW_AUTODIFF))
519    
# Line 540  c Line 522  c
522        IF (myProcId .eq. 0) THEN        IF (myProcId .eq. 0) THEN
523           inquire( file='costfinal', exist=exst )           inquire( file='costfinal', exist=exst )
524           IF ( .NOT. exst .AND. niter0 .EQ. 0 ) THEN           IF ( .NOT. exst .AND. niter0 .EQ. 0 ) THEN
525              CALL TIMER_START('CTRL_UNPACK      [THE_MODEL_MAIN]',mythid)              IF ( optimcycle.NE.0 ) THEN
526              CALL CTRL_UNPACK( .TRUE. , mythid )                 CALL TIMER_START('CTRL_UNPACK   [THE_MODEL_MAIN]',mythid)
527              CALL TIMER_STOP ('CTRL_UNPACK      [THE_MODEL_MAIN]',mythid)                 CALL CTRL_UNPACK( .TRUE. , mythid )
528                   CALL TIMER_STOP ('CTRL_UNPACK   [THE_MODEL_MAIN]',mythid)
529                ENDIF
530              IF ( optimcycle.EQ.0 .AND. mycurrentiter.EQ.niter0 ) THEN              IF ( optimcycle.EQ.0 .AND. mycurrentiter.EQ.niter0 ) THEN
531                 CALL TIMER_START('CTRL_PACK     [THE_MODEL_MAIN]',mythid)                 CALL TIMER_START('CTRL_PACK     [THE_MODEL_MAIN]',mythid)
532                 CALL CTRL_PACK( .TRUE. , mythid )                 CALL CTRL_PACK( .TRUE. , mythid )
# Line 554  c Line 538  c
538        _BARRIER        _BARRIER
539  # endif /* EXCLUDE_CTRL_PACK */  # endif /* EXCLUDE_CTRL_PACK */
540    
541    # ifdef ALLOW_COST
542        CALL COST_DEPENDENT_INIT ( mythid )        CALL COST_DEPENDENT_INIT ( mythid )
543        _BARRIER        _BARRIER
544    # endif
545    
546  # if ( defined (ALLOW_TANGENTLINEAR_RUN) )  # if ( defined (ALLOW_TANGENTLINEAR_RUN) )
547  c  c
# Line 588  cph      CALL ADTHE_MAIN_LOOP ( mythid ) Line 574  cph      CALL ADTHE_MAIN_LOOP ( mythid )
574        CALL TIMER_STOP ('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)        CALL TIMER_STOP ('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)
575  #  endif /* ALLOW_DIVIDED_ADJOINT */  #  endif /* ALLOW_DIVIDED_ADJOINT */
576  c  c
577    # else /* forward run only within AD setting */
578    
579    #ifdef ALLOW_DEBUG
580          IF (debugMode) CALL DEBUG_CALL('THE_MAIN_LOOP',myThid)
581    #endif
582    C--   Call time stepping loop of full model
583          CALL TIMER_START('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)
584          CALL THE_MAIN_LOOP( myCurrentTime, myCurrentIter, myThid )
585          CALL TIMER_STOP ('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)
586    
587  # endif  # endif
588    
589  # ifndef EXCLUDE_CTRL_PACK  # ifndef EXCLUDE_CTRL_PACK
# Line 616  c Line 612  c
612  #ifdef ALLOW_DEBUG  #ifdef ALLOW_DEBUG
613        IF (debugMode) CALL DEBUG_CALL('THE_MAIN_LOOP',myThid)        IF (debugMode) CALL DEBUG_CALL('THE_MAIN_LOOP',myThid)
614  #endif  #endif
   
615  C--   Call time stepping loop of full model  C--   Call time stepping loop of full model
616        CALL TIMER_START('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)        CALL TIMER_START('THE_MAIN_LOOP          [THE_MODEL_MAIN]',myThid)
617        CALL THE_MAIN_LOOP( myCurrentTime, myCurrentIter, myThid )        CALL THE_MAIN_LOOP( myCurrentTime, myCurrentIter, myThid )
# Line 635  C--   Final checkpoint (in case the in-l Line 630  C--   Final checkpoint (in case the in-l
630        CALL TIMER_STOP ('ALL                    [THE_MODEL_MAIN]',myThid)        CALL TIMER_STOP ('ALL                    [THE_MODEL_MAIN]',myThid)
631    
632  #ifdef ALLOW_MNC  #ifdef ALLOW_MNC
633  C     Close all open NetCDF files        IF (useMNC) THEN
634        _BEGIN_MASTER( mythid )  C       Close all open NetCDF files
635        CALL MNC_FILE_CLOSE_ALL()          _BEGIN_MASTER( mythid )
636        _END_MASTER( mythid )          CALL MNC_FILE_CLOSE_ALL( myThid )
637            _END_MASTER( mythid )
638          ENDIF
639  #endif  #endif
640    
641  C--   Write timer statistics  C--   Write timer statistics

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

  ViewVC Help
Powered by ViewVC 1.1.22