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/ASM/asminc.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/ASM/asminc.F90

    r14986 r15540  
    6969   INTEGER, PUBLIC :: nn_divdmp     !: Apply divergence damping filter nn_divdmp times 
    7070 
    71    REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   t_bkg   , s_bkg      !: Background temperature and salinity 
    72    REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   u_bkg   , v_bkg      !: Background u- & v- velocity components 
    73    REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   t_bkginc, s_bkginc   !: Increment to the background T & S 
    74    REAL(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   u_bkginc, v_bkginc   !: Increment to the u- & v-components 
    75    REAL(wp), PUBLIC, DIMENSION(:)    , ALLOCATABLE ::   wgtiau               !: IAU weights for each time step 
     71   REAL(dp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   t_bkg   , s_bkg      !: Background temperature and salinity 
     72   REAL(dp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   u_bkg   , v_bkg      !: Background u- & v- velocity components 
     73   REAL(dp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   t_bkginc, s_bkginc   !: Increment to the background T & S 
     74   REAL(dp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   u_bkginc, v_bkginc   !: Increment to the u- & v-components 
     75   REAL(dp), PUBLIC, DIMENSION(:)    , ALLOCATABLE ::   wgtiau               !: IAU weights for each time step 
    7676#if defined key_asminc 
    7777   REAL(wp), PUBLIC, DIMENSION(:,:)  , ALLOCATABLE ::   ssh_iau              !: IAU-weighted sea surface height increment 
     
    8585   INTEGER , PUBLIC ::   niaufn      !: Type of IAU weighing function: = 0   Constant weighting 
    8686   !                                 !: = 1   Linear hat-like, centred in middle of IAU interval 
    87    REAL(wp), PUBLIC ::   salfixmin   !: Ensure that the salinity is larger than this  value if (ln_salfix) 
    88  
    89    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   ssh_bkg, ssh_bkginc   ! Background sea surface height and its increment 
    90    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   seaice_bkginc         ! Increment to the background sea ice conc 
     87   REAL(dp), PUBLIC ::   salfixmin   !: Ensure that the salinity is larger than this  value if (ln_salfix) 
     88 
     89   REAL(dp), DIMENSION(:,:), ALLOCATABLE ::   ssh_bkg, ssh_bkginc   ! Background sea surface height and its increment 
     90   REAL(dp), DIMENSION(:,:), ALLOCATABLE ::   seaice_bkginc         ! Increment to the background sea ice conc 
    9191#if defined key_cice && defined key_asminc 
    9292   REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   ndaice_da             ! ice increment tendency into CICE 
     
    127127      REAL(KIND=dp) :: ditiaufin_date  ! Date YYYYMMDD.HHMMSS of IAU interval final time step 
    128128 
    129       REAL(wp) :: znorm        ! Normalization factor for IAU weights 
    130       REAL(wp) :: ztotwgt      ! Value of time-integrated IAU weights (should be equal to one) 
    131       REAL(wp) :: z_inc_dateb  ! Start date of interval on which increment is valid 
    132       REAL(wp) :: z_inc_datef  ! End date of interval on which increment is valid 
    133       REAL(wp) :: zdate_bkg    ! Date in background state file for DI 
    134       REAL(wp) :: zdate_inc    ! Time axis in increments file 
    135       ! 
    136       REAL(wp), ALLOCATABLE, DIMENSION(:,:) ::   zhdiv   ! 2D workspace 
     129      REAL(dp) :: znorm        ! Normalization factor for IAU weights 
     130      REAL(dp) :: ztotwgt      ! Value of time-integrated IAU weights (should be equal to one) 
     131      REAL(dp) :: z_inc_dateb  ! Start date of interval on which increment is valid 
     132      REAL(dp) :: z_inc_datef  ! End date of interval on which increment is valid 
     133      REAL(dp) :: zdate_bkg    ! Date in background state file for DI 
     134      REAL(dp) :: zdate_inc    ! Time axis in increments file 
     135      ! 
     136      REAL(dp), ALLOCATABLE, DIMENSION(:,:) ::   zhdiv   ! 2D workspace 
    137137      !! 
    138138      NAMELIST/nam_asminc/ ln_bkgwri,                                      & 
     
    520520      INTEGER  :: ji, jj, jk 
    521521      INTEGER  :: it 
    522       REAL(wp) :: zincwgt  ! IAU weight for current time step 
    523       REAL(wp), DIMENSION(A2D(nn_hls),jpk) :: fzptnz ! 3d freezing point values 
     522      REAL(dp) :: zincwgt  ! IAU weight for current time step 
     523      REAL(dp), DIMENSION(A2D(nn_hls),jpk) :: fzptnz ! 3d freezing point values 
    524524      !!---------------------------------------------------------------------- 
    525525      ! 
     
    528528      IF( ln_temnofreeze ) THEN 
    529529         DO jk = 1, jpkm1 
    530            CALL eos_fzp( CASTWP(pts(:,:,jk,jp_sal,Kmm)), fzptnz(:,:,jk), CASTWP(gdept(:,:,jk,Kmm)) ) 
     530           CALL eos_fzp( pts(:,:,jk,jp_sal,Kmm), fzptnz(:,:,jk), gdept(:,:,jk,Kmm) ) 
    531531         END DO 
    532532      ENDIF 
     
    613613            pts(:,:,:,:,Kbb) = pts(:,:,:,:,Kmm)                 ! Update before fields 
    614614 
    615             CALL eos( CASTWP(pts(:,:,:,:,Kbb)), rhd, rhop, gdept_0(:,:,:) )  ! Before potential and in situ densities 
     615            CALL eos( pts(:,:,:,:,Kbb), rhd, rhop, gdept_0(:,:,:) )  ! Before potential and in situ densities 
    616616!!gm  fabien 
    617617!            CALL eos( pts(:,:,:,:,Kbb), rhd, rhop )                ! Before potential and in situ densities 
     
    654654      INTEGER :: ji, jj, jk 
    655655      INTEGER :: it 
    656       REAL(wp) :: zincwgt  ! IAU weight for current time step 
     656      REAL(dp) :: zincwgt  ! IAU weight for current time step 
    657657      !!---------------------------------------------------------------------- 
    658658      ! 
     
    729729      INTEGER :: it 
    730730      INTEGER :: ji, jj, jk 
    731       REAL(wp) :: zincwgt  ! IAU weight for current time step 
     731      REAL(dp) :: zincwgt  ! IAU weight for current time step 
    732732      !!---------------------------------------------------------------------- 
    733733      ! 
     
    813813      INTEGER, INTENT(IN) :: kt                               ! ocean time-step index 
    814814      INTEGER, INTENT(IN) :: Kbb, Kmm                         ! time level indices 
    815       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   phdivn   ! horizontal divergence 
     815      REAL(dp), DIMENSION(:,:,:), INTENT(inout) ::   phdivn   ! horizontal divergence 
    816816      !! 
    817817      INTEGER  ::   ji, jj, jk                                ! dummy loop index 
    818       REAL(wp), DIMENSION(:,:)  , POINTER       ::   ztim     ! local array 
     818      REAL(dp), DIMENSION(:,:)  , POINTER       ::   ztim     ! local array 
    819819      !!---------------------------------------------------------------------- 
    820820      ! 
     
    858858      INTEGER  ::   ji, jj 
    859859      INTEGER  ::   it 
    860       REAL(wp) ::   zincwgt   ! IAU weight for current time step 
     860      REAL(dp) ::   zincwgt   ! IAU weight for current time step 
    861861#if defined key_si3 
    862862      REAL(wp), DIMENSION(A2D(nn_hls)) ::   zofrld, zohicif, zseaicendg, zhicifinc 
Note: See TracChangeset for help on using the changeset viewer.