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 12149 for NEMO/branches/2019/ENHANCE-03_closea/src/TOP/trcbc.F90 – NEMO

Ignore:
Timestamp:
2019-12-10T15:03:24+01:00 (4 years ago)
Author:
ayoung
Message:

Updated trunk to 12072

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/ENHANCE-03_closea/src/TOP/trcbc.F90

    r10068 r12149  
    4444   TYPE(FLD), SAVE, PUBLIC, ALLOCATABLE, DIMENSION(:), TARGET  :: sf_trcobc 
    4545#endif 
    46    TYPE(MAP_POINTER), ALLOCATABLE, DIMENSION(:) :: nbmap_ptr   ! array of pointers to nbmap 
    4746 
    4847   !! * Substitutions 
     
    123122      REWIND( numnat_ref )              ! Namelist namtrc_bc in reference namelist : Passive tracer data structure 
    124123      READ  ( numnat_ref, namtrc_bc, IOSTAT = ios, ERR = 901) 
    125 901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtrc_bc in reference namelist', lwp ) 
     124901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtrc_bc in reference namelist' ) 
    126125      REWIND( numnat_cfg )              ! Namelist namtrc_bc in configuration namelist : Passive tracer data structure 
    127126      READ  ( numnat_cfg, namtrc_bc, IOSTAT = ios, ERR = 902 ) 
    128 902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtrc_bc in configuration namelist', lwp ) 
     127902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtrc_bc in configuration namelist' ) 
    129128      IF(lwm) WRITE ( numont, namtrc_bc ) 
    130129 
     
    132131         REWIND( numnat_ref )              ! Namelist namtrc_bdy in reference namelist : Passive tracer data structure 
    133132         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  
     133903      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) 
    136137         REWIND( numnat_cfg )              ! Namelist namtrc_bdy in configuration namelist : Passive tracer data structure 
    137138         READ  ( numnat_cfg, namtrc_bdy, IOSTAT = ios, ERR = 904 ) 
    138 904      IF( ios >  0 )   CALL ctl_nam ( ios , 'namtrc_bdy in configuration namelist', lwp ) 
     139904      IF( ios >  0 )   CALL ctl_nam ( ios , 'namtrc_bdy in configuration namelist' ) 
    139140         IF(lwm) WRITE ( numont, namtrc_bdy ) 
    140141       
     
    234235      ! OPEN Lateral boundary conditions 
    235236      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 ) 
    237238         IF( ierr1 > 0 ) THEN 
    238239            CALL ctl_stop( 'trc_bc_ini: unable to allocate sf_trcobc structure' )   ;   RETURN 
     
    257258                  trcdta_bdy(jn,ib)%trc => sf_trcobc(jl)%fnow(:,1,:) 
    258259                  trcdta_bdy(jn,ib)%rn_fac = rf_trofac(jl) 
    259                   ! create OBC mapping array 
    260                   nbmap_ptr(jl)%ptr => idx_bdy(ib)%nbmap(:,igrd) 
    261                   nbmap_ptr(jl)%ll_unstruc = ln_coords_file(igrd) 
    262                   ! 
    263260               ELSE                          !* Initialise obc arrays from initial conditions *! 
    264261                  ALLOCATE ( trcdta_bdy(jn,ib)%trc(nblen,jpk) ) 
     
    276273         ! 
    277274         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         ! 
    278284      ENDIF 
    279285 
     
    362368      IF( PRESENT(jit) ) THEN  
    363369         ! 
    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) 
    365371         IF( nb_trcobc > 0 ) THEN 
    366372           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) 
    368374         ENDIF 
    369375         ! 
     
    382388      ELSE 
    383389         ! 
    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) 
    385391         IF( nb_trcobc > 0 ) THEN 
    386392           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) 
    388394         ENDIF 
    389395         ! 
Note: See TracChangeset for help on using the changeset viewer.