[Dart-dev] [3864] DART/trunk: Most pervasive change - the namelist echo will only be to the .nml

nancy at ucar.edu nancy at ucar.edu
Thu May 7 14:24:32 MDT 2009


An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/dart-dev/attachments/20090507/63949f1a/attachment-0001.html 
-------------- next part --------------
Modified: DART/trunk/assim_model/assim_model_mod.f90
===================================================================
--- DART/trunk/assim_model/assim_model_mod.f90	2009-05-06 22:19:03 UTC (rev 3863)
+++ DART/trunk/assim_model/assim_model_mod.f90	2009-05-07 20:24:31 UTC (rev 3864)
@@ -25,7 +25,7 @@
 use utilities_mod, only : get_unit, close_file, register_module, error_handler,    &
                           E_ERR, E_WARN, E_MSG, E_DBG, logfileunit, nmlfileunit,   &
                           do_output, dump_unit_attributes, find_namelist_in_file,  &
-                          check_namelist_read, nc_check, &
+                          check_namelist_read, nc_check, do_nml_file, do_nml_term, &
                           find_textfile_dims, file_to_text, timestamp, set_output
 use     model_mod, only : get_model_size, static_init_model, get_state_meta_data,  &
                           get_model_time_step, model_interpolate, init_conditions, &
@@ -86,6 +86,9 @@
 ! Permanent class storage for model_size
 integer :: model_size
 
+! Ensure init code is called exactly once
+logical :: module_initialized = .false.
+
 ! Global storage for default restart formats
 character(len = 16) :: read_format = "unformatted", write_format = "unformatted"
 
@@ -143,9 +146,12 @@
 
 integer :: iunit, io
 
+! only execute this code once, even if called multiple times.
+if (module_initialized) return
+
 ! First thing to do is echo info to logfile ... 
-
 call register_module(source, revision, revdate)
+module_initialized = .true.
 
 ! Read the namelist entry
 call find_namelist_in_file("input.nml", "assim_model_nml", iunit)
@@ -153,8 +159,8 @@
 call check_namelist_read(iunit, io, "assim_model_nml")
 
 ! Record the namelist values used for the run ... 
-if (do_output()) write(nmlfileunit, nml=assim_model_nml)
-if (do_output()) write(     *     , nml=assim_model_nml)
+if (do_nml_file()) write(nmlfileunit, nml=assim_model_nml)
+if (do_nml_term()) write(     *     , nml=assim_model_nml)
 
 ! Set the write format for restart files
 if(write_binary_restart_files) then
@@ -217,6 +223,8 @@
 
 character(len=129), allocatable, dimension(:) :: textblock
 
+if ( .not. module_initialized ) call static_init_assim_model()
+
 if(.not. byteSizesOK()) then
     call error_handler(E_ERR,'init_diag_output', &
    'Compiler does not support required kinds of variables.',source,revision,revdate) 
@@ -253,7 +261,14 @@
 ! Find dimensions of namelist file ... will save it as a variable.
 !-------------------------------------------------------------------------------
 
+! All DART programs require input.nml, so it is unlikely this can fail, but
+! still check and in this case, error out if not found.
 call find_textfile_dims("input.nml", nlines, linelen)
+if (nlines <= 0 .or. linelen <= 0) then
+   call error_handler(E_MSG,'init_diag_output', &
+                      'cannot open/read input.nml to save in diagnostic file', &
+                      source,revision,revdate)
+endif
 
 allocate(textblock(nlines))
 textblock = ''
@@ -421,6 +436,8 @@
 character(len = *), intent(out) :: global_meta_data
 integer,            intent(out) :: model_size, copies_of_field_per_time
 
+if ( .not. module_initialized ) call static_init_assim_model()
+
 init_diag_input = get_unit()
 open(unit = init_diag_input, file = file_name, action = 'read', iostat = io)
 if (io /= 0) then
@@ -763,6 +780,8 @@
 character(len=128) :: filename
 logical :: is_named
 
+if ( .not. module_initialized ) call static_init_assim_model()
+
 ! Figure out whether the file is opened FORMATTED or UNFORMATTED
 inquire(funit, FORM=open_format)
 
@@ -817,6 +836,8 @@
 integer,                intent(in)           :: funit
 type(time_type),        optional, intent(out) :: target_time
 
+if ( .not. module_initialized ) call static_init_assim_model()
+
 if(present(target_time)) then
    call aread_state_restart(assim_model%time, assim_model%state_vector, funit, target_time)
 else
@@ -843,6 +864,8 @@
 character(len = 16) :: open_format
 integer :: ios, int1, int2
 
+if ( .not. module_initialized ) call static_init_assim_model()
+
 ios = 0
 
 ! Figure out whether the file is opened FORMATTED or UNFORMATTED
@@ -898,6 +921,8 @@
 
 integer :: open_restart_write, io
 
+if ( .not. module_initialized ) call static_init_assim_model()
+
 open_restart_write = get_unit()
 if(present(override_write_format)) then
    open(unit = open_restart_write, file = file_name, form = override_write_format, &
@@ -925,6 +950,8 @@
 !!logical :: old_output_state
 type(time_type) :: temp_time
 
+if ( .not. module_initialized ) call static_init_assim_model()
+
 ! DEBUG -- if enabled, every task will print out as it opens the
 ! restart files.  If questions about missing restart files, first start
 ! by commenting in only the timestamp line.  If still concerns, then

Modified: DART/trunk/assim_tools/assim_tools_mod.f90
===================================================================
--- DART/trunk/assim_tools/assim_tools_mod.f90	2009-05-06 22:19:03 UTC (rev 3863)
+++ DART/trunk/assim_tools/assim_tools_mod.f90	2009-05-07 20:24:31 UTC (rev 3864)
@@ -16,7 +16,7 @@
 use      types_mod,       only : r8, digits12, PI
 use  utilities_mod,       only : file_exist, get_unit, check_namelist_read, do_output,    &
                                  find_namelist_in_file, register_module, error_handler,   &
-                                 E_ERR, E_MSG, nmlfileunit
+                                 E_ERR, E_MSG, nmlfileunit, do_nml_file, do_nml_term
 use       sort_mod,       only : index_sort 
 use random_seq_mod,       only : random_seq_type, random_gaussian, init_random_seq,       &
                                  random_uniform
@@ -119,8 +119,8 @@
 call check_namelist_read(iunit, io, "assim_tools_nml")
 
 ! Write the namelist values to the log file
-if (do_output()) write(nmlfileunit, nml=assim_tools_nml)
-if (do_output()) write(     *     , nml=assim_tools_nml)
+if (do_nml_file()) write(nmlfileunit, nml=assim_tools_nml)
+if (do_nml_term()) write(     *     , nml=assim_tools_nml)
 
 ! FOR NOW, can only do spread restoration with filter option 1 (need to extend this)
 if(spread_restoration .and. .not. filter_kind == 1) then

Modified: DART/trunk/cov_cutoff/cov_cutoff_mod.f90
===================================================================
--- DART/trunk/cov_cutoff/cov_cutoff_mod.f90	2009-05-06 22:19:03 UTC (rev 3863)
+++ DART/trunk/cov_cutoff/cov_cutoff_mod.f90	2009-05-07 20:24:31 UTC (rev 3864)
@@ -12,8 +12,9 @@
 ! $Date$
 
 use     types_mod, only : r8
-use utilities_mod, only : register_module, error_handler, E_ERR, E_MSG, do_output, &
-                          nmlfileunit, find_namelist_in_file, check_namelist_read
+use utilities_mod, only : register_module, error_handler, E_ERR, E_MSG, &
+                          do_output, do_nml_file, do_nml_term, nmlfileunit, &
+                          find_namelist_in_file, check_namelist_read
 use location_mod,  only : location_type
 
 implicit none
@@ -95,8 +96,8 @@
    read(iunit, nml = cov_cutoff_nml, iostat = io)
    call check_namelist_read(iunit, io, "cov_cutoff_nml")
 
-   if (do_output()) write(nmlfileunit,nml=cov_cutoff_nml)
-   if (do_output()) write(     *     ,nml=cov_cutoff_nml)
+   if (do_nml_file()) write(nmlfileunit,nml=cov_cutoff_nml)
+   if (do_nml_term()) write(     *     ,nml=cov_cutoff_nml)
 
 endif
 !---------------------------------------------------------

Modified: DART/trunk/diagnostics/oned/obs_diag.f90
===================================================================
--- DART/trunk/diagnostics/oned/obs_diag.f90	2009-05-06 22:19:03 UTC (rev 3863)
+++ DART/trunk/diagnostics/oned/obs_diag.f90	2009-05-07 20:24:31 UTC (rev 3864)
@@ -35,9 +35,10 @@
                              operator(>), operator(<), operator(/), &
                              operator(/=)
 use    utilities_mod, only : get_unit, open_file, close_file, register_module, &
-                             file_exist, error_handler, E_ERR, E_MSG, timestamp, &
-                             initialize_utilities, logfileunit, nmlfileunit, &
-                             find_namelist_in_file, check_namelist_read, do_output
+                             file_exist, error_handler, E_ERR, E_MSG,          &
+                             initialize_utilities, logfileunit, nmlfileunit,   &
+                             find_namelist_in_file, check_namelist_read,       &
+                             do_output, do_nml_file, do_nml_term, timestamp
 
 implicit none
 
@@ -210,10 +211,8 @@
 call check_namelist_read(iunit, io, "obs_diag_nml")
 
 ! Record the namelist values used for the run ...
-if (do_output()) then
-write(nmlfileunit, nml=obs_diag_nml)
-write(     *     , nml=obs_diag_nml)
-endif
+if (do_nml_file()) write(nmlfileunit, nml=obs_diag_nml)
+if (do_nml_term()) write(     *     , nml=obs_diag_nml)
 
 !----------------------------------------------------------------------
 ! Now that we have input, do some checking and setup

Modified: DART/trunk/diagnostics/threed_sphere/obs_diag.f90
===================================================================
--- DART/trunk/diagnostics/threed_sphere/obs_diag.f90	2009-05-06 22:19:03 UTC (rev 3863)
+++ DART/trunk/diagnostics/threed_sphere/obs_diag.f90	2009-05-07 20:24:31 UTC (rev 3864)
@@ -52,10 +52,10 @@
                              operator(/=), operator(<=)
 use    utilities_mod, only : open_file, close_file, register_module, &
                              file_exist, error_handler, E_ERR, E_WARN, E_MSG, &
-                             initialize_utilities, logfileunit, nmlfileunit, timestamp, &
-                             find_namelist_in_file, check_namelist_read, nc_check, &
+                             initialize_utilities, logfileunit, nmlfileunit,  &
+                             find_namelist_in_file, check_namelist_read,      &
+                             nc_check, do_nml_file, do_nml_term, timestamp,   &
                              next_file, find_textfile_dims, file_to_text
-
 use         sort_mod, only : sort
 
 use typeSizes
@@ -316,8 +316,8 @@
 call check_namelist_read(iunit, io, 'obs_diag_nml')
 
 ! Record the namelist values used for the run ...
-write(nmlfileunit, nml=obs_diag_nml)
-write(    *      , nml=obs_diag_nml)
+if (do_nml_file()) write(nmlfileunit, nml=obs_diag_nml)
+if (do_nml_term()) write(    *      , nml=obs_diag_nml)
 
 !----------------------------------------------------------------------
 ! Now that we have input, do some checking and setup

Modified: DART/trunk/ensemble_manager/ensemble_manager_mod.f90
===================================================================
--- DART/trunk/ensemble_manager/ensemble_manager_mod.f90	2009-05-06 22:19:03 UTC (rev 3863)
+++ DART/trunk/ensemble_manager/ensemble_manager_mod.f90	2009-05-07 20:24:31 UTC (rev 3864)
@@ -20,12 +20,13 @@
 ! appropriately abstracted at a higher level of code.
 
 use types_mod,         only : r8, MISSING_R8
-use utilities_mod,     only : register_module, &
+use utilities_mod,     only : register_module, do_nml_file, do_nml_term, &
                               error_handler, E_ERR, E_MSG, do_output, &
-                              nmlfileunit, find_namelist_in_file, check_namelist_read
-use assim_model_mod,   only : aread_state_restart, awrite_state_restart, open_restart_read, &
-                              open_restart_write, close_restart, &
-                              pert_model_state
+                              nmlfileunit, find_namelist_in_file,        &
+                              check_namelist_read
+use assim_model_mod,   only : aread_state_restart, awrite_state_restart, &
+                              open_restart_read, open_restart_write,     &
+                              close_restart, pert_model_state
 use time_manager_mod,  only : time_type, set_time
 use random_seq_mod,    only : random_seq_type, init_random_seq, random_gaussian
 use mpi_utilities_mod, only : task_count, my_task_id, send_to, receive_from
@@ -74,7 +75,7 @@
 ! Module storage for writing error messages
 character(len = 129) :: errstring
 
-! Module storage for pe information for this process aviods recomputation
+! Module storage for pe information for this process avoids recomputation
 integer              :: my_pe, num_pes
 
 !-----------------------------------------------------------------
@@ -90,7 +91,8 @@
 ! Size of perturbations for creating ensembles when model won't do it
 real(r8) :: perturbation_amplitude  = 0.2_r8
 
-namelist / ensemble_manager_nml / single_restart_file_in, single_restart_file_out, &
+namelist / ensemble_manager_nml / single_restart_file_in,  &
+                                  single_restart_file_out, &
                                   perturbation_amplitude
 
 !-----------------------------------------------------------------
@@ -129,8 +131,8 @@
    read(iunit, nml = ensemble_manager_nml, iostat = io)
    call check_namelist_read(iunit, io, "ensemble_manager_nml")
 
-   if (do_output()) write(nmlfileunit, nml=ensemble_manager_nml)
-   if (do_output()) write(     *     , nml=ensemble_manager_nml)
+   if (do_nml_file()) write(nmlfileunit, nml=ensemble_manager_nml)
+   if (do_nml_term()) write(     *     , nml=ensemble_manager_nml)
 
    ! Get mpi information for this process; it's stored in module storage
    num_pes = task_count()
@@ -164,6 +166,7 @@
 ! where other copies like mean, inflation, etc., are stored.
 
 ! Would like to avoid num_vars size storage
+! LARGE ARRAY ON STACK -- make this a pointer and allocate it from heap?
 real(r8)                            :: ens(ens_handle%num_vars)
 integer                             :: iunit, i, j
 character(len = LEN(file_name) + 5) :: this_file_name
@@ -275,6 +278,7 @@
 logical, optional,    intent(in)    :: force_single_file
 
 ! Large temporary storage to be avoided if possible
+! LARGE ARRAY ON STACK -- make this a pointer and allocate it from heap?
 real(r8)                            :: ens(ens_handle%num_vars)
 type(time_type)                     :: ens_time
 integer                             :: iunit, i, global_index

Modified: DART/trunk/filter/filter.dopplerfold.f90
===================================================================
--- DART/trunk/filter/filter.dopplerfold.f90	2009-05-06 22:19:03 UTC (rev 3863)
+++ DART/trunk/filter/filter.dopplerfold.f90	2009-05-07 20:24:31 UTC (rev 3864)
@@ -29,7 +29,7 @@
 use utilities_mod,        only : register_module,  error_handler, E_ERR, E_MSG, E_DBG,       &
                                  initialize_utilities, logfileunit, nmlfileunit, timestamp,  &
                                  do_output, find_namelist_in_file, check_namelist_read,      &
-                                 open_file, close_file
+                                 open_file, close_file, do_nml_file, do_nml_term
 use assim_model_mod,      only : static_init_assim_model, get_model_size,                    &
                                  netcdf_file_type, init_diag_output, finalize_diag_output,   & 
                                  aoutput_diagnostics, ens_mean_for_model
@@ -197,8 +197,8 @@
 call check_namelist_read(iunit, io, "filter_nml")
 
 ! Record the namelist values used for the run ...
-if (do_output()) write(nmlfileunit, nml=filter_nml)
-if (do_output()) write(     *     , nml=filter_nml)
+if (do_nml_file()) write(nmlfileunit, nml=filter_nml)
+if (do_nml_term()) write(     *     , nml=filter_nml)
 
 call set_trace(trace_execution, output_timestamps)
 

Modified: DART/trunk/filter/filter.f90
===================================================================
--- DART/trunk/filter/filter.f90	2009-05-06 22:19:03 UTC (rev 3863)
+++ DART/trunk/filter/filter.f90	2009-05-07 20:24:31 UTC (rev 3864)
@@ -29,7 +29,7 @@
 use utilities_mod,        only : register_module,  error_handler, E_ERR, E_MSG, E_DBG,       &
                                  initialize_utilities, logfileunit, nmlfileunit, timestamp,  &
                                  do_output, find_namelist_in_file, check_namelist_read,      &
-                                 open_file, close_file
+                                 open_file, close_file, do_nml_file, do_nml_term
 use assim_model_mod,      only : static_init_assim_model, get_model_size,                    &
                                  netcdf_file_type, init_diag_output, finalize_diag_output,   & 
                                  aoutput_diagnostics, ens_mean_for_model
@@ -193,8 +193,8 @@
 call check_namelist_read(iunit, io, "filter_nml")
 
 ! Record the namelist values used for the run ...
-if (do_output()) write(nmlfileunit, nml=filter_nml)
-if (do_output()) write(     *     , nml=filter_nml)
+if (do_nml_file()) write(nmlfileunit, nml=filter_nml)
+if (do_nml_term()) write(     *     , nml=filter_nml)
 
 call set_trace(trace_execution, output_timestamps)
 
@@ -360,8 +360,6 @@
    call error_handler(E_MSG,'', ' ')
    call error_handler(E_MSG,'filter:', msgstring)
 
-   !call trace_message(msgstring)
-   !if(my_task_id() == 0) write(*, *) 'Starting advance time loop'
 
    ! Check the time before doing the first model advance.  Not all tasks
    ! might have a time, so only check on PE0 if running multitask.

Modified: DART/trunk/location/threed_sphere/location_mod.f90
===================================================================
--- DART/trunk/location/threed_sphere/location_mod.f90	2009-05-06 22:19:03 UTC (rev 3863)
+++ DART/trunk/location/threed_sphere/location_mod.f90	2009-05-07 20:24:31 UTC (rev 3864)
@@ -25,22 +25,23 @@
 ! of vertical discretization as required for Bgrid surface pressure.
 
 use      types_mod, only : r8, PI, RAD2DEG, DEG2RAD, MISSING_R8, MISSING_I
-use  utilities_mod, only : register_module, error_handler, E_ERR, E_MSG, &
+use  utilities_mod, only : register_module, error_handler, E_ERR, E_MSG,    &
                            logfileunit, nmlfileunit, find_namelist_in_file, &
-                           check_namelist_read, do_output, is_longitude_between
+                           check_namelist_read, do_output, do_nml_file,     &
+                           do_nml_term, is_longitude_between
 use random_seq_mod, only : random_seq_type, init_random_seq, random_uniform
 
 implicit none
 private
 
-public :: location_type, get_location, set_location, &
-          set_location2, set_location_missing, is_location_in_region, &
+public :: location_type, get_location, set_location,                          &
+          set_location2, set_location_missing, is_location_in_region,         &
           write_location, read_location, interactive_location, vert_is_undef, &
-          vert_is_surface, vert_is_pressure, vert_is_level, vert_is_height, &
-          query_location, LocationDims, LocationName, LocationLName, &
-          horiz_dist_only, get_close_obs, get_close_type, &
-          get_close_maxdist_init, get_close_obs_init, get_close_obs_destroy, &
-          operator(==), operator(/=), VERTISUNDEF, VERTISSURFACE, &
+          vert_is_surface, vert_is_pressure, vert_is_level, vert_is_height,   &
+          query_location, LocationDims, LocationName, LocationLName,          &
+          horiz_dist_only, get_close_obs, get_close_type,                     &
+          get_close_maxdist_init, get_close_obs_init, get_close_obs_destroy,  &
+          operator(==), operator(/=), VERTISUNDEF, VERTISSURFACE,             &
           VERTISLEVEL, VERTISPRESSURE, VERTISHEIGHT, get_dist,                &
           print_get_close_type
 
@@ -158,8 +159,8 @@
 
 ! Write the namelist values to the log file
 
-if(do_output()) write(nmlfileunit, nml=location_nml)
-if(do_output()) write(     *     , nml=location_nml)
+if(do_nml_file()) write(nmlfileunit, nml=location_nml)
+if(do_nml_term()) write(     *     , nml=location_nml)
 
 ! Make sure that the number of longitudes, nlon, for get_close_obs is odd
 if(nlon / 2 * 2 == nlon) then
@@ -1715,7 +1716,6 @@
 !if ((minl%which_vert .ne. VERTISUNDEF) .and. 
 !    (loc%vloc < minl%vloc) .or. (loc%vloc > maxl%vloc)) return
 
-
 is_location_in_region = .true.
 
 end function is_location_in_region

Modified: DART/trunk/models/9var/model_mod.f90
===================================================================
--- DART/trunk/models/9var/model_mod.f90	2009-05-06 22:19:03 UTC (rev 3863)
+++ DART/trunk/models/9var/model_mod.f90	2009-05-07 20:24:31 UTC (rev 3864)
@@ -17,7 +17,8 @@
                              get_close_maxdist_init, get_close_obs_init, get_close_obs
 
 use    utilities_mod, only : register_module, error_handler, E_ERR, E_MSG, do_output, &
-                             nmlfileunit, find_namelist_in_file, check_namelist_read
+                             nmlfileunit, find_namelist_in_file, check_namelist_read, &
+                             do_nml_file, do_nml_term
 
 ! All random_seq_mod calls were suppressed because a) they are not being used,
 ! and b) they make the pg5.02 compiler complain about a gap in the common block.
@@ -115,8 +116,8 @@
 call check_namelist_read(iunit, io, "model_nml")
 
 ! Record the namelist values used for the run ...
-if (do_output()) write(nmlfileunit, nml=model_nml)
-if (do_output()) write(     *     , nml=model_nml)
+if (do_nml_file()) write(nmlfileunit, nml=model_nml)
+if (do_nml_term()) write(     *     , nml=model_nml)
 
 ! Define the locations of the model state variables
 do i = 1, model_size

Modified: DART/trunk/models/9var/work/input.nml
===================================================================
--- DART/trunk/models/9var/work/input.nml	2009-05-06 22:19:03 UTC (rev 3863)
+++ DART/trunk/models/9var/work/input.nml	2009-05-07 20:24:31 UTC (rev 3864)
@@ -40,6 +40,7 @@
    output_forward_op_errors = .false.,
    output_timestamps        = .false.,
    output_inflation         = .true.,
+   trace_execution          = .false.,
 
    inf_flavor                  = 0,                       0,
    inf_initial_from_restart    = .false.,                 .false.,
@@ -104,9 +105,10 @@
 
 &utilities_nml
    TERMLEVEL = 1,
-   module_details = .true.,
+   module_details = .false.,
    logfilename = 'dart_log.out',
-   nmlfilename = 'dart_log.nml'  /
+   nmlfilename = 'dart_log.nml',
+   write_nml   = 'file'  /
 
 &preprocess_nml
     input_obs_def_mod_file = '../../../obs_def/DEFAULT_obs_def_mod.F90', 

Modified: DART/trunk/models/9var/work/quickbuild.csh
===================================================================
--- DART/trunk/models/9var/work/quickbuild.csh	2009-05-06 22:19:03 UTC (rev 3863)
+++ DART/trunk/models/9var/work/quickbuild.csh	2009-05-07 20:24:31 UTC (rev 3864)
@@ -51,7 +51,7 @@
 # so this MUST be run first.
 #----------------------------------------------------------------------
 
-\rm -f preprocess *.o *.mod
+\rm -f preprocess *.o *.mod 
 \rm -f ../../../obs_def/obs_def_mod.f90
 \rm -f ../../../obs_kind/obs_kind_mod.f90
 
@@ -92,6 +92,8 @@
    endsw
 end
 
+\rm -f *.o *.mod input.nml*_default
+
 if ( $#argv == 1 && "$1" == "-mpi" ) then
   echo "Success: All single task DART programs compiled."  
   echo "Script now compiling MPI parallel versions of the DART programs."
@@ -116,7 +118,7 @@
 # with MPI all the time, remove or comment out the entire section above.
 #----------------------------------------------------------------------
 
-\rm -f *.o *.mod filter wakeup_filter
+\rm -f filter wakeup_filter
 
 @ n = $n + 1
 echo
@@ -140,7 +142,7 @@
 csh  mkmf_wakeup_filter -mpi
 make || exit $n
 
-\rm -f *.o *.mod
+\rm -f *.o *.mod input.nml*_default
 
 echo
 echo 'time to run filter here:'

Modified: DART/trunk/models/MITgcm_annulus/model_mod.f90
===================================================================
--- DART/trunk/models/MITgcm_annulus/model_mod.f90	2009-05-06 22:19:03 UTC (rev 3863)
+++ DART/trunk/models/MITgcm_annulus/model_mod.f90	2009-05-07 20:24:31 UTC (rev 3864)
@@ -19,7 +19,8 @@
                              get_close_maxdist_init, get_close_obs_init, get_close_obs
 
 use    utilities_mod, only : register_module, error_handler, E_ERR, E_MSG, do_output, &
-                             nmlfileunit, find_namelist_in_file, check_namelist_read
+                             nmlfileunit, find_namelist_in_file, check_namelist_read, &
+                             do_nml_file, do_nml_term
 
 use     obs_kind_mod, only : KIND_U_WIND_COMPONENT, &
                              KIND_V_WIND_COMPONENT, &
@@ -60,31 +61,31 @@
 !---------------------------------------------------------------
 ! Namelist with default values
 !
-! model_size 		length of the data assimilation control
-!			  vector, and is = naz*nrad*nzed*ntype
-! naz			number of gridpoints in the azimuthal direction
-! nrad			number of gridpoints in the radial direction
-! nzed			number of gridpoints in the z direction
-! ntype			number of variables at each grid point that
-!			  are impacted by the data assimilation
-! daz			the gridpoint increment in the azimuthal
-!			  direction (degrees)
-! drad			the gridpoint increment in the radial
-!			  direction (meters)
-! dzed			the gridpoint increment in the z 
-!			  direction (meters)
-! inner_rad		the radius of the inner cylinder of the
-!			  annulus (meters)
-! outer_rad		the radius of the outer cylinder of the
-!		 	  annulus (meters)
-! depth			the overall depth of the fluid (meters)
-! delta_t		the model integration time step (in seconds)
-! time_step_days	the number of days in an integration time step
-! time_step_seconds	the number of seconds in an integration time step.
-!			this is not real time, this is time scales by the
-!			tank's rotation rate.  f=0.5 mean a "day" is 4sec.
-!			equate 4sec to 86400sec and determine the dart
-!			time step
+! model_size             length of the data assimilation control
+!                          vector, and is = naz*nrad*nzed*ntype
+! naz                    number of gridpoints in the azimuthal direction
+! nrad                   number of gridpoints in the radial direction
+! nzed                   number of gridpoints in the z direction
+! ntype                  number of variables at each grid point that
+!                          are impacted by the data assimilation
+! daz                    the gridpoint increment in the azimuthal
+!                          direction (degrees)
+! drad                   the gridpoint increment in the radial
+!                          direction (meters)
+! dzed                   the gridpoint increment in the z 
+!                          direction (meters)
+! inner_rad              the radius of the inner cylinder of the
+!                          annulus (meters)
+! outer_rad              the radius of the outer cylinder of the
+!                           annulus (meters)
+! depth                  the overall depth of the fluid (meters)
+! delta_t                the model integration time step (in seconds)
+! time_step_days         the number of days in an integration time step
+! time_step_seconds      the number of seconds in an integration time step.
+!                        this is not real time, this is time scales by the
+!                        tank's rotation rate.  f=0.5 mean a "day" is 4sec.
+!                        equate 4sec to 86400sec and determine the dart
+!                        time step
 
 integer  :: model_size        = 539400
 integer  :: naz               = 120 
@@ -174,8 +175,8 @@
 call check_namelist_read(iunit, io, "model_nml")
 
 ! Record the namelist to the logfile
-if (do_output()) write(nmlfileunit, nml=model_nml)
-if (do_output()) write(     *     , nml=model_nml)
+if (do_nml_file()) write(nmlfileunit, nml=model_nml)
+if (do_nml_term()) write(     *     , nml=model_nml)
 
 ! Create space for the model prognostic variables
 allocate(var%vars_3d(naz, nrad, nzed, ntype))

Modified: DART/trunk/models/MITgcm_annulus/work/input.nml
===================================================================
--- DART/trunk/models/MITgcm_annulus/work/input.nml	2009-05-06 22:19:03 UTC (rev 3863)
+++ DART/trunk/models/MITgcm_annulus/work/input.nml	2009-05-07 20:24:31 UTC (rev 3864)
@@ -40,6 +40,7 @@
    output_forward_op_errors = .false.,
    output_timestamps        = .false.,
    output_inflation         = .true.,
+   trace_execution          = .false.,
 
    inf_flavor                  = 0,                       0,
    inf_initial_from_restart    = .false.,                 .false.,
@@ -111,9 +112,10 @@
 
 &utilities_nml
    TERMLEVEL = 1,
-   module_details = .true.,
+   module_details = .false.,
    logfilename = 'dart_log.out',
-   nmlfilename = 'dart_log.nml'  /
+   nmlfilename = 'dart_log.nml',
+   write_nml   = 'file'  /
 
 &reg_factor_nml
    select_regression    = 1,

Modified: DART/trunk/models/MITgcm_annulus/work/quickbuild.csh
===================================================================
--- DART/trunk/models/MITgcm_annulus/work/quickbuild.csh	2009-05-06 22:19:03 UTC (rev 3863)
+++ DART/trunk/models/MITgcm_annulus/work/quickbuild.csh	2009-05-07 20:24:31 UTC (rev 3864)
@@ -92,6 +92,8 @@
    endsw
 end
 
+\rm -f *.o *.mod input.nml*_default
+
 if ( $#argv == 1 && "$1" == "-mpi" ) then
   echo "Success: All single task DART programs compiled."  
   echo "Script now compiling MPI parallel versions of the DART programs."
@@ -116,7 +118,7 @@
 # with MPI all the time, remove or comment out the entire section above.
 #----------------------------------------------------------------------
 
-\rm -f *.o *.mod filter wakeup_filter
+\rm -f filter wakeup_filter
 
 @ n = $n + 1
 echo
@@ -140,7 +142,7 @@
 csh  mkmf_wakeup_filter -mpi
 make || exit $n
 
-\rm -f *.o *.mod
+\rm -f *.o *.mod input.nml*_default
 
 echo
 echo 'time to run filter here:'

Modified: DART/trunk/models/PBL_1d/model_mod.f90
===================================================================
--- DART/trunk/models/PBL_1d/model_mod.f90	2009-05-06 22:19:03 UTC (rev 3863)
+++ DART/trunk/models/PBL_1d/model_mod.f90	2009-05-07 20:24:31 UTC (rev 3864)
@@ -27,7 +27,8 @@
 
 use    utilities_mod, only : file_exist, open_file, close_file, &
                              find_namelist_in_file, check_namelist_read, &
-                             register_module, error_handler, E_ERR, E_MSG, logfileunit
+                             register_module, error_handler, E_ERR, E_MSG, &
+                             nmlfileunit, do_nml_file, do_nml_term
 use         sort_mod, only : sort   
 use   random_seq_mod, only : random_seq_type, random_gaussian, &
                              init_random_seq, random_uniform
@@ -355,13 +356,13 @@
 
 ! Record the namelist values used for the run ...
 call error_handler(E_MSG,'static_init_model','model_nml values are',' ',' ',' ')
-write(logfileunit, nml=model_nml)
-write(     *     , nml=model_nml)
+if (do_nml_file()) write(nmlfileunit, nml=model_nml)
+if (do_nml_term()) write(     *     , nml=model_nml)
 
 ! Begin by reading the namelist input
 if(file_exist('wrf1d_namelist.input')) then
    unit_nml = open_file(fname = 'wrf1d_namelist.input', action = 'read')
-   call do_namelist_wrf1d(unit_nml,logfileunit)
+   call do_namelist_wrf1d(unit_nml,nmlfileunit)
    close(unit_nml)
 endif
 

Modified: DART/trunk/models/PBL_1d/work/input.nml
===================================================================
--- DART/trunk/models/PBL_1d/work/input.nml	2009-05-06 22:19:03 UTC (rev 3863)
+++ DART/trunk/models/PBL_1d/work/input.nml	2009-05-07 20:24:31 UTC (rev 3864)
@@ -40,6 +40,7 @@
    output_forward_op_errors = .false.,
    output_timestamps        = .false.,
    output_inflation         = .true.,
+   trace_execution          = .false.,
 
    inf_flavor                  = 0,                       0,
    inf_initial_from_restart    = .false.,                 .false.,
@@ -130,9 +131,10 @@
 
 &utilities_nml
    TERMLEVEL = 1,
-   module_details = .true.,
+   module_details = .false.,
    logfilename = 'dart_log.out',
-   nmlfilename = 'dart_log.nml'  /
+   nmlfilename = 'dart_log.nml',
+   write_nml   = 'file'  /
 
 &preprocess_nml
     input_obs_def_mod_file = '../../../obs_def/DEFAULT_obs_def_mod.F90', 

Modified: DART/trunk/models/PBL_1d/work/quickbuild.csh
===================================================================
--- DART/trunk/models/PBL_1d/work/quickbuild.csh	2009-05-06 22:19:03 UTC (rev 3863)
+++ DART/trunk/models/PBL_1d/work/quickbuild.csh	2009-05-07 20:24:31 UTC (rev 3864)
@@ -117,6 +117,8 @@
    endsw
 end
 
+\rm -f *.o *.mod input.nml*_default
+
 if ( $#argv == 1 && "$1" == "-mpi" ) then
   echo "Success: All single task DART programs compiled."  
   echo "Script now compiling MPI parallel versions of the DART programs."
@@ -141,7 +143,7 @@
 # with MPI all the time, remove or comment out the entire section above.
 #----------------------------------------------------------------------
 
-\rm -f *.o *.mod filter wakeup_filter
+\rm -f filter wakeup_filter
 
 @ n = $n + 1
 echo
@@ -165,7 +167,7 @@
 csh  mkmf_wakeup_filter -mpi
 make || exit $n
 
-\rm -f *.o *.mod
+\rm -f *.o *.mod input.nml*_default
 
 echo
 echo 'time to run filter here:'

Modified: DART/trunk/models/am2/model_mod.f90
===================================================================
--- DART/trunk/models/am2/model_mod.f90	2009-05-06 22:19:03 UTC (rev 3863)
+++ DART/trunk/models/am2/model_mod.f90	2009-05-07 20:24:31 UTC (rev 3864)
@@ -4,13 +4,13 @@
 ! Licensed under the GPL -- www.gpl.org/licenses/gpl.html
 
 module model_mod
-  
+
   ! <next few lines under version control, do not edit>
   ! $URL$
   ! $Id$
   ! $Revision$
   ! $Date$
-  
+
   !----------------------------------------------------------------------
   ! purpose: interface between AM2 and DART
   !              Translate to/from state_vector and restart file(s)
@@ -19,29 +19,29 @@
   !              Generate expected obs from model state (model_interpolate)
   !              Find state variables (or obs) that are close to a given base observation.
   !                  (get_close_obs)
-  ! author: Robert Pincus, CIRES/NOAA ESRL PSD1 
+  ! author: Robert Pincus, CIRES/NOAA ESRL PSD1
   !==============================================================================================
   use netcdf
-  use types_mod,         only : r8
+  use types_mod,         only : r8, MISSING_R8
   use time_manager_mod,  only : time_type, set_time, print_time, set_calendar_type, GREGORIAN
   use utilities_mod,     only : open_file, close_file, find_namelist_in_file, check_namelist_read, &
                                 register_module, error_handler, file_exist, E_ERR, E_WARN, E_MSG,  &
-                                nmlfileunit, do_output, nc_check
+                                nmlfileunit, do_output, nc_check, do_nml_file, do_nml_term
   use mpi_utilities_mod, only : my_task_id, task_count
-  use location_mod,      only : location_type,      get_close_maxdist_init, &
+  use location_mod,      only : location_type,      get_close_maxdist_init,      &
                                 get_close_obs_init, get_close_obs, set_location, &
-                                get_location, vert_is_level, vert_is_pressure
+                                get_location, vert_is_level, vert_is_pressure, vert_is_height
   use obs_kind_mod,      only : KIND_U_WIND_COMPONENT, KIND_V_WIND_COMPONENT,  &
                                 KIND_SURFACE_PRESSURE, KIND_TEMPERATURE,       &
-                                KIND_SPECIFIC_HUMIDITY,                        &
+                                KIND_SPECIFIC_HUMIDITY, KIND_PRESSURE,         &
                                 KIND_CLOUD_LIQUID_WATER, KIND_CLOUD_ICE,       &
+                                get_obs_kind_index, get_obs_kind_var_type
                                 ! We'll need to add a kind_cloud_fraction to correspond to AM2 prog var
-                                get_obs_kind_index, get_obs_kind_var_type
-  use location_mod,      only: VERTISSURFACE, VERTISLEVEL
+  use location_mod,      only:  VERTISSURFACE, VERTISLEVEL
 
   implicit none
   private
-  
+
   !
   ! Standard DART interface
   !
@@ -75,42 +75,42 @@
   !
   ! Global declarations
   !
-  
+
   type model_type
     !
-    ! "Prognostic variables" 
+    ! "Prognostic variables"
     !   Surface pressure may be computed from pressure thickness (delp) on the fly
     !
     real, pointer, dimension(:, :)       :: ps => null()
     real, pointer, dimension(:, :, :)    :: u => null(), v => null(), T => null(), delp => null()
-    ! Tracers; could generalize to 2D and 3D collections 
+    ! Tracers; could generalize to 2D and 3D collections
     real, pointer, dimension(:, :, :, :) :: tracers => null()
     real, pointer, dimension(:)          :: tracerTypes  => null() ! Dart obs type associated with each tracer
   end type model_type
-  
+
   !----------------------------------------------------------------------
   ! Namelist variables with default values follow
-  
+
   !----------------------------------------------------------------------
   integer, parameter :: maxnum_tracers = 10
   character(len = nf90_max_name), dimension(maxnum_tracers) :: &
-    tracer_names = '', tracer_files = '', tracer_obs_kind_names = "", tracer_config_files = '' 
+    tracer_names = '', tracer_files = '', tracer_obs_kind_names = "", tracer_config_files = ''
   integer, dimension(maxnum_tracers) :: tracer_obs_kinds = -1
-  
+
   ! output_state_vector = .true.     results in a "state-vector" netCDF file
   ! output_state_vector = .false.    results in a "prognostic-var" netCDF file
   logical :: output_state_vector = .false.
-  
+
   ! File where basic info about model configuration can be found
   character(len = nf90_max_name) :: model_config_file  = 'fv_rst.res.nc', &
                                     model_restart_file = 'fv_rst.res.nc'
-  
+
   ! Define location restrictions on which observations are assimilated
   ! (values are calculated anyway, but istatus is set to 2)
   real(r8) :: max_obs_lat_degree        = 90.0_r8
   real(r8) :: highest_obs_pressure_mb   = 150.0_r8
   real(r8) :: highest_state_pressure_mb = 150.0_r8
-  
+
   ! Specify shortest time step that the model will support
   ! This may be limited below by the model itself
   integer :: Time_step_seconds = 21600, Time_step_days = 0
@@ -120,25 +120,26 @@
     tracer_obs_kind_names, output_state_vector,                             &
     model_config_file, model_restart_file,                                  &
     highest_obs_pressure_mb, highest_state_pressure_mb, max_obs_lat_degree, &
-    Time_step_seconds, Time_step_days 
+    Time_step_seconds, Time_step_days
   !----------------------------------------------------------------------
   !
   ! Useful global storage
   !
-  
+
   type(time_type) :: Time_step_atmos
   !
   ! Model top pressure is used for converting pressure thickness delp to surface pressure
-  !   It should ideally be availible in phalf but the restart files I have don't have 
-  !   valid values in that dimension variable. 
-  !   The dimension variables have units of mb but delp has units of Pa. 
+  !   It should ideally be availible in phalf but the restart files I have don't have
+  !   valid values in that dimension variable.
+  !   The dimension variables have units of mb but delp has units of Pa.
   !
   real(kind = r8), parameter :: mb_to_pa = 100., model_top_pressure = 1. * mb_to_pa
-  
+  real(kind = r8), parameter :: gravity = 9.81, Rdgas = 287. ! MKS units
+
   integer :: num_tracers, num_lats, num_lons, num_levels, model_size
-  
+
   !
-  ! We assume here that all 2D prognostic variables are functions of lat, lon 
+  ! We assume here that all 2D prognostic variables are functions of lat, lon
   !
   integer, parameter :: num_3d_prog_vars = 3, num_2d_prog_vars = 1
   character(len = 1), dimension(num_3d_prog_vars), parameter :: &
@@ -149,9 +150,9 @@
          kinds_3d_prog_vars = (/ KIND_U_WIND_COMPONENT, KIND_V_WIND_COMPONENT, KIND_TEMPERATURE /)
   integer, dimension(num_2d_prog_vars),            parameter ::  &
          kinds_2d_prog_vars = (/ KIND_SURFACE_PRESSURE /)
-   
+
   !
-  ! Information related to dimensions (coordinates) 
+  ! Information related to dimensions (coordinates)
   !
   integer, parameter :: num_dims = 6
   character(len = 5), dimension(num_dims), parameter :: &
@@ -161,9 +162,9 @@
   !
   integer, dimension(num_dims) :: dim_lens, dim_var_ids
   real, allocatable, dimension(:) :: lat, latu, lon, lonv, pfull, phalf
-  
+
   !
-  ! Surface geopotential and ak, bk terms, read from model_config_file, 
+  ! Surface geopotential and ak, bk terms, read from model_config_file,
   !   used for pressure computations
   !
   real, dimension(:, :), allocatable :: surface_geopotential
@@ -187,25 +188,25 @@
 
   subroutine static_init_model()
     !
-    ! Initializes class data for  model 
+    ! Initializes class data for  model
     !
-    
+
     ! Local variables
     !
     integer :: iunit, io, ens_member, num_tasks, my_task
     integer :: ncfileid, ncvarid, i, index

@@ Diff output truncated at 40000 characters. @@


More information about the Dart-dev mailing list