/[MITgcm]/MITgcm/pkg/land/land_ini_vars.F
ViewVC logotype

Annotation of /MITgcm/pkg/land/land_ini_vars.F

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


Revision 1.4 - (hide annotations) (download)
Sat May 15 20:28:09 2004 UTC (20 years, 1 month ago) by jmc
Branch: MAIN
CVS Tags: checkpoint53d_post, checkpoint54a_pre, checkpoint55c_post, checkpoint54e_post, checkpoint54a_post, checkpoint53c_post, checkpoint55d_pre, checkpoint57d_post, checkpoint57b_post, checkpoint57c_pre, checkpoint55j_post, checkpoint56b_post, checkpoint57e_post, checkpoint55h_post, checkpoint54b_post, checkpoint55b_post, checkpoint54d_post, checkpoint56c_post, checkpoint55, checkpoint57f_pre, checkpoint57a_post, checkpoint54, checkpoint54f_post, checkpoint55g_post, checkpoint55f_post, checkpoint57a_pre, checkpoint55i_post, checkpoint57, checkpoint56, eckpoint57e_pre, checkpoint53g_post, checkpoint57c_post, checkpoint55e_post, checkpoint53f_post, checkpoint55a_post, checkpoint53d_pre, checkpoint54c_post, checkpoint56a_post, checkpoint55d_post
Changes since 1.3: +3 -6 lines
update comments

1 jmc 1.4 C $Header: /u/gcmpack/MITgcm/pkg/land/land_ini_vars.F,v 1.3 2004/03/11 14:42:00 jmc Exp $
2 jmc 1.1 C $Name: $
3    
4     #include "LAND_OPTIONS.h"
5    
6     CBOP
7     C !ROUTINE: LAND_INI_VARS
8     C !INTERFACE:
9     SUBROUTINE LAND_INI_VARS( myThid )
10    
11     C !DESCRIPTION: \bv
12     C *==========================================================*
13     C | S/R LAND_INI_VARS
14     C | o Initialize Land package variables
15     C *==========================================================*
16     C | for now, used only for a restart
17     C *==========================================================*
18     C \ev
19    
20     C !USES:
21     IMPLICIT NONE
22    
23     C == Global variables ===
24    
25     C-- size for MITgcm & Land package :
26     #include "LAND_SIZE.h"
27    
28     #include "EEPARAMS.h"
29     #include "PARAMS.h"
30     #include "LAND_PARAMS.h"
31 jmc 1.2 #include "LAND_VARS.h"
32 jmc 1.1
33     C !INPUT/OUTPUT PARAMETERS:
34     C == Routine Arguments ==
35     C myThid - Number of this instance
36     INTEGER myThid
37     CEOP
38    
39     #ifdef ALLOW_LAND
40    
41     C == Local Variables ==
42     C msgBuf - Informational/error meesage buffer
43 jmc 1.3 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 jmc 1.1 c CHARACTER*(MAX_LEN_MBUF) msgBuf
49 jmc 1.3 INTEGER i,j,k,bi,bj
50     _RL grd_HeatCp, mWater
51     _RL temp_af, temp_bf
52 jmc 1.1
53     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
54    
55 jmc 1.3 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 jmc 1.2
92 jmc 1.1 IF ( startTime.EQ.0. .AND. nIter0.EQ.0 ) THEN
93    
94 jmc 1.2 C-- Define the initial state : read from file
95     _BEGIN_MASTER( myThid )
96     IF ( land_grT_iniFile .NE. ' ' ) THEN
97     CALL MDSREADFIELD( land_grT_iniFile, readBinaryPrec, 'RL',
98     & land_nLev, land_groundT, 1, myThid)
99     ENDIF
100     IF ( land_grW_iniFile .NE. ' ' ) THEN
101     CALL MDSREADFIELD( land_grW_iniFile, readBinaryPrec, 'RL',
102     & land_nLev, land_groundW, 1, myThid)
103     ENDIF
104 jmc 1.3 IF ( land_snow_iniFile .NE. ' ' ) THEN
105     CALL MDSREADFIELD( land_snow_iniFile,readBinaryPrec, 'RL',
106     & 1, land_hSnow, 1, myThid)
107     ENDIF
108 jmc 1.2 _END_MASTER(myThid)
109 jmc 1.1
110     ELSEIF ( land_calc_grT .OR. land_calc_grW ) THEN
111    
112     C-- Read Land package state variables from pickup file
113     CALL LAND_READ_PICKUP( nIter0, myThid )
114    
115 jmc 1.2 c ELSE
116     C- a trick to allow to start without a land pickup:
117     C load grT & grW from AIM surf. BC in S/R aim_land2aim
118 jmc 1.1 ENDIF
119 jmc 1.3
120     DO bj=myByLo(myThid),myByHi(myThid)
121     DO bi=myBxLo(myThid),myBxHi(myThid)
122    
123 jmc 1.4 C- to have a consistent initial state: set surface Temp & enthalpy
124     C assuming all the water in 1 phase only (solid or liquid):
125 jmc 1.3 IF ( ( startTime.EQ.0. .AND. nIter0.EQ.0 ) .OR.
126     & .NOT.( land_calc_grT .OR. land_calc_grW ) .OR.
127     & land_oldPickup ) THEN
128     DO j=1,sNy
129     DO i=1,sNx
130     c IF ( land_frc(i,j,bi,bj).GT.0. ) THEN
131     DO k=1,land_nLev
132     mWater = land_rhoLiqW*land_waterCap
133     & *land_groundW(i,j,k,bi,bj)
134     grd_HeatCp = land_heatCs + land_CpWater*mWater
135     land_enthalp(i,j,k,bi,bj) =
136     & grd_HeatCp*land_groundT(i,j,k,bi,bj)
137     IF (land_groundT(i,j,k,bi,bj).LT. 0. _d 0)
138     & land_enthalp(i,j,k,bi,bj) = land_enthalp(i,j,k,bi,bj)
139     & - land_Lfreez*mWater
140     ENDDO
141     land_skinT(i,j,bi,bj) = land_groundT(i,j,1,bi,bj)
142     c ENDIF
143     ENDDO
144     ENDDO
145     ELSE
146     DO j=1,sNy
147     DO i=1,sNx
148     DO k=1,land_nLev
149     mWater = land_rhoLiqW*land_waterCap
150     & *land_groundW(i,j,k,bi,bj)
151     grd_HeatCp = land_heatCs + land_CpWater*mWater
152     C temperature if below freezing:
153     temp_bf = (land_enthalp(i,j,k,bi,bj)+land_Lfreez*mWater)
154     & / grd_HeatCp
155     C temperature if above freezing:
156     temp_af = land_enthalp(i,j,k,bi,bj) / grd_HeatCp
157     land_groundT(i,j,k,bi,bj) =
158     & MIN( temp_bf, MAX(temp_af, 0. _d 0) )
159     ENDDO
160     ENDDO
161     ENDDO
162     ENDIF
163    
164     C- end bi,bj loops
165     ENDDO
166     ENDDO
167 jmc 1.1
168     #endif /* ALLOW_LAND */
169    
170     RETURN
171     END

  ViewVC Help
Powered by ViewVC 1.1.22