PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
compute_frac_ice.func.h
Go to the documentation of this file.
1!MNH_LIC Copyright 2006-2025 CNRS, Meteo-France and Universite Paul Sabatier
2!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
3!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4!MNH_LIC for details. version 1.
5 ELEMENTAL SUBROUTINE compute_frac_ice(CST,HFRAC_ICE,NEBN,PFRAC_ICE,PT)
6
7! ******* TO BE INCLUDED IN THE *CONTAINS* OF A SUBROUTINE, IN ORDER TO EASE AUTOMATIC INLINING ******
8! => Don't use drHook !!!
9!
10!!**** *COMPUTE_FRAC_ICE* - computes ice fraction
11!
12!! AUTHOR
13!! ------
14!! Julien PERGAUD * Meteo-France *
15!!
16!! MODIFICATIONS
17!! -------------
18!! Original 13/03/06
19!! S. Riette April 2011 optimisation
20!! S. Riette 08/2016 add option O
21!! R. El Khatib 12-Aug-2021 written as a include file
22!! S. Riette Sept 2025, remove KERR argument
23!
24!! --------------------------------------------------------------------------
25USE modd_neb_n, ONLY : neb_t
26USE modd_cst, ONLY : cst_t
27!
28IMPLICIT NONE
29!
30TYPE(cst_t), INTENT(IN) :: cst
31CHARACTER(LEN=1), INTENT(IN) :: hfrac_ice ! scheme to use
32TYPE(neb_t), INTENT(IN) :: nebn
33REAL, INTENT(IN) :: pt ! temperature
34REAL, INTENT(INOUT) :: pfrac_ice ! Ice fraction (1 for ice only, 0 for liquid only)
35!
36!------------------------------------------------------------------------
37
38! 1. Compute FRAC_ICE
39!
40SELECT CASE(hfrac_ice)
41 CASE ('T') !using Temperature
42 pfrac_ice = max( 0., min(1., (( nebn%XTMAXMIX - pt ) / ( nebn%XTMAXMIX - nebn%XTMINMIX )) ) ) ! freezing interval
43 CASE ('O') !using Temperature with old formulae
44 pfrac_ice = max( 0., min(1., (( cst%XTT - pt ) / 40.) ) ) ! freezing interval
45 CASE ('N') !No ice
46 pfrac_ice = 0.
47 CASE ('S') !Same as previous
48 ! (almost) nothing to do
49 pfrac_ice = max( 0., min(1., pfrac_ice ) )
50END SELECT
51
52END SUBROUTINE compute_frac_ice
elemental subroutine compute_frac_ice(cst, hfrac_ice, nebn, pfrac_ice, pt)
type(cst_t), target, save cst
Definition modd_cst.F90:137
type(neb_t), pointer, save nebn
Definition modd_nebn.F90:61