Changeset 8023 for branches/UKMO/dev_r5518_medusa_chg_trc_bio_medusa/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcbio_medusa.F90
- Timestamp:
- 2017-05-12T10:21:30+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/dev_r5518_medusa_chg_trc_bio_medusa/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcbio_medusa.F90
r8012 r8023 6 6 !! History : 7 7 !! - ! 1999-07 (M. Levy) original code 8 !! - ! 2000-12 (E. Kestenare) assign parameters to name individual tracers 8 !! - ! 2000-12 (E. Kestenare) assign parameters to name 9 !! individual tracers 9 10 !! - ! 2001-03 (M. Levy) LNO3 + dia2d 10 11 !! 2.0 ! 2007-12 (C. Deltel, G. Madec) F90 … … 18 19 !! - ! 2015-06 (A. Yool) Update to include MOCSY 19 20 !! - ! 2015-07 (A. Yool) Update for rolling averages 20 !! - ! 2015-10 (J. Palm) Update for diag outputs through iom_use 21 !! - ! 2015-10 (J. Palm) Update for diag outputs through 22 !! iom_use 21 23 !! - ! 2016-11 (A. Yool) Updated diags for CMIP6 22 24 !!---------------------------------------------------------------------- … … 59 61 !! trc_bio_medusa : 60 62 !!---------------------------------------------------------------------- 61 USE oce_trc62 USE trc63 USE sms_medusa64 USE lbclnk65 USE prtctl_trc ! Print control for debugging66 USE trcsed_medusa67 USE sbc_oce ! surface forcing68 USE sbcrnf ! surface boundary condition: runoff variables69 USE in_out_manager ! I/O manager70 # if defined key_iomput71 USE iom72 USE trcnam_medusa ! JPALM 13-11-2015 -- if iom_use for diag73 !!USE trc_nam_iom_medusa ! JPALM 13-11-2015 -- if iom_use for diag74 # endif75 # if defined key_roam76 USE gastransfer77 # if defined key_mocsy78 USE mocsy_wrapper79 # else80 USE trcco2_medusa81 # endif82 USE trcoxy_medusa83 !! Jpalm (08/08/2014)84 USE trcdms_medusa85 # endif86 !! AXY (18/01/12): brought in for benthic timestepping87 USE trcnam_trp ! AXY (24/05/2013)88 USE trdmxl_trc89 USE trdtrc_oce ! AXY (24/05/2013)90 91 63 !! AXY (30/01/14): necessary to find NaNs on HECTOR 92 64 USE, INTRINSIC :: ieee_arithmetic 93 65 66 USE bio_medusa_mod, ONLY: b0, fdep1, & 67 ibenthic, idf, idfval, & 68 # if defined key_roam 69 f_xco2a, & 70 zalk, zdic, zoxy, zsal, ztmp, & 71 # endif 72 # if defined key_mocsy 73 zpho, & 74 # endif 75 zchd, zchn, zdet, zdin, zdtc, & 76 zfer, zpds, zphd, zphn, zsil, & 77 zzme, zzmi 78 USE dom_oce, ONLY: e3t_0, e3t_n, & 79 gdept_0, gdept_n, & 80 gdepw_0, gdepw_n, & 81 nday_year, nsec_day, nyear, & 82 rdt, tmask 83 USE in_out_manager, ONLY: lwp, numout 84 # if defined key_iomput 85 USE iom, ONLY: lk_iomput 86 # endif 87 USE lbclnk, ONLY: lbc_lnk 88 USE lib_mpp, ONLY: ctl_stop 89 USE oce, ONLY: tsb, tsn 90 USE par_kind, ONLY: wp 91 USE par_medusa, ONLY: jpalk, jpchd, jpchn, jpdet, & 92 jpdic, jpdin, jpdtc, jpfer, & 93 jpoxy, jppds, jpphd, jpphn, & 94 jpsil, jpzme, jpzmi 95 USE par_oce, ONLY: jp_sal, jp_tem, jpi, jpim1, & 96 jpj, jpjm1, jpk 94 97 !! JPALM (27-06-2016): add lk_oasis for CO2 and DMS coupling with atm 95 98 USE sbc_oce, ONLY: lk_oasis 96 USE oce, ONLY: CO2Flux_out_cpl, DMS_out_cpl, & 97 PCO2a_in_cpl 98 USE bio_medusa_mod 99 USE sms_medusa, ONLY: hist_pco2 100 USE trc, ONLY: ln_diatrc, ln_rsttr, & 101 nittrc000, trn 102 99 103 USE bio_medusa_init_mod, ONLY: bio_medusa_init 100 104 USE carb_chem_mod, ONLY: carb_chem … … 124 128 125 129 SUBROUTINE trc_bio_medusa( kt ) 126 !!------------------------------------------------------------------ ---130 !!------------------------------------------------------------------ 127 131 !! *** ROUTINE trc_bio *** 128 132 !! 129 !! ** Purpose : compute the now trend due to biogeochemical processes 130 !! and add it to the general trend of passive tracers equations 131 !! 132 !! ** Method : each now biological flux is calculated in function of now 133 !! concentrations of tracers. 134 !! depending on the tracer, these fluxes are sources or sinks. 135 !! the total of the sources and sinks for each tracer 133 !! ** Purpose : compute the now trend due to biogeochemical processes 134 !! and add it to the general trend of passive tracers 135 !! equations 136 !! 137 !! ** Method : each now biological flux is calculated in function of 138 !! now concentrations of tracers. 139 !! depending on the tracer, these fluxes are sources or 140 !! sinks. 141 !! The total of the sources and sinks for each tracer 136 142 !! is added to the general trend. 137 143 !! … … 143 149 !! IF 'key_trc_diabio' defined , the biogeochemical trends 144 150 !! for passive tracers are saved for futher diagnostics. 145 !!------------------------------------------------------------------ ---146 !! 147 !! 148 !!------------------------------------------------------------------ ----151 !!------------------------------------------------------------------ 152 !! 153 !! 154 !!------------------------------------------------------------------ 149 155 !! Variable conventions 150 !!------------------------------------------------------------------ ----156 !!------------------------------------------------------------------ 151 157 !! 152 158 !! names: z*** - state variable 153 !! f*** - function (or temporary variable used in part of a function) 159 !! f*** - function (or temporary variable used in part of 160 !! a function) 154 161 !! x*** - parameter 155 162 !! b*** - right-hand part (sources and sinks) … … 162 169 INTEGER :: ji,jj,jk,jn 163 170 !! 164 !! AXY (27/07/10): add in indices for depth horizons (for sinking flux 165 !! and seafloor iron inputs) 166 !! INTEGER :: i0100, i0200, i0500, i1000, i1100 167 !! 168 !! model state variables 169 ! REAL(wp), DIMENSION(jpi,jpj) :: zchn,zchd,zphn,zphd,zpds,zzmi 170 ! REAL(wp), DIMENSION(jpi,jpj) :: zzme,zdet,zdtc,zdin,zsil,zfer 171 ! zage doesn't seem to be used - marc 19/4/17 172 ! REAL(wp) :: zage 173 !# if defined key_roam 174 ! REAL(wp), DIMENSION(jpi,jpj) :: zdic, zalk, zoxy 175 ! REAL(wp), DIMENSION(jpi,jpj) :: ztmp, zsal 176 !# endif 177 !# if defined key_mocsy 178 ! REAL(wp), DIMENSION(jpi,jpj) :: zpho 179 !# endif 180 !! 181 !! integrated source and sink terms 182 ! REAL(wp) :: b0 183 !! AXY (23/08/13): changed from individual variables for each flux to 184 !! an array that holds all fluxes 185 REAL(wp), DIMENSION(jpi,jpj,jp_medusa) :: btra 186 !! 187 !! primary production and chl related quantities 188 ! REAL(wp), DIMENSION(jpi,jpj) :: fthetan,faln,fchn1,fchn,fjln,fprn,frn 189 ! REAL(wp), DIMENSION(jpi,jpj) :: fthetad,fald,fchd1,fchd,fjld,fprd,frd 190 !! AXY (23/11/16): add in light-only limitation term (normalised 0-1 range) 191 ! REAL(wp), DIMENSION(jpi,jpj) :: fjlim_pn, fjlim_pd 192 !! AXY (03/02/11): add in Liebig terms 193 ! REAL(wp), DIMENSION(jpi,jpj) :: fpnlim, fpdlim 194 !! AXY (16/07/09): add in Eppley curve functionality 195 ! REAL(wp), DIMENSION(jpi,jpj) :: fun_T,xvpnT,xvpdT 196 INTEGER :: ieppley 197 !! AXY (16/05/11): per Katya's prompting, add in new T-dependence 198 !! for phytoplankton growth only (i.e. no change 199 !! for remineralisation) 200 ! REAL(wp), DIMENSION(jpi,jpj) :: fun_Q10 201 !! AXY (01/03/10): add in mixed layer PP diagnostics 202 ! REAL(wp), DIMENSION(jpi,jpj) :: fprn_ml,fprd_ml 203 !! 204 !! nutrient limiting factors 205 ! REAL(wp), DIMENSION(jpi,jpj) :: fnln,ffln2 !! N and Fe 206 ! REAL(wp), DIMENSION(jpi,jpj) :: fnld,ffld,fsld,fsld2 !! N, Fe and Si 207 !! 208 !! silicon cycle 209 ! REAL(wp), DIMENSION(jpi,jpj) :: fsin,fnsi,fprds,fsdiss 210 REAL(wp) :: fsin1,fnsi1,fnsi2 211 !! 212 !! iron cycle; includes parameters for Parekh et al. (2005) iron scheme 213 ! REAL(wp), DIMENSION(jpi,jpj) :: ffetop,ffebot,ffescav 214 REAL(wp) :: xLgF, xFeT, xFeF, xFeL !! state variables for iron-ligand system 215 ! REAL(wp), DIMENSION(jpi,jpj) :: xFree !! state variables for iron-ligand system 216 REAL(wp) :: xb_coef_tmp, xb2M4ac !! iron-ligand parameters 217 REAL(wp) :: xmaxFeF,fdeltaFe !! max Fe' parameters 218 !! 219 !! local parameters for Moore et al. (2004) alternative scavenging scheme 220 REAL(wp) :: fbase_scav,fscal_sink,fscal_part,fscal_scav 221 !! 222 !! local parameters for Moore et al. (2008) alternative scavenging scheme 223 REAL(wp) :: fscal_csink,fscal_sisink,fscal_casink 224 !! 225 !! local parameters for Galbraith et al. (2010) alternative scavenging scheme 226 REAL(wp) :: xCscav1, xCscav2, xk_org, xORGscav !! organic portion of scavenging 227 REAL(wp) :: xk_inorg, xINORGscav !! inorganic portion of scavenging 228 !! 229 !! microzooplankton grazing 230 ! REAL(wp), DIMENSION(jpi,jpj) :: fmi1,fmi,fgmipn,fgmid,fgmidc 231 ! REAL(wp), DIMENSION(jpi,jpj) :: finmi,ficmi,fstarmi,fmith,fmigrow,fmiexcr,fmiresp 232 !! 233 !! mesozooplankton grazing 234 ! REAL(wp), DIMENSION(jpi,jpj) :: fme1,fme,fgmepn,fgmepd,fgmepds,fgmezmi,fgmed,fgmedc 235 ! REAL(wp), DIMENSION(jpi,jpj) :: finme,ficme,fstarme,fmeth,fmegrow,fmeexcr,fmeresp 236 !! 237 !! mortality/Remineralisation (defunct parameter "fz" removed) 238 ! REAL(wp), DIMENSION(jpi,jpj) :: fdpn,fdpd,fdpds,fdzmi,fdzme,fdd 171 INTEGER :: iball 239 172 # if defined key_roam 240 ! REAL(wp), DIMENSION(jpi,jpj) :: fddc 241 # endif 242 ! REAL(wp), DIMENSION(jpi,jpj) :: fdpn2,fdpd2,fdpds2,fdzmi2,fdzme2 243 ! REAL(wp), DIMENSION(jpi,jpj) :: fslown, fslowc 244 ! REAL(wp), DIMENSION(jpi,jpj) :: fslownflux, fslowcflux 245 ! REAL(wp), DIMENSION(jpi,jpj) :: fregen,fregensi 246 ! REAL(wp), DIMENSION(jpi,jpj) :: fregenfast,fregenfastsi 247 # if defined key_roam 248 !! Doesn't look like this is used - marc 10/4/17 249 !! REAL(wp), DIMENSION(jpi,jpj) :: fregenc 250 ! REAL(wp), DIMENSION(jpi,jpj) :: fregenfastc 251 # endif 252 !! 253 !! particle flux 254 ! REAL(WP), DIMENSION(jpi,jpj) :: fdep1,fcaco3 255 ! REAL(WP), DIMENSION(jpi,jpj) :: ftempn,ftempsi,ftempfe,ftempc,ftempca 256 ! REAL(wp), DIMENSION(jpi,jpj) :: freminn,freminsi,freminfe,freminc,freminca 257 ! REAL(wp), DIMENSION(jpi,jpj) :: ffastn,ffastsi,ffastfe,ffastc,ffastca 258 ! REAL(wp), DIMENSION(jpi,jpj) :: fprotf 259 ! REAL(wp), DIMENSION(jpi,jpj) :: fsedn,fsedsi,fsedfe,fsedc,fsedca 260 ! REAL(wp), DIMENSION(jpi,jpj) :: fccd 261 ! REAL(wp), DIMENSION(jpi,jpj) :: fccd_dep 262 !! 263 !! AXY (06/07/11): alternative fast detritus schemes 264 REAL(wp) :: fb_val, fl_sst 265 !! 266 !! AXY (08/07/11): fate of fast detritus reaching the seafloor 267 ! I don't think ffast2slowfe is used - marc 10/4/17 268 ! REAL(wp), DIMENSION(jpi,jpj) :: ffast2slown,ffast2slowfe,ffast2slowc 269 ! REAL(wp), DIMENSION(jpi,jpj) :: ffast2slown,ffast2slowc 270 !! 271 !! conservation law 272 REAL(wp) :: fnit0,fsil0,ffer0 273 # if defined key_roam 274 REAL(wp) :: fcar0,falk0,foxy0 275 # endif 173 !! 174 INTEGER :: iyr1, iyr2 175 !! 176 # endif 276 177 !! 277 178 !! temporary variables 278 REAL(wp) :: fq0,fq1,fq2,fq3,fq4,fq5,fq6,fq7,fq8,fq9 279 !! 280 !! water column nutrient and flux integrals 281 ! REAL(wp), DIMENSION(jpi,jpj) :: ftot_n,ftot_si,ftot_fe 282 ! REAL(wp), DIMENSION(jpi,jpj) :: fflx_n,fflx_si,fflx_fe 283 ! REAL(wp), DIMENSION(jpi,jpj) :: fifd_n,fifd_si,fifd_fe 284 ! REAL(wp), DIMENSION(jpi,jpj) :: fofd_n,fofd_si,fofd_fe 285 # if defined key_roam 286 ! REAL(wp), DIMENSION(jpi,jpj) :: ftot_c,ftot_a,ftot_o2 287 ! REAL(wp), DIMENSION(jpi,jpj) :: fflx_c,fflx_a,fflx_o2 288 ! REAL(wp), DIMENSION(jpi,jpj) :: fifd_c,fifd_a,fifd_o2 289 ! REAL(wp), DIMENSION(jpi,jpj) :: fofd_c,fofd_a,fofd_o2 290 # endif 291 !! 292 !! zooplankton grazing integrals 293 ! REAL(wp), DIMENSION(jpi,jpj) :: fzmi_i,fzmi_o,fzme_i,fzme_o 294 !! 295 !! limitation term temporary variables 296 ! REAL(wp), DIMENSION(jpi,jpj) :: ftot_pn,ftot_pd 297 ! REAL(wp), DIMENSION(jpi,jpj) :: ftot_zmi,ftot_zme,ftot_det,ftot_dtc 298 !! use ballast scheme (1) or simple exponential scheme (0; a conservation test) 299 INTEGER :: iball 300 !! use biological fluxes (1) or not (0) 301 ! INTEGER :: ibio_switch 302 !! 303 !! diagnose fluxes (should only be used in 1D runs) 304 ! INTEGER :: idf, idfval 305 !! 306 !! nitrogen and silicon production and consumption 307 REAL(wp) :: fn_prod, fn_cons, fs_prod, fs_cons 308 ! REAL(wp), DIMENSION(jpi,jpj) :: fnit_prod, fnit_cons, fsil_prod, fsil_cons 309 # if defined key_roam 310 !! 311 !! flags to help with calculating the position of the CCD 312 ! Moved into carb_chem.F90 - marc 20/4/17 313 ! INTEGER, DIMENSION(jpi,jpj) :: i2_omcal,i2_omarg 314 !! 315 !! AXY (24/11/16): add xCO2 variable for atmosphere (what we actually have) 316 ! REAL(wp) :: f_xco2a 317 ! REAL(wp), DIMENSION(jpi,jpj) :: f_ph, f_pco2w, f_h2co3, f_hco3, f_co3, f_co2flux 318 ! REAL(wp), DIMENSION(jpi,jpj) :: f_TDIC, f_TALK, f_dcf, f_henry 319 ! REAL(wp), DIMENSION(jpi,jpj) :: f_pp0 320 ! REAL(wp), DIMENSION(jpi,jpj) :: f_kw660, f_o2flux, f_o2sat 321 REAL(wp) :: f_o2sat3 322 ! REAL(wp), DIMENSION(jpi,jpj) :: f_omcal, f_omarg 323 !! 324 !! AXY (23/06/15): additional diagnostics for MOCSY and oxygen 325 ! REAL(wp), DIMENSION(jpi,jpj) :: f_fco2w, f_BetaD, f_rhosw, f_opres, f_insitut, f_pco2atm, f_fco2atm 326 ! REAL(wp), DIMENSION(jpi,jpj) :: f_schmidtco2, f_kwco2, f_K0, f_co2starair, f_dpco2, f_kwo2 327 !! jpalm 14-07-2016: convert CO2flux diag from mmol/m2/d to kg/m2/s 328 REAL, PARAMETER :: weight_CO2_mol = 44.0095 !! g / mol 329 REAL, PARAMETER :: secs_in_day = 86400.0 !! s / d 330 REAL, PARAMETER :: CO2flux_conv = (1.e-6 * weight_CO2_mol) / secs_in_day 331 332 !! 333 ! INTEGER, DIMENSION(jpi,jpj) :: iters 334 REAL(wp) :: f_year 335 INTEGER :: i_year 336 INTEGER :: iyr1, iyr2 337 !! 338 !! carbon, alkalinity production and consumption 339 REAL(wp) :: fc_prod, fc_cons, fa_prod, fa_cons 340 ! REAL(wp), DIMENSION(jpi,jpj) :: fcomm_resp 341 ! REAL(wp), DIMENSION(jpi,jpj) :: fcar_prod, fcar_cons 342 !! 343 !! oxygen production and consumption (and non-consumption) 344 REAL(wp), DIMENSION(jpi,jpj) :: fo2_prod, fo2_cons, fo2_ncons, fo2_ccons 345 ! REAL(wp), DIMENSION(jpi,jpj) :: foxy_prod, foxy_cons, foxy_anox 346 !! Jpalm (11-08-2014) 347 !! add DMS in MEDUSA for UKESM1 model 348 ! REAL(wp), DIMENSION(jpi,jpj) :: dms_surf 349 !! AXY (13/03/15): add in other DMS calculations 350 ! REAL(wp), DIMENSION(jpi,jpj) :: dms_andr, dms_simo, dms_aran, dms_hall 351 352 # endif 353 !! 354 !! benthic fluxes 355 ! INTEGER :: ibenthic 356 ! REAL(wp), DIMENSION(jpi,jpj) :: f_sbenin_n, f_sbenin_fe, f_sbenin_c 357 ! REAL(wp), DIMENSION(jpi,jpj) :: f_fbenin_n, f_fbenin_fe, f_fbenin_si, f_fbenin_c, f_fbenin_ca 358 ! REAL(wp), DIMENSION(jpi,jpj) :: f_benout_n, f_benout_fe, f_benout_si, f_benout_c, f_benout_ca 359 REAL(wp) :: zfact 360 !! 361 !! benthic fluxes of CaCO3 that shouldn't happen because of lysocline 362 ! REAL(wp), DIMENSION(jpi,jpj) :: f_benout_lyso_ca 363 !! 364 !! riverine fluxes 365 ! REAL(wp), DIMENSION(jpi,jpj) :: f_runoff, f_riv_n, f_riv_si, f_riv_c, f_riv_alk 366 !! AXY (19/07/12): variables for local riverine fluxes to handle inputs below surface 367 ! REAL(wp), DIMENSION(jpi,jpj) :: f_riv_loc_n, f_riv_loc_si, f_riv_loc_c, f_riv_loc_alk 368 !!--------------------------------------------------------------------- 179 REAL(wp) :: fq0,fq1,fq2,fq3,fq4 180 !! 181 !!------------------------------------------------------------------ 369 182 370 183 # if defined key_debug_medusa … … 384 197 !! AXY (13/01/12): is benthic model properly interactive? 0 = no, 1 = yes 385 198 ibenthic = 1 386 387 !! not sure what this is for; it's not used anywhere; commenting out388 !! fbodn(:,:) = 0.e0389 390 !!391 IF( ln_diatrc ) THEN392 !! blank 2D diagnostic array393 trc2d(:,:,:) = 0.e0394 !!395 !! blank 3D diagnostic array396 trc3d(:,:,:,:) = 0.e0397 ENDIF398 199 399 200 !!------------------------------------------------------------------ … … 587 388 !! OPEN wet point IF..THEN loop 588 389 if (tmask(ji,jj,jk) == 1) then 589 !!====================================================== ===390 !!====================================================== 590 391 !! SETUP LOCAL GRID CELL 591 !!====================================================== ===392 !!====================================================== 592 393 !! 593 !!------------------------------------------------------ ---394 !!------------------------------------------------------ 594 395 !! Some notes on grid vertical structure 595 396 !! - fsdepw(ji,jj,jk) is the depth of the upper surface of … … 598 399 !! level jk 599 400 !! - fse3t(ji,jj,jk) is the thickness of level jk 600 !!------------------------------------------------------ ---401 !!------------------------------------------------------ 601 402 !! 602 403 !! AXY (01/03/10): set up level depth (bottom of level) … … 864 665 865 666 #else 866 !!===================================================================== =667 !!===================================================================== 867 668 !! Dummy module : No MEDUSA bio-model 868 !!===================================================================== =669 !!===================================================================== 869 670 CONTAINS 870 671 SUBROUTINE trc_bio_medusa( kt ) ! Empty routine … … 874 675 #endif 875 676 876 !!===================================================================== =677 !!===================================================================== 877 678 END MODULE trcbio_medusa
Note: See TracChangeset
for help on using the changeset viewer.