alpale_wk.f90 Source File


This file depends on

sourcefile~~alpale_wk.f90~~EfferentGraph sourcefile~alpale_wk.f90 alpale_wk.f90 sourcefile~dimphy.f90 dimphy.f90 sourcefile~alpale_wk.f90->sourcefile~dimphy.f90 sourcefile~yomcst_mod_h.f90 yomcst_mod_h.f90 sourcefile~alpale_wk.f90->sourcefile~yomcst_mod_h.f90 sourcefile~ioipsl_getin_p_mod.f90 ioipsl_getin_p_mod.f90 sourcefile~alpale_wk.f90->sourcefile~ioipsl_getin_p_mod.f90 sourcefile~print_control_mod.f90 print_control_mod.f90 sourcefile~alpale_wk.f90->sourcefile~print_control_mod.f90 sourcefile~strings_mod.f90 strings_mod.f90 sourcefile~ioipsl_getin_p_mod.f90->sourcefile~strings_mod.f90 sourcefile~mod_phys_lmdz_para.f90 mod_phys_lmdz_para.f90 sourcefile~ioipsl_getin_p_mod.f90->sourcefile~mod_phys_lmdz_para.f90 sourcefile~mod_phys_lmdz_transfert_para.f90 mod_phys_lmdz_transfert_para.f90 sourcefile~ioipsl_getin_p_mod.f90->sourcefile~mod_phys_lmdz_transfert_para.f90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~print_control_mod.f90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~mod_phys_lmdz_transfert_para.f90 sourcefile~mod_phys_lmdz_mpi_data.f90 mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_grid_phy_lmdz.f90 mod_grid_phy_lmdz.f90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~mod_phys_lmdz_omp_data.f90 mod_phys_lmdz_omp_data.F90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~mod_phys_lmdz_omp_data.f90 sourcefile~mod_phys_lmdz_omp_transfert.f90 mod_phys_lmdz_omp_transfert.f90 sourcefile~mod_phys_lmdz_transfert_para.f90->sourcefile~mod_phys_lmdz_omp_transfert.f90 sourcefile~mod_phys_lmdz_transfert_para.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_mpi_transfert.f90 mod_phys_lmdz_mpi_transfert.f90 sourcefile~mod_phys_lmdz_transfert_para.f90->sourcefile~mod_phys_lmdz_mpi_transfert.f90 sourcefile~mod_phys_lmdz_omp_transfert.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_omp_transfert.f90->sourcefile~mod_phys_lmdz_omp_data.f90 sourcefile~mod_phys_lmdz_mpi_data.f90->sourcefile~print_control_mod.f90 sourcefile~lmdz_mpi.f90 lmdz_mpi.F90 sourcefile~mod_phys_lmdz_mpi_data.f90->sourcefile~lmdz_mpi.f90 sourcefile~lmdz_cppkeys_wrapper.f90 lmdz_cppkeys_wrapper.F90 sourcefile~mod_phys_lmdz_mpi_data.f90->sourcefile~lmdz_cppkeys_wrapper.f90 sourcefile~mod_phys_lmdz_mpi_transfert.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_mpi_transfert.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~mod_phys_lmdz_mpi_transfert.f90->sourcefile~lmdz_mpi.f90 sourcefile~mod_phys_lmdz_omp_data.f90->sourcefile~dimphy.f90 sourcefile~mod_phys_lmdz_omp_data.f90->sourcefile~print_control_mod.f90 sourcefile~mod_phys_lmdz_omp_data.f90->sourcefile~mod_phys_lmdz_mpi_data.f90

Files dependent on this one

sourcefile~~alpale_wk.f90~~AfferentGraph sourcefile~alpale_wk.f90 alpale_wk.f90 sourcefile~physiq_mod.f90 physiq_mod.F90 sourcefile~physiq_mod.f90->sourcefile~alpale_wk.f90 sourcefile~physiq_mod.f90~2 physiq_mod.F90 sourcefile~physiq_mod.f90~2->sourcefile~alpale_wk.f90 sourcefile~old_lmdz1d.f90 old_lmdz1d.f90 sourcefile~old_lmdz1d.f90->sourcefile~physiq_mod.f90 sourcefile~scm.f90 scm.f90 sourcefile~scm.f90->sourcefile~physiq_mod.f90 sourcefile~callphysiq_mod.f90 callphysiq_mod.f90 sourcefile~callphysiq_mod.f90->sourcefile~physiq_mod.f90 sourcefile~callphysiq_mod.f90~2 callphysiq_mod.f90 sourcefile~callphysiq_mod.f90~2->sourcefile~physiq_mod.f90 sourcefile~calfis.f90 calfis.f90 sourcefile~calfis.f90->sourcefile~callphysiq_mod.f90

Contents

Source Code


Source Code

!$gpum horizontal klon
MODULE alpale_wk_mod
  PRIVATE

  LOGICAL, SAVE                                              :: first = .TRUE.
  !$OMP THREADPRIVATE(first)
  REAL, ALLOCATABLE, SAVE, DIMENSION(:)                      :: cellrad
  !$OMP THREADPRIVATE(cellrad)

  PUBLIC alpale_wk, alpale_wk_first

  CONTAINS

SUBROUTINE alpale_wk_first(cell_area)

  USE dimphy, ONLY: klon
  USE yomcst_mod_h, ONLY: rpi

  IMPLICIT NONE
  REAL, DIMENSION(klon), INTENT(IN)     :: cell_area

  IF (first) THEN
    ALLOCATE (cellrad(klon))
  !  Compute pseudo grid-cell radius cellrad, such that pi*cellrad^2=cell_area
    print *,'alpale_wk: cell_area(1) ',cell_area(1)
    cellrad(:)=sqrt(cell_area(:)/rpi)
    first = .FALSE.
  ENDIF

END SUBROUTINE alpale_wk_first

SUBROUTINE alpale_wk ( dtime, cell_area, zoccur, sigmaw, wdens, fip ,  &
                       fip_cond)

! **************************************************************
!                                                              *
! ALPALE_WK                                                    *
!                                                              *
!                                                              *
! written by   : Jean-Yves Grandpeix, 07/08/2017               *
! modified by :                                                *
! **************************************************************

  USE dimphy, ONLY: klon
  USE ioipsl_getin_p_mod, ONLY : getin_p
  USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level
  USE yomcst_mod_h, ONLY: rpi

  IMPLICIT NONE

!================================================================
! Auteur(s)   : Jean-Yves Grandpeix, 07/08/2017
! Objet : Contribution of the wake scheme to Ale and Alp
!================================================================

! Input arguments
!----------------
  REAL, INTENT(IN)                                           :: dtime
  REAL, DIMENSION(klon),    INTENT(IN)                       :: cell_area
  INTEGER, DIMENSION(klon), INTENT (IN)                      :: zoccur
  REAL, DIMENSION(klon),    INTENT(IN)                       :: sigmaw
  REAL, DIMENSION(klon),    INTENT(IN)                       :: wdens
  REAL, DIMENSION(klon),    INTENT(IN)                       :: fip
! Output arguments
!-----------------
  REAL, DIMENSION(klon), INTENT(OUT)                         :: fip_cond


! Local variables
!----------------
  INTEGER                                                    :: i
  REAL, DIMENSION(klon)                                      :: wkrad
  REAL, DIMENSION(klon)                                      :: proba_gf

!  Compute wake radius
!!  print *,'alpale_wk: sigmaw(1), wdens(1) ', sigmaw(1), wdens(1)
  DO i = 1,klon
    IF (zoccur(i) .GE. 1) THEN
      wkrad(i) = sqrt(sigmaw(i)/(rpi*wdens(i)))
    ELSE
      wkrad(i) = 0.
    ENDIF ! (zoccur(i) .GE. 1)
  ENDDO

!  Compute probability that the grid-cell is intersected by a gust front
!!  print *,'alpale_wk: wkrad(1), cellrad(1) ', wkrad(1), cellrad(1)
!!  proba_gf(:) = exp(-wdens(:)*rpi*max(wkrad(:)-cellrad(:),0.)**2) - &   ! Formules
!!                exp(-wdens(:)*rpi*(wkrad(:)+cellrad(:))**2)             ! fausses !
  proba_gf(:) = 1. - exp(-wdens(:)*rpi*((wkrad(:)+cellrad(:))**2 - &
                                        max(wkrad(:)-cellrad(:),0.)**2) )
!
  proba_gf(:) = max(proba_gf(:),1.e-3)
!  Compute Fip conditionned on the presence of some gust front within the 
!  grid-cell
!!  print *,'alpale_wk: proba_gf(1), fip(1), ', proba_gf(1), fip(1)
  fip_cond(:) = fip(:)/proba_gf(:)
!!    print *,'alpale_wk: wkrad(1), cellrad(1), proba_gf(1), fip(1), fip_cond(1) ', &
!!                        wkrad(1), cellrad(1), proba_gf(1), fip(1), fip_cond(1)

   RETURN
   END SUBROUTINE alpale_wk

END MODULE alpale_wk_mod