New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 10302 for branches/UKMO/dev_r5518_GO6_package_FOAMv14/NEMOGCM/NEMO/TOP_SRC/trcini.F90 – NEMO

Ignore:
Timestamp:
2018-11-13T18:21:16+01:00 (5 years ago)
Author:
dford
Message:

Merge in revisions 8447:10159 of dev_r5518_GO6_package.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_GO6_package_FOAMv14/NEMOGCM/NEMO/TOP_SRC/trcini.F90

    r8442 r10302  
    2828   USE trcini_idtra    ! idealize tracer initialisation 
    2929   USE trcini_medusa   ! MEDUSA   initialisation 
     30   USE par_medusa      ! MEDUSA   parameters (needed for elemental cycles) 
    3031   USE trcdta          ! initialisation from files 
    3132   USE daymod          ! calendar manager 
     
    3536   USE sbc_oce 
    3637   USE trcice          ! tracers in sea ice 
    37   
     38# if defined key_medusa 
     39   USE sms_medusa      ! MEDUSA   initialisation 
     40# endif 
    3841   IMPLICIT NONE 
    3942   PRIVATE 
     
    6265      !!                or read data or analytical formulation 
    6366      !!--------------------------------------------------------------------- 
    64       INTEGER ::   jk, jn, jl    ! dummy loop indices 
     67      INTEGER ::   ji, jj, jk, jn, jl    ! dummy loop indices 
     68# if defined key_medusa && defined key_roam 
     69      !! AXY (23/11/2017) 
     70      REAL(wp)                         :: zsum3d, zsum2d 
     71      REAL(wp)                         :: zq1, zq2, loc_vol, loc_area 
     72      REAL(wp), DIMENSION(6)           :: loc_cycletot3, loc_cycletot2 
     73      REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztot3d 
     74      REAL(wp), DIMENSION(jpi,jpj)     :: ztot2d, carea 
     75# endif 
    6576      CHARACTER (len=25) :: charout 
    6677      !!--------------------------------------------------------------------- 
     
    98109      !                                                              ! total volume of the ocean  
    99110      areatot = glob_sum( cvol(:,:,:) ) 
     111# if defined key_medusa && defined key_roam 
     112      carea(:,:) = e1e2t(:,:) * tmask(:,:,1)  
     113# endif 
    100114 
    101115      IF( lk_pisces  )       CALL trc_ini_pisces       ! PISCES  bio-model 
     
    192206      ENDIF 
    193207 
    194       IF(lwp) WRITE(numout,*) 
    195       IF(lwp) WRITE(numout,*) 'trc_init : passive tracer set up completed' 
    196       IF(lwp) WRITE(numout,*) '~~~~~~~' 
    197       IF(lwp) CALL flush(numout) 
     208# if defined key_medusa && defined key_roam 
     209      ! AXY (17/11/2017): calculate initial totals of elemental cycles 
     210      ! 
     211      ! This is done in a very hard-wired way here; in future, this could be 
     212      ! replaced with loops and using a 2D array; one dimension would cover 
     213      ! the tracers, the other would be for the elements; each tracer would 
     214      ! have a factor for each element to say how much of that element was 
     215      ! in that tracer; for example, PHN would be 1.0 for N, xrfn for Fe and 
     216      ! xthetapn for C, with the other elements 0.0; the array entry for PHN 
     217      ! would then be (1. 0. xrfn xthetapn 0. 0.) for (N, Si, Fe, C, A, O2); 
     218      ! saving this for the next iteration 
     219      ! 
     220      cycletot(:) = 0._wp 
     221      ! report elemental totals at initialisation as we go along 
     222      IF ( lwp ) WRITE(numout,*) 
     223      IF ( lwp ) WRITE(numout,*)    ' Elemental cycle totals: ' 
     224      ! nitrogen 
     225      ztot3d(:,:,:) = trn(:,:,:,jpphn) + trn(:,:,:,jpphd) + trn(:,:,:,jpzmi) + & 
     226                      trn(:,:,:,jpzme) + trn(:,:,:,jpdet) + trn(:,:,:,jpdin) 
     227      ztot2d(:,:)   = zn_sed_n(:,:) 
     228      zsum3d        = glob_sum( ztot3d(:,:,:) * cvol(:,:,:) ) 
     229      zsum2d        = glob_sum( ztot2d(:,:) * carea(:,:) ) 
     230      cycletot(1)   = zsum3d + zsum2d 
     231      IF ( lwp ) WRITE(numout,9010) 'nitrogen', zsum3d, zsum2d, cycletot(1) 
     232      ! silicon 
     233      ztot3d(:,:,:) = trn(:,:,:,jppds) + trn(:,:,:,jpsil) 
     234      ztot2d(:,:)   = zn_sed_si(:,:) 
     235      zsum3d        = glob_sum( ztot3d(:,:,:) * cvol(:,:,:) ) 
     236      zsum2d        = glob_sum( ztot2d(:,:) * carea(:,:) ) 
     237      cycletot(2)   = zsum3d + zsum2d 
     238      IF ( lwp ) WRITE(numout,9010) 'silicon', zsum3d, zsum2d, cycletot(2) 
     239      ! iron 
     240      ztot3d(:,:,:) = ((trn(:,:,:,jpphn) + trn(:,:,:,jpphd) + trn(:,:,:,jpzmi) + & 
     241                      trn(:,:,:,jpzme) + trn(:,:,:,jpdet)) * xrfn) + trn(:,:,:,jpfer) 
     242      ztot2d(:,:)   = zn_sed_fe(:,:) 
     243      zsum3d        = glob_sum( ztot3d(:,:,:) * cvol(:,:,:) ) 
     244      zsum2d        = glob_sum( ztot2d(:,:) * carea(:,:) ) 
     245      cycletot(3)   = zsum3d + zsum2d 
     246      IF ( lwp ) WRITE(numout,9010) 'iron', zsum3d, zsum2d, cycletot(3) 
     247      ! carbon (uses fixed C:N ratios on plankton tracers) 
     248      ztot3d(:,:,:) = (trn(:,:,:,jpphn) * xthetapn)  + (trn(:,:,:,jpphd) * xthetapd)  +  & 
     249                      (trn(:,:,:,jpzmi) * xthetazmi) + (trn(:,:,:,jpzme) * xthetazme) +  & 
     250                      trn(:,:,:,jpdtc) + trn(:,:,:,jpdic) 
     251      ztot2d(:,:)   = zn_sed_c(:,:) + zn_sed_ca(:,:) 
     252      zsum3d        = glob_sum( ztot3d(:,:,:) * cvol(:,:,:) ) 
     253      zsum2d        = glob_sum( ztot2d(:,:) * carea(:,:) ) 
     254      cycletot(4)   = zsum3d + zsum2d 
     255      IF ( lwp ) WRITE(numout,9010) 'carbon', zsum3d, zsum2d, cycletot(4) 
     256      ! alkalinity (note benthic correction) 
     257      ztot3d(:,:,:) = trn(:,:,:,jpalk) 
     258      ztot2d(:,:)   = zn_sed_ca(:,:) * 2._wp 
     259      zsum3d        = glob_sum( ztot3d(:,:,:) * cvol(:,:,:) ) 
     260      zsum2d        = glob_sum( ztot2d(:,:) * carea(:,:) ) 
     261      cycletot(5)   = zsum3d + zsum2d 
     262      IF ( lwp ) WRITE(numout,9010) 'alkalinity', zsum3d, zsum2d, cycletot(5) 
     263      ! oxygen (note no benthic) 
     264      ztot3d(:,:,:) = trn(:,:,:,jpoxy) 
     265      ztot2d(:,:)   = 0._wp 
     266      zsum3d        = glob_sum( ztot3d(:,:,:) * cvol(:,:,:) ) 
     267      zsum2d        = glob_sum( ztot2d(:,:) * carea(:,:) ) 
     268      cycletot(6)   = zsum3d + zsum2d 
     269      IF ( lwp ) WRITE(numout,9010) 'oxygen', zsum3d, zsum2d, cycletot(6) 
     270      ! Check 
     271      zsum3d        = glob_sum( cvol(:,:,:) ) 
     272      zsum2d        = glob_sum( carea(:,:) )       
     273      IF ( lwp ) THEN 
     274         WRITE(numout,*) 
     275         WRITE(numout,*) ' check : cvol    : ', zsum3d 
     276         WRITE(numout,*) ' check : carea   : ', zsum2d 
     277         WRITE(numout,*) 
     278      ENDIF 
     279      ! 
     280# endif 
     281 
     282      IF(lwp) THEN  
     283          WRITE(numout,*) 
     284          WRITE(numout,*) 'trc_init : passive tracer set up completed' 
     285          WRITE(numout,*) '~~~~~~~' 
     286      ENDIF  
    198287# if defined key_debug_medusa 
    199288         CALL trc_rst_stat 
     
    202291 
    2032929000  FORMAT(' tracer nb : ',i2,'      name :',a10,'      initial content :',e18.10) 
     2939010  FORMAT(' element:',a10,                     & 
     294             ' 3d sum:',e18.10,' 2d sum:',e18.10, & 
     295             ' total:',e18.10) 
    204296      ! 
    205297      IF( nn_timing == 1 )   CALL timing_stop('trc_init') 
Note: See TracChangeset for help on using the changeset viewer.