Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bug: MITgcm pert_model_copiesΒ #360

@hkershaw-brown

Description

@hkershaw-brown

πŸ›

Describe the bug

  1. List the steps someone needs to take to reproduce the bug.
    run filter MITgcm_ocean and perturb from a single copy

  2. What was the expected outcome?

pertval depends on the which variable is being perturbed (some are clamped).

 ! Clamping: Samples obtained from truncated Gaussian dist. 
 if (.not. log_transform) pertval = max(clamp_min_val, pertval)
  1. What actually happened?

The loop is assuming that a variable is contiguous in %copies.

- start_ind = get_index_start(domain_id, ivar)
- end_ind   = get_index_end(domain_id, ivar)

INDICES : do i = start_ind, end_ind
        MEMBERS : do copy = 1, ens_size

         ! Only perturb the actual ocean cells;
         ! Leave the land and ocean floor values alone.
         if( state_ens_handle%copies(copy, i) == FVAL ) cycle MEMBERS

         pertval = random_gaussian(random_seq, state_ens_handle%copies(copy, i), &
                                         model_perturbation_amplitude)

         ! Clamping: Samples obtained from truncated Gaussian dist. 
-         if (.not. log_transform) pertval = max(clamp_min_val, pertval)

         state_ens_handle%copies(copy, i) = pertval

      enddo MEMBERS
   enddo INDICES

get_index_start is for %vars not %copies. %copies is round robin across processors.
so if (.not. log_transform) pertval = max(clamp_min_val, pertval) is not necessary the variable you want.

Error Message

You can get i > %copies(copy, i) and segfault.

Which model(s) are you working with?

MITgcm_ocean

Version of DART

Which version of DART are you using?
v10.0.1

Have you modified the DART code?

No

Build information

Cheyenne, intel but applies to any machine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions