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 | USE mod_inout
18 |
19 | IMPLICIT NONE
20 |
21 | DOM_INT :: itask, ntot_proc
22 |
23 | INCLUDE 'pmm_constants.h'
24 |
25 | IF (itask.eq.MASTER_INIT) THEN
26 |
27 | ! ----------------!
28 | ! Read input files!
29 | ! ----------------!
30 |
31 | CALL read_data
32 | #ifdef USEPALM
33 | IF (.not.ALLOCATED(Srtot)) ALLOCATE(Srtot(i_dom_nnodes))
34 | IF (.not.ALLOCATED(Gtot)) ALLOCATE(Gtot(i_dom_nnodes))
35 | IF (.not.ALLOCATED(Q_rtot)) ALLOCATE(Q_rtot(3,i_dom_nnodes))
36 |
37 | CALL read_domcoor
38 |
39 | ! -------------------------------------------------------!
40 | ! PALM: send node coordinates and dummy radiative fields !
41 | ! -------------------------------------------------------!
42 |
43 | CALL interf_nodescoor
44 | CALL interf_bfacecoor
45 | CALL interf_sendfields
46 | #endif
47 |
48 | ! -----------------------------------------------!
49 | ! Calculate partitioning in bands and directions !
50 | ! -----------------------------------------------!
51 |
52 | ntot_proc = pmm_n_p
53 | !$ ntot_proc = pmm_n_p * i_dom_nthread
54 |
55 | WRITE(*,*) " PRISSMA: calculation over -> ", ntot_proc, "proc"
56 | WRITE(*,*)
57 | WRITE(*,*) " >> MASTER: Creating partition"
58 | CALL meshpartition
59 | CALL partition
60 |
61 | ELSEIF (itask.eq.MASTER_OUTPROC) THEN
62 | WRITE(*,*) " >> MASTER: Outprocessing results"
63 | CALL outprocessing
64 |
65 | #ifdef USEPALM
66 | CALL interf_sendfields
67 |
68 | ELSEIF (itask.eq.MASTER_COUPLING) THEN
69 |
70 | ! -------------------------------------------------!
71 | ! PALM: Receiving data from slaves to send to palm !
72 | ! -------------------------------------------------!
73 |
74 | WRITE(*,*) " >> MASTER: Preparing result vectors for coupling"
75 | ! CALL outprocessing_coupling
76 | CALL interf_sendfields
77 |
78 | #endif
79 |
80 | ENDIF
81 |
82 | END SUBROUTINE master_control
master_control.F could be called by: