1 | include(dom.inc)
2 |
3 | SUBROUTINE master_control(itask)
4 |
5 | ! ================================================================!
6 | ! !
7 | ! master_control.F : Main control of the MASTER side of the code. !
8 | ! !
9 | ! out : !
10 | ! !
11 | ! author : J. AMAYA (september 2007) !
12 | ! !
13 | ! ================================================================!
14 |
15 | USE mod_pmm
16 | USE mod_prissma
17 |
18 | IMPLICIT NONE
19 |
20 | DOM_INT :: itask
21 |
22 | INCLUDE 'pmm_constants.h'
23 |
24 | IF (itask.eq.MASTER_INIT) THEN
25 |
26 | ! ----------------!
27 | ! Read input files!
28 | ! ----------------!
29 |
30 | CALL read_data
31 |
32 | ! ------------------------------!
33 | ! Result vectors initialization !
34 | ! ------------------------------!
35 |
36 | IF (ALLOCATED(Gtot)) DEALLOCATE(Gtot)
37 | IF (ALLOCATED(Lbtot)) DEALLOCATE(Lbtot)
38 | IF (ALLOCATED(Htot)) DEALLOCATE(Htot)
39 | IF (ALLOCATED(Lotot)) DEALLOCATE(Lotot)
40 | IF (ALLOCATED(Srtot)) DEALLOCATE(Srtot)
41 | IF (ALLOCATED(Q_rtot)) DEALLOCATE(Q_rtot)
42 |
43 | ALLOCATE(Gtot(i_dom_ncells))
44 | ALLOCATE(Lbtot(i_dom_ncells))
45 | ALLOCATE(Htot(i_dom_nfacesmax,i_dom_ncells))
46 | ALLOCATE(Lotot(i_dom_nfacesmax,i_dom_ncells))
47 | ALLOCATE(Srtot(i_dom_ncells))
48 | ALLOCATE(Q_rtot(3,i_dom_ncells))
49 |
50 | Gtot = 0.
51 | Lbtot = 0.
52 | Htot = 0.
53 | Lotot = 0.
54 | Srtot = 0.
55 | Q_rtot = 0.
56 |
57 | ! -----------------------------------------------!
58 | ! Calculate partitioning in bands and directions !
59 | ! -----------------------------------------------!
60 |
61 | WRITE(*,*) " >> MASTER: Creating partition"
62 | CALL partition
63 |
64 | ! ----------------------!
65 | ! Send arrays to slaves !
66 | ! ----------------------!
67 |
68 | WRITE(*,*) " >> MASTER: Communicating run params to all procs"
69 | CALL sendtoslaves
70 |
71 | ELSEIF (itask.eq.MASTER_OUTPROC) THEN
72 | WRITE(*,*) " >> MASTER: Receiving result vectors"
73 | CALL pmm_returnvectors(i_dom_ncells, i_dom_nfacesmax)
74 | Srtot = Lbtot - Gtot
75 | WRITE(*,*) " >> MASTER: Outprocessing results"
76 | CALL outprocessing
77 | ENDIF
78 |
79 | END SUBROUTINE master_control
master_control.F could be called by: