--- trunk/Sources/phylmd/CV30_routines/cv30_compress.f 2016/05/23 13:50:39 196 +++ trunk/Sources/phylmd/CV30_routines/cv30_compress.f 2016/05/24 12:25:29 197 @@ -14,6 +14,7 @@ use cv30_param_m, only: nl USE dimphy, ONLY: klev, klon + use nr_util, only: assert ! inputs: integer, intent(in):: iflag1(:), nk1(:), icb1(:), icbs1(:) ! (klon) @@ -31,11 +32,7 @@ ! outputs: integer nk(:) ! (klon) - - integer, intent(out):: icb(:) ! (ncum) - ! {2 <= icb <= nl - 3} - ! {ph(i, icb(i) + 1) < plcl(i) <= ph(i, icb(i))} - + integer, intent(out):: icb(:) ! (ncum) {2 <= icb <= nl - 3} integer icbs(klon) real, intent(out):: plcl(:) ! (ncum) real tnk(:), qnk(:), gznk(:) ! (klon) @@ -101,6 +98,12 @@ endif end do + do i = 1, ncum + call assert(2 <= icb(i) .and. icb(i) <= nl - 3 .and. ph(i, icb(i) + 1) & + < plcl(i) .and. (plcl(i) <= ph(i, icb(i)) .or. icb(i) == 2), & + "cv30_compress") + end do + end SUBROUTINE cv30_compress end module cv30_compress_m