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 11764 for NEMO/branches/2019 – NEMO

Changeset 11764 for NEMO/branches/2019


Ignore:
Timestamp:
2019-10-22T19:57:44+02:00 (4 years ago)
Author:
smueller
Message:

Addition of optional tidal-potential output (ticket #2194)

Location:
NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/cfgs/SHARED/field_def_nemo-oce.xml

    r10645 r11764  
    113113 
    114114      <field_group id="Tides_T" grid_ref="grid_T_2D" operation="once" > 
     115        <!-- Tidal potential --> 
     116        <field id="tide_pot"      long_name="Total tidal potential" unit="m" /> 
     117        <field id="tide_pot_M2"   long_name="M2 tidal potential"    unit="m" /> 
     118        <field id="tide_pot_N2"   long_name="N2 tidal potential"    unit="m" /> 
     119        <field id="tide_pot_2N2"  long_name="2N2 tidal potential"   unit="m" /> 
     120        <field id="tide_pot_S2"   long_name="S2 tidal potential"    unit="m" /> 
     121        <field id="tide_pot_K2"   long_name="K2 tidal potential"    unit="m" /> 
     122        <field id="tide_pot_K1"   long_name="K1 tidal potential"    unit="m" /> 
     123        <field id="tide_pot_O1"   long_name="O1 tidal potential"    unit="m" /> 
     124        <field id="tide_pot_Q1"   long_name="Q1 tidal potential"    unit="m" /> 
     125        <field id="tide_pot_P1"   long_name="P1 tidal potential"    unit="m" /> 
     126        <field id="tide_pot_M4"   long_name="M4 tidal potential"    unit="m" /> 
     127        <field id="tide_pot_Mf"   long_name="Mf tidal potential"    unit="m" /> 
     128        <field id="tide_pot_Mm"   long_name="Mm tidal potential"    unit="m" /> 
     129        <field id="tide_pot_Msqm" long_name="Msqm tidal potential"  unit="m" /> 
     130        <field id="tide_pot_Mtm"  long_name="Mtm tidal potential"   unit="m" /> 
     131        <field id="tide_pot_S1"   long_name="S1 tidal potential"    unit="m" /> 
     132        <field id="tide_pot_MU2"  long_name="MU2 tidal potential"   unit="m" /> 
     133        <field id="tide_pot_NU2"  long_name="NU2 tidal potential"   unit="m" /> 
     134        <field id="tide_pot_L2"   long_name="L2 tidal potential"    unit="m" /> 
     135        <field id="tide_pot_T2"   long_name="T2 tidal potential"    unit="m" /> 
    115136        <!-- tidal composante --> 
    116137        <field id="M2x"          long_name="M2 Elevation harmonic real part "                             unit="m"        /> 
  • NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/cfgs/SHARED/namelist_ref

    r11664 r11764  
    566566   ln_tide     = .false.      ! Activate tides 
    567567      nn_tide_var   = 1          !  Variant of tidal parameter set and tide-potential computation 
     568      ln_tide_dia   = .false.    !  Enable tidal diagnostic output 
    568569      !                          !     (1: default; 0: compatibility with previous versions) 
    569570      ln_tide_pot   = .true.                !  use tidal potential forcing 
  • NEMO/branches/2019/dev_r10742_ENHANCE-12_SimonM-Tides/src/OCE/TDE/tide_mod.F90

    r11737 r11764  
    5050   LOGICAL , PUBLIC ::   ln_tide_pot     !: 
    5151   INTEGER          ::   nn_tide_var     !  Variant of tidal parameter set and tide-potential computation 
     52   LOGICAL          ::   ln_tide_dia     !  Enable tidal diagnostic output 
    5253   LOGICAL          ::   ln_read_load    !: 
    5354   LOGICAL , PUBLIC ::   ln_scal_load    !: 
     
    6061 
    6162   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)   ::   pot_astro !: tidal potential 
     63   REAL(wp),         ALLOCATABLE, DIMENSION(:,:)   ::   pot_astro_comp   !  tidal-potential component 
    6264   REAL(wp),         ALLOCATABLE, DIMENSION(:,:,:) ::   amp_pot, phi_pot 
    6365   REAL(wp),         ALLOCATABLE, DIMENSION(:,:,:) ::   amp_load, phi_load 
     
    8486      INTEGER  ::   ios                 ! Local integer output status for namelist read 
    8587      ! 
    86       NAMELIST/nam_tide/ln_tide, nn_tide_var, ln_tide_pot, rn_tide_gamma, & 
     88      NAMELIST/nam_tide/ln_tide, nn_tide_var, ln_tide_dia, ln_tide_pot, rn_tide_gamma, & 
    8789         &              ln_scal_load, ln_read_load, cn_tide_load,         & 
    8890         &              ln_tide_ramp, rn_scal_load, rn_tide_ramp_dt,      & 
     
    111113            WRITE(numout,*) '      Use tidal components                       ln_tide         = ', ln_tide 
    112114            WRITE(numout,*) '         Variant (1: default; 0: legacy option)  nn_tide_var     = ', nn_tide_var 
     115            WRITE(numout,*) '         Tidal diagnostic output                 ln_tide_dia     = ', ln_tide_dia 
    113116            WRITE(numout,*) '         Apply astronomical potential            ln_tide_pot     = ', ln_tide_pot 
    114117            WRITE(numout,*) '         Tidal tilt factor                       rn_tide_gamma   = ', rn_tide_gamma 
     
    154157      ALLOCATE( amp_pot(jpi,jpj,nb_harmo),                      & 
    155158           &      phi_pot(jpi,jpj,nb_harmo), pot_astro(jpi,jpj)   ) 
     159      IF( ln_tide_dia ) ALLOCATE( pot_astro_comp(jpi,jpj) ) 
    156160      IF( ln_read_load ) THEN 
    157161         ALLOCATE( amp_load(jpi,jpj,nb_harmo), phi_load(jpi,jpj,nb_harmo) ) 
     
    762766      zwt(:) = tide_harmonics(:)%omega * pdelta 
    763767      ! 
    764       pot_astro(:,:) = 0._wp          ! update tidal potential (sum of all harmonics) 
    765       DO jk = 1, nb_harmo    
    766          pot_astro(:,:) = pot_astro(:,:) + amp_pot(:,:,jk) * COS( zwt(jk) + phi_pot(:,:,jk) )       
    767       END DO 
    768       ! 
    769768      IF( ln_tide_ramp ) THEN         ! linear increase if asked 
    770769         zt = rn_tide_ramp_t + pdelta 
    771770         zramp = MIN(  MAX( zt / (rn_tide_ramp_dt*rday) , 0._wp ) , 1._wp  ) 
    772          pot_astro(:,:) = zramp * pot_astro(:,:) 
    773771      ENDIF 
     772      ! 
     773      pot_astro(:,:) = 0._wp          ! update tidal potential (sum of all harmonics) 
     774      DO jk = 1, nb_harmo 
     775         IF ( .NOT. ln_tide_dia ) THEN 
     776            pot_astro(:,:) = pot_astro(:,:) + amp_pot(:,:,jk) * COS( zwt(jk) + phi_pot(:,:,jk) ) 
     777         ELSE 
     778            pot_astro_comp(:,:) = amp_pot(:,:,jk) * COS( zwt(jk) + phi_pot(:,:,jk) ) 
     779            pot_astro(:,:) = pot_astro(:,:) + pot_astro_comp(:,:) 
     780            IF ( iom_use( "tide_pot_" // TRIM( tide_harmonics(jk)%cname_tide ) ) ) THEN   ! Output tidal potential (incl. load potential) 
     781               IF ( ln_tide_ramp ) pot_astro_comp(:,:) = zramp * pot_astro_comp(:,:) 
     782               CALL iom_put( "tide_pot_" // TRIM( tide_harmonics(jk)%cname_tide ), pot_astro_comp(:,:) ) 
     783            END IF 
     784         END IF 
     785      END DO 
     786      ! 
     787      IF ( ln_tide_ramp ) pot_astro(:,:) = zramp * pot_astro(:,:) 
     788      ! 
     789      IF( ln_tide_dia ) THEN          ! Output total tidal potential (incl. load potential) 
     790         IF ( iom_use( "tide_pot" ) ) CALL iom_put( "tide_pot", pot_astro(:,:) + rn_scal_load * sshn(:,:) ) 
     791      END IF 
    774792      ! 
    775793   END SUBROUTINE upd_tide 
Note: See TracChangeset for help on using the changeset viewer.