SURFEX v8.1
General documentation of Surfex
ch_init_dep_isban.F90
Go to the documentation of this file.
1 !SFX_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
2 !SFX_LIC This is part of the SURFEX software governed by the CeCILL-C licence
3 !SFX_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4 !SFX_LIC for details. version 1.
5 ! #########
6  SUBROUTINE ch_init_dep_isba_n (CHI, NCHI, NP, DTCO, KPATCH, OCOVER, PCOVER, &
7  KCH,KLUOUT,KLU)
8 !! ##################################################
9 !!
10 !!*** *CH_INIT_DEP_ISBA_n*
11 !!
12 !! PURPOSE
13 !! -------
14 ! The purpose of this subroutine is to calculate the surface flux
15 ! (emission or deposition) for the chemical (=scalar) variable
16 !!
17 !!** METHOD
18 !! ------
19 !! The surface flux will be calculated using an exchange velocity
20 !! and a surface mixing ratio for each species:
21 !! Flux = v_exchange * ( C(first model level) )
22 !! Exchange velocity and surface concentration will be read from
23 !! the general purpose input file, or,
24 !! if CCH_DRY_DEP = "WES89", the Wesley method will be used
25 !! to calculate the dry deposition velocities. The wesely code
26 !! has been separate into four subroutines: ch_teb_depn.f90 for town area;
27 !! ch_water_depn.f90 for inland water; ch_sea_depn.f90 for sea and
28 !! ch_isba_depn.f90 for nature area.
29 !!
30 !! information read from the input file:
31 !! surface values SURFVALU
32 !! exchange velocities EXCHGVEL (non-Wesley)
33 !!
34 !! in addition for Wesley:
35 !! chemical molecular diffusivity MASS_MOL
36 !! molecular reactivity factor REA_FACT
37 !! surface resistance SURF_RES
38 !! molecular effective Henry constant HENRY_SP
39 !!
40 !!
41 !! REFERENCE
42 !! ---------
43 !!
44 !! AUTHOR
45 !! ------
46 !! K. Suhre *Laboratoire d'Aerologie*
47 !!
48 !! MODIFICATIONS
49 !! -------------
50 !! Original 17/11/95
51 !! 05/08/96 (K. Suhre) restructured
52 !! 19/02/98 (P. Tulet) add explicit dry deposition for chemical species
53 !! 11/08/98 (N. Asencio) add parallel code
54 !! 29/03/99 (K. Suhre) add IKB = MIN(2,SIZE(PSVT,3))
55 !! so that this subroutine can be called by the box model
56 !! 16/01/01 (P. Tulet) restructured
57 !! 18/01/01 (P. Tulet) add patch vegetative class, town and water/sea
58 !! for friction velocity and aerodynamical resistance
59 !! 18/07/03 (P. Tulet) surface externalisation
60 !!
61 !!
62 !! EXTERNAL
63 !! --------
64 !
65 !
67 USE modd_isba_n, ONLY : isba_np_t
69 !
70 USE modi_ch_open_inputb ! open the general purpose ASCII input file
71 USE modi_convert_cover_ch_isba
72 !
75 USE modd_ch_surf
76 USE modd_surf_par, ONLY : xundef
77 !!
78 !! IMPLICIT ARGUMENTS
79 !! ------------------
80 !-------------------------------------------------------------------------------
81 !
82 !* 0. DECLARATIONS
83 ! ------------
84 !
85 USE yomhook ,ONLY : lhook, dr_hook
86 USE parkind1 ,ONLY : jprb
87 !
88 IMPLICIT NONE
89 !
90 !* 0.1 declarations of arguments
91 !
92 TYPE(ch_isba_t), INTENT(INOUT) :: CHI
93 TYPE(ch_isba_np_t), INTENT(INOUT) :: NCHI
94 TYPE(isba_np_t), INTENT(INOUT) :: NP
95 TYPE(data_cover_t), INTENT(INOUT) :: DTCO
96 !
97 INTEGER, INTENT(IN) :: KPATCH
98 LOGICAL, DIMENSION(:), INTENT(IN) :: OCOVER
99 REAL, DIMENSION(:,:), INTENT(IN) :: PCOVER
100 !
101 INTEGER, INTENT(IN) :: KCH ! chemistry input file
102 INTEGER, INTENT(IN) :: KLUOUT ! output listing channel
103 INTEGER, INTENT(IN) :: KLU ! number of points
104 !
105 !* 0.2 declarations of local variables
106 !
107  CHARACTER(LEN=40) :: YFORMAT
108 ! format for input
109  CHARACTER(LEN=40) :: YOUTFORMAT = '(A32,2E15.5)'
110 ! format for output
111 INTEGER :: IRESIS ! number of chemical reactivity factor to be read
112  CHARACTER(LEN=40), DIMENSION(:), ALLOCATABLE :: YRESISNAME !resistance name
113 REAL , DIMENSION(:), ALLOCATABLE :: ZRESISVAL
114 ! chemical reactivity factor value
115 !
116 INTEGER :: JI, JNREAL, JP ! loop control variables
117 REAL(KIND=JPRB) :: ZHOOK_HANDLE
118 !
119 !=============================================================================
120 !
121  !
122  ! 1. Default values
123  !
124  IF (lhook) CALL dr_hook('CH_INIT_DEP_ISBA_N',0,zhook_handle)
126  xrcclayo3 = xundef
128  xrcsando3 = xundef
130  xrcsnowo3 = xundef
131  xlandrext = xundef
132  !
133  !-----------------------------------------------------------------------------
134  !
135  !
136  IF (chi%CCH_DRY_DEP == "WES89") THEN
137  !
138  !* 2. Physiographic fields
139  !
140  DO jp = 1,kpatch
141  !
142  ALLOCATE(nchi%AL(jp)%XSOILRC_SO2(np%AL(jp)%NSIZE_P))
143  ALLOCATE(nchi%AL(jp)%XSOILRC_O3 (np%AL(jp)%NSIZE_P))
144  !
145  CALL convert_cover_ch_isba(dtco, pcover, ocover, kpatch, jp, np%AL(jp), &
146  nchi%AL(jp)%XSOILRC_SO2, nchi%AL(jp)%XSOILRC_O3)
147  !
148  !---------------------------------------------------------------------------
149  !
150  !
151  !* 3. read surface resistance SURF_RES
152  !
153  ALLOCATE(nchi%AL(jp)%XDEP(klu,chi%SVI%NBEQ))
154  !
155  ENDDO
156  !
157  ! open input file
158  WRITE(kluout,*) &
159  "CH_INIT_DEP_ISBA_n: reading reactivity factor "
160  CALL ch_open_inputb("SURF_RES", kch, kluout)
161  !
162  ! read number of input surface resistance IRESIS
163  READ(kch, *) iresis
164  WRITE(kluout,*) "number of reactivity factor : ", iresis
165  !
166  ! read data input format
167  READ(kch,"(A)") yformat
168  WRITE(kluout,*) "input format is: ", yformat
169  !
170  ! allocate fields
171  ALLOCATE(yresisname(iresis))
172  ALLOCATE(zresisval(iresis))
173  !
174  ! read reactivity factor
175  DO ji = 1, iresis
176  READ(kch,yformat) yresisname(ji), zresisval(ji)
177  WRITE(kluout,yformat) yresisname(ji), zresisval(ji)
178  END DO
179 !
180  ! close file
181  DO jnreal = 1, iresis
182  IF ('LANDREXT'== yresisname(jnreal) (1:8)) xlandrext = zresisval(jnreal)
183  IF ('RCSANDSO2'== yresisname(jnreal) (1:9)) xrcsandso2 = zresisval(jnreal)
184  IF ('RCSANDO3'== yresisname(jnreal) (1:8)) xrcsando3 = zresisval(jnreal)
185  IF ('RCCLAYSO2'== yresisname(jnreal) (1:9)) xrcclayso2 = zresisval(jnreal)
186  IF ('RCCLAYO3'== yresisname(jnreal) (1:8)) xrcclayo3 = zresisval(jnreal)
187  IF ('RCSNOWSO2'== yresisname(jnreal) (1:9)) xrcsnowso2 = zresisval(jnreal)
188  IF ('RCSNOWO3'== yresisname(jnreal) (1:8)) xrcsnowo3 = zresisval(jnreal)
189  END DO
190  !
191  WRITE(kluout,'(A)') '----------------------------------------------------'
192  WRITE(kluout,'(A)') 'SURF_RES'
193  WRITE(kluout,'(A)') 'surface resistances (s/m)'
194  WRITE(kluout,'(I4)') 7
195  WRITE(kluout,'(A)') youtformat
196  WRITE(kluout,youtformat) 'LANDREXT', xlandrext
197  WRITE(kluout,youtformat) 'RCSANDSO2', xrcsandso2
198  WRITE(kluout,youtformat) 'RCSANDO3', xrcsando3
199  WRITE(kluout,youtformat) 'RCCLAYSO2', xrcclayso2
200  WRITE(kluout,youtformat) 'RCCLAYO3', xrcclayo3
201  WRITE(kluout,youtformat) 'RCSNOWSO2', xrcsnowso2
202  WRITE(kluout,youtformat) 'RCSNOWO3', xrcsnowo3
203  !
204  DEALLOCATE(yresisname)
205  DEALLOCATE(zresisval)
206  ELSE
207  DO jp = 1,kpatch
208  ALLOCATE(nchi%AL(jp)%XDEP(0,0))
209  ENDDO
210  END IF
211 IF (lhook) CALL dr_hook('CH_INIT_DEP_ISBA_N',1,zhook_handle)
212  !
213  !=============================================================================
214  !
215 END SUBROUTINE ch_init_dep_isba_n
real, save xrcsnowso2
real, save xrcsando3
subroutine convert_cover_ch_isba(DTCO, PCOVER, OCOVER, KNPATCH, K
real, save xrcsandso2
real, parameter xundef
subroutine ch_open_inputb(HKEYWORD, KCHANNEL, KLUOUT)
integer, parameter jprb
Definition: parkind1.F90:32
real, save xlandrext
real, save xrcclayso2
subroutine ch_init_dep_isba_n(CHI, NCHI, NP, DTCO, KPATCH, OCOVER
logical lhook
Definition: yomhook.F90:15
real, save xrcclayo3
real, save xrcsnowo3