Changeset 6607 for trunk/NEMOGCM/NEMO/TOP_SRC/trcdta.F90
- Timestamp:
- 2016-05-23T17:18:38+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/TOP_SRC/trcdta.F90
r6309 r6607 159 159 160 160 161 SUBROUTINE trc_dta( kt, sf_dta)161 SUBROUTINE trc_dta( kt, ptrc ) 162 162 !!---------------------------------------------------------------------- 163 163 !! *** ROUTINE trc_dta *** … … 169 169 !! - ln_trcdmp=F: deallocates the data structure as they are not used 170 170 !! 171 !! ** Action : sf_ dta passive tracer data on medl mesh and interpolated at time-step kt172 !!---------------------------------------------------------------------- 173 INTEGER , INTENT(in) :: kt ! ocean time-step174 TYPE(FLD), DIMENSION(1) , INTENT(inout) :: sf_dta! array of information on the field to read171 !! ** Action : sf_trcdta passive tracer data on medl mesh and interpolated at time-step kt 172 !!---------------------------------------------------------------------- 173 INTEGER , INTENT(in ) :: kt ! ocean time-step 174 REAL(wp), DIMENSION(jpi,jpj,jpk,nb_trcdta), INTENT(inout) :: ptrc ! array of information on the field to read 175 175 ! 176 176 INTEGER :: ji, jj, jk, jl, jkk, ik ! dummy loop indices 177 177 REAL(wp):: zl, zi 178 178 REAL(wp), DIMENSION(jpk) :: ztp ! 1D workspace 179 CHARACTER(len=100) :: clndta180 179 !!---------------------------------------------------------------------- 181 180 ! … … 184 183 IF( nb_trcdta > 0 ) THEN 185 184 ! 186 CALL fld_read( kt, 1, sf_dta ) !== read data at kt time step ==! 185 CALL fld_read( kt, 1, sf_trcdta ) !== read data at kt time step ==! 186 ! 187 DO jl = 1, nb_trcdta 188 ptrc(:,:,:,jl) = sf_trcdta(jl)%fnow(:,:,:) * tmask(:,:,:) ! Mask 189 ENDDO 187 190 ! 188 191 IF( ln_sco ) THEN !== s- or mixed s-zps-coordinate ==! … … 192 195 WRITE(numout,*) 'trc_dta: interpolates passive tracer data onto the s- or mixed s-z-coordinate mesh' 193 196 ENDIF 194 !197 DO jl = 1, nb_trcdta 195 198 DO jj = 1, jpj ! vertical interpolation of T & S 196 199 DO ji = 1, jpi 197 200 DO jk = 1, jpk ! determines the intepolated T-S profiles at each (i,j) points 198 zl = gdept_n(ji,jj,jk)201 zl = fsdept_n(ji,jj,jk) 199 202 IF( zl < gdept_1d(1 ) ) THEN ! above the first level of data 200 ztp(jk) = sf_dta(1)%fnow(ji,jj,1)203 ztp(jk) = ptrc(ji,jj,1,jl) 201 204 ELSEIF( zl > gdept_1d(jpk) ) THEN ! below the last level of data 202 ztp(jk) = sf_dta(1)%fnow(ji,jj,jpkm1)205 ztp(jk) = ptrc(ji,jj,jpkm1,jl) 203 206 ELSE ! inbetween : vertical interpolation between jkk & jkk+1 204 207 DO jkk = 1, jpkm1 ! when gdept(jkk) < zl < gdept(jkk+1) 205 208 IF( (zl-gdept_1d(jkk)) * (zl-gdept_1d(jkk+1)) <= 0._wp ) THEN 206 209 zi = ( zl - gdept_1d(jkk) ) / (gdept_1d(jkk+1)-gdept_1d(jkk)) 207 ztp(jk) = sf_dta(1)%fnow(ji,jj,jkk) + ( sf_dta(1)%fnow(ji,jj,jkk+1) - & 208 sf_dta(1)%fnow(ji,jj,jkk) ) * zi 210 ztp(jk) = ptrc(ji,jj,jkk,jl) + ( ptrc(ji,jj,jkk+1,jl) - ptrc(ji,jj,jkk,jl) ) * zi 209 211 ENDIF 210 212 END DO … … 212 214 END DO 213 215 DO jk = 1, jpkm1 214 sf_dta(1)%fnow(ji,jj,jk) = ztp(jk) * tmask(ji,jj,jk) ! mask required for mixed zps-s-coord216 ptrc(ji,jj,jk,jl) = ztp(jk) * tmask(ji,jj,jk) ! mask required for mixed zps-s-coord 215 217 END DO 216 sf_dta(1)%fnow(ji,jj,jpk) = 0._wp218 ptrc(ji,jj,jpk,jl) = 0._wp 217 219 END DO 218 220 END DO 221 END DO 219 222 ! 220 223 ELSE !== z- or zps- coordinate ==! 221 224 ! 222 sf_dta(1)%fnow(:,:,:) = sf_dta(1)%fnow(:,:,:) * tmask(:,:,:) ! Mask223 !224 IF( ln_zps ) THEN ! zps-coordinate (partial steps) interpolation at the last ocean level225 IF( ln_zps ) THEN ! zps-coordinate (partial steps) interpolation at the last ocean level 226 DO jl = 1, nb_trcdta 227 ! 225 228 DO jj = 1, jpj 226 229 DO ji = 1, jpi 227 230 ik = mbkt(ji,jj) 228 231 IF( ik > 1 ) THEN 229 zl = ( gdept_1d(ik) - gdept_n(ji,jj,ik) ) / ( gdept_1d(ik) - gdept_1d(ik-1) )230 sf_dta(1)%fnow(ji,jj,ik) = (1.-zl) * sf_dta(1)%fnow(ji,jj,ik) + zl * sf_dta(1)%fnow(ji,jj,ik-1)232 zl = ( gdept_1d(ik) - fsdept_n(ji,jj,ik) ) / ( gdept_1d(ik) - gdept_1d(ik-1) ) 233 ptrc(ji,jj,ik,jl) = (1.-zl) * ptrc(ji,jj,ik,jl) + zl * ptrc(ji,jj,ik-1,jl) 231 234 ENDIF 232 235 END DO 233 236 END DO 234 ENDIF 237 END DO 238 ENDIF 235 239 ! 236 240 ENDIF 237 241 ! 238 242 ENDIF 243 ! 244 IF( .NOT.ln_trcdmp .AND. .NOT.ln_trcdmp_clo ) THEN !== deallocate data structure ==! 245 ! (data used only for initialisation) 246 IF(lwp) WRITE(numout,*) 'trc_dta: deallocate data arrays as they are only used to initialize the run' 247 DO jl = 1, nb_trcdta 248 DEALLOCATE( sf_trcdta(jl)%fnow) ! arrays in the structure 249 IF( sf_trcdta(jl)%ln_tint ) DEALLOCATE( sf_trcdta(jl)%fdta) 250 ENDDO 251 ENDIF 239 252 ! 240 253 IF( nn_timing == 1 ) CALL timing_stop('trc_dta') 241 254 ! 242 255 END SUBROUTINE trc_dta 243 256 244 257 #else 245 258 !!----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.