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 6607 for trunk/NEMOGCM/NEMO/TOP_SRC/trcini.F90 – NEMO

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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/TOP_SRC/trcini.F90

    r6309 r6607  
    204204      ! 
    205205      INTEGER ::   jk, jn, jl    ! dummy loop indices 
     206      REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztrcdta 
    206207      !!---------------------------------------------------------------------- 
    207208      ! 
     
    220221        IF( ln_trcdta .AND. nb_trcdta > 0 ) THEN  ! Initialisation of tracer from a file that may also be used for damping 
    221222            ! 
    222            DO jn = 1, jptra 
     223            CALL wrk_alloc( jpi, jpj, jpk, nb_trcdta, ztrcdta ) 
     224            ! 
     225            CALL trc_dta( nit000, ztrcdta )   ! read tracer data at nit000 
     226            ! 
     227            DO jn = 1, jptra 
    223228               IF( ln_trc_ini(jn) ) THEN      ! update passive tracers arrays with input data read from file 
    224229                  jl = n_trc_index(jn)  
    225                   CALL trc_dta( nit000, sf_trcdta(jl) )   ! read tracer data at nit000 
    226                   trn(:,:,:,jn) = sf_trcdta(jl)%fnow(:,:,:) * tmask(:,:,:) * rf_trfac(jl) 
    227                   ! 
    228                   IF( .NOT.ln_trcdmp .AND. .NOT.ln_trcdmp_clo ) THEN      !== deallocate data structure   ==! 
    229                      !                                                    (data used only for initialisation) 
    230                      IF(lwp) WRITE(numout,*) 'trc_dta: deallocate data arrays as they are only used to initialize the run' 
    231                                                   DEALLOCATE( sf_trcdta(jl)%fnow )     !  arrays in the structure 
    232                      IF( sf_trcdta(jl)%ln_tint )  DEALLOCATE( sf_trcdta(jl)%fdta ) 
    233                      ! 
    234                   ENDIF 
     230                  trn(:,:,:,jn) = ztrcdta(:,:,:,jl) * rf_trfac(jl) 
    235231               ENDIF 
    236232            ENDDO 
    237233            ! 
     234            CALL wrk_dealloc( jpi, jpj, jpk, nb_trcdta, ztrcdta ) 
     235            !  
    238236        ENDIF 
    239237        ! 
Note: See TracChangeset for help on using the changeset viewer.