Ignore:
Timestamp:
May 15, 2019, 7:30:27 PM (6 years ago)
Author:
jyg
Message:

Correction of a bug in cv3_unsat: the ice fraction in the precipitation source was different in cv3_unsat and in cv3_undilute2.
The correction is protected by a new flag: keepbug_ice_frac.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmd/cv3_routines.F90

    r3500 r3502  
    136136     adiab_ascent_mass_flux_depends_on_ejectliq = .FALSE.
    137137     CALL getin_p('adiab_ascent_mass_flux_depends_on_ejectliq',adiab_ascent_mass_flux_depends_on_ejectliq)
     138     keepbug_ice_frac = .TRUE.
     139     CALL getin_p('keepbug_ice_frac', keepbug_ice_frac)
    138140
    139141    WRITE (*, *) 't_top_max=', t_top_max
     
    155157    WRITE (*, *) 'elcrit=', elcrit
    156158    WRITE (*, *) 'tlcrit=', tlcrit
     159    WRITE (*, *) 'ejectliq=', ejectliq
     160    WRITE (*, *) 'ejectice=', ejectice
     161    WRITE (*, *) 'cvflag_prec_eject =', cvflag_prec_eject
     162    WRITE (*, *) 'qsat_depends_on_qt =', qsat_depends_on_qt
     163    WRITE (*, *) 'adiab_ascent_mass_flux_depends_on_ejectliq =', adiab_ascent_mass_flux_depends_on_ejectliq
     164    WRITE (*, *) 'keepbug_ice_frac =', keepbug_ice_frac
     165
    157166    first = .FALSE.
    158167  END IF ! (first)
     
    29732982        DO il = 1, ncum                                                                                   !!jygprl
    29742983          IF (i<=inb(il) .AND. lwork(il)) THEN                                                            !!jygprl
    2975           frac(il, inb(il)) = 1. - (t(il,inb(il))-243.15)/(263.15-243.15)
    2976           frac(il, inb(il)) = min(max(frac(il,inb(il)),0.), 1.)
     2984!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     2985            IF (keepbug_ice_frac) THEN
     2986              frac(il, i) = frac_s(il, i)
    29772987!       Ice fraction computed again here as a function of the temperature seen by unsaturated downdraughts
    29782988!       (i.e. the cold pool temperature) for compatibility with earlier versions.
    2979           fraci(il, i) = 1. - (t(il,i)-243.15)/(263.15-243.15)
    2980           fraci(il, i) = min(max(fraci(il,i),0.0), 1.0)
     2989              fraci(il, i) = 1. - (t(il,i)-243.15)/(263.15-243.15)
     2990              fraci(il, i) = min(max(fraci(il,i),0.0), 1.0)
     2991!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     2992            ELSE  ! (keepbug_ice_frac)
     2993!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     2994              frac(il, i) = frac_s(il, i)
     2995              fraci(il, i) = frac(il, i)                                                                    !!jygprl
     2996            ENDIF  ! (keepbug_ice_frac)
     2997!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    29812998          END IF                                                                                          !!jygprl
    29822999        END DO                                                                                            !!jygprl
     
    29843001    END IF                                                                                              !!jygprl
    29853002
     3003
    29863004    DO il = 1, ncum
    29873005      IF (i<=inb(il) .AND. lwork(il)) THEN
     
    29893007        wt(il, i) = 45.0
    29903008
    2991 
    29923009        IF (i<inb(il)) THEN
    2993 
    2994           IF (cvflag_ice) THEN
    2995 !CR:tmax_fonte_cv: T for which ice is totally melted (used to be 275.15)
    2996             thaw = (t(il,i)-273.15)/(tmax_fonte_cv-273.15)
    2997             thaw = min(max(thaw,0.0), 1.0)
    2998             frac(il, i) = frac(il, i)*(1.-thaw)
    2999           ELSE
    3000             CONTINUE
    3001           END IF
    3002 
    30033010          rp(il, i) = rp(il, i+1) + &
    30043011                      (cpd*(t(il,i+1)-t(il,i))+gz(il,i+1)-gz(il,i))/lv(il, i)
    30053012          rp(il, i) = 0.5*(rp(il,i)+rr(il,i))
    30063013        END IF
    3007 !!        fraci(il, i) = 1. - (t(il,i)-243.15)/(263.15-243.15)
    3008 !!        fraci(il, i) = min(max(fraci(il,i),0.0), 1.0)
    30093014        rp(il, i) = max(rp(il,i), 0.0)
    30103015        rp(il, i) = amin1(rp(il,i), rs(il,i))
     
    34273432
    34283433  RETURN
     3434
    34293435END SUBROUTINE cv3_unsat
    34303436
Note: See TracChangeset for help on using the changeset viewer.