1 |
jmc |
1.16 |
C $Header: /u/gcmpack/MITgcm/pkg/aim_v23/aim_do_physics.F,v 1.15 2009/01/05 15:15:33 dfer Exp $ |
2 |
jmc |
1.1 |
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "AIM_OPTIONS.h" |
5 |
|
|
|
6 |
jmc |
1.5 |
CBOP |
7 |
|
|
C !ROUTINE: AIM_DO_PHYSICS |
8 |
|
|
C !INTERFACE: |
9 |
jmc |
1.16 |
SUBROUTINE AIM_DO_PHYSICS( myTime, myIter, myThid ) |
10 |
jmc |
1.10 |
|
11 |
jmc |
1.5 |
C !DESCRIPTION: \bv |
12 |
jmc |
1.1 |
C *==================================================================* |
13 |
|
|
C | S/R AIM_DO_PHYSICS |
14 |
|
|
C *==================================================================* |
15 |
|
|
C | Interface between atmospheric physics package and the |
16 |
|
|
C | dynamical model. |
17 |
|
|
C | Routine calls physics pacakge after setting surface BC. |
18 |
|
|
C | Package should derive and set tendency terms |
19 |
|
|
C | which can be included as external forcing terms in the dynamical |
20 |
|
|
C | tendency routines. Packages should communicate this information |
21 |
|
|
C | through common blocks. |
22 |
|
|
C *==================================================================* |
23 |
jmc |
1.5 |
C \ev |
24 |
|
|
|
25 |
|
|
C !USES: |
26 |
jmc |
1.1 |
IMPLICIT NONE |
27 |
|
|
|
28 |
|
|
C -------------- Global variables ------------------------------------ |
29 |
|
|
C-- size for MITgcm & Physics package : |
30 |
|
|
#include "AIM_SIZE.h" |
31 |
|
|
|
32 |
|
|
C-- MITgcm |
33 |
|
|
#include "EEPARAMS.h" |
34 |
|
|
#include "PARAMS.h" |
35 |
|
|
#include "DYNVARS.h" |
36 |
|
|
#include "GRID.h" |
37 |
|
|
#include "SURFACE.h" |
38 |
|
|
|
39 |
|
|
C-- Physics package |
40 |
jmc |
1.3 |
#include "AIM_PARAMS.h" |
41 |
jmc |
1.1 |
#include "AIM_FFIELDS.h" |
42 |
|
|
#include "AIM_GRID.h" |
43 |
|
|
#include "com_physvar.h" |
44 |
|
|
#include "com_forcing.h" |
45 |
|
|
|
46 |
jmc |
1.5 |
C !INPUT/OUTPUT PARAMETERS: |
47 |
jmc |
1.1 |
C == Routine arguments == |
48 |
jmc |
1.13 |
C myTime :: Current time in simulation (s) |
49 |
|
|
C myIter :: Current iteration number |
50 |
|
|
C myThid :: My Thread Id. number |
51 |
|
|
_RL myTime |
52 |
|
|
INTEGER myIter |
53 |
|
|
INTEGER myThid |
54 |
jmc |
1.5 |
CEOP |
55 |
jmc |
1.1 |
|
56 |
|
|
#ifdef ALLOW_AIM |
57 |
|
|
C == Local variables == |
58 |
jmc |
1.16 |
C bi,bj :: Tile indices |
59 |
jmc |
1.12 |
C i,j,k,I2 :: Loop counters |
60 |
|
|
C tYear :: Fraction into year |
61 |
|
|
C aim_sWght0 :: weight for time interpolation of surface BC |
62 |
|
|
C aim_sWght1 :: 0/1 = time period before/after the current time |
63 |
|
|
C prcAtm :: total precip from the atmosphere [kg/m2/s] |
64 |
jmc |
1.16 |
INTEGER bi,bj |
65 |
jmc |
1.11 |
INTEGER i,j,k,I2 |
66 |
jmc |
1.1 |
_RL tYear, yearLength |
67 |
jmc |
1.12 |
_RL aim_sWght0, aim_sWght1 |
68 |
jmc |
1.5 |
_RL prcAtm(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
69 |
jmc |
1.1 |
|
70 |
jmc |
1.16 |
C-- Start loops on tile indices |
71 |
|
|
DO bj=myByLo(myThid),myByHi(myThid) |
72 |
|
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
73 |
|
|
|
74 |
jmc |
1.1 |
C_jmc: Because AIM physics LSC is not applied in the stratosphere (top level), |
75 |
|
|
C ==> move water wapor from the stratos to the surface level. |
76 |
|
|
DO j = 1-Oly, sNy+Oly |
77 |
|
|
DO i = 1-Olx, sNx+Olx |
78 |
|
|
k = ksurfC(i,j,bi,bj) |
79 |
|
|
IF (k.LE.Nr) |
80 |
|
|
& salt(i,j,k,bi,bj) = salt(i,j,k,bi,bj) |
81 |
|
|
& + salt(i,j,Nr,bi,bj)*drF(Nr)*recip_drF(k) |
82 |
|
|
& *hFacC(i,j,Nr,bi,bj)*recip_hFacC(i,j,k,bi,bj) |
83 |
|
|
salt(i,j,Nr,bi,bj) = 0. |
84 |
|
|
ENDDO |
85 |
|
|
ENDDO |
86 |
|
|
|
87 |
jmc |
1.13 |
#ifdef ALLOW_THSICE |
88 |
|
|
IF ( useThSIce ) THEN |
89 |
|
|
C- do sea-ice advection before setting any surface BC. |
90 |
|
|
CALL THSICE_DO_ADVECT( |
91 |
|
|
I bi, bj, myTime, myIter, myThid ) |
92 |
|
|
ENDIF |
93 |
|
|
#endif /* ALLOW_THSICE */ |
94 |
|
|
|
95 |
jmc |
1.1 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
96 |
|
|
|
97 |
|
|
C- Physics package needs to know time of year as a fraction |
98 |
|
|
yearLength = 86400.*360. |
99 |
jmc |
1.11 |
tYear = MOD(myTime/yearLength, 1. _d 0) |
100 |
jmc |
1.1 |
|
101 |
jmc |
1.2 |
C-- Set surface Boundary Conditions for atmos. physics package: |
102 |
|
|
C (Albedo, Soil moisture, Surf Temp, Land sea mask) |
103 |
|
|
C includes some parts of S/R FORDATE from F.Molteni SPEDDY code (ver23) |
104 |
jmc |
1.12 |
CALL AIM_SURF_BC( |
105 |
|
|
U tYear, |
106 |
|
|
O aim_sWght0, aim_sWght1, |
107 |
|
|
I bi, bj, myTime, myIter, myThid ) |
108 |
jmc |
1.1 |
|
109 |
dfer |
1.15 |
#ifdef ALLOW_AIM_CO2 |
110 |
|
|
CALL AIM_DO_CO2( bi, bj, myTime, myIter, myThid ) |
111 |
|
|
#endif |
112 |
|
|
|
113 |
jmc |
1.1 |
C-- Set surface geopotential: (g * orographic height) |
114 |
jmc |
1.11 |
DO j=1,sNy |
115 |
|
|
DO i=1,sNx |
116 |
|
|
I2 = i+(j-1)*sNx |
117 |
jmc |
1.1 |
PHI0(I2) = gravity*topoZ(i,j,bi,bj) |
118 |
|
|
ENDDO |
119 |
|
|
ENDDO |
120 |
|
|
|
121 |
|
|
C-- Set topographic dependent FOROG var (originally in common SFLFIX); |
122 |
|
|
C used to compute for wind stress over land |
123 |
|
|
|
124 |
|
|
c_FM IF (IDAY.EQ.0) THEN |
125 |
|
|
c_FM CALL SFLSET (PHIS0) |
126 |
|
|
CALL SFLSET (PHI0, fOrogr(1,myThid), bi,bj,myThid) |
127 |
|
|
c_FM ENDIF |
128 |
|
|
c_FM CALL SOL_OZ (SOLC,TYEAR) |
129 |
|
|
|
130 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
131 |
|
|
|
132 |
|
|
C- Compute atmospheric-physics tendencies (call the main AIM S/R) |
133 |
jmc |
1.10 |
CALL PHY_DRIVER( tYear, useDiagnostics, |
134 |
|
|
I bi, bj, myTime, myIter, myThid ) |
135 |
jmc |
1.1 |
|
136 |
|
|
CALL AIM_AIM2DYN( bi, bj, myTime, myIter, myThid ) |
137 |
jmc |
1.3 |
|
138 |
|
|
#ifdef ALLOW_LAND |
139 |
jmc |
1.4 |
IF (useLand) THEN |
140 |
jmc |
1.3 |
C- prepare Surface flux over land for land package |
141 |
jmc |
1.11 |
CALL AIM_AIM2LAND( aim_landFr, bi, bj, |
142 |
jmc |
1.3 |
I myTime, myIter, myThid ) |
143 |
|
|
|
144 |
|
|
C- Step forward land model |
145 |
jmc |
1.11 |
CALL LAND_STEPFWD( aim_landFr, bi, bj, |
146 |
jmc |
1.3 |
I myTime, myIter, myThid ) |
147 |
|
|
|
148 |
|
|
C- Land diagnostics : write snap-shot & cumulate for TimeAve output |
149 |
jmc |
1.11 |
CALL LAND_DO_DIAGS( aim_landFr, bi, bj, |
150 |
jmc |
1.9 |
I myTime, myIter, myThid ) |
151 |
jmc |
1.3 |
|
152 |
|
|
ENDIF |
153 |
|
|
#endif /* ALLOW_LAND */ |
154 |
jmc |
1.5 |
|
155 |
jmc |
1.11 |
C- surface fluxes over ocean (ice-free & ice covered) |
156 |
jmc |
1.6 |
C used for diagnostics, thsice package and coupler |
157 |
jmc |
1.7 |
CALL AIM_AIM2SIOCE( aim_landFr, fmask1(1,3,myThid), |
158 |
jmc |
1.11 |
O prcAtm, |
159 |
jmc |
1.6 |
I bi, bj, myTime, myIter, myThid ) |
160 |
|
|
|
161 |
jmc |
1.5 |
#ifdef ALLOW_THSICE |
162 |
|
|
IF ( useThSIce ) THEN |
163 |
|
|
|
164 |
|
|
C- Step forward sea-ice model |
165 |
|
|
CALL THSICE_STEP_FWD( bi, bj, 1, sNx, 1, sNy, |
166 |
jmc |
1.11 |
I prcAtm, |
167 |
jmc |
1.5 |
I myTime, myIter, myThid ) |
168 |
|
|
|
169 |
jmc |
1.11 |
C- Slab Ocean : step forward ocean mixed-layer temp. & salinity |
170 |
|
|
CALL THSICE_SLAB_OCEAN( |
171 |
jmc |
1.12 |
I aim_sWght0, aim_sWght1, |
172 |
|
|
O dTsurf(1,2,myThid), |
173 |
|
|
I bi, bj, myTime, myIter, myThid ) |
174 |
jmc |
1.5 |
|
175 |
jmc |
1.11 |
CALL THSICE_AVE( |
176 |
jmc |
1.5 |
I bi, bj, myTime, myIter, myThid ) |
177 |
|
|
|
178 |
|
|
ENDIF |
179 |
|
|
#endif /* ALLOW_THSICE */ |
180 |
jmc |
1.4 |
|
181 |
|
|
#ifdef COMPONENT_MODULE |
182 |
|
|
IF ( useCoupler ) THEN |
183 |
jmc |
1.14 |
CALL ATM_STORE_MY_DATA( bi, bj, myTime, myIter, myThid ) |
184 |
jmc |
1.4 |
ENDIF |
185 |
|
|
#endif /* COMPONENT_MODULE */ |
186 |
jmc |
1.1 |
|
187 |
jmc |
1.8 |
C- AIM diagnostics : write snap-shot & cumulate for TimeAve output |
188 |
|
|
CALL AIM_DIAGNOSTICS( bi, bj, myTime, myIter, myThid ) |
189 |
|
|
|
190 |
jmc |
1.16 |
C-- end bi,bj loops. |
191 |
|
|
ENDDO |
192 |
|
|
ENDDO |
193 |
jmc |
1.1 |
#endif /* ALLOW_AIM */ |
194 |
|
|
|
195 |
|
|
RETURN |
196 |
|
|
END |