Ignore:
Timestamp:
Jan 9, 2018, 12:26:53 PM (7 years ago)
Author:
jvatant
Message:

Making chemistry handling more flexible - Step 2
+ Added the calculation of the pressure grid in newstart
using Vervack profile in gr_kim_vervack routine
+ Next step : regridding !
--JVO

Location:
trunk/LMDZ.TITAN/libf/dynphy_lonlat/phytitan
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.TITAN/libf/dynphy_lonlat/phytitan/lect_start_archive.F

    r1647 r1889  
    55
    66!      USE surfdat_h
     7      USE comchem_h, ONLY: nlaykimold, preskimold
    78      USE comsoil_h, ONLY: nsoilmx, layer, mlayer, volcapa, inertiedat
    89      USE infotrac, ONLY: tname, nqtot
     
    4647c------------------------------------
    4748      INTEGER   imold,jmold,lmold,nsoilold,nqold
    48 
    4949
    5050c Variables pour les lectures des fichiers "ini"
     
    147147      real, dimension(:,:), allocatable :: emisold
    148148      real, dimension(:,:,:,:), allocatable :: qold
    149 
     149     
    150150      real tab_cntrl(100)
    151151
     
    158158      logical :: therminertia_3D=.true. ! flag
    159159! therminertia_3D=.true. if thermal inertia is 3D and read from datafile
     160
    160161c Variable intermediaires iutilise pour l'extrapolation verticale
    161162c----------------------------------------------------------------
     
    247248      endif
    248249
    249 
    250250      if (nsoilold.ne.nsoilmx) then ! interpolation will be required
    251251        depthinterpol=.true.
    252252      endif
     253
     254! 1.2.2 find out the # of upper chemistry layers
     255
     256      ierr= NF_INQ_DIMID(nid,"upper_chemistry_layers",dimid)
     257      ierr= NF_INQ_DIMLEN(nid,dimid,nlaykimold)
     258
     259      ! NB : The regriding, if needed cannot be done here since the new
     260      ! pressure grid is only computed at the end of newstart
    253261
    254262! 1.3 Report dimensions
     
    266274      write(*,*) '  Otherwise, set nsoilmx -in dimphys.h- to: ',nsoilold
    267275      endif
     276      write(*,*) "upper_chemistry_layers: ",nlaykimold
    268277      write(*,*) "time lenght: ",timelen
    269278      write(*,*)
     
    295304      allocate(mlayerold(nsoilold))
    296305      allocate(qsurfold(imold+1,jmold+1,nqtot))
     306     
     307      allocate(preskimold(nlaykimold))
    297308
    298309      allocate(var (imold+1,jmold+1,llm))
     
    512523       endif
    513524      endif
    514 
    515 c-----------------------------------------------------------------------
    516 c 3.6 Lecture geopotentiel au sol
     525     
     526c-----------------------------------------------------------------------
     527c 3.6 Read upper chemistry mid-layer pressure
     528c----------------------------------------------------------------------- 
     529   
     530      ierr=NF_INQ_VARID(nid,"preskim",nvarid)
     531      IF (ierr .NE. NF_NOERR) THEN
     532         PRINT*, "lect_start_archive: Le champ <preskim> est absent"
     533         CALL abort
     534      ENDIF
     535#ifdef NC_DOUBLE
     536      ierr = NF_GET_VAR_DOUBLE(nid, nvarid, preskimold)
     537#else
     538      ierr = NF_GET_VAR_REAL(nid, nvarid, preskimold)
     539#endif
     540      IF (ierr .NE. NF_NOERR) THEN
     541         PRINT*, "lect_start_archive: Lecture echouee pour <preskim>"
     542         CALL abort
     543      ENDIF
     544
     545c-----------------------------------------------------------------------
     546c 3.7 Lecture geopotentiel au sol
    517547c-----------------------------------------------------------------------
    518548c
  • trunk/LMDZ.TITAN/libf/dynphy_lonlat/phytitan/newstart.F

    r1871 r1889  
    1717     &                              is_master
    1818      use infotrac, only: infotrac_init, nqtot, tname
     19      USE comchem_h, ONLY: nlaykim_up, nlaykimold
    1920      USE comsoil_h, ONLY: nsoilmx, layer, mlayer, inertiedat
    2021      USE surfdat_h, ONLY: phisfi, albedodat,
     
    130131      real tab_cntrl(100)
    131132      real tab_cntrl_bis(100)
    132 
     133     
    133134c variables diverses
    134135c-------------------
     
    258259
    259260      endif
    260 
    261261
    262262c=======================================================================
     
    536536        CALL lect_start_archive(ngridmx,llm,
    537537     &   date,tsurf,tsoil,emis,q2,
    538      &   t,ucov,vcov,ps,teta,phisold_newgrid,q,qsurf,
    539      &   surfith,nid)
     538     &   t,ucov,vcov,ps,teta,phisold_newgrid,
     539     &   q,qsurf,surfith,nid)
    540540        write(*,*) "OK, read start_archive file"
    541541        ! copy soil thermal inertia
     
    572572      write(*,*) 'q=x : give a specific uniform value to one tracer'
    573573      write(*,*) 'q=profile    : specify a profile for a tracer'
    574 !      write(*,*) 'ini_q : tracers initialisation for chemistry, water an
    575 !     $d ice   '
    576 !      write(*,*) 'ini_q-H2O : tracers initialisation for chemistry and
    577 !     $ice '
    578 !      write(*,*) 'ini_q-iceH2O : tracers initialisation for chemistry on
    579 !     $ly '
    580574      write(*,*) 'isotherm  : Isothermal Temperatures, wind set to zero'
    581575      write(*,*) 'radequi   : Earth-like radiative equilibrium temperature
     
    10711065      CALL inifilr
    10721066      CALL pression(ip1jmp1, ap, bp, ps, p3d)
     1067     
     1068
     1069c=========================================================================
     1070c  Calcul de la dimension verticale pour la chimie  - JVO 2017
     1071c  start_archive seulement, la grille verticale pouvant avoir ete modifiee
     1072c==========================================================================
     1073
     1074      IF (choix_1.eq.0) THEN
     1075
     1076        ! Calculate the # of upper chemistry layers with the "new" pressure grid
     1077        ! For this we use Vervack profile for upper atmosphere with dz=10km
     1078
     1079        CALL gr_kim_vervack
     1080
     1081        WRITE(*,*)
     1082        WRITE(*,*) " With the compiled vertical grid we found :"
     1083        WRITE(*,*) " Number of upper chemistry layers =", nlaykim_up
     1084       
     1085        ! Regriding is then done, if needed
     1086       
     1087        IF (nlaykimold.ne.nlaykim_up) THEN
     1088
     1089          WRITE(*,*) " Warning, nlaykimold=", nlaykimold
     1090          WRITE(*,*) ' which implies that a regriding on upper chemistry
     1091     & will be performed.'
     1092          WRITE(*,*)
     1093         
     1094!          CALL  regrid_kim
     1095         
     1096        ENDIF
     1097 
     1098      endif ! of if (choix_1.eq.0)     
     1099 
    10731100
    10741101c-----------------------------------------------------------------------
     
    11251152         day_ini=int(date)
    11261153      endif
     1154
    11271155c
    11281156      CALL geopot  ( ip1jmp1, teta  , pk , pks,  phis  , phi   )
Note: See TracChangeset for help on using the changeset viewer.