MODULE trcbio_medusa !!====================================================================== !! *** MODULE trcbio *** !! TOP : MEDUSA !!====================================================================== !! History : !! - ! 1999-07 (M. Levy) original code !! - ! 2000-12 (E. Kestenare) assign parameters to name !! individual tracers !! - ! 2001-03 (M. Levy) LNO3 + dia2d !! 2.0 ! 2007-12 (C. Deltel, G. Madec) F90 !! - ! 2008-08 (K. Popova) adaptation for MEDUSA !! - ! 2008-11 (A. Yool) continuing adaptation for MEDUSA !! - ! 2010-03 (A. Yool) updated for branch inclusion !! - ! 2011-08 (A. Yool) updated for ROAM (see below) !! - ! 2013-03 (A. Yool) updated for iMARNET !! - ! 2013-05 (A. Yool) updated for v3.5 !! - ! 2014-08 (A. Yool, J. Palm) Add DMS module for UKESM1 model !! - ! 2015-06 (A. Yool) Update to include MOCSY !! - ! 2015-07 (A. Yool) Update for rolling averages !! - ! 2015-10 (J. Palm) Update for diag outputs through !! iom_use !! - ! 2016-11 (A. Yool) Updated diags for CMIP6 !! - ! 2017-05 (A. Yool) Added extra DMS calculation !!---------------------------------------------------------------------- !! #if defined key_roam !!---------------------------------------------------------------------- !! Updates for the ROAM project include: !! - addition of DIC, alkalinity, detrital carbon and oxygen tracers !! - addition of air-sea fluxes of CO2 and oxygen !! - periodic (monthly) calculation of full 3D carbonate chemistry !! - detrital C:N ratio now free to evolve dynamically !! - benthic storage pools !! !! Opportunity also taken to add functionality: !! - switch for Liebig Law (= most-limiting) nutrient uptake !! - switch for accelerated seafloor detritus remineralisation !! - switch for fast -> slow detritus transfer at seafloor !! - switch for ballast vs. Martin vs. Henson fast detritus remin. !! - per GMD referee remarks, xfdfrac3 introduced for grazed PDS !!---------------------------------------------------------------------- #endif !! #if defined key_mocsy !!---------------------------------------------------------------------- !! Updates with the addition of MOCSY include: !! - option to use PML or MOCSY carbonate chemistry (the latter is !! preferred) !! - central calculation of gas transfer velocity, f_kw660; previously !! this was done separately for CO2 and O2 with predictable results !! - distribution of f_kw660 to both PML and MOCSY CO2 air-sea flux !! calculations and to those for O2 air-sea flux !! - extra diagnostics included for MOCSY !!---------------------------------------------------------------------- #endif !! #if defined key_medusa !!---------------------------------------------------------------------- !! MEDUSA bio-model !!---------------------------------------------------------------------- !! trc_bio_medusa : !!---------------------------------------------------------------------- !! AXY (30/01/14): necessary to find NaNs on HECTOR USE, INTRINSIC :: ieee_arithmetic USE bio_medusa_mod, ONLY: b0, fdep1, & ibenthic, idf, idfval, & # if defined key_roam f_xco2a, & zalk, zdic, zoxy, zsal, ztmp, & # endif # if defined key_mocsy zpho, & # endif zchd, zchn, zdet, zdin, zdtc, & zfer, zpds, zphd, zphn, zsil, & zzme, zzmi USE dom_oce, ONLY: e3t_0, e3t_n, & gdept_0, gdept_n, & gdepw_0, gdepw_n, & nday_year, nsec_day, nyear, & rdt, tmask USE in_out_manager, ONLY: lwp, numout, nn_date0 # if defined key_iomput USE iom, ONLY: lk_iomput # endif USE lbclnk, ONLY: lbc_lnk USE lib_mpp, ONLY: ctl_stop USE oce, ONLY: tsb, tsn USE par_kind, ONLY: wp USE par_medusa, ONLY: jpalk, jpchd, jpchn, jpdet, & jpdic, jpdin, jpdtc, jpfer, & jpoxy, jppds, jpphd, jpphn, & jpsil, jpzme, jpzmi USE par_oce, ONLY: jp_sal, jp_tem, jpi, jpim1, & jpj, jpjm1, jpk !! JPALM (27-06-2016): add lk_oasis for CO2 and DMS coupling with atm USE sbc_oce, ONLY: lk_oasis USE sms_medusa, ONLY: hist_pco2 USE trc, ONLY: ln_rsttr, nittrc000, trn USE bio_medusa_init_mod, ONLY: bio_medusa_init USE carb_chem_mod, ONLY: carb_chem USE air_sea_mod, ONLY: air_sea USE plankton_mod, ONLY: plankton USE iron_chem_scav_mod, ONLY: iron_chem_scav USE detritus_mod, ONLY: detritus USE bio_medusa_update_mod, ONLY: bio_medusa_update USE bio_medusa_diag_mod, ONLY: bio_medusa_diag USE bio_medusa_diag_slice_mod, ONLY: bio_medusa_diag_slice USE bio_medusa_fin_mod, ONLY: bio_medusa_fin IMPLICIT NONE PRIVATE PUBLIC trc_bio_medusa ! called in trcsms_medusa.F90 !!* Substitution # include "domzgr_substitute.h90" !!---------------------------------------------------------------------- !! NEMO/TOP 2.0 , LOCEAN-IPSL (2007) !! $Id$ !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) !!---------------------------------------------------------------------- CONTAINS SUBROUTINE trc_bio_medusa( kt ) !!------------------------------------------------------------------ !! *** ROUTINE trc_bio *** !! !! ** Purpose : compute the now trend due to biogeochemical processes !! and add it to the general trend of passive tracers !! equations !! !! ** Method : each now biological flux is calculated in function of !! now concentrations of tracers. !! depending on the tracer, these fluxes are sources or !! sinks. !! The total of the sources and sinks for each tracer !! is added to the general trend. !! !! tra = tra + zf...tra - zftra... !! | | !! | | !! source sink !! !! IF 'key_trc_diabio' defined , the biogeochemical trends !! for passive tracers are saved for futher diagnostics. !!------------------------------------------------------------------ !! !! !!------------------------------------------------------------------ !! Variable conventions !!------------------------------------------------------------------ !! !! names: z*** - state variable !! f*** - function (or temporary variable used in part of !! a function) !! x*** - parameter !! b*** - right-hand part (sources and sinks) !! i*** - integer variable (usually used in yes/no flags) !! !! time (integer timestep) INTEGER, INTENT( in ) :: kt !! !! spatial array indices INTEGER :: ji,jj,jk,jn !! INTEGER :: iball # if defined key_roam !! INTEGER :: iyr1, iyr2 !! # endif !! !! temporary variables REAL(wp) :: fq0,fq1,fq2,fq3,fq4 !! !!------------------------------------------------------------------ # if defined key_debug_medusa IF (lwp) write (numout,*) 'trc_bio_medusa: variables defined' CALL flush(numout) # endif !! AXY (20/11/14): alter this to report on first MEDUSA call !! IF( kt == nit000 ) THEN IF( kt == nittrc000 ) THEN IF(lwp) WRITE(numout,*) IF(lwp) WRITE(numout,*) ' trc_bio: MEDUSA bio-model' IF(lwp) WRITE(numout,*) ' ~~~~~~~' IF(lwp) WRITE(numout,*) ' kt =',kt ENDIF !! AXY (13/01/12): is benthic model properly interactive? 0 = no, 1 = yes ibenthic = 1 !!------------------------------------------------------------------ !! b0 is present for debugging purposes; using b0 = 0 sets the tendency !! terms of all biological equations to 0. !!------------------------------------------------------------------ !! !! AXY (03/09/14): probably not the smartest move ever, but it'll fit !! the bill for now; another item on the things-to-sort- !! out-in-the-future list ... # if defined key_kill_medusa b0 = 0. # else b0 = 1. # endif !!------------------------------------------------------------------ !! fast detritus ballast scheme (0 = no; 1 = yes) !! alternative to ballast scheme is same scheme but with no ballast !! protection (not dissimilar to Martin et al., 1987) !!------------------------------------------------------------------ !! iball = 1 !!------------------------------------------------------------------ !! full flux diagnostics (0 = no; 1 = yes); appear in ocean.output !! these should *only* be used in 1D since they give comprehensive !! output for ecological functions in the model; primarily used in !! debugging !!------------------------------------------------------------------ !! idf = 0 !! !! timer mechanism if (kt/120*120.eq.kt) then idfval = 1 else idfval = 0 endif !!------------------------------------------------------------------ !! Initialise arrays to zero and set up arrays for diagnostics !!------------------------------------------------------------------ CALL bio_medusa_init( kt ) # if defined key_axy_nancheck DO jn = jp_msa0,jp_msa1 !! fq0 = MINVAL(trn(:,:,:,jn)) !! fq1 = MAXVAL(trn(:,:,:,jn)) fq2 = SUM(trn(:,:,:,jn)) !! if (lwp) write (numout,'(a,2i6,3(1x,1pe15.5))') 'NAN-CHECK', & !! kt, jn, fq0, fq1, fq2 !! AXY (30/01/14): much to our surprise, the next line doesn't !! work on HECTOR and has been replaced here with !! a specialist routine !! if (fq2 /= fq2 ) then if ( ieee_is_nan( fq2 ) ) then !! there's a NaN here if (lwp) write(numout,*) 'NAN detected in field', jn, & 'at time', kt, 'at position:' DO jk = 1,jpk DO jj = 1,jpj DO ji = 1,jpi !! AXY (30/01/14): "isnan" problem on HECTOR !! if (trn(ji,jj,jk,jn) /= trn(ji,jj,jk,jn)) then if ( ieee_is_nan( trn(ji,jj,jk,jn) ) ) then if (lwp) write (numout,'(a,1pe12.2,4i6)') & 'NAN-CHECK', tmask(ji,jj,jk), ji, jj, jk, jn endif enddo enddo enddo CALL ctl_stop( 'trcbio_medusa, NAN in incoming tracer field' ) endif ENDDO CALL flush(numout) # endif # if defined key_debug_medusa IF (lwp) write (numout,*) & 'trc_bio_medusa: variables initialised and checked' CALL flush(numout) # endif # if defined key_roam !!------------------------------------------------------------------ !! calculate atmospheric pCO2 !!------------------------------------------------------------------ !! !! what's atmospheric pCO2 doing? (data start in 1859) iyr1 = nyear - 1859 + 1 iyr2 = iyr1 + 1 if (iyr1 .le. 1) then !! before 1860 f_xco2a(:,:) = hist_pco2(1) elseif (iyr2 .ge. 242) then !! after 2099 f_xco2a(:,:) = hist_pco2(242) else !! just right fq0 = hist_pco2(iyr1) fq1 = hist_pco2(iyr2) fq2 = real(nsec_day) / (60.0 * 60.0 * 24.0) !! AXY (14/06/12): tweaked to make more sense (and be correct) # if defined key_bs_axy_yrlen !! bugfix: for 360d year with HadGEM2-ES forcing fq3 = (real(nday_year) - 1.0 + fq2) / 360.0 # else !! original use of 365 days (not accounting for leap year or !! 360d year) fq3 = (real(nday_year) - 1.0 + fq2) / 365.0 # endif fq4 = (fq0 * (1.0 - fq3)) + (fq1 * fq3) f_xco2a(:,:) = fq4 endif # if defined key_axy_pi_co2 !! OCMIP pre-industrial pCO2 !! f_xco2a(:,:) = 284.725 !! CMIP5 pre-industrial pCO2 f_xco2a = 284.317 !! CMIP6 pre-industrial pCO2 # endif !! IF(lwp) WRITE(numout,*) ' MEDUSA nyear =', nyear !! IF(lwp) WRITE(numout,*) ' MEDUSA nsec_day =', real(nsec_day) !! IF(lwp) WRITE(numout,*) ' MEDUSA nday_year =', real(nday_year) !! AXY (29/01/14): remove surplus diagnostics !! IF(lwp) WRITE(numout,*) ' MEDUSA fq0 =', fq0 !! IF(lwp) WRITE(numout,*) ' MEDUSA fq1 =', fq1 !! IF(lwp) WRITE(numout,*) ' MEDUSA fq2 =', fq2 !! IF(lwp) WRITE(numout,*) ' MEDUSA fq3 =', fq3 IF(lwp) WRITE(numout,*) ' MEDUSA atm pCO2 =', f_xco2a(1,1) # endif # if defined key_debug_medusa IF (lwp) write (numout,*) 'trc_bio_medusa: ready for carbonate chemistry' IF (lwp) write (numout,*) 'trc_bio_medusa: kt = ', kt IF (lwp) write (numout,*) 'trc_bio_medusa: nittrc000 = ', nittrc000 CALL flush(numout) # endif # if defined key_roam !! AXY (20/11/14): alter to call on first MEDUSA timestep and then every !! month (this is hardwired as 960 timesteps but should !! be calculated and done properly !! IF( kt == nit000 .or. mod(kt,1920) == 0 ) THEN !! IF( kt == nittrc000 .or. mod(kt,960) == 0 ) THEN !!============================= !! Jpalm -- 07-10-2016 -- need to change carb-chem frequency call : !! we don't want to call on the first time-step of all run !! submission, but only on the very first time-step, and !! then every month. So we call on nittrc000 if not !! restarted run, else if one month after last call. !! Assume one month is 30d --> 3600*24*30 : 2592000s !! try to call carb-chem at 1st month's tm-stp : !! x * 30d + 1*rdt(i.e: mod = rdt) !! ++ need to pass carb-chem output var through restarts If ( (kt == nittrc000 .AND. .NOT.ln_rsttr) .OR. & ((86400*mod(nn_date0,100) + mod(kt*rdt,2592000.)) == rdt) ) THEN !!--------------------------------------------------------------- !! Calculate the carbonate chemistry for the whole ocean on the first !! simulation timestep and every month subsequently; the resulting 3D !! field of omega calcite is used to determine the depth of the CCD !!--------------------------------------------------------------- CALL carb_chem( kt ) ENDIF # endif # if defined key_debug_medusa IF (lwp) write (numout,*) 'trc_bio_medusa: ready for full domain calculations' CALL flush(numout) # endif !!------------------------------------------------------------------ !! MEDUSA has unified equation through the water column !! (Diff. from LOBSTER which has two sets: bio- and non-bio layers) !! Statement below in LOBSTER is different: DO jk = 1, jpkbm1 !!------------------------------------------------------------------ !! !! NOTE: the ordering of the loops below differs from that of some other !! models; looping over the vertical dimension is the outermost loop and !! this complicates some calculations (e.g. storage of vertical fluxes !! that can otherwise be done via a singular variable require 2D fields !! here); however, these issues are relatively easily resolved, but the !! loops CANNOT be reordered without potentially causing code efficiency !! problems (e.g. array indexing means that reordering the loops would !! require skipping between widely-spaced memory location; potentially !! outside those immediately cached) !! !! OPEN vertical loop DO jk = 1,jpk !! OPEN horizontal loops DO jj = 2,jpjm1 DO ji = 2,jpim1 !! OPEN wet point IF..THEN loop if (tmask(ji,jj,jk) == 1) then !!====================================================== !! SETUP LOCAL GRID CELL !!====================================================== !! !!------------------------------------------------------ !! Some notes on grid vertical structure !! - fsdepw(ji,jj,jk) is the depth of the upper surface of !! level jk !! - fsde3w(ji,jj,jk) is *approximately* the midpoint of !! level jk !! - fse3t(ji,jj,jk) is the thickness of level jk !!------------------------------------------------------ !! !! AXY (01/03/10): set up level depth (bottom of level) fdep1(ji,jj) = fsdepw(ji,jj,jk) + fse3t(ji,jj,jk) !! !! set up model tracers !! negative values of state variables are not allowed to !! contribute to the calculated fluxes !! non-diatom chlorophyll zchn(ji,jj) = max(0.,trn(ji,jj,jk,jpchn)) !! diatom chlorophyll zchd(ji,jj) = max(0.,trn(ji,jj,jk,jpchd)) !! non-diatoms zphn(ji,jj) = max(0.,trn(ji,jj,jk,jpphn)) !! diatoms zphd(ji,jj) = max(0.,trn(ji,jj,jk,jpphd)) !! diatom silicon zpds(ji,jj) = max(0.,trn(ji,jj,jk,jppds)) !! AXY (28/01/10): probably need to take account of !! chl/biomass connection if (zchn(ji,jj).eq.0.) zphn(ji,jj) = 0. if (zchd(ji,jj).eq.0.) zphd(ji,jj) = 0. if (zphn(ji,jj).eq.0.) zchn(ji,jj) = 0. if (zphd(ji,jj).eq.0.) zchd(ji,jj) = 0. !! AXY (23/01/14): duh - why did I forget diatom silicon? if (zpds(ji,jj).eq.0.) zphd(ji,jj) = 0. if (zphd(ji,jj).eq.0.) zpds(ji,jj) = 0. ENDIF ENDDO ENDDO DO jj = 2,jpjm1 DO ji = 2,jpim1 if (tmask(ji,jj,jk) == 1) then !! microzooplankton zzmi(ji,jj) = max(0.,trn(ji,jj,jk,jpzmi)) !! mesozooplankton zzme(ji,jj) = max(0.,trn(ji,jj,jk,jpzme)) !! detrital nitrogen zdet(ji,jj) = max(0.,trn(ji,jj,jk,jpdet)) !! dissolved inorganic nitrogen zdin(ji,jj) = max(0.,trn(ji,jj,jk,jpdin)) !! dissolved silicic acid zsil(ji,jj) = max(0.,trn(ji,jj,jk,jpsil)) !! dissolved "iron" zfer(ji,jj) = max(0.,trn(ji,jj,jk,jpfer)) ENDIF ENDDO ENDDO # if defined key_roam DO jj = 2,jpjm1 DO ji = 2,jpim1 if (tmask(ji,jj,jk) == 1) then !! detrital carbon zdtc(ji,jj) = max(0.,trn(ji,jj,jk,jpdtc)) !! dissolved inorganic carbon zdic(ji,jj) = max(0.,trn(ji,jj,jk,jpdic)) !! alkalinity zalk(ji,jj) = max(0.,trn(ji,jj,jk,jpalk)) !! oxygen zoxy(ji,jj) = max(0.,trn(ji,jj,jk,jpoxy)) # if defined key_axy_carbchem && defined key_mocsy !! phosphate via DIN and Redfield zpho(ji,jj) = max(0.,trn(ji,jj,jk,jpdin)) / 16.0 # endif !! !! also need physical parameters for gas exchange !! calculations ztmp(ji,jj) = tsn(ji,jj,jk,jp_tem) zsal(ji,jj) = tsn(ji,jj,jk,jp_sal) !! !! AXY (28/02/14): check input fields if (ztmp(ji,jj) .lt. -3.0 .or. ztmp(ji,jj) .gt. 40.0 ) then IF(lwp) WRITE(numout,*) & ' trc_bio_medusa: T WARNING 2D, ', & tsb(ji,jj,jk,jp_tem), tsn(ji,jj,jk,jp_tem), & ' at (', ji, ',', jj, ',', jk, ') at time', kt IF(lwp) WRITE(numout,*) & ' trc_bio_medusa: T SWITCHING 2D, ', & tsn(ji,jj,jk,jp_tem), ' -> ', tsb(ji,jj,jk,jp_tem) !! temperatur ztmp(ji,jj) = tsb(ji,jj,jk,jp_tem) endif if (zsal(ji,jj) .lt. 0.0 .or. zsal(ji,jj) .gt. 45.0 ) then IF(lwp) WRITE(numout,*) & ' trc_bio_medusa: S WARNING 2D, ', & tsb(ji,jj,jk,jp_sal), tsn(ji,jj,jk,jp_sal), & ' at (', ji, ',', jj, ',', jk, ') at time', kt endif ENDIF ENDDO ENDDO # else DO jj = 2,jpjm1 DO ji = 2,jpim1 if (tmask(ji,jj,jk) == 1) then !! implicit detrital carbon zdtc(ji,jj) = zdet(ji,jj) * xthetad ENDIF ENDDO ENDDO # endif # if defined key_debug_medusa DO jj = 2,jpjm1 DO ji = 2,jpim1 if (tmask(ji,jj,jk) == 1) then if (idf.eq.1) then !! AXY (15/01/10) if (trn(ji,jj,jk,jpdin).lt.0.) then IF (lwp) write (numout,*) & '------------------------------' IF (lwp) write (numout,*) 'NEGATIVE DIN ERROR =', & trn(ji,jj,jk,jpdin) IF (lwp) write (numout,*) 'NEGATIVE DIN ERROR @', & ji, jj, jk, kt endif if (trn(ji,jj,jk,jpsil).lt.0.) then IF (lwp) write (numout,*) & '------------------------------' IF (lwp) write (numout,*) 'NEGATIVE SIL ERROR =', & trn(ji,jj,jk,jpsil) IF (lwp) write (numout,*) 'NEGATIVE SIL ERROR @', & ji, jj, jk, kt endif # if defined key_roam if (trn(ji,jj,jk,jpdic).lt.0.) then IF (lwp) write (numout,*) & '------------------------------' IF (lwp) write (numout,*) 'NEGATIVE DIC ERROR =', & trn(ji,jj,jk,jpdic) IF (lwp) write (numout,*) 'NEGATIVE DIC ERROR @', & ji, jj, jk, kt endif if (trn(ji,jj,jk,jpalk).lt.0.) then IF (lwp) write (numout,*) & '------------------------------' IF (lwp) write (numout,*) 'NEGATIVE ALK ERROR =', & trn(ji,jj,jk,jpalk) IF (lwp) write (numout,*) 'NEGATIVE ALK ERROR @', & ji, jj, jk, kt endif if (trn(ji,jj,jk,jpoxy).lt.0.) then IF (lwp) write (numout,*) & '------------------------------' IF (lwp) write (numout,*) 'NEGATIVE OXY ERROR =', & trn(ji,jj,jk,jpoxy) IF (lwp) write (numout,*) 'NEGATIVE OXY ERROR @', & ji, jj, jk, kt endif # endif endif ENDIF ENDDO ENDDO # endif # if defined key_debug_medusa ! I'M NOT SURE THIS IS USEFUL NOW THAT I'VE SPLIT THE DO LOOP - marc 8/5/17 ! if (idf.eq.1.AND.idfval.eq.1) then ! DO jj = 2,jpjm1 ! DO ji = 2,jpim1 ! if (tmask(ji,jj,jk) == 1) then ! !! report state variable values ! IF (lwp) write (numout,*) & ! '------------------------------' ! IF (lwp) write (numout,*) 'fthk(',jk,') = ', & ! fse3t(ji,jj,jk) ! IF (lwp) write (numout,*) 'zphn(',jk,') = ', zphn(ji,jj) ! IF (lwp) write (numout,*) 'zphd(',jk,') = ', zphd(ji,jj) ! IF (lwp) write (numout,*) 'zpds(',jk,') = ', zpds(ji,jj) ! IF (lwp) write (numout,*) 'zzmi(',jk,') = ', zzmi(ji,jj) ! IF (lwp) write (numout,*) 'zzme(',jk,') = ', zzme(ji,jj) ! IF (lwp) write (numout,*) 'zdet(',jk,') = ', zdet(ji,jj) ! IF (lwp) write (numout,*) 'zdin(',jk,') = ', zdin(ji,jj) ! IF (lwp) write (numout,*) 'zsil(',jk,') = ', zsil(ji,jj) ! IF (lwp) write (numout,*) 'zfer(',jk,') = ', zfer(ji,jj) # if defined key_roam ! IF (lwp) write (numout,*) 'zdtc(',jk,') = ', zdtc(ji,jj) ! IF (lwp) write (numout,*) 'zdic(',jk,') = ', zdic(ji,jj) ! IF (lwp) write (numout,*) 'zalk(',jk,') = ', zalk(ji,jj) ! IF (lwp) write (numout,*) 'zoxy(',jk,') = ', zoxy(ji,jj) # endif ! ENDIF ! ENDDO ! ENDDO ! endif # endif # if defined key_debug_medusa ! I'M NOT SURE THIS IS USEFUL NOW THAT I'VE SPLIT THE DO LOOP - marc 8/5/17 ! if (idf.eq.1.AND.idfval.eq.1.AND.jk.eq.1) then ! DO jj = 2,jpjm1 ! DO ji = 2,jpim1 ! if (tmask(ji,jj,jk) == 1) then ! IF (lwp) write (numout,*) & ! '------------------------------' ! IF (lwp) write (numout,*) 'dust = ', dust(ji,jj) ! ENDIF ! ENDDO ! ENDDO ! endif # endif !!--------------------------------------------------------------- !! Calculate air-sea gas exchange and river inputs !!--------------------------------------------------------------- IF ( jk == 1 ) THEN CALL air_sea( kt ) ENDIF !!--------------------------------------------------------------- !! Phytoplankton growth, zooplankton grazing and miscellaneous !! plankton losses. !!--------------------------------------------------------------- CALL plankton( jk ) !!--------------------------------------------------------------- !! Iron chemistry and scavenging !!--------------------------------------------------------------- CALL iron_chem_scav( jk ) !!--------------------------------------------------------------- !! Detritus processes !!--------------------------------------------------------------- CALL detritus( jk, iball ) !!--------------------------------------------------------------- !! Updating tracers !!--------------------------------------------------------------- CALL bio_medusa_update( kt, jk ) !!--------------------------------------------------------------- !! Diagnostics !!--------------------------------------------------------------- CALL bio_medusa_diag( jk ) !!------------------------------------------------------- !! 2d specific k level diags !!------------------------------------------------------- IF( lk_iomput ) THEN CALL bio_medusa_diag_slice( jk ) ENDIF !! CLOSE vertical loop ENDDO !!------------------------------------------------------------------ !! Final calculations for diagnostics !!------------------------------------------------------------------ CALL bio_medusa_fin( kt ) # if defined key_debug_medusa IF(lwp) WRITE(numout,*) ' MEDUSA exiting trc_bio_medusa at kt =', kt CALL flush(numout) # endif END SUBROUTINE trc_bio_medusa #else !!===================================================================== !! Dummy module : No MEDUSA bio-model !!===================================================================== CONTAINS SUBROUTINE trc_bio_medusa( kt ) ! Empty routine INTEGER, INTENT( in ) :: kt WRITE(*,*) 'trc_bio_medusa: You should not have seen this print! error?', kt END SUBROUTINE trc_bio_medusa #endif !!===================================================================== END MODULE trcbio_medusa