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 8352 for branches/NERC – NEMO

Changeset 8352 for branches/NERC


Ignore:
Timestamp:
2017-07-19T16:26:37+02:00 (7 years ago)
Author:
jpalmier
Message:

jpalm -- debug plus add conservation test print statement in debug mode

Location:
branches/NERC/dev_r5518_GO6_CleanMedusa/NEMOGCM/NEMO/TOP_SRC/MEDUSA
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/NERC/dev_r5518_GO6_CleanMedusa/NEMOGCM/NEMO/TOP_SRC/MEDUSA/bio_medusa_fin.F90

    r8344 r8352  
    3232      !!---------------------------------------------------------------------- 
    3333      USE bio_medusa_mod 
    34       USE dom_oce,           ONLY: atfp, atfp1, neuler, rdt 
     34      USE dom_oce,           ONLY: atfp, atfp1, neuler, rdt, e3t_n, tmask 
    3535      USE in_out_manager,    ONLY: lwp, numout 
    3636# if defined key_iomput 
     
    6161      INTEGER :: ji, jj 
    6262      INTEGER :: jn 
     63 
     64      REAL(wp) :: fq0,fq1,fq2,fq3 
     65 
    6366      !!---------------------------------------------------------------------- 
    6467      !! Process benthic in/out fluxes 
     
    107110            ENDDO 
    108111         ENDDO 
    109          !! AXY (07/07/15): temporary hijacking 
    110 # if defined key_roam 
    111   !!       trc2d(:,:,126) = zn_dms_chn(:,:) 
    112   !!       trc2d(:,:,127) = zn_dms_chd(:,:) 
    113   !!       trc2d(:,:,128) = zn_dms_mld(:,:) 
    114   !!       trc2d(:,:,129) = zn_dms_qsr(:,:) 
    115   !!       trc2d(:,:,130) = zn_dms_din(:,:) 
    116 # endif 
    117112      ENDIF  
    118113      !! 
     
    235230         ENDIF 
    236231      endif 
    237        
     232 
     233#  if defined key_debug_medusa 
     234         !! AXY (12/07/17) 
     235         !!----------------------------------------------------------------- 
     236         !! Check conservation of MEDUSA's sinks-minus-sources using fflx_X  
     237         !! diagnostics (i.e. biogeochemical processes only) 
     238         !!   - fflx_X diagnostics *should* include all transfers between 
     239         !!     modelled components 
     240         !!   - they should also include gains / losses due to air-sea  
     241         !!     fluxes of C and O2, aeolian and seafloor inputs of Fe, and  
     242         !!     inputs from seafloor "benthic buckets" (N, Si, Fe, C and  
     243         !!     alkalinity) 
     244         !!   - however, they do not include the transfer of material to  
     245         !!     "benthic buckets" by sedimenting slow- and fast-sinking 
     246         !!     detritus since these are separate 2D reservoirs 
     247         !!   - consequently, for a given water column, the integrated 
     248         !!     fluxes should sum to the "loss" of material to the "benthic 
     249         !!     buckets" 
     250         !!   - if they do not, this suggests that MEDUSA contains errors 
     251         !!     in its accounting (e.g. processes omitted from calculated 
     252         !!     fluxes) 
     253         !!   - here, the local integrated fluxes and benthic inputs (plus 
     254         !!     air-sea fluxes in the case of C) are reported together with 
     255         !!     the resulting error 
     256         !!   - only N, Si, C and alkalinity inventories considered; Fe and 
     257         !!     O2 overlooked because of wholesale loss (and addition, in  
     258         !!     the case of O2) of these tracers within the water column 
     259         !!----------------------------------------------------------------- 
     260         !! 
     261         !! nitrogen 
     262         DO jj = 2,jpjm1 
     263            DO ji = 2,jpim1 
     264               if (tmask(ji,jj,1) == 1) then 
     265                  fq0 = fflx_n(ji,jj) 
     266                  fq1 = f_sbenin_n(ji,jj) + f_fbenin_n(ji,jj) 
     267                  fq2 = fq0 + fq1 
     268                  IF (lwp) write (numout,'(a,2i3,a,3f15.10)')               & 
     269                     'AXY N   cons: (i,j)=',ji,jj,', (flx,ben,err)=',      & 
     270                     fq0,fq1,fq2 
     271               ENDIF 
     272            ENDDO 
     273         ENDDO    
     274         !! silicon 
     275         DO jj = 2,jpjm1 
     276            DO ji = 2,jpim1 
     277               if (tmask(ji,jj,1) == 1) then 
     278                  fq0 = fflx_si(ji,jj) 
     279                  fq1 = f_fbenin_si(ji,jj) 
     280                  fq2 = fq0 + fq1 
     281                  IF (lwp) write (numout,'(a,2i3,a,3f15.10)')               & 
     282                     'AXY Si  cons: (i,j)=',ji,jj,', (flx,ben,err)=',     & 
     283                     fq0,fq1,fq2 
     284               ENDIF 
     285            ENDDO 
     286         ENDDO    
     287         !! carbon 
     288         DO jj = 2,jpjm1 
     289            DO ji = 2,jpim1 
     290               if (tmask(ji,jj,1) == 1) then 
     291                  fq0 = fflx_c(ji,jj) 
     292                  fq1 = f_sbenin_c(ji,jj) + f_fbenin_c(ji,jj) + f_fbenin_ca(ji,jj) 
     293                  fq2 = f_co2flux(ji,jj) * e3t_n(ji,jj,1) 
     294                  fq3 = fq0 + fq1 
     295                  IF (lwp) write (numout,'(a,2i3,a,4f15.10)')               & 
     296                    'AXY C   cons: (i,j)=',ji,jj,', (flx,ben,asf,err)=',  & 
     297                    fq0,fq1,fq2,fq3 
     298               ENDIF 
     299            ENDDO 
     300         ENDDO    
     301         !! alkalinity 
     302         DO jj = 2,jpjm1 
     303            DO ji = 2,jpim1 
     304               if (tmask(ji,jj,1) == 1) then 
     305                  fq0 = fflx_a(ji,jj) 
     306                  fq1 = 2.0 * f_fbenin_ca(ji,jj) 
     307                  fq2 = fq0 + fq1 
     308                  IF (lwp) write (numout,'(a,2i3,a,3f15.10)')               & 
     309                     'AXY alk cons: (i,j)=',ji,jj,', (flx,ben,err)=',     & 
     310                     fq0,fq1,fq2 
     311               ENDIF 
     312            ENDDO 
     313         ENDDO    
     314#  endif 
     315 
    238316      IF( ln_diatrc ) THEN 
    239317         !!----------------------------------------------------------------- 
  • branches/NERC/dev_r5518_GO6_CleanMedusa/NEMOGCM/NEMO/TOP_SRC/MEDUSA/trcbio_medusa.F90

    r8344 r8352  
    350350      !!          x * 30d + 1*rdt(i.e: mod = rdt)    
    351351      !!          ++ need to pass carb-chem output var through restarts 
    352       If ( ( kt == nittrc000 .AND. .NOT.ln_rsttr ) .OR.                      & 
    353            ( mod(kt*rdt,2592000.) == rdt ) ) THEN 
    354352      If ( (kt == nittrc000 .AND. .NOT.ln_rsttr) .OR.                        & 
    355353           ((86400*mod(nn_date0,100) + mod(kt*rdt,2592000.)) == rdt) ) THEN 
Note: See TracChangeset for help on using the changeset viewer.