--- trunk/Sources/phylmd/hgardfou.f 2015/04/29 15:47:56 134 +++ trunk/Sources/phylmd/hgardfou.f 2017/11/02 15:47:03 227 @@ -4,17 +4,20 @@ contains - SUBROUTINE hgardfou(t, tsol) + SUBROUTINE hgardfou(t_seri, ftsol) - ! From phylmd/hgardfou.F, v 1.1.1.1 2004/05/19 12:53:07 + ! From phylmd/hgardfou.F, v 1.1.1.1, 2004/05/19 12:53:07 ! This procedure aborts the program if the temperature gets out of range. - USE indicesol, ONLY: nbsrf + use abort_gcm_m, only: abort_gcm + USE indicesol, ONLY: nbsrf, clnsurf USE dimphy, ONLY: klev, klon use nr_util, only: ifirstloc + use phyetat0_m, only: rlon, rlat - REAL, intent(in):: t(klon, klev), tsol(klon, nbsrf) + REAL, intent(in):: t_seri(:, :) ! (klon, klev) + REAL, intent(in):: ftsol(:, :) ! (klon, nbsrf) ! Variables local to the procedure: @@ -24,20 +27,23 @@ !---------------------------------------------------------- DO k = 1, klev - jbad = ifirstloc(t(:, k) > temp_max .or. t(:, k) < temp_min) + jbad = ifirstloc(t_seri(:, k) > temp_max .or. t_seri(:, k) < temp_min) if (jbad <= klon) then - PRINT *, 'hgardfou: temperature out of range' - print *, "t(", jbad, ", ", k, ") = ", t(jbad, k) - stop 1 + print *, "t_seri(", jbad, ", ", k, ") = ", t_seri(jbad, k) + call abort_gcm('hgardfou', 'temperature out of range') end if ENDDO DO nsrf = 1, nbsrf - jbad = ifirstloc(tsol(:, nsrf) > temp_max .or. tsol(:, nsrf) < temp_min) + jbad = ifirstloc(ftsol(:, nsrf) > temp_max & + .or. ftsol(:, nsrf) < temp_min) if (jbad <= klon) then - PRINT *, 'hgardfou: temperature out of range' - print *, "tsol(", jbad, ", ", nsrf, ") = ", tsol(jbad, nsrf) - stop 1 + print *, "ftsol(position index =", jbad, ", sub-surface index =", & + nsrf, ") =", ftsol(jbad, nsrf) + print *, "sub-surface name: ", clnsurf(nsrf) + print *, "longitude:", rlon(jbad), "degrees east" + print *, "latitude:", rlat(jbad), "degrees north" + call abort_gcm('hgardfou', 'temperature out of range') ENDIF ENDDO