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 2865 for branches/2011/UKMO_MERCATOR_obc_bdy_merge/NEMOGCM/NEMO/OPA_SRC/OBC/obctides.F90 – NEMO

Ignore:
Timestamp:
2011-09-27T14:33:01+02:00 (13 years ago)
Author:
davestorkey
Message:
  1. Updates for dynspg_exp option.
  2. Implement time_offset functionality in obc_dta.
  3. Add option to specify boundaries in the namelist.
  4. Re-activate obc_vol option.
  5. Update to namelist control of tidal harmonics.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2011/UKMO_MERCATOR_obc_bdy_merge/NEMOGCM/NEMO/OPA_SRC/OBC/obctides.F90

    r2814 r2865  
    9494      REWIND(numnam) 
    9595      DO ib_obc = 1, nb_obc 
    96          IF( nn_tides(ib_obc) .gt. 0 ) THEN 
     96         IF( nn_dyn2d_dta(ib_obc) .ge. 2 ) THEN 
    9797 
    9898            td => tides(ib_obc) 
     
    260260            ENDIF ! date correction 
    261261            ! 
    262          ENDIF ! nn_tides .gt. 0 
     262         ENDIF ! nn_dyn2d_dta(ib_obc) .ge. 2 
    263263         ! 
    264264      END DO ! loop on ib_obc 
     
    267267 
    268268 
    269    SUBROUTINE tide_update ( kt, jit, idx, dta, td ) 
     269   SUBROUTINE tide_update ( kt, idx, dta, td, jit, time_offset ) 
    270270      !!---------------------------------------------------------------------- 
    271271      !!                 ***  SUBROUTINE tide_update  *** 
     
    276276      INTEGER, INTENT( in )          ::   kt      ! Main timestep counter 
    277277!!gm doctor jit ==> kit 
    278       INTEGER, INTENT( in )          ::   jit     ! Barotropic timestep counter (for timesplitting option) 
    279278      TYPE(OBC_INDEX), INTENT( in )  ::   idx     ! OBC indices 
    280279      TYPE(OBC_DATA),  INTENT(inout) ::   dta     ! OBC external data 
    281280      TYPE(TIDES_DATA),INTENT( in )  ::   td      ! tidal harmonics data 
     281      INTEGER,INTENT(in),OPTIONAL    ::   jit     ! Barotropic timestep counter (for timesplitting option) 
     282      INTEGER,INTENT( in ), OPTIONAL ::   time_offset  ! time offset in units of timesteps. NB. if jit 
     283                                                       ! is present then units = subcycle timesteps. 
     284                                                       ! time_offset = 0 => get data at "now" time level 
     285                                                       ! time_offset = -1 => get data at "before" time level 
     286                                                       ! time_offset = +1 => get data at "after" time level 
     287                                                       ! etc. 
    282288      !! 
    283289      INTEGER                          :: itide, igrd, ib      ! dummy loop indices 
     290      INTEGER                          :: time_add             ! time offset in units of timesteps 
    284291      REAL(wp)                         :: z_arg, z_sarg       
    285292      REAL(wp), DIMENSION(jptides_max) :: z_sist, z_cost 
    286293      !!---------------------------------------------------------------------- 
    287294 
     295      time_add = 0 
     296      IF( PRESENT(time_offset) ) THEN 
     297         time_add = time_offset 
     298      ENDIF 
     299          
    288300      ! Note tide phase speeds are in deg/hour, so we need to convert the 
    289301      ! elapsed time in seconds to hours by dividing by 3600.0 
    290       IF( jit == 0 ) THEN   
    291          z_arg = kt * rdt * rad / 3600.0 
    292       ELSE                              ! we are in a barotropic subcycle (for timesplitting option) 
    293 !         z_arg = ( (kt-1) * rdt + jit * rdt / REAL(nn_baro,lwp) ) * rad / 3600.0 
    294          z_arg = ( (kt-1) * rdt + jit * rdt / REAL(nn_baro,wp) ) * rad / 3600.0 
     302      IF( PRESENT(jit) ) THEN   
     303         z_arg = ( (kt-1) * rdt + (jit+time_add) * rdt / REAL(nn_baro,wp) ) * rad / 3600.0 
     304      ELSE                               
     305         z_arg = (kt+time_add) * rdt * rad / 3600.0 
    295306      ENDIF 
    296307 
     
    301312      END DO 
    302313 
    303       ! 
    304314      DO itide = 1, td%ncpt 
    305315         igrd=1                              ! SSH on tracer grid. 
Note: See TracChangeset for help on using the changeset viewer.