source: CONFIG/publications/ICOLMDZORINCA_CO2_Transport_GMD_2023/INCA/src/INCA_PARA/init_inca_para.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: 4.8 KB
Line 
1!$Id: init_inca_para.F90 104 2008-12-23 10:28:51Z acosce $
2!! =========================================================================
3!! INCA - INteraction with Chemistry and Aerosols
4!!
5!! Copyright Laboratoire des Sciences du Climat et de l'Environnement (LSCE)
6!!           Unite mixte CEA-CNRS-UVSQ
7!!
8!! Contributors to this INCA subroutine:
9!!
10!!
11!! Anne Cozic, LSCE, anne.cozic@cea.fr
12!! Yann Meurdesoif, LSCE, yann.meurdesoif@cea.fr
13!!
14!! This software is a computer program whose purpose is to simulate the
15!! atmospheric gas phase and aerosol composition. The model is designed to be
16!! used within a transport model or a general circulation model. This version
17!! of INCA was designed to be coupled to the LMDz GCM. LMDz-INCA accounts
18!! for emissions, transport (resolved and sub-grid scale), photochemical
19!! transformations, and scavenging (dry deposition and washout) of chemical
20!! species and aerosols interactively in the GCM. Several versions of the INCA
21!! model are currently used depending on the envisaged applications with the
22!! chemistry-climate model.
23!!
24!! This software is governed by the CeCILL  license under French law and
25!! abiding by the rules of distribution of free software.  You can  use,
26!! modify and/ or redistribute the software under the terms of the CeCILL
27!! license as circulated by CEA, CNRS and INRIA at the following URL
28!! "http://www.cecill.info".
29!!
30!! As a counterpart to the access to the source code and  rights to copy,
31!! modify and redistribute granted by the license, users are provided only
32!! with a limited warranty  and the software's author,  the holder of the
33!! economic rights,  and the successive licensors  have only  limited
34!! liability.
35!!
36!! In this respect, the user's attention is drawn to the risks associated
37!! with loading,  using,  modifying and/or developing or reproducing the
38!! software by the user in light of its specific status of free software,
39!! that may mean  that it is complicated to manipulate,  and  that  also
40!! therefore means  that it is reserved for developers  and  experienced
41!! professionals having in-depth computer knowledge. Users are therefore
42!! encouraged to load and test the software's suitability as regards their
43!! requirements in conditions enabling the security of their systems and/or
44!! data to be ensured and,  more generally, to use and operate it in the
45!! same conditions as regards security.
46!!
47!! The fact that you are presently reading this means that you have had
48!! knowledge of the CeCILL license and that you accept its terms.
49!! =========================================================================
50
51
52SUBROUTINE INIT_INCA_PARA( &
53   iim      , &
54   jjp1     , &
55   llm      , &
56   nbp      , &
57   nb_proc  , &
58   distrib  , &
59   nvertex_lmdz, &
60   grid_type_lmdz, &
61   COMM_LMDZ)
62
63
64  USE MOD_INCA_PARA, mpi_root_x=>mpi_root
65  USE MOD_GRID_INCA
66  USE PRINT_INCA
67#ifdef XIOS
68  USE xios
69#endif
70
71  IMPLICIT NONE
72
73#ifdef CPP_PARA
74  include 'mpif.h'
75#endif
76
77  INTEGER, INTENT(in) :: iim
78  INTEGER, INTENT(in) :: jjp1
79  INTEGER, INTENT(in) :: llm
80  INTEGER, INTENT(in) :: nbp
81  INTEGER, INTENT(in) :: nb_proc
82  INTEGER, INTENT(in) :: distrib(0:nb_proc-1)
83  INTEGER, INTENT(in) :: nvertex_lmdz
84  INTEGER, INTENT(in) :: grid_type_lmdz
85  INTEGER, INTENT(in) :: comm_lmdz
86  INTEGER :: index(nbp)
87  INTEGER :: pos,i
88  CHARACTER(len=*),PARAMETER      :: id="client"           !! Id for initialization of ORCHIDEE in XIOS
89  integer :: xios_comm
90  iim_glo=iim
91  jjm_glo=jjp1
92  iim_g=iim_glo
93  jjm_g=jjm_glo
94  nbp_glo=iim*jjp1-2*(iim-1)
95
96
97  nvertex = nvertex_lmdz
98
99
100  grid_type = grid_type_lmdz
101
102
103  CALL Init_mod_inca_para(iim,jjp1,llm,nb_proc,distrib,COMM_LMDZ)
104
105
106  ALLOCATE(nbp_para_nb(0:mpi_size-1))
107  ALLOCATE(nbp_para_begin(0:mpi_size-1))
108  ALLOCATE(nbp_para_end(0:mpi_size-1))
109
110  DO i=0,mpi_size-1
111     nbp_para_nb(i)=distrib(i)
112  ENDDO
113  nbp_para_begin(0)=1
114  nbp_para_end(0)=nbp_para_nb(0)
115  DO i=1,mpi_size-1
116     nbp_para_begin(i)=nbp_para_end(i-1)+1
117     nbp_para_end(i)=nbp_para_begin(i)+nbp_para_nb(i)-1
118  ENDDO
119
120  nbp_mpi=nbp_para_nb(mpi_rank)
121
122  index(1)=1
123  pos=iim_glo+1
124  DO i=2,nbp_glo
125     index(i)=pos
126     pos=pos+1
127  ENDDO
128
129  CALL init_inca_io_para
130
131
132END SUBROUTINE INIT_INCA_PARA
133
134SUBROUTINE INIT_INCA_IO_PARA
135
136  USE IOIPSL
137  USE INCA_DATA_PARA
138
139  IMPLICIT NONE
140
141  INTEGER,DIMENSION(2) :: ddid
142  INTEGER,DIMENSION(2) :: dsg
143  INTEGER,DIMENSION(2) :: dsl
144  INTEGER,DIMENSION(2) :: dpf
145  INTEGER,DIMENSION(2) :: dpl
146  INTEGER,DIMENSION(2) :: dhs
147  INTEGER,DIMENSION(2) :: dhe 
148
149  ddid=(/ 1,2 /)
150  dsg=(/ iim_glo, jjm_glo /)
151  dsl=(/ iim_glo, jj_nb /)
152  dpf=(/ 1,jj_begin /)
153  dpl=(/ iim_glo, jj_end /)
154  dhs=(/ ii_begin-1,0 /)
155  IF (mpi_rank==mpi_size-1) THEN
156      dhe=(/0,0/)
157  ELSE
158      dhe=(/ iim_glo-ii_end,0 /) 
159  ENDIF
160 
161  CALL flio_dom_set( &
162     mpi_size,mpi_rank, &
163     ddid,dsg,dsl,dpf,  &
164     dpl,dhs,dhe,       &
165     'APPLE',inca_domain_id)
166
167END SUBROUTINE Init_inca_io_para
Note: See TracBrowser for help on using the repository browser.