source: LMDZ.3.3/branches/rel-LF/libf/dyn3d/interp_vert.F @ 604

Last change on this file since 604 was 2, checked in by lmdz, 25 years ago

Initial revision

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.6 KB
Line 
1c******************************************************
2      SUBROUTINE   interp_vert(varo,varn,lmo,lmn,sigmo,sigmn,Nhoriz)
3c
4c interpolation lineaire pour passer
5c a une nouvelle discretisation verticale pour
6c les variables de GCM
7c Francois Forget (01/1995)
8c**********************************************************
9
10      IMPLICIT NONE
11
12c   Declarations:
13c ==============
14c
15c  ARGUMENTS
16c  """""""""
17
18       integer lmo ! dimensions ancienne couches (input)
19       integer lmn ! dimensions nouvelle couches (input)
20
21       real sigmo(lmo) ! niveau des variables dans les anciennes coord
22       real sigmn(lmn) ! niveau des variables dans les nouvelles coord
23
24       integer Nhoriz ! nombre de point horizontale (input)
25
26       real varo(Nhoriz,lmo) ! var dans l'ancienne grille (input)
27       real varn(Nhoriz,lmn) ! var dans la nouvelle grille (output)
28
29c Autres variables
30c """"""""""""""""
31       integer n, ln ,lo
32       real coef
33
34c run
35c ====
36      do ln=1,lmn
37        if (sigmn(ln).ge.sigmo(1))then
38           do n=1,Nhoriz
39             varn(n,ln) =  varo(n,1) 
40           end do 
41        else if (sigmn(ln).le.sigmo(lmo)) then
42           do n=1,Nhoriz
43             varn(n,ln) =  varo(n,lmo)
44           end do
45        else
46           do lo =1,lmo-1
47             if ( (sigmn(ln).le.sigmo(lo)).and.
48     &          (sigmn(ln).gt.sigmo(lo+1)) )then
49               coef = (sigmn(ln)-sigmo(lo))/(sigmo(lo+1)-sigmo(lo))
50               do n=1,Nhoriz
51                 varn(n,ln)=varo(n,lo) +coef*(varo(n,lo+1)-varo(n,lo))
52               end do
53             end if
54           end do           
55        end if
56      end do
57      return
58      end   
Note: See TracBrowser for help on using the repository browser.