Ignore:
Timestamp:
Apr 13, 2012, 8:40:01 AM (13 years ago)
Author:
emillour
Message:

Mars GCM:

Update of the chemistry package:

  • calchim.F90 :
    • upgraded from calchim.F
    • can run with or without CH4
    • fixed the mass conservation scheme
  • photochemistry.F : -chemistry timestep is now independant from physics timestep -can run with or without a CH4 tracer
    • removed initial tests on species, since these are already done in calchim
  • removed inichim_readcallphys.F (not used any more)
  • concentrations.F: adaptated to better handle indexes and molar masses of

tracers. "ncomp" (in chimiedata.h) no longer needed.

  • inichim_newstart.F90 : rewritten and cleaned (won't be compatible with

old start files where tracer names are q01,...).
Now handles hybrid levels and automaticaly adapts
depending on which tracers are available.

  • newstart.F : adapted to followup changes in inchim_newstart.F90 and some

cleanup around the initialization of tracer names and surface
values.

FL+EM

File:
1 edited

Legend:

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

    r563 r618  
    139139      real choix_1
    140140      character*80      fichnom
    141       integer Lmodif,iq,thermo
     141      integer Lmodif,iq
     142      integer flagthermo, flagh2o
    142143      character modif*20
    143144      real z_reel(iip1,jjp1)
     
    450451      enddo ! of do iq=1,nqmx
    451452     
     453      ! initialize tracer names noms(:) and indexes (igcm_co2, igcm_h2o_vap, ...)
     454      call initracer(qsurf,co2ice)
     455     
    452456      if (count.eq.nqmx) then
    453457        write(*,*) 'Newstart: updating tracer names'
    454         ! do things the easy but dirty way:
    455         ! 1. call inichim_readcallphys (so that callphys.def is read)
    456         call inichim_readcallphys()
    457         ! 2. call initracer to set all new tracer names (in noms(:))
    458         call initracer(qsurf,co2ice)
    459         ! 3. copy noms(:) to tnom(:)
     458        ! copy noms(:) to tnom(:) to have matching tracer names in physics
     459        ! and dynamics
    460460        tnom(1:nqmx)=noms(1:nqmx)
    461         write(*,*) 'Newstart: updated tracer names'
    462       else
    463        ! initialize tracer names and indexes (igcm_co2, igcm_h2o_vap, ...)
    464         call initracer(qsurf,co2ice)
    465461      endif
    466462
     
    474470      write(*,*)
    475471      write(*,*) 'List of possible changes :'
    476       write(*,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
     472      write(*,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~'
    477473      write(*,*)
    478       write(*,*) 'flat : no topography ("aquaplanet")'
    479       write(*,*) 'bilball : uniform albedo and thermal inertia'
    480       write(*,*) 'z0 : set a uniform surface roughness length'
    481       write(*,*) 'coldspole : cold subsurface and high albedo at S.pole'
    482       write(*,*) 'qname : change tracer name'
    483       write(*,*) 'q=0 : ALL tracer =zero'
    484       write(*,*) 'q=x : give a specific uniform value to one tracer'
    485       write(*,*) 'q=profile : specify a profile for a tracer'
    486       write(*,*) 'ini_q : tracers initialisation for chemistry, water an
    487      $d ice   '
    488       write(*,*) 'ini_q-H2O : tracers initialisation for chemistry and
    489      $ice '
    490       write(*,*) 'ini_q-iceH2O : tracers initialisation for chemistry on
    491      $ly '
    492       write(*,*) 'ini_h2osurf : reinitialize surface water ice '
    493       write(*,*) 'noglacier : Remove tropical H2O ice if |lat|<45'
    494       write(*,*) 'watercapn : H20 ice on permanent N polar cap '
    495       write(*,*) 'watercaps : H20 ice on permanent S polar cap '
    496       write(*,*) 'wetstart  : start with a wet atmosphere'
    497       write(*,*) 'isotherm : Isothermal Temperatures, wind set to zero'
    498       write(*,*) 'co2ice=0 : remove CO2 polar cap'
    499       write(*,*) 'ptot : change total pressure'
    500       write(*,*) 'therm_ini_s: Set soil thermal inertia to reference sur
    501      &face values'
    502       write(*,*) 'subsoilice_n: Put deep underground ice layer in northe
    503      &rn hemisphere'
    504       write(*,*) 'subsoilice_s: Put deep underground ice layer in southe
    505      &rn hemisphere'
    506       write(*,*) 'mons_ice: Put underground ice layer according to MONS-
    507      &derived data'
     474      write(*,*) 'flat         : no topography ("aquaplanet")'
     475      write(*,*) 'bilball      : uniform albedo and thermal inertia'
     476      write(*,*) 'z0           : set a uniform surface roughness length'
     477      write(*,*) 'coldspole    : cold subsurface and high albedo at
     478     $ S.Pole'
     479      write(*,*) 'qname        : change tracer name'
     480      write(*,*) 'q=0          : ALL tracer =zero'
     481      write(*,*) 'q=x          : give a specific uniform value to one
     482     $ tracer'
     483      write(*,*) 'q=profile    : specify a profile for a tracer'
     484      write(*,*) 'ini_q        : tracers initialization for chemistry
     485     $ and water vapour'
     486      write(*,*) 'ini_q-h2o    : tracers initialization for chemistry
     487     $ only'
     488      write(*,*) 'ini_h2osurf  : reinitialize surface water ice '
     489      write(*,*) 'noglacier    : Remove tropical H2O ice if |lat|<45'
     490      write(*,*) 'watercapn    : H20 ice on permanent N polar cap '
     491      write(*,*) 'watercaps    : H20 ice on permanent S polar cap '
     492      write(*,*) 'wetstart     : start with a wet atmosphere'
     493      write(*,*) 'isotherm     : Isothermal Temperatures, wind set to
     494     $ zero'
     495      write(*,*) 'co2ice=0     : remove CO2 polar cap'
     496      write(*,*) 'ptot         : change total pressure'
     497      write(*,*) 'therm_ini_s  : set soil thermal inertia to reference
     498     $ surface values'
     499      write(*,*) 'subsoilice_n : put deep underground ice layer in
     500     $ northern hemisphere'
     501      write(*,*) 'subsoilice_s : put deep underground ice layer in
     502     $ southern hemisphere'
     503      write(*,*) 'mons_ice     : put underground ice layer according
     504     $ to MONS derived data'
    508505
    509506        write(*,*)
     
    834831c       -----------------------------------------------
    835832        else if (trim(modif) .eq. 'ini_q') then
     833          flagh2o    = 1
     834          flagthermo = 0
     835          yes=' '
    836836c         For more than 32 layers, possible to initiate thermosphere only     
    837           thermo=0
    838           yes=' '
    839837          if (llm.gt.32) then
    840838            do while ((yes.ne.'y').and.(yes.ne.'n'))
     
    843841            read(*,fmt='(a)') yes
    844842            if (yes.eq.'y') then
    845             thermo=1
     843            flagthermo=1
    846844            else
    847             thermo=0
     845            flagthermo=0
    848846            endif
    849847            enddo 
    850848          endif
    851849         
    852               call inichim_newstart(q,ps,sig,nqmx,latfi,lonfi,airefi,
    853      $   thermo,qsurf)
    854           write(*,*) 'Chemical species initialized'
    855 
    856         if (thermo.eq.0) then
    857 c          mise a 0 des qsurf (traceurs a la surface)
    858            DO iq =1, nqmx
    859              DO ig=1,ngridmx
    860                  qsurf(ig,iq)=0.
    861              ENDDO
    862            ENDDO
    863         endif   
    864 
    865 c       ini_q-H2O : as above exept for the water vapour tracer
     850          call inichim_newstart(q, qsurf, ps, flagh2o, flagthermo)
     851          write(*,*) 'inichim_newstart: chemical species and
     852     $ water vapour initialised'
     853
     854
     855c       ini_q-h2o : as above exept for the water vapour tracer
    866856c       ------------------------------------------------------
    867         else if (trim(modif) .eq. 'ini_q-H2O') then
     857        else if (trim(modif) .eq. 'ini_q-h2o') then
     858          flagh2o    = 0
     859          flagthermo = 0
     860          yes=' '
    868861          ! for more than 32 layers, possible to initiate thermosphere only     
    869           thermo=0
    870           yes=' '
    871862          if(llm.gt.32) then
    872863            do while ((yes.ne.'y').and.(yes.ne.'n'))
     
    875866            read(*,fmt='(a)') yes
    876867            if (yes.eq.'y') then
    877             thermo=1
     868            flagthermo=1
    878869            else
    879             thermo=0
     870            flagthermo=0
    880871            endif
    881872            enddo
    882873          endif
    883               call inichim_newstart(q,ps,sig,nqmx-1,latfi,lonfi,airefi,
    884      $   thermo,qsurf)
    885           write(*,*) 'Initialized chem. species exept last (H2O)'
    886 
    887         if (thermo.eq.0) then
    888 c          set surface tracers to zero, except water ice
    889            DO iq =1, nqmx
    890             if (iq.ne.igcm_h2o_ice) then
    891              DO ig=1,ngridmx
    892                  qsurf(ig,iq)=0.
    893              ENDDO
    894             endif
    895            ENDDO
    896         endif
    897 
    898 c       ini_q-iceH2O : as above exept for ice et H2O
    899 c       -----------------------------------------------
    900         else if (trim(modif) .eq. 'ini_q-iceH2O') then
    901 c         For more than 32 layers, possible to initiate thermosphere only     
    902           thermo=0
    903           yes=' '
    904           if(llm.gt.32) then
    905             do while ((yes.ne.'y').and.(yes.ne.'n'))
    906             write(*,*)'',
    907      &      'initialisation for thermosphere only? (y/n)'
    908             read(*,fmt='(a)') yes
    909             if (yes.eq.'y') then
    910             thermo=1
    911             else
    912             thermo=0
    913             endif
    914             enddo
    915           endif
    916      
    917          call inichim_newstart(q,ps,sig,nqmx-2,latfi,lonfi,airefi,
    918      $   thermo,qsurf)
    919           write(*,*) 'Initialized chem. species exept ice and H2O'
    920 
    921         if (thermo.eq.0) then
    922 c          set surface tracers to zero, except water ice
    923            DO iq =1, nqmx
    924             if (iq.ne.igcm_h2o_ice) then
    925              DO ig=1,ngridmx
    926                  qsurf(ig,iq)=0.
    927              ENDDO
    928             endif
    929            ENDDO
    930         endif
     874          call inichim_newstart(q, qsurf, ps, flagh2o, flagthermo)
     875          write(*,*) 'inichim_newstart: chemical species initialised
     876     $ (except water vapour)'
     877
    931878
    932879c      wetstart : wet atmosphere with a north to south gradient
Note: See TracChangeset for help on using the changeset viewer.