Subversion Repositories lagranto.ecmwf

Rev

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

Rev 33 Rev 36
Line 512... Line 512...
512
      integer      nz1
512
      integer      nz1
513
      real         rtime
513
      real         rtime
514
      integer      closear
514
      integer      closear
515
      integer      stat
515
      integer      stat
516
      real         delta
516
      real         delta
-
 
517
      integer      pressure
517
 
518
 
518
c     Init mdv
519
c     Init mdv
519
      mdv = -999.
520
      mdv = -999.
520
 
521
      
-
 
522
c     Special handling if 3D pressure is
-
 
523
      if ( fieldname.eq.'P' ) then
-
 
524
         fieldname = 'U'
-
 
525
         pressure  = 1
-
 
526
      else
-
 
527
         pressure = 0
-
 
528
      endif
-
 
529
 
521
c     Get the number of dimensions -> ndim
530
c     Get the number of dimensions -> ndim
522
      ierr = NF90_INQ_VARID(fid,fieldname,varid)
531
      ierr = NF90_INQ_VARID(fid,fieldname,varid)
523
      IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
532
      IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
524
      ierr = nf90_inquire_variable(fid, varid, ndims  = ndim)
533
      ierr = nf90_inquire_variable(fid, varid, ndims  = ndim)
525
      IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
534
      IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
Line 658... Line 667...
658
        if ( lev(1).gt.lev(2) ) then
667
        if ( lev(1).gt.lev(2) ) then
659
          vertical_swap = 0
668
          vertical_swap = 0
660
        endif
669
        endif
661
      endif
670
      endif
662
 
671
 
663
c     Read data 
672
c     Read data /or set 3D pressure field) 
-
 
673
      if ( pressure.eq.0 ) then
664
      ierr = NF90_INQ_VARID(fid,fieldname,varid)
674
         ierr = NF90_INQ_VARID(fid,fieldname,varid)
665
      IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
675
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
666
      ierr = nf90_get_var(fid,varid,tmp3)
676
         ierr = nf90_get_var(fid,varid,tmp3)
667
      IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
677
         IF(ierr /= nf90_NoErr) PRINT *,NF90_STRERROR(ierr)
-
 
678
      else
-
 
679
         if (leveltype.eq.'hybrid_sigma_pressure' ) then
-
 
680
            do i=1,vardim(1)
-
 
681
              do j=1,vardim(2)
-
 
682
                 do k=1,vardim(3)
-
 
683
                  tmp3(i,j,k)=aktmp(k)+bktmp(k)*tmp2(i,j)
-
 
684
                 enddo
-
 
685
              enddo
-
 
686
           enddo
-
 
687
         elseif (leveltype.eq.'air_pressure' ) then
-
 
688
           do i=1,vardim(1)
-
 
689
              do j=1,vardim(2)
-
 
690
                 do k=1,vardim(3)
-
 
691
                  tmp3(i,j,k)=lev(k)
-
 
692
                 enddo
-
 
693
              enddo
-
 
694
           enddo
-
 
695
         endif
-
 
696
      endif
668
  
697
  
669
c     If the field is 2D, expand it to 3D - simple handling of 2D tracing
698
c     If the field is 2D, expand it to 3D - simple handling of 2D tracing
670
      if ( vardim(3).eq.1 ) then
699
      if ( vardim(3).eq.1 ) then
671
         do i=1,vardim(1)
700
         do i=1,vardim(1)
672
            do j=1,vardim(2)
701
            do j=1,vardim(2)