/[MITgcm]/MITgcm/pkg/aim_v23/aim_do_physics.F
ViewVC logotype

Annotation of /MITgcm/pkg/aim_v23/aim_do_physics.F

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


Revision 1.11 - (hide annotations) (download)
Thu May 25 18:05:24 2006 UTC (18 years, 1 month ago) by jmc
Branch: MAIN
CVS Tags: checkpoint58f_post, checkpoint58m_post, checkpoint58o_post, checkpoint58p_post, checkpoint58n_post, checkpoint58k_post, checkpoint58l_post, checkpoint58g_post, checkpoint58h_post, checkpoint58j_post, checkpoint58i_post
Changes since 1.10: +18 -23 lines
- put i,j loops inside S/R: THSICE_ALBEDO & THSICE_SOLVE4TEMP

1 jmc 1.11 C $Header: /u/gcmpack/MITgcm/pkg/aim_v23/aim_do_physics.F,v 1.10 2006/01/26 00:18:54 jmc 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.10 SUBROUTINE AIM_DO_PHYSICS( bi, bj, myTime, myIter, myThid )
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.11 C bi,bj - Tile index
49 jmc 1.1 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 jmc 1.5 CEOP
55 jmc 1.1
56     #ifdef ALLOW_AIM
57     C == Local variables ==
58 jmc 1.11 C i,j,k,I2 - Loop counters
59 jmc 1.1 C tYear - Fraction into year
60     C Katm - Atmospheric K index
61 jmc 1.5 C prcAtm :: total precip from the atmosphere [kg/m2/s]
62 jmc 1.11 INTEGER i,j,k,I2
63 jmc 1.1 c INTEGER Katm
64     _RL tYear, yearLength
65 jmc 1.5 _RL prcAtm(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
66 jmc 1.1
67     C_jmc: Because AIM physics LSC is not applied in the stratosphere (top level),
68     C ==> move water wapor from the stratos to the surface level.
69     DO j = 1-Oly, sNy+Oly
70     DO i = 1-Olx, sNx+Olx
71     k = ksurfC(i,j,bi,bj)
72     IF (k.LE.Nr)
73     & salt(i,j,k,bi,bj) = salt(i,j,k,bi,bj)
74     & + salt(i,j,Nr,bi,bj)*drF(Nr)*recip_drF(k)
75     & *hFacC(i,j,Nr,bi,bj)*recip_hFacC(i,j,k,bi,bj)
76     salt(i,j,Nr,bi,bj) = 0.
77     ENDDO
78     ENDDO
79    
80     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
81    
82     C- Physics package needs to know time of year as a fraction
83     yearLength = 86400.*360.
84 jmc 1.11 tYear = MOD(myTime/yearLength, 1. _d 0)
85 jmc 1.1 c tYear = myTime/(86400.*360.) -
86     c & FLOAT(INT(myTime/(86400.*360.)))
87    
88 jmc 1.2 C-- Set surface Boundary Conditions for atmos. physics package:
89     C (Albedo, Soil moisture, Surf Temp, Land sea mask)
90     C includes some parts of S/R FORDATE from F.Molteni SPEDDY code (ver23)
91     CALL AIM_SURF_BC( tYear, myTime, myIter, bi, bj, myThid )
92 jmc 1.1
93     C-- Set surface geopotential: (g * orographic height)
94 jmc 1.11 DO j=1,sNy
95     DO i=1,sNx
96     I2 = i+(j-1)*sNx
97 jmc 1.1 PHI0(I2) = gravity*topoZ(i,j,bi,bj)
98     ENDDO
99     ENDDO
100    
101     C-- Set topographic dependent FOROG var (originally in common SFLFIX);
102     C used to compute for wind stress over land
103    
104     c_FM IF (IDAY.EQ.0) THEN
105     c_FM CALL SFLSET (PHIS0)
106     CALL SFLSET (PHI0, fOrogr(1,myThid), bi,bj,myThid)
107     c_FM ENDIF
108     c_FM CALL SOL_OZ (SOLC,TYEAR)
109    
110     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
111    
112     C- Compute atmospheric-physics tendencies (call the main AIM S/R)
113 jmc 1.10 CALL PHY_DRIVER( tYear, useDiagnostics,
114     I bi, bj, myTime, myIter, myThid )
115 jmc 1.1
116     CALL AIM_AIM2DYN( bi, bj, myTime, myIter, myThid )
117 jmc 1.3
118     #ifdef ALLOW_LAND
119 jmc 1.4 IF (useLand) THEN
120 jmc 1.3 C- prepare Surface flux over land for land package
121 jmc 1.11 CALL AIM_AIM2LAND( aim_landFr, bi, bj,
122 jmc 1.3 I myTime, myIter, myThid )
123    
124     C- Step forward land model
125 jmc 1.11 CALL LAND_STEPFWD( aim_landFr, bi, bj,
126 jmc 1.3 I myTime, myIter, myThid )
127    
128     C- Land diagnostics : write snap-shot & cumulate for TimeAve output
129 jmc 1.11 CALL LAND_DO_DIAGS( aim_landFr, bi, bj,
130 jmc 1.9 I myTime, myIter, myThid )
131 jmc 1.3
132     ENDIF
133     #endif /* ALLOW_LAND */
134 jmc 1.5
135 jmc 1.11 C- surface fluxes over ocean (ice-free & ice covered)
136 jmc 1.6 C used for diagnostics, thsice package and coupler
137 jmc 1.7 CALL AIM_AIM2SIOCE( aim_landFr, fmask1(1,3,myThid),
138 jmc 1.11 O prcAtm,
139 jmc 1.6 I bi, bj, myTime, myIter, myThid )
140    
141 jmc 1.5 #ifdef ALLOW_THSICE
142     IF ( useThSIce ) THEN
143    
144     C- Step forward sea-ice model
145     CALL THSICE_STEP_FWD( bi, bj, 1, sNx, 1, sNy,
146 jmc 1.11 I prcAtm,
147 jmc 1.5 I myTime, myIter, myThid )
148    
149 jmc 1.11 C- Slab Ocean : step forward ocean mixed-layer temp. & salinity
150     CALL THSICE_SLAB_OCEAN(
151     O dTsurf(1,2,myThid),
152 jmc 1.8 I bi,bj, myThid )
153 jmc 1.5
154 jmc 1.11 CALL THSICE_AVE(
155 jmc 1.5 I bi, bj, myTime, myIter, myThid )
156    
157     ENDIF
158     #endif /* ALLOW_THSICE */
159 jmc 1.4
160     #ifdef COMPONENT_MODULE
161     IF ( useCoupler ) THEN
162     CALL ATM_STORE_MY_DATA( bi, bj, myIter, myTime, myThid )
163     ENDIF
164     #endif /* COMPONENT_MODULE */
165 jmc 1.1
166 jmc 1.8 C- AIM diagnostics : write snap-shot & cumulate for TimeAve output
167     CALL AIM_DIAGNOSTICS( bi, bj, myTime, myIter, myThid )
168    
169 jmc 1.1 #endif /* ALLOW_AIM */
170    
171     RETURN
172     END

  ViewVC Help
Powered by ViewVC 1.1.22