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 5203 – NEMO

Changeset 5203


Ignore:
Timestamp:
2015-04-08T16:20:22+02:00 (9 years ago)
Author:
timgraham
Message:

Modifications to tide code to allow a run to start from times other than midnight.
The tidal components must be initialised to the start of the day and kt_tide is set to what the timestep would have been at the start of the day (which could be < zero)

Location:
branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC/BDY/bdytides.F90

    r5075 r5203  
    316316      ENDIF 
    317317 
    318       IF ( nsec_day == NINT(0.5_wp * rdttra(1)) .AND. zflag==1 ) THEN 
     318      IF ( (nsec_day == NINT(0.5_wp * rdttra(1)) .OR. kt==nit000) .AND. zflag==1 ) THEN 
    319319        ! 
    320         kt_tide = kt 
     320        kt_tide = kt - (nsec_day - 0.5_wp * rdttra(1))/rdttra(1) 
    321321        ! 
    322322        IF(lwp) THEN 
     
    431431            ! We refresh nodal factors every day below 
    432432            ! This should be done somewhere else 
    433             IF ( nsec_day == NINT(0.5_wp * rdttra(1)) .AND. lk_first_btstp ) THEN 
    434                ! 
    435                kt_tide = kt                
     433            IF ( ( nsec_day == NINT(0.5_wp * rdttra(1)) .OR. kt==nit000 ) .AND. lk_first_btstp ) THEN 
     434               ! 
     435               kt_tide = kt - (nsec_day - 0.5_wp * rdttra(1))/rdttra(1) 
    436436               ! 
    437437               IF(lwp) THEN 
  • branches/2014/dev_r4650_UKMO7_STARTHOUR/NEMOGCM/NEMO/OPA_SRC/SBC/sbctide.F90

    r5164 r5203  
    4747      INTEGER, INTENT( in ) ::   kt     ! ocean time-step 
    4848      INTEGER               ::   jk     ! dummy loop index 
     49      INTEGER               ::   nsec_day_orig     ! Temporary variable 
    4950      !!---------------------------------------------------------------------- 
    50  
    51       IF( nsec_day == NINT(0.5_wp * rdttra(1)) ) THEN      ! start a new day 
     51       
     52      IF( nsec_day == NINT(0.5_wp * rdttra(1)) .OR. kt == nit000 ) THEN      ! start a new day 
    5253         ! 
    5354         IF( kt == nit000 ) THEN 
     
    6061         pot_astro(:,:) = 0._wp 
    6162         ! 
     63         ! If the run does not start from midnight then need to initialise tides 
     64         ! at the start of the current day (only occurs when kt==nit000) 
     65         ! Temporarily set nsec_day to beginning of day. 
     66         nsec_day_orig = nsec_day 
     67         kt_tide = kt - (nsec_day - 0.5_wp * rdttra(1))/rdttra(1) 
     68         IF ( nsec_day /= NINT(0.5_wp * rdttra(1)) THEN  
     69            nsec_day = NINT(0.5_wp * rdttra(1)) 
     70         ENDIF 
    6271         CALL tide_harmo( omega_tide, v0tide, utide, ftide, ntide, nb_harmo ) 
    6372         ! 
    64          kt_tide = kt 
    6573         ! 
    6674         IF(lwp) THEN 
     
    7583         IF( ln_tide_pot )   CALL tide_init_potential 
    7684         ! 
     85         ! Reset nsec_day 
     86         nsec_day = nsec_day_orig  
    7787      ENDIF 
    7888      ! 
Note: See TracChangeset for help on using the changeset viewer.