/[MITgcm]/MITgcm/pkg/fizhi/fizhi_init_vars.F
ViewVC logotype

Contents of /MITgcm/pkg/fizhi/fizhi_init_vars.F

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


Revision 1.9 - (show annotations) (download)
Thu Sep 30 15:59:50 2004 UTC (19 years, 8 months ago) by molod
Branch: MAIN
CVS Tags: checkpoint55d_pre, checkpoint55e_post, checkpoint55d_post
Changes since 1.8: +10 -3 lines
Some cleaning

1 C $Header: /u/gcmpack/MITgcm/pkg/fizhi/fizhi_init_vars.F,v 1.8 2004/08/12 15:21:22 molod Exp $
2 C $Name: $
3
4 #include "FIZHI_OPTIONS.h"
5 subroutine fizhi_init_vars (myThid)
6 c-----------------------------------------------------------------------
7 c Routine to initialise the fizhi state.
8 c
9 c Input: myThid - Process number calling this routine
10 c
11 c Notes:
12 c 1) For a Cold Start -
13 c This routine takes the initial condition on the dynamics grid
14 c and interpolates to the physics grid to initialize the state
15 c variables that are on both grids. It initializes the variables
16 c of the turbulence scheme to 0., and the land state from a model
17 c climatology.
18 c 2) For a Restart, read the fizhi pickup file
19 c 3) The velocity component physics fields are on an A-Grid
20 c
21 c Calls: dyn2phys (x4)
22 c-----------------------------------------------------------------------
23 implicit none
24 #include "SIZE.h"
25 #include "fizhi_SIZE.h"
26 #include "fizhi_land_SIZE.h"
27 #include "GRID.h"
28 #include "DYNVARS.h"
29 #include "gridalt_mapping.h"
30 #include "fizhi_coms.h"
31 #include "fizhi_land_coms.h"
32 #include "fizhi_earth_coms.h"
33 #include "EEPARAMS.h"
34 #include "SURFACE.h"
35 #include "PARAMS.h"
36
37 integer myThid
38
39 c pe on dynamics and physics grid refers to bottom edge
40 _RL pephy(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys+1,nSx,nSy)
41 _RL pedyn(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr+1,nSx,nSy)
42 _RL windphy(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys,nSx,nSy)
43 _RL udyntemp(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
44 _RL vdyntemp(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
45 _RL tempphy(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys,nSx,nSy)
46
47 integer i, j, L, bi, bj, Lbotij
48 integer im1, im2, jm1, jm2, idim1, idim2, jdim1, jdim2
49
50 im1 = 1-OLx
51 im2 = sNx+OLx
52 jm1 = 1-OLy
53 jm2 = sNy+OLy
54 idim1 = 1
55 idim2 = sNx
56 jdim1 = 1
57 jdim2 = sNy
58
59 IF ( startTime.EQ.0. .AND. nIter0.EQ.0 ) THEN
60 print *,' In fizhi_init_vars: Cold start '
61
62 do bj = myByLo(myThid), myByHi(myThid)
63 do bi = myBxLo(myThid), myBxHi(myThid)
64
65 C Build pressures on dynamics grid
66 do j = 1,sNy
67 do i = 1,sNx
68 do L = 1,Nr
69 pedyn(i,j,L,bi,bj) = 0.
70 enddo
71 enddo
72 enddo
73 do j = 1,sNy
74 do i = 1,sNx
75 Lbotij = ksurfC(i,j,bi,bj)
76 if(Lbotij.ne.0.)
77 . pedyn(i,j,Lbotij,bi,bj) = Ro_surf(i,j,bi,bj) + etaH(i,j,bi,bj)
78 enddo
79 enddo
80 do j = 1,sNy
81 do i = 1,sNx
82 Lbotij = ksurfC(i,j,bi,bj)
83 do L = Lbotij+1,Nr+1
84 pedyn(i,j,L,bi,bj) = pedyn(i,j,L-1,bi,bj) -
85 . drF(L-1)*hfacC(i,j,L-1,bi,bj)
86 enddo
87 c Do not use a zero field as the top edge pressure for interpolation
88 if(pedyn(i,j,Nr+1,bi,bj).lt.1.e-5)
89 . pedyn(i,j,Nr+1,bi,bj) = 1.e-5
90 enddo
91 enddo
92 C Build pressures on physics grid
93 do j = 1,sNy
94 do i = 1,sNx
95 pephy(i,j,1,bi,bj)=Ro_surf(i,j,bi,bj) + etaH(i,j,bi,bj)
96 do L = 2,Nrphys+1
97 pephy(i,j,L,bi,bj)=pephy(i,j,L-1,bi,bj)-dpphys0(i,j,L-1,bi,bj)
98 enddo
99 c Do not use a zero field as the top edge pressure for interpolation
100 if(pephy(i,j,Nrphys+1,bi,bj).lt.1.e-5)
101 . pephy(i,j,Nrphys+1,bi,bj) = 1.e-5
102 enddo
103 enddo
104 c
105 c Create an initial wind magnitude field on the physics grid -
106 c Use a log wind law with z0=1cm, u*=1 cm/sec,
107 c do units and get u = .025*ln(dP*10), with dP in pa.
108 do L = 1,Nrphys
109 do j = 1,sNy
110 do i = 1,sNx
111 windphy(i,j,L,bi,bj) = 0.025 *
112 . log((pephy(i,j,1,bi,bj)-pephy(i,j,L+1,bi,bj))*10.)
113 enddo
114 enddo
115 enddo
116
117 enddo
118 enddo
119
120 c Create initial fields on phys. grid - Move Dynamics u and v to A-Grid
121 call CtoA(myThid,uvel,vvel,maskW,maskS,im1,im2,jm1,jm2,Nr,
122 . Nsx,Nsy,1,sNx,1,sNy,udyntemp,vdyntemp)
123
124 do bj = myByLo(myThid), myByHi(myThid)
125 do bi = myBxLo(myThid), myBxHi(myThid)
126
127 c Create initial fields on phys. grid - interpolate from dyn. grid
128 call dyn2phys(udyntemp,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy,
129 . 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,1,tempphy)
130 c Note: Interpolation gives bottom-up arrays (level 1 is bottom),
131 c Physics works top-down. so -> need to flip arrays
132 do L = 1,Nrphys
133 do j = 1,sNy
134 do i = 1,sNx
135 uphy(i,j,Nrphys+1-L,bi,bj) = tempphy(i,j,L,bi,bj)
136 enddo
137 enddo
138 enddo
139 call dyn2phys(vdyntemp,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy,
140 . 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,1,tempphy)
141 do L = 1,Nrphys
142 do j = 1,sNy
143 do i = 1,sNx
144 vphy(i,j,Nrphys+1-L,bi,bj) = tempphy(i,j,L,bi,bj)
145 enddo
146 enddo
147 enddo
148 call dyn2phys(theta,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy,
149 . 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,0,tempphy)
150 do L = 1,Nrphys
151 do j = 1,sNy
152 do i = 1,sNx
153 thphy(i,j,Nrphys+1-L,bi,bj) = tempphy(i,j,L,bi,bj)
154 enddo
155 enddo
156 enddo
157
158 call dyn2phys(salt,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy,
159 . 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,0,tempphy)
160 do L = 1,Nrphys
161 do j = 1,sNy
162 do i = 1,sNx
163 sphy(i,j,Nrphys+1-L,bi,bj) = tempphy(i,j,L,bi,bj)
164 enddo
165 enddo
166 enddo
167
168 c Now initialize tke, xlmt, khmt, xxmt, yymt, ctmt, zetamt,
169 c Now initialize land state too - tcanopy, etc...
170 do i = 1,nchp
171 ctmt(i,bi,bj) = 0.
172 xxmt(i,bi,bj) = 0.
173 yymt(i,bi,bj) = 0.
174 zetamt(i,bi,bj) = 0.
175 enddo
176 do L = 1,Nrphys
177 do i = 1,nchp
178 tke(i,L,bi,bj) = 0.
179 xlmt(i,L,bi,bj) = 0.
180 khmt(i,L,bi,bj) = 0.
181 enddo
182 enddo
183 c Now initialize land state too - tcanopy, etc... SET FOR NOW,
184 c READ CLIM FOR REAL
185 do i = 1,nchp
186 tcanopy(i,bi,bj) = 283.
187 tdeep(i,bi,bj) = 282.5
188 ecanopy(i,bi,bj) = 2.e-2
189 swetshal(i,bi,bj) = 0.6
190 swetroot(i,bi,bj) = 0.5
191 swetdeep(i,bi,bj) = 0.5
192 capac(i,bi,bj) = 0.
193 snodep(i,bi,bj) = 0.
194 enddo
195
196 enddo
197 enddo
198
199 ELSE
200 print *,' In fizhi_init_vars: Read from restart '
201
202 C-- Read fizhi package state variables from pickup file
203
204 call fizhi_read_pickup( nIter0, myThid )
205 CALL FIZHI_READ_VEGTILES( nIter0, 'D', myThid )
206
207 ENDIF
208
209 return
210 end

  ViewVC Help
Powered by ViewVC 1.1.22