/[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.10 - (show annotations) (download)
Sat Jan 16 22:02:32 2016 UTC (10 years ago) by jmc
Branch: MAIN
CVS Tags: checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, HEAD
Changes since 1.9: +1 -37 lines
- move update of DIC forcing fields (with value from ATM-OCN coupler)
  in new S/R DIC_FIELDS_UPDATE

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

  ViewVC Help
Powered by ViewVC 1.1.22