source: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/INCA/build/ppsrc/INCA_SRC/setinv.f90 @ 6610

Last change on this file since 6610 was 6610, checked in by acosce, 10 months ago

INCA used for ICOLMDZORINCA_CO2_Transport_GMD_2023

File size: 5.3 KB
Line 
1
2
3
4
5
6
7
8
9
10
11
12!$Id: setinv.F90 10 2007-08-09 12:43:01Z acosce $
13!! =========================================================================
14!! INCA - INteraction with Chemistry and Aerosols
15!!
16!! Copyright Laboratoire des Sciences du Climat et de l'Environnement (LSCE)
17!!           Unite mixte CEA-CNRS-UVSQ
18!!
19!! Contributors to this INCA subroutine:
20!!
21!! Didier Hauglustaine, LSCE, hauglustaine@cea.fr
22!! Stacy Walters, NCAR, stacy@ucar.edu
23!!
24!! Anne Cozic, LSCE, anne.cozic@cea.fr
25!! Yann Meurdesoif, LSCE, yann.meurdesoif@cea.fr
26!!
27!! This software is a computer program whose purpose is to simulate the
28!! atmospheric gas phase and aerosol composition. The model is designed to be
29!! used within a transport model or a general circulation model. This version
30!! of INCA was designed to be coupled to the LMDz GCM. LMDz-INCA accounts
31!! for emissions, transport (resolved and sub-grid scale), photochemical
32!! transformations, and scavenging (dry deposition and washout) of chemical
33!! species and aerosols interactively in the GCM. Several versions of the INCA
34!! model are currently used depending on the envisaged applications with the
35!! chemistry-climate model.
36!!
37!! This software is governed by the CeCILL  license under French law and
38!! abiding by the rules of distribution of free software.  You can  use,
39!! modify and/ or redistribute the software under the terms of the CeCILL
40!! license as circulated by CEA, CNRS and INRIA at the following URL
41!! "http://www.cecill.info".
42!!
43!! As a counterpart to the access to the source code and  rights to copy,
44!! modify and redistribute granted by the license, users are provided only
45!! with a limited warranty  and the software's author,  the holder of the
46!! economic rights,  and the successive licensors  have only  limited
47!! liability.
48!!
49!! In this respect, the user's attention is drawn to the risks associated
50!! with loading,  using,  modifying and/or developing or reproducing the
51!! software by the user in light of its specific status of free software,
52!! that may mean  that it is complicated to manipulate,  and  that  also
53!! therefore means  that it is reserved for developers  and  experienced
54!! professionals having in-depth computer knowledge. Users are therefore
55!! encouraged to load and test the software's suitability as regards their
56!! requirements in conditions enabling the security of their systems and/or
57!! data to be ensured and,  more generally, to use and operate it in the
58!! same conditions as regards security.
59!!
60!! The fact that you are presently reading this means that you have had
61!! knowledge of the CeCILL license and that you accept its terms.
62!! =========================================================================
63
64
65SUBROUTINE SETINV( &
66   invariants  , &
67   tfld        , &
68   h2ovmr      , &
69   pmid )
70  !-----------------------------------------------------------------
71  !        ... Set the invariant densities (molecules/cm**3)
72  ! Stacy Walters, NCAR, 1998.
73  ! Modified by Didier Hauglustaine, IPSL, for LMDZ/INCA, 1999.
74  !-----------------------------------------------------------------
75
76  USE OXYDANT_COM
77  USE INCA_DIM
78  USE RATE_INDEX_MOD
79  USE XIOS_INCA
80
81  IMPLICIT NONE
82
83  !-----------------------------------------------------------------
84  !        ... Dummy arguments
85  !-----------------------------------------------------------------
86  REAL, INTENT(in)     ::      tfld(PLON,PLEV)           ! temperature
87  REAL, INTENT(in)     ::      h2ovmr(PLON,PLEV)          ! water vapor vmr
88  REAL, INTENT(in)     ::      pmid(PLON,PLEV)           ! pressure
89  REAL, INTENT(out)    ::      invariants(PLON,PLEV,12)  ! invariant array
90
91  !-----------------------------------------------------------------
92  !        .. Local variables
93  !-----------------------------------------------------------------
94  REAL, PARAMETER ::  boltz = 1.38044e-16      ! erg/K
95  REAL, PARAMETER ::  rma = 28./48.
96  INTEGER :: n 
97  !-----------------------------------------------------------------
98  !        NOTE: Invariants are in cgs density units.
99  !              The pmid array is in pascals and must be
100  !            mutiplied by 10. to yield dynes/cm**2.
101  !-----------------------------------------------------------------
102
103  !-----------------------------------------------------------------
104  !     ... Set M, N2, O2, H2O and other invariant densities
105  !-----------------------------------------------------------------
106  invariants(:,:,inv_M) = 10. * pmid(:,:) / (boltz*tfld(:,:))
107  invariants(:,:,inv_N2) = .79 * invariants(:,:,inv_M)
108  invariants(:,:,inv_O2) = .21 * invariants(:,:,inv_M)
109  invariants(:,:,inv_CO2) = 365.e-6 * invariants(:,:,inv_M)
110  invariants(:,:,inv_H2O) = h2ovmr(:,:) * invariants(:,:,inv_M)
111
112
113  invariants(:,:,inv_OH)      = ohoxyd(:,:)*invariants(:,:,inv_M)
114  invariants(:,:,inv_NO3INV)  = no3oxyd(:,:)*invariants(:,:,inv_M)
115  invariants(:,:,inv_O3)      = o3oxyd(:,:)*invariants(:,:,inv_M)
116  invariants(:,:,inv_H2O2)    = h2o2oxyd(:,:)*invariants(:,:,inv_M)
117  invariants(:,:,inv_O1D)     = o1doxyd(:,:)*invariants(:,:,inv_M)
118  invariants(:,:,inv_HNO3INV) = hno3oxyd(:,:)*invariants(:,:,inv_M)
119  invariants(:,:,inv_NO2INV)  = no2oxyd(:,:)*invariants(:,:,inv_M)
120
121
122!  CALL xios_inca_change_context("inca")
123!  DO n=1, 12
124!     CALL xios_inca_send_field("inv_"//trim(invname(n)), invariants(:,:,n))
125!  ENDDO
126!  CALL xios_inca_change_context("LMDZ")
127
128
129END SUBROUTINE SETINV
130
131
Note: See TracBrowser for help on using the repository browser.