anchor.diff:      CHARACTER(225)                  :: optimizer_used
       CHARACTER(225)                  :: exec_dir
       CHARACTER(10)                   :: request
  -
  +    character(len=1024) :: filename
  +    CHARACTER(55)                   :: today_char
  +    CHARACTER(55)                   :: now_char
  +    CHARACTER(155)                  :: val_char
  +    CHARACTER(50)                   :: tmp_char
   !------------------------------------------------------------------------------
   ! Algorithm
   !------------------------------------------------------------------------------
  
positive.code: 
          CALL dist_optim_paras(coeffs_a, coeffs_b, coeffs_edu, coeffs_home, shocks_cholesky, x_all_current)
  
  
  
          IF(task == 2) THEN
  
negative.code: 
              END IF
  
  
              OPEN(UNIT=12, FILE=TRIM(filename), ACCESS='APPEND')
                CALL get_time(today_char, now_char)
                WRITE(12, 120) 'Start calc', now_char
              CLOSE(12)
  
              CALL fort_calculate_payoffs_systematic(periods_payoffs_systematic, states_number_period, states_all, coeffs_a, coeffs_b, coeffs_edu, coeffs_home, edu_start)
  
              OPEN(UNIT=12, FILE=TRIM(filename), ACCESS='APPEND')
                CALL get_time(today_char, now_char)
                WRITE(12, 120) 'Start backw', now_char
              CLOSE(12)
  
              CALL fort_backward_induction_slave(periods_emax, periods_draws_emax, states_number_period, periods_payoffs_systematic, mapping_state_idx, states_all, shocks_cholesky, delta, is_debug, is_interpolated, is_myopic, edu_start, edu_max, num_emax_slaves, .False.)
  
              OPEN(UNIT=12, FILE=TRIM(filename), ACCESS='APPEND')
                CALL get_time(today_char, now_char)
                WRITE(12, 120) 'Start contrib', now_char
              CLOSE(12)
  
              CALL fort_contributions(contribs, periods_payoffs_systematic, mapping_state_idx, periods_emax, states_all, shocks_cholesky, data_slave, periods_draws_prob, delta, tau, edu_start, edu_max)
              OPEN(UNIT=12, FILE=TRIM(filename), ACCESS='APPEND')
                CALL get_time(today_char, now_char)
                WRITE(12, 120) 'done contrib', now_char
              CLOSE(12)
  
  
              CALL MPI_SEND(contribs, num_obs_slaves(rank + 1), MPI_DOUBLE, 0, rank, PARENTCOMM, ierr)
  
          END IF
  
          OPEN(UNIT=12, FILE=TRIM(filename), ACCESS='APPEND')
  
            WRITE(12, *)
            WRITE(12, *)
            WRITE(12, *)
  
          CLOSE(12)
  
      END DO
  
  END PROGRAM
  