1 |
C $Header$ |
C $Header$ |
2 |
C $Name$ |
C $Name$ |
3 |
|
|
4 |
#include "CPP_OPTIONS.h" |
#include "ATM_CPL_OPTIONS.h" |
5 |
|
|
6 |
CBOP 0 |
CBOP 0 |
7 |
C !ROUTINE: CPL_EXCH_CONFIGS |
C !ROUTINE: CPL_EXCH_CONFIGS |
36 |
C == Global variables == |
C == Global variables == |
37 |
#include "SIZE.h" |
#include "SIZE.h" |
38 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
39 |
#include "PARAMS.h" |
c#include "PARAMS.h" |
40 |
#include "GRID.h" |
c#include "CPL_PARAMS.h" |
|
#include "ATMCPL.h" |
|
41 |
|
|
42 |
C !INPUT/OUTPUT PARAMETERS: |
C !INPUT/OUTPUT PARAMETERS: |
43 |
C myThid :: Thread number for this instance of the routine |
C myThid :: Thread number for this instance of the routine |
44 |
INTEGER myThid |
INTEGER myThid |
45 |
|
|
46 |
C !LOCAL VARIABLES: |
C !LOCAL VARIABLES: |
47 |
INTEGER i, j, bi, bj |
C errMsg :: error message to print to clog file |
48 |
LOGICAL errFlag |
LOGICAL errFlag |
49 |
CHARACTER*70 errMsg |
CHARACTER*70 errMsg |
50 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
c CHARACTER*(MAX_LEN_MBUF) msgBuf |
|
_RL atm_waterOnly, atm_landOnly, mxlD_noWater |
|
51 |
C-- local variable in common block |
C-- local variable in common block |
52 |
_RL landMask_loc(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
_RL landMask_loc(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
53 |
COMMON / CPL_EXCH_CONFIGS_LOC / landMask_loc |
COMMON / CPL_EXCH_CONFIGS_LOC / landMask_loc |
54 |
CEOP |
CEOP |
55 |
|
|
56 |
errFlag = .FALSE. |
errFlag = .FALSE. |
57 |
|
errMsg = ' ' |
58 |
|
|
59 |
C Get configuration information (=land/sea mask) from other pkg |
C- Get configuration information (=land/sea mask) from other pkg |
60 |
CALL ATM_GET_ATMCONFIG( |
CALL ATM_GET_ATMCONFIG( |
61 |
O landMask_loc, |
O landMask_loc, |
62 |
I myThid ) |
I myThid ) |
63 |
|
|
64 |
C Post my configuration information to the coupler "layer". |
C- Post my configuration information to the coupler "layer". |
65 |
CALL ATM_EXPORT_ATMCONFIG( |
CALL ATM_EXPORT_ATMCONFIG( |
66 |
U errFlag, |
U errFlag, |
67 |
I landMask_loc, myThid ) |
I landMask_loc, myThid ) |
68 |
|
|
69 |
C Import other component model(s) configuration(s) from the coupler "layer" |
C- Import other component model(s) configuration(s) from the coupler "layer" |
70 |
C o Get ocean model configuration |
C o Get ocean model configuration |
71 |
CALL ATM_IMPORT_OCNCONFIG( myThid ) |
CALL ATM_IMPORT_OCNCONFIG( myThid ) |
72 |
|
|
73 |
C Summarise fields that were imported. |
C- Summarise coupling config set-up and check for inconsistency |
|
C o Plot ocean depths |
|
|
IF ( debugLevel.GE.debLevB ) THEN |
|
|
CALL WRITE_FLD_XY_RL( 'Ocn_MxlD', ' ', ocMxlD, 0, myThid ) |
|
|
ENDIF |
|
|
IF ( debugLevel.GE.debLevC ) THEN |
|
|
CALL PLOT_FIELD_XYRL( ocMxlD, |
|
|
& 'Ocean mixed-layer depth on atmos grid', |
|
|
& 1, myThid ) |
|
|
ENDIF |
|
|
|
|
|
C Do consistency checks on imported fields. |
|
|
C o Check that: |
|
|
C a) where land/sea mask is "water-only", this should be a wet ocean pts |
|
|
C b) where land/sea mask has "no water", this should be a dry ocean pts |
|
74 |
_BARRIER |
_BARRIER |
75 |
_BEGIN_MASTER( myThid ) |
CALL ATM_CHECK_CPLCONFIG( |
76 |
atm_waterOnly = 0. _d 0 |
U errFlag, errMsg, |
77 |
atm_landOnly = 1. _d 0 |
I landMask_loc, myThid ) |
|
mxlD_noWater = 0. _d 0 |
|
|
DO bj=1,nSy |
|
|
DO bi=1,nSx |
|
|
DO j=1,sNy |
|
|
DO i=1,sNx |
|
|
IF ( ( landMask_loc(i,j,bi,bj) .EQ. atm_waterOnly |
|
|
& .AND. ocMxlD(i,j,bi,bj) .EQ. mxlD_noWater ) |
|
|
& .OR. ( landMask_loc(i,j,bi,bj) .EQ. atm_landOnly |
|
|
& .AND. ocMxlD(i,j,bi,bj) .NE. mxlD_noWater ) ) THEN |
|
|
errFlag = .TRUE. |
|
|
WRITE(msgBuf,'(2(A,I6),2(A,I4),A)') |
|
|
& 'Inconsistent land/sea mask @ (i=', i, ',j=', j, |
|
|
& ',bi=', bi, ',bj=', bj, ')' |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
|
|
WRITE(msgBuf,'(A,E30.15)') |
|
|
& 'Land (atmosphere) ==', landMask_loc(i,j,bi,bj) |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
|
|
WRITE(msgBuf,'(A,E30.15)') |
|
|
& 'Mxl-Depth (ocean) ==', ocMxlD(i,j,bi,bj) |
|
|
CALL PRINT_ERROR( msgBuf, myThid ) |
|
|
ENDIF |
|
|
ENDDO |
|
|
ENDDO |
|
|
ENDDO |
|
|
ENDDO |
|
|
|
|
|
errMsg = ' ' |
|
|
IF ( errFlag ) WRITE(errMsg,'(A)') |
|
|
& 'ATM_EXCH_CONFIGS: Oce & Atm configs are inconsistent' |
|
78 |
|
|
79 |
C-- All procs in World check for error and stop if any |
C-- All procs in World check for error and stop if any |
80 |
|
_BEGIN_MASTER( myThid ) |
81 |
CALL MITCPLR_ALL_CHECK( errFlag, errMsg ) |
CALL MITCPLR_ALL_CHECK( errFlag, errMsg ) |
|
|
|
82 |
_END_MASTER( myThid ) |
_END_MASTER( myThid ) |
83 |
|
|
84 |
_BARRIER |
_BARRIER |
85 |
|
|
86 |
RETURN |
RETURN |