Subversion Repositories lagranto.ecmwf

Rev

Rev 3 | Rev 19 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3 Rev 9
Line 112... Line 112...
112
      integer      isok
112
      integer      isok
113
      real         tmp(200)
113
      real         tmp(200)
114
      character*80 varname
114
      character*80 varname
115
      real         rtime
115
      real         rtime
116
      integer      is2d
116
      integer      is2d
-
 
117
      integer      plev
117
 
118
 
118
c     Init the flag for 2D variables - assume a 3D field
119
c     Init the flag for 2D variables - assume a 3D field
119
      is2d = 0
120
      is2d = 0
120
 
121
 
-
 
122
c     Init the flag for pressure levels (PS is not needed)
-
 
123
      plev = 0
-
 
124
 
121
c     Inquire dimensions and grid constants if <fid> is negative
125
c     Inquire dimensions and grid constants if <fid> is negative
122
      if (fid.lt.0) then
126
      if (fid.lt.0) then
123
 
127
 
124
c        Get grid info for the selected variable
128
c        Get grid info for the selected variable
125
         if ( fieldname.eq.'PLEV' ) then
129
         if ( fieldname.eq.'PLEV' ) then
Line 269... Line 273...
269
            call getlevs(cstid,vardim(3),aklev,bklev,aklay,bklay,ierr)
273
            call getlevs(cstid,vardim(3),aklev,bklev,aklay,bklay,ierr)
270
            if (ierr.ne.0) goto 903
274
            if (ierr.ne.0) goto 903
271
            call clscdf(cstid,ierr)
275
            call clscdf(cstid,ierr)
272
            if (ierr.ne.0) goto 903
276
            if (ierr.ne.0) goto 903
273
 
277
 
-
 
278
c           Check whether PS is needed to get the 3d pressure field
-
 
279
            plev = 1
-
 
280
            do i=1,nz
-
 
281
              if ( (abs(stagz).lt.eps).and.(abs(bklev(i)).gt.eps) ) then
-
 
282
                plev = 0
-
 
283
              endif
-
 
284
              if ( (abs(stagz).gt.eps).and.(abs(bklay(i)).gt.eps) ) then
-
 
285
                plev = 0
-
 
286
              endif
-
 
287
            enddo
-
 
288
 
274
c           Read surface pressure
289
c           Read surface pressure if needed
-
 
290
            if ( plev.ne.1 ) then
275
            varname='PS'
291
              varname='PS'
276
            call getdat(fid,varname,rtime,0,ps,ierr)
292
              call getdat(fid,varname,rtime,0,ps,ierr)
277
            if (ierr.ne.0) goto 904
293
              if (ierr.ne.0) goto 904
-
 
294
            else
-
 
295
              do i=1,nx
-
 
296
                do j=1,ny
-
 
297
                    ps(i,j) = 1000.
-
 
298
                enddo
-
 
299
              enddo
-
 
300
            endif
278
 
301
 
279
         endif
302
         endif
280
 
303
 
281
c        Calculate layer and level pressures
304
c        Calculate layer and level pressures
282
         do i=1,nx
305
         do i=1,nx