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