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 6606 for branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/TOP_SRC/trcini.F90 – NEMO

Ignore:
Timestamp:
2016-05-23T17:06:46+02:00 (8 years ago)
Author:
cetlod
Message:

Bugfix on passive tracers restoring ; the previous one was not properly done, see ticket 16677

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/TOP_SRC/trcini.F90

    r6308 r6606  
    3030   USE trcsub          ! variables to substep passive tracers 
    3131   USE lib_mpp         ! distribued memory computing library 
     32   USE wrk_nemo 
    3233   USE sbc_oce 
    3334   USE trcice          ! tracers in sea ice 
     
    6162      INTEGER ::   jk, jn, jl    ! dummy loop indices 
    6263      CHARACTER (len=25) :: charout 
     64      REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztrcdta 
    6365      !!--------------------------------------------------------------------- 
    6466      ! 
     
    120122        IF( ln_trcdta .AND. nb_trcdta > 0 ) THEN  ! Initialisation of tracer from a file that may also be used for damping 
    121123            ! 
     124            CALL wrk_alloc( jpi, jpj, jpk, nb_trcdta, ztrcdta ) 
     125            ! 
     126            CALL trc_dta( nit000, ztrcdta )   ! read tracer data at nit000 
     127            ! 
    122128            DO jn = 1, jptra 
    123129               IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file 
    124130                  jl = n_trc_index(jn)  
    125                   CALL trc_dta( nit000, sf_trcdta(jl) )   ! read tracer data at nit000 
    126                   trn(:,:,:,jn) = sf_trcdta(jl)%fnow(:,:,:) * tmask(:,:,:) * rf_trfac(jl) 
    127                   ! 
    128                   IF( .NOT.ln_trcdmp .AND. .NOT.ln_trcdmp_clo ) THEN      !== deallocate data structure   ==! 
    129                      !                                                    (data used only for initialisation) 
    130                      IF(lwp) WRITE(numout,*) 'trc_dta: deallocate data arrays as they are only used to initialize the run' 
    131                                                   DEALLOCATE( sf_trcdta(jl)%fnow )     !  arrays in the structure 
    132                      IF( sf_trcdta(jl)%ln_tint )  DEALLOCATE( sf_trcdta(jl)%fdta ) 
    133                      ! 
    134                   ENDIF 
     131                  trn(:,:,:,jn) = ztrcdta(:,:,:,jl) * rf_trfac(jl) 
    135132               ENDIF 
    136133            ENDDO 
    137134            ! 
     135            CALL wrk_dealloc( jpi, jpj, jpk, nb_trcdta, ztrcdta ) 
     136            !  
    138137        ENDIF 
    139138        ! 
Note: See TracChangeset for help on using the changeset viewer.