Changeset 1891


Ignore:
Timestamp:
Jan 10, 2018, 3:46:51 PM (7 years ago)
Author:
jvatant
Message:

Follow-up of r1890 - actually found a a cleaner way
to manage the chem. fields, it's useless to call them
by their name ...
--JVO

Location:
trunk/LMDZ.TITAN
Files:
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.TITAN/README

    r1890 r1891  
    13431343Big modifs of the tracer gestion/init in the physiq with a new query by names (see tracer_h )
    13441344
    1345 == 20/12/2017 - ... : r1871-86-89-90 ... == JVO
     1345== 20/12/2017 - ... : r1871-86-87-91 ... == JVO
    13461346Management of the chemistry within startfi. Open the way to :
    13471347 1) run with chemistry in another resolution than 32x48 !
     
    13521352rather than read in the middle of calchim as before from compo files
    13531353+ An "upper_chemistry_layers" dimension is now handled in startfi files
    1354 + Added a comchem_h.F90 module for all the stuff related to chemistry in the GCM
    1355 and specific comchem_***_h.F90 for the chemistry management in newstart and
    1356 start2archive for more convenience
     1354+ Added a comchem_h.F90 module for all the stuff related to chemistry in the GCM and
     1355 specific comchem_newstart_h.F90 for the chemistry management in newstart
    13571356+ In newstart we calculate the pressure grid above GCM top using Vervack profile
    13581357with the introduction of gr_kim_vervack.F90 routine
  • trunk/LMDZ.TITAN/libf/dynphy_lonlat/phytitan/comchem_newstart_h.F90

    r1890 r1891  
    77IMPLICIT NONE 
    88 
    9 
    10   ! Variable and allocatables for vertical regriding chemistry in newstart
     9  ! Variable and allocatables for regriding chemistry pressure in newstart
    1110  ! ----------------------------------------------------------------------
    1211   
    1312  INTEGER :: nlaykimold ! Number of upper atm. layers for chemistry in the start_archive file
    1413  REAL, ALLOCATABLE, DIMENSION(:) :: preskimold ! Pressure grid of upper chemistry in the start_archive file
     14   
     15  ! Allocatable arrays for newstart fields
     16  ! --------------------------------------
     17 
     18  ! Nouvelle grille physique, ancienne grille verticale
     19  REAL,ALLOCATABLE :: oldykim_up(:,:) 
    1520
     21  ! Nouvelle grille scalaire, ancienne grille verticale 
     22  REAL,ALLOCATABLE :: ykim_upS(:,:,:) 
    1623
     24  ! Ancienne grille scalaire, ancienne grille verticale 
     25  REAL,ALLOCATABLE :: ykim_upoldS(:,:,:) 
     26
     27 
    1728END MODULE comchem_newstart_h
  • trunk/LMDZ.TITAN/libf/dynphy_lonlat/phytitan/lect_start_archive.F

    r1890 r1891  
    55
    66!      USE surfdat_h
    7       USE comchem_newstart_h, ONLY: nlaykimold, preskimold
     7      USE comchem_newstart_h
    88      USE comsoil_h, ONLY: nsoilmx, layer, mlayer, volcapa, inertiedat
    99      USE infotrac, ONLY: tname, nqtot
     
    257257      ierr= NF_INQ_DIMLEN(nid,dimid,nlaykimold)
    258258
    259       ! NB : The regriding, if needed cannot be done here since the new
     259      ! NB : The vertical regriding, if needed cannot be done here since the new
    260260      ! pressure grid is only computed at the end of newstart
     261      ! Here we will just do the horizontal interpolation on scalar grid.
    261262
    262263! 1.3 Report dimensions
     
    306307     
    307308      allocate(preskimold(nlaykimold))
     309      allocate(ykim_upS(44,iip1,jjp1))
     310      allocate(ykim_upoldS(44,imold+1,jmold+1))
    308311
    309312      allocate(var (imold+1,jmold+1,llm))
  • trunk/LMDZ.TITAN/libf/dynphy_lonlat/phytitan/newstart.F

    r1890 r1891  
    1717     &                              is_master
    1818      use infotrac, only: infotrac_init, nqtot, tname
    19       USE comchem_h, ONLY: nlaykim_up
    20       USE comchem_newstart_h, ONLY: nlaykimold
     19      USE comchem_h, ONLY: nlaykim_up, ykim_up
     20      USE comchem_newstart_h
    2121      USE comsoil_h, ONLY: nsoilmx, layer, mlayer, inertiedat
    2222      USE surfdat_h, ONLY: phisfi, albedodat,
     
    165165
    166166!     added by JVO for Titan
    167       REAL tankCH4(ngridmx)
     167      REAL tankCH4(ngridmx)     
    168168
    169169c sortie visu pour les champs dynamiques
  • trunk/LMDZ.TITAN/libf/dynphy_lonlat/phytitan/start2archive.F

    r1890 r1891  
    2121      use infotrac, only: infotrac_init, nqtot, tname
    2222      USE comsoil_h
    23      
    2423      USE comchem_h, only : nlaykim_up, preskim
    25       USE comchem_startarch_h
    26 
    2724!      USE comgeomfi_h, ONLY: lati, long, area
    2825!      use control_mod
     
    8784      REAL tankCH4(ngridmx) ! Depth of surface methane tank
    8885     
    89       ! + Titan upper atm. chemistry 44 fields in comchem_h
     86      REAL,ALLOCATABLE :: ykim_up(:,:,:)  ! Upper chemistry fields
    9087
    9188c Variable naturelle / grille scalaire
     
    10299      REAL tankCH4S(ip1jmp1)  ! Depth of surface methane tank
    103100
    104       ! + Titan upper atm. chemistry 44 fields in comchem_h
     101      REAL,ALLOCATABLE :: ykim_upS(:,:,:)  ! Upper chemistry fields
    105102 
    106103c Variables intermediaires : vent naturel, mais pas coord scalaire
     
    234231        PRINT*,"start2archive: I found a field for upper chemistry ...
    235232     . I presume they're all here as you can't do uncomplete chemistry!"
    236         ! Allocates upper chemistry fields in comchem_h on physical and scalar grid
    237         CALL alloc_kim_start2archive(ngridmx,ip1jmp1)
     233     
     234        ALLOCATE(ykim_up(44,ngridmx,nlaykim_up))
     235        ALLOCATE(ykim_upS(44,ip1jmp1,nlaykim_up))
     236       
    238237        kim=.TRUE.
    239238      ENDIF
     
    388387      call gr_fi_dyn(1,ngridmx,iip1,jjp1,tankCH4,tankCH4S)
    389388
    390       IF (kim) THEN ! NB : fields are in comchem_h
    391          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,H,H_S)
    392          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,H2,H2_S)
    393          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,CH,CH_S)
    394          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,CH2s,CH2s_S)
    395          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,CH2,CH2_S)
    396          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,CH3,CH3_S)
    397          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,CH4,CH4_S)
    398          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C2,C2_S)
    399          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C2H,C2H_S)
    400          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C2H2,C2H2_S)
    401          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C2H3,C2H3_S)
    402          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C2H4,C2H4_S)
    403          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C2H5,C2H5_S)
    404          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C2H6,C2H6_S)
    405          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C3H3,C3H3_S)
    406          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C3H5,C3H5_S)
    407          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C3H6,C3H6_S)
    408          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C3H7,C3H7_S)
    409          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C4H,C4H_S)
    410          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C4H3,C4H3_S)
    411          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C4H4,C4H4_S)
    412          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C4H2s,C4H2s_S)
    413          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,CH2CCH2,CH2CCH2_S)
    414          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,CH3CCH,CH3CCH_S)
    415          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C3H8,C3H8_S)
    416          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C4H2,C4H2_S)
    417          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C4H6,C4H6_S)
    418          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C4H10,C4H10_S)
    419          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,AC6H6,AC6H6_S)
    420          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C3H2,C3H2_S)
    421          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C4H5,C4H5_S)
    422          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,AC6H5,AC6H5_S)
    423          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,N2,N2_S)
    424          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,N4S,N4S_S)
    425          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,CN,CN_S)
    426          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,HCN,HCN_S)
    427          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,H2CN,H2CN_S)
    428          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,CHCN,CHCN_S)
    429          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,CH2CN,CH2CN_S)
    430          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,CH3CN,CH3CN_S)
    431          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C3N,C3N_S)
    432          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,HC3N,HC3N_S)
    433          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,NCCN,NCCN_S)
    434          call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,C4N2,C4N2_S)
     389      IF (kim) THEN ! NB : fields are in comchem_startarch_h
     390         DO i=1,44
     391           call gr_fi_dyn(nlaykim_up,ngridmx,iip1,jjp1,ykim_up(i,:,:),
     392     &                                                 ykim_upS(i,:,:))
     393         ENDDO
    435394      ENDIF
    436395
     
    580539c-----------------------------------------------------------------
    581540c Ecriture des champs upper_chemistry
     541c NB : We assume a given order of the 44 chemistry tracers !!
     542c ( H=1, H2=2 ..., C4N2=44)
    582543c-----------------------------------------------------------------
    583544
    584545      IF (kim) THEN
    585546         call write_archive(nid,ntime,'H_up',
    586      .              'H in upper atmosphere','kg/kg',4,H_S)
     547     .         'H in upper atmosphere','kg/kg',4,ykim_upS(1,:,:))
    587548         call write_archive(nid,ntime,'H2_up',
    588      .              'H2 in upper atmosphere','kg/kg',4,H2_S)
     549     .         'H2 in upper atmosphere','kg/kg',4,ykim_upS(2,:,:))
    589550         call write_archive(nid,ntime,'CH_up',
    590      .              'CH in upper atmosphere','kg/kg',4,CH_S)
     551     .         'CH in upper atmosphere','kg/kg',4,ykim_upS(3,:,:))
    591552         call write_archive(nid,ntime,'CH2s_up',
    592      .              'CH2s in upper atmosphere','kg/kg',4,CH2s_S)
     553     .         'CH2s in upper atmosphere','kg/kg',4,ykim_upS(4,:,:))
    593554         call write_archive(nid,ntime,'CH2_up',
    594      .              'CH2 in upper atmosphere','kg/kg',4,CH2_S)
     555     .         'CH2 in upper atmosphere','kg/kg',4,ykim_upS(5,:,:))
    595556         call write_archive(nid,ntime,'CH3_up',
    596      .              'CH3 in upper atmosphere','kg/kg',4,CH3_S)
     557     .         'CH3 in upper atmosphere','kg/kg',4,ykim_upS(6,:,:))
    597558         call write_archive(nid,ntime,'CH4_up',
    598      .              'CH4 in upper atmosphere','kg/kg',4,CH4_S)
     559     .         'CH4 in upper atmosphere','kg/kg',4,ykim_upS(7,:,:))
    599560         call write_archive(nid,ntime,'C2_up',
    600      .              'C2 in upper atmosphere','kg/kg',4,C2_S)
     561     .         'C2 in upper atmosphere','kg/kg',4,ykim_upS(8,:,:))
    601562         call write_archive(nid,ntime,'C2H_up',
    602      .              'C2H in upper atmosphere','kg/kg',4,C2H_S)
     563     .         'C2H in upper atmosphere','kg/kg',4,ykim_upS(9,:,:))
    603564         call write_archive(nid,ntime,'C2H2_up',
    604      .              'C2H2 in upper atmosphere','kg/kg',4,C2H2_S)
     565     .         'C2H2 in upper atmosphere','kg/kg',4,ykim_upS(10,:,:))
    605566         call write_archive(nid,ntime,'C2H3_up',
    606      .              'C2H3 in upper atmosphere','kg/kg',4,C2H3_S)
     567     .         'C2H3 in upper atmosphere','kg/kg',4,ykim_upS(11,:,:))
    607568         call write_archive(nid,ntime,'C2H4_up',
    608      .              'C2H4 in upper atmosphere','kg/kg',4,C2H4_S)
     569     .         'C2H4 in upper atmosphere','kg/kg',4,ykim_upS(12,:,:))
    609570         call write_archive(nid,ntime,'C2H5_up',
    610      .              'C2H5 in upper atmosphere','kg/kg',4,C2H5_S)
     571     .         'C2H5 in upper atmosphere','kg/kg',4,ykim_upS(13,:,:))
    611572         call write_archive(nid,ntime,'C2H6_up',
    612      .              'C2H6 in upper atmosphere','kg/kg',4,C2H6_S)
     573     .         'C2H6 in upper atmosphere','kg/kg',4,ykim_upS(14,:,:))
    613574         call write_archive(nid,ntime,'C3H3_up',
    614      .              'C3H3 in upper atmosphere','kg/kg',4,C3H3_S)
     575     .         'C3H3 in upper atmosphere','kg/kg',4,ykim_upS(15,:,:))
    615576         call write_archive(nid,ntime,'C3H5_up',
    616      .              'C3H5 in upper atmosphere','kg/kg',4,C3H5_S)
     577     .         'C3H5 in upper atmosphere','kg/kg',4,ykim_upS(16,:,:))
    617578         call write_archive(nid,ntime,'C3H6_up',
    618      .              'C3H6 in upper atmosphere','kg/kg',4,C3H6_S)
     579     .         'C3H6 in upper atmosphere','kg/kg',4,ykim_upS(17,:,:))
    619580         call write_archive(nid,ntime,'C3H7_up',
    620      .              'C3H7 in upper atmosphere','kg/kg',4,C3H7_S)
     581     .         'C3H7 in upper atmosphere','kg/kg',4,ykim_upS(18,:,:))
    621582         call write_archive(nid,ntime,'C4H_up',
    622      .              'C4H in upper atmosphere','kg/kg',4,C4H_S)
     583     .         'C4H in upper atmosphere','kg/kg',4,ykim_upS(19,:,:))
    623584         call write_archive(nid,ntime,'C4H3_up',
    624      .              'C4H3 in upper atmosphere','kg/kg',4,C4H3_S)
     585     .         'C4H3 in upper atmosphere','kg/kg',4,ykim_upS(20,:,:))
    625586         call write_archive(nid,ntime,'C4H4_up',
    626      .              'C4H4 in upper atmosphere','kg/kg',4,C4H4_S)
     587     .         'C4H4 in upper atmosphere','kg/kg',4,ykim_upS(21,:,:))
    627588         call write_archive(nid,ntime,'C4H2s_up',
    628      .              'C4H2s in upper atmosphere','kg/kg',4,C4H2s_S)
     589     .         'C4H2s in upper atmosphere','kg/kg',4,ykim_upS(22,:,:))
    629590         call write_archive(nid,ntime,'CH2CCH2_up',
    630      .              'CH2CCH2 in upper atmosphere','kg/kg',4,CH2CCH2_S)
     591     .         'CH2CCH2 in upper atmosphere','kg/kg',4,ykim_upS(23,:,:))
    631592         call write_archive(nid,ntime,'CH3CCH_up',
    632      .              'CH3CCH in upper atmosphere','kg/kg',4,CH3CCH_S)
     593     .         'CH3CCH in upper atmosphere','kg/kg',4,ykim_upS(24,:,:))
    633594         call write_archive(nid,ntime,'C3H8_up',
    634      .              'C3H8 in upper atmosphere','kg/kg',4,C3H8_S)
     595     .         'C3H8 in upper atmosphere','kg/kg',4,ykim_upS(25,:,:))
    635596         call write_archive(nid,ntime,'C4H2_up',
    636      .              'C4H2 in upper atmosphere','kg/kg',4,C4H2_S)
     597     .         'C4H2 in upper atmosphere','kg/kg',4,ykim_upS(26,:,:))
    637598         call write_archive(nid,ntime,'C4H6_up',
    638      .              'C4H6 in upper atmosphere','kg/kg',4,C4H6_S)
     599     .         'C4H6 in upper atmosphere','kg/kg',4,ykim_upS(27,:,:))
    639600         call write_archive(nid,ntime,'C4H10_up',
    640      .              'C4H10 in upper atmosphere','kg/kg',4,C4H10_S)
     601     .         'C4H10 in upper atmosphere','kg/kg',4,ykim_upS(28,:,:))
    641602         call write_archive(nid,ntime,'AC6H6_up',
    642      .              'AC6H6 in upper atmosphere','kg/kg',4,AC6H6_S)
     603     .         'AC6H6 in upper atmosphere','kg/kg',4,ykim_upS(29,:,:))
    643604         call write_archive(nid,ntime,'C3H2_up',
    644      .              'C3H2 in upper atmosphere','kg/kg',4,C3H2_S)
     605     .         'C3H2 in upper atmosphere','kg/kg',4,ykim_upS(30,:,:))
    645606         call write_archive(nid,ntime,'C4H5_up',
    646      .              'C4H5 in upper atmosphere','kg/kg',4,C4H5_S)
     607     .         'C4H5 in upper atmosphere','kg/kg',4,ykim_upS(31,:,:))
    647608         call write_archive(nid,ntime,'AC6H5_up',
    648      .              'AC6H5 in upper atmosphere','kg/kg',4,AC6H5_S)
     609     .         'AC6H5 in upper atmosphere','kg/kg',4,ykim_upS(32,:,:))
    649610         call write_archive(nid,ntime,'N2_up',
    650      .              'N2 in upper atmosphere','kg/kg',4,N2_S)
     611     .         'N2 in upper atmosphere','kg/kg',4,ykim_upS(33,:,:))
    651612         call write_archive(nid,ntime,'N4S_up',
    652      .              'N4S in upper atmosphere','kg/kg',4,N4S_S)
     613     .         'N4S in upper atmosphere','kg/kg',4,ykim_upS(34,:,:))
    653614         call write_archive(nid,ntime,'CN_up',
    654      .              'CN in upper atmosphere','kg/kg',4,CN_S)
     615     .         'CN in upper atmosphere','kg/kg',4,ykim_upS(35,:,:))
    655616         call write_archive(nid,ntime,'HCN_up',
    656      .              'HCN in upper atmosphere','kg/kg',4,HCN_S)
     617     .         'HCN in upper atmosphere','kg/kg',4,ykim_upS(36,:,:))
    657618         call write_archive(nid,ntime,'H2CN_up',
    658      .              'H2CN in upper atmosphere','kg/kg',4,H2CN_S)
     619     .         'H2CN in upper atmosphere','kg/kg',4,ykim_upS(37,:,:))
    659620         call write_archive(nid,ntime,'CHCN_up',
    660      .              'CHCN in upper atmosphere','kg/kg',4,CHCN_S)
     621     .         'CHCN in upper atmosphere','kg/kg',4,ykim_upS(38,:,:))
    661622         call write_archive(nid,ntime,'CH2CN_up',
    662      .              'CH2CN in upper atmosphere','kg/kg',4,CH2CN_S)
     623     .         'CH2CN in upper atmosphere','kg/kg',4,ykim_upS(39,:,:))
    663624         call write_archive(nid,ntime,'CH3CN_up',
    664      .              'CH3CN in upper atmosphere','kg/kg',4,CH3CN_S)
     625     .         'CH3CN in upper atmosphere','kg/kg',4,ykim_upS(40,:,:))
    665626         call write_archive(nid,ntime,'C3N_up',
    666      .              'C3N in upper atmosphere','kg/kg',4,C3N_S)
     627     .         'C3N in upper atmosphere','kg/kg',4,ykim_upS(41,:,:))
    667628         call write_archive(nid,ntime,'HC3N_up',
    668      .              'HC3N in upper atmosphere','kg/kg',4,HC3N_S)
     629     .         'HC3N in upper atmosphere','kg/kg',4,ykim_upS(42,:,:))
    669630         call write_archive(nid,ntime,'NCCN_up',
    670      .              'NCCN in upper atmosphere','kg/kg',4,NCCN_S)
     631     .         'NCCN in upper atmosphere','kg/kg',4,ykim_upS(43,:,:))
    671632         call write_archive(nid,ntime,'C4N2_up',
    672      .              'C4N2 in upper atmosphere','kg/kg',4,C4N2_S)
     633     .         'C4N2 in upper atmosphere','kg/kg',4,ykim_upS(44,:,:))
    673634      ENDIF
    674635
  • trunk/LMDZ.TITAN/libf/phytitan/comchem_h.F90

    r1890 r1891  
    22
    33! Stores data relative to upper chemistry in the GCM
    4 ! For the newstart and satrt2archive, there are specific comchem_***_h modules.
     4! For newstart there is a specific comchem_newstart_h module.
    55
    66! Author : Jan Vatant d'Ollone (2017)
     
    2020!$OMP_THREADPRIVATE(zlay_kim)
    2121
     22   REAL,SAVE,ALLOCATABLE,DIMENSION(:,:,:) :: ykim_up ! Upper chemistry fields (kg/kg)
     23!$OMP_THREADPRIVATE(ykim_up)
    2224
    2325END MODULE comchem_h
Note: See TracChangeset for help on using the changeset viewer.