source: trunk/WRF.COMMON/WRFV2/mars_lmd/libf/aeronomars/interpfast.F @ 3568

Last change on this file since 3568 was 11, checked in by aslmd, 14 years ago

spiga@svn-planeto:ajoute le modele meso-echelle martien

File size: 951 bytes
Line 
1      subroutine interpfast(escout,p,nlayer,
2     & escin,pin,nl,limdown,limup)
3c****WRF:ligne trop longue
4
5C
6C subroutine to perform linear interpolation in pressure from 1D profile
7C escin(nl) sampled on pressure grid pin(nl) to profile
8C escout(nlayer) on pressure grid p(nlayer).
9C
10      real escout(nlayer),p(nlayer)
11      real escin(nl),pin(nl),wm,wp
12      real limup,limdown
13      integer nl,nlayer,n1,n,nm,np
14      nm=1
15      do 5 n1=1,nlayer
16         if(p(n1) .gt. limup .or. p(n1) .lt. limdown) then
17            escout(n1) = 0.0
18         else
19            do n = nm,nl-1
20               if (p(n1).ge.pin(n).and.p(n1).le.pin(n+1)) then
21                  nm=n
22                  np=n+1
23                  wm=abs(pin(nm)-p(n1))/(pin(np)-pin(nm))
24                  wp=1.0 - wm
25                  goto 33
26               endif
27            enddo
28 33         escout(n1) = escin(np)*wm + escin(nm)*wp
29         endif
30    5 continue
31      return
32      end
Note: See TracBrowser for help on using the repository browser.