/[MITgcm]/MITgcm/pkg/ocn_compon_interf/ocn_apply_import.F
ViewVC logotype

Contents of /MITgcm/pkg/ocn_compon_interf/ocn_apply_import.F

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


Revision 1.7 - (show annotations) (download)
Tue Apr 28 18:44:21 2009 UTC (15 years ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint65, checkpoint62, checkpoint63, checkpoint65p, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint61n, checkpoint61o, checkpoint61m, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.6: +12 -12 lines
fix wrong type of EXCH for fice, AtmospCO2, wind
+ change macros (EXCH & GLOBAL_SUM/MAX) sufix _R4/_R8 to _RS/_RL
  when applied to _RS/_RL variable

1 C $Header: /u/gcmpack/MITgcm/pkg/ocn_compon_interf/ocn_apply_import.F,v 1.6 2008/04/04 21:43:57 dfer Exp $
2 C $Name: $
3
4 #include "PACKAGES_CONFIG.h"
5 #include "CPP_OPTIONS.h"
6
7 CBOP
8 C !ROUTINE: OCN_APPLY_IMPORT
9 C !INTERFACE:
10 SUBROUTINE OCN_APPLY_IMPORT(
11 I apply2AllFields, myTime, myIter, myThid )
12 C !DESCRIPTION: \bv
13 C *==========================================================*
14 C | SUBROUTINE OCN_APPLY_IMPORT
15 C | o Apply imported coupling data to forcing fields
16 C *==========================================================*
17 C *==========================================================*
18 C \ev
19
20 C !USES:
21 IMPLICIT NONE
22 C === Global variables ===
23 #include "SIZE.h"
24 #include "EEPARAMS.h"
25 #include "PARAMS.h"
26 #include "CPL_PARAMS.h"
27 #include "OCNIDS.h"
28 #include "OCNCPL.h"
29 #include "FFIELDS.h"
30 #include "SURFACE.h"
31 c #include "GRID.h"
32 c #include "DYNVARS.h"
33 #ifdef ALLOW_DIC
34 # include "DIC_VARS.h"
35 #endif
36
37 C !INPUT/OUTPUT PARAMETERS:
38 C === Routine arguments ===
39 C apply2AllFields - flag: T= apply import to all coupling fields
40 C F= only forcing fields relevant for eta variations
41 C myTime - Simulation time
42 C myIter - Simulation timestep number
43 C myThid - Thread no. that called this routine.
44 LOGICAL apply2AllFields
45 _RL myTime
46 INTEGER myIter
47 INTEGER myThid
48
49 C !LOCAL VARIABLES:
50 C === Local arrays ===
51 INTEGER bi,bj,i,j
52 CEOP
53
54 C-- Use imported coupling data in place of input files data:
55 DO bj = myByLo(myThid), myByHi(myThid)
56 DO bi = myBxLo(myThid), myBxHi(myThid)
57
58 C-- Aplly import to all coupling fields (standard way)
59 IF ( apply2AllFields ) THEN
60
61 C- Dynamical forcing
62 IF ( useImportTau ) THEN
63 DO j=1-Oly,sNy+Oly
64 DO i=1-Olx,sNx+Olx
65 fu(i,j,bi,bj) = tauX(i,j,bi,bj)
66 fv(i,j,bi,bj) = tauY(i,j,bi,bj)
67 ENDDO
68 ENDDO
69 ENDIF
70 IF ( useImportSLP ) THEN
71 DO j=1-Oly,sNy+Oly
72 DO i=1-Olx,sNx+Olx
73 pLoad(i,j,bi,bj) = atmSLPr(i,j,bi,bj)
74 ENDDO
75 ENDDO
76 ENDIF
77 IF ( useImportSIce ) THEN
78 DO j=1-Oly,sNy+Oly
79 DO i=1-Olx,sNx+Olx
80 sIceLoad(i,j,bi,bj) = seaIceMass(i,j,bi,bj)
81 ENDDO
82 ENDDO
83 ENDIF
84
85 C- Fresh-Water & Salinity forcing
86 IF ( useImportFW ) THEN
87 DO j=1-Oly,sNy+Oly
88 DO i=1-Olx,sNx+Olx
89 EmPmR(i,j,bi,bj) = FWFlux (i,j,bi,bj)
90 ENDDO
91 ENDDO
92 ENDIF
93 IF ( useImportFW ) THEN
94 DO j=1-Oly,sNy+Oly
95 DO i=1-Olx,sNx+Olx
96 saltFlux(i,j,bi,bj)= iceSaltFlx(i,j,bi,bj)
97 ENDDO
98 ENDDO
99 ENDIF
100
101 C- Heat Flux forcing
102 IF ( useImportHFlx ) THEN
103 DO j=1-Oly,sNy+Oly
104 DO i=1-Olx,sNx+Olx
105 Qnet(i,j,bi,bj)= HeatFlux (i,j,bi,bj)
106 ENDDO
107 ENDDO
108 #ifdef SHORTWAVE_HEATING
109 DO j=1-Oly,sNy+Oly
110 DO i=1-Olx,sNx+Olx
111 Qsw(i,j,bi,bj) = qShortWave(i,j,bi,bj)
112 ENDDO
113 ENDDO
114 #endif
115 ENDIF
116
117 #ifdef ALLOW_DIC
118 C- Carbon/DIC exchanges
119 IF ( useImportFice ) THEN
120 DO j=1-Oly,sNy+Oly
121 DO i=1-Olx,sNx+Olx
122 fice(i,j,bi,bj)= fracIce(i,j,bi,bj)
123 ENDDO
124 ENDDO
125 ENDIF
126 IF ( useImportCO2 ) THEN
127 DO j=1-Oly,sNy+Oly
128 DO i=1-Olx,sNx+Olx
129 AtmospCO2(i,j,bi,bj)= airCO2(i,j,bi,bj)
130 ENDDO
131 ENDDO
132 ENDIF
133 IF ( useImportWSpd ) THEN
134 DO j=1-Oly,sNy+Oly
135 DO i=1-Olx,sNx+Olx
136 wind(i,j,bi,bj)= surfWSpeed(i,j,bi,bj)
137 ENDDO
138 ENDDO
139 ENDIF
140 #endif /* ALLOW_DIC */
141
142 C-- Apply only to forcings relevant for eta/surf.press variations
143 ELSE
144
145 IF ( useImportSIce .AND. useImportSLP ) THEN
146 DO j=1-Oly,sNy+Oly
147 DO i=1-Olx,sNx+Olx
148 phi0surf(i,j,bi,bj) = atmSLPr(i,j,bi,bj)*recip_rhoConst
149 & + gravity*seaIceMass(i,j,bi,bj)*recip_rhoConst
150 ENDDO
151 ENDDO
152 ELSEIF ( useImportSIce ) THEN
153 DO j=1-Oly,sNy+Oly
154 DO i=1-Olx,sNx+Olx
155 phi0surf(i,j,bi,bj) = pLoad(i,j,bi,bj)*recip_rhoConst
156 & + gravity*seaIceMass(i,j,bi,bj)*recip_rhoConst
157 ENDDO
158 ENDDO
159 ELSEIF ( useImportSLP ) THEN
160 DO j=1-Oly,sNy+Oly
161 DO i=1-Olx,sNx+Olx
162 phi0surf(i,j,bi,bj) = atmSLPr(i,j,bi,bj)*recip_rhoConst
163 ENDDO
164 ENDDO
165 ENDIF
166
167 IF ( useImportFW ) THEN
168 DO j=1-Oly,sNy+Oly
169 DO i=1-Olx,sNx+Olx
170 EmPmR(i,j,bi,bj) = FWFlux (i,j,bi,bj)
171 ENDDO
172 ENDDO
173 ENDIF
174
175 C-- end if apply2AllFields / else blocks
176 ENDIF
177
178 C-- end bi,bj loop
179 ENDDO
180 ENDDO
181
182 C-- Fill in Halo region with valid values
183
184 #ifdef ATMOSPHERIC_LOADING
185 IF ( useImportSLP . AND.
186 & ( ocnCpl_exchange_DIC .OR. apply2AllFields ) )
187 & _EXCH_XY_RS( pLoad, myThid )
188 IF ( apply2AllFields ) THEN
189 IF ( useImportSIce) _EXCH_XY_RS( sIceLoad, myThid )
190 ELSEIF ( useImportSLP .OR. useImportSIce ) THEN
191 _EXCH_XY_RS( phi0surf, myThid )
192 ENDIF
193 #else
194 IF ( useImportSLP . AND. ocnCpl_exchange_DIC)
195 & _EXCH_XY_RS( pLoad, myThid )
196 #endif
197
198 IF ( useImportFW ) _EXCH_XY_RS(EmPmR, myThid )
199 IF ( apply2AllFields ) THEN
200 IF (useImportTau ) CALL EXCH_UV_XY_RS(fu,fv,.TRUE.,myThid)
201 IF (useImportFW ) _EXCH_XY_RS(saltFlux, myThid )
202 IF (useImportHFlx) _EXCH_XY_RS(Qnet , myThid )
203 #ifdef SHORTWAVE_HEATING
204 IF (useImportHFlx) _EXCH_XY_RS(Qsw , myThid )
205 #endif
206 #ifdef ALLOW_DIC
207 IF ( useImportFice ) _EXCH_XY_RL(fice , myThid )
208 IF ( useImportCO2 ) _EXCH_XY_RL(AtmospCO2 , myThid )
209 IF ( useImportWSpd ) _EXCH_XY_RL(wind , myThid )
210 #endif
211 ENDIF
212
213 RETURN
214 END

  ViewVC Help
Powered by ViewVC 1.1.22