Changeset 1890 for trunk/LMDZ.TITAN/libf


Ignore:
Timestamp:
Jan 10, 2018, 12:25:01 PM (7 years ago)
Author:
jvatant
Message:

Making chemistry handling more flexible - step 2.5
+ For more convenience I introduce specific modules
for chemistry stuff specific to start2archive and newstart
and not to pollute main module comchem_h.
--JVO

Location:
trunk/LMDZ.TITAN/libf
Files:
2 added
4 edited

Legend:

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

    r1889 r1890  
    55
    66!      USE surfdat_h
    7       USE comchem_h, ONLY: nlaykimold, preskimold
     7      USE comchem_newstart_h, ONLY: nlaykimold, preskimold
    88      USE comsoil_h, ONLY: nsoilmx, layer, mlayer, volcapa, inertiedat
    99      USE infotrac, ONLY: tname, nqtot
  • trunk/LMDZ.TITAN/libf/dynphy_lonlat/phytitan/newstart.F

    r1889 r1890  
    1717     &                              is_master
    1818      use infotrac, only: infotrac_init, nqtot, tname
    19       USE comchem_h, ONLY: nlaykim_up, nlaykimold
     19      USE comchem_h, ONLY: nlaykim_up
     20      USE comchem_newstart_h, ONLY: nlaykimold
    2021      USE comsoil_h, ONLY: nsoilmx, layer, mlayer, inertiedat
    2122      USE surfdat_h, ONLY: phisfi, albedodat,
     
    3536      USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0
    3637      use tabfi_mod, only: tabfi
     38      use callkeys_mod, only: callchim
    3739      use iniphysiq_mod, only: iniphysiq
    3840      use phyetat0_mod, only: phyetat0
     
    10851087        ! Regriding is then done, if needed
    10861088       
    1087         IF (nlaykimold.ne.nlaykim_up) THEN
     1089        IF (callchim .and. nlaykimold.ne.nlaykim_up) THEN
    10881090
    10891091          WRITE(*,*) " Warning, nlaykimold=", nlaykimold
    10901092          WRITE(*,*) ' which implies that a regriding on upper chemistry
    1091      & will be performed.'
     1093     & fields will be performed.'
    10921094          WRITE(*,*)
    10931095         
    1094 !          CALL  regrid_kim
     1096!          CALL regrid_kim(ngridmx)
    10951097         
    10961098        ENDIF
  • trunk/LMDZ.TITAN/libf/dynphy_lonlat/phytitan/start2archive.F

    r1887 r1890  
    2121      use infotrac, only: infotrac_init, nqtot, tname
    2222      USE comsoil_h
    23       USE comchem_h
     23     
     24      USE comchem_h, only : nlaykim_up, preskim
     25      USE comchem_startarch_h
    2426
    2527!      USE comgeomfi_h, ONLY: lati, long, area
     
    233235     . I presume they're all here as you can't do uncomplete chemistry!"
    234236        ! Allocates upper chemistry fields in comchem_h on physical and scalar grid
    235         CALL allokim_start2archive(ngridmx,ip1jmp1)
     237        CALL alloc_kim_start2archive(ngridmx,ip1jmp1)
    236238        kim=.TRUE.
    237239      ENDIF
  • trunk/LMDZ.TITAN/libf/phytitan/comchem_h.F90

    r1889 r1890  
    11MODULE comchem_h
    22
    3 ! Stores data relative to chemistry and routines for chemistry management in startfiles
     3! Stores data relative to upper chemistry in the GCM
     4! For the newstart and satrt2archive, there are specific comchem_***_h modules.
    45
    56! Author : Jan Vatant d'Ollone (2017)
     
    1112!$OMP_THREADPRIVATE(nlaykim_up,nlay_kim_tot)
    1213
    13 ! NB : For the startfile we use nlaykim_up grid (upper atm) and for outputs we use nlaykim_tot grid (all layers)
     14  ! NB : For the startfile we use nlaykim_up grid (upper atm) and for outputs we use nlaykim_tot grid (all layers)
    1415
    1516   REAL,SAVE,ALLOCATABLE,DIMENSION(:) :: preskim  ! Pressure (Pa) of upper chemistry (mid)-layers
     
    2021
    2122
    22   ! Variable and allocatables for regriding chemistry newstart
    23   ! ----------------------------------------------------------
    24    
    25   INTEGER :: nlaykimold ! Number of upper atm. layers for chemistry in the start_archive file
    26   REAL, ALLOCATABLE, DIMENSION(:) :: preskimold ! Pressure grid of upper chemistry in the start_archive file
    27 
    28   ! Allocatable arrays for start2archive
    29   ! ------------------------------------
    30  
    31   ! 1. Grille physique
    32   REAL,ALLOCATABLE :: H(:,:) 
    33   REAL,ALLOCATABLE :: H2(:,:) 
    34   REAL,ALLOCATABLE :: CH(:,:) 
    35   REAL,ALLOCATABLE :: CH2s(:,:) 
    36   REAL,ALLOCATABLE :: CH2(:,:) 
    37   REAL,ALLOCATABLE :: CH3(:,:) 
    38   REAL,ALLOCATABLE :: CH4(:,:) 
    39   REAL,ALLOCATABLE :: C2(:,:) 
    40   REAL,ALLOCATABLE :: C2H(:,:) 
    41   REAL,ALLOCATABLE :: C2H2(:,:) 
    42   REAL,ALLOCATABLE :: C2H3(:,:) 
    43   REAL,ALLOCATABLE :: C2H4(:,:) 
    44   REAL,ALLOCATABLE :: C2H5(:,:) 
    45   REAL,ALLOCATABLE :: C2H6(:,:) 
    46   REAL,ALLOCATABLE :: C3H3(:,:) 
    47   REAL,ALLOCATABLE :: C3H5(:,:) 
    48   REAL,ALLOCATABLE :: C3H6(:,:) 
    49   REAL,ALLOCATABLE :: C3H7(:,:) 
    50   REAL,ALLOCATABLE :: C4H(:,:) 
    51   REAL,ALLOCATABLE :: C4H3(:,:) 
    52   REAL,ALLOCATABLE :: C4H4(:,:) 
    53   REAL,ALLOCATABLE :: C4H2s(:,:) 
    54   REAL,ALLOCATABLE :: CH2CCH2(:,:) 
    55   REAL,ALLOCATABLE :: CH3CCH(:,:) 
    56   REAL,ALLOCATABLE :: C3H8(:,:) 
    57   REAL,ALLOCATABLE :: C4H2(:,:) 
    58   REAL,ALLOCATABLE :: C4H6(:,:) 
    59   REAL,ALLOCATABLE :: C4H10(:,:) 
    60   REAL,ALLOCATABLE :: AC6H6(:,:) 
    61   REAL,ALLOCATABLE :: C3H2(:,:) 
    62   REAL,ALLOCATABLE :: C4H5(:,:) 
    63   REAL,ALLOCATABLE :: AC6H5(:,:) 
    64   REAL,ALLOCATABLE :: N2(:,:) 
    65   REAL,ALLOCATABLE :: N4S(:,:) 
    66   REAL,ALLOCATABLE :: CN(:,:) 
    67   REAL,ALLOCATABLE :: HCN(:,:) 
    68   REAL,ALLOCATABLE :: H2CN(:,:) 
    69   REAL,ALLOCATABLE :: CHCN(:,:) 
    70   REAL,ALLOCATABLE :: CH2CN(:,:) 
    71   REAL,ALLOCATABLE :: CH3CN(:,:) 
    72   REAL,ALLOCATABLE :: C3N(:,:) 
    73   REAL,ALLOCATABLE :: HC3N(:,:) 
    74   REAL,ALLOCATABLE :: NCCN(:,:) 
    75   REAL,ALLOCATABLE :: C4N2(:,:) 
    76  
    77   ! 2. Grille scalaire 
    78   REAL,ALLOCATABLE :: H_S(:,:) 
    79   REAL,ALLOCATABLE :: H2_S(:,:) 
    80   REAL,ALLOCATABLE :: CH_S(:,:) 
    81   REAL,ALLOCATABLE :: CH2s_S(:,:) 
    82   REAL,ALLOCATABLE :: CH2_S(:,:) 
    83   REAL,ALLOCATABLE :: CH3_S(:,:) 
    84   REAL,ALLOCATABLE :: CH4_S(:,:) 
    85   REAL,ALLOCATABLE :: C2_S(:,:) 
    86   REAL,ALLOCATABLE :: C2H_S(:,:) 
    87   REAL,ALLOCATABLE :: C2H2_S(:,:) 
    88   REAL,ALLOCATABLE :: C2H3_S(:,:) 
    89   REAL,ALLOCATABLE :: C2H4_S(:,:) 
    90   REAL,ALLOCATABLE :: C2H5_S(:,:) 
    91   REAL,ALLOCATABLE :: C2H6_S(:,:) 
    92   REAL,ALLOCATABLE :: C3H3_S(:,:) 
    93   REAL,ALLOCATABLE :: C3H5_S(:,:) 
    94   REAL,ALLOCATABLE :: C3H6_S(:,:) 
    95   REAL,ALLOCATABLE :: C3H7_S(:,:) 
    96   REAL,ALLOCATABLE :: C4H_S(:,:) 
    97   REAL,ALLOCATABLE :: C4H3_S(:,:) 
    98   REAL,ALLOCATABLE :: C4H4_S(:,:) 
    99   REAL,ALLOCATABLE :: C4H2s_S(:,:) 
    100   REAL,ALLOCATABLE :: CH2CCH2_S(:,:) 
    101   REAL,ALLOCATABLE :: CH3CCH_S(:,:) 
    102   REAL,ALLOCATABLE :: C3H8_S(:,:) 
    103   REAL,ALLOCATABLE :: C4H2_S(:,:) 
    104   REAL,ALLOCATABLE :: C4H6_S(:,:) 
    105   REAL,ALLOCATABLE :: C4H10_S(:,:) 
    106   REAL,ALLOCATABLE :: AC6H6_S(:,:) 
    107   REAL,ALLOCATABLE :: C3H2_S(:,:) 
    108   REAL,ALLOCATABLE :: C4H5_S(:,:) 
    109   REAL,ALLOCATABLE :: AC6H5_S(:,:) 
    110   REAL,ALLOCATABLE :: N2_S(:,:) 
    111   REAL,ALLOCATABLE :: N4S_S(:,:) 
    112   REAL,ALLOCATABLE :: CN_S(:,:) 
    113   REAL,ALLOCATABLE :: HCN_S(:,:) 
    114   REAL,ALLOCATABLE :: H2CN_S(:,:) 
    115   REAL,ALLOCATABLE :: CHCN_S(:,:) 
    116   REAL,ALLOCATABLE :: CH2CN_S(:,:) 
    117   REAL,ALLOCATABLE :: CH3CN_S(:,:) 
    118   REAL,ALLOCATABLE :: C3N_S(:,:) 
    119   REAL,ALLOCATABLE :: HC3N_S(:,:) 
    120   REAL,ALLOCATABLE :: NCCN_S(:,:) 
    121   REAL,ALLOCATABLE :: C4N2_S(:,:)
    122  
    123  
    124   CONTAINS
    125 
    126 
    127   SUBROUTINE allokim_start2archive(ngridmx,ip1jmp1)
    128  
    129     IMPLICIT NONE
    130 
    131     INTEGER,INTENT(IN) :: ngridmx
    132     INTEGER,INTENT(IN) :: ip1jmp1
    133    
    134     allocate(H(ngridmx,nlaykim_up))
    135     allocate(H_S(ip1jmp1,nlaykim_up))
    136     allocate(H2(ngridmx,nlaykim_up))
    137     allocate(H2_S(ip1jmp1,nlaykim_up))
    138     allocate(CH(ngridmx,nlaykim_up))
    139     allocate(CH_S(ip1jmp1,nlaykim_up))
    140     allocate(CH2s(ngridmx,nlaykim_up))
    141     allocate(CH2s_S(ip1jmp1,nlaykim_up))
    142     allocate(CH2(ngridmx,nlaykim_up))
    143     allocate(CH2_S(ip1jmp1,nlaykim_up))
    144     allocate(CH3(ngridmx,nlaykim_up))
    145     allocate(CH3_S(ip1jmp1,nlaykim_up))
    146     allocate(CH4(ngridmx,nlaykim_up))
    147     allocate(CH4_S(ip1jmp1,nlaykim_up))
    148     allocate(C2(ngridmx,nlaykim_up))
    149     allocate(C2_S(ip1jmp1,nlaykim_up))
    150     allocate(C2H(ngridmx,nlaykim_up))
    151     allocate(C2H_S(ip1jmp1,nlaykim_up))
    152     allocate(C2H2(ngridmx,nlaykim_up))
    153     allocate(C2H2_S(ip1jmp1,nlaykim_up))
    154     allocate(C2H3(ngridmx,nlaykim_up))
    155     allocate(C2H3_S(ip1jmp1,nlaykim_up))
    156     allocate(C2H4(ngridmx,nlaykim_up))
    157     allocate(C2H4_S(ip1jmp1,nlaykim_up))
    158     allocate(C2H5(ngridmx,nlaykim_up))
    159     allocate(C2H5_S(ip1jmp1,nlaykim_up))
    160     allocate(C2H6(ngridmx,nlaykim_up))
    161     allocate(C2H6_S(ip1jmp1,nlaykim_up))
    162     allocate(C3H3(ngridmx,nlaykim_up))
    163     allocate(C3H3_S(ip1jmp1,nlaykim_up))
    164     allocate(C3H5(ngridmx,nlaykim_up))
    165     allocate(C3H5_S(ip1jmp1,nlaykim_up))
    166     allocate(C3H6(ngridmx,nlaykim_up))
    167     allocate(C3H6_S(ip1jmp1,nlaykim_up))
    168     allocate(C3H7(ngridmx,nlaykim_up))
    169     allocate(C3H7_S(ip1jmp1,nlaykim_up))
    170     allocate(C4H(ngridmx,nlaykim_up))
    171     allocate(C4H_S(ip1jmp1,nlaykim_up))
    172     allocate(C4H3(ngridmx,nlaykim_up))
    173     allocate(C4H3_S(ip1jmp1,nlaykim_up))
    174     allocate(C4H4(ngridmx,nlaykim_up))
    175     allocate(C4H4_S(ip1jmp1,nlaykim_up))
    176     allocate(C4H2s(ngridmx,nlaykim_up))
    177     allocate(C4H2s_S(ip1jmp1,nlaykim_up))
    178     allocate(CH2CCH2(ngridmx,nlaykim_up))
    179     allocate(CH2CCH2_S(ip1jmp1,nlaykim_up))
    180     allocate(CH3CCH(ngridmx,nlaykim_up))
    181     allocate(CH3CCH_S(ip1jmp1,nlaykim_up))
    182     allocate(C3H8(ngridmx,nlaykim_up))
    183     allocate(C3H8_S(ip1jmp1,nlaykim_up))
    184     allocate(C4H2(ngridmx,nlaykim_up))
    185     allocate(C4H2_S(ip1jmp1,nlaykim_up))
    186     allocate(C4H6(ngridmx,nlaykim_up))
    187     allocate(C4H6_S(ip1jmp1,nlaykim_up))
    188     allocate(C4H10(ngridmx,nlaykim_up))
    189     allocate(C4H10_S(ip1jmp1,nlaykim_up))
    190     allocate(AC6H6(ngridmx,nlaykim_up))
    191     allocate(AC6H6_S(ip1jmp1,nlaykim_up))
    192     allocate(C3H2(ngridmx,nlaykim_up))
    193     allocate(C3H2_S(ip1jmp1,nlaykim_up))
    194     allocate(C4H5(ngridmx,nlaykim_up))
    195     allocate(C4H5_S(ip1jmp1,nlaykim_up))
    196     allocate(AC6H5(ngridmx,nlaykim_up))
    197     allocate(AC6H5_S(ip1jmp1,nlaykim_up))
    198     allocate(N2(ngridmx,nlaykim_up))
    199     allocate(N2_S(ip1jmp1,nlaykim_up))
    200     allocate(N4S(ngridmx,nlaykim_up))
    201     allocate(N4S_S(ip1jmp1,nlaykim_up))
    202     allocate(CN(ngridmx,nlaykim_up))
    203     allocate(CN_S(ip1jmp1,nlaykim_up))
    204     allocate(HCN(ngridmx,nlaykim_up))
    205     allocate(HCN_S(ip1jmp1,nlaykim_up))
    206     allocate(H2CN(ngridmx,nlaykim_up))
    207     allocate(H2CN_S(ip1jmp1,nlaykim_up))
    208     allocate(CHCN(ngridmx,nlaykim_up))
    209     allocate(CHCN_S(ip1jmp1,nlaykim_up))
    210     allocate(CH2CN(ngridmx,nlaykim_up))
    211     allocate(CH2CN_S(ip1jmp1,nlaykim_up))
    212     allocate(CH3CN(ngridmx,nlaykim_up))
    213     allocate(CH3CN_S(ip1jmp1,nlaykim_up))
    214     allocate(C3N(ngridmx,nlaykim_up))
    215     allocate(C3N_S(ip1jmp1,nlaykim_up))
    216     allocate(HC3N(ngridmx,nlaykim_up))
    217     allocate(HC3N_S(ip1jmp1,nlaykim_up))
    218     allocate(NCCN(ngridmx,nlaykim_up))
    219     allocate(NCCN_S(ip1jmp1,nlaykim_up))
    220     allocate(C4N2(ngridmx,nlaykim_up))
    221     allocate(C4N2_S(ip1jmp1,nlaykim_up))
    222  
    223   END SUBROUTINE allokim_start2archive
    224 
    22523END MODULE comchem_h
Note: See TracChangeset for help on using the changeset viewer.