[Dart-dev] DART/branches Revision: 12683
dart at ucar.edu
dart at ucar.edu
Tue Jun 26 08:14:19 MDT 2018
nancy at ucar.edu
2018-06-26 08:14:18 -0600 (Tue, 26 Jun 2018)
303
on the recam branch - distinguish between i4 and i8
for some routines; make the error handling code simpler
by moving the test for a closed log file into the
error handler code itself instead of testing each time
before calling; add a debugging array dump routine for
4d arrays (1-3d already existed).
Modified: DART/branches/recam/assimilation_code/modules/utilities/utilities_mod.f90
===================================================================
--- DART/branches/recam/assimilation_code/modules/utilities/utilities_mod.f90 2018-06-18 20:35:29 UTC (rev 12682)
+++ DART/branches/recam/assimilation_code/modules/utilities/utilities_mod.f90 2018-06-26 14:14:18 UTC (rev 12683)
@@ -6,13 +6,14 @@
module utilities_mod
+!> general purpose lower level utility routines.
+!>
+!> probably large enough now this file should be split with the
+!> logging and error handing here, maybe the file routines in
+!> another util module?
+
use types_mod, only : r4, r8, digits12, i4, i8, PI, MISSING_R8, MISSING_I
-!>@todo FIXME netcdf is only needed for the nc_check() routine.
-!>when it moves to the netcdf_utilities_mod module remove the 'use'
-!>from here to simplify things.
-use netcdf
-
implicit none
private
@@ -23,13 +24,13 @@
real(r8), parameter :: TWOPI = PI * 2.0_r8
-logical :: do_output_flag = .false.
-integer :: nml_flag = NML_FILE
-logical :: single_task = .true.
-integer :: task_number = 0
+logical :: do_output_flag = .false.
+integer :: nml_flag = NML_FILE
+logical :: single_task = .true.
+integer :: task_number = 0
logical :: module_initialized = .false.
-integer :: logfileunit = -1
-integer :: nmlfileunit = -1
+integer :: logfileunit = -1
+integer :: nmlfileunit = -1
public :: get_unit, &
@@ -95,7 +96,7 @@
! if so, make to_scalar_int explicitly I4, i guess.)
interface scalar
module procedure to_scalar_real
- module procedure to_scalar_int
+ module procedure to_scalar_int4
module procedure to_scalar_int8
end interface
@@ -103,6 +104,7 @@
module procedure array_1d_dump
module procedure array_2d_dump
module procedure array_3d_dump
+ module procedure array_4d_dump
end interface
! version controlled file description for error handling, do not edit
@@ -162,7 +164,6 @@
module_initialized = .true.
-
! now default to false, and only turn on if i'm task 0
! or the caller tells me to turn it on.
if (present(output_flag)) then
@@ -222,7 +223,7 @@
endif
! Check to make sure termlevel is set to a reasonable value
-call checkTermLevel(TERMLEVEL)
+call check_term_level(TERMLEVEL)
! Echo the module information using normal mechanism
call register_module(source, revision, revdate)
@@ -418,12 +419,8 @@
if(.not. file_exist(trim(namelist_file_name))) then
write(msgstring1, *) 'Namelist input file: ', namelist_file_name, ' must exist.'
- if(logfileunit >= 0) then
- call error_handler(E_ERR, 'find_namelist_in_file', msgstring1, &
- source, revision, revdate)
- else
- call fatal_error_w_no_log('find_namelist_in_file', msgstring1)
- endif
+ call error_handler(E_ERR, 'find_namelist_in_file', msgstring1, &
+ source, revision, revdate)
endif
@@ -444,12 +441,8 @@
! Reached end of file and didn't find this namelist
write(msgstring1, *) 'Namelist entry &', trim(nml_name), &
' must exist in file ', trim(namelist_file_name)
- if(logfileunit >= 0) then
- call error_handler(E_ERR, 'find_namelist_in_file', msgstring1, &
- source, revision, revdate)
- else
More information about the Dart-dev
mailing list