[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 | !! - ! 2000-04 (O. Aumont, M.A. Foujols) HAMOCC3 and P3ZD |
---|
[2528] | 8 | !! NEMO 1.0 ! 2004-03 (C. Ethe) Free form and module |
---|
[186] | 9 | !!---------------------------------------------------------------------- |
---|
[945] | 10 | #if defined key_top |
---|
[186] | 11 | !!---------------------------------------------------------------------- |
---|
[945] | 12 | !! 'key_top' TOP models |
---|
| 13 | !!---------------------------------------------------------------------- |
---|
[186] | 14 | USE par_oce |
---|
| 15 | USE par_trc |
---|
[6140] | 16 | #if defined key_bdy |
---|
| 17 | USE bdy_oce, only: nb_bdy, OBC_DATA |
---|
| 18 | #endif |
---|
[945] | 19 | |
---|
[186] | 20 | IMPLICIT NONE |
---|
| 21 | PUBLIC |
---|
| 22 | |
---|
[2715] | 23 | PUBLIC trc_alloc ! called by nemogcm.F90 |
---|
| 24 | |
---|
[186] | 25 | !! parameters for the control of passive tracers |
---|
[4147] | 26 | !! --------------------------------------------- |
---|
| 27 | INTEGER, PUBLIC :: numnat_ref = -1 !: logical unit for the reference passive tracer namelist_top_ref |
---|
| 28 | INTEGER, PUBLIC :: numnat_cfg = -1 !: logical unit for the reference passive tracer namelist_top_cfg |
---|
| 29 | INTEGER, PUBLIC :: numont = -1 !: logical unit for the reference passive tracer namelist output output.namelist.top |
---|
[7041] | 30 | INTEGER, PUBLIC :: numtrc_ref = -1 !: logical unit for the reference passive tracer namelist_top_ref |
---|
| 31 | INTEGER, PUBLIC :: numtrc_cfg = -1 !: logical unit for the reference passive tracer namelist_top_cfg |
---|
| 32 | INTEGER, PUBLIC :: numonr = -1 !: logical unit for the reference passive tracer namelist output output.namelist.top |
---|
[3294] | 33 | INTEGER, PUBLIC :: numstr !: logical unit for tracer statistics |
---|
[3680] | 34 | INTEGER, PUBLIC :: numrtr !: logical unit for trc restart (read ) |
---|
| 35 | INTEGER, PUBLIC :: numrtw !: logical unit for trc restart ( write ) |
---|
[186] | 36 | |
---|
| 37 | !! passive tracers fields (before,now,after) |
---|
| 38 | !! -------------------------------------------------- |
---|
[3294] | 39 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: trai !: initial total tracer |
---|
| 40 | REAL(wp), PUBLIC :: areatot !: total volume |
---|
| 41 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,: ) :: cvol !: volume correction -degrad option- |
---|
[5385] | 42 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trn !: tracer concentration for now time step |
---|
| 43 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tra !: tracer concentration for next time step |
---|
| 44 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trb !: tracer concentration for before time step |
---|
| 45 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,: ) :: sbc_trc_b !: Before sbc fluxes for tracers |
---|
| 46 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,: ) :: sbc_trc !: Now sbc fluxes for tracers |
---|
[186] | 47 | |
---|
[5385] | 48 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,: ) :: trc_i !: prescribed tracer concentration in sea ice for SBC |
---|
| 49 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,: ) :: trc_o !: prescribed tracer concentration in ocean for SBC |
---|
| 50 | INTEGER , PUBLIC :: nn_ice_tr !: handling of sea ice tracers |
---|
| 51 | |
---|
[2528] | 52 | !! interpolated gradient |
---|
| 53 | !!-------------------------------------------------- |
---|
[3294] | 54 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtru !: hor. gradient at u-points at bottom ocean level |
---|
| 55 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtrv !: hor. gradient at v-points at bottom ocean level |
---|
[4990] | 56 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtrui !: hor. gradient at u-points at top ocean level |
---|
| 57 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtrvi !: hor. gradient at v-points at top ocean level |
---|
[5385] | 58 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: qsr_mean !: daily mean qsr |
---|
[186] | 59 | |
---|
[3294] | 60 | !! passive tracers (input and output) |
---|
[945] | 61 | !! ------------------------------------------ |
---|
[3294] | 62 | LOGICAL , PUBLIC :: ln_rsttr !: boolean term for restart i/o for passive tracers (namelist) |
---|
| 63 | LOGICAL , PUBLIC :: lrst_trc !: logical to control the trc restart write |
---|
| 64 | INTEGER , PUBLIC :: nn_writetrc !: time step frequency for concentration outputs (namelist) |
---|
| 65 | INTEGER , PUBLIC :: nutwrs !: output FILE for passive tracers restart |
---|
| 66 | INTEGER , PUBLIC :: nutrst !: logical unit for restart FILE for passive tracers |
---|
| 67 | INTEGER , PUBLIC :: nn_rsttr !: control of the time step ( 0 or 1 ) for pass. tr. |
---|
| 68 | CHARACTER(len = 80) , PUBLIC :: cn_trcrst_in !: suffix of pass. tracer restart name (input) |
---|
[5341] | 69 | CHARACTER(len = 256), PUBLIC :: cn_trcrst_indir !: restart input directory |
---|
[3294] | 70 | CHARACTER(len = 80) , PUBLIC :: cn_trcrst_out !: suffix of pass. tracer restart name (output) |
---|
[5341] | 71 | CHARACTER(len = 256), PUBLIC :: cn_trcrst_outdir !: restart output directory |
---|
[6140] | 72 | REAL(wp) , PUBLIC :: rdttrc !: passive tracer time step |
---|
[4148] | 73 | LOGICAL , PUBLIC :: ln_top_euler !: boolean term for euler integration |
---|
[3294] | 74 | LOGICAL , PUBLIC :: ln_trcdta !: Read inputs data from files |
---|
| 75 | LOGICAL , PUBLIC :: ln_trcdmp !: internal damping flag |
---|
[4148] | 76 | LOGICAL , PUBLIC :: ln_trcdmp_clo !: internal damping flag on closed seas |
---|
[3294] | 77 | INTEGER , PUBLIC :: nittrc000 !: first time step of passive tracers model |
---|
[5385] | 78 | LOGICAL , PUBLIC :: l_trcdm2dc !: Diurnal cycle for TOP |
---|
[3294] | 79 | |
---|
[5385] | 80 | !! Information for the ice module for tracers |
---|
| 81 | !! ------------------------------------------ |
---|
| 82 | TYPE TRC_I_NML !--- Ice tracer namelist structure |
---|
| 83 | REAL(wp) :: trc_ratio ! ice-ocean trc ratio |
---|
| 84 | REAL(wp) :: trc_prescr ! prescribed ice trc cc |
---|
| 85 | CHARACTER(len=2) :: ctrc_o ! choice of ocean trc cc |
---|
| 86 | END TYPE |
---|
| 87 | |
---|
[7041] | 88 | REAL(wp) , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: trc_ice_ratio ! ice-ocean tracer ratio |
---|
| 89 | REAL(wp) , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: trc_ice_prescr ! prescribed ice trc cc |
---|
| 90 | CHARACTER(len=2), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: cn_trc_o ! choice of ocean tracer cc |
---|
[5385] | 91 | |
---|
[7041] | 92 | |
---|
[186] | 93 | !! information for outputs |
---|
| 94 | !! -------------------------------------------------- |
---|
[3294] | 95 | TYPE, PUBLIC :: PTRACER !: Passive tracer type |
---|
| 96 | CHARACTER(len = 20) :: clsname !: short name |
---|
| 97 | CHARACTER(len = 80) :: cllname !: long name |
---|
| 98 | CHARACTER(len = 20) :: clunit !: unit |
---|
| 99 | LOGICAL :: llinit !: read in a file or not |
---|
[6140] | 100 | #if defined key_my_trc |
---|
| 101 | LOGICAL :: llsbc !: read in a file or not |
---|
| 102 | LOGICAL :: llcbc !: read in a file or not |
---|
| 103 | LOGICAL :: llobc !: read in a file or not |
---|
| 104 | #endif |
---|
[3294] | 105 | END TYPE PTRACER |
---|
| 106 | CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrcnm !: tracer name |
---|
| 107 | CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrcln !: trccer field long name |
---|
| 108 | CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrcun !: tracer unit |
---|
| 109 | |
---|
| 110 | TYPE, PUBLIC :: DIAG !: passive trcacer ddditional diagnostic type |
---|
| 111 | CHARACTER(len = 20) :: sname !: short name |
---|
| 112 | CHARACTER(len = 80) :: lname !: long name |
---|
| 113 | CHARACTER(len = 20) :: units !: unit |
---|
| 114 | END TYPE DIAG |
---|
| 115 | |
---|
[3680] | 116 | !! information for inputs |
---|
| 117 | !! -------------------------------------------------- |
---|
| 118 | LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_ini !: Initialisation from data input file |
---|
| 119 | LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_obc !: Use open boundary condition data |
---|
| 120 | LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_sbc !: Use surface boundary condition data |
---|
| 121 | LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_cbc !: Use coastal boundary condition data |
---|
| 122 | |
---|
[945] | 123 | |
---|
[3294] | 124 | !! variables to average over physics over passive tracer sub-steps. |
---|
| 125 | !! ---------------------------------------------------------------- |
---|
| 126 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: un_tm !: i-horizontal velocity average [m/s] |
---|
| 127 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: vn_tm !: j-horizontal velocity average [m/s] |
---|
| 128 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tsn_tm !: t/s average [m/s] |
---|
| 129 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avt_tm !: vertical diffusivity coeff. at w-point [m2/s] |
---|
| 130 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: rhop_tm !: |
---|
| 131 | # if defined key_zdfddm |
---|
| 132 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avs_tm !: vertical double diffusivity coeff. at w-point [m/s] |
---|
[1077] | 133 | # endif |
---|
[3294] | 134 | #if defined key_trabbl |
---|
| 135 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ahu_bbl_tm !: u-, w-points |
---|
| 136 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ahv_bbl_tm !: j-direction slope at u-, w-points |
---|
| 137 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: utr_bbl_tm !: j-direction slope at u-, w-points |
---|
| 138 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: vtr_bbl_tm !: j-direction slope at u-, w-points |
---|
| 139 | #endif |
---|
| 140 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshn_tm !: average ssh for the now step [m] |
---|
| 141 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshb_hold !:hold sshb from the beginning of each sub-stepping[m] |
---|
[1077] | 142 | |
---|
[3294] | 143 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: rnf_tm !: river runoff |
---|
| 144 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: h_rnf_tm !: depth in metres to the bottom of the relevant grid box |
---|
| 145 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hmld_tm !: mixed layer depth average [m] |
---|
| 146 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fr_i_tm !: average ice fraction [m/s] |
---|
| 147 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: emp_tm !: freshwater budget: volume flux [Kg/m2/s] |
---|
[4148] | 148 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: fmmflx_tm !: freshwater budget: freezing/melting [Kg/m2/s] |
---|
[3294] | 149 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: emp_b_hold !: hold emp from the beginning of each sub-stepping[m] |
---|
| 150 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: qsr_tm !: solar radiation average [m] |
---|
| 151 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: wndm_tm !: 10m wind average [m] |
---|
| 152 | ! |
---|
| 153 | |
---|
| 154 | ! Temporary physical arrays for sub_stepping |
---|
| 155 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tsn_temp |
---|
| 156 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: un_temp,vn_temp,wn_temp !: hold current values of avt, un, vn, wn |
---|
| 157 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avt_temp, rhop_temp !: hold current values of avt, un, vn, wn |
---|
| 158 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshn_temp, sshb_temp, ssha_temp, rnf_temp,h_rnf_temp |
---|
| 159 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: hdivn_temp, rotn_temp |
---|
| 160 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: hdivb_temp, rotb_temp |
---|
| 161 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: hmld_temp, qsr_temp, fr_i_temp,wndm_temp |
---|
[4148] | 162 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: emp_temp, fmmflx_temp, emp_b_temp |
---|
[3294] | 163 | ! |
---|
| 164 | #if defined key_trabbl |
---|
| 165 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ahu_bbl_temp, ahv_bbl_temp, utr_bbl_temp, vtr_bbl_temp !: hold current values |
---|
| 166 | #endif |
---|
| 167 | ! |
---|
| 168 | # if defined key_zdfddm |
---|
| 169 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avs_temp !: salinity vertical diffusivity coeff. at w-point [m/s] |
---|
[945] | 170 | # endif |
---|
[3294] | 171 | ! |
---|
[6140] | 172 | #if defined key_bdy |
---|
| 173 | CHARACTER(len=20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: cn_trc_dflt ! Default OBC condition for all tracers |
---|
| 174 | CHARACTER(len=20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: cn_trc ! Choice of boundary condition for tracers |
---|
| 175 | INTEGER, PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: nn_trcdmp_bdy !: =T Tracer damping |
---|
| 176 | ! External data structure of BDY for TOP. Available elements: cn_obc, ll_trc, trcnow, dmp |
---|
| 177 | TYPE(OBC_DATA), PUBLIC, ALLOCATABLE, DIMENSION(:,:), TARGET :: trcdta_bdy !: bdy external data (local process) |
---|
| 178 | #endif |
---|
| 179 | ! |
---|
[186] | 180 | |
---|
[2715] | 181 | !!---------------------------------------------------------------------- |
---|
| 182 | !! NEMO/TOP 3.3.1 , NEMO Consortium (2010) |
---|
[5341] | 183 | !! $Id$ |
---|
[2715] | 184 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
| 185 | !!---------------------------------------------------------------------- |
---|
| 186 | CONTAINS |
---|
| 187 | |
---|
| 188 | INTEGER FUNCTION trc_alloc() |
---|
| 189 | !!------------------------------------------------------------------- |
---|
| 190 | !! *** ROUTINE trc_alloc *** |
---|
| 191 | !!------------------------------------------------------------------- |
---|
| 192 | USE lib_mpp, ONLY: ctl_warn |
---|
| 193 | !!------------------------------------------------------------------- |
---|
| 194 | ! |
---|
[3294] | 195 | ALLOCATE( trn(jpi,jpj,jpk,jptra), trb(jpi,jpj,jpk,jptra), tra(jpi,jpj,jpk,jptra), & |
---|
[5385] | 196 | & trc_i(jpi,jpj,jptra) , trc_o(jpi,jpj,jptra) , & |
---|
[4990] | 197 | & gtru (jpi,jpj,jptra) , gtrv (jpi,jpj,jptra) , & |
---|
| 198 | & gtrui(jpi,jpj,jptra) , gtrvi(jpi,jpj,jptra) , & |
---|
[5385] | 199 | & sbc_trc_b(jpi,jpj,jptra), sbc_trc(jpi,jpj,jptra) , & |
---|
[7041] | 200 | & cvol(jpi,jpj,jpk) , trai(jptra) , qsr_mean(jpi,jpj) , & |
---|
[3294] | 201 | & ctrcnm(jptra) , ctrcln(jptra) , ctrcun(jptra) , & |
---|
[7041] | 202 | & ln_trc_ini(jptra) , & |
---|
| 203 | & trc_ice_ratio(jptra) , trc_ice_prescr(jptra) , cn_trc_o(jptra) , & |
---|
[6140] | 204 | #if defined key_my_trc |
---|
| 205 | & ln_trc_sbc(jptra) , ln_trc_cbc(jptra) , ln_trc_obc(jptra) , & |
---|
| 206 | #endif |
---|
| 207 | #if defined key_bdy |
---|
| 208 | & cn_trc_dflt(nb_bdy) , cn_trc(nb_bdy) , nn_trcdmp_bdy(nb_bdy) , & |
---|
| 209 | & trcdta_bdy(jptra,nb_bdy) , & |
---|
| 210 | #endif |
---|
| 211 | & STAT = trc_alloc ) |
---|
[2715] | 212 | |
---|
| 213 | IF( trc_alloc /= 0 ) CALL ctl_warn('trc_alloc: failed to allocate arrays') |
---|
| 214 | ! |
---|
| 215 | END FUNCTION trc_alloc |
---|
| 216 | |
---|
[945] | 217 | #else |
---|
| 218 | !!---------------------------------------------------------------------- |
---|
| 219 | !! Empty module : No passive tracer |
---|
| 220 | !!---------------------------------------------------------------------- |
---|
[439] | 221 | #endif |
---|
| 222 | |
---|
[186] | 223 | !!====================================================================== |
---|
| 224 | END MODULE trc |
---|