Line data Source code
1 : module cloud_fraction_fice 2 : 3 : use ccpp_kinds, only: kind_phys 4 : implicit none 5 : 6 : contains 7 : 8 : !================================================================================================ 9 : 10 : !=============================================================================== 11 : !> \section arg_table_cloud_fraction_fice_run Argument Table 12 : !! \htmlinclude cloud_fraction_fice_run.html 13 : !! 14 80640 : subroutine cloud_fraction_fice_run(ncol, t, tmelt, top_lev, pver, fice, fsnow, errmsg, errflg) 15 : ! 16 : ! Compute the fraction of the total cloud water which is in ice phase. 17 : ! The fraction depends on temperature only. 18 : ! This is the form that was used for radiation, the code came from cldefr originally 19 : ! 20 : ! Author: B. A. Boville Sept 10, 2002 21 : ! modified: PJR 3/13/03 (added fsnow to ascribe snow production for convection ) 22 : !----------------------------------------------------------------------- 23 : 24 : ! Arguments 25 : integer, intent(in) :: ncol ! number of active columns (count) 26 : real(kind_phys), intent(in) :: t(:,:) ! temperature (K) 27 : real(kind_phys), intent(in) :: tmelt ! freezing point of water (K) 28 : integer, intent(in) :: top_lev ! Vertical layer index for highest layer with tropopheric clouds (index) 29 : integer, intent(in) :: pver ! Number of vertical layers (count) 30 : 31 : real(kind_phys), intent(out) :: fice(:,:) ! Fractional ice content within cloud 32 : real(kind_phys), intent(out) :: fsnow(:,:) ! Fractional snow content for convection 33 : 34 : character(len=512), intent(out) :: errmsg 35 : integer, intent(out) :: errflg 36 : 37 : ! Local variables 38 : real(kind_phys) :: tmax_fice ! max temperature for cloud ice formation 39 : real(kind_phys) :: tmin_fice ! min temperature for cloud ice formation 40 : real(kind_phys) :: tmax_fsnow ! max temperature for transition to convective snow 41 : real(kind_phys) :: tmin_fsnow ! min temperature for transition to convective snow 42 : 43 : integer :: i,k ! loop indexes 44 : 45 : !----------------------------------------------------------------------- 46 : 47 80640 : errmsg = '' 48 80640 : errflg = 0 49 : 50 80640 : tmax_fice = tmelt - 10._kind_phys ! max temperature for cloud ice formation 51 80640 : tmin_fice = tmax_fice - 30._kind_phys ! min temperature for cloud ice formation 52 80640 : tmax_fsnow = tmelt ! max temperature for transition to convective snow 53 80640 : tmin_fsnow = tmelt - 5._kind_phys ! min temperature for transition to convective snow 54 : 55 33691392 : fice(:,:top_lev-1) = 0._kind_phys 56 33691392 : fsnow(:,:top_lev-1) = 0._kind_phys 57 : 58 : ! Define fractional amount of cloud that is ice 59 3548160 : do k=top_lev,pver 60 53480448 : do i=1,ncol 61 : 62 : ! If warmer than tmax then water phase 63 49932288 : if (t(i,k) > tmax_fice) then 64 11188274 : fice(i,k) = 0.0_kind_phys 65 : 66 : ! If colder than tmin then ice phase 67 38744014 : else if (t(i,k) < tmin_fice) then 68 24261076 : fice(i,k) = 1.0_kind_phys 69 : 70 : ! Otherwise mixed phase, with ice fraction decreasing linearly from tmin to tmax 71 : else 72 14482938 : fice(i,k) =(tmax_fice - t(i,k)) / (tmax_fice - tmin_fice) 73 : end if 74 : 75 : ! snow fraction partitioning 76 : 77 : ! If warmer than tmax then water phase 78 53399808 : if (t(i,k) > tmax_fsnow) then 79 7083424 : fsnow(i,k) = 0.0_kind_phys 80 : 81 : ! If colder than tmin then ice phase 82 42848864 : else if (t(i,k) < tmin_fsnow) then 83 40832925 : fsnow(i,k) = 1.0_kind_phys 84 : 85 : ! Otherwise mixed phase, with ice fraction decreasing linearly from tmin to tmax 86 : else 87 2015939 : fsnow(i,k) =(tmax_fsnow - t(i,k)) / (tmax_fsnow - tmin_fsnow) 88 : end if 89 : 90 : end do 91 : end do 92 : 93 80640 : end subroutine cloud_fraction_fice_run 94 : 95 : end module cloud_fraction_fice