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