Changeset 1357


Ignore:
Timestamp:
Oct 20, 2014, 8:18:06 AM (10 years ago)
Author:
emillour
Message:

Mars GCM:

  • Update and bug correction on the escape fluxes of H and H2.

JYC

Location:
trunk/LMDZ.MARS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/README

    r1353 r1357  
    21472147  measurements, along with dustiropacity='mcs'. Future evolutions of this option
    21482148  could include other instruments, or be used for water ice.
     2149
     2150== 20/10/2014 == JYC
     2151- Update and bug correction on the escape fluxes of H and H2.
  • trunk/LMDZ.MARS/libf/aeronomars/moldiff_red.F90

    r1266 r1357  
    33
    44use tracer_mod, only: noms, mmol
    5 USE comcstfi_h
    6 
     5use comgeomphy, only: airephy
    76implicit none
    87
     8!#include "dimensions.h"
     9!#include "dimphys.h"
     10#include "comcstfi.h"
     11!#include "callkeys.h"
     12!#include "comdiurn.h"
     13!#include "chimiedata.h"
     14!#include "tracer.h"
     15!#include "conc.h"
    916#include "diffusion.h"
     17
     18! July 2014 JYC ADD BALISTIC Transport coupling to compute wup for H and H2
     19
     20
    1021
    1122!
     
    3950      real*8 masseU,kBolt,RgazP,Rmars,Grav,Mmars
    4051      real*8 rho0,D0,T0,H0,time0,dZ,time,dZraf,tdiff,Zmin,Zmax
    41       real*8 FacEsc,invsgmu
     52      real*8 FacEsc,invsgmu,PhiEscH,PhiEscH2
    4253      real*8 hp(nlayer)
    4354      real*8 pp(nlayer)
     
    132143        if (ListeDiff(n) .eq. noms(nn)) then
    133144        indic_diff(nn)=1
    134         if (noms(nn) .eq. 'h') i_h=n
    135         if (noms(nn) .eq. 'h2') i_h2=n
     145!       if (noms(nn) .eq. 'h') i_h=n
     146!       if (noms(nn) .eq. 'h2') i_h2=n
    136147        endif
    137148
     
    151162        n=n+1
    152163        gcmind(n)=nn
    153         endif
    154         enddo
    155 
    156         print*,'gcmind',gcmind
     164        if (noms(nn) .eq. 'h') i_h=n
     165        if (noms(nn) .eq. 'h2') i_h2=n
     166        endif
     167        enddo
     168
     169!       print*,'gcmind',gcmind,i_h,i_h2
    157170
    158171! find vertical index above which diffusion is computed
     
    207220        invsgmu=1d0/g/masseU
    208221       
    209 !       print*,'moldiff',i_h2,i_h,ncompdiff
     222! Compute the wup(ig) for H and H2 using the balistic code from R Yelle
     223
     224        PhiEscH=0D0
     225        PhiEscH2=0D0
     226
    210227      do ig=1,ngrid
    211228        pp=dble(pplay(ig,:))
     
    393410        endif
    394411        enddo
     412
     413!       print*,'wi',wi(i_h),wi(i_h2),Uthermal,Lambdaexo,mmol(gcmind(:))
     414!       print*,'wi',wi
     415!       stop
    395416
    396417! Compute time step for diffusion
     
    572593        CALL RHOTOT(pp,tt,massemoy,qnew,RHOT,RHOK,nlayer,ncompdiff)
    573594
     595! Update total escape flux of H and H2 (if q was really qnew, but not forget we will output
     596! the trend only at the end
     597
     598        PhiEscH=PhiEscH+wi(i_h)*Nrafk(nlraf,i_h)*airephy(ig) ! in s-1
     599        PhiEscH2=PhiEscH2+wi(i_h2)*Nrafk(nlraf,i_h2)*airephy(ig) ! in s-1 (U in m/s, aire in m2, Nrafk in m-3)
     600!       print*,'test',ig,wi(i_h),Nrafk(nlraf,i_h),wi(i_h2),Nrafk(nlraf,i_h2),airephy(ig),PhiEscH,PhiEscH2,i_h,i_h2
     601!       stop
     602
     603
    574604        if (ig .eq. ij0) then
    575605        do l=il0,nlayer
     
    623653
    624654       enddo  ! ig loop         
    625 
     655!       print*,'Escape flux H, H2 (s-1)',PhiEscH,PhiEscH2
    626656
    627657      return
     
    13361366        Ytot=sum(Y)
    13371367
    1338         if (abs((Xtot-Ytot)/Xtot) .gt. 1d-4) then
     1368        if (abs((Xtot-Ytot)/Xtot) .gt. 1d-3) then
    13391369        print*,'no conservation for mass',Xtot,Ytot,nn
    13401370        endif
     
    13571387!       print*,'l',l,qold(l,nn),qnew(l,nn),Mold,Mnew,DM,P(l),P(l+1)
    13581388        ENDDO
    1359         IF (abs(DM/Mold) .gt. 1d-5) THEN
     1389        IF (abs(DM/Mold) .gt. 1d-2) THEN
    13601390        Print*,'We dont conserve mas',nn,DM,Mold,Mnew,DM/Mold
    13611391        ENDIF
Note: See TracChangeset for help on using the changeset viewer.