/[MITgcm]/MITgcm/eesupp/src/eedie.F
ViewVC logotype

Annotation of /MITgcm/eesupp/src/eedie.F

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


Revision 1.6.14.1 - (hide annotations) (download)
Mon Jan 20 03:05:54 2003 UTC (22 years, 5 months ago) by dimitri
Branch: release1_coupled
Changes since 1.6: +9 -4 lines
Branch release1_coupled contains code for coupling
to UCLA atmospheric model:

cvs tag ucla1
  Branched off tag release1_beta1
  Modified eesupp/src/eeboot_minimal.F, eedie.F, exch_jam.F,
    global_max.F, global_sum.F, gsum_jam.F, ini_procs.F, and main.F
    model/src/dynamics.F, forward_step.F, freeze.F, ini_parms.F,
    set_defaults.F, the_main_loop.F, the_model_main.F, timestep.F,
    write_state.F, and mdsio_writefield.F
    pkg/timeave/TIMEAVE_STATV.h, timeave_statv_write.F,
    timeave_statvars.F, and model/inc/PARAMS.h,
  Added model/src/do_coupled_ucla.F and verification/coupled_ucla
  NOTES:
  MPI_COMM_WORLD -> MPI_COMM_MODEL in
    exch_jam.F, global_max.F global_sum.F, and gsum_jam.F
  Added useSingleCpuIO: ini_procs.F, PARAMS.h, ini_parms.F,
    set_defaults.F, mdsio_writefield.F, and subroutine
    GATHER_2D in do_coupled_ucla.F

1 dimitri 1.6.14.1 C $Header: /u/gcmpack/models/MITgcmUV/eesupp/src/eedie.F,v 1.6 2001/04/10 22:35:24 heimbach Exp $
2     C $Name: release1_beta1 $
3 cnh 1.1
4 dimitri 1.6.14.1 #include "CPP_OPTIONS.h"
5 cnh 1.1
6     CStartOfInterface
7     SUBROUTINE EEDIE
8     C /==========================================================\
9     C | SUBROUTINE EEDIE |
10     C | o Close execution "environment", particularly perform |
11     C | steps to terminate parallel processing. |
12     C |==========================================================|
13     C | Note: This routine can also be compiled with CPP |
14     C | directives set so that no multi-processing is initialised|
15     C | This is OK and should work fine. |
16     C \==========================================================/
17 adcroft 1.4 IMPLICIT NONE
18 cnh 1.1
19     C == Global variables ==
20     #include "SIZE.h"
21     #include "EEPARAMS.h"
22     #include "EESUPPORT.h"
23     CEndOfInterface
24    
25     C == Local variables ==
26     C msgBuf - I/O Buffer
27     C nThreadsDone - Used to count number of completed threads.
28     C I - Loop counter.
29     CHARACTER*(MAX_LEN_MBUF) msgBuf
30     INTEGER nThreadsDone
31     INTEGER I
32     #ifdef ALLOW_USE_MPI
33     C mpiRC - Error code reporting variable used
34     C with MPI.
35     INTEGER mpiRC
36     #endif /* ALLOW_USE_MPI */
37    
38     C-- Check that all the threads have ended
39     C No thread should reach this loop before all threads have set
40     C threadIsComplete to TRUE. If they do then either there is a bug
41     C in the code or the behaviour of the parallel compiler directives
42 cnh 1.3 C are not right for this code. In the latter case different
43     C directives may be available or the compiler itself may have a
44     C bug or you may need a different parallel compiler for main.F
45 cnh 1.1 nThreadsDone = 0
46     DO I = 1, nThreads
47     IF ( threadIsComplete(I) ) nThreadsDone = nThreadsDone+1
48     ENDDO
49     IF ( nThreadsDone .LT. nThreads ) THEN
50 adcroft 1.4 WRITE(msgBuf,'(A,I5,A,I5,A)')
51 cnh 1.1 & 'S/R EEDIE: Only ',nThreadsDone,
52 cnh 1.3 & ' threads have completed, ',nThreads,
53     & ' are expected for this configuration!'
54 heimbach 1.6 WRITE(*,*) msgBuf
55     WRITE(*,*)
56 cnh 1.3 & 'Possibly you have different setenv PARALLEL and nThreads?'
57 cnh 1.1 eeEndError = .TRUE.
58     fatalError = .TRUE.
59     ENDIF
60    
61     #ifdef ALLOW_USE_MPI
62     C--
63     C-- MPI style multiple-process termination
64     C-- ======================================
65     #ifndef ALWAYS_USE_MPI
66     IF ( usingMPI ) THEN
67     #endif
68 dimitri 1.6.14.1
69     #if !defined(COUPLED_UCLA) || defined(COUPLED_DEBUG)
70    
71 cnh 1.1 CALL MPI_FINALIZE ( mpiRC )
72     IF ( mpiRC .NE. MPI_SUCCESS ) THEN
73     eeEndError = .TRUE.
74     fatalError = .TRUE.
75 adcroft 1.4 WRITE(msgBuf,'(A,I5)')
76 cnh 1.1 & 'S/R FIN_PROCS: MPI_FINALIZE return code',
77     & mpiRC
78     CALL PRINT_ERROR( msgBuf, 1 )
79     ENDIF
80 dimitri 1.6.14.1
81     #endif COUPLED_UCLA
82    
83 cnh 1.1 #ifndef ALWAYS_USE_MPI
84     ENDIF
85     #endif
86     #endif /* ALLOW_USE_MPI */
87    
88    
89     RETURN
90     END

  ViewVC Help
Powered by ViewVC 1.1.22