1 |
C $Header: $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_OPTIONS.h" |
5 |
|
6 |
CStartOfInterface |
7 |
SUBROUTINE CPL_EXCH_CONFIGS( myThid ) |
8 |
C *==========================================================* |
9 |
C | SUBROUTINE CPL_EXCH_CONFIGS | |
10 |
C | o Controlling routine for initial config exchange between| |
11 |
C | component models and atmosphere component. | |
12 |
C | - Atmospheric version - | |
13 |
C *==========================================================* |
14 |
C | Controls the import of configuration information | |
15 |
C | (grid/topography,etc...) from other components and the | |
16 |
C | export of configuration information from this component. | |
17 |
C | The routine does some basic checking on consistency | |
18 |
C | components and summarizes the information that has been | |
19 |
C | imported. | |
20 |
C | The routine will need to be customised for different | |
21 |
C | styles of coupled run. The coupler requires consistency | |
22 |
C | between sending and receiving operations posted by | |
23 |
C | various components. Therefore changes in one component | |
24 |
C | model CPL_EXCH_CONFIG may require changes in other | |
25 |
C | component models CPL_EXCH_CONFIG routines as well | |
26 |
C | as in the CPL_MASTER_EXCH_CONFIG routine. | |
27 |
C *==========================================================* |
28 |
IMPLICIT NONE |
29 |
|
30 |
C == Global variables == |
31 |
#include "SIZE.h" |
32 |
#include "EEPARAMS.h" |
33 |
#include "GRID.h" |
34 |
#include "ATMCPL.h" |
35 |
|
36 |
C == Routine arguments == |
37 |
C myThid - Thread number for this instance of the routine |
38 |
INTEGER myThid |
39 |
CEndOfInterface |
40 |
|
41 |
C == Local variables == |
42 |
INTEGER I,J,K,bi,bj |
43 |
INTEGER iDiff |
44 |
INTEGER jDiff |
45 |
INTEGER biDiff |
46 |
INTEGER bjDiff |
47 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
48 |
_RL seaSurface_ocn |
49 |
_RL groundLevel_atm |
50 |
|
51 |
C Post my configuration information to the coupler "layer". |
52 |
CALL ATM_EXPORT_ATMCONFIG( myThid ) |
53 |
|
54 |
C Import other component model(s) configuration(s) from the |
55 |
C coupler "layer". |
56 |
C o Get ocean model configuration |
57 |
CALL ATM_IMPORT_OCNCONFIG( myThid ) |
58 |
|
59 |
C Summarise fields that were imported. |
60 |
C o Plot ocean depths |
61 |
CALL PLOT_FIELD_XYRL( Hocn, |
62 |
& 'Ocean depths on atmos grid', |
63 |
& 1, myThid ) |
64 |
|
65 |
C Do consistency checks on imported fields. |
66 |
C o Check that atmos. depth is equal to sea-level for all ocean points. |
67 |
C The ocean model has depth == 0 wherever there is land. For non-land |
68 |
C point the atmosphere must extend to the sea-surface. Usually the |
69 |
C atmospheres full depth is 10^5 Pa. |
70 |
iDiff = 0 |
71 |
jDiff = 0 |
72 |
biDiff = 0 |
73 |
bjDiff = 0 |
74 |
seaSurface_ocn = 0. _d 0 |
75 |
groundLevel_atm = 1. _d 5 |
76 |
DO bj=myByLo(myTHid),myByHi(myThid) |
77 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
78 |
DO J=1,sNy |
79 |
DO I=1,sNx |
80 |
IF ( Hocn(I,J,bi,bj) .NE. seaSurface_ocn .AND. |
81 |
& Ro_surf(I,J,bi,bj) .NE. groundLevel_atm ) THEN |
82 |
iDiff = I |
83 |
jDiff = J |
84 |
biDiff = bi |
85 |
bjDiff = bj |
86 |
WRITE(msgBuf,'(A,I4,A,I4,A,I4,A,I4,A)') |
87 |
& 'Inconsistent land/sea mask @ (i=',iDiff, |
88 |
& ',j=',jDiff,',bi=',biDiff,',bj=',bjDiff,')' |
89 |
CALL PRINT_ERROR( msgBuf, 1 ) |
90 |
WRITE(msgBuf,'(A,E30.15)') |
91 |
& 'H (atmosphere) ==',Ro_surf(I,J,bi,bj) |
92 |
CALL PRINT_ERROR( msgBuf, 1 ) |
93 |
WRITE(msgBuf,'(A,E30.15)') |
94 |
& 'H (ocean) ==',Hocn(I,J,bi,bj) |
95 |
CALL PRINT_ERROR( msgBuf, 1 ) |
96 |
ENDIF |
97 |
ENDDO |
98 |
ENDDO |
99 |
ENDDO |
100 |
ENDDO |
101 |
|
102 |
IF ( iDiff .NE. 0 ) THEN |
103 |
C At least one point had land/sea "inconsistency" between atmos. |
104 |
C and ocean. Stop if this happens. |
105 |
Ccnh STOP 'ABNORMAL END: S/R ATM_EXCH_CONFIGS' |
106 |
ENDIF |
107 |
|
108 |
RETURN |
109 |
END |