/[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.51 by heimbach, Fri Feb 28 03:01:28 2003 UTC revision 1.52 by heimbach, Wed Mar 5 23:39:53 2003 UTC
# Line 460  C     myCurrentIter - Iteration counter Line 460  C     myCurrentIter - Iteration counter
460        INTEGER myCurrentIter        INTEGER myCurrentIter
461        _RL     myCurrentTime        _RL     myCurrentTime
462        logical  exst        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 480  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           inquire( file='divided.ctrl', exist=exst )           inquire( file='costfinal', exist=exst )
485           IF ( .NOT. exst) THEN           IF ( .NOT. exst) THEN
486              CALL TIMER_START('CTRL_UNPACK      [THE_MODEL_MAIN]',mythid)              CALL TIMER_START('CTRL_UNPACK      [THE_MODEL_MAIN]',mythid)
487              CALL CTRL_UNPACK( mycurrentiter, mycurrenttime, mythid )              CALL CTRL_UNPACK( mycurrentiter, mycurrenttime, mythid )
# Line 495  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 515  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 524  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    
 #ifdef ALLOW_GRADIENT_CHECK  
       if (useGrdchk) then  
          CALL TIMER_START('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)  
          CALL GRDCHK_MAIN( mythid )  
          CALL TIMER_STOP ('GRDCHK_MAIN         [THE_MODEL_MAIN]',mythid)  
          _BARRIER  
       end if  
 #endif  
   
554  C--   Sea-ice checkpoint (in case the in-loop checkpoint was missed)  C--   Sea-ice checkpoint (in case the in-loop checkpoint was missed)
555  #ifdef ALLOW_SEAICE  #ifdef ALLOW_SEAICE
556        IF ( useSEAICE )        IF ( useSEAICE )

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

  ViewVC Help
Powered by ViewVC 1.1.22