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

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

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


Revision 1.3 - (hide annotations) (download)
Mon Jun 14 20:34:50 2004 UTC (20 years ago) by molod
Branch: MAIN
CVS Tags: checkpoint54a_pre, checkpoint54a_post, checkpoint54b_post, checkpoint54, checkpoint53g_post, checkpoint53f_post, checkpoint54c_post
Changes since 1.2: +49 -18 lines
Reconcile bottom up (model) and top down (fizhi) level counting

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

  ViewVC Help
Powered by ViewVC 1.1.22