Commit 998d390b authored by kbk's avatar kbk
Browse files

use more general frame for error handling - Umlauf

parent 571110bd
!$Id: uv_depths.F90,v 1.8 2004-01-05 08:59:38 kbk Exp $
!$Id: uv_depths.F90,v 1.9 2005-04-25 07:55:49 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -11,6 +11,7 @@
! !DESCRIPTION:
!
! !USES:
use exceptions
use domain, only: imin,imax,jmin,jmax,az,au,av,H,HU,HV
use variables_2d, only: DU,DV
IMPLICIT NONE
......@@ -26,7 +27,10 @@
! Original author(s): Hans Burchard & Karsten Bolding
!
! $Log: uv_depths.F90,v $
! Revision 1.8 2004-01-05 08:59:38 kbk
! Revision 1.9 2005-04-25 07:55:49 kbk
! use more general frame for error handling - Umlauf
!
! Revision 1.8 2004/01/05 08:59:38 kbk
! different velocity point depth calculations using vel_depth_method
!
! Revision 1.7 2003/06/18 08:27:41 kbk
......
!$Id: internal_pressure.F90,v 1.9 2004-06-18 13:43:50 kbk Exp $
!$Id: internal_pressure.F90,v 1.10 2005-04-25 07:55:50 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -16,6 +16,7 @@
! ip_method=5 ! CHU and FAN 2003 version
!
! !USES:
use exceptions
use domain, only: iimin,iimax,jjmin,jjmax,kmax,az,au,av,H,HU,HV
#if defined(SPHERICAL) || defined(CURVILINEAR)
use domain, only: dxu,dyv
......@@ -51,7 +52,10 @@
! Original author(s): Hans Burchard & Karsten Bolding
!
! $Log: internal_pressure.F90,v $
! Revision 1.9 2004-06-18 13:43:50 kbk
! Revision 1.10 2005-04-25 07:55:50 kbk
! use more general frame for error handling - Umlauf
!
! Revision 1.9 2004/06/18 13:43:50 kbk
! fixed first argument to getm_error()
!
! Revision 1.8 2004/06/18 13:00:30 hb
......
!$Id: m3d.F90,v 1.23 2004-08-09 07:48:07 kbk Exp $
!$Id: m3d.F90,v 1.24 2005-04-25 07:55:50 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -18,6 +18,7 @@
! in from the library lib3d.a.
!
! !USES:
use exceptions
use parameters, only: avmmol
use domain, only: maxdepth,vert_cord
use m2d, only: Am
......@@ -53,7 +54,10 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: m3d.F90,v $
! Revision 1.23 2004-08-09 07:48:07 kbk
! Revision 1.24 2005-04-25 07:55:50 kbk
! use more general frame for error handling - Umlauf
!
! Revision 1.23 2004/08/09 07:48:07 kbk
! checking for negative avmback and avhback
!
! Revision 1.22 2004/08/06 15:14:35 hb
......
!$Id: salinity.F90,v 1.13 2004-08-06 15:16:12 hb Exp $
!$Id: salinity.F90,v 1.14 2005-04-25 07:55:50 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -12,6 +12,7 @@
! Description still missing
!
! !USES:
use exceptions
use domain, only: imin,jmin,imax,jmax,ioff,joff
#ifdef HAIDVOGEL_TEST
use domain, only: iextr,jextr
......@@ -40,7 +41,10 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: salinity.F90,v $
! Revision 1.13 2004-08-06 15:16:12 hb
! Revision 1.14 2005-04-25 07:55:50 kbk
! use more general frame for error handling - Umlauf
!
! Revision 1.13 2004/08/06 15:16:12 hb
! Compiler option ARKONA_TEST included
!
! Revision 1.12 2004/07/29 19:46:32 hb
......
!$Id: temperature.F90,v 1.10 2004-01-06 15:04:00 kbk Exp $
!$Id: temperature.F90,v 1.11 2005-04-25 07:55:50 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -12,6 +12,7 @@
! Description still missing
!
! !USES:
use exceptions
use domain, only: imin,jmin,imax,jmax,H,az
use domain, only: iimin,jjmin,iimax,jjmax,kmax
use variables_3d, only: T,hn,adv_schemes
......@@ -36,7 +37,10 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: temperature.F90,v $
! Revision 1.10 2004-01-06 15:04:00 kbk
! Revision 1.11 2005-04-25 07:55:50 kbk
! use more general frame for error handling - Umlauf
!
! Revision 1.10 2004/01/06 15:04:00 kbk
! FCT advection + split of advection_3d.F90 + extra adv. input checks
!
! Revision 1.9 2003/12/16 17:10:05 kbk
......@@ -141,7 +145,7 @@
!
! !LOCAL VARIABLES:
integer :: k,i,j,n
integer, parameter :: nmax=3100
integer, parameter :: nmax=10000
REALTYPE :: zlev(nmax),prof(nmax)
integer :: temp_field_no=1
NAMELIST /temp/ &
......
#$Id: Makefile,v 1.4 2004-04-21 15:23:02 hb Exp $
#$Id: Makefile,v 1.5 2005-04-25 07:55:49 kbk Exp $
#
# Makefile to build utilities written in Fortran90 - libfutils.a
#
......@@ -7,11 +7,11 @@ include ../Rules.make
LIB = $(LIBDIR)/libfutils${buildtype}.a
MODSRC = parallel.F90 parameters.F90 time.F90 grid_interpol.F90
MODSRC = exceptions.F90 parallel.F90 parameters.F90 time.F90 grid_interpol.F90
LIBSRC = ver_interpol.F90 kbk_interpol.F90 tridiagonal.F90 pos.F90 \
cnv_2d.F90 cnv_3d.F90 eta_mask.F90 col_interpol.F90 \
to_2d_vel.F90 to_3d_vel.F90 tow.F90 getm_error.F90
cnv_2d.F90 cnv_3d.F90 eta_mask.F90 col_interpol.F90 \
to_2d_vel.F90 to_3d_vel.F90 tow.F90
SRC = $(MODSRC) $(LIBSRC)
......@@ -22,6 +22,7 @@ MOD = ${LIB}(halo_mpi.o) ${LIB}(read_par_setup.o)
endif
MOD += \
${LIB}(exceptions.o) \
${LIB}(parallel.o) \
${LIB}(parameters.o) \
${LIB}(halo_zones.o) \
......@@ -39,8 +40,7 @@ ${LIB}(eta_mask.o) \
${LIB}(col_interpol.o) \
${LIB}(to_2d_vel.o) \
${LIB}(to_3d_vel.o) \
${LIB}(tow.o) \
${LIB}(getm_error.o)
${LIB}(tow.o)
all: modules objects
......
!$Id: exceptions.F90,v 1.1 2005-04-25 07:55:49 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
!
! !MODULE: exceptions - handling of GETM errors and warnings
!
! !INTERFACE:
module exceptions
!
! !DESCRIPTION:
! This module contains routines to report \emph{warnings} and \emph{errors}
! to the FORTRAN error channel (i.e.\ normally to the screen). A
! \emph{warning} implies that the code tries to fix the problem (or simply
! does nothing) and continues to run. An \emph{error} means that the problem
! is fatal and the code exits.
!
! !USES:
IMPLICIT NONE
!
! private
!
! !PUBLIC MEMBER FUNCTIONS:
public getm_error,getm_warning
public netcdf_error,netcdf_warning
!
! !REVISION HISTORY:
! Original author(s): Lars Umlauf
!
! $Log: exceptions.F90,v $
! Revision 1.1 2005-04-25 07:55:49 kbk
! use more general frame for error handling - Umlauf
!
!
!EOP
!-----------------------------------------------------------------------
contains
!-----------------------------------------------------------------------
!BOP
!
! !IROUTINE: getm_error()
!
! !INTERFACE:
subroutine getm_error(routine,whatsup)
!
! !DESCRIPTION:
! Reports a fatal \emph{error} concerning a certain {\tt routine} in GETM
! and exits.
! The argument {\tt whatsup} is short (!) error message.
!
! !USES:
IMPLICIT NONE
#ifdef PARALLEL
! use mpi
include "mpif.h"
#endif
!
! !INPUT PARAMETERS:
character(len=*), intent(in) :: routine
character(len=*), intent(in) :: whatsup
!
! !BUGS:
! Exit status for parallel runs is not yet clean.
!
! !REVISION HISTORY:
! Original author(s): Lars Umlauf
!
! !LOCAL VARIABLES:
integer :: ierr
!EOP
!-----------------------------------------------------------------------
!BOC
STDERR " "
STDERR "FATAL GETM ERROR: Called from "//trim(routine)
STDERR "FATAL GETM ERROR: "//trim(whatsup)
STDERR " "
#ifdef PARALLEL
call MPI_Abort(MPI_COMM_WORLD,1,ierr)
#else
stop
#endif
return
end subroutine getm_error
!EOC
!-----------------------------------------------------------------------
!BOP
!
! !IROUTINE: getm_warning()
!
! !INTERFACE:
subroutine getm_warning(routine,whatsup)
!
! !DESCRIPTION:
! Reports a \emph{warning} concerning a certain {\tt routine} in GETM.
! The argument {\tt whatsup} is short (!) error message.
!
! !USES:
IMPLICIT NONE
!
! !INPUT PARAMETERS:
character(len=*), intent(in) :: routine
character(len=*), intent(in) :: whatsup
!
! !REVISION HISTORY:
! Original author(s): Lars Umlauf
!
!EOP
!-----------------------------------------------------------------------
!BOC
STDERR " "
STDERR "GETM WARNING: Called from "//trim(routine)
STDERR "GETM WARNING: "//trim(whatsup)
STDERR "GETM WARNING: This might cause problems later..."
STDERR " "
return
end subroutine getm_warning
!EOC
!-----------------------------------------------------------------------
!BOP
!
! !IROUTINE: netcdf_error()
!
! !INTERFACE:
subroutine netcdf_error(status,routine,whatsup)
!
! !USES:
IMPLICIT NONE
#ifdef PARALLEL
! use mpi
include "mpif.h"
#endif
!
! !DESCRIPTION:
! Reports an \emph{error} concerning a certain netCDF {\tt routine}
! in GETM and exits. The argument {\tt whatsup} is short (!) error
! message. An additional message is appended according to the netCDF
! library's {\tt status} argument.
! !INPUT PARAMETERS:
integer, intent(in) :: status
character(len=*), intent(in) :: routine
character(len=*), intent(in) :: whatsup
!
! !BUGS:
! Exit status for parallel runs is not yet clean.
!
! !REVISION HISTORY:
! Original author(s): Lars Umlauf
!
! !LOCAL VARIABLES:
integer :: ierr
!EOP
!-------------------------------------------------------------------------
!BOC
include "netcdf.inc"
STDERR " "
STDERR "FATAL NETCDF ERROR: Called from "//trim(routine)
STDERR "FATAL NETCDF ERROR: "//trim(whatsup)
STDERR "NETCDF MESSAGE : "//trim(nf_strerror(status))
STDERR " "
#ifdef PARALLEL
call MPI_Abort(MPI_COMM_WORLD,1,ierr)
#else
stop
#endif
return
end subroutine netcdf_error
!EOC
!-----------------------------------------------------------------------
!BOP
!
! !IROUTINE: netcdf_warning
!
! !INTERFACE:
subroutine netcdf_warning(status,routine,whatsup)
!
! !USES:
IMPLICIT NONE
!
! !DESCRIPTION:
! Reports a \emph{warning} concerning a certain netCDF {\tt routine} in GETM.
! The argument {\tt whatsup} is short (!) error message. An additional
! message is appended according to the netCDF library's {\tt status} argument.
!
! !INPUT PARAMETERS:
integer, intent(in) :: status
character(len=*), intent(in) :: routine
character(len=*), intent(in) :: whatsup
!
! !REVISION HISTORY:
! Original author(s): Lars Umlauf
!
!EOP
!-------------------------------------------------------------------------
!BOC
include "netcdf.inc"
STDERR " "
STDERR "NETCDF WARNING: Called from "//trim(routine)
STDERR "NETCDF WARNING: "//trim(whatsup)
STDERR "NETCDF MESSAGE: "//trim(nf_strerror(status))
STDERR " "
return
end subroutine netcdf_warning
!EOC
!-----------------------------------------------------------------------
end module exceptions
!-----------------------------------------------------------------------
! Copyright (C) 2005 - Lars Umlauf, Hans Burchard and Karsten Bolding
!-----------------------------------------------------------------------
!$Id: ncdf_meteo.F90,v 1.16 2005-03-31 10:14:20 kbk Exp $
!$Id: ncdf_meteo.F90,v 1.17 2005-04-25 07:55:50 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -20,6 +20,7 @@
use meteo, only: airp,u10,v10,t2,hum,tcc
use meteo, only: tausx,tausy,swr,shf
use meteo, only: new_meteo,t_1,t_2
use exceptions
IMPLICIT NONE
!
private
......@@ -79,7 +80,10 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: ncdf_meteo.F90,v $
! Revision 1.16 2005-03-31 10:14:20 kbk
! Revision 1.17 2005-04-25 07:55:50 kbk
! use more general frame for error handling - Umlauf
!
! Revision 1.16 2005/03/31 10:14:20 kbk
! flux calc. for point source + combined rot. met. and grid convergence
!
! Revision 1.15 2005/01/12 19:26:16 kbk
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment