- Timestamp:
- 2017-03-24T16:06:42+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/CO6_shelfclimate_fabm/NEMOGCM/NEMO/TOP_SRC/trcbc.F90
r7567 r7835 7 7 !! 3.6 ! 2015-03 (T . Lovato) Revision and BDY support 8 8 !!---------------------------------------------------------------------- 9 #if defined key_top9 #if defined key_top 10 10 !!---------------------------------------------------------------------- 11 11 !! 'key_top' TOP model … … 29 29 PUBLIC trc_bc_read ! called in trcstp.F90 or within 30 30 31 INTEGER , SAVE, PUBLIC :: nb_trcobc ! number of tracers with open BC32 INTEGER , SAVE, PUBLIC :: nb_trcsbc ! number of tracers with surface BC33 INTEGER , SAVE, PUBLIC :: nb_trccbc ! number of tracers with coastal BC31 INTEGER , SAVE, PUBLIC :: nb_trcobc ! number of tracers with open BC 32 INTEGER , SAVE, PUBLIC :: nb_trcsbc ! number of tracers with surface BC 33 INTEGER , SAVE, PUBLIC :: nb_trccbc ! number of tracers with coastal BC 34 34 INTEGER , SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:) :: n_trc_indobc ! index of tracer with OBC data 35 35 INTEGER , SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:) :: n_trc_indsbc ! index of tracer with SBC data 36 36 INTEGER , SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:) :: n_trc_indcbc ! index of tracer with CBC data 37 REAL(wp) , SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:) :: rf_trsfac ! multiplicative factor for SBC tracer values38 TYPE(FLD), SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:) :: sf_trcsbc ! structure of data input SBC (file informations, fields read)39 REAL(wp) , SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:) :: rf_trcfac ! multiplicative factor for CBC tracer values40 TYPE(FLD), SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:) :: sf_trccbc ! structure of data input CBC (file informations, fields read)37 REAL(wp) , SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:) :: rf_trsfac ! multiplicative factor for SBC tracer values 38 TYPE(FLD), SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:) :: sf_trcsbc ! structure of data input SBC (file informations, fields read) 39 REAL(wp) , SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:) :: rf_trcfac ! multiplicative factor for CBC tracer values 40 TYPE(FLD), SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:) :: sf_trccbc ! structure of data input CBC (file informations, fields read) 41 41 REAL(wp) , SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:,:) :: rf_trofac ! multiplicative factor for OBCtracer values 42 42 TYPE(FLD), SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:,:), TARGET :: sf_trcobc ! structure of data input OBC (file informations, fields read) … … 65 65 INTEGER :: jl, jn , ib, ibd, ii, ij, ik ! dummy loop indices 66 66 INTEGER :: ierr0, ierr1, ierr2, ierr3 ! temporary integers 67 INTEGER :: ios! Local integer output status for namelist read67 INTEGER :: ios ! Local integer output status for namelist read 68 68 INTEGER :: nblen, igrd ! support arrays for BDY 69 69 CHARACTER(len=100) :: clndta, clntrc … … 130 130 DO ib = 1, nb_bdy 131 131 #endif 132 READ ( numnat_cfg, namtrc_bc, IOSTAT = ios, ERR = 902 )133 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_bc in configuration namelist', lwp )134 IF(lwm) WRITE ( numont, namtrc_bc )132 READ ( numnat_cfg, namtrc_bc, IOSTAT = ios, ERR = 902 ) 133 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_bc in configuration namelist', lwp ) 134 IF(lwm) WRITE ( numont, namtrc_bc ) 135 135 #if defined key_bdy 136 136 sn_trcobc(:,ib)=sn_trcobc2(:) … … 190 190 IF ( nb_trcsbc > 0 ) THEN 191 191 WRITE(numout,*) ' #trc NAME Boundary Mult.Fact. ' 192 DO jn = 1, ntrc192 DO jn = 1, ntrc 193 193 IF ( ln_trc_sbc(jn) ) WRITE(numout,9001) jn, TRIM( sn_trcsbc(jn)%clvar ), 'SBC', rn_trsfac(jn) 194 194 ENDDO 195 195 ENDIF 196 196 WRITE(numout,'(2a)') ' SURFACE BC data repository : ', TRIM(cn_dir_sbc) 197 197 … … 203 203 IF ( ln_trc_cbc(jn) ) WRITE(numout, 9001) jn, TRIM( sn_trccbc(jn)%clvar ), 'CBC', rn_trcfac(jn) 204 204 ENDDO 205 205 ENDIF 206 206 WRITE(numout,'(2a)') ' COASTAL BC data repository : ', TRIM(cn_dir_cbc) 207 207 … … 227 227 WRITE(numout,'(a,f10.2,a)') ' - Inflow damping time scale : ',rn_time_dmp(ib),' days' 228 228 WRITE(numout,'(a,f10.2,a)') ' - Outflow damping time scale : ',rn_time_dmp_out(ib),' days' 229 ENDIF230 ENDDO231 ENDIF229 ENDIF 230 ENDDO 231 ENDIF 232 232 #endif 233 233 WRITE(numout,'(2a)') ' OPEN BC data repository : ', TRIM(cn_dir_obc) … … 243 243 ALLOCATE ( sf_trcobc(nb_trcobc,nb_bdy), rf_trofac(nb_trcobc,nb_bdy), nbmap_ptr(nb_trcobc,nb_bdy), STAT=ierr1 ) 244 244 IF( ierr1 > 0 ) THEN 245 CALL ctl_stop( 'trc_bc_init: unable to allocate 245 CALL ctl_stop( 'trc_bc_init: unable to allocate sf_trcobc structure' ) ; RETURN 246 246 ENDIF 247 247 … … 249 249 250 250 DO ib = 1, nb_bdy 251 DO jn = 1, ntrc251 DO jn = 1, ntrc 252 252 253 253 nblen = idx_bdy(ib)%nblen(igrd) … … 255 255 IF ( ln_trc_obc(jn) ) THEN 256 256 ! Initialise from external data 257 jl = n_trc_indobc(jn)257 jl = n_trc_indobc(jn) 258 258 slf_i(jl) = sn_trcobc(jn,ib) 259 259 rf_trofac(jl,ib) = rn_trofac(jn) 260 260 ALLOCATE( sf_trcobc(jl,ib)%fnow(nblen,1,jpk) , STAT=ierr2 ) 261 261 IF( sn_trcobc(jn,ib)%ln_tint ) ALLOCATE( sf_trcobc(jl,ib)%fdta(nblen,1,jpk,2) , STAT=ierr3 ) 262 IF( ierr2 + ierr3 > 0 ) THEN263 CALL ctl_stop( 'trc_bc_init : unable to allocate passive tracer OBC data arrays' ) ; RETURN264 ENDIF262 IF( ierr2 + ierr3 > 0 ) THEN 263 CALL ctl_stop( 'trc_bc_init : unable to allocate passive tracer OBC data arrays' ) ; RETURN 264 ENDIF 265 265 trcdta_bdy(jn,ib)%trc => sf_trcobc(jl,ib)%fnow(:,1,:) 266 266 trcdta_bdy(jn,ib)%rn_fac = rf_trofac(jl,ib) … … 279 279 END DO 280 280 trcdta_bdy(jn,ib)%rn_fac = 1._wp 281 ENDIF282 ENDDO281 ENDIF 282 ENDDO 283 283 CALL fld_fill( sf_trcobc(:,ib), slf_i, cn_dir_obc, 'trc_bc_init', 'Passive tracer OBC data', 'namtrc_bc' ) 284 284 ENDDO … … 371 371 IF ( PRESENT(jit) ) THEN 372 372 373 #ifdef key_bdy 373 374 ! OPEN boundary conditions (use time_offset=+1 as they are applied at the end of the step) 374 IF( nb_trcobc > 0 ) THEN375 IF( nb_trcobc > 0 ) THEN 375 376 if (lwp) write(numout,'(a,i5,a,i10)') ' reading OBC data for ', nb_trcobc ,' variable(s) at step ', kt 376 377 DO ib = 1,nb_bdy 377 378 CALL fld_read(kt=kt, kn_fsbc=1, sd=sf_trcobc(:,ib), map=nbmap_ptr(:,ib), kit=jit, kt_offset=+1) 378 379 ENDDO 379 ENDIF 380 381 ! SURFACE boundary conditions 382 IF( nb_trcsbc > 0 ) THEN 380 ENDIF 381 #endif 382 383 ! SURFACE boundary conditions 384 IF( nb_trcsbc > 0 ) THEN 383 385 if (lwp) write(numout,'(a,i5,a,i10)') ' reading SBC data for ', nb_trcsbc ,' variable(s) at step ', kt 384 386 CALL fld_read(kt=kt, kn_fsbc=1, sd=sf_trcsbc, kit=jit) 385 ENDIF386 387 ! COASTAL boundary conditions388 IF( nb_trccbc > 0 ) THEN387 ENDIF 388 389 ! COASTAL boundary conditions 390 IF( nb_trccbc > 0 ) THEN 389 391 if (lwp) write(numout,'(a,i5,a,i10)') ' reading CBC data for ', nb_trccbc ,' variable(s) at step ', kt 390 392 CALL fld_read(kt=kt, kn_fsbc=1, sd=sf_trccbc, kit=jit) 391 ENDIF393 ENDIF 392 394 393 395 ELSE 394 396 397 #ifdef key_bdy 395 398 ! OPEN boundary conditions (use time_offset=+1 as they are applied at the end of the step) 396 399 IF( nb_trcobc > 0 ) THEN … … 400 403 ENDDO 401 404 ENDIF 405 #endif 402 406 403 407 ! SURFACE boundary conditions
Note: See TracChangeset
for help on using the changeset viewer.