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/ICB/icb_oce.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/ICB/icb_oce.F90

    r14030 r15540  
    4646 
    4747   TYPE, PUBLIC ::   icebergs_gridded   !: various icebergs properties on model grid 
    48       REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   calving         ! Calving mass rate  (into stored ice)         [kg/s] 
    49       REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   calving_hflx    ! Calving heat flux [heat content of calving]  [W/m2] 
    50       REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   floating_melt   ! Net melting rate to icebergs + bits      [kg/s/m^2] 
     48      REAL(dp), DIMENSION(:,:)  , ALLOCATABLE ::   calving         ! Calving mass rate  (into stored ice)         [kg/s] 
     49      REAL(dp), DIMENSION(:,:)  , ALLOCATABLE ::   calving_hflx    ! Calving heat flux [heat content of calving]  [W/m2] 
     50      REAL(dp), DIMENSION(:,:)  , ALLOCATABLE ::   floating_melt   ! Net melting rate to icebergs + bits      [kg/s/m^2] 
    5151      INTEGER , DIMENSION(:,:)  , ALLOCATABLE ::   maxclass        ! maximum class number at calving source point 
    52       REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   tmp             ! Temporary work space 
    53       REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::   stored_ice      ! Accumulated ice mass flux at calving locations [kg] 
    54       REAL(wp), DIMENSION(:,:)  , ALLOCATABLE ::   stored_heat     ! Heat content of stored ice                      [J] 
     52      REAL(dp), DIMENSION(:,:)  , ALLOCATABLE ::   tmp             ! Temporary work space 
     53      REAL(dp), DIMENSION(:,:,:), ALLOCATABLE ::   stored_ice      ! Accumulated ice mass flux at calving locations [kg] 
     54      REAL(dp), DIMENSION(:,:)  , ALLOCATABLE ::   stored_heat     ! Heat content of stored ice                      [J] 
    5555   END TYPE icebergs_gridded 
    5656 
    5757   TYPE, PUBLIC ::   point              !: properties of an individual iceberg (position, mass, size, etc...) 
    5858      INTEGER  ::   year 
    59       REAL(wp) ::   xi , yj , zk                                              ! iceberg coordinates in the (i,j) referential (global) and deepest level affected 
    60       REAL(wp) ::   e1 , e2                                                   ! horizontal scale factors at the iceberg position 
    61       REAL(wp) ::   lon, lat, day                                             ! geographic position 
    62       REAL(wp) ::   mass, thickness, width, length, uvel, vvel                ! iceberg physical properties 
    63       REAL(wp) ::   ssu, ssv, ui, vi, ua, va, ssh_x, ssh_y, sst, sss, cn, hi  ! properties of iceberg environment  
    64       REAL(wp) ::   mass_of_bits, heat_density 
     59      REAL(dp) ::   xi , yj , zk                                              ! iceberg coordinates in the (i,j) referential (global) and deepest level affected 
     60      REAL(dp) ::   e1 , e2                                                   ! horizontal scale factors at the iceberg position 
     61      REAL(dp) ::   lon, lat, day                                             ! geographic position 
     62      REAL(dp) ::   mass, thickness, width, length, uvel, vvel                ! iceberg physical properties 
     63      REAL(dp) ::   ssu, ssv, ui, vi, ua, va, ssh_x, ssh_y, sst, sss, cn, hi  ! properties of iceberg environment  
     64      REAL(dp) ::   mass_of_bits, heat_density 
    6565      INTEGER  ::   kb                                                   ! icb bottom level 
    6666   END TYPE point 
     
    6969      TYPE(iceberg), POINTER      ::   prev=>NULL(), next=>NULL()   ! pointers to previous and next unique icebergs in linked list 
    7070      INTEGER, DIMENSION(nkounts) ::   number                       ! variables which do not change for this iceberg 
    71       REAL(wp)                    ::   mass_scaling                 !    -        -            -                -   
     71      REAL(dp)                    ::   mass_scaling                 !    -        -            -                -   
    7272      TYPE(point), POINTER        ::   current_point => NULL()      ! variables which change with time are held in a separate type 
    7373   END TYPE iceberg 
     
    7878 
    7979   !                                                             !!! parameters controlling iceberg characteristics and modelling 
    80    REAL(wp)                            ::   berg_dt                   !: Time-step between iceberg CALLs (should make adaptive?) 
    81    REAL(wp), DIMENSION(:), ALLOCATABLE ::   first_width, first_length !:  
     80   REAL(dp)                            ::   berg_dt                   !: Time-step between iceberg CALLs (should make adaptive?) 
     81   REAL(dp), DIMENSION(:), ALLOCATABLE ::   first_width, first_length !:  
    8282   LOGICAL                             ::   l_restarted_bergs=.FALSE.  ! Indicate whether we read state from a restart or not 
    8383   !                                                               ! arbitrary numbers for diawri entry 
    84    REAL(wp), DIMENSION(nclasses), PUBLIC ::   class_num=(/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 /) 
     84   REAL(dp), DIMENSION(nclasses), PUBLIC ::   class_num=(/ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 /) 
    8585 
    8686   ! Extra arrays with bigger halo, needed when interpolating forcing onto iceberg position 
    8787   ! particularly for MPP when iceberg can lie inside T grid but outside U, V, or f grid 
    88    REAL(wp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   ssu_e, ssv_e 
    89    REAL(wp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   sst_e, sss_e, fr_e 
    90    REAL(wp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   ua_e, va_e 
    91    REAL(wp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   ssh_e 
    92    REAL(wp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   tmask_e, umask_e, vmask_e 
    93    REAl(wp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   rlon_e, rlat_e, ff_e 
    94    REAl(wp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   uoce_e, voce_e, toce_e, e3t_e 
     88   REAL(dp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   ssu_e, ssv_e 
     89   REAL(dp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   sst_e, sss_e, fr_e 
     90   REAL(dp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   ua_e, va_e 
     91   REAL(dp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   ssh_e 
     92   REAL(dp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   tmask_e, umask_e, vmask_e 
     93   REAl(dp), PUBLIC, DIMENSION(:,:), ALLOCATABLE ::   rlon_e, rlat_e, ff_e 
     94   REAl(dp), PUBLIC, DIMENSION(:,:,:), ALLOCATABLE ::   uoce_e, voce_e, toce_e, e3t_e 
    9595   ! 
    9696#if defined key_si3 || defined key_cice 
     
    9999 
    100100   !!gm almost all those PARAM ARE defined in NEMO 
    101    REAL(wp), PUBLIC, PARAMETER :: pp_rho_ice      = 916.7_wp   !: Density of fresh ice   @ 0oC [kg/m^3] 
    102    REAL(wp), PUBLIC, PARAMETER :: pp_rho_water    = 999.8_wp   !: Density of fresh water @ 0oC [kg/m^3] 
    103    REAL(wp), PUBLIC, PARAMETER :: pp_rho_air      = 1.1_wp     !: Density of air         @ 0oC [kg/m^3] 
    104    REAL(wp), PUBLIC, PARAMETER :: pp_rho_seawater = 1025._wp   !: Approx. density of surface sea water @ 0oC [kg/m^3] 
     101   REAL(dp), PUBLIC, PARAMETER :: pp_rho_ice      = 916.7_wp   !: Density of fresh ice   @ 0oC [kg/m^3] 
     102   REAL(dp), PUBLIC, PARAMETER :: pp_rho_water    = 999.8_wp   !: Density of fresh water @ 0oC [kg/m^3] 
     103   REAL(dp), PUBLIC, PARAMETER :: pp_rho_air      = 1.1_wp     !: Density of air         @ 0oC [kg/m^3] 
     104   REAL(dp), PUBLIC, PARAMETER :: pp_rho_seawater = 1025._wp   !: Approx. density of surface sea water @ 0oC [kg/m^3] 
    105105   !!gm end 
    106    REAL(wp), PUBLIC, PARAMETER :: pp_Cd_av = 1.3_wp      !: (Vertical) Drag coefficient between bergs and atmos  
    107    REAL(wp), PUBLIC, PARAMETER :: pp_Cd_ah = 0.0055_wp   !: (lateral ) Drag coefficient between bergs and atmos  
    108    REAL(wp), PUBLIC, PARAMETER :: pp_Cd_wv = 0.9_wp      !: (Vertical) Drag coefficient between bergs and ocean 
    109    REAL(wp), PUBLIC, PARAMETER :: pp_Cd_wh = 0.0012_wp   !: (lateral ) Drag coefficient between bergs and ocean  
    110    REAL(wp), PUBLIC, PARAMETER :: pp_Cd_iv = 0.9_wp      !: (Vertical) Drag coefficient between bergs and sea-ice 
     106   REAL(dp), PUBLIC, PARAMETER :: pp_Cd_av = 1.3_wp      !: (Vertical) Drag coefficient between bergs and atmos  
     107   REAL(dp), PUBLIC, PARAMETER :: pp_Cd_ah = 0.0055_wp   !: (lateral ) Drag coefficient between bergs and atmos  
     108   REAL(dp), PUBLIC, PARAMETER :: pp_Cd_wv = 0.9_wp      !: (Vertical) Drag coefficient between bergs and ocean 
     109   REAL(dp), PUBLIC, PARAMETER :: pp_Cd_wh = 0.0012_wp   !: (lateral ) Drag coefficient between bergs and ocean  
     110   REAL(dp), PUBLIC, PARAMETER :: pp_Cd_iv = 0.9_wp      !: (Vertical) Drag coefficient between bergs and sea-ice 
    111111!TOM> no horizontal drag for sea ice! real, PARAMETER :: pp_Cd_ih=0.0012 ! (lateral) Drag coeff. between bergs and sea-ice 
    112112 
     
    121121   INTEGER , PUBLIC ::   nn_verbose_write                !: timesteps between verbose messages 
    122122   REAL(wp), PUBLIC ::   rn_rho_bergs                    !: Density of icebergs 
    123    REAL(wp), PUBLIC ::   rho_berg_1_oce                  !: convertion factor (thickness to draft) (rn_rho_bergs/pp_rho_seawater) 
     123   REAL(dp), PUBLIC ::   rho_berg_1_oce                  !: convertion factor (thickness to draft) (rn_rho_bergs/pp_rho_seawater) 
    124124   REAL(wp), PUBLIC ::   rn_LoW_ratio                    !: Initial ratio L/W for newly calved icebergs 
    125125   REAL(wp), PUBLIC ::   rn_bits_erosion_fraction        !: Fraction of erosion melt flux to divert to bergy bits 
     
    140140   REAL(wp), DIMENSION(nclasses), PUBLIC ::   rn_mass_scaling      ! Total thickness of newly calved bergs [m] 
    141141   REAL(wp), DIMENSION(nclasses), PUBLIC ::   rn_initial_thickness !  Single instance of an icebergs type initialised in icebergs_init and updated in icebergs_run 
    142    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   src_calving, src_calving_hflx    !: accumulate input ice 
     142   REAL(dp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   src_calving, src_calving_hflx    !: accumulate input ice 
    143143   INTEGER , PUBLIC             , SAVE                     ::   micbkb                           !: deepest level affected by icebergs 
    144144   INTEGER , PUBLIC             , SAVE                     ::   numicb                           !: iceberg IO 
    145145   INTEGER , PUBLIC             , SAVE, DIMENSION(nkounts) ::   num_bergs                        !: iceberg counter 
    146146   INTEGER , PUBLIC             , SAVE                     ::   nicbdi, nicbei, nicbdj, nicbej   !: processor bounds 
    147    REAL(wp), PUBLIC             , SAVE                     ::   ricb_left, ricb_right            !: cyclical bounds 
     147   REAL(dp), PUBLIC             , SAVE                     ::   ricb_left, ricb_right            !: cyclical bounds 
    148148   INTEGER , PUBLIC             , SAVE                     ::   nicbpack                         !: packing integer 
    149149   INTEGER , PUBLIC             , SAVE                     ::   nktberg, nknberg                 !: helpers 
Note: See TracChangeset for help on using the changeset viewer.