Skip to content

V5 add run interfaces

Sebastian Müller requested to merge muellese/mhm:v5_add_run_interfaces into develop

Backport of the run interfaces from !94 (merged)

Refactor mhm_eval: copy everything into subroutines

  • remove PGI pre-processor directives

  • new module: mo_mhm_interface_run.f90

    use mo_mhm_interface_run, only : &
      mhm_interface_run_prepare, &
      mhm_interface_run_get_ndomains, &
      mhm_interface_run_prepare_domain, &
      mhm_interface_run_finished, &
      mhm_interface_run_do_time_step, &
      mhm_interface_run_write_output, &
      mhm_interface_run_update_optisim, &
      mhm_interface_run_finalize_domain, &
      mhm_interface_run_finalize
  • use subroutines for every step in the eval routine:

      ! prepare the mhm run
      call mhm_interface_run_prepare(parameterset, opti_domain_indices, present(runoff))
    
      ! get number of domains to loop over
      call mhm_interface_run_get_ndomains(nDomains)
    
      ! loop over Domains
      DomainLoop: do ii = 1, nDomains
    
        ! prepare current domain
        call mhm_interface_run_prepare_domain(ii, etOptiSim, twsOptiSim, neutronsOptiSim, smOptiSim)
    
        ! run time-loop at least once
        time_loop_finished = .false.
    
        ! Loop over time
        TimeLoop: do while(.not. time_loop_finished)
    
          ! do one time-step on current domain
          call mhm_interface_run_do_time_step()
    
          ! write output
          call mhm_interface_run_write_output()
    
          ! update optisim data
          call mhm_interface_run_update_optisim(etOptiSim, twsOptiSim, neutronsOptiSim, smOptiSim)
    
          ! check whether to run the time-loop further
          call mhm_interface_run_finished(time_loop_finished)
    
        end do TimeLoop !<< TIME STEPS LOOP
    
        ! finalize domain
        call mhm_interface_run_finalize_domain()
    
      end do DomainLoop !<< Domain LOOP
    
      ! SET RUNOFF OUTPUT VARIABLE; reset init-flag for MPR
      call mhm_interface_run_finalize(runoff)

Merge request reports