New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
oce_trc.F90 in trunk/NEMOGCM/NEMO/TOP_SRC – NEMO

source: trunk/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90 @ 3294

Last change on this file since 3294 was 3294, checked in by rblod, 12 years ago

Merge of 3.4beta into the trunk

  • Property svn:keywords set to Id
File size: 19.6 KB
Line 
1MODULE oce_trc
2   !!======================================================================
3   !!                      ***  MODULE  oce_trc  ***
4   !! TOP :   variables shared between ocean and passive tracers
5   !!======================================================================
6   !! History :   1.0  !  2004-03  (C. Ethe)  original code
7   !!             2.0  !  2007-12 (C. Ethe, G. Madec)  rewritting
8   !!----------------------------------------------------------------------
9#if defined key_top
10   !!----------------------------------------------------------------------
11   !!   'key_top'                                                TOP models
12   !!----------------------------------------------------------------------
13
14   !* Domain size *
15   USE par_oce , ONLY :   cp_cfg   =>   cp_cfg     !: name of the configuration
16   USE par_oce , ONLY :   jp_cfg   =>   jp_cfg     !: resolution of the configuration
17   USE par_oce , ONLY :   jpiglo   =>   jpiglo     !: first  dimension of global domain --> i
18   USE par_oce , ONLY :   jpjglo   =>   jpjglo     !: second dimension of global domain --> j
19   USE par_oce , ONLY :   jpi      =>   jpi        !: first  dimension of grid --> i
20   USE par_oce , ONLY :   jpj      =>   jpj        !: second dimension of grid --> j 
21   USE par_oce , ONLY :   jpk      =>   jpk        !: number of levels 
22   USE par_oce , ONLY :   jpim1    =>   jpim1      !: jpi - 1
23   USE par_oce , ONLY :   jpjm1    =>   jpjm1      !: jpj - 1
24   USE par_oce , ONLY :   jpkm1    =>   jpkm1      !: jpk - 1 
25   USE par_oce , ONLY :   jpij     =>   jpij       !: jpi x jpj
26   USE par_oce , ONLY :   jpidta   =>   jpidta     !: first horizontal dimension  > or = jpi
27   USE par_oce , ONLY :   jpjdta   =>   jpjdta     !: second horizontal dimension > or = jpj
28   USE par_oce , ONLY :   jpkdta   =>   jpkdta     !: number of levels            > or = jpk
29   USE par_oce , ONLY :   lk_esopa =>   lk_esopa   !: flag to activate the all option
30   USE par_oce , ONLY :   jp_tem   =>   jp_tem     !: indice for temperature
31   USE par_oce , ONLY :   jp_sal   =>   jp_sal     !: indice for salinity
32
33   !* IO manager *
34   USE in_out_manager   
35 
36   !* Memory Allocation *
37   USE wrk_nemo     
38 
39   !* Timing *
40   USE timing   
41 
42   !* MPP library                         
43   USE lib_mpp 
44
45   !* Fortran utilities                         
46   USE lib_fortran
47
48   !* Lateral boundary conditions                         
49   USE lbclnk
50
51   !* physical constants *
52   USE phycst           
53
54   !* 1D configuration
55   USE c1d                                         
56
57   !* model domain *
58   USE dom_oce , ONLY :   lzoom      => lzoom        !: zoom flag
59   USE dom_oce , ONLY :   lzoom_e    => lzoom_e      !: East  zoom type flag
60   USE dom_oce , ONLY :   lzoom_w    => lzoom_w      !: West  zoom type flag
61   USE dom_oce , ONLY :   lzoom_s    => lzoom_s      !: South zoom type flag
62   USE dom_oce , ONLY :   lzoom_n    => lzoom_n      !: North zoom type flag
63   USE dom_oce , ONLY :   lzoom_arct => lzoom_arct   !: ORCA    arctic zoom flag
64   USE dom_oce , ONLY :   lzoom_anta => lzoom_anta   !: ORCA antarctic zoom flag
65   USE dom_oce , ONLY :   nperio     =>   nperio     !: type of lateral boundary condition       
66   USE dom_oce , ONLY :   nimpp      =>   nimpp      !: i index for mpp-subdomain left bottom
67   USE dom_oce , ONLY :   njmpp      =>   njmpp      !: j index for mpp-subdomain left bottom
68   USE dom_oce , ONLY :   nproc      =>   nproc      !: number for local processor
69   USE dom_oce , ONLY :   narea      =>   narea      !: number for local area
70   USE dom_oce , ONLY :   mig        =>   mig        !: local  ==> global  domain i-indice
71   USE dom_oce , ONLY :   mjg        =>   mjg        !: local  ==> global  domain i-indice
72   USE dom_oce , ONLY :   mi0        =>   mi0        !: global ==> local domain i-indice
73   USE dom_oce , ONLY :   mi1        =>   mi1        !: (mi0=1 and mi1=0 if the global indice is not in the local one)
74   USE dom_oce , ONLY :   mj0        =>   mj0        !: global ==> local domain j-indice
75   USE dom_oce , ONLY :   mj1        =>   mj1        !: (mj0=1 and mj1=0 if the global indice is not in the local one)
76   USE dom_oce , ONLY :   nidom      =>   nidom
77   USE dom_oce , ONLY :   nimppt     => nimppt     !:i-indexes for each processor
78   USE dom_oce , ONLY :   njmppt     => njmppt       !:j-indexes for each processor
79   USE dom_oce , ONLY :   ibonit     => ibonit       !:i-processor neighbour existence
80   USE dom_oce , ONLY :   ibonjt     => ibonjt       !:j- processor neighbour existence
81   USE dom_oce , ONLY :   nlci       => nlci         !:i- & j-dimensions of the local subdomain
82   USE dom_oce , ONLY :   nlcj       => nlcj         !:
83   USE dom_oce , ONLY :   nldi       => nldi         !:first and last indoor i- and j-indexes
84   USE dom_oce , ONLY :   nlei       => nlei         !:
85   USE dom_oce , ONLY :   nldj       => nldj         !:
86   USE dom_oce , ONLY :   nlej       => nlej         !:
87   USE dom_oce , ONLY :   nlcit      => nlcit        !:dimensions of every i-subdomain
88   USE dom_oce , ONLY :   nlcjt      => nlcjt        !:dimensions of every j-subdomain
89   USE dom_oce , ONLY :   nldit      => nldit        !:first indoor index for each i-domain
90   USE dom_oce , ONLY :   nleit      => nleit        !:last indoor index for each i-domain
91   USE dom_oce , ONLY :   nldjt      => nldjt        !:first indoor index for each j-domain
92   USE dom_oce , ONLY :   nlejt      => nlejt        !:last indoor index for each j-domain
93 
94   !* horizontal mesh *
95   USE dom_oce , ONLY :   glamt      =>   glamt      !: longitude of t-point (degre) 
96   USE dom_oce , ONLY :   glamu      =>   glamu      !: longitude of t-point (degre) 
97   USE dom_oce , ONLY :   glamv      =>   glamv      !: longitude of t-point (degre) 
98   USE dom_oce , ONLY :   glamf      =>   glamf      !: longitude of t-point (degre) 
99   USE dom_oce , ONLY :   gphit      =>   gphit      !: latitude  of t-point (degre)   
100   USE dom_oce , ONLY :   gphiu      =>   gphiu      !: latitude  of t-point (degre)   
101   USE dom_oce , ONLY :   gphiv      =>   gphiv      !: latitude  of t-point (degre)   
102   USE dom_oce , ONLY :   gphif      =>   gphif      !: latitude  of t-point (degre)   
103   USE dom_oce , ONLY :   e1t        =>   e1t        !: horizontal scale factors at t-point (m) 
104   USE dom_oce , ONLY :   e2t        =>   e2t        !: horizontal scale factors at t-point (m)   
105   USE dom_oce , ONLY :   e1e2t      =>   e1e2t      !: cell surface at t-point (m2)
106   USE dom_oce , ONLY :   e1u        =>   e1u        !: horizontal scale factors at u-point (m)
107   USE dom_oce , ONLY :   e2u        =>   e2u        !: horizontal scale factors at u-point (m)
108   USE dom_oce , ONLY :   e1v        =>   e1v        !: horizontal scale factors at v-point (m)
109   USE dom_oce , ONLY :   e2v        =>   e2v        !: horizontal scale factors at v-point (m) 
110
111   !* vertical mesh *
112   USE dom_oce , ONLY :   gdept_0    =>   gdept_0    !: reference depth of t-points (m)
113   USE dom_oce , ONLY :   e3t_0      =>   e3t_0      !: reference depth of t-points (m) 
114   USE dom_oce , ONLY :   e3w_0      =>   e3w_0      !: reference depth of w-points (m)
115   USE dom_oce , ONLY :   gdepw_0    =>   gdepw_0    !: reference depth of w-points (m)
116# if ! defined key_zco
117   USE dom_oce , ONLY :   gdep3w     =>  gdep3w      !: ???
118   USE dom_oce , ONLY :   gdept      =>  gdept       !: depth of t-points (m)
119   USE dom_oce , ONLY :   gdepw      =>  gdepw       !: depth of t-points (m)
120   USE dom_oce , ONLY :   e3t        =>  e3t         !: vertical scale factors at t-
121   USE dom_oce , ONLY :   e3u        =>  e3u         !: vertical scale factors at u-
122   USE dom_oce , ONLY :   e3v        =>  e3v         !: vertical scale factors v-
123   USE dom_oce , ONLY :   e3w        =>  e3w         !: w-points (m)
124   USE dom_oce , ONLY :   e3f        =>  e3f         !: f-points (m)
125   USE dom_oce , ONLY :   e3uw       =>  e3uw        !: uw-points (m)
126   USE dom_oce , ONLY :   e3vw       =>  e3vw        !: vw-points (m)
127# endif
128   USE dom_oce , ONLY :   ln_zps     =>  ln_zps      !: partial steps flag
129   USE dom_oce , ONLY :   ln_sco     =>  ln_sco      !: s-coordinate flag
130   USE dom_oce , ONLY :   ln_zco     =>  ln_zco      !: z-coordinate flag
131   USE dom_oce , ONLY :   hbatt      =>  hbatt       !: ocean depth at the vertical of  t-point (m)
132   USE dom_oce , ONLY :   hbatu      =>  hbatu       !: ocean depth at the vertical of  u-point (m)
133   USE dom_oce , ONLY :   hbatv      =>  hbatv       !: ocean depth at the vertical of w-point (m)
134   USE dom_oce , ONLY :   gsigt      =>  gsigt       !: model level depth coefficient at T-levels
135   USE dom_oce , ONLY :   gsigw      =>  gsigw       !: model level depth coefficient at W-levels
136   USE dom_oce , ONLY :   gsi3w      =>  gsi3w       !: model level depth coef at w-levels (defined as the sum of e3w)
137   USE dom_oce , ONLY :   esigt      =>  esigt       !: vertical scale factor coef. at t-levels
138   USE dom_oce , ONLY :   esigw      =>  esigw       !: vertical scale factor coef. at w-levels
139   USE dom_oce , ONLY :   lk_vvl     =>  lk_vvl      !: variable grid flag
140# if defined key_vvl
141   USE dom_oce , ONLY :   gdep3w_1   =>  gdep3w_1    !: ???
142   USE dom_oce , ONLY :   gdept_1    =>  gdept_1     !: depth of t-points (m)
143   USE dom_oce , ONLY :   gdepw_1    =>  gdepw_1     !: depth of t-points (m)
144   USE dom_oce , ONLY :   e3t_1      =>  e3t_1       !: vertical scale factors at t-
145   USE dom_oce , ONLY :   e3u_1      =>  e3u_1       !: vertical scale factors at u-
146   USE dom_oce , ONLY :   e3v_1      =>  e3v_1       !: vertical scale factors v-
147   USE dom_oce , ONLY :   e3w_1      =>  e3w_1       !: w-points (m)
148   USE dom_oce , ONLY :   e3f_1      =>  e3f_1       !: f-points (m)
149   USE dom_oce , ONLY :   e3uw_1     =>  e3uw_1      !: uw-points (m)
150   USE dom_oce , ONLY :   e3vw_1     =>  e3vw_1      !: vw-points (m)
151# endif
152   !* masks, bathymetry *
153   USE dom_oce , ONLY :   mbkt       =>   mbkt       !: vertical index of the bottom last T- ocean level
154   USE dom_oce , ONLY :   mbku       =>   mbku       !: vertical index of the bottom last U- ocean level
155   USE dom_oce , ONLY :   mbkv       =>   mbkv       !: vertical index of the bottom last V- ocean level
156   USE dom_oce , ONLY :   tmask_i    =>   tmask_i    !: Interior mask at t-points
157   USE dom_oce , ONLY :   tmask      =>   tmask      !: land/ocean mask at t-points
158   USE dom_oce , ONLY :   umask      =>   umask      !: land/ocean mask at u-points   
159   USE dom_oce , ONLY :   vmask      =>   vmask      !: land/ocean mask at v-points
160   USE dom_oce , ONLY :   fmask      =>   fmask      !: land/ocean mask at f-points
161
162   !* time domain *
163   USE dom_oce , ONLY :   neuler     =>   neuler     !: restart euler forward option (0=Euler)
164   USE dom_oce , ONLY :   rdt        =>   rdt        !: time step for the dynamics
165   USE dom_oce , ONLY :   atfp       =>   atfp       !: asselin time filter parameter
166   USE dom_oce , ONLY :   atfp1      =>   atfp1      !: asselin time filter coeff. (atfp1= 1-2*atfp)
167   USE dom_oce , ONLY :   rdttra     =>   rdttra     !: vertical profile of tracer time step
168   !                                                 !: it is the accumulated duration of previous runs
169   !                                                 !: that may have been run with different time steps.
170   !* calendar variables *
171   USE dom_oce , ONLY :   nyear      =>   nyear      !: current year
172   USE dom_oce , ONLY :   nmonth     =>   nmonth     !: current month
173   USE dom_oce , ONLY :   nday       =>   nday       !: current day of the month
174   USE dom_oce , ONLY :   ndastp     =>   ndastp     !: time step date in yyyymmdd format
175   USE dom_oce , ONLY :   nday_year  =>   nday_year  !: current day counted from jan 1st of the current year
176   USE dom_oce , ONLY :   nsec_year  =>   nsec_year  !: current time step counted in second since 00h jan 1st of the current year
177   USE dom_oce , ONLY :   nsec_month =>   nsec_month !: current time step counted in second since 00h 1st day of the current month
178   USE dom_oce , ONLY :   nsec_day   =>   nsec_day   !: current time step counted in second since 00h of the current day
179   USE dom_oce , ONLY :   fjulday    =>   fjulday    !: julian day
180   USE dom_oce , ONLY :   adatrj     =>   adatrj     !: number of elapsed days since the begining of the whole simulation
181                                                     !: (cumulative duration of previous runs
182                                                     !: that may have used different time-step size)
183   USE dom_oce , ONLY :   nyear_len  =>   nyear_len  !: length in days of the previous/current year
184   USE dom_oce , ONLY :   nmonth_len =>   nmonth_len !: length in days of the months of the current year
185
186
187   !* ocean fields: here now and after fields *
188   USE oce , ONLY :   ua      =>    ua      !: i-horizontal velocity (m s-1)
189   USE oce , ONLY :   va      =>    va      !: j-horizontal velocity (m s-1)
190   USE oce , ONLY :   un      =>    un      !: i-horizontal velocity (m s-1)
191   USE oce , ONLY :   vn      =>    vn      !: j-horizontal velocity (m s-1)
192   USE oce , ONLY :   wn      =>    wn      !: vertical velocity (m s-1) 
193   USE oce , ONLY :   tsn     =>    tsn     !: 4D array contaning ( tn, sn )
194   USE oce , ONLY :   tsb     =>    tsb     !: 4D array contaning ( tb, sb )
195   USE oce , ONLY :   tsa     =>    tsa     !: 4D array contaning ( ta, sa )
196   USE oce , ONLY :   rhop    =>    rhop    !: potential volumic mass (kg m-3)
197   USE oce , ONLY :   rhd     =>    rhd     !: in situ density anomalie rhd=(rho-rau0)/rau0 (no units)
198   USE oce , ONLY :   hdivn   =>    hdivn   !: horizontal divergence (1/s)
199   USE oce , ONLY :   rotn    =>    rotn    !: relative vorticity    [s-1]
200   USE oce , ONLY :   hdivb   =>    hdivb   !: horizontal divergence (1/s)
201   USE oce , ONLY :   rotb    =>    rotb    !: relative vorticity    [s-1]
202   USE oce , ONLY :   sshn    =>    sshn    !: sea surface height at t-point [m]   
203   USE oce , ONLY :   sshb    =>    sshb    !: sea surface height at t-point [m]   
204   USE oce , ONLY :   ssha    =>    ssha    !: sea surface height at t-point [m]   
205   USE oce , ONLY :   sshu_n  =>    sshu_n  !: sea surface height at u-point [m]   
206   USE oce , ONLY :   sshu_b  =>    sshu_b  !: sea surface height at u-point [m]   
207   USE oce , ONLY :   sshu_a  =>    sshu_a  !: sea surface height at u-point [m]   
208   USE oce , ONLY :   sshv_n  =>    sshv_n  !: sea surface height at v-point [m]   
209   USE oce , ONLY :   sshv_b  =>    sshv_b  !: sea surface height at v-point [m]   
210   USE oce , ONLY :   sshv_a  =>    sshv_a  !: sea surface height at v-point [m]   
211   USE oce , ONLY :   sshf_n  =>    sshf_n  !: sea surface height at v-point [m]   
212   USE oce , ONLY :   l_traldf_rot => l_traldf_rot  !: rotated laplacian operator for lateral diffusion
213#if defined key_offline
214   USE oce , ONLY :   gtsu    =>    gtsu    !: t-, s- and rd horizontal gradient at u- and
215   USE oce , ONLY :   gtsv    =>    gtsv    !:
216   USE oce , ONLY :   gru     =>    gru     !:
217   USE oce , ONLY :   grv     =>    grv     !:
218#endif
219
220   USE dom_oce , ONLY :   nn_cla    =>  nn_cla        !: flag (0/1) for cross land advection
221
222   !* surface fluxes *
223   USE sbc_oce , ONLY :   utau       =>    utau       !: i-surface stress component
224   USE sbc_oce , ONLY :   vtau       =>    vtau       !: j-surface stress component
225   USE sbc_oce , ONLY :   wndm       =>    wndm       !: 10m wind speed
226   USE sbc_oce , ONLY :   qsr        =>    qsr        !: penetrative solar radiation (w m-2) 
227   USE sbc_oce , ONLY :   emp        =>    emp        !: freshwater budget: volume flux               [Kg/m2/s]
228   USE sbc_oce , ONLY :   emp_b      =>    emp_b      !: freshwater budget: volume flux               [Kg/m2/s]
229   USE sbc_oce , ONLY :   emps       =>    emps       !: freshwater budget: concentration/dillution   [Kg/m2/s]
230   USE sbc_oce , ONLY :   rnf        =>    rnf        !: river runoff   [Kg/m2/s]
231   USE sbc_oce , ONLY :   ln_dm2dc   =>    ln_dm2dc   !: Daily mean to Diurnal Cycle short wave (qsr)
232   USE sbc_oce , ONLY :   ln_rnf     =>    ln_rnf     !: runoffs / runoff mouths
233   USE sbc_oce , ONLY :   fr_i       =>    fr_i       !: ice fraction (between 0 to 1)
234   USE traqsr  , ONLY :   rn_abs     =>    rn_abs     !: fraction absorbed in the very near surface
235   USE traqsr  , ONLY :   rn_si0     =>    rn_si0     !: very near surface depth of extinction
236   USE traqsr  , ONLY :   ln_qsr_bio =>    ln_qsr_bio !: flag to use or not the biological fluxes for light
237   USE sbcrnf  , ONLY :   rnfmsk     =>    rnfmsk     !: mixed adv scheme in runoffs vicinity (hori.)
238   USE sbcrnf  , ONLY :   rnfmsk_z   =>    rnfmsk_z   !: mixed adv scheme in runoffs vicinity (vert.)
239   USE sbcrnf  , ONLY :   h_rnf      =>    h_rnf      !: river runoff   [Kg/m2/s]
240
241   USE trc_oce
242
243   !* lateral diffusivity (tracers) *
244   USE ldftra_oce , ONLY :  rldf     =>   rldf        !: multiplicative coef. for lateral diffusivity
245   USE ldftra_oce , ONLY :  rn_aht_0 =>   rn_aht_0    !: horizontal eddy diffusivity for tracers (m2/s)
246   USE ldftra_oce , ONLY :  aht0     =>   aht0        !: horizontal eddy diffusivity for tracers (m2/s)
247   USE ldftra_oce , ONLY :  ahtb0    =>   ahtb0       !: background eddy diffusivity for isopycnal diff. (m2/s)
248   USE ldftra_oce , ONLY :  ahtu     =>   ahtu        !: lateral diffusivity coef. at u-points
249   USE ldftra_oce , ONLY :  ahtv     =>   ahtv        !: lateral diffusivity coef. at v-points
250   USE ldftra_oce , ONLY :  ahtw     =>   ahtw        !: lateral diffusivity coef. at w-points
251   USE ldftra_oce , ONLY :  ahtt     =>   ahtt        !: lateral diffusivity coef. at t-points
252   USE ldftra_oce , ONLY :  aeiv0    =>   aeiv0       !: eddy induced velocity coefficient (m2/s)
253   USE ldftra_oce , ONLY :  aeiu     =>   aeiu        !: eddy induced velocity coef. at u-points (m2/s)   
254   USE ldftra_oce , ONLY :  aeiv     =>   aeiv        !: eddy induced velocity coef. at v-points (m2/s)
255   USE ldftra_oce , ONLY :  aeiw     =>   aeiw        !: eddy induced velocity coef. at w-points (m2/s)
256   USE ldftra_oce , ONLY :  lk_traldf_eiv  =>  lk_traldf_eiv     !: eddy induced velocity flag
257
258   !* vertical diffusion *
259   USE zdf_oce , ONLY :   avt        =>   avt         !: vert. diffusivity coef. at w-point for temp 
260# if defined key_zdfddm
261   USE zdfddm  , ONLY :   avs        =>   avs         !: salinity vertical diffusivity coeff. at w-point
262# endif
263
264   !* mixing & mixed layer depth *
265   USE zdfmxl , ONLY :   nmln        =>   nmln        !: number of level in the mixed layer
266   USE zdfmxl , ONLY :   hmld        =>   hmld        !: mixing layer depth (turbocline)
267   USE zdfmxl , ONLY :   hmlp        =>   hmlp        !: mixed layer depth  (rho=rho0+zdcrit) (m)
268   USE zdfmxl , ONLY :   hmlpt       =>   hmlpt       !: mixed layer depth at t-points (m)
269
270   !* direction of lateral diffusion *
271   USE ldfslp , ONLY :   lk_ldfslp  =>  lk_ldfslp     !: slopes flag
272# if   defined key_ldfslp
273   USE ldfslp , ONLY :   uslp       =>   uslp         !: i-direction slope at u-, w-points
274   USE ldfslp , ONLY :   vslp       =>   vslp         !: j-direction slope at v-, w-points
275   USE ldfslp , ONLY :   wslpi      =>   wslpi        !: i-direction slope at u-, w-points
276   USE ldfslp , ONLY :   wslpj      =>   wslpj        !: j-direction slope at v-, w-points
277# endif
278
279#else
280   !!----------------------------------------------------------------------
281   !!  Empty module :                                     No passive tracer
282   !!----------------------------------------------------------------------
283#endif
284
285   !!----------------------------------------------------------------------
286   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
287   !! $Id$
288   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
289   !!======================================================================
290END MODULE oce_trc
Note: See TracBrowser for help on using the repository browser.