/[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.32 by heimbach, Thu Apr 20 03:01:28 2006 UTC revision 1.36 by heimbach, Sat May 6 14:33:25 2006 UTC
# Line 72  c     == global variables == Line 72  c     == global variables ==
72  #include "EEPARAMS.h"  #include "EEPARAMS.h"
73  #include "PARAMS.h"  #include "PARAMS.h"
74    
75    #ifdef ALLOW_MNC
76    #include "MNC_PARAMS.h"
77          EXTERNAL DIFFERENT_MULTIPLE
78          LOGICAL  DIFFERENT_MULTIPLE
79    #endif
80    
81    #ifdef HAVE_SIGREG
82    #include "SIGREG.h"
83    #endif
84    
85    #ifdef ALLOW_SHAP_FILT
86    # include "SHAP_FILT.h"
87    #endif
88    #ifdef ALLOW_ZONAL_FILT
89    # include "ZONAL_FILT.h"
90    #endif
91    #ifdef COMPONENT_MODULE
92    # include "CPL_PARAMS.h"
93    #endif
94    
95  c**************************************  c**************************************
96  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
97    
# Line 164  c     == local variables == Line 184  c     == local variables ==
184        integer max_lev4        integer max_lev4
185  #endif  #endif
186    
187  #if defined(TIME_PER_TIMESTEP) || defined(USE_PAPI_FLOPS)  #if defined(TIME_PER_TIMESTEP) || defined(USE_PAPI_FLOPS) || defined(USE_PCL_FLOPS)
188        CHARACTER*(MAX_LEN_MBUF) msgBuf        CHARACTER*(MAX_LEN_MBUF) msgBuf
189  #ifdef TIME_PER_TIMESTEP  #ifdef TIME_PER_TIMESTEP
190  CCE107 common block for per timestep timing  CCE107 common block for per timestep timing
# Line 176  C     == Timing variables == Line 196  C     == Timing variables ==
196  #ifdef USE_PAPI_FLOPS  #ifdef USE_PAPI_FLOPS
197  CCE107 common block for PAPI summary performance  CCE107 common block for PAPI summary performance
198  #include <fpapi.h>  #include <fpapi.h>
199        INTEGER*8 flpops        INTEGER*8 flpops, instr
200        DATA flpops /0/        DATA flpops, instr /2*0/
201        INTEGER check        INTEGER check
202        REAL real_time, proc_time, mflops        REAL*4 real_time, proc_time, mflops, ipc
203        DATA real_time, proc_time, mflops /3*0.0D0/        DATA real_time, proc_time, mflops, ipc /4*0.0E0/
204    #else
205    #ifdef USE_PCL_FLOPS
206    CCE107 common block for PCL summary performance
207    #include <pclh.f>
208          INTEGER pcl_counter_list(5), flags, nevents, res, ipcl
209          INTEGER*8 i_result(5), descr
210          REAL*8 fp_result(5)
211          COMMON /pclvars/ i_result, descr, fp_result, pcl_counter_list,
212         $     flags, nevents
213          INTEGER nmaxevents
214          PARAMETER (nmaxevents = 61)
215          CHARACTER*22 pcl_counter_name(0:nmaxevents-1)
216          COMMON /pclnames/ pcl_counter_name
217    #endif
218  #endif  #endif
219  #endif  #endif
   
220  c--   == end of interface ==  c--   == end of interface ==
221    
222  #ifndef DISABLE_DEBUGMODE  #ifndef DISABLE_DEBUGMODE
# Line 276  CCE107 Initial call for timers Line 309  CCE107 Initial call for timers
309  #ifdef USE_PAPI_FLOPS  #ifdef USE_PAPI_FLOPS
310  CCE107 Initial call for PAPI  CCE107 Initial call for PAPI
311        _BEGIN_MASTER( myThid )        _BEGIN_MASTER( myThid )
312    #ifdef USE_FLIPS
313          call PAPIF_flips(real_time, proc_time, flpops, mflops, check)
314    #else
315        call PAPIF_flops(real_time, proc_time, flpops, mflops, check)        call PAPIF_flops(real_time, proc_time, flpops, mflops, check)
316    #endif
317          WRITE(msgBuf,'(A34,F10.6)')
318         $        'Mflop/s before timestepping:', mflops
319          CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
320    #ifdef PAPI_VERSION
321          call PAPIF_ipc(real_time, proc_time, instr, ipc, check)
322          WRITE(msgBuf,'(A34,F10.6)')
323         $        'IPC before timestepping:', ipc
324          CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
325    #endif
326        _END_MASTER( myThid )        _END_MASTER( myThid )
327    #else
328    #ifdef USE_PCL_FLOPS
329    CCE107 Initial call for PCL
330          _BEGIN_MASTER( myThid )
331          res = PCLstop(descr, i_result, fp_result, nevents)
332          do ipcl = 1, nevents
333             WRITE(msgBuf,'(A22,A26,F10.6)'),
334         $        pcl_counter_name(pcl_counter_list(ipcl)),
335         $        'before timestepping:', fp_result(ipcl)
336             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
337          enddo
338          res = PCLstart(descr, pcl_counter_list, nevents, flags)
339          _END_MASTER( myThid )
340    #endif
341  #endif  #endif
342    
343  c--   Do the model integration.  c--   Do the model integration.
# Line 452  C--   State-variables diagnostics Line 512  C--   State-variables diagnostics
512          CALL TIMER_STOP ('DO_STATEVARS_DIAGS  [FORWARD_STEP]',myThid)          CALL TIMER_STOP ('DO_STATEVARS_DIAGS  [FORWARD_STEP]',myThid)
513        ENDIF        ENDIF
514    
515    #ifdef ALLOW_PROFILES
516    c--     Accumulate in-situ time averages of temperature, salinity, and SSH.
517            call timer_start('PROFILES_INLOOP       [ECCO MAIN]', mythid)
518            call profiles_inloop( mytime, mythid )
519            call timer_stop ('PROFILES_INLOOP       [ECCO MAIN]', mythid)
520    #endif
521    
522  #ifdef ALLOW_COST  #ifdef ALLOW_COST
523    
524  c--     Accumulate time averages of temperature, salinity, and SSH.  c--     Accumulate time averages of temperature, salinity
525          call timer_start('COST_AVERAGESFIELDS   [ECCO MAIN]', mythid)          call timer_start('COST_AVERAGESFIELDS   [ECCO MAIN]', mythid)
526          call cost_averagesFields( mytime, mythid )          call cost_averagesFields( mytime, mythid )
527          call timer_stop ('COST_AVERAGESFIELDS   [ECCO MAIN]', mythid)          call timer_stop ('COST_AVERAGESFIELDS   [ECCO MAIN]', mythid)
528    
529    
530  #ifdef ALLOW_COST_ATLANTIC  #ifdef ALLOW_COST_ATLANTIC
531  c--     Compute meridional heat transport  c--     Compute meridional heat transport
532          call timer_start('cost_atlantic         [ECCO MAIN]', mythid)          call timer_start('cost_atlantic         [ECCO MAIN]', mythid)
# Line 469  c--     Compute meridional heat transpor Line 538  c--     Compute meridional heat transpor
538  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
539  c**************************************  c**************************************
540  #include "checkpoint_lev1_directives.h"  #include "checkpoint_lev1_directives.h"
541    #include "checkpoint_lev1_template.h"
542  c**************************************  c**************************************
543  #endif  #endif
544    
# Line 480  c************************************** Line 550  c**************************************
550        CALL EXF_GETFORCING( mytime, myiter, mythid )        CALL EXF_GETFORCING( mytime, myiter, mythid )
551        CALL TIMER_STOP ('EXF_GETFORCING     [FORWARD_STEP]',mythid)        CALL TIMER_STOP ('EXF_GETFORCING     [FORWARD_STEP]',mythid)
552  # ifdef NONLIN_FRSURF  # ifdef NONLIN_FRSURF
553    CADJ STORE hFacC  = comlev1, key = ikey_dynamics
554  CADJ STORE SST    = comlev1, key = ikey_dynamics  CADJ STORE SST    = comlev1, key = ikey_dynamics
555  CADJ STORE SSS    = comlev1, key = ikey_dynamics  CADJ STORE SSS    = comlev1, key = ikey_dynamics
556  #  ifdef SHORTWAVE_HEATING  #  ifdef SHORTWAVE_HEATING
# Line 500  cph this simple runtime flag causes a lo Line 571  cph this simple runtime flag causes a lo
571           IF ( debugLevel .GE. debLevB )           IF ( debugLevel .GE. debLevB )
572       &    CALL DEBUG_CALL('SEAICE_MODEL',myThid)       &    CALL DEBUG_CALL('SEAICE_MODEL',myThid)
573  #endif  #endif
 #ifdef ALLOW_AUTODIFF_TAMC  
 CADJ STORE area  = comlev1, key = ikey_dynamics  
 #endif  
574           CALL TIMER_START('SEAICE_MODEL       [FORWARD_STEP]',myThid)           CALL TIMER_START('SEAICE_MODEL       [FORWARD_STEP]',myThid)
575           CALL SEAICE_MODEL( myTime, myIter, myThid )           CALL SEAICE_MODEL( myTime, myIter, myThid )
576           CALL TIMER_STOP ('SEAICE_MODEL       [FORWARD_STEP]',myThid)           CALL TIMER_STOP ('SEAICE_MODEL       [FORWARD_STEP]',myThid)
# Line 1012  CCE107 Time per timestep information Line 1080  CCE107 Time per timestep information
1080  #ifdef USE_PAPI_FLOPS  #ifdef USE_PAPI_FLOPS
1081  CCE107 PAPI summary performance  CCE107 PAPI summary performance
1082        _BEGIN_MASTER( myThid )        _BEGIN_MASTER( myThid )
1083    #ifdef USE_FLIPS
1084          call PAPIF_flips(real_time, proc_time, flpops, mflops, check)
1085    #else
1086        call PAPIF_flops(real_time, proc_time, flpops, mflops, check)        call PAPIF_flops(real_time, proc_time, flpops, mflops, check)
1087    #endif
1088        WRITE(msgBuf,'(F10.6,A34,I8)')        WRITE(msgBuf,'(F10.6,A34,I8)')
1089       $        mflops, 'Mflop/s during timestep ', iloop       $        mflops, 'Mflop/s during timestep ', iloop
1090        CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)        CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
1091        _END_MASTER( myThid )        _END_MASTER( myThid )
1092    #ifdef PAPI_VERSION
1093          call PAPIF_ipc(real_time, proc_time, instr, ipc, check)
1094          WRITE(msgBuf,'(F10.6,A34,I8)')
1095         $        ipc, 'IPC during timestep ', iloop
1096          CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
1097    #endif
1098          _END_MASTER( myThid )
1099    #else
1100    #ifdef USE_PCL_FLOPS
1101    CCE107 PCL summary performance
1102          _BEGIN_MASTER( myThid )
1103          res = PCLstop(descr, i_result, fp_result, nevents)
1104          do ipcl = 1, nevents
1105             WRITE(msgBuf,'(F10.6,A2,A22,A17,I8)'), fp_result(ipcl),
1106         $        ' ', pcl_counter_name(pcl_counter_list(ipcl)),
1107         $        'during timestep ', iloop
1108             CALL PRINT_MESSAGE(msgBuf,standardMessageUnit,SQUEEZE_RIGHT,1)
1109          enddo
1110           res = PCLstart(descr, pcl_counter_list, nevents, flags)
1111          _END_MASTER( myThid )
1112    #endif
1113  #endif  #endif
1114    
1115  #ifdef ALLOW_AUTODIFF_TAMC  #ifdef ALLOW_AUTODIFF_TAMC
# Line 1047  c Line 1140  c
1140    
1141        call timer_start('ECCO SPIN-DOWN', mythid)        call timer_start('ECCO SPIN-DOWN', mythid)
1142    
1143    #ifdef ALLOW_PROFILES
1144    c--     Accumulate in-situ time averages of temperature, salinity, and SSH.
1145          call timer_start('PROFILES_INLOOP     [ECCO SPIN-DOWN]', mythid)
1146          call profiles_inloop( mytime, mythid )
1147          call timer_stop ('PROFILES_INLOOP     [ECCO SPIN-DOWN]', mythid)
1148    #endif
1149    
1150  #ifdef ALLOW_COST  #ifdef ALLOW_COST
1151    
1152  #ifdef ALLOW_DIVIDED_ADJOINT  #ifdef ALLOW_DIVIDED_ADJOINT

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.36

  ViewVC Help
Powered by ViewVC 1.1.22