Changeset 201 for codes/icosagcm/trunk
- Timestamp:
- 07/08/14 15:03:32 (10 years ago)
- Location:
- codes/icosagcm/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/trunk/src/etat0.f90
r199 r201 13 13 14 14 SUBROUTINE etat0(f_ps,f_mass,f_phis,f_theta_rhodz,f_u, f_q) 15 USE icosa16 15 USE mpipara, ONLY : is_mpi_root 17 16 USE disvert_mod … … 54 53 CASE ('isothermal') 55 54 CALL getin_etat0_isothermal 56 CALL etat0_collocated( init_mass,f_phis,f_ps,f_mass,f_theta_rhodz,f_u, f_q)55 CALL etat0_collocated(f_phis,f_ps,f_mass,f_theta_rhodz,f_u, f_q) 57 56 CASE ('williamson91.6') 58 57 init_mass=.FALSE. 59 58 CALL etat0_williamson_new(f_phis,f_mass,f_theta_rhodz,f_u, f_q) 60 59 CASE ('jablonowsky06') 61 CALL etat0_jablonowsky06(f_ps,f_phis,f_theta_rhodz,f_u, f_q) 60 ! CALL etat0_jablonowsky06(f_ps,f_phis,f_theta_rhodz,f_u, f_q) 61 CALL etat0_collocated(f_phis,f_ps,f_mass,f_theta_rhodz,f_u, f_q) 62 62 CASE ('academic') 63 63 CALL etat0_academic(f_ps,f_phis,f_theta_rhodz,f_u, f_q) … … 106 106 END SUBROUTINE etat0 107 107 108 SUBROUTINE etat0_collocated(init_mass, f_ps,f_mass,f_phis,f_theta_rhodz,f_u, f_q) 108 SUBROUTINE etat0_collocated(f_phis,f_ps,f_mass,f_theta_rhodz,f_u, f_q) 109 USE mpipara 109 110 IMPLICIT NONE 110 LOGICAL, INTENT(IN) :: init_mass111 111 TYPE(t_field),POINTER :: f_ps(:) 112 112 TYPE(t_field),POINTER :: f_mass(:) … … 134 134 u=f_u(ind) 135 135 q=f_q(ind) 136 CALL compute_etat0_collocated(init_mass, ps,mass, phis, theta_rhodz, u, q) 136 CALL compute_etat0_collocated(ps,mass, phis, theta_rhodz, u, q) 137 137 138 ENDDO 138 139 END SUBROUTINE etat0_collocated 139 140 140 SUBROUTINE compute_etat0_collocated(init_mass, ps,mass, phis, theta_rhodz, u, q) 141 USE icosa 141 SUBROUTINE compute_etat0_collocated(ps,mass, phis, theta_rhodz, u, q) 142 142 USE disvert_mod 143 143 USE theta2theta_rhodz_mod 144 144 USE wind_mod 145 USE etat0_jablonowsky06_mod, ONLY : compute_jablonowsky06 => compute_etat0_new 145 146 IMPLICIT NONE 146 LOGICAL, INTENT(IN) :: init_mass147 147 REAL(rstd),INTENT(INOUT) :: ps(iim*jjm) 148 148 REAL(rstd),INTENT(INOUT) :: mass(iim*jjm,llm) … … 182 182 END DO 183 183 184 CALL compute_etat0_ngrid(iim*jjm,lon_i,lat_i, phis, ps, mass, temp_i, ulon_i, ulat_i, q)185 IF(init_mass) THEN186 CALL compute_rhodz(.TRUE., ps, mass)187 END IF188 CALL compute_temperature2theta_rhodz(ps,temp_i,theta_rhodz,0) ! FIXME - works with shallow-water ?189 190 CALL compute_etat0_ngrid(3*iim*jjm,lon_e,lat_e, phis_e,ps_e,mass_e, temp_e, ulon_e, ulat_e, q_e)191 CALL compute_wind_from_lonlat_compound(ulon_e, ulat_e, u)192 193 END SUBROUTINE compute_etat0_collocated194 195 SUBROUTINE compute_etat0_ngrid(ngrid,lon,lat, phis, ps, mass, temp, ulon, ulat, q)196 IMPLICIT NONE197 INTEGER, INTENT(IN) :: ngrid198 REAL(rstd),INTENT(IN) :: lon(ngrid)199 REAL(rstd),INTENT(IN) :: lat(ngrid)200 REAL(rstd),INTENT(OUT) :: phis(ngrid)201 REAL(rstd),INTENT(INOUT) :: ps(ngrid)202 REAL(rstd),INTENT(INOUT) :: mass(ngrid,llm)203 REAL(rstd),INTENT(OUT) :: temp(ngrid,llm)204 REAL(rstd),INTENT(OUT) :: ulon(ngrid,llm)205 REAL(rstd),INTENT(OUT) :: ulat(ngrid,llm)206 REAL(rstd),INTENT(OUT) :: q(ngrid,llm,nqtot)207 208 184 SELECT CASE (TRIM(etat0_type)) 209 185 CASE ('isothermal') 210 CALL compute_etat0_isothermal(ngrid, phis, ps, temp, ulon, ulat, q) 186 CALL compute_etat0_isothermal(iim*jjm, phis, ps, temp_i, ulon_i, ulat_i, q) 187 CALL compute_etat0_isothermal(3*iim*jjm, phis_e, ps_e, temp_e, ulon_e, ulat_e, q_e) 188 CASE('jablonowsky06') 189 CALL compute_jablonowsky06(iim*jjm,lon_i,lat_i, phis, ps, temp_i, ulon_i, ulat_i) 190 CALL compute_jablonowsky06(3*iim*jjm,lon_e,lat_e, phis_e, ps_e, temp_e, ulon_e, ulat_e) 211 191 END SELECT 212 192 213 END SUBROUTINE compute_etat0_ngrid 193 CALL compute_temperature2theta_rhodz(ps,temp_i,theta_rhodz,0) 194 CALL compute_wind_perp_from_lonlat_compound(ulon_e, ulat_e, u) 195 196 END SUBROUTINE compute_etat0_collocated 214 197 215 198 !----------------------------- Resting isothermal state -------------------------------- 216 199 217 200 SUBROUTINE getin_etat0_isothermal 218 etat0_temp=300 ;219 CALL getin("etat0_ temp",etat0_temp)201 etat0_temp=300 202 CALL getin("etat0_isothermal_temp",etat0_temp) 220 203 END SUBROUTINE getin_etat0_isothermal 221 204 -
codes/icosagcm/trunk/src/etat0_jablonowsky06.f90
r186 r201 6 6 REAL(rstd),PARAMETER :: ps0=1e5 7 7 REAL(rstd),PARAMETER :: u0=35 8 ! REAL(rstd),PARAMETER :: u0=09 8 REAL(rstd),PARAMETER :: T0=288 10 9 REAL(rstd),PARAMETER :: DeltaT=4.8e5 … … 12 11 REAL(rstd),PARAMETER :: Gamma=0.005 13 12 REAL(rstd),PARAMETER :: up0=1 14 PUBLIC test_etat0_jablonowsky06, etat0, compute_etat0_jablonowsky06 13 PUBLIC test_etat0_jablonowsky06, etat0, compute_etat0_jablonowsky06, compute_etat0_new 15 14 CONTAINS 16 15 … … 248 247 249 248 END SUBROUTINE compute_etat0_jablonowsky06 249 250 SUBROUTINE compute_etat0_new(ngrid,lat,lon, phis, ps, temp, ulon, ulat) 251 USE disvert_mod 252 IMPLICIT NONE 253 INTEGER, INTENT(IN) :: ngrid 254 REAL(rstd),INTENT(IN) :: lat(ngrid) 255 REAL(rstd),INTENT(IN) :: lon(ngrid) 256 REAL(rstd),INTENT(OUT) :: phis(ngrid) 257 REAL(rstd),INTENT(OUT) :: ps(ngrid) 258 REAL(rstd),INTENT(OUT) :: temp(ngrid,llm) 259 REAL(rstd),INTENT(OUT) :: ulon(ngrid,llm) 260 REAL(rstd),INTENT(OUT) :: ulat(ngrid,llm) 261 262 INTEGER :: l,ij 263 REAL(rstd) :: eta(llm) 264 REAL(rstd) :: etav(llm) 265 REAL(rstd) :: etas, etavs, Tave, phis_ave, r2 266 267 DO l=1,llm 268 eta(l) = 0.5 *( ap(l)/ps0+bp(l) + ap(l+1)/ps0+bp(l+1) ) 269 etav(l) = (eta(l)-eta0)*Pi/2 270 ENDDO 271 etas = ap(1)+bp(1) 272 etavs = (etas-eta0)*Pi/2 273 274 phis_ave=T0*g/Gamma*(1-etas**(Rd*Gamma/g)) 275 DO ij=1,ngrid 276 ps(ij)=ps0 277 phis(ij) = phis_ave + u0*cos(etavs)**1.5*( (-2*sin(lat(ij))**6 * (cos(lat(ij))**2+1./3) + 10./63 )*u0*cos(etavs)**1.5 & 278 +(8./5*cos(lat(ij))**3 * (sin(lat(ij))**2 + 2./3) - Pi/4)*radius*Omega ) 279 ENDDO 280 281 DO l=1,llm 282 Tave=T0*eta(l)**(Rd*Gamma/g) 283 IF (etat>eta(l)) Tave=Tave+DeltaT*(etat-eta(l))**5 284 DO ij=1,ngrid 285 r2 = arc(Pi/9,2*Pi/9, lon(ij),lat(ij))**2 286 temp(ij,l) = Tave + 0.75*(eta(l)*Pi*u0/Rd)*sin(etav(l))*cos(etav(l))**0.5 & 287 * ( (-2*sin(lat(ij))**6*(cos(lat(ij))**2+1./3)+10./63)*2*u0*cos(etav(l))**1.5 & 288 + (8./5*cos(lat(ij))**3*(sin(lat(ij))**2+2./3)-Pi/4)*radius*Omega) 289 ulon(ij,l) = u0*cos(etav(l))**1.5*sin(2*lat(ij))**2 + up0*exp(-r2/0.01) 290 ulat(ij,l) = 0 291 ENDDO 292 ENDDO 293 294 295 END SUBROUTINE compute_etat0_new 250 296 251 297 END MODULE etat0_jablonowsky06_mod -
codes/icosagcm/trunk/src/vector.f90
r12 r201 47 47 48 48 END SUBROUTINE cross_product2 49 49 50 FUNCTION arc(lon1,lat1, lon2,lat2) 51 REAL(rstd) :: lon1,lat1, lon2,lat2, arc2, & 52 x1,x2,x3,y1,y2,y3,z1,z2,z3 53 x1=cos(lat1)*cos(lon1) 54 x2=cos(lat2)*cos(lon2) 55 y1=cos(lat1)*sin(lon1) 56 y2=cos(lat2)*sin(lon2) 57 z1=sin(lat1) 58 z2=sin(lat2) 59 x3=y1*z2-y2*z1 60 y3=z1*x2-z2*x1 61 z3=x1*y2-x2*y1 62 arc=ASIN(SQRT(x3*x3+y3*y3+z3*z3)) 63 END FUNCTION arc 64 50 65 END MODULE vector
Note: See TracChangeset
for help on using the changeset viewer.