CTBTO FLEXPART WO4 (2015-10-15)
 All Classes Files Functions Variables
shift_field_0.f90
Go to the documentation of this file.
1 !**********************************************************************
2 ! Copyright 1998,1999,2000,2001,2002,2005,2007,2008,2009,2010 *
3 ! Andreas Stohl, Petra Seibert, A. Frank, Gerhard Wotawa, *
4 ! Caroline Forster, Sabine Eckhardt, John Burkhart, Harald Sodemann *
5 ! *
6 ! This file is part of FLEXPART. *
7 ! *
8 ! FLEXPART is free software: you can redistribute it and/or modify *
9 ! it under the terms of the GNU General Public License as published by*
10 ! the Free Software Foundation, either version 3 of the License, or *
11 ! (at your option) any later version. *
12 ! *
13 ! FLEXPART is distributed in the hope that it will be useful, *
14 ! but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 ! GNU General Public License for more details. *
17 ! *
18 ! You should have received a copy of the GNU General Public License *
19 ! along with FLEXPART. If not, see <http://www.gnu.org/licenses/>. *
20 !**********************************************************************
21 
22 subroutine shift_field_0(field,nxf,nyf)
23  ! i/o i i
24  !*****************************************************************************
25  ! *
26  ! This subroutine shifts global fields by nxshift grid cells, in order to *
27  ! facilitate all sorts of nested wind fields, or output grids, which, *
28  ! without shifting, would overlap with the domain "boundary". *
29  ! *
30  ! Author: A. Stohl *
31  ! *
32  ! 3 July 2002 *
33  ! *
34  !*****************************************************************************
35  ! *
36  ! Variables: *
37  ! *
38  ! Constants: *
39  ! *
40  !*****************************************************************************
41 
42  use par_mod
43 
44  implicit none
45 
46  integer :: nxf,nyf,ix,jy,ixs
47  real :: field(0:nxmax-1,0:nymax-1),xshiftaux(0:nxmax-1)
48 
49  ! Loop over y and z
50  !******************
51 
52  do jy=0,nyf-1
53 
54  ! Shift the data
55  !***************
56 
57  if (nxshift.ne.0) then
58  do ix=0,nxf-1
59  if (ix.ge.nxshift) then
60  ixs=ix-nxshift
61  else
62  ixs=nxf-nxshift+ix
63  endif
64  xshiftaux(ixs)=field(ix,jy)
65  end do
66  do ix=0,nxf-1
67  field(ix,jy)=xshiftaux(ix)
68  end do
69  endif
70 
71  ! Repeat the westernmost grid cells at the easternmost domain "boundary"
72  !***********************************************************************
73 
74  field(nxf,jy)=field(0,jy)
75  end do
76 
77  return
78 end subroutine shift_field_0
subroutine shift_field_0(field, nxf, nyf)