source: flexpart.git/src/shift_field_0.f90

10.4.1_peseiGFS_025bugfixes+enhancementsdevrelease-10release-10.4.1scaling-bug
Last change on this file was 92fab65, checked in by Ignacio Pisso <ip@…>, 4 years ago

add SPDX-License-Identifier to all .f90 files

  • Property mode set to 100644
File size: 2.3 KB
Line 
1! SPDX-FileCopyrightText: FLEXPART 1998-2019, see flexpart_license.txt
2! SPDX-License-Identifier: GPL-3.0-or-later
3
4subroutine shift_field_0(field,nxf,nyf)
5  !                          i/o   i   i
6  !*****************************************************************************
7  !                                                                            *
8  !  This subroutine shifts global fields by nxshift grid cells, in order to   *
9  !  facilitate all sorts of nested wind fields, or output grids, which,       *
10  !  without shifting, would overlap with the domain "boundary".               *
11  !                                                                            *
12  !    Author: A. Stohl                                                        *
13  !                                                                            *
14  !    3 July 2002                                                             *
15  !                                                                            *
16  !*****************************************************************************
17  !                                                                            *
18  ! Variables:                                                                 *
19  !                                                                            *
20  ! Constants:                                                                 *
21  !                                                                            *
22  !*****************************************************************************
23
24  use par_mod
25
26  implicit none
27
28  integer :: nxf,nyf,ix,jy,ixs
29  real :: field(0:nxmax-1,0:nymax-1),xshiftaux(0:nxmax-1)
30
31  ! Loop over y and z
32  !******************
33
34  do jy=0,nyf-1
35
36  ! Shift the data
37  !***************
38
39    if (nxshift.ne.0) then
40      do ix=0,nxf-1
41        if (ix.ge.nxshift) then
42          ixs=ix-nxshift
43        else
44          ixs=nxf-nxshift+ix
45        endif
46        xshiftaux(ixs)=field(ix,jy)
47      end do
48      do ix=0,nxf-1
49        field(ix,jy)=xshiftaux(ix)
50      end do
51    endif
52
53  ! Repeat the westernmost grid cells at the easternmost domain "boundary"
54  !***********************************************************************
55
56    field(nxf,jy)=field(0,jy)
57  end do
58
59  return
60end subroutine shift_field_0
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG