/[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.7 - (hide annotations) (download)
Mon Nov 5 15:40:53 2007 UTC (16 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint65, checkpoint60, checkpoint61, checkpoint62, checkpoint63, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59k, checkpoint59j, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y, HEAD
Changes since 1.6: +7 -7 lines
- replace call to MDSIO S/R with call to RW interface S/R.

1 jmc 1.7 C $Header: /u/gcmpack/MITgcm/pkg/land/land_ini_vars.F,v 1.6 2006/08/13 22:56:17 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 jmc 1.6
20 jmc 1.1 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 jmc 1.6 C == Routine Arguments ==
35 jmc 1.1 C myThid - Number of this instance
36     INTEGER myThid
37     CEOP
38    
39     #ifdef ALLOW_LAND
40    
41 jmc 1.6 C == Local Variables ==
42 jmc 1.1 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.6 C- Need to synchronize here before doing master-thread IO
93     _BARRIER
94    
95 jmc 1.5 IF ( startTime.EQ.baseTime .AND. nIter0.EQ.0 ) THEN
96 jmc 1.1
97 jmc 1.2 C-- Define the initial state : read from file
98     IF ( land_grT_iniFile .NE. ' ' ) THEN
99 jmc 1.7 CALL READ_REC_3D_RL( land_grT_iniFile, readBinaryPrec,
100     & land_nLev, land_groundT, 1, nIter0, myThid )
101 jmc 1.2 ENDIF
102     IF ( land_grW_iniFile .NE. ' ' ) THEN
103 jmc 1.7 CALL READ_REC_3D_RL( land_grW_iniFile, readBinaryPrec,
104     & land_nLev, land_groundW, 1, nIter0, myThid )
105 jmc 1.2 ENDIF
106 jmc 1.3 IF ( land_snow_iniFile .NE. ' ' ) THEN
107 jmc 1.7 CALL READ_FLD_XY_RL( land_snow_iniFile, ' ',
108     & land_hSnow, nIter0, myThid )
109 jmc 1.3 ENDIF
110 jmc 1.1
111     ELSEIF ( land_calc_grT .OR. land_calc_grW ) THEN
112    
113     C-- Read Land package state variables from pickup file
114     CALL LAND_READ_PICKUP( nIter0, myThid )
115    
116 jmc 1.2 c ELSE
117     C- a trick to allow to start without a land pickup:
118     C load grT & grW from AIM surf. BC in S/R aim_land2aim
119 jmc 1.1 ENDIF
120 jmc 1.3
121 jmc 1.6 C- Every one else must wait until loading is done.
122     _BARRIER
123    
124     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
125    
126 jmc 1.3 DO bj=myByLo(myThid),myByHi(myThid)
127     DO bi=myBxLo(myThid),myBxHi(myThid)
128    
129 jmc 1.4 C- to have a consistent initial state: set surface Temp & enthalpy
130     C assuming all the water in 1 phase only (solid or liquid):
131 jmc 1.5 IF ( ( startTime.EQ.baseTime .AND. nIter0.EQ.0 ) .OR.
132 jmc 1.3 & .NOT.( land_calc_grT .OR. land_calc_grW ) .OR.
133     & land_oldPickup ) THEN
134     DO j=1,sNy
135     DO i=1,sNx
136     c IF ( land_frc(i,j,bi,bj).GT.0. ) THEN
137     DO k=1,land_nLev
138     mWater = land_rhoLiqW*land_waterCap
139     & *land_groundW(i,j,k,bi,bj)
140     grd_HeatCp = land_heatCs + land_CpWater*mWater
141 jmc 1.6 land_enthalp(i,j,k,bi,bj) =
142 jmc 1.3 & grd_HeatCp*land_groundT(i,j,k,bi,bj)
143 jmc 1.6 IF (land_groundT(i,j,k,bi,bj).LT. 0. _d 0)
144 jmc 1.3 & land_enthalp(i,j,k,bi,bj) = land_enthalp(i,j,k,bi,bj)
145     & - land_Lfreez*mWater
146     ENDDO
147     land_skinT(i,j,bi,bj) = land_groundT(i,j,1,bi,bj)
148     c ENDIF
149     ENDDO
150     ENDDO
151 jmc 1.6 ELSE
152 jmc 1.3 DO j=1,sNy
153     DO i=1,sNx
154     DO k=1,land_nLev
155     mWater = land_rhoLiqW*land_waterCap
156     & *land_groundW(i,j,k,bi,bj)
157     grd_HeatCp = land_heatCs + land_CpWater*mWater
158     C temperature if below freezing:
159     temp_bf = (land_enthalp(i,j,k,bi,bj)+land_Lfreez*mWater)
160     & / grd_HeatCp
161     C temperature if above freezing:
162     temp_af = land_enthalp(i,j,k,bi,bj) / grd_HeatCp
163     land_groundT(i,j,k,bi,bj) =
164     & MIN( temp_bf, MAX(temp_af, 0. _d 0) )
165     ENDDO
166     ENDDO
167     ENDDO
168     ENDIF
169    
170     C- end bi,bj loops
171     ENDDO
172     ENDDO
173 jmc 1.1
174     #endif /* ALLOW_LAND */
175    
176     RETURN
177     END

  ViewVC Help
Powered by ViewVC 1.1.22