Changeset 1820
- Timestamp:
- Nov 15, 2017, 8:32:34 AM (7 years ago)
- Location:
- trunk/LMDZ.MARS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/README
r1818 r1820 2484 2484 - All that you need to launch a GCM run with co2 clouds is described in co2clouds.F comments. Ehouarn Millour and Anni Määttänen have the files. 2485 2485 2486 == 15/11/2017 == EM 2487 - Bug fix in co2cloud.F (in the computation of the saturation index) along 2488 with some code tidying. -
trunk/LMDZ.MARS/libf/phymars/co2cloud.F
r1818 r1820 6 6 & rsedcloud,rhocloud,pzlev,pdqs_sedco2, 7 7 & pdu,pu) 8 ! to use 'getin' 8 USE ioipsl_getincom, only: getin 9 9 use dimradmars_mod, only: naerkind 10 USE comcstfi_h 11 USE ioipsl_getincom12 USE updaterad10 USE comcstfi_h, only: pi, g, cpp 11 USE updaterad, only: updaterice_microco2, updaterice_micro, 12 & updaterdust 13 13 use conc_mod, only: mmean,rnew 14 14 use tracer_mod, only: nqmx, igcm_co2, igcm_co2_ice, … … 21 21 IMPLICIT NONE 22 22 23 #include "datafile.h"24 #include "callkeys.h"25 #include "microphys.h"23 include "datafile.h" 24 include "callkeys.h" 25 include "microphys.h" 26 26 27 27 c======================================================================= … … 68 68 69 69 c----------------------------------------------------------------------- 70 c declarations:70 c arguments: 71 71 c ------------- 72 72 73 c Inputs: 74 c ------ 75 76 INTEGER ngrid,nlay77 INTEGER nq ! nombre de traceurs78 REAL ptimestep ! pas de temps physique (s)79 REAL pplev(ngrid,nlay+1) ! pression aux inter-couches (Pa)80 REAL pplay(ngrid,nlay) ! pression au milieu des couches (Pa)81 REAL pdpsrf(ngrid) ! tendence surf pressure82 REAL pzlay(ngrid,nlay) ! altitude at the middle of the layers83 REAL pt(ngrid,nlay) ! temperature at the middle of the layers (K)84 REAL pdt(ngrid,nlay) ! tendence temperature des autres param.85 real,intent(in) :: pzlev(ngrid,nlay+1) ! altitude at the boundaries of the layers86 real pq(ngrid,nlay,nq) ! traceur (kg/kg)87 real pdq(ngrid,nlay,nq) ! tendance avant condensation (kg/kg.s-1)88 89 real rice(ngrid,nlay) ! Water Ice mass mean radius (m)73 INTEGER, INTENT(IN) :: ngrid,nlay 74 REAL, INTENT(IN) :: ptimestep ! pas de temps physique (s) 75 REAL, INTENT(IN) :: pplev(ngrid,nlay+1) ! Inter-layer pressures (Pa) 76 REAL, INTENT(IN) :: pplay(ngrid,nlay) ! mid-layer pressures (Pa) 77 REAL, INTENT(IN) :: pdpsrf(ngrid) ! tendency on surface pressure 78 REAL, INTENT(IN) :: pzlay(ngrid,nlay) ! altitude at the middle of the layers 79 REAL, INTENT(IN) :: pt(ngrid,nlay) ! temperature at the middle of the layers (K) 80 REAL, INTENT(IN) :: pdt(ngrid,nlay) ! tendency on temperature from other parametrizations 81 real, INTENT(IN) :: pq(ngrid,nlay,nq) ! tracers (kg/kg) 82 real, INTENT(IN) :: pdq(ngrid,nlay,nq) ! tendencies before condensation (kg/kg.s-1) 83 real, intent(out) :: pdqcloudco2(ngrid,nlay,nq) ! tendency due to CO2 condensation (kg/kg.s-1) 84 real, intent(out) :: pdtcloudco2(ngrid,nlay) ! tendency on temperature due to latent heat 85 INTEGER, INTENT(IN) :: nq ! number of tracers 86 REAL, INTENT(IN) :: tau(ngrid,naerkind) ! Column dust optical depth at each point 87 REAL, INTENT(IN) :: tauscaling(ngrid) ! Convertion factor for dust amount 88 REAL, INTENT(OUT) :: rdust(ngrid,nlay) ! Dust geometric mean radius (m) 89 real, intent(OUT) :: rice(ngrid,nlay) ! Water Ice mass mean radius (m) 90 90 ! used for nucleation of CO2 on ice-coated ccns 91 DOUBLE PRECISION rho_ice_co2T(ngrid,nlay) !T-dependant CO2 ice density 92 DOUBLE PRECISION :: myT ! temperature scalar for co2 density computation 93 REAL tau(ngrid,naerkind) ! Column dust optical depth at each point 94 REAL tauscaling(ngrid) ! Convertion factor for dust amount 95 real rdust(ngrid,nlay) ! Dust geometric mean radius (m) 96 97 c Outputs: 98 c ------- 99 100 real pdqcloudco2(ngrid,nlay,nq) ! tendence de la condensation H2O(kg/kg.s-1) 101 REAL pdtcloudco2(ngrid,nlay) ! tendence temperature due 102 ! a la chaleur latente 103 DOUBLE PRECISION riceco2(ngrid,nlay) ! Ice mass mean radius (m) 91 DOUBLE PRECISION, INTENT(out) :: riceco2(ngrid,nlay) ! Ice mass mean radius (m) 104 92 ! (r_c in montmessin_2004) 105 REAL nuice(ngrid,nlay) ! Estimated effective variance93 REAL, INTENT(in) :: nuice(ngrid,nlay) ! Estimated effective variance 106 94 ! of the size distribution 107 real rsedcloudco2(ngrid,nlay) ! Cloud sedimentation radius 108 real rhocloudco2(ngrid,nlay) ! Cloud density (kg.m-3) 109 real rhocloudco2t(ngrid,nlay) ! Cloud density (kg.m-3) 110 real pdqs_sedco2(ngrid) ! CO2 flux at the surface 95 real, intent(out) :: rsedcloudco2(ngrid,nlay) ! Cloud sedimentation radius 96 real, intent(out) :: rhocloudco2(ngrid,nlay) ! Cloud density (kg.m-3) 97 real, intent(out) :: rsedcloud(ngrid,nlay) ! Water Cloud sedimentation radius 98 real, intent(out) :: rhocloud(ngrid,nlay) ! Water Cloud density (kg.m-3) 99 real, intent(in) :: pzlev(ngrid,nlay+1) ! altitude at the boundaries of the layers 100 real, intent(out) :: pdqs_sedco2(ngrid) ! CO2 flux at the surface 101 REAL, INTENT(IN) :: pdu(ngrid,nlay),pu(ngrid,nlay) !Zonal Wind: zu=pu+pdu*ptimestep 111 102 112 103 c local: 113 104 c ------ 114 !water115 real rsedcloud(ngrid,nlay) ! Cloud sedimentation radius116 real rhocloud(ngrid,nlay) ! Cloud density (kg.m-3)117 ! for ice radius computation118 105 119 106 ! for time loop 120 107 INTEGER microstep ! time subsampling step variable 121 INTEGER imicroco2 ! time subsampling for coupled water microphysics & sedimentation 122 SAVE imicroco2 123 REAL microtimestep ! integration timestep for coupled water microphysics & sedimentation 124 SAVE microtimestep 108 INTEGER, SAVE :: imicroco2 ! time subsampling for coupled water microphysics & sedimentation 109 REAL, SAVE :: microtimestep ! integration timestep for coupled water microphysics & sedimentation 125 110 126 111 ! tendency given by clouds (inside the micro loop) … … 135 120 REAL satuco2(ngrid,nlay) ! co2 satu ratio for output 136 121 REAL zqsatco2(ngrid,nlay) ! saturation co2 122 123 DOUBLE PRECISION rho_ice_co2T(ngrid,nlay) !T-dependant CO2 ice density 124 DOUBLE PRECISION :: myT ! temperature scalar for co2 density computation 137 125 138 126 INTEGER iq,ig,l,i … … 154 142 ! What we need for Qext reading and tau computation : size distribution 155 143 DOUBLE PRECISION vrat_cld ! Volume ratio 156 DOUBLE PRECISION rb_cldco2(nbinco2_cld+1) ! boundary values of each rad_cldco2 bin (m) 157 SAVE rb_cldco2 144 DOUBLE PRECISION, SAVE :: rb_cldco2(nbinco2_cld+1) ! boundary values of each rad_cldco2 bin (m) 158 145 DOUBLE PRECISION, PARAMETER :: rmin_cld = 1.e-9 ! Minimum radius (m) 159 146 DOUBLE PRECISION, PARAMETER :: rmax_cld = 5.e-6 ! Maximum radius (m) … … 162 149 DOUBLE PRECISION dr_cld(nbinco2_cld) ! width of each rad_cldco2 bin (m) 163 150 DOUBLE PRECISION vol_cld(nbinco2_cld) ! particle volume for each bin (m3) 164 REAL sigma_iceco2 ! Variance of the ice and CCN distributions151 REAL, SAVE :: sigma_iceco2 ! Variance of the ice and CCN distributions 165 152 logical :: file_ok !Qext file reading 166 153 double precision :: radv(10000),Qextv1mic(10000) 167 double precision :: Qext1bins(100),Qtemp 154 double precision, save :: Qext1bins(100) 155 double precision :: Qtemp 168 156 double precision :: ltemp1(10000),ltemp2(10000) 169 157 integer :: nelem,lebon1,lebon2,uQext 170 save Qext1bins171 158 DOUBLE PRECISION n_aer(nbinco2_cld),Rn,No,n_derf,dev2 172 159 DOUBLE PRECISION Qext1bins2(ngrid,nlay) … … 177 164 REAL zt(ngrid,nlay) ! local value of temperature 178 165 REAL :: zq(ngrid, nlay,nq) 166 167 real :: rhocloudco2t(ngrid,nlay) ! Cloud density (kg.m-3) 179 168 180 169 DOUBLE PRECISION :: tcond(ngrid,nlay) !CO2 condensation temperature … … 187 176 REAL :: mincloud ! min cloud frac 188 177 DOUBLE PRECISION:: rho,zu,NN,gradT !For Saturation Index computation 189 REAL :: pdu(ngrid,nlay),pu(ngrid,nlay) !Wind field zu=pu+pdu*ptimestep190 178 DOUBLE PRECISION :: SatIndex(ngrid,nlay),SatIndexmap(ngrid) 191 179 … … 378 366 379 367 if (satindexco2) then !logical in callphys.def 380 DO l=12,26 381 ! layers 12 --> 26 ~ 12->85 km 382 DO ig=1,ngrid 383 ! Calcul de N^2 static stability 384 gradT=(zt(ig,l+1)-zt(ig,l))/(pzlev(ig,l+1)-pzlev(ig,l)) 385 NN=sqrt(g/zt(iq,l)*(max(gradT,-g/cpp)+g/cpp)) 386 !calcul of wind field 387 zu=pu(ig,l) + pdu(ig,l)*ptimestep 388 ! calcul of background density 389 rho=pplay(ig,l)/(rnew(ig,l)*zt(ig,l)) 390 !saturation index 391 SatIndex(ig,l)=sqrt(7.5e-7*150.e3/(2.*pi)*NN/(rho*zu*zu*zu)) 392 enddo 393 enddo 368 DO l=12,26 369 ! layers 12 --> 26 ~ 12->85 km 370 DO ig=1,ngrid 371 ! compute N^2 static stability 372 gradT=(zt(ig,l+1)-zt(ig,l))/(pzlev(ig,l+1)-pzlev(ig,l)) 373 NN=sqrt(g/zt(iq,l)*(max(gradT,-g/cpp)+g/cpp)) 374 ! compute absolute value of zonal wind field 375 zu=abs(pu(ig,l) + pdu(ig,l)*ptimestep) 376 ! compute background density 377 rho=pplay(ig,l)/(rnew(ig,l)*zt(ig,l)) 378 !saturation index 379 SatIndex(ig,l)=sqrt(7.5e-7*150.e3/(2.*pi)*NN/ 380 & (rho*zu*zu*zu)) 381 ENDDO 382 ENDDO 394 383 !Then compute Satindex map 395 384 ! layers 12 --> 26 ~ 12->85 km 396 DO ig=1,ngrid397 SatIndexmap(ig)=maxval(SatIndex(ig,12:26))398 enddo399 400 call WRITEDIAGFI(ngrid,"SatIndexmap","SatIndexmap","km",2,401 & SatIndexmap)385 DO ig=1,ngrid 386 SatIndexmap(ig)=maxval(SatIndex(ig,12:26)) 387 ENDDO 388 389 call WRITEDIAGFI(ngrid,"SatIndexmap","SatIndexmap","km",2, 390 & SatIndexmap) 402 391 else 403 DOig=1,ngrid404 405 406 endif 392 do ig=1,ngrid 393 SatIndexmap(ig)=0.05 !maxval(SatIndex(ig,12:26)) 394 enddo 395 endif ! of if (satindexco2) 407 396 408 397 !Modulate the DeltaT by GW propagation index : … … 414 403 415 404 CALL tcondco2(ngrid,nlay,pplay,zqvap,tcond) 416 ! A tester: CALL tcondco2(ngrid,nlay,pplay,zqvap,tcond)417 405 zdelt=spant 418 406 DO ig=1,ngrid 419 407 420 if(SatIndexmap(ig) .le. 0.1) THEN421 408 IF (SatIndexmap(ig) .le. 0.1) THEN 409 DO l=1,nlay-1 422 410 423 411 IF (tcond(ig,l) .ge. (zt(ig,l)+zdelt) 424 & .or. tcond(ig,l) .le. 0 ) THEN !T oute la fraction est saturée412 & .or. tcond(ig,l) .le. 0 ) THEN !The entire fraction is saturated 425 413 zteff(ig,l)=zt(ig,l) 426 414 cloudfrac(ig,l)=1. 427 ELSE IF (tcond(ig,l) .le. (zt(ig,l)-zdelt)) THEN ! Rien n'est saturé415 ELSE IF (tcond(ig,l) .le. (zt(ig,l)-zdelt)) THEN ! No saturation at all 428 416 zteff(ig,l)=zt(ig,l)-zdelt 429 417 cloudfrac(ig,l)=mincloud … … 431 419 cloudfrac(ig,l)=(tcond(ig,l)-zt(ig,l)+zdelt)/ 432 420 & (2.0*zdelt) 433 zteff(ig,l)=(tcond(ig,l)+zt(ig,l)-zdelt)/2. ! Temperature moyenne de la fraction nuageuse421 zteff(ig,l)=(tcond(ig,l)+zt(ig,l)-zdelt)/2. !Mean temperature of the cloud fraction 434 422 END IF !ig if (tcond(ig,l) ... 435 423 zteff(ig,l)=zteff(ig,l)-pdt(ig,l)*ptimestep … … 439 427 cloudfrac(ig,l)=1. 440 428 END IF 441 ENDDO442 ELSE429 ENDDO 430 ELSE 443 431 !SatIndex not favorable for GW : leave pt untouched 444 zteff(ig,l)=pt(ig,l)445 cloudfrac(ig,l)=mincloud446 ENDIF ! of if(SatIndexmap...447 ENDDO432 zteff(ig,l)=pt(ig,l) 433 cloudfrac(ig,l)=mincloud 434 ENDIF ! of if(SatIndexmap... 435 ENDDO ! of DO ig=1,ngrid 448 436 ! Totalcloud frac of the column missing here 449 437 c----------------------- … … 466 454 c------ Temperature tendency subpdt 467 455 ! If imicro=1 subpdt is the same as pdt 468 469 456 DO l=1,nlay 457 DO ig=1,ngrid 470 458 subpdt(ig,l) = subpdt(ig,l) 471 459 & + pdt(ig,l) ! At each micro timestep we add pdt in order to have a stepped entry … … 500 488 & subpdq(ig,l,igcm_ccn_number) 501 489 & + pdq(ig,l,igcm_ccn_number) 502 503 490 ENDDO 491 ENDDO 504 492 c- Effective tracers quantities in the cloud fraction 505 493 IF (CLFvaryingCO2) THEN 506 494 pqeff(:,:,:)=pq(:,:,:) ! prevent from buggs (A. Pottier) 507 495 pqeff(:,:,igcm_ccnco2_mass) =pq(:,:,igcm_ccnco2_mass)/ … … 511 499 pqeff(:,:,igcm_co2_ice)= pq(:,:,igcm_co2_ice)/ 512 500 & cloudfrac(:,:) 513 501 ELSE 514 502 pqeff(:,:,:)=pq(:,:,:) 515 503 END IF 516 504 517 505 c------------------------------------------------------ … … 519 507 c call to sedimentation routine, update tendancies 520 508 c------------------------------------------------------ 521 DO l=1, nlay509 DO l=1, nlay 522 510 DO ig=1,ngrid 523 511 tempo_traceur_t(ig,l)=zteff(ig,l)+subpdt(ig,l) … … 548 536 & riceco2(ig,l)) 549 537 ENDDO 550 ENDDO538 ENDDO 551 539 ! Gravitational sedimentation 552 sav_trac(:,:,igcm_co2_ice)=tempo_traceurs(:,:,igcm_co2_ice)553 sav_trac(:,:,igcm_ccnco2_mass)=540 sav_trac(:,:,igcm_co2_ice)=tempo_traceurs(:,:,igcm_co2_ice) 541 sav_trac(:,:,igcm_ccnco2_mass)= 554 542 & tempo_traceurs(:,:,igcm_ccnco2_mass) 555 sav_trac(:,:,igcm_ccnco2_number)=543 sav_trac(:,:,igcm_ccnco2_number)= 556 544 & tempo_traceurs(:,:,igcm_ccnco2_number) 557 545 !We save actualized tracer values to compute sedimentation tendancies 558 call newsedim(ngrid,nlay,ngrid*nlay,ngrid*nlay,546 call newsedim(ngrid,nlay,ngrid*nlay,ngrid*nlay, 559 547 & microtimestep,pplev,masse,epaisseur,tempo_traceur_t, 560 548 & rsedcloudco2,rhocloudco2t, 561 549 & tempo_traceurs(:,:,igcm_co2_ice),wq,beta) ! 3 traceurs 562 550 ! sedim at the surface of co2 ice : keep track of it for physiq_mod 563 do ig=1,ngrid564 pdqs_sedco2(ig)=pdqs_sedco2(ig)+ wq(ig,1)/microtimestep565 end do566 call newsedim(ngrid,nlay,ngrid*nlay,ngrid*nlay,551 do ig=1,ngrid 552 pdqs_sedco2(ig)=pdqs_sedco2(ig)+ wq(ig,1)/microtimestep 553 end do 554 call newsedim(ngrid,nlay,ngrid*nlay,ngrid*nlay, 567 555 & microtimestep,pplev,masse,epaisseur,tempo_traceur_t, 568 556 & rsedcloudco2,rhocloudco2t, 569 557 & tempo_traceurs(:,:,igcm_ccnco2_mass),wq,beta) 570 call newsedim(ngrid,nlay,ngrid*nlay,ngrid*nlay,558 call newsedim(ngrid,nlay,ngrid*nlay,ngrid*nlay, 571 559 & microtimestep,pplev,masse,epaisseur,tempo_traceur_t, 572 560 & rsedcloudco2,rhocloudco2t, 573 561 & tempo_traceurs(:,:,igcm_ccnco2_number),wq,beta) 574 DO l = 1, nlay !Compute tendencies575 DO ig=1,ngrid562 DO l = 1, nlay !Compute tendencies 563 DO ig=1,ngrid 576 564 pdqsed(ig,l,igcm_ccnco2_mass)= 577 565 & (tempo_traceurs(ig,l,igcm_ccnco2_mass)- … … 583 571 & (tempo_traceurs(ig,l,igcm_co2_ice)- 584 572 & sav_trac(ig,l,igcm_co2_ice))/microtimestep 585 ENDDO586 ENDDO573 ENDDO 574 ENDDO 587 575 !update subtimestep tendencies with sedimentation input 588 576 DO l=1,nlay … … 598 586 & +pdqsed(ig,l,igcm_co2_ice) 599 587 ENDDO 600 ENDDO588 ENDDO 601 589 c------------------------------------------------------ 602 590 c 2. Main call to the cloud schemes: 603 591 c------------------------------------------------------ 604 CALL improvedCO2clouds(ngrid,nlay,microtimestep,592 CALL improvedCO2clouds(ngrid,nlay,microtimestep, 605 593 & pplay,pplev,zteff,subpdt, 606 594 & pqeff,subpdq,subpdqcloudco2,subpdtcloudco2, … … 609 597 c 3. Updating tendencies after cloud scheme: 610 598 c----------------------------------------------------- 611 612 599 DO l=1,nlay 600 DO ig=1,ngrid 613 601 subpdt(ig,l) = 614 602 & subpdt(ig,l) + subpdtcloudco2(ig,l) … … 644 632 & subpdq(ig,l,igcm_ccn_number) 645 633 & + subpdqcloudco2(ig,l,igcm_ccn_number) 646 647 634 ENDDO 635 ENDDO 648 636 ENDDO ! of DO microstep=1,imicro 649 637 … … 656 644 enddo 657 645 c------ Temperature tendency pdtcloud 658 659 646 DO l=1,nlay 647 DO ig=1,ngrid 660 648 pdtcloudco2(ig,l) = 661 649 & subpdt(ig,l)/real(imicroco2)-pdt(ig,l) 662 663 650 ENDDO 651 ENDDO 664 652 c------ Tracers tendencies pdqcloud 665 666 653 DO l=1,nlay 654 DO ig=1,ngrid 667 655 pdqcloudco2(ig,l,igcm_co2_ice) = 668 656 & subpdq(ig,l,igcm_co2_ice)/real(imicroco2) … … 674 662 & subpdq(ig,l,igcm_h2o_ice)/real(imicroco2) 675 663 & - pdq(ig,l,igcm_h2o_ice) 676 677 678 679 664 ENDDO 665 ENDDO 666 DO l=1,nlay 667 DO ig=1,ngrid 680 668 pdqcloudco2(ig,l,igcm_ccnco2_mass) = 681 669 & subpdq(ig,l,igcm_ccnco2_mass)/real(imicroco2) … … 690 678 & subpdq(ig,l,igcm_ccn_number)/real(imicroco2) 691 679 & - pdq(ig,l,igcm_ccn_number) 692 693 694 695 680 ENDDO 681 ENDDO 682 DO l=1,nlay 683 DO ig=1,ngrid 696 684 pdqcloudco2(ig,l,igcm_dust_mass) = 697 685 & subpdq(ig,l,igcm_dust_mass)/real(imicroco2) … … 700 688 & subpdq(ig,l,igcm_dust_number)/real(imicroco2) 701 689 & - pdq(ig,l,igcm_dust_number) 702 703 690 ENDDO 691 ENDDO 704 692 c-------Due to stepped entry, other processes tendencies can add up to negative values 705 693 c-------Therefore, enforce positive values and conserve mass 706 707 694 DO l=1,nlay 695 DO ig=1,ngrid 708 696 IF ((pqeff(ig,l,igcm_ccnco2_number) + 709 697 & ptimestep* (pdq(ig,l,igcm_ccnco2_number) + … … 725 713 & -pdqcloudco2(ig,l,igcm_ccnco2_mass) 726 714 ENDIF 727 728 729 730 715 ENDDO 716 ENDDO 717 DO l=1,nlay 718 DO ig=1,ngrid 731 719 IF ( (pqeff(ig,l,igcm_dust_number) + 732 720 & ptimestep* (pdq(ig,l,igcm_dust_number) + … … 747 735 & -pdqcloudco2(ig,l,igcm_dust_mass) 748 736 ENDIF 749 750 737 ENDDO 738 ENDDO 751 739 !pq+ptime*(pdq+pdqc)=1 ! pdqc=1-pq/ptime-pdq 752 753 740 DO l=1,nlay 741 DO ig=1,ngrid 754 742 IF (pqeff(ig,l,igcm_co2_ice) + ptimestep* 755 743 & (pdq(ig,l,igcm_co2_ice) + pdqcloudco2(ig,l,igcm_co2_ice)) … … 766 754 pdqcloudco2(ig,l,igcm_co2_ice)= -pdqcloudco2(ig,l,igcm_co2) 767 755 ENDIF 768 769 756 ENDDO 757 ENDDO 770 758 771 759 c Update clouds parameters values in the cloud fraction (for output) 772 773 760 DO l=1, nlay 761 DO ig=1,ngrid 774 762 775 763 Niceco2=pqeff(ig,l,igcm_co2_ice) + … … 801 789 & Nccnco2*tauscaling(ig) .le. 1.) )THEN 802 790 riceco2(ig,l)=0. 791 Qext1bins2(ig,l)=0. 792 else 793 c Compute opacities 794 No=Nccnco2*tauscaling(ig) 795 Rn=-dlog(riceco2(ig,l)) 796 n_derf = derf( (rb_cldco2(1)+Rn) *dev2) 797 Qext1bins2(ig,l)=0. 798 do i = 1, nbinco2_cld 799 n_aer(i) = -0.5 * No * n_derf !! this ith previously computed 800 n_derf = derf((rb_cldco2(i+1)+Rn) *dev2) 801 n_aer(i) = n_aer(i) + 0.5 * No * n_derf 802 Qext1bins2(ig,l)=Qext1bins2(ig,l)+Qext1bins(i)*n_aer(i) 803 enddo 803 804 endif 804 c Compute opacities805 No=Nccnco2*tauscaling(ig)806 Rn=-dlog(riceco2(ig,l))807 n_derf = derf( (rb_cldco2(1)+Rn) *dev2)808 Qext1bins2(ig,l)=0.809 do i = 1, nbinco2_cld810 n_aer(i) = -0.5 * No * n_derf !! this ith previously computed811 n_derf = derf((rb_cldco2(i+1)+Rn) *dev2)812 n_aer(i) = n_aer(i) + 0.5 * No * n_derf813 Qext1bins2(ig,l)=Qext1bins2(ig,l)+Qext1bins(i)*n_aer(i)814 enddo815 805 816 806 !update rice water 817 call updaterice_micro(807 call updaterice_micro( 818 808 & pqeff(ig,l,igcm_h2o_ice) + ! ice mass 819 809 & (pdq(ig,l,igcm_h2o_ice) + ! ice mass … … 827 817 & tauscaling(ig),rice(ig,l),rhocloud(ig,l)) 828 818 829 call updaterdust(819 call updaterdust( 830 820 & pqeff(ig,l,igcm_dust_mass) + ! dust mass 831 821 & (pdq(ig,l,igcm_dust_mass) + ! dust mass … … 836 826 & rdust(ig,l)) 837 827 838 839 828 ENDDO 829 ENDDO 840 830 841 831 c A correction if a lot of subliming CO2 fills the 1st layer FF04/2005 … … 843 833 c Then that should not affect the ice particle radius 844 834 845 846 835 do ig=1,ngrid 836 if(pdpsrf(ig)*ptimestep.gt.0.9*(pplev(ig,1)-pplev(ig,2)))then 847 837 if(pdpsrf(ig)*ptimestep.gt.0.9*(pplev(ig,1)-pplev(ig,3))) 848 838 & riceco2(ig,2)=riceco2(ig,3) 849 839 riceco2(ig,1)=riceco2(ig,2) 850 end 840 endif 851 841 end do 852 842 … … 860 850 ENDDO 861 851 862 852 DO l=1,nlay 863 853 DO ig=1,ngrid 864 854 rsedcloudco2(ig,l)=max(riceco2(ig,l)* … … 867 857 c rsedcloudco2(ig,l)=min(rsedcloudco2(ig,l),1.e-5) 868 858 ENDDO 869 859 ENDDO 870 860 871 861 call co2sat(ngrid*nlay,zteff+(pdt+pdtcloudco2)*ptimestep 872 862 & ,pplay,zqsatco2) 873 874 863 do l=1,nlay 864 do ig=1,ngrid 875 865 satuco2(ig,l) = (pqeff(ig,l,igcm_co2) + 876 866 & (pdq(ig,l,igcm_co2) + 877 867 & pdqcloudco2(ig,l,igcm_co2))*ptimestep)* 878 868 & (mmean(ig,l)/44.01)*pplay(ig,l)/zqsatco2(ig,l) 879 880 881 ! Tout ce qui est modifié par la microphysique de CO2 doit être rapporté a cloudfrac882 869 enddo 870 enddo 871 !Everything modified by CO2 microphysics must be wrt cloudfrac 872 IF (CLFvaryingCO2) THEN 883 873 DO l=1,nlay 884 874 DO ig=1,ngrid … … 905 895 ENDDO 906 896 ENDDO 907 908 ! l'opacité de la case ig est la somme sur l de Qext1bins2: Est-ce-vrai?909 910 911 912 913 914 897 ENDIF 898 ! opacity in mesh ig is the sum over l of Qext1bins2: Is this true ? 899 tau1mic(:)=0. 900 do l=1,nlay 901 do ig=1,ngrid 902 tau1mic(ig)=tau1mic(ig)+Qext1bins2(ig,l) 903 enddo 904 enddo 915 905 !Outputs: 916 906 call WRITEDIAGFI(ngrid,"SatIndex","SatIndex"," ",3, 917 907 & SatIndex) 918 908 call WRITEDIAGFI(ngrid,"satuco2","vap in satu","kg/kg",3, 919 909 & satuco2) 920 910 call WRITEdiagfi(ngrid,"riceco2","ice radius","m" 921 911 & ,3,riceco2) 922 912 call WRITEdiagfi(ngrid,"cloudfrac","co2 cloud fraction" 923 913 & ," ",3,cloudfrac) 924 914 call WRITEdiagfi(ngrid,"rsedcloudco2","rsed co2" 925 915 & ,"m",3,rsedcloudco2) 926 916 call WRITEdiagfi(ngrid,"Tau3D1mic"," co2 ice opacities" 927 917 & ," ",3,Qext1bins2) 928 918 call WRITEdiagfi(ngrid,"tau1mic","co2 ice opacity 1 micron" 929 919 & ," ",2,tau1mic) 930 920 931 921 END
Note: See TracChangeset
for help on using the changeset viewer.