Changeset 3411 for trunk/LMDZ.PLUTO
- Timestamp:
- Aug 20, 2024, 12:12:41 PM (3 months ago)
- Location:
- trunk/LMDZ.PLUTO/libf
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.PLUTO/libf/dynphy_lonlat/phypluto/leapfrog_nogcm.F
r3410 r3411 13 13 #endif 14 14 USE infotrac, ONLY: nqtot,ok_iso_verif,tname 15 USE guide_mod, ONLY : guide_main 15 16 USE write_field, ONLY: writefield 16 17 USE control_mod, ONLY: planet_type,nday,day_step,iperiod,iphysiq, … … 22 23 use exner_milieu_m, only: exner_milieu 23 24 use cpdet_mod, only: cpdet,tpot2t,t2tpot 25 use sponge_mod, only: callsponge,mode_sponge,sponge 24 26 use comuforc_h 25 27 USE comvert_mod, ONLY: ap,bp,pressure_exner,presnivs, … … 107 109 ! ED18 nogcm 108 110 REAL tau_ps 109 REAL tau_ co2111 REAL tau_n2 110 112 REAL tau_teta 111 113 REAL tetadpmean … … 197 199 198 200 REAL psmean ! pression moyenne 199 REAL pq co2mean ! moyenne globale ps*qco201 REAL pqn2mean ! moyenne globale ps*qco 200 202 REAL p0 ! pression de reference 201 203 REAL p00d ! globalaverage(kpd) 202 REAL qmean_ co2,qmean_co2_vert ! mass mean mixing ratio vap co2203 REAL pq co2(ip1jmp1) ! average co2 mass index : ps*q_co2204 REAL qmean_n2,qmean_n2_vert ! mass mean mixing ratio vap n2 205 REAL pqn2(ip1jmp1) ! average n2 mass index : ps*q_n2 204 206 REAL oldps(ip1jmp1) ! saving old pressure ps to calculate qch4 205 207 … … 239 241 240 242 ! TEMP : diagnostic mass 241 real :: co2mass(iip1,jjp1)242 real :: co2ice_ij(iip1,jjp1)243 integer,save :: igcm_ co2=0 ! index of CO2 tracer (if any)243 real :: n2mass(iip1,jjp1) 244 real :: n2ice_ij(iip1,jjp1) 245 integer,save :: igcm_n2=0 ! index of CO2 tracer (if any) 244 246 integer :: i,j,ig 245 247 integer, parameter :: ngrid = 2+(jjm-1)*iim … … 337 339 p00d=globaverage2d(kpd) ! mean pres at ref level 338 340 tau_ps = 1. ! constante de rappel for pressure (s) 339 tau_ co2 = 1.E5 !E5 ! constante de rappel for mix ratio qco2 (s)341 tau_n2 = 1.E5 !E5 ! constante de rappel for mix ratio qn2 (s) 340 342 tau_teta = 1.E7 !constante de rappel for potentiel temperature 341 343 342 ! ED18 TEST 343 ! PRINT*,'igcm_co2 = ',igcm_co2 344 ! Locate tracer "co2" and set igcm_co2: 344 PRINT*,'igcm_n2 = ',igcm_n2 345 345 do iq=1,nqtot 346 if (tname(iq)==" co2") then347 igcm_ co2=iq346 if (tname(iq)=="n2") then 347 igcm_n2=iq 348 348 exit 349 349 endif … … 475 475 & (itau+1)/day_step 476 476 477 IF ((planet_type .eq."generic").or. 478 & (planet_type .eq."mars")) THEN 479 ! AS: we make jD_cur to be pday 480 jD_cur = int(day_ini + itau/day_step) 481 ENDIF 477 ! AS: we make jD_cur to be pday 478 jD_cur = int(day_ini + itau/day_step) 482 479 483 480 ! print*,'itau =',itau … … 488 485 jH_cur = jH_ref + start_time + & 489 486 & mod(itau+1,day_step)/float(day_step) 490 IF ((planet_type .eq."generic").or. 491 & (planet_type .eq."mars")) THEN 492 jH_cur = jH_ref + start_time + & 487 jH_cur = jH_ref + start_time + & 493 488 & mod(itau,day_step)/float(day_step) 494 ENDIF495 489 jD_cur = jD_cur + int(jH_cur) 496 490 jH_cur = jH_cur - int(jH_cur) … … 590 584 DO l=1, llm 591 585 DO ij=1,ip1jmp1 592 mq(ij,l) = masse(ij,l)*q(ij,l,igcm_ co2)586 mq(ij,l) = masse(ij,l)*q(ij,l,igcm_n2) 593 587 ENDDO 594 588 ENDDO … … 645 639 DO l=1, llm 646 640 DO ij=1,ip1jmp1 647 q(ij,l,igcm_ co2) = mq(ij,l)/ masse(ij,l)641 q(ij,l,igcm_n2) = mq(ij,l)/ masse(ij,l) 648 642 ENDDO 649 643 ENDDO … … 655 649 ! Rappel newtonien vers psmean 656 650 psmean= globaverage2d(ps) ! mean pressure 657 ! ! increment q_ co2 with physical tendancy658 ! IF (igcm_ co2.ne.0) then651 ! ! increment q_n2 with physical tendancy 652 ! IF (igcm_n2.ne.0) then 659 653 ! DO l=1, llm 660 654 ! DO ij=1,ip1jmp1 661 ! q(ij,l,igcm_ co2)=q(ij,l,igcm_co2)+662 ! & dqfi(ij,l,igcm_ co2)*dtphys655 ! q(ij,l,igcm_n2)=q(ij,l,igcm_n2)+ 656 ! & dqfi(ij,l,igcm_n2)*dtphys 663 657 ! ENDDO 664 658 ! ENDDO … … 667 661 c Mixing CO2 vertically 668 662 c -------------------------- 669 if (igcm_ co2.ne.0) then663 if (igcm_n2.ne.0) then 670 664 DO ij=1,ip1jmp1 671 qmean_ co2_vert=0.665 qmean_n2_vert=0. 672 666 DO l=1, llm 673 qmean_ co2_vert= qmean_co2_vert674 & + q(ij,l,igcm_ co2)*( p(ij,l) - p(ij,l+1))667 qmean_n2_vert= qmean_n2_vert 668 & + q(ij,l,igcm_n2)*( p(ij,l) - p(ij,l+1)) 675 669 END DO 676 qmean_ co2_vert= qmean_co2_vert/ps(ij)670 qmean_n2_vert= qmean_n2_vert/ps(ij) 677 671 DO l=1, llm 678 q(ij,l,igcm_ co2)= qmean_co2_vert672 q(ij,l,igcm_n2)= qmean_n2_vert 679 673 END DO 680 674 END DO … … 691 685 c --------------------------------------------------------------------------------- 692 686 693 ! Simulate redistribution by dynamics for q co2694 if (igcm_ co2.ne.0) then687 ! Simulate redistribution by dynamics for qn2 688 if (igcm_n2.ne.0) then 695 689 696 690 DO ij=1,ip1jmp1 697 pq co2(ij)= ps(ij) * q(ij,1,igcm_co2)691 pqn2(ij)= ps(ij) * q(ij,1,igcm_n2) 698 692 ENDDO 699 pq co2mean=globaverage2d(pqco2)700 701 ! Rappel newtonien vers q co2_mean702 qmean_ co2= pqco2mean / psmean693 pqn2mean=globaverage2d(pqn2) 694 695 ! Rappel newtonien vers qn2_mean 696 qmean_n2= pqn2mean / psmean 703 697 704 698 DO ij=1,ip1jmp1 705 q(ij,1,igcm_ co2)=q(ij,1,igcm_co2)+706 & (qmean_ co2-q(ij,1,igcm_co2))*707 & (1.-exp(-dtphys/tau_ co2))699 q(ij,1,igcm_n2)=q(ij,1,igcm_n2)+ 700 & (qmean_n2-q(ij,1,igcm_n2))* 701 & (1.-exp(-dtphys/tau_n2)) 708 702 ENDDO 709 703 710 704 DO l=2, llm 711 705 DO ij=1,ip1jmp1 712 q(ij,l,igcm_ co2)=q(ij,1,igcm_co2)706 q(ij,l,igcm_n2)=q(ij,1,igcm_n2) 713 707 END DO 714 708 END DO … … 716 710 ! TEMPORAIRE (ED) 717 711 ! PRINT*,'psmean = ',psmean 718 ! PRINT*,'qmean_ co2 = ',qmean_co2719 ! PRINT*,'pq co2mean = ',pqco2mean720 ! PRINT*,'q(50,1,igcm_ co2) = ',q(50,1,igcm_co2)721 ! PRINT*,'q(50,2,igcm_ co2) = ',q(50,2,igcm_co2)722 ! PRINT*,'q(50,3,igcm_ co2) = ',q(50,3,igcm_co2)723 724 endif ! igcm_ co2.ne.0712 ! PRINT*,'qmean_n2 = ',qmean_n2 713 ! PRINT*,'pqn2mean = ',pqn2mean 714 ! PRINT*,'q(50,1,igcm_n2) = ',q(50,1,igcm_n2) 715 ! PRINT*,'q(50,2,igcm_n2) = ',q(50,2,igcm_n2) 716 ! PRINT*,'q(50,3,igcm_n2) = ',q(50,3,igcm_n2) 717 718 endif ! igcm_n2.ne.0 725 719 726 720 … … 736 730 c ------------------------------- 737 731 ! initialize variables that will be averaged 738 !DO l=1,llm739 !DO ij=1,ip1jmp1740 !dp(ij,l) = p(ij,l) - p(ij,l+1)741 !tetadp(ij,l) = teta(ij,l)*dp(ij,l)742 !ENDDO743 !ENDDO744 745 !DO l=1,llm746 !tetadpmean = globaverage2d(tetadp(:,l))747 !dpmean = globaverage2d(dp(:,l))748 !tetamean = tetadpmean / dpmean749 !DO ij=1,ip1jmp1750 !teta(ij,l) = teta(ij,l) + (tetamean - teta(ij,l)) *751 !& (1 - exp(-dtphys/tau_teta))752 !ENDDO753 !ENDDO732 DO l=1,llm 733 DO ij=1,ip1jmp1 734 dp(ij,l) = p(ij,l) - p(ij,l+1) 735 tetadp(ij,l) = teta(ij,l)*dp(ij,l) 736 ENDDO 737 ENDDO 738 739 DO l=1,llm 740 tetadpmean = globaverage2d(tetadp(:,l)) 741 dpmean = globaverage2d(dp(:,l)) 742 tetamean = tetadpmean / dpmean 743 DO ij=1,ip1jmp1 744 teta(ij,l) = teta(ij,l) + (tetamean - teta(ij,l)) * 745 & (1 - exp(-dtphys/tau_teta)) 746 ENDDO 747 ENDDO 754 748 755 749 … … 867 861 IF(itau.EQ.itaufin) THEN 868 862 869 if (planet_type=="mars") then 870 CALL dynredem1("restart.nc",REAL(itau)/REAL(day_step), 863 CALL dynredem1("restart.nc",start_time, 871 864 & vcov,ucov,teta,q,masse,ps) 872 else873 CALL dynredem1("restart.nc",start_time,874 & vcov,ucov,teta,q,masse,ps)875 endif876 865 CLOSE(99) 877 866 !!! Ehouarn: Why not stop here and now? … … 997 986 998 987 IF(itau.EQ.itaufin) THEN 999 if (planet_type=="mars") then1000 CALL dynredem1("restart.nc",REAL(itau)/REAL(day_step),1001 & vcov,ucov,teta,q,masse,ps)1002 else1003 988 CALL dynredem1("restart.nc",start_time, 1004 989 & vcov,ucov,teta,q,masse,ps) 1005 endif1006 990 ENDIF ! of IF(itau.EQ.itaufin) 1007 991 -
trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90
r3390 r3411 1703 1703 ! Surface pressure. 1704 1704 ps(1:ngrid) = pplev(1:ngrid,1) + pdpsrf(1:ngrid)*ptimestep 1705 call globalaverage2d(ngrid,ps,globave) 1705 1706 1706 1707 ! pressure density !pluto specific … … 2321 2322 2,zdqssed(:,igcm_ch4_gas)) 2322 2323 endif 2323 if (metcloud ) then2324 if (metcloud.and.(.not.fast)) then 2324 2325 call writediagfi(ngrid,"zdtch4cloud","ch4 cloud","T s-1",& 2325 2326 3,zdtch4cloud)
Note: See TracChangeset
for help on using the changeset viewer.