[Dart-dev] DART/branches Revision: 12592

dart at ucar.edu dart at ucar.edu
Tue May 22 15:42:29 MDT 2018


nancy at ucar.edu
2018-05-22 15:42:29 -0600 (Tue, 22 May 2018)
169
fix the indexing in the perturb routine.

also be more quiet about creating variables in the
diagnostic files; this prints out once for every
file which could be 100s.




Modified: DART/branches/recam/models/cam-fv/model_mod.f90
===================================================================
--- DART/branches/recam/models/cam-fv/model_mod.f90	2018-05-21 20:49:26 UTC (rev 12591)
+++ DART/branches/recam/models/cam-fv/model_mod.f90	2018-05-22 21:42:29 UTC (rev 12592)
@@ -1952,11 +1952,8 @@
 cam_date = iyear*10000 + imonth*100 + iday
 cam_tod  = ihour*3600  + iminute*60 + isecond
 
-! if the file doesn't already have a "date" variable, so we make one
+! if the file doesn't already have a "date" variable make one
 if (.not. nc_variable_exists(ncid, "date")) then
-   call error_handler(E_MSG, routine,'"date" variable not found in file, creating one', &
-                      source, revision, revdate)
-
    call nc_begin_define_mode(ncid, routine)
    call nc_define_integer_variable(ncid, 'date', (/ 'time' /), routine)
    call nc_end_define_mode(ncid, routine)
@@ -1963,12 +1960,8 @@
    call nc_put_variable(ncid, 'date', cam_date, routine)
 endif
 
-! if the file doesn't already have a "datesec" variable, so we make one
+! if the file doesn't already have a "datesec" variable make one
 if (.not. nc_variable_exists(ncid, "datesec")) then
-
-   call error_handler(E_MSG, routine,'"datesec" variable not found in file, creating one', &
-                      source, revision, revdate)
-
    call nc_begin_define_mode(ncid, routine)
    call nc_define_integer_variable(ncid, 'datesec', (/ 'time' /), routine)
    call nc_end_define_mode(ncid, routine)
@@ -2082,7 +2075,7 @@
 call init_random_seq(seq, my_task_id())
 
 max_qtys = get_num_quantities()
-allocate(do_these_qtys(max_qtys), perturb_by(max_qtys))
+allocate(do_these_qtys(0:max_qtys), perturb_by(0:max_qtys))
 
 do_these_qtys(:) = .false.
 perturb_by(:)    = 0.0_r8
@@ -2097,8 +2090,8 @@
       call error_handler(E_ERR,routine,string1,source,revision,revdate)
    endif
 
-   do_these_qtys(i) = .true.
-   perturb_by(i)    = perturbation_amplitude(i)
+   do_these_qtys(myqty) = .true.
+   perturb_by(myqty)    = perturbation_amplitude(i)
 enddo
 
 ! get the global index numbers of the part of the state that 
@@ -2115,7 +2108,7 @@
    if (.not. do_these_qtys(myqty)) cycle
   
    do j=1, ens_size
-      state_ens_handle%copies(j, i) = random_gaussian(seq, state_ens_handle%copies(j, i), perturb_by(i))
+      state_ens_handle%copies(j, i) = random_gaussian(seq, state_ens_handle%copies(j, i), perturb_by(myqty))
    enddo
 
 enddo


More information about the Dart-dev mailing list