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