program modflow_dll_test_4 implicit none integer, parameter :: max_path_len = 256 character(len=max_path_len) :: config_file_name ! config (*.run / *.nam / components file) integer :: num_args ! #program arguments double precision :: currenttime double precision, dimension(:,:), allocatable :: head1 real, dimension(:,:), allocatable :: recharge logical :: endOfSimulation, doTimeLoop, enableStateSave, stssave integer :: retVal = 0 integer :: nlay,nrow,ncol integer :: isub, nnsub integer, external :: mf_init_no_sub_pest_moz num_args = nargs() if (num_args == 2) then call getarg(1, config_file_name) else stop 'provide *.run / *.nam' endif ! initialize model enableStateSave = .false. retVal = mf_init_no_sub_pest_moz(config_file_name, endOfSimulation, -1.d0, enableStateSave) if (retVal /= 0) then stop 'modflow did not initialize correctly, see modflow log file' else if (endOfSimulation) then stop 'modflow did not initialize correctly, see modflow log file' endif !!!!!! get grid dimension and allocate head/recharge !!!!! call mf_get_grid_sizes(nlay,nrow,ncol) if (allocated(head1)) deallocate(head1) if (allocated(recharge)) deallocate(recharge) allocate(head1(ncol,nrow),recharge(ncol,nrow)) recharge = 0. ! run model endOfSimulation = .false. stssave = .false. do while (.not.endOfSimulation) ! simulation loop doTimeLoop = .true. do while(doTimeLoop) ! time loop !!!!!! set recharge !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! recharge = recharge + 0.001 call mf_set_recharge(recharge,ncol,nrow) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! call mf_update_no_sub_pest_moz(endOfSimulation, doTimeLoop, stssave) !!!!! get the head for layer 1 !!!!!!!!!!!!!!!!!!!!!!!!!!! call mf_get_heads(head1,ncol,nrow) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! end do end do call mf_finish_no_sub_pest_moz() end program modflow_dll_test_4