source: codes/icosagcm/trunk/src/theta_rhodz.f90 @ 12

Last change on this file since 12 was 12, checked in by ymipsl, 12 years ago

dynamico tree creation

YM

File size: 1.5 KB
Line 
1MODULE theta2theta_rhodz_mod
2
3CONTAINS
4
5  SUBROUTINE theta2theta_rhodz(f_ps,f_theta,f_theta_rhodz)
6  USE transfert_mod
7  USE field_mod
8  USE dimensions
9  USE geometry
10  USE domain_mod
11  IMPLICIT NONE
12    TYPE(t_field), POINTER :: f_ps(:)
13    TYPE(t_field), POINTER :: f_theta(:)
14    TYPE(t_field), POINTER :: f_theta_rhodz(:)
15 
16    REAL(rstd), POINTER :: ps(:)
17    REAL(rstd), POINTER :: theta(:,:)
18    REAL(rstd), POINTER :: theta_rhodz(:,:)
19    INTEGER :: ind
20
21    DO ind=1,ndomain
22      CALL swap_dimensions(ind)
23      CALL swap_geometry(ind)
24      ps=f_ps(ind)
25      theta=f_theta(ind)
26      theta_rhodz=f_theta_rhodz(ind)
27      CALL compute_theta2theta_rhodz(ps, theta, theta_rhodz,0)
28    ENDDO
29 
30  END SUBROUTINE theta2theta_rhodz
31 
32  SUBROUTINE compute_theta2theta_rhodz(ps,theta, theta_rhodz,offset)
33  USE dimensions
34  USE geometry
35  USE metric
36  USE pression_mod
37  IMPLICIT NONE
38    REAL(rstd),INTENT(IN) :: ps(iim*jjm)
39    REAL(rstd),INTENT(IN) :: theta(iim*jjm,llm)
40    REAL(rstd),INTENT(OUT) :: theta_rhodz(iim*jjm,llm)
41    INTEGER,INTENT(IN) :: offset
42    INTEGER :: i,j,ij,l
43    REAL(rstd) :: p(iim*jjm,llm+1)
44
45    CALL compute_pression(ps,p,offset)
46   
47    DO    l    = 1, llm
48      DO j=jj_begin-offset,jj_end+offset
49        DO i=ii_begin-offset,ii_end+offset
50          ij=(j-1)*iim+i
51          theta_rhodz(ij,l) = theta(ij,l) * (p(ij,l)-p(ij,l+1))/g
52        ENDDO
53      ENDDO
54    ENDDO
55   
56  END SUBROUTINE compute_theta2theta_rhodz
57
58END MODULE theta2theta_rhodz_mod
Note: See TracBrowser for help on using the repository browser.