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 9208 for branches/NERC/dev_r5518_GO6_conserv_check_up/NEMOGCM/NEMO/TOP_SRC/trcini.F90 – NEMO

Ignore:
Timestamp:
2018-01-10T17:06:13+01:00 (6 years ago)
Author:
jpalmier
Message:

JPALM -- GMED 364 -- clean/correct branch from GO6 Head

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/NERC/dev_r5518_GO6_conserv_check_up/NEMOGCM/NEMO/TOP_SRC/trcini.F90

    r8442 r9208  
    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   USE sms_medusa      ! MEDUSA   initialisation 
    3839   IMPLICIT NONE 
    3940   PRIVATE 
     
    6263      !!                or read data or analytical formulation 
    6364      !!--------------------------------------------------------------------- 
    64       INTEGER ::   jk, jn, jl    ! dummy loop indices 
     65      INTEGER ::   ji, jj, jk, jn, jl    ! dummy loop indices 
     66# if defined key_medusa && defined key_roam 
     67      !! AXY (23/11/2017) 
     68      REAL(wp)                         :: zsum3d, zsum2d 
     69      REAL(wp)                         :: zq1, zq2, loc_vol, loc_area 
     70      REAL(wp), DIMENSION(6)           :: loc_cycletot3, loc_cycletot2 
     71      REAL(wp), DIMENSION(jpi,jpj,jpk) :: ztot3d 
     72      REAL(wp), DIMENSION(jpi,jpj)     :: ztot2d, carea 
     73# endif 
    6574      CHARACTER (len=25) :: charout 
    6675      !!--------------------------------------------------------------------- 
     
    98107      !                                                              ! total volume of the ocean  
    99108      areatot = glob_sum( cvol(:,:,:) ) 
     109      carea(:,:) = e1e2t(:,:) * tmask(:,:,1)  
    100110 
    101111      IF( lk_pisces  )       CALL trc_ini_pisces       ! PISCES  bio-model 
     
    192202      ENDIF 
    193203 
     204# if defined key_medusa && defined key_roam 
     205      ! AXY (17/11/2017): calculate initial totals of elemental cycles 
     206      ! 
     207      ! This is done in a very hard-wired way here; in future, this could be 
     208      ! replaced with loops and using a 2D array; one dimension would cover 
     209      ! the tracers, the other would be for the elements; each tracer would 
     210      ! have a factor for each element to say how much of that element was 
     211      ! in that tracer; for example, PHN would be 1.0 for N, xrfn for Fe and 
     212      ! xthetapn for C, with the other elements 0.0; the array entry for PHN 
     213      ! would then be (1. 0. xrfn xthetapn 0. 0.) for (N, Si, Fe, C, A, O2); 
     214      ! saving this for the next iteration 
     215      ! 
     216      cycletot(:) = 0._wp 
     217      ! report elemental totals at initialisation as we go along 
     218      IF ( lwp ) WRITE(numout,*) 
     219      IF ( lwp ) WRITE(numout,*)    ' Elemental cycle totals: ' 
     220      IF ( lwp ) CALL flush(numout) 
     221      ! nitrogen 
     222      ztot3d(:,:,:) = trn(:,:,:,jpphn) + trn(:,:,:,jpphd) + trn(:,:,:,jpzmi) + & 
     223                      trn(:,:,:,jpzme) + trn(:,:,:,jpdet) + trn(:,:,:,jpdin) 
     224      ztot2d(:,:)   = zn_sed_n(:,:) 
     225      zsum3d        = glob_sum( ztot3d(:,:,:) * cvol(:,:,:) ) 
     226      zsum2d        = glob_sum( ztot2d(:,:) * carea(:,:) ) 
     227      cycletot(1)   = zsum3d + zsum2d 
     228      IF ( lwp ) WRITE(numout,9010) 'nitrogen', zsum3d, zsum2d, cycletot(1) 
     229      IF ( lwp ) CALL flush(numout) 
     230      ! silicon 
     231      ztot3d(:,:,:) = trn(:,:,:,jppds) + trn(:,:,:,jpsil) 
     232      ztot2d(:,:)   = zn_sed_si(:,:) 
     233      zsum3d        = glob_sum( ztot3d(:,:,:) * cvol(:,:,:) ) 
     234      zsum2d        = glob_sum( ztot2d(:,:) * carea(:,:) ) 
     235      cycletot(2)   = zsum3d + zsum2d 
     236      IF ( lwp ) WRITE(numout,9010) 'silicon', zsum3d, zsum2d, cycletot(2) 
     237      IF ( lwp ) CALL flush(numout) 
     238      ! iron 
     239      ztot3d(:,:,:) = ((trn(:,:,:,jpphn) + trn(:,:,:,jpphd) + trn(:,:,:,jpzmi) + & 
     240                      trn(:,:,:,jpzme) + trn(:,:,:,jpdet)) * xrfn) + trn(:,:,:,jpfer) 
     241      ztot2d(:,:)   = zn_sed_fe(:,:) 
     242      zsum3d        = glob_sum( ztot3d(:,:,:) * cvol(:,:,:) ) 
     243      zsum2d        = glob_sum( ztot2d(:,:) * carea(:,:) ) 
     244      cycletot(3)   = zsum3d + zsum2d 
     245      IF ( lwp ) WRITE(numout,9010) 'iron', zsum3d, zsum2d, cycletot(3) 
     246      IF ( lwp ) CALL flush(numout) 
     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      IF ( lwp ) CALL flush(numout) 
     257      ! alkalinity (note benthic correction) 
     258      ztot3d(:,:,:) = trn(:,:,:,jpalk) 
     259      ztot2d(:,:)   = zn_sed_ca(:,:) * 2._wp 
     260      zsum3d        = glob_sum( ztot3d(:,:,:) * cvol(:,:,:) ) 
     261      zsum2d        = glob_sum( ztot2d(:,:) * carea(:,:) ) 
     262      cycletot(5)   = zsum3d + zsum2d 
     263      IF ( lwp ) WRITE(numout,9010) 'alkalinity', zsum3d, zsum2d, cycletot(5) 
     264      IF ( lwp ) CALL flush(numout) 
     265      ! oxygen (note no benthic) 
     266      ztot3d(:,:,:) = trn(:,:,:,jpoxy) 
     267      ztot2d(:,:)   = 0._wp 
     268      zsum3d        = glob_sum( ztot3d(:,:,:) * cvol(:,:,:) ) 
     269      zsum2d        = glob_sum( ztot2d(:,:) * carea(:,:) ) 
     270      cycletot(6)   = zsum3d + zsum2d 
     271      IF ( lwp ) WRITE(numout,9010) 'oxygen', zsum3d, zsum2d, cycletot(6) 
     272      IF ( lwp ) CALL flush(numout) 
     273      ! Check 
     274      zsum3d        = glob_sum( cvol(:,:,:) ) 
     275      zsum2d        = glob_sum( carea(:,:) )       
     276      IF ( lwp ) WRITE(numout,*) 
     277      IF ( lwp ) WRITE(numout,*) ' check : cvol    : ', zsum3d 
     278      IF ( lwp ) WRITE(numout,*) ' check : carea   : ', zsum2d 
     279      IF ( lwp ) WRITE(numout,*) 
     280      IF ( lwp ) CALL flush(numout) 
     281      ! 
     282# endif 
     283 
    194284      IF(lwp) WRITE(numout,*) 
    195285      IF(lwp) WRITE(numout,*) 'trc_init : passive tracer set up completed' 
     
    202292 
    2032939000  FORMAT(' tracer nb : ',i2,'      name :',a10,'      initial content :',e18.10) 
     2949010  FORMAT(' element:',a10,                     & 
     295             ' 3d sum:',e18.10,' 2d sum:',e18.10, & 
     296             ' total:',e18.10) 
    204297      ! 
    205298      IF( nn_timing == 1 )   CALL timing_stop('trc_init') 
Note: See TracChangeset for help on using the changeset viewer.