| Directory: | ./ |
|---|---|
| File: | phys/icefrac_lsc_mod.f90 |
| Date: | 2022-01-11 19:19:34 |
| Exec | Total | Coverage | |
|---|---|---|---|
| Lines: | 10 | 12 | 83.3% |
| Branches: | 5 | 8 | 62.5% |
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | ! | ||
| 2 | ! $Header$ | ||
| 3 | ! | ||
| 4 | MODULE icefrac_lsc_mod | ||
| 5 | |||
| 6 | IMPLICIT NONE | ||
| 7 | |||
| 8 | CONTAINS | ||
| 9 | !******************************************************************* | ||
| 10 | |||
| 11 | 117000 | SUBROUTINE icefrac_lsc(np,temp, sig, icefrac) | |
| 12 | ! | ||
| 13 | ! Compute the ice fraction 1-xliq (see e.g. | ||
| 14 | ! Doutriaux-Boucher & Quaas 2004, section 2.2.) | ||
| 15 | ! | ||
| 16 | ! (JBM 3/14 8/14 5/16) | ||
| 17 | |||
| 18 | USE print_control_mod, ONLY: lunout, prt_level | ||
| 19 | INCLUDE "nuage.h" | ||
| 20 | |||
| 21 | ! nuage.h contains: | ||
| 22 | ! t_glace_min: if T < Tmin, the cloud is only made of water ice | ||
| 23 | ! t_glace_max: if T > Tmax, the cloud is only made of liquid water | ||
| 24 | ! exposant_glace: controls the sharpness of the transition | ||
| 25 | INTEGER :: np | ||
| 26 | REAL, DIMENSION(np), INTENT(IN) :: temp ! temperature | ||
| 27 | REAL, DIMENSION(np), INTENT(IN) :: sig | ||
| 28 | REAL, DIMENSION(np), INTENT(OUT) :: icefrac | ||
| 29 | |||
| 30 | REAL :: sig0,www,tmin_tmp,liqfrac_tmp | ||
| 31 | INTEGER :: ip | ||
| 32 | |||
| 33 | sig0=0.8 | ||
| 34 | |||
| 35 |
2/2✓ Branch 0 taken 116298000 times.
✓ Branch 1 taken 117000 times.
|
116415000 | DO ip=1,np |
| 36 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 116298000 times.
|
116298000 | IF (iflag_t_glace.EQ.1) THEN |
| 37 | ! Transition to ice close to surface for T<Tmax | ||
| 38 | ! w=1 at the surface and 0 for sig < sig0 | ||
| 39 | ✗ | www=(max(sig(ip)-sig0,0.))/(1.-sig0) | |
| 40 |
1/2✓ Branch 0 taken 116298000 times.
✗ Branch 1 not taken.
|
116298000 | ELSEIF (iflag_t_glace.GE.2) THEN |
| 41 | ! No convertion to ice close to surface | ||
| 42 | www = 0. | ||
| 43 | ENDIF | ||
| 44 | 116298000 | tmin_tmp=www*t_glace_max+(1.-www)*t_glace_min | |
| 45 | 116298000 | liqfrac_tmp= (temp(ip)-tmin_tmp) / (t_glace_max-tmin_tmp) | |
| 46 | 116298000 | liqfrac_tmp = MIN(MAX(liqfrac_tmp,0.0),1.0) | |
| 47 |
1/2✓ Branch 0 taken 116298000 times.
✗ Branch 1 not taken.
|
116415000 | IF (iflag_t_glace.GE.3) THEN |
| 48 | 116298000 | icefrac(ip) = 1.0-liqfrac_tmp**exposant_glace | |
| 49 | ELSE | ||
| 50 | ✗ | icefrac(ip) = (1.0-liqfrac_tmp)**exposant_glace | |
| 51 | ENDIF | ||
| 52 | ENDDO | ||
| 53 | |||
| 54 | 117000 | RETURN | |
| 55 | END SUBROUTINE icefrac_lsc | ||
| 56 | |||
| 57 | !******************************************************************* | ||
| 58 | ! | ||
| 59 | END MODULE icefrac_lsc_mod | ||
| 60 |