[186] | 1 | MODULE trc |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE trc *** |
---|
| 4 | !! Passive tracers : module for tracers defined |
---|
| 5 | !!====================================================================== |
---|
| 6 | !! History : |
---|
| 7 | !! 8.2 ! 96-01 (M. Levy) Original code |
---|
| 8 | !! ! 99-07 (M. Levy) for LOBSTER1 or NPZD model |
---|
| 9 | !! ! 00-04 (O. Aumont, M.A. Foujols) HAMOCC3 and P3ZD |
---|
| 10 | !! 9.0 ! 04-03 (C. Ethe) Free form and module |
---|
| 11 | !!---------------------------------------------------------------------- |
---|
[340] | 12 | !! TOP 1.0, LOCEAN-IPSL (2005) |
---|
| 13 | !! $Header$ |
---|
| 14 | !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt |
---|
[274] | 15 | !!---------------------------------------------------------------------- |
---|
[186] | 16 | #if defined key_passivetrc |
---|
| 17 | !!---------------------------------------------------------------------- |
---|
| 18 | !! 'key_passivetrc' : Passive tracer |
---|
| 19 | !!--------------------------------------------------------------------- |
---|
| 20 | !! * Modules used |
---|
| 21 | USE par_oce |
---|
| 22 | USE par_trc |
---|
| 23 | IMPLICIT NONE |
---|
| 24 | |
---|
| 25 | PUBLIC |
---|
| 26 | |
---|
| 27 | |
---|
| 28 | !! passive tracers names and units (read in namelist) |
---|
| 29 | !! -------------------------------------------------- |
---|
| 30 | CHARACTER(len=12), PUBLIC, DIMENSION(jptra) :: & |
---|
| 31 | ctrcnm , & !!: tracer name |
---|
| 32 | ctrcun !!: tracer unit |
---|
| 33 | |
---|
| 34 | CHARACTER(len=80), PUBLIC, DIMENSION(jptra) :: & |
---|
| 35 | ctrcnl !!: tracer long name |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | !! parameters for the control of passive tracers |
---|
| 39 | !! -------------------------------------------------- |
---|
| 40 | INTEGER, PUBLIC :: & |
---|
| 41 | numnat !!: the number of the passive tracer NAMELIST |
---|
| 42 | |
---|
| 43 | LOGICAL, PUBLIC, DIMENSION(jptra) :: & |
---|
| 44 | lutini !!: initialisation from FILE or not (NAMELIST) |
---|
| 45 | |
---|
| 46 | INTEGER , PUBLIC, DIMENSION(jptra) :: & |
---|
| 47 | nutini !!: FORTRAN LOGICAL UNIT for initialisation file |
---|
| 48 | |
---|
| 49 | !! passive tracers fields (before,now,after) |
---|
| 50 | !! -------------------------------------------------- |
---|
[433] | 51 | REAL(wp), PUBLIC, SAVE :: & |
---|
| 52 | trai , & !!: initial total tracer |
---|
| 53 | areatot !!: total volume |
---|
[186] | 54 | |
---|
| 55 | REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk,jptra) :: & |
---|
| 56 | trn , & !!: traceur concentration for actual time step |
---|
| 57 | tra , & !!: traceur concentration for next time step |
---|
| 58 | trb !!: traceur concentration for before time step |
---|
| 59 | |
---|
| 60 | |
---|
| 61 | !! numerical parameter (NAMELIST) |
---|
| 62 | !! -------------------------------------------------- |
---|
| 63 | REAL(wp), PUBLIC :: & |
---|
| 64 | rsc , & !!: tuning coefficient for anti-diffusion |
---|
| 65 | rtrn !!: value for truncation |
---|
| 66 | |
---|
| 67 | !! namelist parameters |
---|
| 68 | !! -------------------------------------------------- |
---|
| 69 | INTEGER , PUBLIC :: & |
---|
| 70 | ncortrc , & !!: number of corrective phases |
---|
| 71 | ndttrc , & !!: frequency of step on passive tracers |
---|
| 72 | nittrc000 !!: first time step of passive tracers model |
---|
| 73 | |
---|
| 74 | LOGICAL, PUBLIC :: & |
---|
| 75 | crosster !!: logical if true computes crossterms |
---|
| 76 | |
---|
| 77 | |
---|
| 78 | !! isopycnal scheme for passive tracers |
---|
| 79 | !! -------------------------------------------------- |
---|
| 80 | REAL(wp), PUBLIC :: & |
---|
| 81 | ahtrb0 , & !!: background diffusivity coefficient for passive tracer (m2/s) |
---|
| 82 | trcrat , & !!: ratio between passive and active tracer coeff for diffusion |
---|
| 83 | ahtrc0 , & !!: horizontal eddy diffusivity for passive tracers (m2/s) |
---|
| 84 | aeivtr0 !!: eddy induced velocity coefficient (m2/s) |
---|
| 85 | |
---|
| 86 | |
---|
| 87 | !! passive tracers restart (input and output) |
---|
| 88 | !! -------------------------------------------------- |
---|
| 89 | LOGICAL, PUBLIC :: & |
---|
| 90 | lrsttr !!: boolean term for restart i/o for passive tracers (namelist) |
---|
| 91 | |
---|
| 92 | INTEGER , PUBLIC :: & |
---|
| 93 | nutwrs , & !!: output FILE for passive tracers restart |
---|
| 94 | nutrst , & !!: logical unit for restart FILE for passive tracers |
---|
| 95 | nrsttr !!: control of the time step ( 0 or 1 ) for pass. tr. |
---|
| 96 | |
---|
| 97 | #if defined key_partial_steps |
---|
| 98 | |
---|
| 99 | !! interpolated gradient |
---|
| 100 | !!-------------------------------------------------- |
---|
| 101 | REAL (wp), PUBLIC, DIMENSION (jpi,jpj,jptra) :: & |
---|
| 102 | gtru , & !!: horizontal gradient at u-points at bottom ocean level |
---|
| 103 | gtrv !!: horizontal gradient at v-points at bottom ocean level |
---|
| 104 | #else |
---|
| 105 | REAL (wp), PUBLIC :: & |
---|
| 106 | gtru , & !!: horizontal gradient at u-points at bottom ocean level |
---|
| 107 | gtrv !!: horizontal gradient at v-points at bottom ocean level |
---|
| 108 | |
---|
| 109 | #endif |
---|
| 110 | |
---|
[197] | 111 | #if defined key_trcldf_eiv && defined key_diaeiv |
---|
[186] | 112 | !! The three component of the eddy induced velocity |
---|
| 113 | !! -------------------------------------------------- |
---|
| 114 | REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk) :: & |
---|
| 115 | u_trc_eiv, & !!: u-eiv (m/s) |
---|
| 116 | v_trc_eiv, & !!: v-eiv (m/s) |
---|
| 117 | w_trc_eiv !!: w-eiv (m/s) |
---|
| 118 | #endif |
---|
| 119 | |
---|
| 120 | |
---|
| 121 | !! information for outputs |
---|
| 122 | !! -------------------------------------------------- |
---|
| 123 | INTEGER , PUBLIC :: & |
---|
[267] | 124 | nwritetrc !!: time step frequency for concentration outputs (namelist) |
---|
[186] | 125 | |
---|
[433] | 126 | #if defined key_trc_diaadd |
---|
[186] | 127 | !! additional 2D/3D outputs namelist |
---|
| 128 | !! -------------------------------------------------- |
---|
| 129 | CHARACTER(len=8), PUBLIC, DIMENSION (jpdia2d) :: & |
---|
| 130 | ctrc2d , & !!: 2d output field name |
---|
| 131 | ctrc2u !!: 2d output field unit |
---|
| 132 | |
---|
| 133 | CHARACTER(len=8), PUBLIC, DIMENSION (jpdia3d) :: & |
---|
| 134 | ctrc3d , & !!: 3d output field name |
---|
| 135 | ctrc3u !!: 3d output field unit |
---|
| 136 | |
---|
| 137 | CHARACTER(len=80), PUBLIC, DIMENSION (jpdia2d) :: & |
---|
| 138 | ctrc2l !!: 2d output field long name |
---|
| 139 | |
---|
| 140 | CHARACTER(len=80), PUBLIC, DIMENSION (jpdia3d) :: & |
---|
| 141 | ctrc3l !!: 3d output field long name |
---|
| 142 | |
---|
| 143 | REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpdia2d) :: & |
---|
| 144 | trc2d !!: additional 2d outputs |
---|
| 145 | |
---|
| 146 | REAL(wp), PUBLIC, DIMENSION (jpi,jpj,jpk,jpdia3d) :: & |
---|
| 147 | trc3d !!: additional 3d outputs |
---|
| 148 | |
---|
| 149 | |
---|
| 150 | !! netcdf files and index common |
---|
| 151 | !! -------------------------------------------------- |
---|
| 152 | INTEGER , PUBLIC :: & |
---|
[267] | 153 | nwriteadd !!: frequency of additional arrays outputs(namelist) |
---|
[186] | 154 | #endif |
---|
| 155 | |
---|
[433] | 156 | #if defined key_trc_diatrd |
---|
[186] | 157 | |
---|
| 158 | !! non conservative trends (biological, ...) |
---|
| 159 | !! -------------------------------------------------- |
---|
| 160 | LOGICAL, PUBLIC, DIMENSION (jptra) :: & |
---|
| 161 | luttrd !!: large trends diagnostic to write or not (namelist) |
---|
| 162 | |
---|
| 163 | !! dynamical trends |
---|
| 164 | !! trtrd() : trends of the tracer equations |
---|
| 165 | !! 1 : X advection |
---|
| 166 | !! 2 : Y advection |
---|
| 167 | !! 3 : Z advection |
---|
| 168 | !! 4 : X diffusion |
---|
| 169 | !! 5 : Y diffusion |
---|
| 170 | !! 6 : Z diffusion |
---|
| 171 | !! 7 : X gent velocity |
---|
| 172 | !! 8 : Y gent velocity |
---|
| 173 | !! 9 : Z gent velocity |
---|
| 174 | !! -------------------------------------------------- |
---|
| 175 | |
---|
| 176 | |
---|
[433] | 177 | REAL(wp), PUBLIC, DIMENSION(:,:,:,:,:), ALLOCATABLE, SAVE :: & |
---|
[186] | 178 | trtrd !!: trends of the tracer equations |
---|
| 179 | |
---|
[433] | 180 | INTEGER, PUBLIC, DIMENSION(jptra), SAVE :: ikeep ! indice of tracer for which dyn trends are stored |
---|
| 181 | INTEGER, PUBLIC, SAVE :: nkeep ! number of tracers for which dyn trends are stored |
---|
| 182 | ! (used to allocate trtrd buffer) |
---|
| 183 | |
---|
[186] | 184 | !! netcdf files and index common |
---|
| 185 | !! -------------------------------------------------- |
---|
| 186 | INTEGER , PUBLIC :: & |
---|
| 187 | nwritetrd !!: frequency of additional arrays outputs(namelist) |
---|
| 188 | |
---|
| 189 | #endif |
---|
| 190 | |
---|
| 191 | !! passive tracers data read and at given time_step |
---|
| 192 | !! -------------------------------------------------- |
---|
| 193 | #if defined key_trc_dta |
---|
| 194 | |
---|
| 195 | INTEGER , PUBLIC, DIMENSION(jptra) :: & |
---|
[267] | 196 | numtr !!: logical unit for passive tracers data |
---|
[186] | 197 | |
---|
| 198 | #endif |
---|
| 199 | |
---|
| 200 | #else |
---|
| 201 | !!====================================================================== |
---|
| 202 | !! Empty module : No passive tracer |
---|
| 203 | !!====================================================================== |
---|
| 204 | #endif |
---|
| 205 | |
---|
| 206 | END MODULE trc |
---|