Commit fcce18e4 authored by Ignacio Pisso's avatar Ignacio Pisso
Browse files

If global input fields, do not stop if output grid crosses input field edge

parent c56da455
......@@ -329,6 +329,10 @@ subroutine gridcheck_ecmwf
!***********************************************************
xauxa=abs(xaux2+dx-360.-xaux1)
!cyclicx
print*, 'xauxa=abs(xaux2+dx-360.-xaux1)'
print*, xauxa,xaux2,dx,xaux1
!stop
if (xauxa.lt.0.001) then
nx=nxfield+1 ! field is cyclic
xglobal=.true.
......
......@@ -116,9 +116,21 @@ subroutine readoutgrid
yr=outlat0+real(numygrid)*dyout
xr1=xlon0+real(nxmin1)*dx
yr1=ylat0+real(nymin1)*dy
if ((outlon0+eps.lt.xlon0).or.(outlat0+eps.lt.ylat0) &
.or.(xr.gt.xr1+eps).or.(yr.gt.yr1+eps)) then
write(*,*) outlon0,outlat0
if ((outlat0+eps.lt.ylat0).or.(yr.gt.yr1+eps)) then
write(*,*) 'outlat0 =',outlat0
write(*,*) 'yr1,ylat0,yr,dyout =', yr1,ylat0,yr,dyout
write(*,*) ' #### FLEXPART MODEL ERROR! LAT OF OUTPUT ####'
write(*,*) ' #### GRID IS OUTSIDE MODEL DOMAIN. CHANGE ####'
write(*,*) ' #### FILE OUTGRID IN DIRECTORY ####'
write(*,'(a)') path(1)(1:length(1))
stop
endif
!cyclicx
print*, xglobal
! If cyclic input field allow output grid to cross border (do not stop)
if ((.not.xglobal).and.((outlon0+eps.lt.xlon0).or.(xr.gt.xr1+eps))) then
write(*,*) outlon0
write(*,*) xr1,yr1,xlon0,ylat0,xr,yr,dxout,dyout
write(*,*) ' #### FLEXPART MODEL ERROR! PART OF OUTPUT ####'
write(*,*) ' #### GRID IS OUTSIDE MODEL DOMAIN. CHANGE ####'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment