[186] | 1 | MODULE trc |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE trc *** |
---|
| 4 | !! Passive tracers : module for tracers defined |
---|
| 5 | !!====================================================================== |
---|
[2528] | 6 | !! History : OPA ! 1996-01 (M. Levy) Original code |
---|
[945] | 7 | !! - ! 1999-07 (M. Levy) for LOBSTER1 or NPZD model |
---|
| 8 | !! - ! 2000-04 (O. Aumont, M.A. Foujols) HAMOCC3 and P3ZD |
---|
[2528] | 9 | !! NEMO 1.0 ! 2004-03 (C. Ethe) Free form and module |
---|
[186] | 10 | !!---------------------------------------------------------------------- |
---|
[945] | 11 | #if defined key_top |
---|
[186] | 12 | !!---------------------------------------------------------------------- |
---|
[945] | 13 | !! 'key_top' TOP models |
---|
| 14 | !!---------------------------------------------------------------------- |
---|
[186] | 15 | USE par_oce |
---|
| 16 | USE par_trc |
---|
[945] | 17 | |
---|
[186] | 18 | IMPLICIT NONE |
---|
| 19 | PUBLIC |
---|
| 20 | |
---|
[2715] | 21 | PUBLIC trc_alloc ! called by nemogcm.F90 |
---|
| 22 | |
---|
[186] | 23 | !! passive tracers names and units (read in namelist) |
---|
| 24 | !! -------------------------------------------------- |
---|
[945] | 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 |
---|
[186] | 28 | |
---|
| 29 | |
---|
| 30 | !! parameters for the control of passive tracers |
---|
| 31 | !! -------------------------------------------------- |
---|
[945] | 32 | INTEGER, PUBLIC :: numnat !: the number of the passive tracer NAMELIST |
---|
| 33 | LOGICAL, PUBLIC, DIMENSION(jptra) :: lutini !: initialisation from FILE or not (NAMELIST) |
---|
[2528] | 34 | LOGICAL, PUBLIC, DIMENSION(jptra) :: lutsav !: save the tracer or not |
---|
[186] | 35 | |
---|
| 36 | !! passive tracers fields (before,now,after) |
---|
| 37 | !! -------------------------------------------------- |
---|
[2528] | 38 | REAL(wp), PUBLIC :: trai !: initial total tracer |
---|
| 39 | REAL(wp), PUBLIC :: areatot !: total volume |
---|
[2715] | 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 |
---|
[186] | 44 | |
---|
[2528] | 45 | !! interpolated gradient |
---|
| 46 | !!-------------------------------------------------- |
---|
[2715] | 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 |
---|
[186] | 49 | |
---|
| 50 | !! passive tracers restart (input and output) |
---|
[945] | 51 | !! ------------------------------------------ |
---|
[2715] | 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) |
---|
[186] | 60 | |
---|
| 61 | !! information for outputs |
---|
| 62 | !! -------------------------------------------------- |
---|
[2528] | 63 | INTEGER , PUBLIC :: nn_writetrc !: time step frequency for concentration outputs (namelist) |
---|
[2715] | 64 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: rdttrc !: vertical profile of passive tracer time step |
---|
[186] | 65 | |
---|
[2528] | 66 | # if defined key_diatrc && ! defined key_iomput |
---|
[186] | 67 | !! additional 2D/3D outputs namelist |
---|
| 68 | !! -------------------------------------------------- |
---|
[2715] | 69 | INTEGER , PUBLIC :: nn_writedia !: frequency of additional arrays outputs(namelist) |
---|
| 70 | CHARACTER(len= 8), PUBLIC, DIMENSION(jpdia2d) :: ctrc2d !: 2d output field name |
---|
| 71 | CHARACTER(len= 8), PUBLIC, DIMENSION(jpdia2d) :: ctrc2u !: 2d output field unit |
---|
| 72 | CHARACTER(len= 8), PUBLIC, DIMENSION(jpdia3d) :: ctrc3d !: 3d output field name |
---|
| 73 | CHARACTER(len= 8), PUBLIC, DIMENSION(jpdia3d) :: ctrc3u !: 3d output field unit |
---|
| 74 | CHARACTER(len=80), PUBLIC, DIMENSION(jpdia2d) :: ctrc2l !: 2d output field long name |
---|
| 75 | CHARACTER(len=80), PUBLIC, DIMENSION(jpdia3d) :: ctrc3l !: 3d output field long name |
---|
[945] | 76 | |
---|
[2715] | 77 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:, :) :: trc2d !: additional 2d outputs |
---|
| 78 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trc3d !: additional 3d outputs |
---|
[945] | 79 | # endif |
---|
[433] | 80 | |
---|
[2715] | 81 | # if defined key_diabio || defined key_trdmld_trc |
---|
[2528] | 82 | ! !!* namtop_XXX namelist * |
---|
[2567] | 83 | INTEGER , PUBLIC :: nn_writebio !: time step frequency for biological outputs |
---|
[2528] | 84 | CHARACTER(len=8 ), PUBLIC, DIMENSION(jpdiabio) :: ctrbio !: biological trends name |
---|
| 85 | CHARACTER(len=20), PUBLIC, DIMENSION(jpdiabio) :: ctrbiu !: biological trends unit |
---|
| 86 | CHARACTER(len=80), PUBLIC, DIMENSION(jpdiabio) :: ctrbil !: biological trends long name |
---|
[2715] | 87 | # endif |
---|
[2528] | 88 | # if defined key_diabio |
---|
[1077] | 89 | !! Biological trends |
---|
| 90 | !! ----------------- |
---|
[2715] | 91 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trbio !: biological trends |
---|
[1077] | 92 | # endif |
---|
| 93 | |
---|
[186] | 94 | |
---|
| 95 | !! passive tracers data read and at given time_step |
---|
| 96 | !! -------------------------------------------------- |
---|
[945] | 97 | # if defined key_dtatrc |
---|
| 98 | INTEGER , PUBLIC, DIMENSION(jptra) :: numtr !: logical unit for passive tracers data |
---|
| 99 | # endif |
---|
[186] | 100 | |
---|
[2715] | 101 | !!---------------------------------------------------------------------- |
---|
| 102 | !! NEMO/TOP 3.3.1 , NEMO Consortium (2010) |
---|
| 103 | !! $Id$ |
---|
| 104 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
| 105 | !!---------------------------------------------------------------------- |
---|
| 106 | CONTAINS |
---|
| 107 | |
---|
| 108 | INTEGER FUNCTION trc_alloc() |
---|
| 109 | !!------------------------------------------------------------------- |
---|
| 110 | !! *** ROUTINE trc_alloc *** |
---|
| 111 | !!------------------------------------------------------------------- |
---|
| 112 | USE lib_mpp, ONLY: ctl_warn |
---|
| 113 | !!------------------------------------------------------------------- |
---|
| 114 | ! |
---|
| 115 | ALLOCATE( cvol(jpi,jpj,jpk ) , & |
---|
| 116 | & trn (jpi,jpj,jpk,jptra) , & |
---|
| 117 | & tra (jpi,jpj,jpk,jptra) , & |
---|
| 118 | & trb (jpi,jpj,jpk,jptra) , & |
---|
| 119 | & gtru(jpi,jpj ,jptra) , gtrv(jpi,jpj,jptra) , & |
---|
| 120 | # if defined key_diatrc && ! defined key_iomput |
---|
| 121 | & trc2d(jpi,jpj,jpdia2d), trc3d(jpi,jpj,jpk,jpdia3d), & |
---|
| 122 | # endif |
---|
| 123 | # if defined key_diabio |
---|
| 124 | & trbio(jpi,jpj,jpk,jpdiabio), & |
---|
| 125 | #endif |
---|
| 126 | rdttrc(jpk) , STAT=trc_alloc ) |
---|
| 127 | |
---|
| 128 | IF( trc_alloc /= 0 ) CALL ctl_warn('trc_alloc: failed to allocate arrays') |
---|
| 129 | ! |
---|
| 130 | END FUNCTION trc_alloc |
---|
| 131 | |
---|
[945] | 132 | #else |
---|
| 133 | !!---------------------------------------------------------------------- |
---|
| 134 | !! Empty module : No passive tracer |
---|
| 135 | !!---------------------------------------------------------------------- |
---|
[439] | 136 | #endif |
---|
| 137 | |
---|
[186] | 138 | !!====================================================================== |
---|
| 139 | END MODULE trc |
---|