1 | MODULE trc |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE trc *** |
---|
4 | !! Passive tracers : module for tracers defined |
---|
5 | !!====================================================================== |
---|
6 | !! History : OPA ! 1996-01 (M. Levy) Original code |
---|
7 | !! - ! 1999-07 (M. Levy) for LOBSTER1 or NPZD model |
---|
8 | !! - ! 2000-04 (O. Aumont, M.A. Foujols) HAMOCC3 and P3ZD |
---|
9 | !! NEMO 1.0 ! 2004-03 (C. Ethe) Free form and module |
---|
10 | !!---------------------------------------------------------------------- |
---|
11 | #if defined key_top |
---|
12 | !!---------------------------------------------------------------------- |
---|
13 | !! 'key_top' TOP models |
---|
14 | !!---------------------------------------------------------------------- |
---|
15 | USE par_oce |
---|
16 | USE par_trc |
---|
17 | |
---|
18 | IMPLICIT NONE |
---|
19 | PUBLIC |
---|
20 | |
---|
21 | PUBLIC trc_alloc ! called by nemogcm.F90 |
---|
22 | |
---|
23 | !! passive tracers names and units (read in namelist) |
---|
24 | !! -------------------------------------------------- |
---|
25 | CHARACTER(len=12), PUBLIC, DIMENSION(jptra) :: ctrcnm !: tracer name |
---|
26 | CHARACTER(len=12), PUBLIC, DIMENSION(jptra) :: ctrcun !: tracer unit |
---|
27 | CHARACTER(len=80), PUBLIC, DIMENSION(jptra) :: ctrcnl !: tracer long name |
---|
28 | |
---|
29 | |
---|
30 | !! parameters for the control of passive tracers |
---|
31 | !! -------------------------------------------------- |
---|
32 | INTEGER, PUBLIC :: numnat !: the number of the passive tracer NAMELIST |
---|
33 | LOGICAL, PUBLIC, DIMENSION(jptra) :: lutini !: initialisation from FILE or not (NAMELIST) |
---|
34 | LOGICAL, PUBLIC, DIMENSION(jptra) :: lutsav !: save the tracer or not |
---|
35 | |
---|
36 | !! passive tracers fields (before,now,after) |
---|
37 | !! -------------------------------------------------- |
---|
38 | REAL(wp), PUBLIC :: trai !: initial total tracer |
---|
39 | REAL(wp), PUBLIC :: areatot !: total volume |
---|
40 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:) :: cvol !: volume correction -degrad option- |
---|
41 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:,:) :: trn !: traceur concentration for now time step |
---|
42 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:,:) :: tra !: traceur concentration for next time step |
---|
43 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:,:) :: trb !: traceur concentration for before time step |
---|
44 | |
---|
45 | !! interpolated gradient |
---|
46 | !!-------------------------------------------------- |
---|
47 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:) :: gtru !: hor. gradient at u-points at bottom ocean level |
---|
48 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:) :: gtrv !: hor. gradient at v-points at bottom ocean level |
---|
49 | |
---|
50 | !! passive tracers restart (input and output) |
---|
51 | !! ------------------------------------------ |
---|
52 | LOGICAL , PUBLIC :: ln_rsttr !: boolean term for restart i/o for passive tracers (namelist) |
---|
53 | LOGICAL , PUBLIC :: lrst_trc !: logical to control the trc restart write |
---|
54 | INTEGER , PUBLIC :: nn_dttrc !: frequency of step on passive tracers |
---|
55 | INTEGER , PUBLIC :: nutwrs !: output FILE for passive tracers restart |
---|
56 | INTEGER , PUBLIC :: nutrst !: logical unit for restart FILE for passive tracers |
---|
57 | INTEGER , PUBLIC :: nn_rsttr !: control of the time step ( 0 or 1 ) for pass. tr. |
---|
58 | CHARACTER(len=50), PUBLIC :: cn_trcrst_in !: suffix of pass. tracer restart name (input) |
---|
59 | CHARACTER(len=50), PUBLIC :: cn_trcrst_out !: suffix of pass. tracer restart name (output) |
---|
60 | |
---|
61 | INTEGER , PUBLIC :: nittrc000 !: first time step of passive tracers model |
---|
62 | |
---|
63 | !! information for outputs |
---|
64 | !! -------------------------------------------------- |
---|
65 | INTEGER , PUBLIC :: nn_writetrc !: time step frequency for concentration outputs (namelist) |
---|
66 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: rdttrc !: vertical profile of passive tracer time step |
---|
67 | |
---|
68 | # if defined key_diatrc && ! defined key_iomput |
---|
69 | !! additional 2D/3D outputs namelist |
---|
70 | !! -------------------------------------------------- |
---|
71 | INTEGER , PUBLIC :: nn_writedia !: frequency of additional arrays outputs(namelist) |
---|
72 | CHARACTER(len= 8), PUBLIC, DIMENSION(jpdia2d) :: ctrc2d !: 2d output field name |
---|
73 | CHARACTER(len= 8), PUBLIC, DIMENSION(jpdia2d) :: ctrc2u !: 2d output field unit |
---|
74 | CHARACTER(len= 8), PUBLIC, DIMENSION(jpdia3d) :: ctrc3d !: 3d output field name |
---|
75 | CHARACTER(len= 8), PUBLIC, DIMENSION(jpdia3d) :: ctrc3u !: 3d output field unit |
---|
76 | CHARACTER(len=80), PUBLIC, DIMENSION(jpdia2d) :: ctrc2l !: 2d output field long name |
---|
77 | CHARACTER(len=80), PUBLIC, DIMENSION(jpdia3d) :: ctrc3l !: 3d output field long name |
---|
78 | |
---|
79 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:, :) :: trc2d !: additional 2d outputs |
---|
80 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trc3d !: additional 3d outputs |
---|
81 | # endif |
---|
82 | |
---|
83 | # if defined key_diabio || defined key_trdmld_trc |
---|
84 | ! !!* namtop_XXX namelist * |
---|
85 | INTEGER , PUBLIC :: nn_writebio !: time step frequency for biological outputs |
---|
86 | CHARACTER(len=8 ), PUBLIC, DIMENSION(jpdiabio) :: ctrbio !: biological trends name |
---|
87 | CHARACTER(len=20), PUBLIC, DIMENSION(jpdiabio) :: ctrbiu !: biological trends unit |
---|
88 | CHARACTER(len=80), PUBLIC, DIMENSION(jpdiabio) :: ctrbil !: biological trends long name |
---|
89 | # endif |
---|
90 | # if defined key_diabio |
---|
91 | !! Biological trends |
---|
92 | !! ----------------- |
---|
93 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trbio !: biological trends |
---|
94 | # endif |
---|
95 | |
---|
96 | |
---|
97 | !! passive tracers data read and at given time_step |
---|
98 | !! -------------------------------------------------- |
---|
99 | # if defined key_dtatrc |
---|
100 | INTEGER , PUBLIC, DIMENSION(jptra) :: numtr !: logical unit for passive tracers data |
---|
101 | # endif |
---|
102 | |
---|
103 | !! variables to average over physics over passive tracer sub-steps. |
---|
104 | !! ---------------------------------------------------------------- |
---|
105 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: un_tm !: i-horizontal velocity average [m/s] |
---|
106 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: vn_tm !: j-horizontal velocity average [m/s] |
---|
107 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tsn_tm !: t/s average [m/s] |
---|
108 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avt_tm !: vertical diffusivity coeff. at w-point [m2/s] |
---|
109 | # if defined key_zdfddm |
---|
110 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avs_tm !: vertical double diffusivity coeff. at w-point [m/s] |
---|
111 | # endif |
---|
112 | #if defined key_ldfslp |
---|
113 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: wslpi_tm !: i-direction slope at u-, w-points |
---|
114 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: wslpj_tm !: j-direction slope at u-, w-points |
---|
115 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: uslp_tm !: j-direction slope at u-, w-points |
---|
116 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: vslp_tm !: j-direction slope at u-, w-points |
---|
117 | #endif |
---|
118 | #if defined key_trabbl |
---|
119 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ahu_bbl_tm !: u-, w-points |
---|
120 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ahv_bbl_tm !: j-direction slope at u-, w-points |
---|
121 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: utr_bbl_tm !: j-direction slope at u-, w-points |
---|
122 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: vtr_bbl_tm !: j-direction slope at u-, w-points |
---|
123 | #endif |
---|
124 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshn_tm !: average ssh for the now step [m] |
---|
125 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshu_n_tm !: average ssh for the now step [m] |
---|
126 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshv_n_tm !: average ssh for the now step [m] |
---|
127 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshb_hold !:hold sshb from the beginning of each sub-stepping[m] |
---|
128 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshu_b_hold !:hold sshb from the beginning of each sub-stepping[m] |
---|
129 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshv_b_hold !:hold sshb from the beginning of each sub-stepping[m] |
---|
130 | |
---|
131 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: rnf_tm !: river runoff |
---|
132 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: h_rnf_tm !: depth in metres to the bottom of the relevant grid box |
---|
133 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hmld_tm !: mixed layer depth average [m] |
---|
134 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fr_i_tm !: average ice fraction [m/s] |
---|
135 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: emp_tm !: freshwater budget: volume flux [Kg/m2/s] |
---|
136 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: emps_tm !: freshwater budget:concentration/dilution [Kg/m2/s] |
---|
137 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: emp_b_hold !: hold emp from the beginning of each sub-stepping[m] |
---|
138 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: qsr_tm !: solar radiation average [m] |
---|
139 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: wndm_tm !: 10m wind average [m] |
---|
140 | ! |
---|
141 | #if defined key_traldf_c3d |
---|
142 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ahtt_tm, ahtu_tm, ahtv_tm, ahtw_tm !: ** 3D coefficients ** at T-,U-,V-,W-points |
---|
143 | #elif defined key_traldf_c2d |
---|
144 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ahtt_tm, ahtu_tm, ahtv_tm, ahtw_tm !: ** 2D coefficients ** at T-,U-,V-,W-points |
---|
145 | #elif defined key_traldf_c1d |
---|
146 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ahtt_tm, ahtu_tm, ahtv_tm, ahtw_tm !: ** 1D coefficients ** at T-,U-,V-,W-points |
---|
147 | #else |
---|
148 | REAL(wp), PUBLIC :: ahtt_tm, ahtu_tm, ahtv_tm, ahtw_tm !: ** 0D coefficients ** at T-,U-,V-,W-points |
---|
149 | #endif |
---|
150 | ! |
---|
151 | #if defined key_traldf_eiv |
---|
152 | # if defined key_traldf_c3d |
---|
153 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: aeiu_tm , aeiv_tm , aeiw_tm !: ** 3D coefficients ** |
---|
154 | # elif defined key_traldf_c2d |
---|
155 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: aeiu_tm , aeiv_tm , aeiw_tm !: ** 2D coefficients ** |
---|
156 | # elif defined key_traldf_c1d |
---|
157 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: aeiu_tm , aeiv_tm, aeiw_tm !: ** 1D coefficients ** |
---|
158 | # else |
---|
159 | REAL(wp), PUBLIC :: aeiu_tm , aeiv_tm , aeiw_tm !: ** 0D coefficients ** |
---|
160 | # endif |
---|
161 | #endif |
---|
162 | |
---|
163 | ! Temporary physical arrays for sub_stepping |
---|
164 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tsn_temp |
---|
165 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: un_temp,vn_temp,wn_temp !: hold current values of avt, un, vn, wn |
---|
166 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avt_temp !: hold current values of avt, un, vn, wn |
---|
167 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: e3t_temp,e3u_temp,e3v_temp,e3w_temp !: hold current values |
---|
168 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshn_temp, sshb_temp, ssha_temp, rnf_temp,h_rnf_temp |
---|
169 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshu_n_temp, sshu_b_temp, sshu_a_temp |
---|
170 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshf_n_temp |
---|
171 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshv_n_temp, sshv_b_temp, sshv_a_temp |
---|
172 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hu_temp, hv_temp, hur_temp, hvr_temp |
---|
173 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: hdivn_temp, rotn_temp |
---|
174 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: hdivb_temp, rotb_temp |
---|
175 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hmld_temp, qsr_temp, fr_i_temp,wndm_temp |
---|
176 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: emp_temp, emps_temp, emp_b_temp |
---|
177 | ! |
---|
178 | #if defined key_trabbl |
---|
179 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ahu_bbl_temp, ahv_bbl_temp, utr_bbl_temp, vtr_bbl_temp !: hold current values |
---|
180 | #endif |
---|
181 | ! |
---|
182 | #if defined key_ldfslp |
---|
183 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: wslpi_temp, wslpj_temp, uslp_temp, vslp_temp !: hold current values |
---|
184 | #endif |
---|
185 | ! |
---|
186 | # if defined key_zdfddm |
---|
187 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avs_temp !: salinity vertical diffusivity coeff. at w-point [m/s] |
---|
188 | # endif |
---|
189 | ! |
---|
190 | #if defined key_traldf_c3d |
---|
191 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ahtt_temp, ahtu_temp, ahtv_temp, ahtw_temp |
---|
192 | #elif defined key_traldf_c2d |
---|
193 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ahtt_temp, ahtu_temp, ahtv_temp, ahtw_temp |
---|
194 | #elif defined key_traldf_c1d |
---|
195 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ahtt_temp, ahtu_temp, ahtv_temp, ahtw_temp |
---|
196 | #else |
---|
197 | REAL(wp), PUBLIC :: ahtt_temp, ahtu_temp, ahtv_temp, ahtw_temp |
---|
198 | #endif |
---|
199 | ! |
---|
200 | #if defined key_traldf_eiv |
---|
201 | # if defined key_traldf_c3d |
---|
202 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: aeiu_temp , aeiv_temp , aeiw_temp !: ** 3D coefficients ** |
---|
203 | # elif defined key_traldf_c2d |
---|
204 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: aeiu_temp , aeiv_temp , aeiw_temp !: ** 2D coefficients ** |
---|
205 | # elif defined key_traldf_c1d |
---|
206 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: aeiu_temp , aeiv_temp, aeiw_temp !: ** 1D coefficients ** |
---|
207 | # else |
---|
208 | REAL(wp), PUBLIC :: aeiu_temp , aeiv_temp , aeiw_temp !: ** 0D coefficients ** |
---|
209 | # endif |
---|
210 | # endif |
---|
211 | |
---|
212 | !!---------------------------------------------------------------------- |
---|
213 | !! NEMO/TOP 3.3.1 , NEMO Consortium (2010) |
---|
214 | !! $Id$ |
---|
215 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
216 | !!---------------------------------------------------------------------- |
---|
217 | CONTAINS |
---|
218 | |
---|
219 | INTEGER FUNCTION trc_alloc() |
---|
220 | !!------------------------------------------------------------------- |
---|
221 | !! *** ROUTINE trc_alloc *** |
---|
222 | !!------------------------------------------------------------------- |
---|
223 | USE lib_mpp, ONLY: ctl_warn |
---|
224 | !!------------------------------------------------------------------- |
---|
225 | ! |
---|
226 | ALLOCATE( cvol(jpi,jpj,jpk ) , & |
---|
227 | & trn (jpi,jpj,jpk,jptra) , & |
---|
228 | & tra (jpi,jpj,jpk,jptra) , & |
---|
229 | & trb (jpi,jpj,jpk,jptra) , & |
---|
230 | & gtru(jpi,jpj ,jptra) , gtrv(jpi,jpj,jptra) , & |
---|
231 | # if defined key_diatrc && ! defined key_iomput |
---|
232 | & trc2d(jpi,jpj,jpdia2d), trc3d(jpi,jpj,jpk,jpdia3d), & |
---|
233 | # endif |
---|
234 | # if defined key_diabio |
---|
235 | & trbio(jpi,jpj,jpk,jpdiabio), & |
---|
236 | #endif |
---|
237 | rdttrc(jpk) , STAT=trc_alloc ) |
---|
238 | |
---|
239 | IF( trc_alloc /= 0 ) CALL ctl_warn('trc_alloc: failed to allocate arrays') |
---|
240 | ! |
---|
241 | END FUNCTION trc_alloc |
---|
242 | |
---|
243 | #else |
---|
244 | !!---------------------------------------------------------------------- |
---|
245 | !! Empty module : No passive tracer |
---|
246 | !!---------------------------------------------------------------------- |
---|
247 | #endif |
---|
248 | |
---|
249 | !!====================================================================== |
---|
250 | END MODULE trc |
---|