Ignore:
Timestamp:
Nov 7, 2019, 5:26:32 PM (5 years ago)
Author:
jnaar
Message:

[MARS GCM]
File "newstart.F", option "composition". Added the possibility to change atmospheric
composition when non-co2 gases (ar, n2, co, o2) are implicit. When this case is met,
we assume the molar mass of non-co2 atmosphere to be the one measured by MSL at Ls~184.
Atmospheric composition is changed at a selected grid point, and horizontal and vertical
gradients are preserved.

JN

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/newstart.F

    r2167 r2175  
    173173      real :: latref,lonref,dlatmin,dlonmin
    174174! Variable used to change composition
    175       real :: Svmr,Smmr,Smmr_old,Smmr_new,Sn
     175      real :: Svmr,Smmr,Smmr_old,Smmr_new,n,Sn
    176176      real :: Mair_old,Mair_new,vmr_old,vmr_new
    177177      real,allocatable :: coefvmr(:)  ! Correction coefficient when changing composition
     
    992992
    993993        ! Compute air molar mass at reference site
    994           Smmr=0
    995           Sn = 0
     994          Smmr=0.
     995          Sn = 0.
     996          write(*,*) 'igcm_co2 = ', igcm_co2
     997          write(*,*) 'igcm_n2 = ', igcm_n2
     998          write(*,*) 'igcm_ar = ', igcm_ar
     999          write(*,*) 'igcm_o2 = ', igcm_o2
     1000          write(*,*) 'igcm_co = ', igcm_co
     1001          write(*,*) noms
    9961002          do iq=1,nqtot
    9971003             if ((iq.eq.igcm_co2).or.(iq.eq.igcm_n2)
     
    10021008             end if
    10031009          end do
    1004           write(*,*) "At reference site :  "
    1005           write(*,*) "Sum of mass mix. ratio (should be about 1)=",Smmr
    1006           Mair_old =Smmr/Sn
    1007           write(*,*)
    1008      &     "Air molar mass (g/mol) at reference site= ",Mair_old
     1010        ! Special case : implicit non-co2 gases ! JN 11/2019
     1011          if ((igcm_n2.eq.0) .or. (igcm_ar.eq.0)) then
     1012           write(*,*) "Warning : non-co2 gases are implicit :  "
     1013           write(*,*) "At reference site :  "
     1014       !    write(*,*) "q= ", q(iref, jref, 1,igcm_co2)
     1015           write(*,*) "Sum of mass mix. ratio (ie MMR(co2))=",Smmr
     1016           Mair_old = 44.0*Smmr  + 33.87226017157708*(1-Smmr)
     1017     
     1018       !  33.87226017157708 is the
     1019       !   molar mass of non-co2 atmosphere measured by MSL at Ls ~184
     1020       
     1021           write(*,*)
     1022     &      "Air molar mass (g/mol) at reference site= ",Mair_old
     1023          end if
    10091024
    10101025        ! Ask for new volume mixing ratio at reference site
    10111026          Svmr =0.
    10121027          Sn =0.
     1028          coefvmr(igcm_co2)=1.
     1029
    10131030          do iq=1,nqtot
    10141031           coefvmr(iq) = 1.
     
    10401057           end if
    10411058          enddo ! of do iq=1,nqtot
     1059
     1060        ! Special case : implicit non-co2 gases JN 11/2019
     1061          if ((igcm_n2.eq.0) .or. (igcm_ar.eq.0)) then
     1062            write(*,*) "Warning : non-co2 gases are implicit"
     1063            vmr_old=q(iref,jref,1,igcm_co2)*Mair_old/mmol(igcm_co2) 
     1064            write(*,*) "Previous vmr(co2)=", vmr_old
     1065            write(*,*) "New vmr(co2) ? (MSL: 0.956521 at Ls~184)"
     1066 666          read(*,*,iostat=ierr) vmr_new
     1067              if(ierr.ne.0) goto 666
     1068              coefvmr(igcm_co2) = vmr_new/vmr_old
     1069              Svmr=Svmr+vmr_new
     1070              Sn=vmr_new*mmol(igcm_co2) + (1-vmr_new)
     1071     &         *33.87226017157708 ! Molar mass of non-co2 atm from MSL
     1072          end if
    10421073      !  Estimation of new Air molar mass at reference site (assuming vmr_co2 = 1-Svmr)
    10431074          Mair_new = Sn + (1-Svmr)*mmol(igcm_co2)
     1075      !  Estimation of new Air molar mass when non-co2 gases are implicit
     1076          if ((igcm_n2.eq.0) .or. (igcm_ar.eq.0)) then
     1077              Mair_new=vmr_new*mmol(igcm_co2) + (1-vmr_new)
     1078     &         *33.87226017157708 ! Molar mass of non-co2 atm from MSL
     1079           write(*,*)
     1080     &     "We consider non-co2 gases vmr measured from Curiosity"
     1081          end if
    10441082          write(*,*)
    10451083     &     "NEW Air molar mass (g/mol) at reference site= ",Mair_new
     
    10471085        ! Compute mass mixing ratio changes 
    10481086          do iq=1,nqtot 
    1049             if ((iq.eq.igcm_n2).or.(iq.eq.igcm_ar)
     1087            if ((iq.eq.igcm_co2).or.(iq.eq.igcm_n2).or.(iq.eq.igcm_ar)
    10501088     &          .or. (iq.eq.igcm_o2).or.(iq.eq.igcm_co)) then
    10511089             write(*,*) "Everywhere mmr("//trim(tname(iq))//
     
    10621100              Smmr_new = 0.
    10631101              do iq=1,nqtot 
    1064                 if ((iq.eq.igcm_n2).or.(iq.eq.igcm_ar)
    1065      &         .or. (iq.eq.igcm_o2).or.(iq.eq.igcm_co)) then
     1102                if ((iq.eq.igcm_co2).or.(iq.eq.igcm_n2)
     1103     &          .or.(iq.eq.igcm_ar)
     1104     &          .or. (iq.eq.igcm_o2).or.(iq.eq.igcm_co)) then
    10661105                   Smmr_old = Smmr_old + q(i,j,l,iq) ! sum of old mmr
    10671106                   q(i,j,l,iq)=q(i,j,l,iq)*coefvmr(iq)*Mair_old/Mair_new
     
    10751114           enddo
    10761115          enddo
     1116
     1117
     1118!          do l=1,llm
     1119!           do j=1,jjp1
     1120!            do i=1,iip1
     1121!              Smmr_old = 0.
     1122!              Smmr_new = 0.
     1123!              do iq=1,nqtot 
     1124!                if ((iq.eq.igcm_co2).or.(iq.eq.igcm_n2)
     1125!     &          .or.(iq.eq.igcm_ar)
     1126!     &          .or. (iq.eq.igcm_o2).or.(iq.eq.igcm_co)) then
     1127!                   Smmr_old = Smmr_old + q(i,j,l,iq) ! sum of old mmr
     1128!                   q(i,j,l,iq)=q(i,j,l,iq)*coefvmr(iq)*Mair_old/Mair_new
     1129!                   Smmr_new = Smmr_new + q(i,j,l,iq) ! sum of new mmr
     1130!                end if
     1131!              enddo
     1132!              iloc = maxloc(q(i,j,l,:))
     1133!              iqmax = iloc(1)
     1134!              q(i,j,l,iqmax) = q(i,j,l,iqmax) + Smmr_old - Smmr_new
     1135!            enddo
     1136!           enddo
     1137!          enddo
    10771138
    10781139          write(*,*)
Note: See TracChangeset for help on using the changeset viewer.