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

Ignore:
Timestamp:
2019-03-29T13:54:25+01:00 (5 years ago)
Author:
smueller
Message:

Replacement of the module variable used to store information about all available tidal components (variable Wave in module tide_mod) by an array used to store information about the selected components only (variable tide_components in module tide_mod), replacement of the corresponding initialisation subroutine, as well as related adjustments in various modules (bdytides, diaharm, sbctide, and tide_mod) and in one include file (tide.h90) (ticket #2194)

File:
1 edited

Legend:

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

    r10425 r10811  
    3838   INTEGER ::   nb_ana        ! Number of harmonics to analyse 
    3939 
    40    INTEGER , ALLOCATABLE, DIMENSION(:)       ::   name 
    4140   REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::   ana_temp 
    4241   REAL(wp), ALLOCATABLE, DIMENSION(:)       ::   ana_freq, ut   , vt   , ft 
     
    7372      INTEGER :: jh, nhan, jk, ji 
    7473      INTEGER ::   ios                 ! Local integer output status for namelist read 
     74      TYPE(tide), PUBLIC, DIMENSION(:), POINTER ::   tide_components ! Selected tidal components 
    7575 
    7676      NAMELIST/nam_diaharm/ nit000_han, nitend_han, nstep_han, tname 
     
    8484      ! 
    8585      IF( .NOT. ln_tide )   CALL ctl_stop( 'dia_harm_init : ln_tide must be true for harmonic analysis') 
    86       ! 
    87       CALL tide_init_Wave 
    8886      ! 
    8987      REWIND( numnam_ref )              ! Namelist nam_diaharm in reference namelist : Tidal harmonic analysis 
     
    111109         &                        CALL ctl_stop( 'dia_harm_init : analysis time span must be a multiple of nstep_han' ) 
    112110 
    113       nb_ana = 0 
    114       DO jk=1,jpmax_harmo 
    115          DO ji=1,jpmax_harmo 
    116             IF(TRIM(tname(jk)) == Wave(ji)%cname_tide) THEN 
    117                nb_ana=nb_ana+1 
    118             ENDIF 
    119          END DO 
    120       END DO 
     111      ! Request parameters for tidal components that have been selected for 
     112      ! harmonic analysis 
     113      CALL tide_init_components(tname, tide_components) 
     114      ! Number of tidal components selected for harmonic analysis 
     115      nb_ana = size(tide_components) 
    121116      ! 
    122117      IF(lwp) THEN 
     
    132127      ENDIF 
    133128 
    134       ALLOCATE(name    (nb_ana)) 
    135       DO jk=1,nb_ana 
    136        DO ji=1,jpmax_harmo 
    137           IF (TRIM(tname(jk)) ==  Wave(ji)%cname_tide) THEN 
    138              name(jk) = ji 
    139              EXIT 
    140           END IF 
    141        END DO 
    142       END DO 
    143  
    144129      ! Initialize frequency array: 
    145130      ! --------------------------- 
    146131      ALLOCATE( ana_freq(nb_ana), ut(nb_ana), vt(nb_ana), ft(nb_ana) ) 
    147132 
    148       CALL tide_harmo( ana_freq, vt, ut, ft, name, nb_ana ) 
     133      CALL tide_harmo( ana_freq, vt, ut, ft, nb_ana ) 
    149134 
    150135      IF(lwp) WRITE(numout,*) 'Analysed frequency  : ',nb_ana ,'Frequency ' 
Note: See TracChangeset for help on using the changeset viewer.