40 |
|
|
41 |
C == Local Variables == |
C == Local Variables == |
42 |
C msgBuf - Informational/error meesage buffer |
C msgBuf - Informational/error meesage buffer |
43 |
|
C i,j,k,bi,bj :: loop indices |
44 |
|
C grd_HeatCp :: Heat capacity of the ground (J/m3/K) |
45 |
|
C mWater :: water content of the ground (kg/m3) |
46 |
|
C temp_af :: ground temperature if above freezing |
47 |
|
C temp_bf :: ground temperature if below freezing |
48 |
c CHARACTER*(MAX_LEN_MBUF) msgBuf |
c CHARACTER*(MAX_LEN_MBUF) msgBuf |
49 |
|
INTEGER i,j,k,bi,bj |
50 |
|
_RL grd_HeatCp, mWater |
51 |
|
_RL temp_af, temp_bf |
52 |
|
|
53 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
54 |
|
|
55 |
|
C-- Initialize Land package variables |
56 |
|
|
57 |
|
C- Over all tiles |
58 |
|
DO bj = myByLo(myThid), myByHi(myThid) |
59 |
|
DO bi = myBxLo(myThid), myBxHi(myThid) |
60 |
|
|
61 |
|
C- 3D arrays |
62 |
|
DO k=1,land_nLev |
63 |
|
DO J=1-Oly,sNy+Oly |
64 |
|
DO I=1-Olx,sNx+Olx |
65 |
|
land_groundT(i,j,k,bi,bj) = 0. _d 0 |
66 |
|
land_enthalp(i,j,k,bi,bj) = 0. _d 0 |
67 |
|
land_groundW(i,j,k,bi,bj) = 0. _d 0 |
68 |
|
ENDDO |
69 |
|
ENDDO |
70 |
|
ENDDO |
71 |
|
|
72 |
|
C- 2D arrays |
73 |
|
DO J=1-Oly,sNy+Oly |
74 |
|
DO I=1-Olx,sNx+Olx |
75 |
|
land_skinT (i,j,bi,bj) = 0. _d 0 |
76 |
|
land_hSnow (i,j,bi,bj) = 0. _d 0 |
77 |
|
land_snowAge(i,j,bi,bj) = 0. _d 0 |
78 |
|
land_runOff (i,j,bi,bj) = 0. _d 0 |
79 |
|
land_enRnOf (i,j,bi,bj) = 0. _d 0 |
80 |
|
land_HeatFLx(i,j,bi,bj) = 0. _d 0 |
81 |
|
land_Pr_m_Ev(i,j,bi,bj) = 0. _d 0 |
82 |
|
land_EnWFlux(i,j,bi,bj) = 0. _d 0 |
83 |
|
ENDDO |
84 |
|
ENDDO |
85 |
|
|
86 |
|
C- end bi,bj loops |
87 |
|
ENDDO |
88 |
|
ENDDO |
89 |
|
|
90 |
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
91 |
|
|
92 |
IF ( startTime.EQ.0. .AND. nIter0.EQ.0 ) THEN |
IF ( startTime.EQ.0. .AND. nIter0.EQ.0 ) THEN |
93 |
|
|
101 |
CALL MDSREADFIELD( land_grW_iniFile, readBinaryPrec, 'RL', |
CALL MDSREADFIELD( land_grW_iniFile, readBinaryPrec, 'RL', |
102 |
& land_nLev, land_groundW, 1, myThid) |
& land_nLev, land_groundW, 1, myThid) |
103 |
ENDIF |
ENDIF |
104 |
|
IF ( land_snow_iniFile .NE. ' ' ) THEN |
105 |
|
CALL MDSREADFIELD( land_snow_iniFile,readBinaryPrec, 'RL', |
106 |
|
& 1, land_hSnow, 1, myThid) |
107 |
|
ENDIF |
108 |
_END_MASTER(myThid) |
_END_MASTER(myThid) |
109 |
|
|
110 |
|
C- to have a consistent initial stater: derive surface Temp, |
111 |
|
C & enthalpy (assuming liquid water only): |
112 |
|
|
113 |
ELSEIF ( land_calc_grT .OR. land_calc_grW ) THEN |
ELSEIF ( land_calc_grT .OR. land_calc_grW ) THEN |
114 |
|
|
115 |
C-- Read Land package state variables from pickup file |
C-- Read Land package state variables from pickup file |
120 |
C load grT & grW from AIM surf. BC in S/R aim_land2aim |
C load grT & grW from AIM surf. BC in S/R aim_land2aim |
121 |
ENDIF |
ENDIF |
122 |
|
|
123 |
|
DO bj=myByLo(myThid),myByHi(myThid) |
124 |
|
DO bi=myBxLo(myThid),myBxHi(myThid) |
125 |
|
|
126 |
|
C- to have a consistent initial state: derive surface Temp, |
127 |
|
C & enthalpy (assuming liquid water only): |
128 |
|
IF ( ( startTime.EQ.0. .AND. nIter0.EQ.0 ) .OR. |
129 |
|
& .NOT.( land_calc_grT .OR. land_calc_grW ) .OR. |
130 |
|
& land_oldPickup ) THEN |
131 |
|
DO j=1,sNy |
132 |
|
DO i=1,sNx |
133 |
|
c IF ( land_frc(i,j,bi,bj).GT.0. ) THEN |
134 |
|
DO k=1,land_nLev |
135 |
|
mWater = land_rhoLiqW*land_waterCap |
136 |
|
& *land_groundW(i,j,k,bi,bj) |
137 |
|
grd_HeatCp = land_heatCs + land_CpWater*mWater |
138 |
|
land_enthalp(i,j,k,bi,bj) = |
139 |
|
& grd_HeatCp*land_groundT(i,j,k,bi,bj) |
140 |
|
IF (land_groundT(i,j,k,bi,bj).LT. 0. _d 0) |
141 |
|
& land_enthalp(i,j,k,bi,bj) = land_enthalp(i,j,k,bi,bj) |
142 |
|
& - land_Lfreez*mWater |
143 |
|
ENDDO |
144 |
|
land_skinT(i,j,bi,bj) = land_groundT(i,j,1,bi,bj) |
145 |
|
c ENDIF |
146 |
|
ENDDO |
147 |
|
ENDDO |
148 |
|
ELSE |
149 |
|
DO j=1,sNy |
150 |
|
DO i=1,sNx |
151 |
|
DO k=1,land_nLev |
152 |
|
mWater = land_rhoLiqW*land_waterCap |
153 |
|
& *land_groundW(i,j,k,bi,bj) |
154 |
|
grd_HeatCp = land_heatCs + land_CpWater*mWater |
155 |
|
C temperature if below freezing: |
156 |
|
temp_bf = (land_enthalp(i,j,k,bi,bj)+land_Lfreez*mWater) |
157 |
|
& / grd_HeatCp |
158 |
|
C temperature if above freezing: |
159 |
|
temp_af = land_enthalp(i,j,k,bi,bj) / grd_HeatCp |
160 |
|
land_groundT(i,j,k,bi,bj) = |
161 |
|
& MIN( temp_bf, MAX(temp_af, 0. _d 0) ) |
162 |
|
ENDDO |
163 |
|
ENDDO |
164 |
|
ENDDO |
165 |
|
ENDIF |
166 |
|
|
167 |
|
C- end bi,bj loops |
168 |
|
ENDDO |
169 |
|
ENDDO |
170 |
|
|
171 |
#endif /* ALLOW_LAND */ |
#endif /* ALLOW_LAND */ |
172 |
|
|
173 |
RETURN |
RETURN |