1 | SUBROUTINE CLIM_Quit(kinfo) |
---|
2 | c |
---|
3 | c* *** Quit *** CLIM 3.0 |
---|
4 | c |
---|
5 | c purpose: |
---|
6 | c -------- |
---|
7 | c leave mpi |
---|
8 | c |
---|
9 | c interface: |
---|
10 | c ---------- |
---|
11 | c kinfo : output status |
---|
12 | c |
---|
13 | c lib mp: |
---|
14 | c ------- |
---|
15 | c mpi-2 |
---|
16 | c |
---|
17 | c author: |
---|
18 | c ------- |
---|
19 | c Eric Sevault - METEO FRANCE |
---|
20 | c Laurent Terray - CERFACS |
---|
21 | c Jean Latour - F.S.E. (mpi-2) |
---|
22 | c Arnaud Caubel - Fecit - Added deallocation of CLIM arrays |
---|
23 | c ---------------------------------------------------------------- |
---|
24 | #if defined use_comm_MPI1 || defined use_comm_MPI2 || !defined use_comm_MPI1 && !defined use_comm_MPI2 && !defined use_comm_SIPC && !defined use_comm_GMEM && !defined use_comm_PIPE && !defined use_comm_NONE |
---|
25 | USE mod_kinds_oasis |
---|
26 | USE mod_clim |
---|
27 | USE mod_comclim |
---|
28 | #include <mpif.h> |
---|
29 | c ---------------------------------------------------------------- |
---|
30 | INTEGER (kind=ip_intwp_p) kinfo |
---|
31 | c ---------------------------------------------------------------- |
---|
32 | INTEGER (kind=ip_intwp_p) info, il_rank, ji |
---|
33 | c ---------------------------------------------------------------- |
---|
34 | INTEGER (kind=ip_intwp_p) il_bufsizebyt |
---|
35 | REAL (kind=ip_double_p) dl_bufaddr |
---|
36 | c |
---|
37 | c* 0. First Check |
---|
38 | c -------------- |
---|
39 | c |
---|
40 | IF (nexit.ne.1) THEN |
---|
41 | kinfo = CLIM_FastExit |
---|
42 | WRITE(nulprt,FMT='(A)') 'Quit - should not be called' |
---|
43 | GO TO 1010 |
---|
44 | ENDIF |
---|
45 | WRITE(nulprt,*)'entering clim_quit' |
---|
46 | kinfo = CLIM_Ok |
---|
47 | c |
---|
48 | CALL MPI_Comm_Rank(mpi_comm,il_rank,mpi_err) |
---|
49 | c |
---|
50 | DO ji = 0, ncplprocs-1 |
---|
51 | IF (il_rank.eq.modtid(ji)) THEN |
---|
52 | DEALLOCATE (ncode, stat=il_err) |
---|
53 | IF (il_ERR.ne.0) WRITE(nulprt,*)'Error in "ncode" |
---|
54 | $ deallocation in CLIM_Quit routine ! ' |
---|
55 | DEALLOCATE (delta, stat=il_err) |
---|
56 | IF (il_ERR.ne.0) WRITE(nulprt,*)'Error in "delta" |
---|
57 | $ deallocation in CLIM_Quit routine ! ' |
---|
58 | DEALLOCATE (delte, stat=il_err) |
---|
59 | IF (il_ERR.ne.0) WRITE(nulprt,*)'Error in "delte" |
---|
60 | $ deallocation in CLIM_Quit routine ! ' |
---|
61 | DEALLOCATE (cnames, stat=il_err) |
---|
62 | IF (il_ERR.ne.0) WRITE(nulprt,*)'Error in "cnames" |
---|
63 | $ deallocation in CLIM_Quit routine ! ' |
---|
64 | DEALLOCATE (myport, stat = il_ERR) |
---|
65 | IF (il_ERR.ne.CLIM_Ok) WRITE(nulprt,*)' Problem |
---|
66 | $ in "myport" deallocation in CLIM_Quit !' |
---|
67 | DEALLOCATE (mydist,stat = il_ERR) |
---|
68 | IF (il_ERR.ne.CLIM_Ok) WRITE(nulprt,*)' Problem |
---|
69 | $ in "mydist" deallocation in CLIM_Quit !' |
---|
70 | DEALLOCATE (cports, stat = il_ERR) |
---|
71 | IF (il_ERR.ne.CLIM_Ok) WRITE(nulprt,*)' Problem |
---|
72 | $ in "cports" allocation in CLIM_Quit !' |
---|
73 | DEALLOCATE(clrport, stat = il_ERR) |
---|
74 | IF (il_ERR.ne.CLIM_Ok) WRITE(nulprt,*)'Error in clrport |
---|
75 | $ deallocation in CLIM_Quit !' |
---|
76 | DEALLOCATE(irdist, stat = il_ERR) |
---|
77 | IF (il_ERR.ne.0) WRITE(nulprt,*)'Error in "irdist" |
---|
78 | $ deallocation in CLIM_Quit' |
---|
79 | DEALLOCATE(irport, stat = il_ERR) |
---|
80 | IF (il_ERR.ne.0) WRITE(nulprt,*)'Error in "irport" |
---|
81 | $ deallocation in CLIM_Quit' |
---|
82 | DEALLOCATE (mylink, stat = il_ERR) |
---|
83 | IF (il_ERR.ne.CLIM_Ok) WRITE(nulprt,*)' Problem |
---|
84 | $ in "mylink" allocation in CLIM_Quit !' |
---|
85 | DEALLOCATE (pkwork, stat = il_ERR) |
---|
86 | IF (il_ERR.ne.CLIM_Ok) WRITE(nulprt,*)' Problem |
---|
87 | $ in "pkwork" allocation in CLIM_Quit !' |
---|
88 | IF (lg_bsend) then |
---|
89 | CALL MPI_Buffer_Detach(dl_bufaddr,il_bufsizebyt,mpi_err) |
---|
90 | DEALLOCATE (dg_bufsend, stat = il_ERR) |
---|
91 | IF (il_ERR.ne.CLIM_Ok) WRITE(nulprt,*)' Problem |
---|
92 | $ in "dg_bufsend" allocation in CLIM_Quit !' |
---|
93 | ENDIF |
---|
94 | ENDIF |
---|
95 | END DO |
---|
96 | DEALLOCATE (modtid, stat=il_err) |
---|
97 | IF (il_ERR.ne.0) WRITE(nulprt,*)'Error in "modtid" |
---|
98 | $ deallocation in CLIM_Quit routine ! ' |
---|
99 | c |
---|
100 | c |
---|
101 | CALL MPI_Finalize ( info ) |
---|
102 | c |
---|
103 | WRITE(nulprt,FMT='(A,I3,A)') |
---|
104 | * 'Quit - exit status <mpi ',info,'>' |
---|
105 | c |
---|
106 | c ---------------------------------------------------------------- |
---|
107 | c |
---|
108 | 1010 CONTINUE |
---|
109 | CLOSE (nulprt) |
---|
110 | #endif |
---|
111 | RETURN |
---|
112 | END |
---|