Ignore:
Timestamp:
Apr 26, 2012, 3:22:19 PM (13 years ago)
Author:
emillour
Message:

Mars GCM: Update of the chemistry package, including:

  • 93 reactions are accounted for (instead of 22); tracking 28 species (instead of 11)
  • computation of photoabsorption using raytracing
  • improved time stepping in the photochemistry
  • updated parameters (cross-sections); with this new version input files

are in 'EUV/param_v5' of "datafile" directory.

  • transition between lower and upper atmosphere chemistry set to 0.1 Pa (calchim.F90)
  • Lots of code clean-up: removed obsolete files column.F, param_v3.h, flujo.F, phdisrate.F, ch.F, interpfast.F, paramfoto.F, getch.F Converted chemtermos.F -> chemthermos.F90 and euvheat.F -> euvheat.F90. Added paramfoto_compact.F , param_v4.h and iono.h
  • Upadted surfacearea.F
  • Cleaned initracer.F and callkeys.h (removed use of obsolete "nqchem" and "oldnames" case when initializing tracers).
  • Minor correction in "callsedim": compute "rdust" and/or "rice" only when it makes sense.

FGG+FL+EM

Location:
trunk/LMDZ.MARS/libf/phymars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/phymars/callkeys.h

    r552 r635  
    1616     
    1717      COMMON/callkeys_i/iradia,iaervar,iddist,ilwd,ilwb,ilwn,ncouche    &
    18      &   ,dustbin,nqchem_min,nltemodel,nircorr
     18     &   ,dustbin,nltemodel,nircorr
    1919     
    2020      COMMON/callkeys_r/topdustref,solarcondate,semi,alphan,euveff,     &
     
    5454      logical sedimentation,activice,water,microphys,caps
    5555      logical photochem
    56       integer nqchem_min
    5756      integer nltemodel
    5857      integer nircorr
  • trunk/LMDZ.MARS/libf/phymars/callsedim.F

    r626 r635  
    434434c     Update the dust particle size "rdust"
    435435c     -------------------------------------
    436       DO l = 1, nlay
     436      if (doubleq) then
     437       DO l = 1, nlay
    437438        DO ig=1,ngrid
    438439          rdust(ig,l)=
     
    441442          rdust(ig,l)=min(max(rdust(ig,l),1.e-10),500.e-6)
    442443        ENDDO
    443       ENDDO
     444       ENDDO
     445      endif ! of if (doubleq)
    444446     
    445447c     Update the ice particle size "rice"
    446448c     -------------------------------------
    447       IF(scavenging) THEN
     449      if (water) then
     450       IF(scavenging) THEN
    448451        DO l = 1, nlay
    449452          DO ig=1,ngrid
     
    464467          ENDDO
    465468        ENDDO
    466       ELSE
     469       ELSE
    467470        DO l = 1, nlay
    468471          DO ig=1,ngrid
     
    475478          ENDDO
    476479        ENDDO
    477       ENDIF
     480       ENDIF ! of IF(scavenging)
     481      endif ! of if (water)
    478482
    479483      RETURN
  • trunk/LMDZ.MARS/libf/phymars/initracer.F

    r459 r635  
    2424c                  q(iq=2) is the dust number mixing ratio
    2525
    26 c   If (photochem.or.thermochem) there is "ncomp" chemical species (ncomp
    27 c   is set in aeronomars/chimiedata.h) using the ncomp iq values starting at
    28 c      iq=nqchem_min = dustbin+1   (nqchem_min is defined in inifis.F)
    29 c   
    3026c
    3127c   author: F.Forget
     
    4339#include "advtrac.h"
    4440#include "comgeomfi.h"
    45 #include "chimiedata.h"
    4641
    4742#include "surfdat.h"
     
    5550c       et al. (2002), a value of 25 has been deduced;
    5651      real, parameter :: popratio = 25.
    57       logical :: oldnames ! =.true. if old tracer naming convention (q01,...)
    5852      character(len=20) :: txt ! to store some text
    5953
     
    7165c-----------------------------------------------------------------------
    7266
    73       integer :: nqchem_start
    74 
    7567! Initialization: get tracer names from the dynamics and check if we are
    7668!                 using 'old' tracer convention ('q01',q02',...)
    7769!                 or new convention (full tracer names)
    7870      ! check if tracers have 'old' names
    79       oldnames=.false.
    8071      count=0
    8172      do iq=1,nqmx
     
    9081        write(*,*) "initracer: tracers seem to follow old naming ",
    9182     &             "convention (q01,q02,...)"
    92         write(*,*) "   => will work for now ... "
    93         write(*,*) "      but you should run newstart to rename them"
    94         oldnames=.true.
     83        write(*,*) "you should run newstart to rename them"
     84        stop
    9585      endif
    9686
    97       ! copy/set tracer names
    98       if (oldnames) then ! old names (derived from iq & option values)
    99         ! 1. dust:
    100         if (dustbin.ne.0) then ! transported dust
    101           do iq=1,dustbin
    102             txt=" "
    103             write(txt,'(a4,i2.2)') 'dust',iq
    104             noms(iq)=txt
    105             mmol(iq)=100.
    106           enddo
    107           ! special case if doubleq
    108           if (doubleq) then
    109             if (dustbin.ne.2) then
    110               write(*,*) 'initracer: error expected dustbin=2'
    111             else
    112 !              noms(1)='dust_mass'   ! dust mass mixing ratio
    113 !              noms(2)='dust_number' ! dust number mixing ratio
    114 ! same as above, but avoid explict possible out-of-bounds on array
    115                noms(1)='dust_mass'   ! dust mass mixing ratio
    116                do iq=2,2
    117                noms(iq)='dust_number' ! dust number mixing ratio
    118                enddo
    119             endif
    120           endif
    121         endif
    122         ! 2. water & ice
    123         if (water) then
    124           noms(nqmx)='h2o_vap'
    125           mmol(nqmx)=18.
    126 !            noms(nqmx-1)='h2o_ice'
    127 !            mmol(nqmx-1)=18.
    128           !"loop" to avoid potential out-of-bounds in array
    129           do iq=nqmx-1,nqmx-1
    130             noms(iq)='h2o_ice'
    131             mmol(iq)=18.
    132           enddo
    133         endif
    134         ! 3. Chemistry
    135         if (photochem .or. callthermos) then
    136           if (doubleq) then
    137             nqchem_start=3
    138           else
    139             nqchem_start=dustbin+1
    140           end if
    141           do iq=nqchem_start,nqchem_start+ncomp-2
    142             noms(iq)=nomchem(iq-nqchem_start+1)
    143             mmol(iq)=mmolchem(iq-nqchem_start+1)
    144           enddo
    145         endif ! of if (photochem .or. callthermos)
    146         ! 4. Other tracers ????
    147         if ((dustbin.eq.0).and.(.not.water)) then
    148           noms(1)='co2'
    149           mmol(1)=44
    150           if (nqmx.eq.2) then
    151             noms(nqmx)='Ar_N2'
    152             mmol(nqmx)=30
    153           endif
    154         endif
    155       else
    156         ! copy tracer names from dynamics
    157         do iq=1,nqmx
    158           noms(iq)=tnom(iq)
    159         enddo
    160         ! mmol(:) array is initialized later (see below)
    161       endif ! of if (oldnames)
    162 
    163       ! special modification when using 'old' tracers:
    164       ! qsurf(nqmx) was h2o ice whereas q(nqmx) was water vapour
    165       ! and (if iceparty) q(nqmx-1) was null whereas q(nqmx-1) was water ice
    166       if (oldnames.and.water) then
    167         write(*,*)'initracer: moving surface water ice to index ',nqmx-1
    168         ! "loop" to avoid potential out-of-bounds on arrays
    169         do iq=nqmx-1,nqmx-1
    170           qsurf(1:ngridmx,iq)=qsurf(1:ngridmx,iq+1)
    171         enddo
    172         qsurf(1:ngridmx,nqmx)=0
    173       endif
    174      
    175 c------------------------------------------------------------
    176 c     Test Dimensions tracers
    177 c------------------------------------------------------------
    178 
    179 ! Ehouarn: testing number of tracers is obsolete...
    180 !      if(photochem.or.thermochem) then
    181 !          if (water) then
    182 !              if ((dustbin+ncomp+2).ne.nqmx) then
    183 !                 print*,'initracer: tracer dimension problem:'
    184 !                 print*,"(dustbin+ncomp+2).ne.nqmx"
    185 !                 print*,"ncomp: ",ncomp
    186 !                 print*,"dustbin: ",dustbin
    187 !                 print*,"nqmx: ",nqmx
    188 !                 print*,'Change ncomp in chimiedata.h'
    189 !               endif
    190 !          else
    191 !              if ((dustbin+ncomp+1).ne.nqmx) then
    192 !                 print*,'initracer: tracer dimension problem:'
    193 !                 print*,"(dustbin+ncomp+1).ne.nqmx"
    194 !                 print*,"ncomp: ",ncomp
    195 !                 print*,"dustbin: ",dustbin
    196 !                 print*,"nqmx: ",nqmx
    197 !                 print*,'Change ncomp in chimiedata.h'
    198 !                 STOP
    199 !               endif
    200 !            endif
    201 !      endif
     87      ! copy tracer names from dynamics
     88      do iq=1,nqmx
     89        noms(iq)=tnom(iq)
     90      enddo
    20291
    20392c------------------------------------------------------------
    20493c         NAME and molar mass of the tracer
    20594c------------------------------------------------------------
    206 
    20795   
    20896! Identify tracers by their names: (and set corresponding values of mmol)
     
    246134      igcm_n2plus=0
    247135      igcm_hplus=0
     136      igcm_hco2plus=0
    248137      igcm_elec=0
    249 
    250138
    251139      ! 1. find dust tracers
     
    432320          count=count+1
    433321        endif
     322        if (noms(iq).eq."hco2plus") then
     323          igcm_hco2plus=iq
     324          mmol(igcm_hco2plus)=45.
     325          count=count+1
     326        endif
    434327        if (noms(iq).eq."elec") then
    435328          igcm_elec=iq
     
    454347        endif
    455348
    456 
    457349      enddo ! of do iq=1,nqmx
    458 !      count=count+nbqchem
    459350     
    460351      ! check that we identified all tracers:
  • trunk/LMDZ.MARS/libf/phymars/physiq.F

    r633 r635  
    131131#include "chimiedata.h"
    132132#include "param.h"
    133 #include "param_v3.h"
     133#include "param_v4.h"
    134134#include "conc.h"
    135135
  • trunk/LMDZ.MARS/libf/phymars/tracer.h

    r420 r635  
    6666      integer :: igcm_n2plus
    6767      integer :: igcm_hplus
     68      integer :: igcm_hco2plus
    6869      integer :: igcm_elec
    6970      ! other tracers
     
    8586     & igcm_co2plus,igcm_oplus,igcm_o2plus,igcm_coplus,igcm_cplus,      &
    8687     & igcm_nplus,igcm_noplus,igcm_n2plus,igcm_hplus,igcm_elec,         &
    87      & igcm_ar_n2!,nbqchem,niqchem
     88     & igcm_hco2plus,igcm_ar_n2!,nbqchem,niqchem
    8889      COMMON/tracer3/noms
    8990!-----------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.