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 15540 for NEMO/branches/2021/dev_r14116_HPC-10_mcastril_Mixed_Precision_implementation/src/OCE/ZDF/zdfgls.F90 – NEMO

Ignore:
Timestamp:
2021-11-26T12:27:56+01:00 (3 years ago)
Author:
sparonuz
Message:

Mixed precision version, tested up to 30 years on ORCA2.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2021/dev_r14116_HPC-10_mcastril_Mixed_Precision_implementation/src/OCE/ZDF/zdfgls.F90

    r14986 r15540  
    4848 
    4949   ! 
    50    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   hmxl_n    !: now mixing length 
    51    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   zwall   !: wall function 
    52    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ustar2_surf !: Squared surface velocity scale at T-points 
    53    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ustar2_top  !: Squared top     velocity scale at T-points 
    54    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ustar2_bot  !: Squared bottom  velocity scale at T-points 
     50   REAL(dp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   hmxl_n    !: now mixing length 
     51   REAL(dp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   zwall   !: wall function 
     52   REAL(dp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ustar2_surf !: Squared surface velocity scale at T-points 
     53   REAL(dp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ustar2_top  !: Squared top     velocity scale at T-points 
     54   REAL(dp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   ustar2_bot  !: Squared bottom  velocity scale at T-points 
    5555 
    5656   !                              !! ** Namelist  namzdf_gls  ** 
     
    6464   INTEGER  ::   nn_stab_func      ! stability functions G88, KC or Canuto (=0/1/2) 
    6565   INTEGER  ::   nn_clos           ! closure 0/1/2/3 MY82/k-eps/k-w/gen 
    66    REAL(wp) ::   rn_clim_galp      ! Holt 2008 value for k-eps: 0.267 
    67    REAL(wp) ::   rn_epsmin         ! minimum value of dissipation (m2/s3) 
    68    REAL(wp) ::   rn_emin           ! minimum value of TKE (m2/s2) 
    69    REAL(wp) ::   rn_charn          ! Charnock constant for surface breaking waves mixing : 1400. (standard) or 2.e5 (Stacey value) 
    70    REAL(wp) ::   rn_crban          ! Craig and Banner constant for surface breaking waves mixing 
    71    REAL(wp) ::   rn_hsro           ! Minimum surface roughness 
    72    REAL(wp) ::   rn_hsri           ! Ice ocean roughness 
    73    REAL(wp) ::   rn_frac_hs        ! Fraction of wave height as surface roughness (if nn_z0_met > 1) 
    74  
    75    REAL(wp) ::   rcm_sf        =  0.73_wp     ! Shear free turbulence parameters 
    76    REAL(wp) ::   ra_sf         = -2.0_wp      ! Must be negative -2 < ra_sf < -1 
    77    REAL(wp) ::   rl_sf         =  0.2_wp      ! 0 <rl_sf<vkarmn 
    78    REAL(wp) ::   rghmin        = -0.28_wp 
    79    REAL(wp) ::   rgh0          =  0.0329_wp 
    80    REAL(wp) ::   rghcri        =  0.03_wp 
    81    REAL(wp) ::   ra1           =  0.92_wp 
    82    REAL(wp) ::   ra2           =  0.74_wp 
    83    REAL(wp) ::   rb1           = 16.60_wp 
    84    REAL(wp) ::   rb2           = 10.10_wp 
    85    REAL(wp) ::   re2           =  1.33_wp 
    86    REAL(wp) ::   rl1           =  0.107_wp 
    87    REAL(wp) ::   rl2           =  0.0032_wp 
    88    REAL(wp) ::   rl3           =  0.0864_wp 
    89    REAL(wp) ::   rl4           =  0.12_wp 
    90    REAL(wp) ::   rl5           = 11.9_wp 
    91    REAL(wp) ::   rl6           =  0.4_wp 
    92    REAL(wp) ::   rl7           =  0.0_wp 
    93    REAL(wp) ::   rl8           =  0.48_wp 
    94    REAL(wp) ::   rm1           =  0.127_wp 
    95    REAL(wp) ::   rm2           =  0.00336_wp 
    96    REAL(wp) ::   rm3           =  0.0906_wp 
    97    REAL(wp) ::   rm4           =  0.101_wp 
    98    REAL(wp) ::   rm5           = 11.2_wp 
    99    REAL(wp) ::   rm6           =  0.4_wp 
    100    REAL(wp) ::   rm7           =  0.0_wp 
    101    REAL(wp) ::   rm8           =  0.318_wp 
    102    REAL(wp) ::   rtrans        =  0.1_wp 
    103    REAL(wp) ::   rc02, rc02r, rc03, rc04                          ! coefficients deduced from above parameters 
    104    REAL(wp) ::   rsbc_tke1, rsbc_tke2, rfact_tke                  !     -           -           -        - 
    105    REAL(wp) ::   rsbc_psi1, rsbc_psi2, rfact_psi                  !     -           -           -        - 
    106    REAL(wp) ::   rsbc_zs1, rsbc_zs2                               !     -           -           -        - 
    107    REAL(wp) ::   rc0, rc2, rc3, rf6, rcff, rc_diff                !     -           -           -        - 
    108    REAL(wp) ::   rs0, rs1, rs2, rs4, rs5, rs6                     !     -           -           -        - 
    109    REAL(wp) ::   rd0, rd1, rd2, rd3, rd4, rd5                     !     -           -           -        - 
    110    REAL(wp) ::   rsc_tke, rsc_psi, rpsi1, rpsi2, rpsi3, rsc_psi0  !     -           -           -        - 
    111    REAL(wp) ::   rpsi3m, rpsi3p, rpp, rmm, rnn                    !     -           -           -        - 
     66   REAL(dp) ::   rn_clim_galp      ! Holt 2008 value for k-eps: 0.267 
     67   REAL(dp) ::   rn_epsmin         ! minimum value of dissipation (m2/s3) 
     68   REAL(dp) ::   rn_emin           ! minimum value of TKE (m2/s2) 
     69   REAL(dp) ::   rn_charn          ! Charnock constant for surface breaking waves mixing : 1400. (standard) or 2.e5 (Stacey value) 
     70   REAL(dp) ::   rn_crban          ! Craig and Banner constant for surface breaking waves mixing 
     71   REAL(dp) ::   rn_hsro           ! Minimum surface roughness 
     72   REAL(dp) ::   rn_hsri           ! Ice ocean roughness 
     73   REAL(dp) ::   rn_frac_hs        ! Fraction of wave height as surface roughness (if nn_z0_met > 1) 
     74 
     75   REAL(dp) ::   rcm_sf        =  0.73_wp     ! Shear free turbulence parameters 
     76   REAL(dp) ::   ra_sf         = -2.0_wp      ! Must be negative -2 < ra_sf < -1 
     77   REAL(dp) ::   rl_sf         =  0.2_wp      ! 0 <rl_sf<vkarmn 
     78   REAL(dp) ::   rghmin        = -0.28_wp 
     79   REAL(dp) ::   rgh0          =  0.0329_wp 
     80   REAL(dp) ::   rghcri        =  0.03_wp 
     81   REAL(dp) ::   ra1           =  0.92_wp 
     82   REAL(dp) ::   ra2           =  0.74_wp 
     83   REAL(dp) ::   rb1           = 16.60_wp 
     84   REAL(dp) ::   rb2           = 10.10_wp 
     85   REAL(dp) ::   re2           =  1.33_wp 
     86   REAL(dp) ::   rl1           =  0.107_wp 
     87   REAL(dp) ::   rl2           =  0.0032_wp 
     88   REAL(dp) ::   rl3           =  0.0864_wp 
     89   REAL(dp) ::   rl4           =  0.12_wp 
     90   REAL(dp) ::   rl5           = 11.9_wp 
     91   REAL(dp) ::   rl6           =  0.4_wp 
     92   REAL(dp) ::   rl7           =  0.0_wp 
     93   REAL(dp) ::   rl8           =  0.48_wp 
     94   REAL(dp) ::   rm1           =  0.127_wp 
     95   REAL(dp) ::   rm2           =  0.00336_wp 
     96   REAL(dp) ::   rm3           =  0.0906_wp 
     97   REAL(dp) ::   rm4           =  0.101_wp 
     98   REAL(dp) ::   rm5           = 11.2_wp 
     99   REAL(dp) ::   rm6           =  0.4_wp 
     100   REAL(dp) ::   rm7           =  0.0_wp 
     101   REAL(dp) ::   rm8           =  0.318_wp 
     102   REAL(dp) ::   rtrans        =  0.1_wp 
     103   REAL(dp) ::   rc02, rc02r, rc03, rc04                          ! coefficients deduced from above parameters 
     104   REAL(dp) ::   rsbc_tke1, rsbc_tke2, rfact_tke                  !     -           -           -        - 
     105   REAL(dp) ::   rsbc_psi1, rsbc_psi2, rfact_psi                  !     -           -           -        - 
     106   REAL(dp) ::   rsbc_zs1, rsbc_zs2                               !     -           -           -        - 
     107   REAL(dp) ::   rc0, rc2, rc3, rf6, rcff, rc_diff                !     -           -           -        - 
     108   REAL(dp) ::   rs0, rs1, rs2, rs4, rs5, rs6                     !     -           -           -        - 
     109   REAL(dp) ::   rd0, rd1, rd2, rd3, rd4, rd5                     !     -           -           -        - 
     110   REAL(dp) ::   rsc_tke, rsc_psi, rpsi1, rpsi2, rpsi3, rsc_psi0  !     -           -           -        - 
     111   REAL(dp) ::   rpsi3m, rpsi3p, rpp, rmm, rnn                    !     -           -           -        - 
    112112   ! 
    113    REAL(wp) ::   r2_3 = 2._wp/3._wp   ! constant=2/3 
     113   REAL(dp) ::   r2_3 = 2._wp/3._wp   ! constant=2/3 
    114114 
    115115   !! * Substitutions 
     
    146146      INTEGER                             , INTENT(in   ) ::   kt             ! ocean time step 
    147147      INTEGER                             , INTENT(in   ) ::   Kbb, Kmm       ! ocean time level indices 
    148       REAL(wp), DIMENSION(A2D(nn_hls),jpk), INTENT(in   ) ::   p_sh2          ! shear production term 
    149       REAL(wp), DIMENSION(:,:,:)          , INTENT(inout) ::   p_avm, p_avt   !  momentum and tracer Kz (w-points) 
     148      REAL(dp), DIMENSION(A2D(nn_hls),jpk), INTENT(in   ) ::   p_sh2          ! shear production term 
     149      REAL(dp), DIMENSION(:,:,:)          , INTENT(inout) ::   p_avm, p_avt   !  momentum and tracer Kz (w-points) 
    150150      ! 
    151151      INTEGER  ::   ji, jj, jk    ! dummy loop arguments 
    152152      INTEGER  ::   ibot, ibotm1  ! local integers 
    153153      INTEGER  ::   itop, itopp1  !   -       - 
    154       REAL(wp) ::   zesh2, zsigpsi, zcoef, zex1 , zex2  ! local scalars 
    155       REAL(wp) ::   ztx2, zty2, zup, zdown, zcof, zdir  !   -      - 
    156       REAL(wp) ::   zratio, zrn2, zflxb, sh     , z_en  !   -      - 
    157       REAL(wp) ::   prod, buoy, diss, zdiss, sm         !   -      - 
    158       REAL(wp) ::   gh, gm, shr, dif, zsqen, zavt, zavm !   -      - 
    159       REAL(wp) ::   zmsku, zmskv                        !   -      - 
    160       REAL(wp), DIMENSION(A2D(nn_hls))     ::   zdep 
    161       REAL(wp), DIMENSION(A2D(nn_hls))     ::   zkar 
    162       REAL(wp), DIMENSION(A2D(nn_hls))     ::   zflxs                 ! Turbulence fluxed induced by internal waves 
    163       REAL(wp), DIMENSION(A2D(nn_hls))     ::   zhsro                 ! Surface roughness (surface waves) 
    164       REAL(wp), DIMENSION(A2D(nn_hls))     ::   zice_fra              ! Tapering of wave breaking under sea ice 
    165       REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   eb                    ! tke at time before 
    166       REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   hmxl_b                ! mixing length at time before 
    167       REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   eps                   ! dissipation rate 
    168       REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   zwall_psi             ! Wall function use in the wb case (ln_sigpsi) 
    169       REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   psi                   ! psi at time now 
    170       REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   zd_lw, zd_up, zdiag   ! lower, upper  and diagonal of the matrix 
    171       REAL(wp), DIMENSION(A2D(nn_hls),jpk) ::   zstt, zstm            ! stability function on tracer and momentum 
     154      REAL(dp) ::   zesh2, zsigpsi, zcoef, zex1 , zex2  ! local scalars 
     155      REAL(dp) ::   ztx2, zty2, zup, zdown, zcof, zdir  !   -      - 
     156      REAL(dp) ::   zratio, zrn2, zflxb, sh     , z_en  !   -      - 
     157      REAL(dp) ::   prod, buoy, diss, zdiss, sm         !   -      - 
     158      REAL(dp) ::   gh, gm, shr, dif, zsqen, zavt, zavm !   -      - 
     159      REAL(dp) ::   zmsku, zmskv                        !   -      - 
     160      REAL(dp), DIMENSION(A2D(nn_hls))     ::   zdep 
     161      REAL(dp), DIMENSION(A2D(nn_hls))     ::   zkar 
     162      REAL(dp), DIMENSION(A2D(nn_hls))     ::   zflxs                 ! Turbulence fluxed induced by internal waves 
     163      REAL(dp), DIMENSION(A2D(nn_hls))     ::   zhsro                 ! Surface roughness (surface waves) 
     164      REAL(dp), DIMENSION(A2D(nn_hls))     ::   zice_fra              ! Tapering of wave breaking under sea ice 
     165      REAL(dp), DIMENSION(A2D(nn_hls),jpk) ::   eb                    ! tke at time before 
     166      REAL(dp), DIMENSION(A2D(nn_hls),jpk) ::   hmxl_b                ! mixing length at time before 
     167      REAL(dp), DIMENSION(A2D(nn_hls),jpk) ::   eps                   ! dissipation rate 
     168      REAL(dp), DIMENSION(A2D(nn_hls),jpk) ::   zwall_psi             ! Wall function use in the wb case (ln_sigpsi) 
     169      REAL(dp), DIMENSION(A2D(nn_hls),jpk) ::   psi                   ! psi at time now 
     170      REAL(dp), DIMENSION(A2D(nn_hls),jpk) ::   zd_lw, zd_up, zdiag   ! lower, upper  and diagonal of the matrix 
     171      REAL(dp), DIMENSION(A2D(nn_hls),jpk) ::   zstt, zstm            ! stability function on tracer and momentum 
    172172      !!-------------------------------------------------------------------- 
    173173      ! 
     
    910910      INTEGER ::   jk    ! dummy loop indices 
    911911      INTEGER ::   ios   ! Local integer output status for namelist read 
    912       REAL(wp)::   zcr   ! local scalar 
     912      REAL(dp)::   zcr   ! local scalar 
    913913      !! 
    914914      NAMELIST/namzdf_gls/rn_emin, rn_epsmin, ln_length_lim,       & 
     
    12291229      INTEGER ::   id1, id2, id3, id4 
    12301230      INTEGER ::   ji, jj, ikbu, ikbv 
    1231       REAL(wp)::   cbx, cby 
     1231      REAL(dp)::   cbx, cby 
    12321232      !!---------------------------------------------------------------------- 
    12331233      ! 
Note: See TracChangeset for help on using the changeset viewer.