Changeset 566
- Timestamp:
- Mar 7, 2012, 3:48:18 PM (13 years ago)
- Location:
- trunk/LMDZ.MARS/libf/phymars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/inifis.F
r565 r566 249 249 $ "1-> new correction", 250 250 $ "(matters only if callnirco2=T)" 251 nircorr= 0!default value251 nircorr=1 !default value 252 252 call getin("nircorr",nircorr) 253 253 write(*,*) " nircorr = ",nircorr … … 290 290 endif 291 291 292 #ifndef MESOSCALE293 292 if (calladj .and. callrichsl .and. (.not. calltherm)) then 294 293 print*,'You should not be calling the convective adjustment … … 301 300 stop 302 301 endif 303 #endif 302 304 303 write(*,*) "call CO2 condensation ?" 305 304 callcond=.true. ! default value -
trunk/LMDZ.MARS/libf/phymars/pbl_parameters.F
r529 r566 1 1 SUBROUTINE pbl_parameters(ngrid,nlay,ps,pplay,pz0, 2 & pg,zzlay,zzlev,pu,pv,wstar_in,hfmax,zmax,pts,ph,z_out, 2 & pg,zzlay,zzlev,pu,pv,wstar_in,hfmax,zmax,pts,ph,z_out,n_out, 3 3 & Teta_out,u_out,ustar,tstar,L_mo,vhf,vvv) 4 4 IMPLICIT NONE … … 30 30 ! pts(ngrid) surface temperature 31 31 ! ph(ngrid,nlay) potential temperature T*(p/ps)^kappa 32 ! z_out height of interpolation 32 ! z_out(n_out) heights of interpolation 33 ! n_out number of points for interpolation 33 34 ! 34 35 ! outputs: 35 36 ! ------ 36 37 ! 37 ! Teta_out(ngrid ) interpolated teta38 ! u_out(ngrid ) interpolated u38 ! Teta_out(ngrid,n_out) interpolated teta 39 ! u_out(ngrid,n_out) interpolated u 39 40 ! ustar(ngrid) friction velocity 40 41 ! tstar(ngrid) friction temperature … … 55 56 ! ---------- 56 57 57 INTEGER, INTENT(IN) :: ngrid,nlay 58 INTEGER, INTENT(IN) :: ngrid,nlay,n_out 58 59 REAL, INTENT(IN) :: pz0(ngrid),ps(ngrid),pplay(ngrid,nlay) 59 60 REAL, INTENT(IN) :: pg,zzlay(ngrid,nlay),zzlev(ngrid,nlay) … … 61 62 REAL, INTENT(IN) :: wstar_in(ngrid),hfmax(ngrid),zmax(ngrid) 62 63 REAL, INTENT(IN) :: pts(ngrid),ph(ngrid,nlay) 63 REAL, INTENT(IN) :: z_out 64 REAL, INTENT(IN) :: z_out(n_out) 64 65 65 66 ! Outputs: 66 67 ! -------- 67 68 68 REAL, INTENT(OUT) :: Teta_out(ngrid ),u_out(ngrid)69 REAL T_out(ngrid )69 REAL, INTENT(OUT) :: Teta_out(ngrid,n_out),u_out(ngrid,n_out) 70 REAL T_out(ngrid,n_out) 70 71 REAL, INTENT(OUT) :: ustar(ngrid), tstar(ngrid) 71 72 REAL wstar(ngrid) … … 75 76 ! ------ 76 77 77 INTEGER ig,k 78 INTEGER ig,k,n 78 79 REAL karman,nu 79 80 DATA karman,nu/.41,0.001/ … … 118 119 !------------------------------------------------------------------------ 119 120 121 DO n=1,n_out 122 120 123 c Initialisation : 121 124 … … 123 126 ustar(:)=0. 124 127 tstar(:)=0. 125 zout=z_out 128 zout=z_out(n) 126 129 reynolds(:)=0. 127 130 pz0t = 0. … … 247 250 DO ig=1,ngrid 248 251 IF(zout .lt. pz0tcomp(ig)) THEN 249 u_out(ig )=0.250 Teta_out(ig )=pts(ig)252 u_out(ig,n)=0. 253 Teta_out(ig,n)=pts(ig) 251 254 ELSEIF (L_mo(ig) .gt. 0.) THEN 252 u_out(ig )=(ustar(ig)/karman)*log(zout/pz0(ig)) +255 u_out(ig,n)=(ustar(ig)/karman)*log(zout/pz0(ig)) + 253 256 & 5.*(ustar(ig)/(karman*L_mo(ig)))*(zout-pz0(ig)) 254 Teta_out(ig )=pts(ig)+(tstar(ig)/(prandtl(ig)*karman))257 Teta_out(ig,n)=pts(ig)+(tstar(ig)/(prandtl(ig)*karman)) 255 258 & *log(zout/pz0tcomp(ig)) + 256 259 & 5.*(tstar(ig)/(prandtl(ig)*karman*L_mo(ig))) … … 260 263 IF(L_mo(ig) .gt. -1000.) THEN 261 264 262 u_out(ig )=(ustar(ig)/karman)*(265 u_out(ig,n)=(ustar(ig)/karman)*( 263 266 & 2.*atan((1.-16.*zout/L_mo(ig))**0.25) 264 267 & -2.*atan((1.-16.*pz0(ig)/L_mo(ig))**0.25) … … 270 273 & ) 271 274 272 Teta_out(ig )=pts(ig)+(tstar(ig)/(prandtl(ig)*karman))*(275 Teta_out(ig,n)=pts(ig)+(tstar(ig)/(prandtl(ig)*karman))*( 273 276 & 2.*log(1.+sqrt(1.-16.*pz0tcomp(ig)/L_mo(ig))) 274 277 & -2.*log(1.+sqrt(1.-16.*zout/L_mo(ig))) … … 285 288 ! (we do that to avoid using r*4 precision, otherwise, we get -inf values) 286 289 287 u_out(ig )=(ustar(ig)/karman)*(290 u_out(ig,n)=(ustar(ig)/karman)*( 288 291 & (4./L_mo(ig))*(zout-pz0(ig)) 289 292 & + (20./(L_mo(ig))**2)*(zout**2-pz0(ig)**2) … … 292 295 & ) 293 296 294 Teta_out(ig )=pts(ig)+(tstar(ig)/(prandtl(ig)*karman))*(297 Teta_out(ig,n)=pts(ig)+(tstar(ig)/(prandtl(ig)*karman))*( 295 298 & (8./L_mo(ig))*(zout-pz0tcomp(ig)) 296 299 & + (48./(L_mo(ig))**2)*(zout**2-pz0tcomp(ig)**2) … … 301 304 ENDIF 302 305 ELSE 303 u_out(ig )=0.304 Teta_out(ig )=pts(ig)306 u_out(ig,n)=0. 307 Teta_out(ig,n)=pts(ig) 305 308 ENDIF 306 309 IF(zout .lt. pz0(ig)) THEN 307 u_out(ig )=0.310 u_out(ig,n)=0. 308 311 ENDIF 309 312 ENDDO … … 314 317 315 318 IF ((.not.calltherm).and.(calladj)) THEN 316 Teta_out(: )=ph(:,1)319 Teta_out(:,n)=ph(:,1) 317 320 ENDIF 318 321 319 T_out(: ) = Teta_out(:)*(exp(322 T_out(:,n) = Teta_out(:,n)*(exp( 320 323 & (zout/zzlay(:,1))*(log(pplay(:,1)/ps)) 321 324 & ) 322 325 & )**rcp 323 326 327 ENDDO !of n=1,n_out 324 328 325 329 !------------------------------------------------------------------------ … … 333 337 334 338 ! Nearest index for the pbl height 339 340 IF (calltherm) THEN 335 341 336 342 pbl_height_index(:)=1 … … 361 367 ENDDO 362 368 369 ! Recompute wstar 363 370 ! We follow Spiga et. al 2010 (QJRMS) 364 371 ! ------------ … … 410 417 vvv(:) = dvvv(:)*(wstar(:))**2 411 418 412 !------------------------------------------------------------------------ 413 !------------------------------------------------------------------------ 414 ! OUTPUTS 415 !------------------------------------------------------------------------ 416 !------------------------------------------------------------------------ 417 418 IF (ngrid .eq. 1) THEN 419 dimout=0 420 ELSE 421 dimout=2 422 ENDIF 423 424 call WRITEDIAGFI(ngrid,'Teta_out', 425 & 'potential temperature at z_out','K', 426 & dimout,Teta_out) 427 call WRITEDIAGFI(ngrid,'u_out', 428 & 'horizontal velocity norm at z_out','m/s', 429 & dimout,u_out) 430 call WRITEDIAGFI(ngrid,'u_star', 431 & 'friction velocity','m/s', 432 & dimout,ustar) 433 call WRITEDIAGFI(ngrid,'teta_star', 434 & 'friction potential temperature','K', 435 & dimout,tstar) 436 call WRITEDIAGFI(ngrid,'L', 437 & 'Monin Obukhov length','m', 438 & dimout,L_mo) 439 ! call WRITEDIAGFI(ngrid,'w_star', 440 ! & 'Free convection velocity','m', 441 ! & dimout,wstar) 442 ! call WRITEDIAGFI(ngrid,'z_i', 443 ! & 'PBL height','m', 444 ! & dimout,zmax) 445 ! call WRITEDIAGFI(ngrid,'hf_max', 446 ! & 'Maximum vertical heat flux','m', 447 ! & dimout,hfmax) 448 call WRITEDIAGFI(ngrid,'vvv', 449 & 'Vertical velocity variance at zout','m', 450 & dimout,vvv) 451 call WRITEDIAGFI(ngrid,'vhf', 452 & 'Vertical heat flux at zout','m', 453 & dimout,vhf) 419 ENDIF ! of if calltherm 454 420 455 421 RETURN -
trunk/LMDZ.MARS/libf/phymars/physiq.F
r556 r566 345 345 REAL pdu_th(ngridmx,nlayermx),pdv_th(ngridmx,nlayermx) 346 346 REAL pdt_th(ngridmx,nlayermx),pdq_th(ngridmx,nlayermx,nqmx) 347 INTEGER lmax_th(ngridmx) 347 INTEGER lmax_th(ngridmx),dimout,n_out,n 348 CHARACTER(50) zstring 348 349 REAL dtke_th(ngridmx,nlayermx+1) 349 350 REAL zcdv(ngridmx), zcdh(ngridmx) 350 REAL Teta_out(ngridmx),u_out(ngridmx) ! Interpolated teta and u at z_out 351 REAL z_out ! height of interpolation between z0 and z1 [meters] 351 REAL, ALLOCATABLE, DIMENSION(:,:) :: Teta_out 352 REAL, ALLOCATABLE, DIMENSION(:,:) :: u_out ! Interpolated teta and u at z_out 353 REAL, ALLOCATABLE, DIMENSION(:) :: z_out ! height of interpolation between z0 and z1 [meters] 352 354 REAL ustar(ngridmx),tstar(ngridmx) ! friction velocity and friction potential temp 353 355 REAL L_mo(ngridmx),wstarpbl(ngridmx),vhf(ngridmx),vvv(ngridmx) … … 838 840 839 841 c----------------------------------------------------------------------- 840 c TEST. Thermals : 841 c HIGHLY EXPERIMENTAL, BEWARE !! 842 c 5. Thermals : 842 843 c ----------------------------- 843 844 844 845 if(calltherm) then 845 846 … … 1377 1378 ENDIF ! of IF (lwrite) 1378 1379 1380 c ---------------------------------------------------------- 1381 c ---------------------------------------------------------- 1382 c INTERPOLATIONS IN THE SURFACE-LAYER 1383 c ---------------------------------------------------------- 1384 c ---------------------------------------------------------- 1385 1386 IF (1 .eq. 0.) THEN 1387 IF (callrichsl) THEN 1388 n_out=5 1389 1390 ALLOCATE(z_out(n_out)) 1391 ALLOCATE(Teta_out(ngrid,n_out)) 1392 ALLOCATE(u_out(ngrid,n_out)) 1393 1394 z_out(:)=[0.001,0.05,0.1,0.5,1.] 1395 u_out(:,:)=0. 1396 Teta_out(:,:)=0. 1397 1398 call pbl_parameters(ngrid,nlayer,ps,zplay,z0, 1399 & g,zzlay,zzlev,zu,zv,wstar,hfmax_th,zmax_th,tsurf,zh,z_out,n_out, 1400 & Teta_out,u_out,ustar,tstar,wstarpbl,L_mo,vhf,vvv) 1401 1402 #ifndef MESOSCALE 1403 IF (ngrid .eq. 1) THEN 1404 dimout=0 1405 ELSE 1406 dimout=2 1407 ENDIF 1408 DO n=1,n_out 1409 write(zstring, '(F9.6)') z_out(n) 1410 call WRITEDIAGFI(ngrid,'Teta_out_'//trim(zstring), 1411 & 'potential temperature at z_out','K',dimout,Teta_out(:,n)) 1412 call WRITEDIAGFI(ngrid,'u_out_'//trim(zstring), 1413 & 'horizontal velocity norm at z_out','m/s',dimout,u_out(:,n)) 1414 ENDDO 1415 call WRITEDIAGFI(ngrid,'u_star', 1416 & 'friction velocity','m/s',dimout,ustar) 1417 call WRITEDIAGFI(ngrid,'teta_star', 1418 & 'friction potential temperature','K',dimout,tstar) 1419 call WRITEDIAGFI(ngrid,'L', 1420 & 'Monin Obukhov length','m',dimout,L_mo) 1421 call WRITEDIAGFI(ngrid,'vvv', 1422 & 'Vertical velocity variance at zout','m',dimout,vvv) 1423 call WRITEDIAGFI(ngrid,'vhf', 1424 & 'Vertical heat flux at zout','m',dimout,vhf) 1425 #endif 1426 1427 ENDIF 1428 ENDIF ! of pbl interpolation outputs 1429 1430 c ---------------------------------------------------------- 1431 c ---------------------------------------------------------- 1432 c END OF SURFACE LAYER INTERPOLATIONS 1433 c ---------------------------------------------------------- 1434 c ---------------------------------------------------------- 1435 1379 1436 IF (ngrid.NE.1) THEN 1380 1437 … … 1863 1920 c ---------------------------------------------------------- 1864 1921 1865 1866 c ----------------------------------------------------------1867 c Outputs of surface layer1868 c ----------------------------------------------------------1869 1870 1871 z_out=0.1872 if (calltherm .and. (z_out .gt. 0.)) then1873 1874 call pbl_parameters(ngrid,nlayer,ps,zplay,z0,1875 & g,zzlay,zzlev,zu,zv,wstar,hfmax_th,zmax_th,tsurf,zh,z_out,1876 & Teta_out,u_out,ustar,tstar,wstarpbl,L_mo,vhf,vvv)1877 1878 else1879 if((.not. calltherm).and.(z_out .gt. 0.)) then1880 print*, 'WARNING : no interpolation in surface-layer :'1881 print*, 'Outputing surface-layer quantities without thermals1882 & does not make sense'1883 endif1884 endif1885 1886 1922 c ---------------------------------------------------------- 1887 1923 c Outputs of thermals … … 1961 1997 1962 1998 ! THERMALS STUFF 1D 1963 1964 z_out=1.1965 if (calltherm .and. (z_out .gt. 0.)) then1966 1967 call pbl_parameters(ngrid,nlayer,ps,zplay,z0,1968 & g,zzlay,zzlev,zu,zv,wstar,hfmax_th,zmax_th,tsurf,zh,z_out,1969 & Teta_out,u_out,ustar,tstar,wstarpbl,L_mo,vhf,vvv)1970 1971 else1972 if((.not. calltherm).and.(z_out .gt. 0.)) then1973 print*, 'WARNING : no interpolation in surface-layer :'1974 print*, 'Outputing surface-layer quantities without thermals1975 & does not make sense'1976 endif1977 endif1978 1979 1999 if(calltherm) then 1980 2000
Note: See TracChangeset
for help on using the changeset viewer.