Subversion Repositories lagranto.wrf

Rev

Rev 15 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15 Rev 21
Line 105... Line 105...
105
      real            addtheta       ! Offset for potential temperature
105
      real            addtheta       ! Offset for potential temperature
106
      parameter       (addtheta=300.)
106
      parameter       (addtheta=300.)
107
 
107
 
108
c     Auxiliary variables
108
c     Auxiliary variables
109
      real,allocatable,dimension (:,:,:)  :: temp,temp1,temp2
109
      real,allocatable,dimension (:,:,:)  :: temp,temp1,temp2
-
 
110
      real,allocatable,dimension (:,:  )  :: temp3
110
      integer         ndims
111
      integer         ndims
111
      integer         is2d
112
      integer         is2d
112
      integer		  levid,lonid,latid
113
      integer		  levid,lonid,latid
113
      integer      	  nx,ny,nz
114
      integer      	  nx,ny,nz
114
      integer		  status,i,j,k
115
      integer		  status,i,j,k
Line 145... Line 146...
145
          is2d = 0
146
          is2d = 0
146
 
147
 
147
      elseif ( (trim(varname).eq.'geopots').or.
148
      elseif ( (trim(varname).eq.'geopots').or.
148
     >         (trim(varname).eq.'ZB'     ) )
149
     >         (trim(varname).eq.'ZB'     ) )
149
     >then
150
     >then
150
          stag = 'Z'
151
          stag = 'nil'
151
          is2d = 1
152
          is2d = 1
152
 
153
 
153
      elseif ( (trim(varname).eq.'pressure').or.
154
      elseif ( (trim(varname).eq.'pressure').or.
154
     >         (trim(varname).eq.'P'       ) )
155
     >         (trim(varname).eq.'P'       ) )
155
     >then
156
     >then
Line 184... Line 185...
184
 
185
 
185
      elseif ( stag.eq.'Z' ) then
186
      elseif ( stag.eq.'Z' ) then
186
          allocate( temp (nx,ny,nz+1) )
187
          allocate( temp (nx,ny,nz+1) )
187
          allocate( temp1(nx,ny,nz+1) )
188
          allocate( temp1(nx,ny,nz+1) )
188
          allocate( temp2(nx,ny,nz+1) )
189
          allocate( temp2(nx,ny,nz+1) )
189
 
-
 
190
      else
190
      else
191
          allocate( temp (nx,ny,nz) )
191
          allocate( temp (nx,ny,nz) )
192
          allocate( temp1(nx,ny,nz) )
192
          allocate( temp1(nx,ny,nz) )
193
          allocate( temp2(nx,ny,nz) )
193
          allocate( temp2(nx,ny,nz) )
-
 
194
          allocate( temp3(nx,ny   ) )
194
 
195
 
195
      endif
196
      endif
196
 
197
 
197
c	  ------------ Read data ------------------------------------------
198
c	  ------------ Read data ------------------------------------------
198
 
199
 
Line 216... Line 217...
216
	  else if (trim(varname).eq.'W') then
217
	  else if (trim(varname).eq.'W') then
217
                                            
218
                                            
218
	     status = NF_INQ_VARID (fid, 'W', varid)
219
	     status = NF_INQ_VARID (fid, 'W', varid)
219
	     if (status .ne. NF_NOERR) print*,"Error in inq W"
220
	     if (status .ne. NF_NOERR) print*,"Error in inq W"
220
	     status = NF_GET_VAR_REAL (fid, varid, temp)
221
	     status = NF_GET_VAR_REAL (fid, varid, temp)
221
	     if (status .ne. NF_NOERR) print*,"Error in reading U"
222
	     if (status .ne. NF_NOERR) print*,"Error in reading W"
222
 
223
 
223
c	  Geopotential height (base + perturbation) : temp(nx,ny,nz+1)
224
c	  Geopotential height (base + perturbation) : temp(nx,ny,nz+1)
224
	  else if ( (trim(varname).eq.'geopot').or.
225
	  else if ( (trim(varname).eq.'geopot').or.
225
     >          (trim(varname).eq.'Z'     ) )
226
     >          (trim(varname).eq.'Z'     ) )
226
     >then
227
     >then
Line 246... Line 247...
246
c	  surface geopotential: temp(nx,ny,nz+1)
247
c	  surface geopotential: temp(nx,ny,nz+1)
247
	  else if ( (trim(varname).eq.'geopots').or.
248
	  else if ( (trim(varname).eq.'geopots').or.
248
     >          (trim(varname).eq.'ZB'     ) )
249
     >          (trim(varname).eq.'ZB'     ) )
249
     >then
250
     >then
250
                                            
251
                                            
251
	     status = NF_INQ_VARID (fid, 'PHB', varid)
252
c	     status = NF_INQ_VARID (fid, 'PHB', varid)
252
	     if (status .ne. NF_NOERR) print*,"Error in inq sgeopot"
253
c	     if (status .ne. NF_NOERR) print*,"Error in inq sgeopot"
253
	     status = NF_GET_VAR_REAL (fid, varid, temp1)
254
c	     status = NF_GET_VAR_REAL (fid, varid, temp1)
254
	     if (status .ne. NF_NOERR) print*,"Error in reading sgeopot"
255
c	     if (status .ne. NF_NOERR) print*,"Error in reading sgeopot"
255
 
256
c
256
	     status = NF_INQ_VARID (fid, 'PH', varid)
257
c	     status = NF_INQ_VARID (fid, 'PH', varid)
257
	     if (status .ne. NF_NOERR) print*,"Error in inq pgeopot"
258
c	     if (status .ne. NF_NOERR) print*,"Error in inq pgeopot"
258
	     status = NF_GET_VAR_REAL (fid, varid, temp2)
259
c	     status = NF_GET_VAR_REAL (fid, varid, temp2)
259
	     if (status .ne. NF_NOERR) print*,"Error in reading pgeopot"
260
c	     if (status .ne. NF_NOERR) print*,"Error in reading pgeopot"
-
 
261
c
-
 
262
c	     do k = 1, nz+1
-
 
263
c	       do j = 1, ny
-
 
264
c	         do i = 1, nx
-
 
265
c	           temp(i,j,k) = temp1(i,j,k) + temp2(i,j,k)
-
 
266
c	         enddo
-
 
267
c	       enddo
-
 
268
c	     enddo
260
 
269
 
-
 
270
	     status = NF_INQ_VARID (fid, 'HGT', varid)
-
 
271
	     if (status .ne. NF_NOERR) print*,"Error in inq HGT"
-
 
272
	     status = NF_GET_VAR_REAL (fid, varid, temp3)
-
 
273
	     if (status .ne. NF_NOERR) print*,"Error in reading HGT"
261
	     do k = 1, nz+1
274
	     do k = 1, nz
262
	       do j = 1, ny
275
	       do j = 1, ny
263
	         do i = 1, nx
276
	         do i = 1, nx
264
	           temp(i,j,k) = temp1(i,j,k) + temp2(i,j,k)
277
	           temp(i,j,k) = temp3(i,j) * gearth
265
	         enddo
278
	         enddo
266
	       enddo
279
	       enddo
267
	     enddo
280
	     enddo
268
 
281
 
269
c	  Pressure (base + perturbation) : temp(nx,ny,nz)
282
c	  Pressure (base + perturbation) : temp(nx,ny,nz)
Line 424... Line 437...
424
      call ncclos(fid,ierr)
437
      call ncclos(fid,ierr)
425
 
438
 
426
      end
439
      end
427
 
440
 
428
c     ------------------------------------------------------------
441
c     ------------------------------------------------------------	
429
c     ------------------------------------------------------------	
-