Ignore:
Timestamp:
Jan 21, 2025, 11:18:55 AM (18 hours ago)
Author:
yann meurdesoif
Message:

Adapt calwake and wake for automatic GPU port.
YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmd/calwake.f90

    r5285 r5499  
    1 
    21! $Id$
     2MODULE calwake_mod
     3  PRIVATE
     4
     5  LOGICAL, SAVE, ALLOCATABLE :: first(:) ! first(klon) : first calwake computation on columns
     6  !$OMP THREADPRIVATE(first)
     7
     8  LOGICAL, SAVE :: first_first=.TRUE.  ! fisrt call to calwake
     9  !$OMP THREADPRIVATE(first_first) 
     10
     11  PUBLIC calwake_first, calwake
     12
     13CONTAINS 
     14
     15SUBROUTINE calwake_first(dtime)
     16USE dimphy, ONLY : klon,klev
     17USE lmdz_wake, ONLY : wake_first
     18  REAL, INTENT(IN)  :: dtime
     19 
     20  IF (first_first) THEN
     21    ALLOCATE(first(klon))
     22    first(:)=.TRUE.
     23   
     24    CALL wake_first(klev, dtime)
     25
     26    first_first=.FALSE.
     27  ENDIF
     28
     29END SUBROUTINE calwake_first
     30
    331
    432SUBROUTINE calwake(iflag_wake_tend, paprs, pplay, dtime, &
     
    2856  USE phys_state_var_mod, ONLY: pctsrf
    2957  USE indice_sol_mod, ONLY: is_oce
    30   USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level
     58  USE print_control_mod, ONLY: lunout, prt_level
    3159  USE lmdz_wake, ONLY : wake
    3260  USE yomcst_mod_h
     
    76104  ! Variable internes
    77105  ! -----------------
    78   LOGICAL, SAVE                                      :: first = .TRUE.
    79   !$OMP THREADPRIVATE(first)
    80106  INTEGER                                            :: i, l
    81107  INTEGER, DIMENSION(klon)                           :: znatsurf    ! 0 if pctsrf(is_oce)>0.1; 1 else.
     
    318344  ENDIF  ! (iflag_wake_tend .EQ. 0)
    319345!
    320   IF (first) THEN
    321     DO i = 1,klon
     346  DO i = 1,klon
     347    IF (first(i)) THEN
    322348      IF (wake_dens(i) < -1.) THEN
    323349        wake_dens(i) = wdens(i)
    324350      ENDIF
    325     ENDDO
    326     first=.false.
    327   ENDIF  ! (first)
     351      first(i)=.FALSE.
     352    ENDIF 
     353  ENDDO
     354   
    328355!>jyg
    329356  IF (prt_level >= 10) THEN
     
    334361END SUBROUTINE calwake
    335362
    336 
     363END MODULE calwake_mod
Note: See TracChangeset for help on using the changeset viewer.