-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
using external fortran-testanything model_mod.f90 is in the work directory. This is a lazy move to avoid fiddling with EXTRA in quickbuild.sh for issue #718
- Loading branch information
1 parent
a85e162
commit 9d0f897
Showing
5 changed files
with
404 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
program test_window | ||
|
||
use mpi_utilities_mod, only : initialize_mpi_utilities, finalize_mpi_utilities, my_task_id, task_count, task_sync | ||
|
||
use ensemble_manager_mod, only : init_ensemble_manager, end_ensemble_manager, ensemble_type, set_num_extra_copies | ||
use distributed_state_mod, only : create_state_window, free_state_window, get_state | ||
use types_mod, only : i8, r8 | ||
|
||
use test ! fortran-testanything | ||
|
||
implicit none | ||
|
||
integer :: num_copies = 10 | ||
integer :: real_ens_members = 3 | ||
real(r8) :: res(3) | ||
integer(i8) :: num_vars = 201 | ||
type(ensemble_type) :: ens_handle | ||
|
||
call initialize_mpi_utilities('test_window') | ||
|
||
if (my_task_id() == 0 ) then | ||
call plan(3*task_count()) | ||
endif | ||
|
||
call init_ensemble_manager(ens_handle, num_copies, num_vars) | ||
call set_num_extra_copies(ens_handle, num_copies - real_ens_members) | ||
|
||
ens_handle%copies(1:real_ens_members,:) = my_task_id() | ||
ens_handle%copies(real_ens_members+1:num_copies,:) = -100 | ||
|
||
call create_state_window(ens_handle) | ||
|
||
! result should be index-1 mod task_count() for round robin distribution | ||
res = get_state(1_i8, ens_handle) | ||
call ok(res(1) == mod(1-1, task_count())) | ||
|
||
res = get_state(27_i8, ens_handle) | ||
call ok(res(1) == mod(27-1, task_count())) | ||
|
||
res = get_state(198_i8, ens_handle) | ||
call ok(res(1) == mod(198-1, task_count())) | ||
|
||
call free_state_window(ens_handle) | ||
|
||
call end_ensemble_manager(ens_handle) | ||
|
||
call finalize_mpi_utilities() | ||
|
||
|
||
end program test_window |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
&ensemble_manager_nml | ||
/ | ||
|
||
&utilities_nml | ||
module_details = .false. | ||
/ | ||
|
||
&preprocess_nml | ||
input_obs_qty_mod_file = '../../../assimilation_code/modules/observations/DEFAULT_obs_kind_mod.F90' | ||
output_obs_qty_mod_file = '../../../assimilation_code/modules/observations/obs_kind_mod.f90' | ||
input_obs_def_mod_file = '../../../observations/forward_operators/DEFAULT_obs_def_mod.F90' | ||
output_obs_def_mod_file = '../../../observations/forward_operators/obs_def_mod.f90' | ||
obs_type_files = '../../../observations/forward_operators/obs_def_gps_mod.f90' | ||
quantity_files = '../../../assimilation_code/modules/observations/default_quantities_mod.f90' | ||
/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env bash | ||
|
||
# DART software - Copyright UCAR. This open source software is provided | ||
# by UCAR, "as is", without charge, subject to all terms of use at | ||
# http://www.image.ucar.edu/DAReS/DART/DART_download | ||
|
||
main() { | ||
|
||
|
||
export DART=$(git rev-parse --show-toplevel) | ||
source "$DART"/build_templates/buildfunctions.sh | ||
|
||
MODEL="none" | ||
EXTRA=/Users/hkershaw/DART/issues/fortran-testanything | ||
dev_test=1 | ||
LOCATION="threed_sphere" | ||
TEST="window" | ||
|
||
programs=( | ||
test_window | ||
) | ||
|
||
# quickbuild arguments | ||
arguments "$@" | ||
|
||
# clean the directory | ||
\rm -f -- *.o *.mod Makefile .cppdefs | ||
|
||
# build and run preprocess before making any other DART executables | ||
buildpreprocess | ||
|
||
# build DART | ||
buildit | ||
|
||
# clean up | ||
\rm -f -- *.o *.mod | ||
|
||
} | ||
|
||
main "$@" |
Oops, something went wrong.