Changeset 2009 for trunk/LMDZ.MARS/libf/phymars/co2condens_mod.F
- Timestamp:
- Oct 18, 2018, 12:39:43 PM (6 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/co2condens_mod.F
r2007 r2009 1 SUBROUTINE newcondens(ngrid,nlayer,nq,ptimestep, 1 MODULE co2condens_mod 2 3 IMPLICIT NONE 4 5 CONTAINS 6 7 SUBROUTINE co2condens(ngrid,nlayer,nq,ptimestep, 2 8 $ pcapcal,pplay,pplev,ptsrf,pt, 3 9 $ pphi,pdt,pdu,pdv,pdtsrf,pu,pv,pq,pdq, … … 11 17 use surfdat_h, only: emissiv, phisfi 12 18 use geometry_mod, only: latitude ! grid point latitudes (rad) 13 use planete_h 14 USE comcstfi_h19 use planete_h, only: obliquit 20 use comcstfi_h, only: cpp, g, r, pi 15 21 #ifndef MESOSCALE 16 22 USE vertical_layers_mod, ONLY: bp … … 24 30 c (Scheme described in Forget et al., Icarus, 1998) 25 31 c 26 c author: Francois Forget 1994-1996 32 c author: Francois Forget 1994-1996 ; updated 1996 -- 2018 27 33 c ------ 28 34 c adapted to external CO2 ice clouds scheme by Deborah Bardet (2018) ' 29 c30 c input:31 c -----32 c ngrid nombre de points de verticales33 c (toutes les boucles de la physique sont au34 c moins vectorisees sur ngrid)35 c nlayer nombre de couches36 c pplay(ngrid,nlayer) Pressure levels37 c pplev(ngrid,nlayer+1) Pressure levels38 c pt(ngrid,nlayer) temperature (en K)39 c ptsrf(ngrid) temperature de surface40 c41 c \42 c pdt(ngrid,nlayer)\ derivee temporelle physique avant condensation43 c / ou sublimation pour pt,ptsrf44 c pdtsrf(ngrid) /45 c46 c output:47 c -------48 c49 c pdpsrf(ngrid) \ derivee temporelle physique (contribution de50 c pdtc(ngrid,nlayer) / la condensation ou sublimation) pour Ps,pt,ptsrf51 c pdtsrfc(ngrid) /52 c53 c Entree/sortie54 c -------------55 c56 c piceco2(ngrid) : quantite de glace co2 au sol (kg/m2)57 c psolaralb(ngrid,2) : albedo au sol58 c pemisurf(ngrid) : emissivite du sol59 60 35 c 61 36 c======================================================================= … … 118 93 c ----------------- 119 94 120 c variables used for albedo parametrization121 c --------------------------------------------122 95 INTEGER i,j 123 c REAL Fluxmean(jjp1) 124 INTEGER l,ig,iq,icap,nmix 125 LOGICAL transparency, fluxdependent 126 c flag transparency if you want to make the co2ice semi-transparent 127 PARAMETER(transparency=.true.) 128 c flag fluxdependent if you want the co2ice albedo to be dependent on 129 c the incident solar flux 130 PARAMETER(fluxdependent=.false.) 131 REAL slopy,alpha,constA,constB,constT,albediceF_new(ngrid) 96 INTEGER l,ig,iq,icap 132 97 REAL zt(ngrid,nlayer) 133 98 REAL zcpi … … 135 100 REAL ztcondsol(ngrid) ! CO2 condensation temperature (surface) 136 101 REAL zdiceco2(ngrid) 137 REAL zcondicea(ngrid,nlayer) 138 REAL zcondices(ngrid) 139 REAL zfallice(ngrid,nlayer+1) , zfallheat 102 REAL zcondicea(ngrid,nlayer) ! condensation rate in layer l (kg/m2/s) 103 REAL zcondices(ngrid) ! condensation rate on the ground (kg/m2/s) 104 REAL zfallice(ngrid,nlayer+1) ! amount of ice falling from layer l (kg/m2/s) 105 REAL zfallheat 140 106 REAL zmflux(nlayer+1) 141 107 REAL zu(nlayer),zv(nlayer) … … 161 127 ! then condensation temperature is computed using partial pressure of CO2 162 128 logical,parameter :: improved_ztcond=.true. 163 ! Bound co2 (tracer) values...164 logical,parameter :: bound_qco2=.false.165 real,parameter :: qco2max=1.1166 real,parameter :: qco2mini=0.1167 real :: zqco2168 129 169 130 c local saved variables … … 174 135 real,parameter :: cpice=1000. ! (J.kg-1.K-1) specific heat of CO2 ice 175 136 REAL,SAVE :: acond,bcond,ccond 176 ! REAL,SAVE :: albediceF(ngrid)177 137 real,save :: m_co2, m_noco2, A , B 178 138 179 139 LOGICAL,SAVE :: firstcall = .true. !,firstcall2=.true. 180 181 integer flag182 140 183 141 c D.BARDET: to debug … … 199 157 firstcall=.false. 200 158 write(*,*) 'Newcondens: improved_ztcond=',improved_ztcond 201 write(*,*) 'Newcondens: bound_qco2=',bound_qco2202 159 PRINT*,'In newcondens:Tcond(P=1mb)=',tcond1mb,' Lcond=',latcond 203 160 PRINT*,'acond,bcond,ccond',acond,bcond,ccond … … 454 411 c Surface albedo and emissivity of the surface below the snow (emisref) 455 412 c ******************************************************************** 456 c Prepare the case where albedo varies with insolation:457 c ----------------------------------------------------458 ! if (fluxdependent) then459 !460 c Calcul du flux moyen (zonal mean)461 ! do j=1,jjp1462 ! Fluxmean(j)=0463 ! do i=1,iim464 ! ig=1+(j-2)*iim +i465 ! if(j.eq.1) ig=1466 ! if(j.eq.jjp1) ig=ngrid467 ! Fluxmean(j)=Fluxmean(j)+fluxsurf_sw(ig,1)468 ! $ +fluxsurf_sw(ig,2)469 ! enddo470 ! Fluxmean(j)=Fluxmean(j)/float(iim)471 ! enddo472 !473 c const A and B used to calculate the albedo which depends on solar flux474 c albedice=constA+constB*Flux475 c constT = time step to calculate the solar flux when flux decreases476 ! constA=0.26477 c constA=0.33478 c constA=0.186479 ! constB=0.00187480 ! constT=10481 ! endif ! of if (fluxdependent)482 413 483 414 ! Check that amont of CO2 ice is not problematic … … 493 424 ! ---------------------------------------- 494 425 CALL albedocaps(zls,ngrid,piceco2,psolaralb,emisref) 495 496 c Calcul de l'albedo497 c ------------------498 ! do ig =1,ngrid499 ! IF(ig.GT.ngrid/2+1) THEN500 ! icap=2501 ! ELSE502 ! icap=1503 ! ENDIF504 ! IF(firstcall2) THEN505 ! albediceF(ig)=albedice(icap)506 ! ENDIF507 c if there is still co2ice ccccccccccccccccccccccc508 ! if (piceco2(ig).gt.0) then509 ! emisref(ig) = emisice(icap)510 511 c if flux dependent albedo is used512 c --------------------------------513 ! if (fluxdependent) then514 ! j=INT((ig-2)/iim)+2515 ! if(ig.eq.1) j=1516 ! if(ig.eq.ngrid) j=jjp1517 c albediceF_new(ig)=MIN(constA+constB*Fluxmean(j),518 c $ constA+constB*250)519 ! albediceF_new(ig)=constA+constB*Fluxmean(j)520 ! if (albediceF(ig).gt.albediceF_new(ig)) then521 ! albediceF(ig)=albediceF(ig)+ ptimestep/(daysec*522 ! $ constT)*(albediceF_new(ig)-albediceF(ig))523 ! else524 ! albediceF(ig)=albediceF_new(ig)525 ! endif526 c if part of the ice is transparent527 c slopy = pente de la droite: alpha = y*co2ice/1620528 c pour une valeur superieur a une epaisseur de glace donnee529 c ici, epaisseur limite = 10cm530 ! if (transparency) then531 ! slopy=1/(1620*0.10)532 ! alpha=MIN(slopy*piceco2(ig),1.)533 ! psolaralb(ig,1) = alpha*albediceF(ig)534 ! $ +(1-alpha)*albedodat(ig)535 ! psolaralb(ig,2) = psolaralb(ig,1)536 ! else537 ! psolaralb(ig,1) = albediceF(ig)538 ! psolaralb(ig,2) = psolaralb(ig,1)539 ! endif540 ! else541 c transparency set to true and fluxdependent set to false542 ! if (transparency) then543 ! slopy=1/(1620*0.10)544 ! alpha=MIN(slopy*piceco2(ig),1.)545 ! psolaralb(ig,1) = alpha*albedice(icap)546 ! $ +(1-alpha)*albedodat(ig)547 ! psolaralb(ig,2) = psolaralb(ig,1)548 ! else549 c simplest case: transparency and flux dependent set to false550 ! psolaralb(ig,1) = albedice(icap)551 ! psolaralb(ig,2) = albedice(icap)552 ! endif553 ! endif554 c no more co2ice, albedo = ground albedo555 ! else556 ! psolaralb(ig,1) = albedodat(ig)557 ! psolaralb(ig,2) = albedodat(ig)558 ! emisref(ig) = emissiv559 ! pemisurf(ig) = emissiv560 ! endif561 ! end do ! end of the ig loop562 426 563 427 ! set pemisurf() to emissiv when there is bare surface (needed for co2snow) … … 722 586 enddo 723 587 724 c --------------------------------------------------------725 c Roughly Simulate Molecular mixing when CO2 is too depleted by726 c Surface condensation (mixing starts if qco2 < qco2min )727 c FF 06/2004728 c WARNING : this is now done in convadj, better (FF 02/2005)729 c --------------------------------------------------------730 flag=0 ! now done in convadj : must be =0731 if (flag.eq.1) then732 if(ico2.gt.0) then ! relevant only if one tracer is CO2733 if(pq(ig,1,ico2)+(pdq(ig,1,ico2)+pdqc(ig,1,ico2))*ptimestep734 & .lt.qco2min) then735 do iq=1,nq736 zq(1,iq)=pq(ig,1,iq)737 & +(pdq(ig,1,iq)+pdqc(ig,1,iq))*ptimestep738 Smq(1,iq) = masse(1)*zq(1,iq)739 end do740 Sm(1) = masse(1)741 do l =2,nlayer742 do iq=1,nq743 zq(l,iq)=pq(ig,l,iq)744 & +(pdq(ig,l,iq)+pdqc(ig,l,iq))*ptimestep745 smq(l,iq) = smq(l-1,iq) + masse(l)*zq(l,iq)746 end do747 sm(l) = sm(l-1) + masse(l)748 if(zq(l,ico2).gt.qco2min) then749 c mixmas: mass of atmosphere that must be mixed to reach qco2min750 mixmas = (sm(l-1)*zq(l,ico2)-Smq(l-1,ico2))751 & /(zq(l,ico2)-qco2min)752 if((mixmas.le.sm(l)))then753 c OK if mixed mass less than mass of layers affected754 nmix=l ! number of layer affected by mixing755 goto 99756 end if757 end if758 end do759 99 continue760 do iq=1,nq761 qmix=zq(nmix,iq)762 & +(Smq(nmix-1,iq)-zq(nmix,iq)*Sm(nmix-1))/mixmas763 do l=1,nmix-1764 pdqc(ig,l,iq)=765 & (qmix-pq(ig,l,iq))/ptimestep - pdq(ig,l,iq)766 end do767 c layer only partly mixed :768 pdqc(ig,nmix,iq)=(769 & qmix+(Sm(nmix)-mixmas)*(zq(nmix,iq)-qmix)/masse(nmix)770 & -pq(ig,nmix,iq))/ptimestep -pdq(ig,nmix,iq)771 772 end do773 end if774 end if775 776 endif ! (flag.eq.1)777 588 end if ! if (condsub) 778 589 END DO ! loop on ig … … 808 619 ! &'Precipitation of co2 ice', 809 620 ! & 'kg.m-2.s-1',2,zfallice(1,1)) 810 811 !! Specific stuff to bound co2 tracer values ....812 if (bound_qco2.and.(ico2.ne.0)) then813 do ig=1,ngrid814 do l=1,nlayer815 zqco2=pq(ig,l,ico2)816 & +(pdq(ig,l,ico2)+pdqc(ig,l,ico2))*ptimestep817 if (zqco2.gt.qco2max) then818 ! correct pdqc:819 pdqc(ig,l,ico2)=((qco2max-pq(ig,l,ico2))/ptimestep)820 & -pdq(ig,l,ico2)821 write(*,*) "newcondens: adapting pdqc(ig,l,ico2)",822 & " so that co2 conc. does not exceed",qco2max823 write(*,*) " ig:",ig," l:",l824 endif ! of if (zqco2.gt.qco2max)825 if (zqco2.lt.qco2mini) then826 ! correct pdqc:827 pdqc(ig,l,ico2)=((qco2mini-pq(ig,l,ico2))/ptimestep)828 & -pdq(ig,l,ico2)829 write(*,*) "newcondens: adapting pdqc(ig,l,ico2)",830 & " so that co2 conc. is not less than",qco2mini831 write(*,*) " ig:",ig," l:",l832 endif ! of if (zqco2.lt.qco2mini)833 end do834 enddo835 endif ! of if (bound_qco2.and.(ico2.ne.0)) then836 621 837 622 #ifndef MESOSCALE … … 853 638 #endif 854 639 855 end640 END SUBROUTINE co2condens 856 641 857 642 … … 977 762 c end if 978 763 979 end 764 END SUBROUTINE vl1d 765 766 END MODULE co2condens_mod
Note: See TracChangeset
for help on using the changeset viewer.