source: LMDZ6/branches/Amaury_dev/libf/phylmd/alpale_wk.F90 @ 5144

Last change on this file since 5144 was 5144, checked in by abarral, 8 weeks ago

Put YOMCST.h into modules

File size: 3.0 KB
RevLine 
[5144]1SUBROUTINE alpale_wk(dtime, cell_area, zoccur, sigmaw, wdens, fip, &
2        fip_cond)
[3001]3
[5144]4  ! **************************************************************
5  !                                                              *
6  ! ALPALE_WK                                                    *
7  !                                                              *
8  !                                                              *
9  ! written by   : Jean-Yves Grandpeix, 07/08/2017               *
10  ! modified by :                                                *
11  ! **************************************************************
[3001]12
13  USE dimphy, ONLY: klon
[5112]14  USE lmdz_ioipsl_getin_p, ONLY: getin_p
[5144]15  USE lmdz_print_control, ONLY: mydebug => debug, lunout, prt_level
16  USE lmdz_yomcst, ONLY: rpi
[5099]17
[3001]18  IMPLICIT NONE
19
[5144]20  !================================================================
21  ! Auteur(s)   : Jean-Yves Grandpeix, 07/08/2017
22  ! Objet : Contribution of the wake scheme to Ale and Alp
23  !================================================================
[3001]24
[5144]25  ! Input arguments
26  !----------------
27  REAL, INTENT(IN) :: dtime
28  REAL, DIMENSION(klon), INTENT(IN) :: cell_area
29  INTEGER, DIMENSION(klon), INTENT (IN) :: zoccur
30  REAL, DIMENSION(klon), INTENT(IN) :: sigmaw
31  REAL, DIMENSION(klon), INTENT(IN) :: wdens
32  REAL, DIMENSION(klon), INTENT(IN) :: fip
33  ! Output arguments
34  !-----------------
35  REAL, DIMENSION(klon), INTENT(OUT) :: fip_cond
[3001]36
37
[5144]38  ! Local variables
39  !----------------
40  INTEGER :: i
41  LOGICAL, SAVE :: first = .TRUE.
[3001]42  !$OMP THREADPRIVATE(first)
[5144]43  REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: cellrad
[3001]44  !$OMP THREADPRIVATE(cellrad)
[5144]45  REAL, DIMENSION(klon) :: wkrad
46  REAL, DIMENSION(klon) :: proba_gf
[3001]47
[5144]48  IF (first) THEN
49    ALLOCATE (cellrad(klon))
50    !  Compute pseudo grid-cell radius cellrad, such that pi*cellrad^2=cell_area
51    print *, 'alpale_wk: cell_area(1) ', cell_area(1)
52    cellrad(:) = sqrt(cell_area(:) / rpi)
53    first = .FALSE.
54  ENDIF
[3001]55
[5144]56  !  Compute wake radius
57  !!  print *,'alpale_wk: sigmaw(1), wdens(1) ', sigmaw(1), wdens(1)
58  DO i = 1, klon
[5081]59    IF (zoccur(i) >= 1) THEN
[5144]60      wkrad(i) = sqrt(sigmaw(i) / (rpi * wdens(i)))
[3001]61    ELSE
62      wkrad(i) = 0.
63    ENDIF ! (zoccur(i) .GE. 1)
64  ENDDO
65
[5144]66  !  Compute probability that the grid-cell is intersected by a gust front
67  !!  print *,'alpale_wk: wkrad(1), cellrad(1) ', wkrad(1), cellrad(1)
68  !!  proba_gf(:) = exp(-wdens(:)*rpi*max(wkrad(:)-cellrad(:),0.)**2) - &   ! Formules
69  !!                exp(-wdens(:)*rpi*(wkrad(:)+cellrad(:))**2)             ! fausses !
70  proba_gf(:) = 1. - exp(-wdens(:) * rpi * ((wkrad(:) + cellrad(:))**2 - &
71          max(wkrad(:) - cellrad(:), 0.)**2))
[5099]72
[5144]73  proba_gf(:) = max(proba_gf(:), 1.e-3)
74  !  Compute Fip conditionned on the presence of some gust front within the
75  !  grid-cell
76  !!  print *,'alpale_wk: proba_gf(1), fip(1), ', proba_gf(1), fip(1)
77  fip_cond(:) = fip(:) / proba_gf(:)
78  !!    print *,'alpale_wk: wkrad(1), cellrad(1), proba_gf(1), fip(1), fip_cond(1) ', &
79  !!                        wkrad(1), cellrad(1), proba_gf(1), fip(1), fip_cond(1)
[3001]80
[5144]81END SUBROUTINE alpale_wk
[5105]82
Note: See TracBrowser for help on using the repository browser.