/[lmdze]/trunk/dyn3d/Guide/Read_reanalyse/nat2gcm.f
ViewVC logotype

Diff of /trunk/dyn3d/Guide/Read_reanalyse/nat2gcm.f

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 172 by guez, Wed Sep 30 15:59:14 2015 UTC revision 173 by guez, Tue Oct 6 15:57:02 2015 UTC
# Line 1  Line 1 
1  subroutine nat2gcm(u,v,t,rh,pk,ucov,vcov,teta,q)  module nat2gcm_m
2    
   ! Passage aux variables du modele (vents covariants, temperature  
   ! potentielle et humidite specifique)  
   
   use dimens_m  
   use paramet_m  
   use comconst  
   use disvert_m  
   use comgeom  
   use q_sat_m, only: q_sat  
   use guide_m  
3    implicit none    implicit none
4    
5    contains
6    
7      subroutine nat2gcm(pk, u, v, t)
8    
9        ! Passage aux variables du mod\`ele (vents covariants,
10        ! temp\'erature potentielle et humidit\'e sp\'ecifique).
11    
12    real u(iip1,jjp1,llm),v(iip1,jjm,llm)      use comconst, only: cpp, kappa
13    real t(iip1,jjp1,llm),pk(iip1,jjp1,llm),rh(iip1,jjp1,llm)      use comgeom, only: cu_2d, cv_2d
14    real ucov(iip1,jjp1,llm),vcov(iip1,jjm,llm)      use dimens_m, only: iim, jjm, llm
15    real teta(iip1,jjp1,llm),q(iip1,jjp1,llm)      use disvert_m, only: preff
16        use paramet_m, only: iip1, jjp1
17    real pres(iip1,jjp1,llm),qsat(iip1,jjp1,llm)  
18        real, intent(in):: pk(iip1, jjp1, llm)
19    real unskap      real, intent(inout):: u(iip1, jjp1, llm), v(iip1, jjm, llm)
20        real, intent(inout):: t(iip1, jjp1, llm)
21    integer i,j,l  
22        ! Local:
23        integer i, j, l
24    print*,'Entree dans nat2gcm'  
25    !    ucov(:,:,:)=0.      !----------------------------------------------------------------------
26    !    do l=1,llm  
27    !       ucov(:,2:jjm,l)=u(:,2:jjm,l)*cu_2d(:,2:jjm)      print *, "Call sequence information: nat2gcm"
28    !    enddo  
29    !    ucov(iip1,:,:)=ucov(1,:,:)      ! calcul de ucov et de la temperature potentielle
30        do l = 1, llm
31    !    teta(:,:,:)=t(:,:,:)*cpp/pk(:,:,:)         do j = 1, jjp1
32    !    teta(iip1,:,:)=teta(1,:,:)            do i = 1, iim
33                 u(i, j, l) = u(i, j, l) * cu_2d(i, j)
34    !   calcul de ucov et de la temperature potentielle               t(i, j, l) = t(i, j, l) * cpp / pk(i, j, l)
35    do l=1,llm            enddo
36       do j=1,jjp1            u(iip1, j, l) = u(1, j, l)
37          do i=1,iim            t(iip1, j, l) = t(1, j, l)
38             ucov(i,j,l)=u(i,j,l)*cu_2d(i,j)         enddo
39             teta(i,j,l)=t(i,j,l)*cpp/pk(i,j,l)         do i = 1, iip1
40          enddo            u(i, 1, l) = 0.
41          ucov(iip1,j,l)=ucov(1,j,l)            u(i, jjp1, l) = 0.
42          teta(iip1,j,l)=teta(1,j,l)            t(i, 1, l) = t(1, 1, l)
43       enddo            t(i, jjp1, l) = t(1, jjp1, l)
44       do i=1,iip1         enddo
45          ucov(i,1,l)=0.      enddo
46          ucov(i,jjp1,l)=0.  
47          teta(i,1,l)=teta(1,1,l)      do l = 1, llm
48          teta(i,jjp1,l)=teta(1,jjp1,l)         do j = 1, jjm
49       enddo            do i = 1, iim
50    enddo               v(i, j, l) = v(i, j, l) * cv_2d(i, j)
51              enddo
52    !   calcul de ucov            v(iip1, j, l) = v(1, j, l)
53    do l=1,llm         enddo
54       do j=1,jjm      enddo
         do i=1,iim  
            vcov(i,j,l)=v(i,j,l)*cv_2d(i,j)  
         enddo  
         vcov(iip1,j,l)=vcov(1,j,l)  
      enddo  
   enddo  
   
   !  Humidite relative -> specifique  
   !  -------------------------------  
   if (1.eq.0) then  
      !   FINALEMENT ON GUIDE EN HUMIDITE RELATIVE  
      print*,'calcul de unskap'  
      unskap   = 1./ kappa  
      print*,'calcul de pres'  
      pres(:,:,:)=preff*(pk(:,:,:)/cpp)**unskap  
      print*,'calcul de qsat'  
      qsat = q_sat(t, pres)  
      print*,'calcul de q'  
      !   ATTENTION : humidites relatives en %  
      rh(:,:,:)=max(rh(:,:,:)*0.01,1.e-6)  
      q(:,:,:)=qsat(:,:,:)*rh(:,:,:)  
      print*,'calcul de q OK'  
55    
56    endif    end subroutine nat2gcm
57    
58  end subroutine nat2gcm  end module nat2gcm_m

Legend:
Removed from v.172  
changed lines
  Added in v.173

  ViewVC Help
Powered by ViewVC 1.1.21