/[MITgcm]/MITgcm/pkg/atm_compon_interf/cpl_exch_configs.F
ViewVC logotype

Contents of /MITgcm/pkg/atm_compon_interf/cpl_exch_configs.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (show annotations) (download)
Mon Dec 2 22:13:23 2013 UTC (10 years, 5 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint65, checkpoint65p, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e
Changes since 1.3: +77 -65 lines
- Send to coupler the number of coupler time-steps to do for this run
- change the config check to test the agreement of Ocean Depth
  with ATM land/sea mask (instead of ATM orography)
- new S/R to get the land/sea mask from an other pkg
- write to file the "config field" received from the other-component

1 C $Header: /u/gcmpack/MITgcm/pkg/atm_compon_interf/cpl_exch_configs.F,v 1.3 2009/12/24 16:49:08 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 coupler EXCH_COMPONENT_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 myThid :: Thread number for this instance of the routine
45 INTEGER myThid
46
47 C !LOCAL VARIABLES:
48 INTEGER i, j, bi, bj
49 LOGICAL errFlag
50 CHARACTER*70 errMsg
51 CHARACTER*(MAX_LEN_MBUF) msgBuf
52 _RL atm_waterOnly, atm_landOnly, mxlD_noWater
53 C-- local variable in common block
54 _RL landMask_loc(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
55 COMMON / CPL_EXCH_CONFIGS_LOC / landMask_loc
56 CEOP
57
58 errFlag = .FALSE.
59
60 C Get configuration information (=land/sea mask) from other pkg
61 CALL ATM_GET_ATMCONFIG(
62 O landMask_loc,
63 I myThid )
64
65 C Post my configuration information to the coupler "layer".
66 CALL ATM_EXPORT_ATMCONFIG(
67 U errFlag,
68 I landMask_loc, myThid )
69
70 C Import other component model(s) configuration(s) from the coupler "layer"
71 C o Get ocean model configuration
72 CALL ATM_IMPORT_OCNCONFIG( myThid )
73
74 C Summarise fields that were imported.
75 C o Plot ocean depths
76 IF ( debugLevel.GE.debLevB ) THEN
77 CALL WRITE_FLD_XY_RL( 'Ocn_MxlD', ' ', ocMxlD, 0, myThid )
78 ENDIF
79 IF ( debugLevel.GE.debLevC ) THEN
80 CALL PLOT_FIELD_XYRL( ocMxlD,
81 & 'Ocean mixed-layer depth on atmos grid',
82 & 1, myThid )
83 ENDIF
84
85 C Do consistency checks on imported fields.
86 C o Check that:
87 C a) where land/sea mask is "water-only", this should be a wet ocean pts
88 C b) where land/sea mask has "no water", this should be a dry ocean pts
89 _BARRIER
90 _BEGIN_MASTER( myThid )
91 atm_waterOnly = 0. _d 0
92 atm_landOnly = 1. _d 0
93 mxlD_noWater = 0. _d 0
94 DO bj=1,nSy
95 DO bi=1,nSx
96 DO j=1,sNy
97 DO i=1,sNx
98 IF ( ( landMask_loc(i,j,bi,bj) .EQ. atm_waterOnly
99 & .AND. ocMxlD(i,j,bi,bj) .EQ. mxlD_noWater )
100 & .OR. ( landMask_loc(i,j,bi,bj) .EQ. atm_landOnly
101 & .AND. ocMxlD(i,j,bi,bj) .NE. mxlD_noWater ) ) THEN
102 errFlag = .TRUE.
103 WRITE(msgBuf,'(2(A,I6),2(A,I4),A)')
104 & 'Inconsistent land/sea mask @ (i=', i, ',j=', j,
105 & ',bi=', bi, ',bj=', bj, ')'
106 CALL PRINT_ERROR( msgBuf, myThid )
107 WRITE(msgBuf,'(A,E30.15)')
108 & 'Land (atmosphere) ==', landMask_loc(i,j,bi,bj)
109 CALL PRINT_ERROR( msgBuf, myThid )
110 WRITE(msgBuf,'(A,E30.15)')
111 & 'Mxl-Depth (ocean) ==', ocMxlD(i,j,bi,bj)
112 CALL PRINT_ERROR( msgBuf, myThid )
113 ENDIF
114 ENDDO
115 ENDDO
116 ENDDO
117 ENDDO
118
119 errMsg = ' '
120 IF ( errFlag ) WRITE(errMsg,'(A)')
121 & 'ATM_EXCH_CONFIGS: Oce & Atm configs are inconsistent'
122
123 C-- All procs in World check for error and stop if any
124 CALL MITCPLR_ALL_CHECK( errFlag, errMsg )
125
126 _END_MASTER( myThid )
127 _BARRIER
128
129 RETURN
130 END

  ViewVC Help
Powered by ViewVC 1.1.22