1 |
C $Header: /u/gcmpack/MITgcm/pkg/aim_v23/aim_land2aim.F,v 1.5 2004/05/15 20:32: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_LAND2AIM |
11 |
C !INTERFACE: |
12 |
SUBROUTINE AIM_LAND2AIM( |
13 |
I land_frc, land_veg, grnd_alb, snowFld, |
14 |
U aimTld, aimSWA, aimAlb, |
15 |
I myTime, myIter, bi, bj, myThid ) |
16 |
|
17 |
C !DESCRIPTION: \bv |
18 |
C *================================================================* |
19 |
C | S/R AIM_LAND2AIM |
20 |
C | provide surface Boundary Conditions over land (from land pkg) |
21 |
C | to atmospheric physics package AIM |
22 |
C *================================================================* |
23 |
C | note: by default, use AIM surf.B.C. fields as initial state |
24 |
C | (myIter=0) for the land model |
25 |
C *================================================================* |
26 |
C \ev |
27 |
|
28 |
C !USES: |
29 |
IMPLICIT NONE |
30 |
|
31 |
C == Global variables === |
32 |
C-- size for MITgcm & Physics package : |
33 |
#include "AIM_SIZE.h" |
34 |
|
35 |
C-- MITgcm |
36 |
#include "EEPARAMS.h" |
37 |
#include "PARAMS.h" |
38 |
|
39 |
C-- Physics package |
40 |
#include "AIM_PARAMS.h" |
41 |
#include "com_forcon.h" |
42 |
|
43 |
#ifdef ALLOW_LAND |
44 |
C-- Land package |
45 |
#include "LAND_SIZE.h" |
46 |
#include "LAND_PARAMS.h" |
47 |
#include "LAND_VARS.h" |
48 |
#endif |
49 |
|
50 |
C == Routine arguments == |
51 |
C land_frc :: land fraction [0-1] |
52 |
C land_veg :: vegetation fraction [0-1] |
53 |
C grnd_alb :: ground albedo [0-1] |
54 |
C aimTld :: land surface temp (K), used in AIM |
55 |
C snowFld :: prescribed snow thickness (from AIM input data) [m] |
56 |
C aimSWA :: soil wetness availability [0-1], used in AIM |
57 |
C aimAlb :: land albedo [0-1], used in AIM |
58 |
C myTime :: Current time of simulation ( s ) |
59 |
C myIter :: Current iteration number in simulation |
60 |
C bi,bj :: Tile index |
61 |
C myThid :: Number of this instance of the routine |
62 |
_RS land_frc(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
63 |
_RS land_veg(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
64 |
_RS grnd_alb(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
65 |
_RL snowFld(sNx,sNy) |
66 |
_RL aimTld(sNx,sNy) |
67 |
_RL aimSWA(sNx,sNy) |
68 |
_RL aimAlb(sNx,sNy) |
69 |
INTEGER myIter, bi, bj, myThid |
70 |
_RL myTime |
71 |
CEOP |
72 |
|
73 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
74 |
|
75 |
#ifdef ALLOW_AIM |
76 |
#ifdef ALLOW_LAND |
77 |
|
78 |
C == Local variables == |
79 |
C i,j,k :: Loop counters |
80 |
C grd_HeatCp :: Heat capacity of the ground [J/m3/K] |
81 |
C mWater :: water content of the ground [kg/m3] |
82 |
C recip_hSnWet :: reciprol effective snow depth for wetness (m^-1) |
83 |
C recip_mSnWet :: reciprol effective snow cover for wetness (mm^-1) |
84 |
INTEGER i,j,k |
85 |
INTEGER kFillW |
86 |
_RL grd_HeatCp, mWater |
87 |
_RL RSD |
88 |
_RL recip_hSnWet, recip_mSnWet |
89 |
|
90 |
c IF (useLand) THEN |
91 |
|
92 |
IF ( land_calc_grT ) THEN |
93 |
C- Use land-pkg output instead of prescribed ground Temp |
94 |
DO j=1,sNy |
95 |
DO i=1,sNx |
96 |
aimTld(i,j) = land_skinT(i,j,bi,bj)+celsius2K |
97 |
ENDDO |
98 |
ENDDO |
99 |
ELSE |
100 |
C- Fill in land-pkg ground Temp. using AIM surf. fields |
101 |
DO k=1,land_nLev |
102 |
DO j=1,sNy |
103 |
DO i=1,sNx |
104 |
land_groundT(i,j,k,bi,bj) = aimTld(i,j)-celsius2K |
105 |
ENDDO |
106 |
ENDDO |
107 |
ENDDO |
108 |
DO j=1,sNy |
109 |
DO i=1,sNx |
110 |
land_skinT(i,j,bi,bj) = land_groundT(i,j,1,bi,bj) |
111 |
ENDDO |
112 |
ENDDO |
113 |
ENDIF |
114 |
|
115 |
IF (land_calc_grW) THEN |
116 |
C- Use land-pkg output instead of prescribed soil moisture |
117 |
IF ( land_calc_snow ) THEN |
118 |
C Units: hSnow & hSnowWetness are in meter (of snow) |
119 |
recip_hSnWet = 0. _d 0 |
120 |
IF ( hSnowWetness .NE. 0. _d 0 ) |
121 |
& recip_hSnWet = 1. _d 0 / hSnowWetness |
122 |
DO j=1,sNy |
123 |
DO i=1,sNx |
124 |
aimSWA(i,j) = land_groundW(i,j,1,bi,bj) |
125 |
& + land_hSnow(i,j,bi,bj)*recip_hSnWet |
126 |
aimSWA(i,j) = MIN( MAX(0. _d 0, aimSWA(i,j)), 1. _d 0 ) |
127 |
ENDDO |
128 |
ENDDO |
129 |
ELSE |
130 |
C Units: snowFld is in milimeter of equivalent liquid water |
131 |
recip_mSnWet = 0. _d 0 |
132 |
IF ( hSnowWetness .NE. 0. _d 0 ) |
133 |
& recip_mSnWet = land_rhoLiqW |
134 |
& / (land_rhoSnow*hSnowWetness*1000. _d 0) |
135 |
DO j=1,sNy |
136 |
DO i=1,sNx |
137 |
aimSWA(i,j) = land_groundW(i,j,1,bi,bj) |
138 |
& + snowFld(i,j)*recip_mSnWet |
139 |
aimSWA(i,j) = MIN( MAX(0. _d 0, aimSWA(i,j)), 1. _d 0 ) |
140 |
ENDDO |
141 |
ENDDO |
142 |
ENDIF |
143 |
ELSE |
144 |
C- Fill in land-pkg soil moisture using AIM surf. fields |
145 |
kFillW = land_nLev |
146 |
IF (land_calc_grT) kFillW = 1 |
147 |
DO k=1,kFillW |
148 |
DO j=1,sNy |
149 |
DO i=1,sNx |
150 |
land_groundW(i,j,k,bi,bj) = aimSWA(i,j) |
151 |
ENDDO |
152 |
ENDDO |
153 |
ENDDO |
154 |
c IF ( land_calc_grT ) THEN |
155 |
C- needs to recompute enthalpy since grdW has changed: |
156 |
C not a good idea: frozen water in the ground will be lost ! |
157 |
IF ( .FALSE. ) THEN |
158 |
DO j=1,sNy |
159 |
DO i=1,sNx |
160 |
c IF ( land_frc(i,j,bi,bj).GT.0. ) THEN |
161 |
DO k=1,land_nLev |
162 |
mWater = land_rhoLiqW*land_waterCap |
163 |
& *land_groundW(i,j,k,bi,bj) |
164 |
grd_HeatCp = land_heatCs + land_CpWater*mWater |
165 |
|
166 |
land_enthalp(i,j,k,bi,bj) = |
167 |
& grd_HeatCp*land_groundT(i,j,k,bi,bj) |
168 |
ENDDO |
169 |
c ENDIF |
170 |
ENDDO |
171 |
ENDDO |
172 |
ENDIF |
173 |
|
174 |
C- end: if land_calc_grW |
175 |
ENDIF |
176 |
|
177 |
IF (land_calc_snow) THEN |
178 |
|
179 |
IF (land_calc_alb) THEN |
180 |
C- Compute albedo of snow ; and replace albedo of land. |
181 |
CALL LAND_ALBEDO( |
182 |
I land_frc, grnd_alb, |
183 |
O aimAlb, |
184 |
I bi,bj, myTime, myIter, myThid ) |
185 |
|
186 |
ELSE |
187 |
C- Surface Albedo : (from F.M. FORDATE S/R) |
188 |
RSD = 1. _d 0/SDALB |
189 |
DO j=1,sNy |
190 |
DO i=1,sNx |
191 |
aimAlb(i,j) = grnd_alb(i,j,bi,bj) |
192 |
& + MAX( 0. _d 0, ALBSN-grnd_alb(i,j,bi,bj) ) |
193 |
& *MIN( 1. _d 0, RSD*snowFld(i,j) ) |
194 |
ENDDO |
195 |
ENDDO |
196 |
ENDIF |
197 |
|
198 |
ENDIF |
199 |
|
200 |
c ENDIF |
201 |
|
202 |
#endif /* ALLOW_LAND */ |
203 |
#endif /* ALLOW_AIM */ |
204 |
|
205 |
RETURN |
206 |
END |