Subversion Repositories lagranto.ecmwf

Rev

Rev 9 | Rev 21 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9 Rev 19
Line 190... Line 190...
190
         endif
190
         endif
191
 
191
 
192
c     Get non-constant grid parameters (surface pressure and vertical grid)
192
c     Get non-constant grid parameters (surface pressure and vertical grid)
193
      else
193
      else
194
         
194
         
-
 
195
c        Special handling for fieldname 'P.ML' -> in this case the fields
-
 
196
c        P and PS are available on the data file and can be read in. There
-
 
197
c        is no need to reconstruct it from PS,AK and BK. This mode is
-
 
198
c        used for model-level (2D) trajectories
-
 
199
         if ( fieldname.eq.'P.ML' ) then
-
 
200
 
-
 
201
c           Get the right time to read
-
 
202
            call gettimes(fid,times,ntimes,ierr)
-
 
203
            if (ierr.ne.0) goto 901
-
 
204
            isok=0
-
 
205
            do i=1,ntimes
-
 
206
               if (abs(time-times(i)).lt.eps) then
-
 
207
                  isok = 1
-
 
208
                  rtime = times(i)
-
 
209
               elseif (timecheck.eq.'no') then
-
 
210
                  isok = 1
-
 
211
                  rtime = times(1)
-
 
212
               endif
-
 
213
            enddo
-
 
214
 
-
 
215
c           Read surface pressure and 3D pressure
-
 
216
            varname='PS'
-
 
217
            call getdat(fid,varname,rtime,0,ps,ierr)
-
 
218
            if (ierr.ne.0) goto 904
-
 
219
            varname='P'
-
 
220
            call getdat(fid,varname,rtime,0,p3,ierr)
-
 
221
            if (ierr.ne.0) goto 904
-
 
222
 
-
 
223
c           Set MDV to 1050. - otherwise interpolation routines don't work
-
 
224
            do i=1,nx
-
 
225
              do j=1,ny
-
 
226
                do k=1,nz
-
 
227
                   if ( p3(i,j,k).lt.0. ) p3(i,j,k) = 1050.
-
 
228
                enddo
-
 
229
              enddo
-
 
230
            enddo
-
 
231
 
-
 
232
c           Don't care about other stuff - finish subroutine
-
 
233
            goto 800
-
 
234
 
-
 
235
         endif
-
 
236
 
195
c        Get full grid info - in particular staggering flag; set flag for 2D tracing
237
c        Get full grid info - in particular staggering flag; set flag for 2D tracing
196
         if ( fieldname.eq.'PLEV' ) then
238
         if ( fieldname.eq.'PLEV' ) then
197
            varname = 'PS'
239
            varname = 'PS'
198
            stagz   = 0.
240
            stagz   = 0.
199
            call getdef(fid,varname,ndim,mdv,vardim,
241
            call getdef(fid,varname,ndim,mdv,vardim,
Line 420... Line 462...
420
         varname = 'PS'
462
         varname = 'PS'
421
         call getdef(fid,varname,ndim,mdv,vardim,
463
         call getdef(fid,varname,ndim,mdv,vardim,
422
     >               varmin,varmax,stag,ierr)
464
     >               varmin,varmax,stag,ierr)
423
         vardim(3) = nz1
465
         vardim(3) = nz1
424
         if (ierr.ne.0) goto 900
466
         if (ierr.ne.0) goto 900
-
 
467
 
425
      else
468
      else
426
         varname = fieldname
469
         varname = fieldname
427
         call getdef(fid,varname,ndim,mdv,vardim,
470
         call getdef(fid,varname,ndim,mdv,vardim,
428
     >               varmin,varmax,stag,ierr)
471
     >               varmin,varmax,stag,ierr)
429
         if (ierr.ne.0) goto 900
472
         if (ierr.ne.0) goto 900