- Timestamp:
- Jun 16, 2011, 3:48:00 PM (13 years ago)
- Location:
- trunk/LMDZ.MARS/libf/phymars
- Files:
-
- 5 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/callkeys.h
r38 r161 12 12 & ,callg2d,linear,rayleigh,tracer,active,doubleq,submicron & 13 13 & ,lifting,callddevil,scavenging,sedimentation,activice,water & 14 & ,caps,photochem 14 & ,caps,photochem,calltherm,outptherm 15 15 16 16 COMMON/callkeys_i/iradia,iaervar,iddist,ilwd,ilwb,ilwn,ncouche & … … 23 23 & ,callstats,calleofdump & 24 24 & ,callnirco2,callnlte,callthermos,callconduct, & 25 & calleuv,callmolvis,callmoldiff,thermochem,thermoswater 25 & calleuv,callmolvis,callmoldiff,thermochem,thermoswater & 26 & ,calltherm,outptherm 26 27 27 28 -
trunk/LMDZ.MARS/libf/phymars/convadj.F
r38 r161 1 1 subroutine convadj(ngrid,nlay,nq,ptimestep, 2 & pplay,pplev,ppopsk, 2 & pplay,pplev,ppopsk,lmax_th, 3 3 & pu,pv,ph,pq, 4 4 & pdufi,pdvfi,pdhfi,pdqfi, … … 21 21 ! Modif. 2005 by F. Forget. 22 22 ! Modif. 2010 by R. Wordsworth 23 ! 23 ! Modif. 2011 by A. Colaitis 24 ! 24 25 !================================================================== 25 26 … … 38 39 ! --------- 39 40 40 INTEGER,intent(in) :: ngrid,nlay 41 INTEGER,intent(in) :: ngrid,nlay,lmax_th(ngrid) 41 42 REAL,intent(in) :: ptimestep 42 43 REAL,intent(in) :: ph(ngrid,nlay) … … 163 164 DO l=2,nlay 164 165 DO ig=1,ngrid 165 IF(zhc(ig,l).LT.zhc(ig,l-1)) vtest(ig)=.true. 166 ENDDO 166 IF((zhc(ig,l).LT.zhc(ig,l-1)) $ 167 $ .AND. (l .GT. lmax_th(ig))) vtest(ig)=.true. 168 ENDDO 167 169 ENDDO 168 170 … … 198 200 ! Test loop upwards on l2 199 201 200 201 202 203 IF (zhc(i, l2) .LT. zhc(i, l2-1)) THEN204 202 DO 203 l2 = l2 + 1 204 IF (l2 .GT. nlay) EXIT 205 IF ((zhc(i, l2) .LT. zhc(i, l2-1)).AND.(l2 .GT. lmax_th(i))) THEN 206 205 207 ! l2 is the highest level of the unstable column 206 208 … … 228 230 ! do we have to extend the column downwards? 229 231 230 231 232 IF (zhmc .lt. zhc(i, l1-1)) then233 234 235 232 down = .false. 233 IF (l1 .ne. 1) then !-- and then 234 IF ((zhmc .lt. zhc(i, l1-1)).and.(l1.gt.lmax_th(i))) then 235 down = .true. 236 END IF 237 END IF 236 238 237 239 ! this could be a problem... -
trunk/LMDZ.MARS/libf/phymars/inifis.F
r79 r161 204 204 write(*,*) " calldifv = ",calldifv 205 205 206 write(*,*) "call thermals ?" 207 calltherm=.false. ! default value 208 call getin("calltherm",calltherm) 209 write(*,*) " calltherm = ",calltherm 210 211 write(*,*) "output thermal diagnostics ?" 212 outptherm=.false. ! default value 213 call getin("outptherm",outptherm) 214 write(*,*) " outptherm = ",outptherm 215 206 216 write(*,*) "call convective adjustment ?" 207 217 calladj=.true. ! default value … … 209 219 write(*,*) " calladj = ",calladj 210 220 221 if (calltherm .and. (.not. calladj)) then 222 print*,'Convadj has to be activated when using thermals' 223 stop 224 endif 211 225 212 226 write(*,*) "call CO2 condensation ?" -
trunk/LMDZ.MARS/libf/phymars/physiq.F
r83 r161 6 6 $ pw, 7 7 $ pdu,pdv,pdt,pdq,pdpsrf,tracerdyn) 8 9 8 10 9 IMPLICIT NONE … … 301 300 REAL time_phys 302 301 302 c Variables from thermal 303 304 REAL lmax_th_out(ngrid) 305 REAL pdu_th(ngrid,nlayer),pdv_th(ngrid,nlayer) 306 REAL pdt_th(ngrid,nlayer),pdq_th(ngrid,nlayer,nq) 307 INTEGER lmax_th(ngrid) 308 REAL dtke_th(ngrid,nlayer+1) 309 REAL dummycol(ngrid) 303 310 c======================================================================= 304 311 … … 515 522 c Radiative transfer 516 523 c ------------------ 524 517 525 CALL callradite(icount,ngrid,nlayer,nq,zday,zls,pq,albedo, 518 526 $ emis,mu0,pplev,pplay,pt,tsurf,fract,dist_sol,igout, … … 599 607 c 4. Vertical diffusion (turbulent mixing): 600 608 c ----------------------------------------- 601 c 609 602 610 IF (calldifv) THEN 603 604 611 605 612 DO ig=1,ngrid … … 624 631 & zdqdif,zdqsdif) 625 632 633 626 634 DO l=1,nlayer 627 635 DO ig=1,ngrid … … 661 669 ENDIF ! of IF (calldifv) 662 670 671 c----------------------------------------------------------------------- 672 c TEST. Thermals : 673 c HIGHLY EXPERIMENTAL, BEWARE !! 674 c ----------------------------- 675 676 if(calltherm) then 677 678 call calltherm_interface(ngrid,nlayer,firstcall, 679 $ long,lati,zzlev,zzlay, 680 $ ptimestep,pu,pv,pt,pq,pdu,pdv,pdt,pdq,q2, 681 $ pplay,pplev,pphi,nq,zpopsk, 682 $ pdu_th,pdv_th,pdt_th,pdq_th,lmax_th,dtke_th) 683 684 DO l=1,nlayer 685 DO ig=1,ngrid 686 pdu(ig,l)=pdu(ig,l)+pdu_th(ig,l) 687 pdv(ig,l)=pdv(ig,l)+pdv_th(ig,l) 688 pdt(ig,l)=pdt(ig,l)+pdt_th(ig,l) 689 q2(ig,l)=q2(ig,l)+dtke_th(ig,l)*ptimestep 690 ENDDO 691 ENDDO 692 693 DO ig=1,ngrid 694 q2(ig,nlayer+1)=q2(ig,nlayer+1)+dtke_th(ig,nlayer+1)*ptimestep 695 ENDDO 696 697 if (tracer) then 698 DO iq=1,nq 699 DO l=1,nlayer 700 DO ig=1,ngrid 701 pdq(ig,l,iq)=pdq(ig,l,iq)+pdq_th(ig,l,iq) 702 ENDDO 703 ENDDO 704 ENDDO 705 endif 706 707 else !of if calltherm 708 lmax_th(:)=0 709 end if 663 710 664 711 c----------------------------------------------------------------------- … … 678 725 679 726 CALL convadj(ngrid,nlayer,nq,ptimestep, 680 $ pplay,pplev,zpopsk, 727 $ pplay,pplev,zpopsk,lmax_th, 681 728 $ pu,pv,zh,pq, 682 729 $ pdu,pdv,zdh,pdq, 683 730 $ zduadj,zdvadj,zdhadj, 684 731 $ zdqadj) 732 685 733 686 734 DO l=1,nlayer … … 1144 1192 c which can later be used to make the statistic files of the run: 1145 1193 c "stats") only possible in 3D runs ! 1146 1147 1194 1148 1195 IF (callstats) THEN … … 1261 1308 c call WRITEDIAGFI(ngrid,"emis","Surface emissivity","w.m-1",2, 1262 1309 c & emis) 1310 call WRITEDIAGFI(ngrid,"pplay","Pressure","Pa",3,zplay) 1311 call WRITEDIAGFI(ngrid,"pplev","Pressure","Pa",3,zplev) 1263 1312 call WRITEDIAGFI(ngrid,"tsurf","Surface temperature","K",2, 1264 1313 & tsurf) … … 1277 1326 & fluxtop_sw_tot) 1278 1327 call WRITEDIAGFI(ngrid,"temp","temperature","K",3,zt) 1279 ccall WRITEDIAGFI(ngrid,"u","Zonal wind","m.s-1",3,zu)1280 ccall WRITEDIAGFI(ngrid,"v","Meridional wind","m.s-1",3,zv)1281 ccall WRITEDIAGFI(ngrid,"w","Vertical wind","m.s-1",3,pw)1328 call WRITEDIAGFI(ngrid,"u","Zonal wind","m.s-1",3,zu) 1329 call WRITEDIAGFI(ngrid,"v","Meridional wind","m.s-1",3,zv) 1330 call WRITEDIAGFI(ngrid,"w","Vertical wind","m.s-1",3,pw) 1282 1331 call WRITEDIAGFI(ngrid,"rho","density","none",3,rho) 1283 1332 c call WRITEDIAGFI(ngrid,"q2","q2","kg.m-3",3,q2) 1284 ccall WRITEDIAGFI(ngrid,'Teta','T potentielle','K',3,zh)1333 call WRITEDIAGFI(ngrid,'Teta','T potentielle','K',3,zh) 1285 1334 c call WRITEDIAGFI(ngrid,"pressure","Pressure","Pa",3,pplay) 1286 1335 c call WRITEDIAGFI(ngrid,"ssurf","Surface stress","N.m-2",2, … … 1290 1339 c call WRITEDIAGFI(ngridmx,'lw_htrt','lw heat. rate', 1291 1340 c & 'w.m-2',3,zdtlw) 1341 c CALL WRITEDIAGFI(ngridmx,'tauTESap', 1342 c & 'tau abs 825 cm-1', 1343 c & '',2,tauTES) 1344 1292 1345 1293 1346 c ---------------------------------------------------------- … … 1402 1455 1403 1456 c ---------------------------------------------------------- 1457 c Outputs of thermals 1458 c ---------------------------------------------------------- 1459 1460 1461 ! call WRITEDIAGFI(ngrid,'dtke', 1462 ! & 'tendance tke thermiques','m**2/s**2', 1463 ! & 3,dtke_th) 1464 ! call WRITEDIAGFI(ngrid,'d_u_ajs', 1465 ! & 'tendance u thermiques','m/s', 1466 ! & 3,pdu_th*ptimestep) 1467 ! call WRITEDIAGFI(ngrid,'d_v_ajs', 1468 ! & 'tendance v thermiques','m/s', 1469 ! & 3,pdv_th*ptimestep) 1470 ! if (tracer) then 1471 ! if (nq .eq. 2) then 1472 ! call WRITEDIAGFI(ngrid,'deltaq_th', 1473 ! & 'delta q thermiques','kg/kg', 1474 ! & 3,ptimestep*pdq_th(:,:,2)) 1475 ! endif 1476 ! endif 1477 1478 1479 c ---------------------------------------------------------- 1404 1480 c Output in netcdf file "diagsoil.nc" for subterranean 1405 1481 c variables (output every "ecritphy", as for writediagfi) … … 1435 1511 c CALL writeg1d(ngrid,nlayer,pw,'w','m.s-1') 1436 1512 1513 ! THERMALS STUFF 1D 1514 if(calltherm) then 1515 1516 lmax_th_out(:)=real(lmax_th(:)) 1517 1518 if (ngridmx .eq. 1) then 1519 call WRITEDIAGFI(ngridmx,'lmax_th', 1520 & 'hauteur du thermique','K', 1521 & 0,lmax_th_out) 1522 1523 else 1524 call WRITEDIAGFI(ngridmx,'lmax_th', 1525 & 'hauteur du thermique','K', 1526 & 2,lmax_th_out) 1527 1528 endif 1529 1530 co2col(:)=0. 1531 dummycol(:)=0. 1532 if (tracer) then 1533 do l=1,nlayermx 1534 do ig=1,ngrid 1535 co2col(ig)=co2col(ig)+ 1536 & zq(ig,l,1)*(pplev(ig,l)-pplev(ig,l+1))/g 1537 if (nqmx .gt. 1) then 1538 dummycol(ig)=dummycol(ig)+ 1539 & zq(ig,l,2)*(pplev(ig,l)-pplev(ig,l+1))/g 1540 endif 1541 enddo 1542 enddo 1543 1544 end if 1545 call WRITEDIAGFI(ngrid,'co2col','integrated co2 mass' & 1546 & ,'kg/m-2',0,co2col) 1547 call WRITEDIAGFI(ngrid,'dummycol','integrated dummy mass' & 1548 & ,'kg/m-2',0,dummycol) 1549 endif 1550 call WRITEDIAGFI(ngrid,'w','vertical velocity' & 1551 & ,'m/s',1,pw) 1552 call WRITEDIAGFI(ngrid,"q2","q2","kg.m-3",1,q2) 1553 call WRITEDIAGFI(ngrid,"tsurf","Surface temperature","K",0, 1554 & tsurf) 1555 1556 call WRITEDIAGFI(ngrid,"fluxsurf_sw", 1557 & "Solar radiative flux to surface","W.m-2",0, 1558 & fluxsurf_sw_tot) 1559 1560 call WRITEDIAGFI(ngrid,"pplay","Pressure","Pa",1,zplay) 1561 call WRITEDIAGFI(ngrid,"pplev","Pressure","Pa",1,zplev) 1437 1562 ! or output in diagfi.nc (for testphys1d) 1438 1563 call WRITEDIAGFI(ngridmx,'ps','Surface pressure','Pa',0,ps) -
trunk/LMDZ.MARS/libf/phymars/testphys1d.F
r86 r161 229 229 close(91) 230 230 endif ! of if (txt.eq."co2") 231 ! Allow for an initial profile of argon 232 ! Can also be used to introduce a decaying tracer 233 ! in the 1D (TBD) to study thermals 234 if (txt.eq."ar") then 235 !look for a "profile_ar" input file 236 open(91,file='profile_ar',status='old', 237 & form='formatted',iostat=ierr) 238 if (ierr.eq.0) then 239 read(91,*) qsurf(iq) 240 do ilayer=1,nlayermx 241 read(91,*) q(ilayer,iq) 242 enddo 243 else 244 write(*,*) "No profile_ar file!" 245 endif 246 close(91) 247 endif ! of if (txt.eq."ar") 248 231 249 ! WATER VAPOUR 232 250 if (txt.eq."h2o_vap") then -
trunk/LMDZ.MARS/libf/phymars/vdifc.F
r77 r161 638 638 ENDIF 639 639 640 if (calltherm .and. outptherm) then 641 if (ngrid .eq. 1) then 642 call WRITEDIAGFI(ngrid,'zh','zh inside vdifc', 643 & 'SI',1,ph(:,:)+pdhfi(:,:)*ptimestep) 644 call WRITEDIAGFI(ngrid,'zkh','zkh', 645 & 'SI',1,zkh) 646 endif 647 endif 648 640 649 RETURN 641 650 END
Note: See TracChangeset
for help on using the changeset viewer.