Changeset 12122 for NEMO/branches/2019/dev_r11879_ENHANCE05_SimonMHarmonic_Analysis/src/OCE/DIA/diadetide.F90
 Timestamp:
 20191209T12:29:10+01:00 (4 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

NEMO/branches/2019/dev_r11879_ENHANCE05_SimonMHarmonic_Analysis/src/OCE/DIA/diadetide.F90
r12022 r12122 11 11 USE dom_oce , ONLY : rdt, nsec_day 12 12 USE phycst , ONLY : rpi 13 USE tide_mod , ONLY : tide_harmo, jpmax_harmo, Wave13 USE tide_mod 14 14 USE xios 15 15 … … 39 39 !! 40 40 41 LOGICAL :: llxatt_enabled 42 INTEGER, ALLOCATABLE, DIMENSION(:) :: itide ! Tidalconstituent index 43 REAL(wp), ALLOCATABLE, DIMENSION(:) :: ztide_omega, ztide_u, ztide_v, ztide_f ! Tidalconstituent parameters 44 REAL(wp) :: zdt 45 INTEGER :: jn 41 REAL(wp) :: zdt 42 INTEGER :: jn 43 CHARACTER (LEN=4), DIMENSION(jpmax_harmo) :: ctide_selected = ' n/a ' 44 TYPE(tide_harmonic), DIMENSION(:), POINTER :: stideconst 46 45 47 46 ! Enquire detiding activation state (test for presence of detidingrelated 48 47 ! weights field and output file group) 49 IF ( xios_is_valid_field( "diadetide_weight" ).AND.xios_is_valid_filegroup( "diadetide_files" ) ) THEN50 l lxatt_enabled= .TRUE.48 IF ( xios_is_valid_field( "diadetide_weight" ).AND.xios_is_valid_filegroup( "diadetide_files" ).AND.ln_tide ) THEN 49 lk_diadetide = .TRUE. 51 50 ELSE 52 l lxatt_enabled= .FALSE.51 lk_diadetide = .FALSE. 53 52 END IF 54 lk_diadetide = llxatt_enabled55 53 56 54 IF (lwp) THEN … … 63 61 IF (lk_diadetide) THEN 64 62 ! Retrieve information about M2 tidal constituent 65 ALLOCATE( ztide_omega(1), ztide_v(1), ztide_u(1), ztide_f(1), itide(1) ) 66 DO jn = 1, jpmax_harmo 67 IF (TRIM( Wave(jn)%cname_tide ) == 'M2') itide(1) = jn 68 END DO 69 CALL tide_harmo( ztide_omega, ztide_v, ztide_u, ztide_f, itide, 1 ) 63 ctide_selected(1) = 'M2' 64 CALL tide_init_harmonics(ctide_selected, stideconst) 65 70 66 ! For M2, twice the tidal period spans slightly more than one full 71 67 ! day. Compute the maximum number of equal intervals that span exactly 72 68 ! twice the tidal period *and* whose midpoints fall within a 24hour 73 69 ! period from midnight to midnight. 74 zdt = Wave(itide(1))%nt * 2.0_wp * rpi / ztide_omega(1)70 zdt = 2.0_wp * 2.0_wp * rpi / stideconst(1)%omega 75 71 ndiadetide = FLOOR( zdt / ( zdt  86400.0_wp ) ) 76 DEALLOCATE( ztide_omega, ztide_v, ztide_u, ztide_f, itide )77 72 ! Compute midpoints of the intervals to be included in the detided 78 73 ! average
Note: See TracChangeset
for help on using the changeset viewer.