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 13342 for NEMO/releases/r4.0/r4.0-HEAD/src/TOP/PISCES/P4Z/p4zsms.F90 – NEMO

Ignore:
Timestamp:
2020-07-27T11:32:05+02:00 (4 years ago)
Author:
cetlod
Message:

r4.0-HEAD : bugfix on PISCES temporal scheme, see ticket #2501

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/releases/r4.0/r4.0-HEAD/src/TOP/PISCES/P4Z/p4zsms.F90

    r13029 r13342  
    6565      REAL(wp), ALLOCATABLE, DIMENSION(:,:    ) :: zw2d 
    6666      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:  ) :: zw3d 
    67       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::   ztrdt   ! 4D workspace 
     67      REAL(wp), DIMENSION(jpi,jpj,jpk,jp_pisces) :: ztrbbio 
    6868 
    6969      !!--------------------------------------------------------------------- 
     
    8989      rfact = r2dttrc 
    9090      ! 
    91       ! trends computation initialisation 
    92       IF( l_trdtrc )  THEN 
    93          ALLOCATE( ztrdt(jpi,jpj,jpk,jp_pisces) )  !* store now fields before applying the Asselin filter 
    94          ztrdt(:,:,:,:)  = trn(:,:,:,:) 
    95       ENDIF 
    96       ! 
    97  
    9891      IF( ( ln_top_euler .AND. kt == nittrc000 )  .OR. ( .NOT.ln_top_euler .AND. kt <= nittrc000 + nn_dttrc ) ) THEN 
    9992         rfactr  = 1. / rfact 
     
    113106         END DO 
    114107      ENDIF 
     108 
     109      DO jn = jp_pcs0, jp_pcs1              !   Store the tracer concentrations before entering PISCES 
     110         ztrbbio(:,:,:,jn) = trb(:,:,:,jn) 
     111      END DO 
     112 
    115113      ! 
    116114      IF( ll_sbc ) CALL p4z_sbc( kt )   ! external sources of nutrients  
     
    145143           trb(:,:,:,jn) = trb(:,:,:,jn) + xnegtr(:,:,:) * tra(:,:,:,jn) 
    146144         END DO 
     145         
    147146        ! 
    148147        IF(  iom_use( 'INTdtAlk' ) .OR. iom_use( 'INTdtDIC' ) .OR. iom_use( 'INTdtFer' ) .OR.  & 
     
    194193        ENDIF 
    195194        ! 
    196          DO jn = jp_pcs0, jp_pcs1 
    197             tra(:,:,:,jn) = 0._wp 
    198          END DO 
    199          ! 
    200          IF( ln_top_euler ) THEN 
    201             DO jn = jp_pcs0, jp_pcs1 
    202                trn(:,:,:,jn) = trb(:,:,:,jn) 
    203             END DO 
    204          ENDIF 
     195        DO jn = jp_pcs0, jp_pcs1 
     196           tra(:,:,:,jn) = 0._wp 
     197        END DO 
     198        ! 
     199      END DO 
     200      ! 
     201#endif 
     202      ! 
     203      IF( ln_sediment ) THEN  
     204         ! 
     205         CALL sed_model( kt )     !  Main program of Sediment model 
     206         ! 
     207      ENDIF 
     208      ! 
     209      DO jn = jp_pcs0, jp_pcs1 
     210         tra(:,:,:,jn) = ( trb(:,:,:,jn) - ztrbbio(:,:,:,jn) ) * rfactr 
     211         trb(:,:,:,jn) = ztrbbio(:,:,:,jn) 
     212         ztrbbio(:,:,:,jn) = 0._wp 
    205213      END DO 
    206214      ! 
    207215      IF( l_trdtrc ) THEN 
    208216         DO jn = jp_pcs0, jp_pcs1 
    209            ztrdt(:,:,:,jn) = ( trb(:,:,:,jn) - ztrdt(:,:,:,jn) ) * rfactr  
    210            CALL trd_trc( ztrdt(:,:,:,jn), jn, jptra_sms, kt )   ! save trends 
     217           CALL trd_trc( tra(:,:,:,jn), jn, jptra_sms, kt )   ! save trends 
    211218         END DO 
    212          DEALLOCATE( ztrdt )  
    213219      END IF 
    214 #endif 
    215       ! 
    216       IF( ln_sediment ) THEN  
    217          ! 
    218          CALL sed_model( kt )     !  Main program of Sediment model 
    219          ! 
    220          IF( ln_top_euler ) THEN 
    221             DO jn = jp_pcs0, jp_pcs1 
    222                trn(:,:,:,jn) = trb(:,:,:,jn) 
    223             END DO 
    224          ENDIF 
    225          ! 
    226       ENDIF 
    227       ! 
     220      !   
    228221      IF( lrst_trc )  CALL p4z_rst( kt, 'WRITE' )  !* Write PISCES informations in restart file  
    229222      ! 
Note: See TracChangeset for help on using the changeset viewer.