Changeset 428 for codes/icosagcm/trunk/src/geopotential_mod.f90
- Timestamp:
- 06/14/16 21:54:26 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/trunk/src/geopotential_mod.f90
r354 r428 2 2 IMPLICIT NONE 3 3 PRIVATE 4 4 5 5 PUBLIC :: compute_geopotential 6 6 CONTAINS 7 8 SUBROUTINE thetarhodz2geopot(f_ps,f_phis,f_theta_rhodz, f_p,f_theta,f_phi) ! FIXME : never called, dry only 9 USE icosa 10 USE omp_para 11 USE pression_mod 12 USE theta2theta_rhodz_mod 13 TYPE(t_field), POINTER :: f_ps(:), f_phis(:), f_theta_rhodz(:), & ! IN 14 f_p(:), f_theta(:), f_phi(:) ! OUT 15 REAL(rstd),POINTER :: pk(:,:), p(:,:), theta(:,:,:), theta_rhodz(:,:,:), & 16 phi(:,:), phis(:), ps(:) 17 INTEGER :: ind 18 19 DO ind=1,ndomain 20 IF (.NOT. assigned_domain(ind)) CYCLE 21 CALL swap_dimensions(ind) 22 CALL swap_geometry(ind) 23 ps = f_ps(ind) 24 p = f_p(ind) 25 !$OMP BARRIER 26 CALL compute_pression(ps,p,0) 27 !$OMP BARRIER 28 theta_rhodz = f_theta_rhodz(ind) 29 theta = f_theta(ind) 30 CALL compute_theta_rhodz2theta(ps, theta_rhodz,theta,0) 31 phis = f_phis(ind) 32 phi = f_phi(ind) 33 CALL compute_geopotential(phis,p,theta,phi,0) 34 END DO 7 35 8 SUBROUTINE geopotential(f_phis,f_pks,f_pk,f_theta,f_phi) ! ORPHAN 9 USE icosa 10 TYPE(t_field), POINTER :: f_phis(:) 11 TYPE(t_field), POINTER :: f_pks(:) 12 TYPE(t_field), POINTER :: f_pk(:) 13 TYPE(t_field), POINTER :: f_theta(:) 14 TYPE(t_field), POINTER :: f_phi(:) 15 16 REAL(rstd), POINTER :: phis(:) 17 REAL(rstd), POINTER :: pks(:) 18 REAL(rstd), POINTER :: pk(:,:) 19 REAL(rstd), POINTER :: theta(:,:) 20 REAL(rstd), POINTER :: phi(:,:) 21 INTEGER :: ind 36 END SUBROUTINE thetarhodz2geopot 22 37 23 DO ind=1,ndomain 24 IF (.NOT. assigned_domain(ind)) CYCLE 25 CALL swap_dimensions(ind) 26 CALL swap_geometry(ind) 27 phis=f_phis(ind) 28 pks=f_pks(ind) 29 pk=f_pk(ind) 30 theta=f_theta(ind) 31 phi=f_phi(ind) 32 CALL compute_geopotential(phis,pks,pk,theta,phi,0) 33 ENDDO 34 35 END SUBROUTINE geopotential 36 37 SUBROUTINE compute_geopotential(phis,pks,pk,theta,phi,offset) 38 USE icosa 39 USE omp_para 40 IMPLICIT NONE 38 39 SUBROUTINE compute_geopotential(phis,p,theta,phi,offset) 40 USE icosa 41 USE omp_para 42 REAL(rstd),INTENT(IN) :: p(iim*jjm,llm+1) 41 43 REAL(rstd),INTENT(IN) :: phis(iim*jjm) 42 REAL(rstd),INTENT(IN) :: pks(iim*jjm) 43 REAL(rstd),INTENT(IN) :: pk(iim*jjm,llm) 44 REAL(rstd),INTENT(IN) :: theta(iim*jjm,llm) 44 REAL(rstd),INTENT(IN) :: theta(iim*jjm,llm,nqdyn) 45 45 REAL(rstd),INTENT(OUT) :: phi(iim*jjm,llm) 46 46 INTEGER,INTENT(IN) :: offset 47 47 INTEGER :: i,j,ij,l 48 REAL(rstd) :: mg_ij, p_ij, exner_ij 48 49 49 50 !!! Compute geopotential … … 57 58 ! flush pks, pk thetha, phis 58 59 !$OMP BARRIER 59 IF(is_omp_level_master) THEN60 DO j=jj_begin-offset,jj_end+offset61 DO i=ii_begin-offset,ii_end+offset62 ij=(j-1)*iim+i63 phi( ij,1 ) = phis( ij ) + theta(ij,1) * ( pks(ij) - pk(ij,1))64 ENDDO65 ENDDO60 IF(is_omp_level_master) THEN 61 DO j=jj_begin-offset,jj_end+offset 62 DO i=ii_begin-offset,ii_end+offset 63 ij=(j-1)*iim+i 64 phi( ij,1 ) = phis( ij ) 65 END DO 66 END DO 66 67 67 68 ! for other layers 68 DO l = 2, llm69 DO l = 1, llm-1 69 70 DO j=jj_begin-offset,jj_end+offset 70 71 DO i=ii_begin-offset,ii_end+offset 71 72 ij=(j-1)*iim+i 72 phi(ij,l) = phi(ij,l-1) + 0.5 * ( theta(ij,l) + theta(ij,l-1) ) & 73 * ( pk(ij,l-1) - pk(ij,l) ) 73 mg_ij = p(ij,l+1)-p(ij,l) 74 ! v=RT/p=(kappa.cpp).Theta.(p/preff)**kappa /p 75 p_ij=.5*(p(ij,l+1)+p(ij,l)) 76 exner_ij = (p_ij/preff)**kappa ! NB : no cpp factor 77 phi(ij,l+1) = phi(ij,l) + (kappa*cpp)*mg_ij*theta(ij,l,1)*exner_ij/p_ij 74 78 ENDDO 75 79 ENDDO
Note: See TracChangeset
for help on using the changeset viewer.