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 10822 for NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/DIA/diaharm.F90 – NEMO

Ignore:
Timestamp:
2019-04-01T17:50:07+02:00 (5 years ago)
Author:
smueller
Message:

Addition of a new type (tide_harmonics in module tide_mod), two replacements of four separate arrays for the storage of oscillation parameters by one array of variables of this new type (in modules diaharm and tide_mod), and related adjustments in various modules (bdytides, diaharm, sbctides, and tide_mod) (ticket #2194)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/DIA/diaharm.F90

    r10811 r10822  
    3939 
    4040   REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::   ana_temp 
    41    REAL(wp), ALLOCATABLE, DIMENSION(:)       ::   ana_freq, ut   , vt   , ft 
    4241   REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)   ::   out_eta , out_u, out_v 
    4342 
     
    7372      INTEGER ::   ios                 ! Local integer output status for namelist read 
    7473      TYPE(tide), PUBLIC, DIMENSION(:), POINTER ::   tide_components ! Selected tidal components 
     74      TYPE(tide),         DIMENSION(:), POINTER ::   tide_harmonics  ! Oscillation parameters of selected tidal components 
    7575 
    7676      NAMELIST/nam_diaharm/ nit000_han, nitend_han, nstep_han, tname 
     
    127127      ENDIF 
    128128 
    129       ! Initialize frequency array: 
    130       ! --------------------------- 
    131       ALLOCATE( ana_freq(nb_ana), ut(nb_ana), vt(nb_ana), ft(nb_ana) ) 
    132  
    133       CALL tide_harmo( ana_freq, vt, ut, ft, nb_ana ) 
     129      ! Initialize oscillation parameters of selected tidal components 
     130      ! -------------------------------------------------------------- 
     131      CALL tide_init_harmonics( tide_components, tide_harmonics) 
    134132 
    135133      IF(lwp) WRITE(numout,*) 'Analysed frequency  : ',nb_ana ,'Frequency ' 
    136134 
    137135      DO jh = 1, nb_ana 
    138         IF(lwp) WRITE(numout,*) '                    : ',tname(jh),' ',ana_freq(jh) 
     136        IF(lwp) WRITE(numout,*) '                    : ',tname(jh),' ',tide_harmonics(jh)%omega 
    139137      END DO 
    140138 
     
    173171            DO jc = 1, 2 
    174172               nhc = nhc+1 
    175                ztemp =(     MOD(jc,2) * ft(jh) *COS(ana_freq(jh)*ztime + vt(jh) + ut(jh))  & 
    176                   &    +(1.-MOD(jc,2))* ft(jh) *SIN(ana_freq(jh)*ztime + vt(jh) + ut(jh))) 
     173               ztemp =(     MOD(jc,2) * tide_harmonics(jh)%f *COS(tide_harmonics(jh)%omega*ztime + & 
     174                  &                                 tide_harmonics(jh)%v0 + tide_harmonics(jh)%u)  & 
     175                  &    +(1.-MOD(jc,2))* tide_harmonics(jh)%f *SIN(tide_harmonics(jh)%omega*ztime + & 
     176                  &                                 tide_harmonics(jh)%v0 + tide_harmonics(jh)%u)) 
    177177                  ! 
    178178               DO jj = 1,jpj 
     
    235235               nisparse(ksp) = keq 
    236236               njsparse(ksp) = kun 
    237                valuesparse(ksp) = (   MOD(jc,2) * ft(jh) * COS(ana_freq(jh)*ztime + vt(jh) + ut(jh))   & 
    238                   &             + (1.-MOD(jc,2))* ft(jh) * SIN(ana_freq(jh)*ztime + vt(jh) + ut(jh)) ) 
     237               valuesparse(ksp) = (   MOD(jc,2) * tide_harmonics(jh)%f * COS(tide_harmonics(jh)%omega*ztime & 
     238                  &                                          + tide_harmonics(jh)%v0 + tide_harmonics(jh)%u)   & 
     239                  &             + (1.-MOD(jc,2))* tide_harmonics(jh)%f * SIN(tide_harmonics(jh)%omega*ztime & 
     240                  &                                          + tide_harmonics(jh)%v0 + tide_harmonics(jh)%u) ) 
    239241            END DO 
    240242         END DO 
Note: See TracChangeset for help on using the changeset viewer.