[Dart-dev] DART/branches Revision: 12906

dart at ucar.edu dart at ucar.edu
Thu Oct 18 14:28:11 MDT 2018


nancy at ucar.edu
2018-10-18 14:28:11 -0600 (Thu, 18 Oct 2018)
251
change some print statements to use the logit() routine
which writes the same string to both stdout and the dart log.

also change some tests to compare against 0.0_r8 instead of just 0.

also test for 0 width cells and report an error during setup.




Modified: DART/branches/recam/models/utilities/quad_utils_mod.f90
===================================================================
--- DART/branches/recam/models/utilities/quad_utils_mod.f90	2018-10-18 20:24:00 UTC (rev 12905)
+++ DART/branches/recam/models/utilities/quad_utils_mod.f90	2018-10-18 20:28:11 UTC (rev 12906)
@@ -40,7 +40,8 @@
 use    utilities_mod, only : register_module, error_handler,         &
                              E_ERR, E_WARN, E_MSG, nmlfileunit,      &
                              do_output, do_nml_file, do_nml_term,    &
-                             find_namelist_in_file, check_namelist_read
+                             find_namelist_in_file, check_namelist_read, &
+                             log_it, array_dump
 
 implicit none
 private
@@ -168,11 +169,11 @@
    integer  :: num_reg_x = 180
    integer  :: num_reg_y = 180
    integer  :: max_reg_list_num = 800
-   real(r8) :: min_lon =   0.0_r8
-   real(r8) :: max_lon = 360.0_r8
+   real(r8) :: min_lon =     0.0_r8
+   real(r8) :: max_lon =   360.0_r8
    real(r8) :: lon_width = 360.0_r8
-   real(r8) :: min_lat = -90.0_r8
-   real(r8) :: max_lat =  90.0_r8
+   real(r8) :: min_lat =   -90.0_r8
+   real(r8) :: max_lat =    90.0_r8
    real(r8) :: lat_width = 180.0_r8
 
    ! these next 2 should be allocated num_reg_x, num_reg_y
@@ -364,22 +365,32 @@
          interp_handle%ii%num_reg_x = 900
          interp_handle%ii%num_reg_y = 900
          interp_handle%ii%max_reg_list_num = 800   !>@todo  what is good val?
-!print *, 'case 1: ', interp_handle%ii%num_reg_x, interp_handle%ii%num_reg_y, &
-!                     interp_handle%ii%max_reg_list_num
+         if(debug > 10) then
+            write(string1, *) 'case 1: ', interp_handle%ii%num_reg_x, interp_handle%ii%num_reg_y, &
+                               interp_handle%ii%max_reg_list_num
+            call log_it(string1)
+         endif
 
       else if (num_lats * num_lons > 250 * 1000) then  ! ~1/2th degree
          interp_handle%ii%num_reg_x = 180
          interp_handle%ii%num_reg_y = 180
          interp_handle%ii%max_reg_list_num = 800
-!print *, 'case 2: ', interp_handle%ii%num_reg_x, interp_handle%ii%num_reg_y, &
-!                     interp_handle%ii%max_reg_list_num
+         if(debug > 10) then
+            write(string1, *) 'case 2: ', interp_handle%ii%num_reg_x, interp_handle%ii%num_reg_y, &
+                               interp_handle%ii%max_reg_list_num
+            call log_it(string1)
+         endif
 
       else
          interp_handle%ii%num_reg_x = 90
          interp_handle%ii%num_reg_y = 90
          interp_handle%ii%max_reg_list_num = 800
-!print *, 'case 3: ', interp_handle%ii%num_reg_x, interp_handle%ii%num_reg_y, &
-!                     interp_handle%ii%max_reg_list_num
+         if(debug > 10) then
+            write(string1, *) 'case 3: ', interp_handle%ii%num_reg_x, interp_handle%ii%num_reg_y, &
+                               interp_handle%ii%max_reg_list_num
+            call log_it(string1)
+         endif
+
       endif
 
       allocate(interp_handle%ii%grid_start(interp_handle%ii%num_reg_x, &
@@ -413,7 +424,10 @@
 
 end select
 
-!print *, 'calling init for ', num_lons, num_lats, grid_type
+if (debug > 2) then
+   write(string1, *) 'calling init for nlons/nlats/type = ', num_lons, num_lats, grid_type
+   call log_it(string1)
+endif
 
 end subroutine init_quad_interp
 
@@ -422,21 +436,39 @@
 subroutine print_quad_handle(interp_handle)
 type(quad_interp_handle), intent(in) :: interp_handle
 
-if (debug > 10) print *, interp_handle%nlat, interp_handle%nlon
-if (debug > 10) print *, interp_handle%grid_type
+if (debug > 10) then
+   write(string1, *) 'nlat, nlon, grid type: ', interp_handle%nlat, interp_handle%nlon, &
+                      interp_handle%grid_type
+   call log_it(string1)
+endif
 
 select case (interp_handle%grid_type)
    case(GRID_QUAD_FULLY_REGULAR)
-      print *,  interp_handle%rr%lon_start, interp_handle%rr%lon_delta, &
-                interp_handle%rr%lat_start, interp_handle%rr%lat_delta
+      call log_it('fully regular quad grid')
+      write(string1, *) 'lon start, delta, count: ', interp_handle%rr%lon_start, &
+                         interp_handle%rr%lon_delta, interp_handle%nlon
+      call log_it(string1)


More information about the Dart-dev mailing list