forked from altMITgcm/MITgcm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cpl_export_import_data.F
106 lines (84 loc) · 3.41 KB
/
cpl_export_import_data.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
C $Header: /u/gcmpack/MITgcm/pkg/ocn_compon_interf/cpl_export_import_data.F,v 1.4 2016/01/06 01:04:05 jmc Exp $
C $Name: $
#include "OCN_CPL_OPTIONS.h"
CBOP
C !ROUTINE: CPL_EXPORT_IMPORT_DATA
C !INTERFACE:
SUBROUTINE CPL_EXPORT_IMPORT_DATA(
I myTime, myIter, myThid )
C !DESCRIPTION: \bv
C *==========================================================*
C | SUBROUTINE CPL_EXPORT_IMPORT_DATA
C | o Routine for controlling
C | - export of coupling data to coupler layer AND
C | - import of coupling data from coupler layer.
C *==========================================================*
C | This version talks to the MIT Coupler. It uses the MIT
C | Coupler "checkpoint1" library calls.
C *==========================================================*
C \ev
C !USES
IMPLICIT NONE
C == GLobal variables ==
#include "SIZE.h"
#include "EEPARAMS.h"
#include "PARAMS.h"
#include "CPL_PARAMS.h"
C !INPUT/OUTPUT PARAMETERS:
C == Routine arguments ==
C myTime :: Current time in simulation.
C myIter :: Current timestep number.
C myThid :: Thread number for this instance of the routine.
_RL myTime
INTEGER myIter
INTEGER myThid
CEOP
#ifdef COMPONENT_MODULE
C !LOCAL VARIABLES:
C msgBuf :: Informational/error message buffer
CHARACTER*(MAX_LEN_MBUF) msgBuf
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
C Note MIT Coupler checkpoint1 does not allow asynchronous posting of
C data, so ordering has to be consistent with coupling layer ordering.
C--------------------------------------------------------------------------
C Synchronous coupling: Send data to coupling layer
IF ( .NOT.ocn_cplSequential ) THEN
IF ( debugMode ) THEN
_BEGIN_MASTER( myThid )
WRITE(msgBuf,'(A,I10)')
& ' Exporting oceanic surface fields at iter=', myIter
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
& SQUEEZE_RIGHT, myThid )
_END_MASTER( myThid )
ENDIF
CALL OCN_STORE_MY_DATA(
I myTime, myIter, myThid )
CALL OCN_EXPORT_FIELDS ( myIter, myThid )
ENDIF
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
C- Fetch data from coupling layer.
IF ( .TRUE. ) THEN
IF ( debugMode ) THEN
_BEGIN_MASTER( myThid )
WRITE(msgBuf,'(A,I10)')
& ' Importing atmospheric surf fluxes at iter=', myIter
CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
& SQUEEZE_RIGHT, myThid )
_END_MASTER( myThid )
ENDIF
CALL OCN_IMPORT_FIELDS ( myIter, myThid )
C Fill diagnostics with updated coupling fields just received from Coupler
CALL CPL_DIAGNOSTICS_FILL( myTime, myIter, myThid )
ENDIF
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
#ifndef ALLOW_THSICE
C Sequential coupling: Send data to coupling layer
C call also OCN_CPL_DIAGS (to cumulate cpl time-ave) in both cases
C (Synchronous or Sequential coupling)
CALL OCN_EXPORT_DATA( myTime, myIter, myThid )
#endif /* ndef ALLOW_THSICE */
C If compiling pkg/thsice, do it later by calling the same S/R
C directly from DO_OCEANIC_PHYS, just after SEAICE_MODEL call.
#endif /* COMPONENT_MODULE */
RETURN
END