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