Changeset 5879


Ignore:
Timestamp:
Nov 21, 2025, 6:51:05 PM (20 hours ago)
Author:
yann meurdesoif
Message:

GPU port of climb_wind_up + climb_wind_down

YM

Location:
LMDZ6/branches/PBLSURF_GPUPORT/libf/phylmd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/PBLSURF_GPUPORT/libf/phylmd/climb_wind_mod.f90

    r5868 r5879  
    2727
    2828 
    29   PUBLIC :: climb_wind_down, climb_wind_up
     29  PUBLIC :: climb_wind_down, climb_wind_up, climb_wind_init
    3030
    3131CONTAINS
     
    3838    CHARACTER(len = 20) :: modname = 'climb_wind_init'   
    3939
    40 !****************************************************************************************
    41 ! Allocation of global module variables
    42 !
    43 !****************************************************************************************
    44 
    45     ALLOCATE(alf1(klon), stat=ierr)
    46     IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocate alf1',1)
    47 
    48     ALLOCATE(alf2(klon), stat=ierr)
    49     IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocate alf2',1)
    50 
    51     ALLOCATE(Kcoefm(klon,klev), stat=ierr)
    52     IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocate Kcoefm',1)
    53 
    54     ALLOCATE(Ccoef_U(klon,klev), stat=ierr)
    55     IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocate Ccoef_U',1)
    56 
    57     ALLOCATE(Dcoef_U(klon,klev), stat=ierr)
    58     IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocation Dcoef_U',1)
    59 
    60     ALLOCATE(Ccoef_V(klon,klev), stat=ierr)
    61     IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocation Ccoef_V',1)
    62 
    63     ALLOCATE(Dcoef_V(klon,klev), stat=ierr)
    64     IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocation Dcoef_V',1)
    65 
    66     ALLOCATE(Acoef_U(klon), Bcoef_U(klon), Acoef_V(klon), Bcoef_V(klon), STAT=ierr)
    67     IF ( ierr /= 0 )  PRINT*,' pb in allloc Acoef_U and Bcoef_U, ierr=', ierr
    68 
    69     firstcall=.FALSE.
     40
     41!****************************************************************************************
     42! Initialize module
     43   
     44    IF (firstcall) THEN
     45
     46      !****************************************************************************************
     47      ! Allocation of global module variables
     48      !
     49      !****************************************************************************************
     50 
     51      ALLOCATE(alf1(klon), stat=ierr)
     52      IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocate alf1',1)
     53      alf1(:) = 0.
     54 
     55      ALLOCATE(alf2(klon), stat=ierr)
     56      IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocate alf2',1)
     57      alf2(:) = 0.
     58 
     59      ALLOCATE(Kcoefm(klon,klev), stat=ierr)
     60      IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocate Kcoefm',1)
     61      Kcoefm(:,:) = 0.
     62 
     63      ALLOCATE(Ccoef_U(klon,klev), stat=ierr)
     64      IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocate Ccoef_U',1)
     65      Ccoef_U(:,:) = 0.
     66 
     67      ALLOCATE(Dcoef_U(klon,klev), stat=ierr)
     68      IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocation Dcoef_U',1)
     69      Dcoef_U(:,:) = 0.
     70 
     71      ALLOCATE(Ccoef_V(klon,klev), stat=ierr)
     72      IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocation Ccoef_V',1)
     73      Ccoef_V(:,:) = 0.
     74 
     75      ALLOCATE(Dcoef_V(klon,klev), stat=ierr)
     76      IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocation Dcoef_V',1)
     77      Dcoef_V(:,:) = 0.
     78 
     79      ALLOCATE(Acoef_U(klon), Bcoef_U(klon), Acoef_V(klon), Bcoef_V(klon), STAT=ierr)
     80      IF ( ierr /= 0 )  PRINT*,' pb in allloc Acoef_U and Bcoef_U, ierr=', ierr
     81      Acoef_U(:) = 0. ; Bcoef_U(:) = 0. ; Acoef_V(:) = 0. ; Bcoef_V(:) = 0. ;
     82 
     83      firstcall=.FALSE.
     84   
     85    ENDIF
    7086
    7187  END SUBROUTINE climb_wind_init
     
    7995!!!
    8096       Acoef_U_out, Acoef_V_out, Bcoef_U_out, Bcoef_V_out)
     97!$gpum horizontal knon
     98
    8199!
    82100! This routine calculates for the wind components u and v,
     
    131149    INTEGER                                  :: k, i, j
    132150
    133 !****************************************************************************************
    134 ! Initialize module
    135     IF (firstcall) CALL climb_wind_init
    136151
    137152!****************************************************************************************
     
    153168
    154169! - Calculate the coefficients C and D, component "u"
    155     CALL calc_coef(knon, yKcoefm(:,:), delp(:,:), &
    156          u_old(:,:), yalf1(:), yalf2(:),  &
    157          yCcoef_U(:,:), yDcoef_U(:,:), yAcoef_U(:), yBcoef_U(:))
     170    CALL calc_coef(knon, yKcoefm, delp, &
     171         u_old, yalf1, yalf2,  &
     172         yCcoef_U, yDcoef_U, yAcoef_U, yBcoef_U)
    158173
    159174! - Calculate the coefficients C and D, component "v"
    160     CALL calc_coef(knon, yKcoefm(:,:), delp(:,:), &
    161          v_old(:,:), yalf1(:), yalf2(:),  &
    162          yCcoef_V(:,:), yDcoef_V(:,:), yAcoef_V(:), yBcoef_V(:))
     175    CALL calc_coef(knon, yKcoefm, delp, &
     176         v_old, yalf1, yalf2,  &
     177         yCcoef_V, yDcoef_V, yAcoef_V, yBcoef_V)
    163178
    164179!****************************************************************************************
     
    222237!
    223238  SUBROUTINE calc_coef(knon, Kcoef, delp, X, alfa1, alfa2, Ccoef, Dcoef, Acoef, Bcoef)
     239!$gpum horizontal knon
     240
    224241!
    225242! Find the coefficients C and D in fonction of alfa, K and delp
     
    289306!!!
    290307       flx_u_new, flx_v_new, d_u_new, d_v_new)
     308!$gpum horizontal knon
     309
    291310!
    292311! Diffuse the wind components from the surface layer and up to the top layer.
  • LMDZ6/branches/PBLSURF_GPUPORT/libf/phylmd/pbl_surface_mod.F90

    r5878 r5879  
    110110    USE cdrag_mod, ONLY : cdrag_init
    111111    USE climb_hq_mod, ONLY : climb_hq_init
     112    USE climb_wind_mod, ONLY : climb_wind_init
    112113    IMPLICIT NONE
    113114 
     
    265266    CALL cdrag_init
    266267    CALL climb_hq_init
     268    CALL climb_wind_init
    267269
    268270  END SUBROUTINE pbl_surface_init
Note: See TracChangeset for help on using the changeset viewer.