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 11822 for NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/TOP/trcbc.F90 – NEMO

Ignore:
Timestamp:
2019-10-29T11:41:36+01:00 (4 years ago)
Author:
acc
Message:

Branch 2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps. Sette tested updates to branch to align with trunk changes between 10721 and 11740. Sette tests are passing but results differ from branch before these changes (except for GYRE_PISCES and VORTEX) and branch results already differed from trunk because of algorithmic fixes. Will need more checks to confirm correctness.

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  
    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 
     
    124123      REWIND( numnat_ref )              ! Namelist namtrc_bc in reference namelist : Passive tracer data structure 
    125124      READ  ( numnat_ref, namtrc_bc, IOSTAT = ios, ERR = 901) 
    126 901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtrc_bc in reference namelist', lwp ) 
     125901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namtrc_bc in reference namelist' ) 
    127126      REWIND( numnat_cfg )              ! Namelist namtrc_bc in configuration namelist : Passive tracer data structure 
    128127      READ  ( numnat_cfg, namtrc_bc, IOSTAT = ios, ERR = 902 ) 
    129 902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtrc_bc in configuration namelist', lwp ) 
     128902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namtrc_bc in configuration namelist' ) 
    130129      IF(lwm) WRITE ( numont, namtrc_bc ) 
    131130 
     
    133132         REWIND( numnat_ref )              ! Namelist namtrc_bdy in reference namelist : Passive tracer data structure 
    134133         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  
     134903      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) 
    137138         REWIND( numnat_cfg )              ! Namelist namtrc_bdy in configuration namelist : Passive tracer data structure 
    138139         READ  ( numnat_cfg, namtrc_bdy, IOSTAT = ios, ERR = 904 ) 
    139 904      IF( ios >  0 )   CALL ctl_nam ( ios , 'namtrc_bdy in configuration namelist', lwp ) 
     140904      IF( ios >  0 )   CALL ctl_nam ( ios , 'namtrc_bdy in configuration namelist' ) 
    140141         IF(lwm) WRITE ( numont, namtrc_bdy ) 
    141142       
     
    235236      ! OPEN Lateral boundary conditions 
    236237      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 ) 
    238239         IF( ierr1 > 0 ) THEN 
    239240            CALL ctl_stop( 'trc_bc_ini: unable to allocate sf_trcobc structure' )   ;   RETURN 
     
    258259                  trcdta_bdy(jn,ib)%trc => sf_trcobc(jl)%fnow(:,1,:) 
    259260                  trcdta_bdy(jn,ib)%rn_fac = rf_trofac(jl) 
    260                   ! create OBC mapping array 
    261                   nbmap_ptr(jl)%ptr => idx_bdy(ib)%nbmap(:,igrd) 
    262                   nbmap_ptr(jl)%ll_unstruc = ln_coords_file(igrd) 
    263                   ! 
    264261               ELSE                          !* Initialise obc arrays from initial conditions *! 
    265262                  ALLOCATE ( trcdta_bdy(jn,ib)%trc(nblen,jpk) ) 
     
    277274         ! 
    278275         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         ! 
    279285      ENDIF 
    280286 
     
    364370      IF( PRESENT(jit) ) THEN  
    365371         ! 
    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) 
    367373         IF( nb_trcobc > 0 ) THEN 
    368374           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) 
    370376         ENDIF 
    371377         ! 
     
    384390      ELSE 
    385391         ! 
    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) 
    387393         IF( nb_trcobc > 0 ) THEN 
    388394           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) 
    390396         ENDIF 
    391397         ! 
Note: See TracChangeset for help on using the changeset viewer.