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 8372 for branches/NERC/dev_r5518_GO6_CleanMedusa/NEMOGCM/NEMO/TOP_SRC/MEDUSA/bio_medusa_fin.F90 – NEMO

Ignore:
Timestamp:
2017-07-25T18:58:24+02:00 (7 years ago)
Author:
jpalmier
Message:

JPALM -- debug switch TOP module call order ; remove trc2d and trc3d from MEDUSA (obsolete); rm trcrst_medusa (obsolete)

File:
1 edited

Legend:

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

    r8352 r8372  
    5151                                   zn_sed_c, zn_sed_ca, zn_sed_fe,      & 
    5252                                   zn_sed_n, zn_sed_si 
    53       USE trc,               ONLY: ctrc2d, ctrc3d, ln_diatrc,           & 
    54                                    med_diag, nittrc000,                 & 
    55                                    trbio, trc2d, trc3d 
     53      USE trc,               ONLY: med_diag, nittrc000  
    5654      USE trcnam_trp,        ONLY: ln_trcadv_cen2, ln_trcadv_tvd 
    5755  
     
    10098         zn_sed_ca(:,:) = za_sed_ca(:,:) 
    10199      endif 
    102       IF( ln_diatrc ) THEN 
    103          DO jj = 2,jpjm1 
    104             DO ji = 2,jpim1 
    105                trc2d(ji,jj,131) = za_sed_n(ji,jj) 
    106                trc2d(ji,jj,132) = za_sed_fe(ji,jj) 
    107                trc2d(ji,jj,133) = za_sed_c(ji,jj) 
    108                trc2d(ji,jj,134) = za_sed_si(ji,jj) 
    109                trc2d(ji,jj,135) = za_sed_ca(ji,jj) 
    110             ENDDO 
    111          ENDDO 
    112       ENDIF  
    113100      !! 
    114101      if (ibenthic.eq.2) then 
     
    314301#  endif 
    315302 
    316       IF( ln_diatrc ) THEN 
    317          !!----------------------------------------------------------------- 
    318          !! Output several accumulated diagnostics 
    319          !!   - biomass-average phytoplankton limitation terms 
    320          !!   - integrated tendency terms 
    321          !!----------------------------------------------------------------- 
    322          !!  
    323          DO jj = 2,jpjm1 
    324             DO ji = 2,jpim1 
    325                !! non-diatom phytoplankton limitations 
    326                trc2d(ji,jj,25)  = trc2d(ji,jj,25) / MAX(ftot_pn(ji,jj), rsmall) 
    327                trc2d(ji,jj,26)  = trc2d(ji,jj,26) / MAX(ftot_pn(ji,jj), rsmall) 
    328                trc2d(ji,jj,27)  = trc2d(ji,jj,27) / MAX(ftot_pn(ji,jj), rsmall) 
    329                !! diatom phytoplankton limitations 
    330                trc2d(ji,jj,28)  = trc2d(ji,jj,28) / MAX(ftot_pd(ji,jj), rsmall) 
    331                trc2d(ji,jj,29)  = trc2d(ji,jj,29) / MAX(ftot_pd(ji,jj), rsmall) 
    332                trc2d(ji,jj,30)  = trc2d(ji,jj,30) / MAX(ftot_pd(ji,jj), rsmall) 
    333                trc2d(ji,jj,31)  = trc2d(ji,jj,31) / MAX(ftot_pd(ji,jj), rsmall) 
    334                trc2d(ji,jj,32)  = trc2d(ji,jj,32) / MAX(ftot_pd(ji,jj), rsmall) 
    335                !! tendency terms 
    336                trc2d(ji,jj,76)  = fflx_n(ji,jj) 
    337                trc2d(ji,jj,77)  = fflx_si(ji,jj) 
    338                trc2d(ji,jj,78)  = fflx_fe(ji,jj) 
    339                !! Integrated biomass. 
    340                !! integrated non-diatom phytoplankton 
    341                trc2d(ji,jj,79)  = ftot_pn(ji,jj) 
    342                !! integrated diatom phytoplankton 
    343                trc2d(ji,jj,80)  = ftot_pd(ji,jj) 
    344                !! Integrated microzooplankton 
    345                trc2d(ji,jj,217) = ftot_zmi(ji,jj) 
    346                !! Integrated mesozooplankton 
    347                trc2d(ji,jj,218) = ftot_zme(ji,jj) 
    348                !! Integrated slow detritus, nitrogen 
    349                trc2d(ji,jj,219) = ftot_det(ji,jj) 
    350                !! Integrated slow detritus, carbon 
    351                trc2d(ji,jj,220) = ftot_dtc(ji,jj) 
    352 # if defined key_roam 
    353                !! The balance of nitrogen production/consumption. 
    354                !! integrated nitrogen production 
    355                trc2d(ji,jj,111) = fnit_prod(ji,jj) 
    356                !! integrated nitrogen consumption 
    357                trc2d(ji,jj,112) = fnit_cons(ji,jj) 
    358                !! The balance of carbon production/consumption. 
    359                !! integrated carbon production 
    360                trc2d(ji,jj,113) = fcar_prod(ji,jj) 
    361                !! integrated carbon consumption 
    362                trc2d(ji,jj,114) = fcar_cons(ji,jj) 
    363                !! The balance of oxygen production/consumption. 
    364                !! integrated oxygen production 
    365                trc2d(ji,jj,115) = foxy_prod(ji,jj) 
    366                !! integrated oxygen consumption 
    367                trc2d(ji,jj,116) = foxy_cons(ji,jj) 
    368                !! integrated unrealised oxygen consumption 
    369                trc2d(ji,jj,117) = foxy_anox(ji,jj) 
    370 # endif 
    371             ENDDO 
    372          ENDDO 
    373           
    374 # if defined key_roam 
    375 #  if defined key_axy_nancheck 
    376          !!--------------------------------------------------------------- 
    377          !! Check for NaNs in diagnostic outputs 
    378          !!--------------------------------------------------------------- 
    379          !!  
    380          !! 2D diagnostics 
    381          DO jn = 1,150 
    382             fq0 = SUM(trc2d(:,:,jn)) 
    383             !! AXY (30/01/14): "isnan" problem on HECTOR 
    384             !! if (fq0 /= fq0 ) then 
    385             if ( ieee_is_nan( fq0 ) ) then 
    386                !! there's a NaN here 
    387                if (lwp) write(numout,*)                                     & 
    388                   'NAN detected in 2D diagnostic field', jn, 'at time',     & 
    389                    kt, 'at position:' 
    390                DO jj = 1,jpj 
    391                   DO ji = 1,jpi 
    392                      if ( ieee_is_nan( trc2d(ji,jj,jn) ) ) then 
    393                         if (lwp) write (numout,'(a,3i6)') 'NAN-CHECK',      & 
    394                                  ji, jj, jn 
    395                      endif 
    396                   ENDDO 
    397                ENDDO 
    398           CALL ctl_stop( 'trcbio_medusa, NAN in 2D diagnostic field' ) 
    399             endif 
    400          ENDDO 
    401          !! 
    402          !! 3D diagnostics 
    403          DO jn = 1,5 
    404             fq0 = SUM(trc3d(:,:,:,jn)) 
    405             !! AXY (30/01/14): "isnan" problem on HECTOR 
    406             !! if (fq0 /= fq0 ) then 
    407             if ( ieee_is_nan( fq0 ) ) then 
    408                !! there's a NaN here 
    409                if (lwp) write(numout,*)                                     & 
    410                   'NAN detected in 3D diagnostic field', jn, 'at time',     & 
    411                   kt, 'at position:' 
    412                DO jk = 1,jpk 
    413                   DO jj = 1,jpj 
    414                      DO ji = 1,jpi 
    415                         if ( ieee_is_nan( trc3d(ji,jj,jk,jn) ) ) then 
    416                            if (lwp) write (numout,'(a,4i6)') 'NAN-CHECK',   & 
    417                                     ji, jj, jk, jn 
    418                         endif 
    419                      ENDDO 
    420                   ENDDO 
    421                ENDDO 
    422           CALL ctl_stop( 'trcbio_medusa, NAN in 3D diagnostic field' ) 
    423             endif 
    424          ENDDO 
    425     CALL flush(numout) 
    426 #  endif 
    427 # endif 
    428  
    429          !!---------------------------------------------------------------- 
    430          !! Don't know what this does; belongs to someone else ... 
    431          !!---------------------------------------------------------------- 
    432          !!  
    433          !! Lateral boundary conditions on trc2d 
    434          DO jn=1,jp_medusa_2d 
    435              CALL lbc_lnk(trc2d(:,:,jn),'T',1. ) 
    436          ENDDO  
    437  
    438          !! Lateral boundary conditions on trc3d 
    439          DO jn=1,jp_medusa_3d 
    440              CALL lbc_lnk(trc3d(:,:,1,jn),'T',1. ) 
    441          ENDDO  
    442  
    443  
    444 # if defined key_axy_nodiag 
    445          !!---------------------------------------------------------------- 
    446          !! Blank diagnostics as a NaN-trap 
    447          !!---------------------------------------------------------------- 
    448          !!  
    449          !! blank 2D diagnostic array 
    450          trc2d(:,:,:) = 0.e0 
    451          !! 
    452          !! blank 3D diagnostic array 
    453          trc3d(:,:,:,:) = 0.e0 
    454 # endif 
    455  
    456  
    457          !!---------------------------------------------------------------- 
    458          !! Add in XML diagnostics stuff 
    459          !!---------------------------------------------------------------- 
    460          !! 
    461          !! ** 2D diagnostics 
    462          DO jn=1,jp_medusa_2d 
    463             CALL iom_put(TRIM(ctrc2d(jn)), trc2d(:,:,jn)) 
    464          END DO 
    465 !! AXY (17/02/14): don't think I need this if I modify the above for  
    466 !! all diagnostics 
    467 !! #  if defined key_roam 
    468 !!          DO jn=91,jp_medusa_2d 
    469 !!             CALL iom_put(TRIM(ctrc2d(jn)), trc2d(:,:,jn)) 
    470 !!          END DO       
    471 !! #  endif 
    472          !! 
    473          !! ** 3D diagnostics 
    474          DO jn=1,jp_medusa_3d 
    475             CALL iom_put(TRIM(ctrc3d(jn)), trc3d(:,:,:,jn)) 
    476          END DO 
    477 !! AXY (17/02/14): don't think I need this if I modify the above for  
    478 !! all diagnostics 
    479 !! #  if defined key_roam 
    480 !!          CALL iom_put(TRIM(ctrc3d(5)), trc3d(:,:,:,5)) 
    481 !! #  endif 
    482  
    483  
    484       ELSE IF( lk_iomput .AND. .NOT. ln_diatrc ) THEN 
    485303         !!!--------------------------------------------------------------- 
    486304         !! Add very last diag calculations  
     
    1173991          DEALLOCATE( zw2d ) 
    1174992 
    1175        ENDIF                    ! end of ln_diatrc option 
    1176  
    1177993   END SUBROUTINE bio_medusa_fin 
    1178994 
Note: See TracChangeset for help on using the changeset viewer.