source: LMDZ5/branches/testing/libf/phylmd/icefrac_lsc_mod.F90 @ 2219

Last change on this file since 2219 was 2160, checked in by Laurent Fairhead, 10 years ago

Merged trunk changes -r2070:2158 into testing branch. Compilation problems introduced by revision r2155 have been corrected by hand

  • Property svn:executable set to *
File size: 1.2 KB
RevLine 
[2077]1!
2! $Header$
3!
4MODULE icefrac_lsc_mod
5
[2109]6IMPLICIT NONE
7
[2077]8CONTAINS
9!*******************************************************************
10
[2109]11SUBROUTINE icefrac_lsc(np,temp, sig, icefrac)
[2077]12  !
13  ! Compute the ice fraction 1-xliq (see e.g.
14  ! Doutriaux-Boucher & Quaas 2004, section 2.2.)
15  !
[2109]16  ! (JBM 3/14 8/14)
17 
18  INCLUDE "nuage.h"
19
20  ! nuage.h contains:
21  ! t_glace_min: if T < Tmin, the cloud is only made of water ice
22  ! t_glace_max: if T > Tmax, the cloud is only made of liquid water
23  ! exposant_glace: controls the sharpness of the transition
[2077]24  INTEGER :: np
25  REAL, DIMENSION(np), INTENT(IN) :: temp ! temperature
26  REAL, DIMENSION(np), INTENT(IN) :: sig
27  REAL, DIMENSION(np), INTENT(OUT) :: icefrac
28
29  REAL :: sig0,www,tmin_tmp,icefrac_tmp
30  INTEGER :: ip
31
32  sig0=0.8
33
34  DO ip=1,np
35     www=(max(sig(ip)-sig0,0.))/(1.-sig0) ! w=1 at the surface and 0 for sig < sig0
[2109]36     tmin_tmp=www*t_glace_max+(1.-www)*t_glace_min
37     icefrac_tmp= 1.0 - (temp(ip)-tmin_tmp) / (t_glace_max-tmin_tmp)
[2077]38     icefrac_tmp = MIN(MAX(icefrac_tmp,0.0),1.0)
[2109]39     icefrac(ip) = icefrac_tmp**exposant_glace
[2077]40  ENDDO
41
42  RETURN
43END SUBROUTINE icefrac_lsc
44
45!*******************************************************************
46!
47END MODULE icefrac_lsc_mod
Note: See TracBrowser for help on using the repository browser.