1 |
C $Header: /u/gcmpack/MITgcm/pkg/aim_v23/aim_do_physics.F,v 1.4 2003/12/15 02:10:26 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "AIM_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: AIM_DO_PHYSICS |
8 |
C !INTERFACE: |
9 |
SUBROUTINE AIM_DO_PHYSICS( bi, bj, myTime, myIter, myThid ) |
10 |
|
11 |
C !DESCRIPTION: \bv |
12 |
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 |
C \ev |
24 |
|
25 |
C !USES: |
26 |
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 |
#include "AIM_PARAMS.h" |
41 |
#include "AIM_FFIELDS.h" |
42 |
#include "AIM_GRID.h" |
43 |
#include "com_physvar.h" |
44 |
#include "com_forcing.h" |
45 |
|
46 |
C !INPUT/OUTPUT PARAMETERS: |
47 |
C == Routine arguments == |
48 |
C bi,bj - Tile index |
49 |
C myTime - Current time of simulation ( s ) |
50 |
C myIter - Current iteration number in simulation |
51 |
C myThid - Number of this instance of the routine |
52 |
INTEGER bi, bj, myIter, myThid |
53 |
_RL myTime |
54 |
CEOP |
55 |
|
56 |
#ifdef ALLOW_AIM |
57 |
C == Local variables == |
58 |
C I,J,K,I2 - Loop counters |
59 |
C tYear - Fraction into year |
60 |
C Katm - Atmospheric K index |
61 |
C prcAtm :: total precip from the atmosphere [kg/m2/s] |
62 |
C evpAtm :: evaporation to the atmosphere [kg/m2/s] (>0 if evaporate) |
63 |
C flxSW :: net Short-Wave heat flux into the ocean (+=down) [W/m2] |
64 |
INTEGER I,J,K,I2 |
65 |
c INTEGER Katm |
66 |
_RL tYear, yearLength |
67 |
#ifdef ALLOW_THSICE |
68 |
_RL prcAtm(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
69 |
_RL evpAtm(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
70 |
_RL flxSW (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
71 |
#endif |
72 |
|
73 |
C_jmc: Because AIM physics LSC is not applied in the stratosphere (top level), |
74 |
C ==> move water wapor from the stratos to the surface level. |
75 |
DO j = 1-Oly, sNy+Oly |
76 |
DO i = 1-Olx, sNx+Olx |
77 |
k = ksurfC(i,j,bi,bj) |
78 |
IF (k.LE.Nr) |
79 |
& salt(i,j,k,bi,bj) = salt(i,j,k,bi,bj) |
80 |
& + salt(i,j,Nr,bi,bj)*drF(Nr)*recip_drF(k) |
81 |
& *hFacC(i,j,Nr,bi,bj)*recip_hFacC(i,j,k,bi,bj) |
82 |
salt(i,j,Nr,bi,bj) = 0. |
83 |
ENDDO |
84 |
ENDDO |
85 |
|
86 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
87 |
|
88 |
C- Physics package needs to know time of year as a fraction |
89 |
yearLength = 86400.*360. |
90 |
tYear = mod(myTime/yearLength, 1. _d 0) |
91 |
c tYear = myTime/(86400.*360.) - |
92 |
c & FLOAT(INT(myTime/(86400.*360.))) |
93 |
|
94 |
C-- Set surface Boundary Conditions for atmos. physics package: |
95 |
C (Albedo, Soil moisture, Surf Temp, Land sea mask) |
96 |
C includes some parts of S/R FORDATE from F.Molteni SPEDDY code (ver23) |
97 |
CALL AIM_SURF_BC( tYear, myTime, myIter, bi, bj, myThid ) |
98 |
|
99 |
C-- Set surface geopotential: (g * orographic height) |
100 |
DO J=1,sNy |
101 |
DO I=1,sNx |
102 |
I2 = I+(J-1)*sNx |
103 |
PHI0(I2) = gravity*topoZ(i,j,bi,bj) |
104 |
ENDDO |
105 |
ENDDO |
106 |
|
107 |
C-- Set topographic dependent FOROG var (originally in common SFLFIX); |
108 |
C used to compute for wind stress over land |
109 |
|
110 |
c_FM IF (IDAY.EQ.0) THEN |
111 |
c_FM CALL SFLSET (PHIS0) |
112 |
CALL SFLSET (PHI0, fOrogr(1,myThid), bi,bj,myThid) |
113 |
c_FM ENDIF |
114 |
c_FM CALL SOL_OZ (SOLC,TYEAR) |
115 |
|
116 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
117 |
|
118 |
C- Compute atmospheric-physics tendencies (call the main AIM S/R) |
119 |
CALL PHY_DRIVER( tYear, myTime, myIter, bi, bj, myThid ) |
120 |
|
121 |
C- AIM diagnostics : write snap-shot & cumulate for TimeAve output |
122 |
CALL AIM_DIAGNOSTICS( bi, bj, myTime, myIter, myThid ) |
123 |
|
124 |
CALL AIM_AIM2DYN( bi, bj, myTime, myIter, myThid ) |
125 |
|
126 |
#ifdef ALLOW_LAND |
127 |
IF (useLand) THEN |
128 |
C- prepare Surface flux over land for land package |
129 |
CALL AIM_AIM2LAND( aim_landFr, bi, bj, |
130 |
I myTime, myIter, myThid ) |
131 |
|
132 |
C- Step forward land model |
133 |
CALL LAND_STEPFWD( aim_landFr, bi, bj, |
134 |
I myTime, myIter, myThid ) |
135 |
|
136 |
C- Land diagnostics : write snap-shot & cumulate for TimeAve output |
137 |
CALL LAND_DIAGNOSTICS( aim_landFr, bi, bj, |
138 |
I myTime, myIter, myThid ) |
139 |
|
140 |
ENDIF |
141 |
#endif /* ALLOW_LAND */ |
142 |
|
143 |
#ifdef ALLOW_THSICE |
144 |
IF ( useThSIce ) THEN |
145 |
C- prepare Surface flux over sea-ice for thsice package |
146 |
CALL AIM_AIM2SICE( aim_landFr, |
147 |
O prcAtm, evpAtm, flxSW, |
148 |
I bi, bj, myTime, myIter, myThid ) |
149 |
|
150 |
C- Step forward sea-ice model |
151 |
CALL THSICE_STEP_FWD( bi, bj, 1, sNx, 1, sNy, |
152 |
I prcAtm, |
153 |
U evpAtm, flxSW, |
154 |
I myTime, myIter, myThid ) |
155 |
|
156 |
C- Slab Ocean : step forward ocean mixed-layer temp. & salinity |
157 |
CALL THSICE_SLAB_OCEAN( bi,bj, myThid ) |
158 |
|
159 |
CALL THSICE_AVE( evpAtm, flxSW, |
160 |
I bi, bj, myTime, myIter, myThid ) |
161 |
|
162 |
ENDIF |
163 |
#endif /* ALLOW_THSICE */ |
164 |
|
165 |
#ifdef COMPONENT_MODULE |
166 |
IF ( useCoupler ) THEN |
167 |
CALL ATM_STORE_MY_DATA( bi, bj, myIter, myTime, myThid ) |
168 |
ENDIF |
169 |
#endif /* COMPONENT_MODULE */ |
170 |
|
171 |
#endif /* ALLOW_AIM */ |
172 |
|
173 |
RETURN |
174 |
END |