[Dart-dev] DART/branches Revision: 11133

dart at ucar.edu dart at ucar.edu
Wed Feb 22 13:08:38 MST 2017


raeder at ucar.edu
2017-02-22 13:08:38 -0700 (Wed, 22 Feb 2017)
568
Replaced a redundant 'success' status with a failure condition in
interp_lonlat:obs_kind == KIND_SURFACE_HEIGHT.
Simplified a latitude restriction 'failure' condition in interp_lonlat.
Removed variable pmln from model_heights and from the call to dcz2
since it's used only in dcz2.
Completed the 'pressure' vs. 'log_invP' options in convert_vert.
Missing options were allowing which_new to remain undefined in some cases.
Removed write_model_time into dart_model_io_mod and added 'use' statement or it.
Clarified the calculation of the seed given to init_random_seq.




Modified: DART/branches/rma_trunk/models/cam-fv/model_mod.f90
===================================================================
--- DART/branches/rma_trunk/models/cam-fv/model_mod.f90	2017-02-22 19:55:59 UTC (rev 11132)
+++ DART/branches/rma_trunk/models/cam-fv/model_mod.f90	2017-02-22 20:08:38 UTC (rev 11133)
@@ -4,7 +4,8 @@
 
 ! $Id$
 
-! > > > See RMA-KR for changes to Helen's original RMA version.
+! > > > This version has NOT been updated to describe RMA changes.
+!       See RMA-KR for changes to Helen's original RMA version.
 !       Some comments in here are meant to connect with comments in 
 !       the trunk (non-RMA) version as of 2016-7.  These comments
 !       and the sections in the trunk may be helpful in tracing the
@@ -3024,7 +3025,15 @@
    val_12(:) = phis(lon_ind_below, lat_ind_above) / gravity_const
    val_21(:) = phis(lon_ind_above, lat_ind_below) / gravity_const
    val_22(:) = phis(lon_ind_above, lat_ind_above) / gravity_const
-   vstatus(:) = 0 
+   if (val_11(1) == MISSING_R8 .or. &
+       val_12(1) == MISSING_R8 .or. &
+       val_21(1) == MISSING_R8 .or. &
+       val_22(1) == MISSING_R8 ) then
+      vstatus(:) = 1 
+      write(string1,*) 'interp_lonlat: val_##(mem1) = MISSING_R* for ',&
+                       'lon, lat near ',lon_ind_above, lat_ind_above
+      call error_handler(E_WARN, 'interp_lonlat', string1,source,revision,revdate)
+   endif
 
 elseif (vert_is_level(obs_loc)) then
    ! Pobs
@@ -3104,12 +3113,15 @@
 ! RMA-KR; Note that there's no early return based on an interpolation failure.
 !         The interpolation is done for those members for whom it's possible
 !         and the others get 'failed' istatus, which is returned to the calling routine.
-istatus(:) = vstatus(:)
 
 if (abs(lon_lat_lev(2)) > max_obs_lat_degree) then
    ! Define istatus to be a combination of vstatus (= 0 or 2 (for higher than highest_obs...))
    ! and whether the ob is poleward of the limits set in the namelist (+ 4).
-   where (istatus == 0 .or. istatus == 2) istatus = 10*vstatus + 4
+   ! Too confusing for now; 
+   ! istatus(:) = 10*vstatus + 4
+   istatus(:) = 2
+else
+   istatus(:) = vstatus(:)
 endif
 
 where (istatus == 0 .or. istatus == 2) ! These are success codes
@@ -4235,7 +4247,10 @@
    endif
 
 elseif (old_which == VERTISPRESSURE) then
-   if (vert_coord == 'log_invP') then
+   if (vert_coord == 'pressure') then
+      new_array(3) =  old_array(3)
+      new_which = VERTISPRESSURE
+   elseif (vert_coord == 'log_invP') then
       new_array(3) = scale_height(p_surface=p_surf(1), p_above=old_array(3))
       new_which = VERTISSCALEHEIGHT
    endif
@@ -4244,6 +4259,9 @@
    if (vert_coord == 'pressure') then
       new_array(3) = p_surf(1) / exp(old_array(3))
       new_which = VERTISPRESSURE
+   elseif (vert_coord == 'log_invP') then
+      new_array(3) = old_array(3)
+      new_which = old_which
    endif
 
 elseif (old_which == VERTISLEVEL) then
@@ -4379,7 +4397,8 @@
 
 ! This will make the results reproduce for runs with the same number of MPI tasks.
 ! It will NOT give the same random sequence if you change the task count.
-call init_random_seq(random_seq, my_task_id()+1 * 1000)
+k = (my_task_id()+1) * 1000
+call init_random_seq(random_seq, k)
 
 pert_fld = 1
 
@@ -4395,10 +4414,14 @@
 
       perturbed = .true.
 
-      call error_handler(E_MSG,'pert_model_state', 'Perturbing '//trim(pert_names(pert_fld)))
-
       start_index = get_index_start(component_id, m)
       end_index = get_index_end(component_id, m)
+      if (output_task0) then
+         write(string1,'(3A,2I8,A,I8)') 'Perturbing ',trim(pert_names(pert_fld)), &
+               ' start,stop = ',start_index,end_index,' seed=', k
+         call error_handler(E_MSG,'pert_model_copies', string1)
+      endif
+
       ! FIXME : below is not robust. ens_member is always 0 in CESM context.
       !         Probably should remove this option from future versions; hasn't been used for years.
 
@@ -4416,6 +4439,13 @@
          mode = pert_fld
       endif


More information about the Dart-dev mailing list