/[MITgcm]/MITgcm/pkg/ecco/the_main_loop.F
ViewVC logotype

Diff of /MITgcm/pkg/ecco/the_main_loop.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.42 by heimbach, Mon Oct 23 22:43:05 2006 UTC revision 1.48 by heimbach, Wed Dec 13 22:31:19 2006 UTC
# Line 261  cph because we only have active file han Line 261  cph because we only have active file han
261    
262        CALL TIMER_START('ECCO SPIN-UP', mythid)        CALL TIMER_START('ECCO SPIN-UP', mythid)
263    
264    #ifdef ALLOW_CAL
265  c--   Get the current date.  c--   Get the current date.
266        call CAL_TIMESTAMP( myiter, mytime, mydate, mythid )        call CAL_TIMESTAMP( myiter, mytime, mydate, mythid )
267    #endif
268    
269  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
270  # ifdef NONLIN_FRSURF  # ifdef NONLIN_FRSURF
# Line 416  c-- Line 418  c--
418  # ifdef ALLOW_PTRACERS  # ifdef ALLOW_PTRACERS
419  CADJ INIT comlev1_bibj_ptracers = COMMON,  CADJ INIT comlev1_bibj_ptracers = COMMON,
420  CADJ &    nchklev_1*nsx*nsy*nthreads_chkpt*PTRACERS_num  CADJ &    nchklev_1*nsx*nsy*nthreads_chkpt*PTRACERS_num
421    CADJ INIT comlev1_bibj_k_ptracers = COMMON,
422    CADJ &    nchklev_1*nsx*nsy*nthreads_chkpt*PTRACERS_num*nr
423  # endif /* ALLOW_PTRACERS */  # endif /* ALLOW_PTRACERS */
424  c--  c--
425  cph Now also needed by seaice  cph Now also needed by seaice
# Line 506  c--     Set the model iteration counter Line 510  c--     Set the model iteration counter
510          CALL AUTODIFF_INADMODE_UNSET( myThid )          CALL AUTODIFF_INADMODE_UNSET( myThid )
511  #endif  #endif
512    
   
 #ifndef ALLOW_DIVIDED_ADJOINT  
513  #ifdef ALLOW_DIAGNOSTICS  #ifdef ALLOW_DIAGNOSTICS
514  C--   Switch on/off diagnostics for snap-shot output:  C--   State-variables diagnostics
515        IF ( useDiagnostics ) THEN        IF ( useDiagnostics ) THEN
516    C--   Switch on/off diagnostics for snap-shot output:
517          CALL DIAGNOSTICS_SWITCH_ONOFF( myTime, myIter, myThid )          CALL DIAGNOSTICS_SWITCH_ONOFF( myTime, myIter, myThid )
       ENDIF  
 C--   State-variables diagnostics  
       IF ( usediagnostics ) THEN  
518          CALL TIMER_START('DO_STATEVARS_DIAGS  [FORWARD_STEP]',myThid)          CALL TIMER_START('DO_STATEVARS_DIAGS  [FORWARD_STEP]',myThid)
519          CALL DO_STATEVARS_DIAGS( myTime, 0, myIter, myThid )          CALL DO_STATEVARS_DIAGS( myTime, 0, myIter, myThid )
520          CALL TIMER_STOP ('DO_STATEVARS_DIAGS  [FORWARD_STEP]',myThid)          CALL TIMER_STOP ('DO_STATEVARS_DIAGS  [FORWARD_STEP]',myThid)
521        ENDIF        ENDIF
522  #endif  #endif
 #endif  
523    
524  #ifdef ALLOW_PROFILES  #ifdef ALLOW_PROFILES
525  c--     Accumulate in-situ time averages of temperature, salinity, and SSH.  c--     Accumulate in-situ time averages of temperature, salinity, and SSH.
# Line 602  C--     Step forward fields and calculat Line 601  C--     Step forward fields and calculat
601  cphCADJ STORE empmr              = comlev1, key = ikey_dynamics  cphCADJ STORE empmr              = comlev1, key = ikey_dynamics
602  cphCADJ STORE pmepr              = comlev1, key = ikey_dynamics  cphCADJ STORE pmepr              = comlev1, key = ikey_dynamics
603  # endif  # endif
604    # ifdef ALLOW_PTRACERS
605    CADJ STORE ptracer               = comlev1, key = ikey_dynamics
606    # endif
607  # ifdef NONLIN_FRSURF  # ifdef NONLIN_FRSURF
608  cph-test  cph-test
609  CADJ STORE hFacC              = comlev1, key = ikey_dynamics  CADJ STORE hFacC              = comlev1, key = ikey_dynamics
# Line 939  C--   do exchanges of U,V (needed for mu Line 941  C--   do exchanges of U,V (needed for mu
941          CALL DO_STAGGER_FIELDS_EXCHANGES( myTime, myIter, myThid )          CALL DO_STAGGER_FIELDS_EXCHANGES( myTime, myIter, myThid )
942          CALL TIMER_STOP ('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)          CALL TIMER_STOP ('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)
943    
 #ifndef ALLOW_DIVIDED_ADJOINT  
944  #ifdef ALLOW_DIAGNOSTICS  #ifdef ALLOW_DIAGNOSTICS
945  C--   State-variables diagnostics  C--   State-variables diagnostics
946         IF ( usediagnostics ) THEN         IF ( usediagnostics ) THEN
# Line 948  C--   State-variables diagnostics Line 949  C--   State-variables diagnostics
949          CALL TIMER_STOP ('DO_STATEVARS_DIAGS  [FORWARD_STEP]',myThid)          CALL TIMER_STOP ('DO_STATEVARS_DIAGS  [FORWARD_STEP]',myThid)
950         ENDIF         ENDIF
951  #endif  #endif
 #endif  
952    
953  #ifdef ALLOW_DEBUG  #ifdef ALLOW_DEBUG
954          IF ( debugLevel .GE. debLevB )          IF ( debugLevel .GE. debLevB )
# Line 996  C--   Do "blocking" sends and receives f Line 996  C--   Do "blocking" sends and receives f
996        CALL DO_FIELDS_BLOCKING_EXCHANGES( myThid )        CALL DO_FIELDS_BLOCKING_EXCHANGES( myThid )
997        CALL TIMER_STOP ('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)        CALL TIMER_STOP ('BLOCKING_EXCHANGES  [FORWARD_STEP]',myThid)
998    
999    #ifdef ALLOW_DIAGNOSTICS
1000          IF ( useDiagnostics ) THEN
1001           CALL TIMER_START('DO_STATEVARS_DIAGS  [FORWARD_STEP]',myThid)
1002           CALL DO_STATEVARS_DIAGS( myTime, 2, myIter, myThid )
1003           CALL TIMER_STOP ('DO_STATEVARS_DIAGS  [FORWARD_STEP]',myThid)
1004          ENDIF
1005    #endif
1006    
1007  #ifdef ALLOW_FLT  #ifdef ALLOW_FLT
1008  C--   Calculate float trajectories  C--   Calculate float trajectories
1009        IF (useFLT) THEN        IF (useFLT) THEN
# Line 1009  C--   Calculate float trajectories Line 1017  C--   Calculate float trajectories
1017          CALL AUTODIFF_INADMODE_SET( myThid )          CALL AUTODIFF_INADMODE_SET( myThid )
1018  #endif  #endif
1019    
1020  #ifndef ALLOW_DIVIDED_ADJOINT  #ifdef ALLOW_TIMEAVE
1021  C--   State-variables time-averaging  C--   State-variables time-averaging
1022        CALL TIMER_START('DO_STATEVARS_TAVE   [FORWARD_STEP]',myThid)        CALL TIMER_START('DO_STATEVARS_TAVE   [FORWARD_STEP]',myThid)
1023        CALL DO_STATEVARS_TAVE( myTime, myIter, myThid )        CALL DO_STATEVARS_TAVE( myTime, myIter, myThid )
1024        CALL TIMER_STOP ('DO_STATEVARS_TAVE   [FORWARD_STEP]',myThid)        CALL TIMER_STOP ('DO_STATEVARS_TAVE   [FORWARD_STEP]',myThid)
1025    #endif
1026    
1027  #ifndef ALLOW_OFFLINE  #ifndef ALLOW_OFFLINE
1028  #ifdef ALLOW_MONITOR  #ifdef ALLOW_MONITOR
# Line 1035  C--   Do IO if needed. Line 1044  C--   Do IO if needed.
1044        CALL TIMER_STOP ('DO_THE_MODEL_IO     [FORWARD_STEP]',myThid)        CALL TIMER_STOP ('DO_THE_MODEL_IO     [FORWARD_STEP]',myThid)
1045  #endif  #endif
1046    
1047    #ifndef ALLOW_DIVIDED_ADJOINT
1048    # ifdef HAVE_SIGREG
1049          IF ( useSIGREG ) THEN
1050            IF ( i_got_signal .GT. 0 ) THEN
1051              CALL PACKAGES_WRITE_PICKUP(
1052         I         .TRUE., myTime, myIter, myThid )
1053              CALL WRITE_PICKUP(
1054         I         .TRUE., myTime, myIter, myThid )
1055              STOP 'Checkpoint completed -- killed by signal handler'
1056            ENDIF
1057          ENDIF
1058    # endif /* HAVE_SIGREG */
1059  C--   Save state for restarts  C--   Save state for restarts
1060        CALL TIMER_START('WRITE_CHECKPOINT    [FORWARD_STEP]',myThid)        CALL TIMER_START('DO_WRITE_PICKUP     [FORWARD_STEP]',myThid)
1061        CALL PACKAGES_WRITE_PICKUP(        CALL DO_WRITE_PICKUP(
1062       I               .FALSE., myTime, myIter, myThid )       I               .FALSE., myTime, myIter, myThid )
1063  #ifndef ALLOW_OFFLINE        CALL TIMER_STOP ('DO_WRITE_PICKUP     [FORWARD_STEP]',myThid)
1064        CALL WRITE_CHECKPOINT(  #endif /* ALLOW_DIVIDED_ADJOINT */
      I               .FALSE., myTime, myIter, myThid )    
 #endif  
       CALL TIMER_STOP ('WRITE_CHECKPOINT    [FORWARD_STEP]',myThid)  
 #endif  
1065    
1066  #ifdef TIME_PER_TIMESTEP  #ifdef TIME_PER_TIMESTEP
1067  CCE107 Time per timestep information  CCE107 Time per timestep information
# Line 1124  c Line 1141  c
1141        call timer_start('ECCO SPIN-DOWN', mythid)        call timer_start('ECCO SPIN-DOWN', mythid)
1142    
1143  #ifdef ALLOW_PROFILES  #ifdef ALLOW_PROFILES
1144  c  #ifndef ALLOW_DIVIDED_ADJOINT
 # ifdef ALLOW_DIVIDED_ADJOINT  
 CADJ STORE mytime = onetape  
 # endif  
1145  c--     Accumulate in-situ time averages of temperature, salinity, and SSH.  c--     Accumulate in-situ time averages of temperature, salinity, and SSH.
1146        call timer_start('PROFILES_INLOOP     [ECCO SPIN-DOWN]', mythid)        call timer_start('PROFILES_INLOOP     [ECCO SPIN-DOWN]', mythid)
1147        call profiles_inloop( mytime, mythid )        call profiles_inloop( mytime, mythid )
1148        call timer_stop ('PROFILES_INLOOP     [ECCO SPIN-DOWN]', mythid)        call timer_stop ('PROFILES_INLOOP     [ECCO SPIN-DOWN]', mythid)
1149  #endif  #endif
1150    #endif
1151    
1152  #ifdef ALLOW_COST  #ifdef ALLOW_COST
1153    
# Line 1202  c--   Compute cost function contribution Line 1217  c--   Compute cost function contribution
1217        call timer_stop ('cost_ssh           [ECCO SPIN-DOWN]', mythid)        call timer_stop ('cost_ssh           [ECCO SPIN-DOWN]', mythid)
1218  # ifdef ALLOW_AUTODIFF_TAMC  # ifdef ALLOW_AUTODIFF_TAMC
1219  #  ifdef ALLOW_PROFILES  #  ifdef ALLOW_PROFILES
1220  CADJ STORE etan = tapelev_init, key = 1  CADJ STORE prof_etan_mean = tapelev_init, key = 1
1221  #  endif  #  endif
1222  # endif  # endif
1223  #endif  #endif

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.48

  ViewVC Help
Powered by ViewVC 1.1.22