Add files via upload

This commit is contained in:
Xuesong (Steve)
2018-08-28 00:40:44 -04:00
committed by GitHub
parent c7ac7673cc
commit bc4969bb71
53 changed files with 78152 additions and 0 deletions

View File

@ -0,0 +1,29 @@
SUBROUTINE INTERP_AP( ya, na, xa, yb, nb, xb )
! Linear interpolation xa (ya, na) >> xb (yb, nb)
! ya, yb == pressure levels
! NOTE: yb:bottom->top ; ya: top->bottom
integer :: na, nb
integer :: i, j
real*4, dimension(na) :: xa, ya
real*4, dimension(nb) :: xb, yb
real*4 :: slope, biais
do j = 1, nb
do i = 1, na-1
if (( yb(j) .ge. ya(i)) .and. ( yb(j) .lt. ya(i+1))) then
if ( (xa(i) -xa(i+1)) .ne. 0.) then
slope = ( ya(i) - ya (i+1) ) / (xa(i) -xa(i+1))
biais = ya(i) - slope * xa(i)
xb(j) = ( yb(j) - biais) / slope
else
xb(j) = xa(i)
endif
endif
enddo
enddo
!Return to calling program
END SUBROUTINE INTERP_AP