Subversion Repositories lagranto.wrf

Rev

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

Rev 2 Rev 20
Line 25... Line 25...
25
  parameter (ndatmax=500)
25
  parameter (ndatmax=500)
26
 
26
 
27
  ! Numerical epsilon (for float comparison)
27
  ! Numerical epsilon (for float comparison)
28
  real :: eps
28
  real :: eps
29
  parameter (eps=0.001)
29
  parameter (eps=0.001)
-
 
30
  real         mdv                              ! missing data value
-
 
31
  parameter    (mdv=-999.)
30
 
32
 
31
  ! Prefix for primary and secondary fields
33
  ! Prefix for primary and secondary fields
32
  character :: charp
34
  character :: charp
33
  character :: chars
35
  character :: chars
34
  parameter (charp='P')
36
  parameter (charp='P')
Line 95... Line 97...
95
  integer :: nx,ny,nz     ! Grid dimensions
97
  integer :: nx,ny,nz     ! Grid dimensions
96
  real :: dx,dy           ! Horizontal grid resolution
98
  real :: dx,dy           ! Horizontal grid resolution
97
  integer :: hem          ! Flag for hemispheric domain
99
  integer :: hem          ! Flag for hemispheric domain
98
  integer :: per          ! Flag for periodic domain
100
  integer :: per          ! Flag for periodic domain
99
  real :: stagz           ! Vertical staggering
101
  real :: stagz           ! Vertical staggering
100
  real :: mdv             ! Missing data value
-
 
101
 
102
 
102
  ! Auxiliary variables
103
  ! Auxiliary variables
103
  integer :: i,j,k,l,m,n
104
  integer :: i,j,k,l,m,n
104
  real :: rd
105
  real :: rd
105
  character(len=80) :: filename,varname
106
  character(len=80) :: filename,varname
Line 319... Line 320...
319
  varsinp(4) = 'z'
320
  varsinp(4) = 'z'
320
 
321
 
321
  ! Transform start coordinates from index space to WRF grid
322
  ! Transform start coordinates from index space to WRF grid
322
  do i=1,ntra
323
  do i=1,ntra
323
     do j=1,ntim
324
     do j=1,ntim
-
 
325
         if ( ( abs(trainp(i,j,2)-mdv).gt.eps).and.( abs(trainp(i,j,3)-mdv).gt.eps) ) then
324
         trainp(i,j,2) = xmin + ( trainp(i,j,2) - 1. ) * dx
326
            trainp(i,j,2) = xmin + ( trainp(i,j,2) - 1. ) * dx
325
         trainp(i,j,3) = ymin + ( trainp(i,j,3) - 1. ) * dy
327
            trainp(i,j,3) = ymin + ( trainp(i,j,3) - 1. ) * dy
-
 
328
         endif
326
     enddo
329
     enddo
327
  enddo
330
  enddo
328
 
331
 
329
  ! Write some status information of the input trajectories
332
  ! Write some status information of the input trajectories
330
  print*,'---- INPUT TRAJECTORIES ---------------------------------'
333
  print*,'---- INPUT TRAJECTORIES ---------------------------------'
Line 622... Line 625...
622
  enddo
625
  enddo
623
 
626
 
624
 ! Transform coordinates into index space
627
 ! Transform coordinates into index space
625
   do i=1,ntra
628
   do i=1,ntra
626
     do j=1,ntim
629
     do j=1,ntim
-
 
630
 
-
 
631
         if ( ( abs(traout(i,j,2)-mdv).gt.eps ).and.( abs(traout(i,j,3)-mdv).gt.eps ) ) then
627
         traout(i,j,2) = ( traout(i,j,2) - xmin ) / dx + 1.
632
            traout(i,j,2) = ( traout(i,j,2) - xmin ) / dx + 1.
628
         traout(i,j,3) = ( traout(i,j,3) - ymin ) / dy + 1.
633
            traout(i,j,3) = ( traout(i,j,3) - ymin ) / dy + 1.
-
 
634
         endif
-
 
635
 
629
     enddo
636
     enddo
630
  enddo
637
  enddo
631
 
638
 
632
  ! Write trajectories
639
  ! Write trajectories
633
  call wopen_tra(fod,outfile,ntra,ntim,ncol+ntrace0, &
640
  call wopen_tra(fod,outfile,ntra,ntim,ncol+ntrace0, &