Changeset 10860
- Timestamp:
- 2019-04-11T11:35:27+02:00 (5 years ago)
- Location:
- NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/BDY/bdytides.F90
r10822 r10860 44 44 !$AGRIF_END_DO_NOT_TREAT 45 45 TYPE(OBC_DATA) , PUBLIC, DIMENSION(jp_bdy) :: dta_bdy_s !: bdy external data (slow component) 46 47 INTEGER :: kt_tide 46 48 47 49 !!---------------------------------------------------------------------- -
NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/DYN/dynspg.F90
r10852 r10860 42 42 INTEGER, PARAMETER :: np_EXP = 0 ! explicit time stepping 43 43 INTEGER, PARAMETER :: np_NO =-1 ! no surface pressure gradient, no scheme 44 ! 45 REAL(wp) :: zt0step ! Time of day at the beginning of the time step 44 46 45 47 !! * Substitutions … … 112 114 IF( .NOT.ln_dynspg_ts .AND. ( ln_tide_pot .AND. ln_tide ) ) THEN ! N.B. added directly at sub-time-step in ts-case 113 115 ! 114 CALL upd_tide( kt ) ! update tide potential 116 ! Update tide potential at the beginning of current time step 117 zt0step = REAL(nsec_day, wp)-0.5_wp*rdt 118 CALL upd_tide(zt0step) 115 119 ! 116 120 DO jj = 2, jpjm1 ! add tide potential forcing -
NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/DYN/dynspg_ts.F90
r10852 r10860 171 171 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: ztwdmask, zuwdmask, zvwdmask ! ROMS wetting and drying masks at t,u,v points 172 172 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zuwdav2, zvwdav2 ! averages over the sub-steps of zuwdmask and zvwdmask 173 REAL(wp) :: zt0substep ! Time of day at the beginning of the time substep 173 174 !!---------------------------------------------------------------------- 174 175 ! … … 718 719 ! Update only tidal forcing at open boundaries 719 720 IF( ln_bdy .AND. ln_tide ) CALL bdy_dta_tides( kt, kit=jn, time_offset= noffset+1 ) 720 IF( ln_tide_pot .AND. ln_tide ) CALL upd_tide ( kt, kit=jn, time_offset= noffset ) 721 ! Update tide potential at the beginning of current time substep 722 IF( ln_tide_pot .AND. ln_tide ) THEN 723 zt0substep = REAL(nsec_day, wp) - 0.5_wp*rdt + (jn + noffset - 1) * rdt / REAL(nn_baro, wp) 724 CALL upd_tide(zt0substep) 725 END IF 721 726 ! 722 727 ! Set extrapolation coefficients for predictor step: -
NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/TDE/tide_mod.F90
r10856 r10860 54 54 LOGICAL , PUBLIC :: ln_tide_ramp !: 55 55 INTEGER , PUBLIC :: nb_harmo !: Number of active tidal components 56 INTEGER , PUBLIC :: kt_tide !:57 56 REAL(wp), PUBLIC :: rn_tide_ramp_dt !: 58 57 REAL(wp), PUBLIC :: rn_scal_load !: … … 64 63 REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: amp_load, phi_load 65 64 65 REAL(wp) :: rn_tide_ramp_t ! Elapsed time in seconds 66 66 67 67 REAL(wp) :: sh_T, sh_s, sh_h, sh_p, sh_p1 ! astronomic angles … … 146 146 ! Ensure that tidal components have been set in namelist_cfg 147 147 IF( nb_harmo == 0 ) CALL ctl_stop( 'tide_init : No tidal components set in nam_tide' ) 148 !149 ! Reference time step for time-dependent tidal parameters150 kt_tide = nit000151 148 ! 152 149 IF (.NOT.ln_scal_load ) rn_scal_load = 0._wp … … 339 336 IF( nsec_day == NINT(0.5_wp * rdt) .OR. kt == nit000 ) THEN ! start a new day 340 337 ! 341 ! If the run does not start from midnight then need to initialise tides342 ! at the start of the current day (only occurs when kt==nit000)343 IF ( nsec_day /= NINT(0.5_wp * rdt) ) THEN344 kt_tide = kt - (nsec_day - 0.5_wp * rdt)/rdt345 ELSE346 kt_tide = kt347 ENDIF348 338 CALL tide_harmo(tide_components, tide_harmonics, ndt05) ! Update oscillation parameters of tidal components for start of current day 349 339 ! … … 361 351 IF( ln_tide_pot ) CALL tide_init_potential 362 352 ! 353 rn_tide_ramp_t = (kt - nit000)*rdt ! Elapsed time in seconds 363 354 ENDIF 364 355 ! … … 730 721 731 722 732 SUBROUTINE upd_tide( kt, kit, time_offset)723 SUBROUTINE upd_tide(pdelta) 733 724 !!---------------------------------------------------------------------- 734 725 !! *** ROUTINE upd_tide *** … … 740 731 !! ** Action : pot_astro actronomical potential 741 732 !!---------------------------------------------------------------------- 742 INTEGER, INTENT(in) :: kt ! ocean time-step index 743 INTEGER, INTENT(in), OPTIONAL :: kit ! external mode sub-time-step index (lk_dynspg_ts=T) 744 INTEGER, INTENT(in), OPTIONAL :: time_offset ! time offset in number 745 ! of internal steps (lk_dynspg_ts=F) 746 ! of external steps (lk_dynspg_ts=T) 747 ! 748 INTEGER :: joffset ! local integer 749 INTEGER :: ji, jj, jk ! dummy loop indices 750 REAL(wp) :: zt, zramp ! local scalar 751 REAL(wp), DIMENSION(nb_harmo) :: zwt 733 REAL, INTENT(in) :: pdelta ! Temporal offset in seconds 734 INTEGER :: jk ! Dummy loop index 735 REAL(wp) :: zt, zramp ! Local scalars 736 REAL(wp), DIMENSION(nb_harmo) :: zwt ! Temporary array 752 737 !!---------------------------------------------------------------------- 753 738 ! 754 ! ! tide pulsation at model time step (or sub-time-step) 755 zt = ( kt - kt_tide ) * rdt 756 ! 757 joffset = 0 758 IF( PRESENT( time_offset ) ) joffset = time_offset 759 ! 760 IF( PRESENT( kit ) ) THEN 761 zt = zt + ( kit + joffset - 1 ) * rdt / REAL( nn_baro, wp ) 762 ELSE 763 zt = zt + joffset * rdt 764 ENDIF 765 ! 766 zwt(:) = tide_harmonics(:)%omega * zt 767 739 zwt(:) = tide_harmonics(:)%omega * pdelta 740 ! 768 741 pot_astro(:,:) = 0._wp ! update tidal potential (sum of all harmonics) 769 742 DO jk = 1, nb_harmo … … 772 745 ! 773 746 IF( ln_tide_ramp ) THEN ! linear increase if asked 774 zt = ( kt - nit000 ) * rdt 775 IF( PRESENT( kit ) ) zt = zt + ( kit + joffset -1) * rdt / REAL( nn_baro, wp ) 747 zt = rn_tide_ramp_t + pdelta 776 748 zramp = MIN( MAX( zt / (rn_tide_ramp_dt*rday) , 0._wp ) , 1._wp ) 777 749 pot_astro(:,:) = zramp * pot_astro(:,:)
Note: See TracChangeset
for help on using the changeset viewer.