! +-======-+ ! Copyright (c) 2003-2018 United States Government as represented by ! the Admistrator of the National Aeronautics and Space Administration. ! All Rights Reserved. ! ! THIS OPEN SOURCE AGREEMENT ("AGREEMENT") DEFINES THE RIGHTS OF USE, ! REPRODUCTION, DISTRIBUTION, MODIFICATION AND REDISTRIBUTION OF CERTAIN ! COMPUTER SOFTWARE ORIGINALLY RELEASED BY THE UNITED STATES GOVERNMENT AS ! REPRESENTED BY THE GOVERNMENT AGENCY LISTED BELOW ("GOVERNMENT AGENCY"). ! THE UNITED STATES GOVERNMENT, AS REPRESENTED BY GOVERNMENT AGENCY, IS AN ! INTENDED THIRD-PARTY BENEFICIARY OF ALL SUBSEQUENT DISTRIBUTIONS OR ! REDISTRIBUTIONS OF THE SUBJECT SOFTWARE. ANYONE WHO USES, REPRODUCES, ! DISTRIBUTES, MODIFIES OR REDISTRIBUTES THE SUBJECT SOFTWARE, AS DEFINED ! HEREIN, OR ANY PART THEREOF, IS, BY THAT ACTION, ACCEPTING IN FULL THE ! RESPONSIBILITIES AND OBLIGATIONS CONTAINED IN THIS AGREEMENT. ! ! Government Agency: National Aeronautics and Space Administration ! Government Agency Original Software Designation: GSC-15354-1 ! Government Agency Original Software Title: GEOS-5 GCM Modeling Software ! User Registration Requested. Please Visit http://opensource.gsfc.nasa.gov ! Government Agency Point of Contact for Original Software: ! Dale Hithon, SRA Assistant, (301) 286-2691 ! ! +-======-+ ! SUBROUTINE fill_Land (q,im,jm,undef) !--------------------------------------------------------------------------- implicit none integer im,jm real undef real q(im,jm) integer i,j,k,L,n,i0,nundef real qz(im) real dist,dq !--------------------------------------------------------------------------- do j=1,jm qz = q(:,j) nundef = count( qz.eq.undef ) if( nundef.eq.im .or. nundef.eq.0 ) cycle do i0=1,im if( q(i0,j).ne.undef ) exit enddo do k=i0,im+i0-1 L=k if(L.gt.im) L=L-im qz(k-i0+1) = q(L,j) enddo do i=2,im if( qz(i).ne.undef ) cycle do k=i+1,im if( qz(k).eq.undef ) cycle dist = k-i+1 dq = ( qz(k)-qz(i-1) )/dist exit enddo if( k.eq.im+1) then dist = k-i+1 dq = ( qz(1)-qz(i-1) )/dist endif do L=i,k-1 qz(L) = qz(i-1) + (L-i+1)*dq enddo enddo do k=i0,im+i0-1 L=k if(L.gt.im) L=L-im q(L,j) = qz(k-i0+1) enddo enddo ! j=1,jm return !--------------------------------------------------------------------------- END SUBROUTINE fill_Land !