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 4996 for trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90 – NEMO

Ignore:
Timestamp:
2014-12-22T12:56:38+01:00 (9 years ago)
Author:
cetlod
Message:

trunk : New diagnostics in PISCES model, see ticket #1424

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/TOP_SRC/PISCES/P4Z/p4zsms.F90

    r4990 r4996  
    120120         ENDDO 
    121121      ENDIF 
    122  
    123122      CALL p4z_lys( kt )             ! Compute CaCO3 saturation 
    124123      CALL p4z_flx( kt )             ! Compute surface fluxes 
     
    151150      END IF 
    152151      ! 
    153       CALL p4z_chk_mass( kt ) ! Mass conservation checking 
     152      IF( lk_iomput .OR. ln_check_mass )  CALL p4z_chk_mass( kt ) ! Mass conservation checking 
    154153 
    155154      IF ( lwm .AND. kt == nittrc000 ) CALL FLUSH    ( numonp )     ! flush output namelist PISCES 
     
    328327         ENDIF 
    329328         ! 
     329         IF( iom_varid( numrtr, 'tcflxcum', ldstop = .FALSE. ) > 0 ) THEN  ! cumulative total flux of carbon 
     330            CALL iom_get( numrtr, 'tcflxcum' , t_oce_co2_flx_cum  ) 
     331         ELSE 
     332            t_oce_co2_flx_cum = 0._wp 
     333         ENDIF 
     334         ! 
    330335      ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN 
    331336         IF( kt == nitrst ) THEN 
     
    337342         CALL iom_rstput( kt, nitrst, numrtw, 'Silicalim', xksi(:,:) ) 
    338343         CALL iom_rstput( kt, nitrst, numrtw, 'Silicamax', xksimax(:,:) ) 
     344         CALL iom_rstput( kt, nitrst, numrtw, 'tcflxcum', t_oce_co2_flx_cum ) 
    339345      ENDIF 
    340346      ! 
     
    398404      !!--------------------------------------------------------------------- 
    399405      ! 
    400       INTEGER, INTENT( in ) ::   kt      ! ocean time-step index       
     406      INTEGER , INTENT( in ) ::   kt      ! ocean time-step index       
     407      REAL(wp)               ::  zfact        
    401408      !! 
    402409      !!--------------------------------------------------------------------- 
     
    409416      ENDIF 
    410417 
    411       IF( ln_check_mass .AND. kt == nitend ) THEN      !   Compute the budget of NO3, ALK, Si, Fer 
     418      IF( iom_use( "pno3tot" ) .OR. ( ln_check_mass .AND. kt == nitend )  ) THEN 
     419         !   Compute the budget of NO3, ALK, Si, Fer 
    412420         no3budget = glob_sum( (   trn(:,:,:,jpno3) + trn(:,:,:,jpnh4)  & 
    413421            &                    + trn(:,:,:,jpphy) + trn(:,:,:,jpdia)  & 
     
    417425            &                    + trn(:,:,:,jpgoc)                     & 
    418426#endif 
    419             &                    + trn(:,:,:,jpdoc)                     ) * cvol(:,:,:)  )  
    420          !  
     427            &                    + trn(:,:,:,jpdoc)                     ) * cvol(:,:,:)  ) 
     428         ! 
     429         no3budget = no3budget / areatot 
     430         CALL iom_put( "pno3tot", no3budget ) 
     431      ENDIF 
     432      ! 
     433      IF( iom_use( "psiltot" ) .OR.  ( ln_check_mass .AND. kt == nitend )  ) THEN 
    421434         silbudget = glob_sum( (   trn(:,:,:,jpsil) + trn(:,:,:,jpgsi)  & 
    422435            &                    + trn(:,:,:,jpdsi)                     ) * cvol(:,:,:)  ) 
    423          !  
     436         ! 
     437         silbudget = silbudget / areatot 
     438         CALL iom_put( "psiltot", silbudget ) 
     439      ENDIF 
     440      ! 
     441      IF( iom_use( "palktot" ) .OR.  ( ln_check_mass .AND. kt == nitend )  ) THEN 
    424442         alkbudget = glob_sum( (   trn(:,:,:,jpno3) * rno3              & 
    425443            &                    + trn(:,:,:,jptal)                     & 
    426444            &                    + trn(:,:,:,jpcal) * 2.                ) * cvol(:,:,:)  ) 
    427          !  
     445         ! 
     446         alkbudget = alkbudget / areatot 
     447         CALL iom_put( "palktot", alkbudget ) 
     448      ENDIF 
     449      ! 
     450      IF( iom_use( "pfertot" ) .OR.  ( ln_check_mass .AND. kt == nitend )  ) THEN 
    428451         ferbudget = glob_sum( (   trn(:,:,:,jpfer) + trn(:,:,:,jpnfe)  & 
    429452            &                    + trn(:,:,:,jpdfe)                     & 
     
    434457            &                    + trn(:,:,:,jpzoo) * ferat3            & 
    435458            &                    + trn(:,:,:,jpmes) * ferat3            ) * cvol(:,:,:)  ) 
    436  
    437          ! 
     459         ! 
     460         ferbudget = ferbudget / areatot 
     461         CALL iom_put( "pfertot", ferbudget ) 
     462      ENDIF 
     463      ! 
     464      IF( ln_check_mass .AND. kt == nitend ) THEN   ! Compute the budget of NO3, ALK, Si, Fer 
     465         zfact = rfact2r * 12. / 1.e15 * ryyss    ! conversion molC/kt --> PgC/year 
    438466         t_atm_co2_flx  = t_atm_co2_flx / glob_sum( e1e2t(:,:) ) 
    439          t_oce_co2_flx  = t_oce_co2_flx         * 12. / 1.e15 * (-1 ) 
    440          tpp            = tpp           * 1000. * 12. / 1.E15 
    441          t_oce_co2_exp  = t_oce_co2_exp * 1000. * 12. / 1.E15 
    442          ! 
    443          no3budget = no3budget / areatot 
    444          silbudget = silbudget / areatot 
    445          alkbudget = alkbudget / areatot 
    446          ferbudget = ferbudget / areatot 
    447          ! 
    448          IF(lwp) THEN 
    449             WRITE(numco2,9000) ndastp, t_atm_co2_flx, t_oce_co2_flx, tpp, t_oce_co2_exp 
    450             WRITE(numnut,9500) ndastp, alkbudget, no3budget, silbudget, ferbudget 
    451          ENDIF 
    452          ! 
    453       ENDIF 
    454        ! 
     467         t_oce_co2_flx  = t_oce_co2_flx         * zfact * (-1 ) 
     468         tpp            = tpp           * 1000. * zfact 
     469         t_oce_co2_exp  = t_oce_co2_exp * 1000. * zfact 
     470         IF( lwp ) WRITE(numco2,9000) ndastp, t_atm_co2_flx, t_oce_co2_flx, tpp, t_oce_co2_exp 
     471         IF( lwp ) WRITE(numnut,9500) ndastp, alkbudget        * 1.e+06, & 
     472             &                                no3budget * rno3 * 1.e+06, & 
     473             &                                silbudget        * 1.e+06, & 
     474             &                                ferbudget        * 1.e+09 
     475      ENDIF 
     476      ! 
    455477 9000  FORMAT(i8,f10.5,e18.10,f10.5,f10.5) 
    456  9500  FORMAT(i8,4e18.10)      
     478 9500  FORMAT(i8,4e18.10) 
    457479       ! 
    458480   END SUBROUTINE p4z_chk_mass 
Note: See TracChangeset for help on using the changeset viewer.