- Timestamp:
- 2019-11-26T15:11:43+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/ENHANCE-02_ISF_nemo_TEST_MERGE/src/TOP/trcbc.F90
r10068 r11967 44 44 TYPE(FLD), SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:), TARGET :: sf_trcobc 45 45 #endif 46 TYPE(MAP_POINTER), ALLOCATABLE, DIMENSION(:) :: nbmap_ptr ! array of pointers to nbmap47 46 48 47 !! * Substitutions … … 123 122 REWIND( numnat_ref ) ! Namelist namtrc_bc in reference namelist : Passive tracer data structure 124 123 READ ( numnat_ref, namtrc_bc, IOSTAT = ios, ERR = 901) 125 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_bc in reference namelist' , lwp)124 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_bc in reference namelist' ) 126 125 REWIND( numnat_cfg ) ! Namelist namtrc_bc in configuration namelist : Passive tracer data structure 127 126 READ ( numnat_cfg, namtrc_bc, IOSTAT = ios, ERR = 902 ) 128 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namtrc_bc in configuration namelist' , lwp)127 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namtrc_bc in configuration namelist' ) 129 128 IF(lwm) WRITE ( numont, namtrc_bc ) 130 129 … … 132 131 REWIND( numnat_ref ) ! Namelist namtrc_bdy in reference namelist : Passive tracer data structure 133 132 READ ( numnat_ref, namtrc_bdy, IOSTAT = ios, ERR = 903) 134 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_bdy in reference namelist', lwp ) 135 133 903 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_bdy in reference namelist' ) 134 ! make sur that all elements of the namelist variables have a default definition from namelist_ref 135 cn_trc (2:jp_bdy) = cn_trc (1) 136 cn_trc_dflt(2:jp_bdy) = cn_trc_dflt(1) 136 137 REWIND( numnat_cfg ) ! Namelist namtrc_bdy in configuration namelist : Passive tracer data structure 137 138 READ ( numnat_cfg, namtrc_bdy, IOSTAT = ios, ERR = 904 ) 138 904 IF( ios > 0 ) CALL ctl_nam ( ios , 'namtrc_bdy in configuration namelist' , lwp)139 904 IF( ios > 0 ) CALL ctl_nam ( ios , 'namtrc_bdy in configuration namelist' ) 139 140 IF(lwm) WRITE ( numont, namtrc_bdy ) 140 141 … … 234 235 ! OPEN Lateral boundary conditions 235 236 IF( ln_bdy .AND. nb_trcobc > 0 ) THEN 236 ALLOCATE ( sf_trcobc(nb_trcobc), rf_trofac(nb_trcobc), nbmap_ptr(nb_trcobc),STAT=ierr1 )237 ALLOCATE ( sf_trcobc(nb_trcobc), rf_trofac(nb_trcobc), STAT=ierr1 ) 237 238 IF( ierr1 > 0 ) THEN 238 239 CALL ctl_stop( 'trc_bc_ini: unable to allocate sf_trcobc structure' ) ; RETURN … … 257 258 trcdta_bdy(jn,ib)%trc => sf_trcobc(jl)%fnow(:,1,:) 258 259 trcdta_bdy(jn,ib)%rn_fac = rf_trofac(jl) 259 ! create OBC mapping array260 nbmap_ptr(jl)%ptr => idx_bdy(ib)%nbmap(:,igrd)261 nbmap_ptr(jl)%ll_unstruc = ln_coords_file(igrd)262 !263 260 ELSE !* Initialise obc arrays from initial conditions *! 264 261 ALLOCATE ( trcdta_bdy(jn,ib)%trc(nblen,jpk) ) … … 276 273 ! 277 274 CALL fld_fill( sf_trcobc, slf_i, cn_dir_obc, 'trc_bc_ini', 'Passive tracer OBC data', 'namtrc_bc' ) 275 DO jn = 1, ntrc ! define imap pointer, must be done after the call to fld_fill 276 DO ib = 1, nb_bdy 277 IF( ln_trc_obc(jn) ) THEN !* Initialise from external data *! 278 jl = n_trc_indobc(jn) 279 sf_trcobc(jl)%imap => idx_bdy(ib)%nbmap(1:idx_bdy(ib)%nblen(igrd),igrd) 280 ENDIF 281 END DO 282 END DO 283 ! 278 284 ENDIF 279 285 … … 362 368 IF( PRESENT(jit) ) THEN 363 369 ! 364 ! OPEN boundary conditions (use time_offset=+1 as they are applied at the end of the step)370 ! OPEN boundary conditions (use kt_offset=+1 as they are applied at the end of the step) 365 371 IF( nb_trcobc > 0 ) THEN 366 372 if (lwp) write(numout,'(a,i5,a,i10)') ' reading OBC data for ', nb_trcobc ,' variable(s) at step ', kt 367 CALL fld_read( kt=kt, kn_fsbc=1, sd=sf_trcobc, map=nbmap_ptr,kit=jit, kt_offset=+1)373 CALL fld_read( kt=kt, kn_fsbc=1, sd=sf_trcobc, kit=jit, kt_offset=+1) 368 374 ENDIF 369 375 ! … … 382 388 ELSE 383 389 ! 384 ! OPEN boundary conditions (use time_offset=+1 as they are applied at the end of the step)390 ! OPEN boundary conditions (use kt_offset=+1 as they are applied at the end of the step) 385 391 IF( nb_trcobc > 0 ) THEN 386 392 if (lwp) write(numout,'(a,i5,a,i10)') ' reading OBC data for ', nb_trcobc ,' variable(s) at step ', kt 387 CALL fld_read( kt=kt, kn_fsbc=1, sd=sf_trcobc, map=nbmap_ptr,kt_offset=+1)393 CALL fld_read( kt=kt, kn_fsbc=1, sd=sf_trcobc, kt_offset=+1) 388 394 ENDIF 389 395 !
Note: See TracChangeset
for help on using the changeset viewer.