1 |
C $Header: /u/gcmpack/MITgcm/pkg/aim_v23/aim_land_impl.F,v 1.2 2004/05/21 17:43:04 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "AIM_OPTIONS.h" |
5 |
#ifdef ALLOW_LAND |
6 |
#include "LAND_OPTIONS.h" |
7 |
#endif |
8 |
|
9 |
CBOP |
10 |
C !ROUTINE: AIM_LAND_IMPL |
11 |
C !INTERFACE: |
12 |
SUBROUTINE AIM_LAND_IMPL( |
13 |
I FMASK, dTskin, |
14 |
I Shf0, dShf, Evp0, dEvp, Slr0, dSlr, |
15 |
U sFlx, |
16 |
U Tsurf, SHF, EVAP, SLRU, |
17 |
O dTsurf, |
18 |
I bi, bj, myTime, myIter, myThid) |
19 |
|
20 |
C !DESCRIPTION: \bv |
21 |
C *==========================================================* |
22 |
C | S/R AIM_LAND_IMPL |
23 |
C | o AIM Interface to the implicit part of the land model |
24 |
C *==========================================================* |
25 |
C \ev |
26 |
|
27 |
C !USES: |
28 |
IMPLICIT NONE |
29 |
|
30 |
C == Global variables === |
31 |
C-- size for MITgcm & Physics package : |
32 |
#include "AIM_SIZE.h" |
33 |
|
34 |
#include "EEPARAMS.h" |
35 |
#include "PARAMS.h" |
36 |
|
37 |
#include "AIM_FFIELDS.h" |
38 |
#include "com_physcon.h" |
39 |
c #include "com_physvar.h" |
40 |
|
41 |
#ifdef ALLOW_LAND |
42 |
#include "LAND_SIZE.h" |
43 |
#include "LAND_PARAMS.h" |
44 |
#include "LAND_VARS.h" |
45 |
#endif |
46 |
|
47 |
C !INPUT/OUTPUT PARAMETERS: |
48 |
C == Routine arguments == |
49 |
C FMASK :: land fraction [0-1] |
50 |
C dTskin :: temp. correction for daily-cycle heating [K] |
51 |
C Shf0 :: sensible heat flux over freezing surf. |
52 |
C dShf :: sensible heat flux derivative relative to surf. temp |
53 |
C Evp0 :: evaporation computed over freezing surface (Ts=0.oC) |
54 |
C dEvp :: evaporation derivative relative to surf. temp |
55 |
C Slr0 :: upward long wave radiation over freezing surf. |
56 |
C dSlr :: upward long wave derivative relative to surf. temp |
57 |
C sFlx :: net surface flux (+=down) function of surf. temp Ts: |
58 |
C 0: Flux(Ts=0.oC) ; 1: Flux(Ts^n) ; 2: d.Flux/d.Ts(Ts^n) |
59 |
C Tsurf :: surface temperature (2-dim) |
60 |
C SHF :: sensible heat flux (2-dim) |
61 |
C EVAP :: evaporation [g/(m^2 s)] (2-dim) |
62 |
C SLRU :: sfc lw radiation (upward flux) (2-dim) |
63 |
C dTsurf :: surf. temp change after 1 implicit time step [oC] |
64 |
C bi,bj :: Tile index |
65 |
C myTime :: Current time of simulation ( s ) |
66 |
C myIter :: Current iteration number in simulation |
67 |
C myThid :: Number of this instance of the routine |
68 |
_RL FMASK(NGP), dTskin(NGP) |
69 |
_RL Shf0(NGP), dShf(NGP), Evp0(NGP), dEvp(NGP) |
70 |
_RL Slr0(NGP), dSlr(NGP), sFlx(NGP,0:2) |
71 |
_RL Tsurf(NGP), SHF(NGP), EVAP(NGP), SLRU(NGP) |
72 |
_RL dTsurf(NGP) |
73 |
INTEGER bi, bj, myIter, myThid |
74 |
_RL myTime |
75 |
CEOP |
76 |
|
77 |
#ifdef ALLOW_AIM |
78 |
#ifdef ALLOW_LAND |
79 |
C == Local variables == |
80 |
C i,j, I2 :: loop counters |
81 |
INTEGER i,j, I2 |
82 |
|
83 |
IF ( useLand .AND. land_impl_grT ) THEN |
84 |
|
85 |
C- Initialisation : |
86 |
DO j=1,sNy |
87 |
DO i=1,sNx |
88 |
I2 = i+(j-1)*sNx |
89 |
|
90 |
C- initialize temp. changes and fresh water flux : |
91 |
dTsurf(I2) = 0. |
92 |
land_Pr_m_Ev(i,j,bi,bj) = 0. _d 0 |
93 |
land_EnWFlux(i,j,bi,bj) = 0. _d 0 |
94 |
|
95 |
ENDDO |
96 |
ENDDO |
97 |
|
98 |
IF ( land_calc_snow ) THEN |
99 |
C- Evap of snow: substract Latent Heat of freezing from heatFlux |
100 |
DO j=1,sNy |
101 |
DO i=1,sNx |
102 |
I2 = i+(j-1)*sNx |
103 |
IF ( land_skinT(i,j,bi,bj).LT. 0. _d 0 .OR. |
104 |
& land_hSnow(i,j,bi,bj).GT. 0. _d 0 ) THEN |
105 |
sFlx(I2,0) = sFlx(I2,0) - ALHF*Evp0(I2) |
106 |
sFlx(I2,1) = sFlx(I2,1) - ALHF*EVAP(I2) |
107 |
sFlx(I2,2) = sFlx(I2,2) - ALHF*dEvp(I2) |
108 |
land_EnWFlux(i,j,bi,bj) = -ALHF |
109 |
ENDIF |
110 |
ENDDO |
111 |
ENDDO |
112 |
ENDIF |
113 |
|
114 |
CALL LAND_IMPL_TEMP( |
115 |
I aim_landFr, |
116 |
I dTskin, sFlx, |
117 |
O dTsurf, |
118 |
I bi, bj, myTime, myIter, myThid) |
119 |
|
120 |
C-- Surface B.C. for atmospheric physics: |
121 |
C- Update Evap, Upward SW according to surf. temp. changes |
122 |
DO J=1,NGP |
123 |
IF ( dTsurf(J) .GT. 999. ) THEN |
124 |
SHF (J) = Shf0(J) |
125 |
EVAP(J) = Evp0(J) |
126 |
SLRU(J) = Slr0(J) |
127 |
ELSE |
128 |
SHF (J) = SHF (J) + dTsurf(J)*dShf(J) |
129 |
EVAP(J) = EVAP(J) + dTsurf(J)*dEvp(J) |
130 |
SLRU(J) = SLRU(J) + dTsurf(J)*dSlr(J) |
131 |
ENDIF |
132 |
ENDDO |
133 |
|
134 |
C-- Update surface fluxes for Land model: |
135 |
DO j=1,sNy |
136 |
DO i=1,sNx |
137 |
I2 = i+(j-1)*sNx |
138 |
C- net surface downward heat flux : |
139 |
IF ( dTsurf(I2) .GT. 999. ) THEN |
140 |
land_HeatFlx(i,j,bi,bj) = sFlx(I2,0) |
141 |
ELSE |
142 |
land_HeatFlx(i,j,bi,bj) = sFlx(I2,1)+dTsurf(I2)*sFlx(I2,2) |
143 |
ENDIF |
144 |
C- energy flux associated with Evap of Snow |
145 |
land_EnWFlux(i,j,bi,bj) = -land_EnWFlux(i,j,bi,bj)*EVAP(I2) |
146 |
ENDDO |
147 |
ENDDO |
148 |
|
149 |
C- Update Surf.Temp.: |
150 |
DO J=1,NGP |
151 |
IF ( dTsurf(J) .GT. 999. ) THEN |
152 |
dTsurf(J)= tFreeze - Tsurf(J) |
153 |
Tsurf(J) = tFreeze |
154 |
ELSE |
155 |
Tsurf(J) = Tsurf(J)+ dTsurf(J) |
156 |
ENDIF |
157 |
ENDDO |
158 |
|
159 |
C- end (if useLand & land_impl_grT) |
160 |
ENDIF |
161 |
|
162 |
#endif /* ALLOW_LAND */ |
163 |
#endif /* ALLOW_AIM */ |
164 |
|
165 |
RETURN |
166 |
END |