Changeset 428 for codes/icosagcm/trunk/src/theta_rhodz.f90
- Timestamp:
- 06/14/16 21:54:26 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/trunk/src/theta_rhodz.f90
r387 r428 1 1 MODULE theta2theta_rhodz_mod 2 2 USE field_mod 3 3 PRIVATE 4 4 TYPE(t_field), POINTER, SAVE :: f_p(:) 5 TYPE(t_field), POINTER, SAVE :: f_pks(:) 6 TYPE(t_field), POINTER, SAVE :: f_pk(:) 7 8 PRIVATE :: f_p,f_pk,f_pks 5 6 PUBLIC :: init_theta2theta_rhodz, theta_rhodz2theta, & 7 theta_rhodz2temperature, temperature2theta_rhodz, & 8 theta2theta_rhodz, & 9 compute_theta2theta_rhodz, compute_theta_rhodz2theta 9 10 10 11 CONTAINS … … 14 15 USE field_mod 15 16 IMPLICIT NONE 16 CALL allocate_field(f_p,field_t,type_real,llm+1,name='p (theta2theta_rhodz_mod)') 17 CALL allocate_field(f_pk,field_t,type_real,llm,name='pk (theta2theta_rhodz_mod)') 18 CALL allocate_field(f_pks,field_t,type_real,name='pks (theta2theta_rhodz_mod)') 19 17 CALL allocate_field(f_p,field_t,type_real,llm+1,name='p (theta2theta_rhodz_mod)') 20 18 END SUBROUTINE init_theta2theta_rhodz 21 22 19 23 20 … … 61 58 REAL(rstd), POINTER :: temp(:,:) 62 59 REAL(rstd), POINTER :: p(:,:) 63 REAL(rstd), POINTER :: pk(:,:)64 REAL(rstd), POINTER :: pks(:)65 60 INTEGER :: ind 66 61 … … 71 66 ps=f_ps(ind) 72 67 p=f_p(ind) 73 pks=f_pks(ind)74 pk=f_pk(ind)75 68 theta_rhodz=f_theta_rhodz(ind) 76 69 temp=f_temp(ind) … … 79 72 CALL compute_pression(ps,p,0) 80 73 !$OMP BARRIER 81 CALL compute_exner(ps,p,pks,pk,0) 82 !$OMP BARRIER 83 CALL compute_theta_rhodz2temperature(p, pk, theta_rhodz(:,:,1),temp,0) 74 CALL compute_theta_rhodz2temperature(p, theta_rhodz(:,:,1),temp,0) 84 75 ENDDO 85 76 !$OMP BARRIER … … 100 91 REAL(rstd), POINTER :: temp(:,:) 101 92 REAL(rstd), POINTER :: p(:,:) 102 REAL(rstd), POINTER :: pk(:,:)103 REAL(rstd), POINTER :: pks(:)104 93 INTEGER :: ind 105 94 … … 110 99 ps=f_ps(ind) 111 100 p=f_p(ind) 112 pks=f_pks(ind)113 pk=f_pk(ind)114 101 theta_rhodz=f_theta_rhodz(ind) 115 102 temp=f_temp(ind) … … 118 105 CALL compute_pression(ps,p,0) 119 106 !$OMP BARRIER 120 CALL compute_exner(ps,p,pks,pk,0) 121 !$OMP BARRIER 122 CALL compute_temperature2theta_rhodz(p, pk, temp, theta_rhodz(:,:,1), 0) 107 CALL compute_temperature2theta_rhodz(p, temp, theta_rhodz(:,:,1), 0) 123 108 ENDDO 124 109 !$OMP BARRIER … … 213 198 214 199 215 SUBROUTINE compute_theta_rhodz2temperature(p, pk,theta_rhodz,temp,offset)200 SUBROUTINE compute_theta_rhodz2temperature(p,theta_rhodz,temp,offset) 216 201 USE icosa 217 202 USE pression_mod … … 220 205 IMPLICIT NONE 221 206 REAL(rstd),INTENT(IN) :: p(iim*jjm,llm+1) 222 REAL(rstd),INTENT(IN) :: pk(iim*jjm,llm)223 207 REAL(rstd),INTENT(IN) :: theta_rhodz(iim*jjm,llm) 224 208 REAL(rstd),INTENT(OUT) :: temp(iim*jjm,llm) 225 209 INTEGER,INTENT(IN) :: offset 210 REAL(rstd) :: pk_ij 226 211 INTEGER :: i,j,ij,l 227 212 … … 232 217 DO i=ii_begin-offset,ii_end+offset 233 218 ij=(j-1)*iim+i 234 temp(ij,l) = ( theta_rhodz(ij,l) / ((p(ij,l)-p(ij,l+1))/g) ) * pk(ij,l) / cpp 219 pk_ij=((.5/preff)*(p(ij,l)+p(ij,l+1)))**kappa 220 temp(ij,l) = ( theta_rhodz(ij,l) / ((p(ij,l)-p(ij,l+1))/g) ) * pk_ij 235 221 ENDDO 236 222 ENDDO … … 241 227 END SUBROUTINE compute_theta_rhodz2temperature 242 228 243 SUBROUTINE compute_temperature2theta_rhodz(p, pk,temp,theta_rhodz,offset)229 SUBROUTINE compute_temperature2theta_rhodz(p,temp,theta_rhodz,offset) 244 230 USE icosa 245 231 USE pression_mod … … 248 234 IMPLICIT NONE 249 235 REAL(rstd),INTENT(IN) :: p(iim*jjm,llm+1) 250 REAL(rstd),INTENT(IN) :: pk(iim*jjm,llm)251 236 REAL(rstd),INTENT(OUT) :: theta_rhodz(iim*jjm,llm) 252 237 REAL(rstd),INTENT(IN) :: temp(iim*jjm,llm) 253 238 INTEGER,INTENT(IN) :: offset 239 REAL(rstd) :: pk_ij 254 240 INTEGER :: i,j,ij,l 255 241 … … 262 248 DO i=ii_begin-offset,ii_end+offset 263 249 ij=(j-1)*iim+i 264 theta_rhodz(ij,l) = temp(ij,l) * ((p(ij,l)-p(ij,l+1))/g) / (pk(ij,l) / cpp ) 250 pk_ij=((.5/preff)*(p(ij,l)+p(ij,l+1)))**kappa 251 theta_rhodz(ij,l) = temp(ij,l) * ((p(ij,l)-p(ij,l+1))/g) / pk_ij 265 252 ENDDO 266 253 ENDDO
Note: See TracChangeset
for help on using the changeset viewer.