/[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.49 by dimitri, Tue Feb 18 05:33:54 2003 UTC revision 1.52 by heimbach, Wed Mar 5 23:39:53 2003 UTC
# Line 459  C     myCurrentTime - Time counter for t Line 459  C     myCurrentTime - Time counter for t
459  C     myCurrentIter - Iteration counter for this thread  C     myCurrentIter - Iteration counter for this thread
460        INTEGER myCurrentIter        INTEGER myCurrentIter
461        _RL     myCurrentTime        _RL     myCurrentTime
462          logical  exst
463          logical  lastdiva
464  CEOP  CEOP
465    
466  C--   This timer encompasses the whole code  C--   This timer encompasses the whole code
# Line 479  C--   Set model configuration (fixed arr Line 481  C--   Set model configuration (fixed arr
481    
482        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
483        IF (myProcId .eq. 0) THEN        IF (myProcId .eq. 0) THEN
484           CALL TIMER_START('CTRL_UNPACK         [THE_MODEL_MAIN]',mythid)           inquire( file='costfinal', exist=exst )
485           CALL CTRL_UNPACK( mycurrentiter, mycurrenttime, mythid )           IF ( .NOT. exst) THEN
486           CALL TIMER_STOP ('CTRL_UNPACK         [THE_MODEL_MAIN]',mythid)              CALL TIMER_START('CTRL_UNPACK      [THE_MODEL_MAIN]',mythid)
487                CALL CTRL_UNPACK( mycurrentiter, mycurrenttime, mythid )
488                CALL TIMER_STOP ('CTRL_UNPACK      [THE_MODEL_MAIN]',mythid)
489             ENDIF
490        ENDIF        ENDIF
491        _END_MASTER( mythid )        _END_MASTER( mythid )
492        _BARRIER        _BARRIER
# Line 491  C--   Set model configuration (fixed arr Line 496  C--   Set model configuration (fixed arr
496    
497  #if ( defined (ALLOW_ADJOINT_RUN) || \  #if ( defined (ALLOW_ADJOINT_RUN) || \
498        defined (ALLOW_ECCO_OPTIMIZATION) )        defined (ALLOW_ECCO_OPTIMIZATION) )
499        CALL TIMER_START('ADTHE_MAIN_LOOP           [ADJOINT RUN]',mythid)  # ifdef ALLOW_DIVIDED_ADJOINT
500    c-- The following assumes the TAF option '-pure'
501          inquire( file='costfinal', exist=exst )
502          IF ( .NOT. exst) THEN
503             CALL TIMER_START('MDTHE_MAIN_LOOP            [MD RUN]', mythid)
504             CALL MDTHE_MAIN_LOOP ( myCurrentTime, myCurrentIter, mythid )
505             CALL TIMER_STOP ('MDTHE_MAIN_LOOP            [MD RUN]', mythid)
506             CALL COST_FINAL_STORE ( mythid, lastdiva )
507          ELSE
508             CALL TIMER_START('ADTHE_MAIN_LOOP       [ADJOINT RUN]', mythid)
509             CALL ADTHE_MAIN_LOOP ( mythid )
510             CALL TIMER_STOP ('ADTHE_MAIN_LOOP       [ADJOINT RUN]', mythid)
511             CALL COST_FINAL_RESTORE ( mythid, lastdiva )
512          ENDIF
513    c--
514    # else
515          CALL TIMER_START('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)
516        CALL ADTHE_MAIN_LOOP ( mythid )        CALL ADTHE_MAIN_LOOP ( mythid )
517        CALL TIMER_STOP ('ADTHE_MAIN_LOOP           [ADJOINT RUN]',mythid)        CALL TIMER_STOP ('ADTHE_MAIN_LOOP          [ADJOINT RUN]', mythid)
518        _BARRIER  # endif
519    c--
520  #elif (defined (ALLOW_TANGENTLINEAR_RUN))  #elif (defined (ALLOW_TANGENTLINEAR_RUN))
521        CALL TIMER_START('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)        CALL TIMER_START('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)
522        CALL G_THE_MAIN_LOOP ( myCurrentTime, myCurrentIter, myThid )        CALL G_THE_MAIN_LOOP ( myCurrentTime, myCurrentIter, myThid )
523        CALL TIMER_STOP ('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)        CALL TIMER_STOP ('G_THE_MAIN_LOOP           [TANGENT RUN]',mythid)
       _BARRIER  
524  #endif  #endif
525          _BARRIER
526    
527        _BEGIN_MASTER( mythid )        _BEGIN_MASTER( mythid )
528        IF (myProcId .eq. 0) THEN        IF ( myProcId .eq. 0 .AND. lastdiva ) THEN
529           CALL TIMER_START('CTLR_PACK           [THE_MODEL_MAIN]',mythid)           CALL TIMER_START('CTLR_PACK           [THE_MODEL_MAIN]',mythid)
530           call CTRL_PACK( mycurrentiter, mycurrenttime, mythid )           call CTRL_PACK( mycurrentiter, mycurrenttime, mythid )
531           CALL TIMER_STOP ('CTLR_PACK           [THE_MODEL_MAIN]',mythid)           CALL TIMER_STOP ('CTLR_PACK           [THE_MODEL_MAIN]',mythid)
# Line 511  C--   Set model configuration (fixed arr Line 533  C--   Set model configuration (fixed arr
533        _END_MASTER( mythid )        _END_MASTER( mythid )
534        _BARRIER        _BARRIER
535    
536    #ifdef ALLOW_GRADIENT_CHECK
537          IF ( useGrdchk .AND. lastdiva ) THEN
538             CALL TIMER_START('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)
539             CALL GRDCHK_MAIN( mythid )
540             CALL TIMER_STOP ('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)
541             _BARRIER
542          ENDIF
543    #endif
544    
545  #else /* ALLOW_ADJOINT_RUN undef */  #else /* ALLOW_ADJOINT_RUN undef */
546    
547  C--   Call time stepping loop of full model  C--   Call time stepping loop of full model
# Line 520  C--   Call time stepping loop of full mo Line 551  C--   Call time stepping loop of full mo
551    
552  #endif /* ALLOW_ADJOINT_RUN */  #endif /* ALLOW_ADJOINT_RUN */
553    
554  #ifdef ALLOW_GRADIENT_CHECK  C--   Sea-ice checkpoint (in case the in-loop checkpoint was missed)
555        if (useGrdchk) then  #ifdef ALLOW_SEAICE
556           CALL TIMER_START('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)        IF ( useSEAICE )
557           CALL GRDCHK_MAIN( mythid )       &     CALL SEAICE_WRITE_PICKUP(
558           CALL TIMER_STOP ('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)       &     .TRUE., myCurrentTime, myCurrentIter, myThid )
          _BARRIER  
       end if  
559  #endif  #endif
560    
561  C--   Final checkpoint (in case the in-loop checkpoint was missed)  C--   Final checkpoint (in case the in-loop checkpoint was missed)
# Line 535  C--   Final checkpoint (in case the in-l Line 564  C--   Final checkpoint (in case the in-l
564       &        .TRUE., myCurrentTime, myCurrentIter, myThid )       &        .TRUE., myCurrentTime, myCurrentIter, myThid )
565        CALL TIMER_STOP ('WRITE_CHECKPOINT       [THE_MODEL_MAIN]',myThid)        CALL TIMER_STOP ('WRITE_CHECKPOINT       [THE_MODEL_MAIN]',myThid)
566    
 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  
   
567        CALL TIMER_STOP ('ALL                    [THE_MODEL_MAIN]',myThid)        CALL TIMER_STOP ('ALL                    [THE_MODEL_MAIN]',myThid)
568    
569  C--   Write timer statistics  C--   Write timer statistics

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

  ViewVC Help
Powered by ViewVC 1.1.22