1 |
C $Header: /u/gcmpack/MITgcm/pkg/aim_compon_interf/cpl_exch_configs.F,v 1.2 2004/05/21 20:00:48 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 atmosphere component. | |
17 |
C | - Atmospheric 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 "PARAMS.h" |
40 |
#include "GRID.h" |
41 |
#include "ATMCPL.h" |
42 |
|
43 |
C !INPUT/OUTPUT PARAMETERS: |
44 |
C == Routine arguments == |
45 |
C myThid :: Thread number for this instance of the routine |
46 |
INTEGER myThid |
47 |
CEOP |
48 |
|
49 |
C == Local variables == |
50 |
INTEGER I,J,K,bi,bj |
51 |
INTEGER iDiff |
52 |
INTEGER jDiff |
53 |
INTEGER biDiff |
54 |
INTEGER bjDiff |
55 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
56 |
_RL seaSurface_ocn |
57 |
_RL groundLevel_atm |
58 |
|
59 |
C Post my configuration information to the coupler "layer". |
60 |
CALL ATM_EXPORT_ATMCONFIG( myThid ) |
61 |
|
62 |
C Import other component model(s) configuration(s) from the |
63 |
C coupler "layer". |
64 |
C o Get ocean model configuration |
65 |
CALL ATM_IMPORT_OCNCONFIG( myThid ) |
66 |
|
67 |
C Summarise fields that were imported. |
68 |
C o Plot ocean depths |
69 |
CALL PLOT_FIELD_XYRL( ocMxlD, |
70 |
& 'Ocean mixed-layer depth on atmos grid', |
71 |
& 1, myThid ) |
72 |
|
73 |
C Do consistency checks on imported fields. |
74 |
C o Check that atmos. depth is equal to sea-level for all ocean points. |
75 |
C The ocean model has depth == 0 wherever there is land. For non-land |
76 |
C point the atmosphere must extend to the sea-surface. Usually the |
77 |
C atmospheres full depth is 10^5 Pa. |
78 |
iDiff = 0 |
79 |
jDiff = 0 |
80 |
biDiff = 0 |
81 |
bjDiff = 0 |
82 |
seaSurface_ocn = 0. _d 0 |
83 |
c groundLevel_atm = 1. _d 5 |
84 |
groundLevel_atm = Ro_SeaLevel |
85 |
DO bj=myByLo(myTHid),myByHi(myThid) |
86 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
87 |
DO J=1,sNy |
88 |
DO I=1,sNx |
89 |
IF ( ocMxlD(I,J,bi,bj) .NE. seaSurface_ocn .AND. |
90 |
& Ro_surf(I,J,bi,bj) .NE. groundLevel_atm ) THEN |
91 |
iDiff = I |
92 |
jDiff = J |
93 |
biDiff = bi |
94 |
bjDiff = bj |
95 |
WRITE(msgBuf,'(A,I4,A,I4,A,I4,A,I4,A)') |
96 |
& 'Inconsistent land/sea mask @ (i=',iDiff, |
97 |
& ',j=',jDiff,',bi=',biDiff,',bj=',bjDiff,')' |
98 |
CALL PRINT_ERROR( msgBuf, myThid ) |
99 |
WRITE(msgBuf,'(A,E30.15)') |
100 |
& 'H (atmosphere) ==',Ro_surf(I,J,bi,bj) |
101 |
CALL PRINT_ERROR( msgBuf, myThid ) |
102 |
WRITE(msgBuf,'(A,E30.15)') |
103 |
& 'H (ocean) ==',ocMxlD(I,J,bi,bj) |
104 |
CALL PRINT_ERROR( msgBuf, myThid ) |
105 |
ENDIF |
106 |
ENDDO |
107 |
ENDDO |
108 |
ENDDO |
109 |
ENDDO |
110 |
|
111 |
IF ( iDiff .NE. 0 ) THEN |
112 |
C At least one point had land/sea "inconsistency" between atmos. |
113 |
C and ocean. Stop if this happens. |
114 |
Ccnh STOP 'ABNORMAL END: S/R ATM_EXCH_CONFIGS' |
115 |
ENDIF |
116 |
|
117 |
RETURN |
118 |
END |