1 |
jmc |
1.5 |
C $Header: /u/gcmpack/MITgcm/pkg/atm_ocn_coupler/initialise.F,v 1.4 2013/12/02 21:55:06 jmc Exp $ |
2 |
jmc |
1.1 |
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "CPP_OPTIONS.h" |
5 |
|
|
|
6 |
jmc |
1.4 |
CBOP 0 |
7 |
|
|
C !ROUTINE: INITIALISE |
8 |
|
|
|
9 |
|
|
C !INTERFACE: |
10 |
|
|
SUBROUTINE INITIALISE( |
11 |
|
|
O msgUnit ) |
12 |
|
|
|
13 |
|
|
C !DESCRIPTION: |
14 |
|
|
C *==========================================================* |
15 |
|
|
C | SUBROUTINE INITIALISE |
16 |
|
|
C | o Routine to initialise coupling component. |
17 |
|
|
C *==========================================================* |
18 |
|
|
C | Initialisation involves starting up MPI and then joining |
19 |
|
|
C | the coupled configuration as a component with the special |
20 |
|
|
C | name "Coupler". With the present MIT Coupler library |
21 |
|
|
C | only one process can register with the name "Coupler". |
22 |
|
|
C | This component is the process responsible for |
23 |
|
|
C | coordinating the transfer of data between other |
24 |
|
|
C | components and for mapping data from one components |
25 |
|
|
C | representation to anothers representation as appropriate. |
26 |
|
|
C *==========================================================* |
27 |
|
|
|
28 |
|
|
C !USES: |
29 |
jmc |
1.1 |
IMPLICIT NONE |
30 |
|
|
C === GLobal variables == |
31 |
|
|
#include "CPLIDS.h" |
32 |
|
|
|
33 |
jmc |
1.4 |
C !INPUT/OUTPUT PARAMETERS: |
34 |
|
|
C msgUnit :: log-file I/O unit |
35 |
|
|
INTEGER msgUnit |
36 |
|
|
|
37 |
|
|
C !LOCAL VARIABLES: |
38 |
|
|
C iErr :: Error code |
39 |
|
|
C MPI_COMM_Coupler :: Communicatior used by this component. |
40 |
|
|
C Stored internally by the coupling library. |
41 |
jmc |
1.1 |
INTEGER iErr |
42 |
|
|
INTEGER MPI_COMM_Coupler |
43 |
jmc |
1.4 |
CEOP |
44 |
jmc |
1.1 |
|
45 |
|
|
CALL MPI_Init(iErr) |
46 |
|
|
|
47 |
|
|
C-- Set the running directory (= rank_0 ) |
48 |
|
|
CALL SETDIR( 0 ) |
49 |
|
|
|
50 |
|
|
C Register this process as the "coupler" participant. Currently there can |
51 |
|
|
C only be one coupler participant all others are "component" participants. |
52 |
jmc |
1.4 |
CALL MITCOUPLER_INIT( |
53 |
|
|
I cplCompName, |
54 |
|
|
O MPI_COMM_Coupler, msgUnit ) |
55 |
jmc |
1.1 |
|
56 |
jmc |
1.4 |
CALL CPL_READ_PARAMS( msgUnit ) |
57 |
jmc |
1.1 |
|
58 |
jmc |
1.4 |
CALL SET_RUNOFFMAP( msgUnit ) |
59 |
jmc |
1.1 |
|
60 |
jmc |
1.5 |
C-- Initialise Coupler field arrays |
61 |
|
|
CALL CPL_INIT_ATM_VARS( msgUnit ) |
62 |
|
|
CALL CPL_INIT_OCN_VARS( msgUnit ) |
63 |
|
|
|
64 |
jmc |
1.1 |
RETURN |
65 |
|
|
END |