--- trunk/dyn3d/test_disvert.f 2014/09/11 15:09:15 107 +++ trunk/dyn3d/test_disvert.f 2018/03/20 09:35:59 265 @@ -17,7 +17,7 @@ use abort_gcm_m, only: abort_gcm use comconst, only: kappa, cpp use disvert_m, only: ap, bp, preff, presnivs, s - use dimens_m, only: llm + use dimensions, only: llm use exner_hyb_m, only: exner_hyb use jumble, only: new_unit @@ -42,27 +42,6 @@ call exner_hyb(ps, p, pks, pk) p_lay = preff * (pk(:, 1, :) / cpp)**(1. / kappa) - ! Are pressure values in the right order? - if (any(p(:, 1, :llm) <= p_lay .or. p_lay <= p(:, 1, 2:))) then - ! List details and stop: - do l = 1, llm - do i = 1, ngrid - if (p(i, 1, l) <= p_lay(i, l)) then - print 1000, "ps = ", ps(i, 1) / 100., "hPa, p(level ", l, & - ") = ", p(i, 1, l) / 100., " hPa <= p(layer ", l, ") = ", & - p_lay(i, l) / 100., " hPa" - end if - if (p_lay(i, l) <= p(i, 1, l+1)) then - print 1000, "ps = ", ps(i, 1) / 100., & - "hPa, p(layer ", l, ") = ", p_lay(i, l) / 100., & - " hPa <= p(level ", l + 1, ") = ", & - p(i, 1, l + 1) / 100., " hPa" - end if - end do - end do - call abort_gcm("test_disvert", "bad order of pressure values", 1) - end if - ! Write distribution for the reference surface pressure (index ngrid): z = 7. * log(preff / p(ngrid, 1, :llm)) @@ -90,7 +69,28 @@ close(unit) print *, 'The file "full_level.csv" has been created.' -1000 format (3(a, g10.4, a, i0)) + ! Are pressure values in the right order? + if (any(p(:, 1, :llm) <= p_lay .or. p_lay <= p(:, 1, 2:))) then + ! List details and stop: + do l = 1, llm + do i = 1, ngrid + if (p(i, 1, l) <= p_lay(i, l)) then + print 1000, "ps = ", ps(i, 1) / 100., "hPa, p(level ", l, & + ") = ", p(i, 1, l) / 100., " hPa <= p(layer ", l, ") = ", & + p_lay(i, l) / 100., " hPa" + end if + if (p_lay(i, l) <= p(i, 1, l+1)) then + print 1000, "ps = ", ps(i, 1) / 100., & + "hPa, p(layer ", l, ") = ", p_lay(i, l) / 100., & + " hPa <= p(level ", l + 1, ") = ", & + p(i, 1, l + 1) / 100., " hPa" + end if + end do + end do + call abort_gcm("test_disvert", "bad order of pressure values") + end if + +1000 format (3(a, g11.4, a, i0)) end subroutine test_disvert