diff options
author | Tobias Burnus <burnus@net-b.de> | 2014-06-25 22:31:32 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2014-06-25 22:31:32 +0200 |
commit | 5c75088c80c2f661d435731dec5c3bc95376b9da (patch) | |
tree | b78359680b9fe9703b183f0741b895d551ea0837 /gcc | |
parent | aa9ca5ca4f3e9e272a7dcc518d037927b319bb27 (diff) | |
download | gcc-5c75088c80c2f661d435731dec5c3bc95376b9da.zip gcc-5c75088c80c2f661d435731dec5c3bc95376b9da.tar.gz gcc-5c75088c80c2f661d435731dec5c3bc95376b9da.tar.bz2 |
resolve.c (resolve_ordinary_assign): Don't invoke caf_send when assigning a coindexed RHS scalar to a noncoindexed...
2014-06-25 Tobias Burnus <burnus@net-b.de>
fortran/
* resolve.c (resolve_ordinary_assign): Don't invoke caf_send
when assigning a coindexed RHS scalar to a noncoindexed LHS
array.
* trans-intrinsic.c (conv_caf_send): Do numeric type conversion
for a noncoindexed scalar RHS.
gcc/testsuite/
* gfortran.dg/coarray/coindexed_1.f90: New.
libgfortran/
* caf/single.c (assign_char4_from_char1,
* assign_char1_from_char4,
convert_type): New static functions.
(_gfortran_caf_get, _gfortran_caf_send): Use them.
From-SVN: r211993
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 5 | ||||
-rw-r--r-- | gcc/fortran/trans-intrinsic.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/coarray/coindexed_1.f90 | 1459 |
5 files changed, 1487 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 12606ff..d92a88f 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,10 +1,19 @@ 2014-06-25 Tobias Burnus <burnus@net-b.de> + * resolve.c (resolve_ordinary_assign): Don't invoke caf_send + when assigning a coindexed RHS scalar to a noncoindexed LHS + array. + * trans-intrinsic.c (conv_caf_send): Do numeric type conversion + for a noncoindexed scalar RHS. + +2014-06-25 Tobias Burnus <burnus@net-b.de> + * check.c (check_co_minmaxsum): Add definable check. * expr.c (gfc_check_vardef_context): Fix context == NULL case. - * trans-expr.c (get_scalar_to_descriptor_type): Handle pointer arguments. - * trans-intrinsic.c (gfc_conv_intrinsic_caf_get): Fix generation of temporary - strings. + * trans-expr.c (get_scalar_to_descriptor_type): Handle pointer + arguments. + * trans-intrinsic.c (gfc_conv_intrinsic_caf_get): Fix generation of + temporary strings. 2014-06-25 Jakub Jelinek <jakub@redhat.com> diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 48b3a40..ca20c29 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -9300,12 +9300,15 @@ resolve_ordinary_assign (gfc_code *code, gfc_namespace *ns) /* Insert a GFC_ISYM_CAF_SEND intrinsic, when the LHS is a coindexed variable. Additionally, insert this code when the RHS is a CAF as we then use the GFC_ISYM_CAF_SEND intrinsic just to avoid a temporary; but do not do so if - the LHS is (re)allocatable or has a vector subscript. */ + the LHS is (re)allocatable or has a vector subscript. If the LHS is a + noncoindexed array and the RHS is a coindexed scalar, use the normal code + path. */ if (gfc_option.coarray == GFC_FCOARRAY_LIB && (lhs_coindexed || (code->expr2->expr_type == EXPR_FUNCTION && code->expr2->value.function.isym && code->expr2->value.function.isym->id == GFC_ISYM_CAF_GET + && (code->expr1->rank == 0 || code->expr2->rank != 0) && !gfc_expr_attr (rhs).allocatable && !gfc_has_vector_subscript (rhs)))) { diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index a0c7421..a1dfdfb 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -1349,6 +1349,7 @@ conv_caf_send (gfc_code *code) { gfc_se lhs_se, rhs_se; stmtblock_t block; tree caf_decl, token, offset, image_index, tmp, lhs_kind, rhs_kind; + tree lhs_type = NULL_TREE; tree vec = null_pointer_node, rhs_vec = null_pointer_node; gcc_assert (gfc_option.coarray == GFC_FCOARRAY_LIB); @@ -1364,6 +1365,7 @@ conv_caf_send (gfc_code *code) { symbol_attribute attr; gfc_clear_attr (&attr); gfc_conv_expr (&lhs_se, lhs_expr); + lhs_type = TREE_TYPE (lhs_se.expr); lhs_se.expr = gfc_conv_scalar_to_descriptor (&lhs_se, lhs_se.expr, attr); lhs_se.expr = gfc_build_addr_expr (NULL_TREE, lhs_se.expr); } @@ -1385,6 +1387,7 @@ conv_caf_send (gfc_code *code) { } lhs_se.want_pointer = 1; gfc_conv_expr_descriptor (&lhs_se, lhs_expr); + lhs_type = gfc_get_element_type (TREE_TYPE (TREE_TYPE (lhs_se.expr))); if (has_vector) { vec = conv_caf_vector_subscript (&block, lhs_se.expr, ar); @@ -1418,11 +1421,16 @@ conv_caf_send (gfc_code *code) { /* RHS. */ gfc_init_se (&rhs_se, NULL); + if (rhs_expr->expr_type == EXPR_FUNCTION && rhs_expr->value.function.isym + && rhs_expr->value.function.isym->id == GFC_ISYM_CONVERSION) + rhs_expr = rhs_expr->value.function.actual->expr; if (rhs_expr->rank == 0) { symbol_attribute attr; gfc_clear_attr (&attr); gfc_conv_expr (&rhs_se, rhs_expr); + if (!gfc_is_coindexed (rhs_expr) && rhs_expr->ts.type != BT_CHARACTER) + rhs_se.expr = fold_convert (lhs_type , rhs_se.expr); rhs_se.expr = gfc_conv_scalar_to_descriptor (&rhs_se, rhs_se.expr, attr); rhs_se.expr = gfc_build_addr_expr (NULL_TREE, rhs_se.expr); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7046ff7..0735c44 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2014-06-25 Tobias Burnus <burnus@net-b.de> + * gfortran.dg/coarray/coindexed_1.f90: New. + +2014-06-25 Tobias Burnus <burnus@net-b.de> + * gfortran.dg/coarray_collectives_7.f90: New. 2014-06-25 Bernd Edlinger <bernd.edlinger@hotmail.de> diff --git a/gcc/testsuite/gfortran.dg/coarray/coindexed_1.f90 b/gcc/testsuite/gfortran.dg/coarray/coindexed_1.f90 new file mode 100644 index 0000000..86f86d1 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/coarray/coindexed_1.f90 @@ -0,0 +1,1459 @@ +! { dg-do run } +! +! +program test + implicit none + call char_test() +contains +subroutine char_test() + character(len=3, kind=1), save :: str1a[*], str1b(5)[*] + character(len=7, kind=1), save :: str2a[*], str2b(5)[*] + character(len=3, kind=4), save :: ustr1a[*], ustr1b(5)[*] + character(len=7, kind=4), save :: ustr2a[*], ustr2b(5)[*] + + ! ---------- Assign to coindexed variable ------------- + + ! - - - - - scalar = scalar + + ! SCALAR - kind 1 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str1a = 1_"abc" + str2a = 1_"XXXXXXX" + if (this_image() == num_images()) then + str2a[1] = str1a + end if + sync all + if (this_image() == 1) then + if (str2a /= 1_"abc ") call abort() + else + if (str2a /= 1_"XXXXXXX") call abort() + end if + + ! SCALAR - kind 4 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr1a = 4_"abc" + ustr2a = 4_"XXXXXXX" + if (this_image() == num_images()) then + ustr2a[1] = ustr1a + end if + sync all + if (this_image() == 1) then + if (ustr2a /= 4_"abc ") call abort() + else + if (ustr2a /= 4_"XXXXXXX") call abort() + end if + + ! SCALAR - kind 1 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str2a = 1_"abcde" + str1a = 1_"XXX" + if (this_image() == num_images()) then + str1a[1] = str2a + end if + sync all + if (this_image() == 1) then + if (str1a /= 1_"abc") call abort() + else + if (str1a /= 1_"XXX") call abort() + end if + + ! SCALAR - kind 4 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr2a = 4_"abcde" + ustr1a = 4_"XXX" + if (this_image() == num_images()) then + ustr1a[1] = ustr2a + end if + sync all + if (this_image() == 1) then + if (ustr1a /= 4_"abc") call abort() + else + if (ustr1a /= 4_"XXX") call abort() + end if + + ! - - - - - array = array + + ! contiguous ARRAY - kind 1 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str1b(1) = 1_"abc" + str1b(2) = 1_"def" + str1b(3) = 1_"gjh" + str2b(1) = 1_"XXXXXXX" + str2b(2) = 1_"YYYYYYY" + str2b(3) = 1_"ZZZZZZZ" + if (this_image() == num_images()) then + str2b(:)[1] = str1b + end if + sync all + if (this_image() == 1) then + if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"def " & + .or. str2b(3) /= 1_"gjh ") call abort() + else + if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" & + .or. str2b(3) /= 1_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr1b(1) = 4_"abc" + ustr1b(2) = 4_"def" + ustr1b(3) = 4_"gjh" + ustr2b(1) = 4_"XXXXXXX" + ustr2b(2) = 4_"YYYYYYY" + ustr2b(3) = 4_"ZZZZZZZ" + if (this_image() == num_images()) then + ustr2b(:)[1] = ustr1b + end if + sync all + if (this_image() == 1) then + if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"def " & + .or. ustr2b(3) /= 4_"gjh ") call abort() + else + if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" & + .or. ustr2b(3) /= 4_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 1 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str2b(1) = 1_"abcdefg" + str2b(2) = 1_"hijklmn" + str2b(3) = 1_"opqrstu" + str1b(1) = 1_"XXX" + str1b(2) = 1_"YYY" + str1b(3) = 1_"ZZZ" + if (this_image() == num_images()) then + str1b(:)[1] = str2b + end if + sync all + if (this_image() == 1) then + if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"hij" & + .or. str1b(3) /= 1_"opq") call abort() + else + if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" & + .or. str1b(3) /= 1_"ZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr2b(1) = 4_"abcdefg" + ustr2b(2) = 4_"hijklmn" + ustr2b(3) = 4_"opqrstu" + ustr1b(1) = 4_"XXX" + ustr1b(2) = 4_"YYY" + ustr1b(3) = 4_"ZZZ" + if (this_image() == num_images()) then + ustr1b(:)[1] = ustr2b + end if + sync all + if (this_image() == 1) then + if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"hij" & + .or. ustr1b(3) /= 4_"opq") call abort() + else + if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" & + .or. ustr1b(3) /= 4_"ZZZ") call abort() + end if + + ! - - - - - array = scalar + + ! contiguous ARRAY - kind 1 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str1a = 1_"abc" + str2b(1) = 1_"XXXXXXX" + str2b(2) = 1_"YYYYYYY" + str2b(3) = 1_"ZZZZZZZ" + if (this_image() == num_images()) then + str2b(:)[1] = str1a + end if + sync all + if (this_image() == 1) then + if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"abc " & + .or. str2b(3) /= 1_"abc ") call abort() + else + if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" & + .or. str2b(3) /= 1_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr1a = 4_"abc" + ustr2b(1) = 4_"XXXXXXX" + ustr2b(2) = 4_"YYYYYYY" + ustr2b(3) = 4_"ZZZZZZZ" + if (this_image() == num_images()) then + ustr2b(:)[1] = ustr1a + end if + sync all + if (this_image() == 1) then + if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"abc " & + .or. ustr2b(3) /= 4_"abc ") call abort() + else + if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" & + .or. ustr2b(3) /= 4_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 1 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str2a = 1_"abcdefg" + str1b(1) = 1_"XXX" + str1b(2) = 1_"YYY" + str1b(3) = 1_"ZZZ" + if (this_image() == num_images()) then + str1b(:)[1] = str2a + end if + sync all + if (this_image() == 1) then + if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"abc" & + .or. str1b(3) /= 1_"abc") call abort() + else + if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" & + .or. str1b(3) /= 1_"ZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr2a = 4_"abcdefg" + ustr1b(1) = 4_"XXX" + ustr1b(2) = 4_"YYY" + ustr1b(3) = 4_"ZZZ" + if (this_image() == num_images()) then + ustr1b(:)[1] = ustr2a + end if + sync all + if (this_image() == 1) then + if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"abc" & + .or. ustr1b(3) /= 4_"abc") call abort() + else + if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" & + .or. ustr1b(3) /= 4_"ZZZ") call abort() + end if + + ! ---------- Take from a coindexed variable ------------- + + ! - - - - - scalar = scalar + + ! SCALAR - kind 1 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str1a = 1_"abc" + str2a = 1_"XXXXXXX" + if (this_image() == num_images()) then + str2a = str1a[1] + end if + sync all + if (this_image() == num_images()) then + if (str2a /= 1_"abc ") call abort() + else + if (str2a /= 1_"XXXXXXX") call abort() + end if + + ! SCALAR - kind 4 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr1a = 4_"abc" + ustr2a = 4_"XXXXXXX" + if (this_image() == num_images()) then + ustr2a = ustr1a[1] + end if + sync all + if (this_image() == num_images()) then + if (ustr2a /= 4_"abc ") call abort() + else + if (ustr2a /= 4_"XXXXXXX") call abort() + end if + + ! SCALAR - kind 1 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str2a = 1_"abcde" + str1a = 1_"XXX" + if (this_image() == num_images()) then + str1a = str2a[1] + end if + sync all + if (this_image() == num_images()) then + if (str1a /= 1_"abc") call abort() + else + if (str1a /= 1_"XXX") call abort() + end if + + ! SCALAR - kind 4 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr2a = 4_"abcde" + ustr1a = 4_"XXX" + if (this_image() == num_images()) then + ustr1a = ustr2a[1] + end if + sync all + if (this_image() == num_images()) then + if (ustr1a /= 4_"abc") call abort() + else + if (ustr1a /= 4_"XXX") call abort() + end if + + ! - - - - - array = array + + ! contiguous ARRAY - kind 1 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str1b(1) = 1_"abc" + str1b(2) = 1_"def" + str1b(3) = 1_"gjh" + str2b(1) = 1_"XXXXXXX" + str2b(2) = 1_"YYYYYYY" + str2b(3) = 1_"ZZZZZZZ" + if (this_image() == num_images()) then + str2b = str1b(:)[1] + end if + sync all + if (this_image() == num_images()) then + if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"def " & + .or. str2b(3) /= 1_"gjh ") call abort() + else + if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" & + .or. str2b(3) /= 1_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr1b(1) = 4_"abc" + ustr1b(2) = 4_"def" + ustr1b(3) = 4_"gjh" + ustr2b(1) = 4_"XXXXXXX" + ustr2b(2) = 4_"YYYYYYY" + ustr2b(3) = 4_"ZZZZZZZ" + if (this_image() == num_images()) then + ustr2b = ustr1b(:)[1] + end if + sync all + if (this_image() == num_images()) then + if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"def " & + .or. ustr2b(3) /= 4_"gjh ") call abort() + else + if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" & + .or. ustr2b(3) /= 4_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 1 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str2b(1) = 1_"abcdefg" + str2b(2) = 1_"hijklmn" + str2b(3) = 1_"opqrstu" + str1b(1) = 1_"XXX" + str1b(2) = 1_"YYY" + str1b(3) = 1_"ZZZ" + if (this_image() == num_images()) then + str1b = str2b(:)[1] + end if + sync all + if (this_image() == num_images()) then + if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"hij" & + .or. str1b(3) /= 1_"opq") call abort() + else + if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" & + .or. str1b(3) /= 1_"ZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr2b(1) = 4_"abcdefg" + ustr2b(2) = 4_"hijklmn" + ustr2b(3) = 4_"opqrstu" + ustr1b(1) = 4_"XXX" + ustr1b(2) = 4_"YYY" + ustr1b(3) = 4_"ZZZ" + if (this_image() == num_images()) then + ustr1b = ustr2b(:)[1] + end if + sync all + if (this_image() == num_images()) then + if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"hij" & + .or. ustr1b(3) /= 4_"opq") call abort() + else + if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" & + .or. ustr1b(3) /= 4_"ZZZ") call abort() + end if + + ! - - - - - array = scalar + + ! contiguous ARRAY - kind 1 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str1a = 1_"abc" + str2b(1) = 1_"XXXXXXX" + str2b(2) = 1_"YYYYYYY" + str2b(3) = 1_"ZZZZZZZ" + if (this_image() == num_images()) then + str2b = str1a[1] + end if + sync all + if (this_image() == num_images()) then + if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"abc " & + .or. str2b(3) /= 1_"abc ") call abort() + else + if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" & + .or. str2b(3) /= 1_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr1a = 4_"abc" + ustr2b(1) = 4_"XXXXXXX" + ustr2b(2) = 4_"YYYYYYY" + ustr2b(3) = 4_"ZZZZZZZ" + if (this_image() == num_images()) then + ustr2b = ustr1a[1] + end if + sync all + if (this_image() == num_images()) then + if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"abc " & + .or. ustr2b(3) /= 4_"abc ") call abort() + else + if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" & + .or. ustr2b(3) /= 4_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 1 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str2a = 1_"abcdefg" + str1b(1) = 1_"XXX" + str1b(2) = 1_"YYY" + str1b(3) = 1_"ZZZ" + if (this_image() == num_images()) then + str1b = str2a[1] + end if + sync all + if (this_image() == num_images()) then + if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"abc" & + .or. str1b(3) /= 1_"abc") call abort() + else + if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" & + .or. str1b(3) /= 1_"ZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr2a = 4_"abcdefg" + ustr1b(1) = 4_"XXX" + ustr1b(2) = 4_"YYY" + ustr1b(3) = 4_"ZZZ" + if (this_image() == num_images()) then + ustr1b = ustr2a[1] + end if + sync all + if (this_image() == num_images()) then + if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"abc" & + .or. ustr1b(3) /= 4_"abc") call abort() + else + if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" & + .or. ustr1b(3) /= 4_"ZZZ") call abort() + end if + + + ! ---------- coindexed to coindexed variable ------------- + + ! - - - - - scalar = scalar + + ! SCALAR - kind 1 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str1a = 1_"abc" + str2a = 1_"XXXXXXX" + if (this_image() == num_images()) then + str2a[1] = str1a[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (str2a /= 1_"abc ") call abort() + else + if (str2a /= 1_"XXXXXXX") call abort() + end if + + ! SCALAR - kind 4 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr1a = 4_"abc" + ustr2a = 4_"XXXXXXX" + if (this_image() == num_images()) then + ustr2a[1] = ustr1a[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (ustr2a /= 4_"abc ") call abort() + else + if (ustr2a /= 4_"XXXXXXX") call abort() + end if + + ! SCALAR - kind 1 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str2a = 1_"abcde" + str1a = 1_"XXX" + if (this_image() == num_images()) then + str1a[1] = str2a[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (str1a /= 1_"abc") call abort() + else + if (str1a /= 1_"XXX") call abort() + end if + + ! SCALAR - kind 4 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr2a = 4_"abcde" + ustr1a = 4_"XXX" + if (this_image() == num_images()) then + ustr1a[1] = ustr2a[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (ustr1a /= 4_"abc") call abort() + else + if (ustr1a /= 4_"XXX") call abort() + end if + + ! - - - - - array = array + + ! contiguous ARRAY - kind 1 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str1b(1) = 1_"abc" + str1b(2) = 1_"def" + str1b(3) = 1_"gjh" + str2b(1) = 1_"XXXXXXX" + str2b(2) = 1_"YYYYYYY" + str2b(3) = 1_"ZZZZZZZ" + if (this_image() == num_images()) then + str2b(:)[1] = str1b(:)[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"def " & + .or. str2b(3) /= 1_"gjh ") call abort() + else + if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" & + .or. str2b(3) /= 1_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr1b(1) = 4_"abc" + ustr1b(2) = 4_"def" + ustr1b(3) = 4_"gjh" + ustr2b(1) = 4_"XXXXXXX" + ustr2b(2) = 4_"YYYYYYY" + ustr2b(3) = 4_"ZZZZZZZ" + if (this_image() == num_images()) then + ustr2b(:)[1] = ustr1b(:)[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"def " & + .or. ustr2b(3) /= 4_"gjh ") call abort() + else + if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" & + .or. ustr2b(3) /= 4_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 1 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str2b(1) = 1_"abcdefg" + str2b(2) = 1_"hijklmn" + str2b(3) = 1_"opqrstu" + str1b(1) = 1_"XXX" + str1b(2) = 1_"YYY" + str1b(3) = 1_"ZZZ" + if (this_image() == num_images()) then + str1b(:)[1] = str2b(:)[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"hij" & + .or. str1b(3) /= 1_"opq") call abort() + else + if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" & + .or. str1b(3) /= 1_"ZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr2b(1) = 4_"abcdefg" + ustr2b(2) = 4_"hijklmn" + ustr2b(3) = 4_"opqrstu" + ustr1b(1) = 4_"XXX" + ustr1b(2) = 4_"YYY" + ustr1b(3) = 4_"ZZZ" + if (this_image() == num_images()) then + ustr1b(:)[1] = ustr2b(:)[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"hij" & + .or. ustr1b(3) /= 4_"opq") call abort() + else + if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" & + .or. ustr1b(3) /= 4_"ZZZ") call abort() + end if + + ! - - - - - array = scalar + + ! contiguous ARRAY - kind 1 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str1a = 1_"abc" + str2b(1) = 1_"XXXXXXX" + str2b(2) = 1_"YYYYYYY" + str2b(3) = 1_"ZZZZZZZ" + if (this_image() == num_images()) then + str2b(:)[1] = str1a[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"abc " & + .or. str2b(3) /= 1_"abc ") call abort() + else + if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" & + .or. str2b(3) /= 1_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr1a = 4_"abc" + ustr2b(1) = 4_"XXXXXXX" + ustr2b(2) = 4_"YYYYYYY" + ustr2b(3) = 4_"ZZZZZZZ" + if (this_image() == num_images()) then + ustr2b(:)[1] = ustr1a[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"abc " & + .or. ustr2b(3) /= 4_"abc ") call abort() + else + if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" & + .or. ustr2b(3) /= 4_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 1 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str2a = 1_"abcdefg" + str1b(1) = 1_"XXX" + str1b(2) = 1_"YYY" + str1b(3) = 1_"ZZZ" + if (this_image() == num_images()) then + str1b(:)[1] = str2a[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"abc" & + .or. str1b(3) /= 1_"abc") call abort() + else + if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" & + .or. str1b(3) /= 1_"ZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr2a = 4_"abcdefg" + ustr1b(1) = 4_"XXX" + ustr1b(2) = 4_"YYY" + ustr1b(3) = 4_"ZZZ" + if (this_image() == num_images()) then + ustr1b(:)[1] = ustr2a[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"abc" & + .or. ustr1b(3) /= 4_"abc") call abort() + else + if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" & + .or. ustr1b(3) /= 4_"ZZZ") call abort() + end if + + ! ============== char1 <-> char4 ===================== + + ! ---------- Assign to coindexed variable ------------- + + ! - - - - - scalar = scalar + + ! SCALAR - kind 1 <- 4 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr1a = 4_"abc" + str1a = 1_"XXXXXXX" + if (this_image() == num_images()) then + str2a[1] = ustr1a + end if + sync all + if (this_image() == 1) then + if (str2a /= 1_"abc ") call abort() + else + if (str2a /= 1_"XXXXXXX") call abort() + end if + + ! SCALAR - kind 4 <- 1 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str1a = 4_"abc" + ustr2a = 1_"XXXXXXX" + if (this_image() == num_images()) then + ustr2a[1] = str1a + end if + sync all + if (this_image() == 1) then + if (ustr2a /= 4_"abc ") call abort() + else + if (ustr2a /= 4_"XXXXXXX") call abort() + end if + + ! SCALAR - kind 1 <- 4 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr2a = 4_"abcde" + str1a = 1_"XXX" + if (this_image() == num_images()) then + str1a[1] = ustr2a + end if + sync all + if (this_image() == 1) then + if (str1a /= 1_"abc") call abort() + else + if (str1a /= 1_"XXX") call abort() + end if + + ! SCALAR - kind 4 <- 1 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str2a = 4_"abcde" + ustr1a = 1_"XXX" + if (this_image() == num_images()) then + ustr1a[1] = str2a + end if + sync all + if (this_image() == 1) then + if (ustr1a /= 4_"abc") call abort() + else + if (ustr1a /= 4_"XXX") call abort() + end if + + ! - - - - - array = array + + ! contiguous ARRAY - kind 1 <- 4 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr1b(1) = 4_"abc" + ustr1b(2) = 4_"def" + ustr1b(3) = 4_"gjh" + str2b(1) = 1_"XXXXXXX" + str2b(2) = 1_"YYYYYYY" + str2b(3) = 1_"ZZZZZZZ" + if (this_image() == num_images()) then + str2b(:)[1] = ustr1b + end if + sync all + if (this_image() == 1) then + if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"def " & + .or. str2b(3) /= 1_"gjh ") call abort() + else + if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" & + .or. str2b(3) /= 1_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 <- 1 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str1b(1) = 1_"abc" + str1b(2) = 1_"def" + str1b(3) = 1_"gjh" + ustr2b(1) = 4_"XXXXXXX" + ustr2b(2) = 4_"YYYYYYY" + ustr2b(3) = 4_"ZZZZZZZ" + if (this_image() == num_images()) then + ustr2b(:)[1] = str1b + end if + sync all + if (this_image() == 1) then + if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"def " & + .or. ustr2b(3) /= 4_"gjh ") call abort() + else + if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" & + .or. ustr2b(3) /= 4_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 1 <- 4 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr2b(1) = 4_"abcdefg" + ustr2b(2) = 4_"hijklmn" + ustr2b(3) = 4_"opqrstu" + str1b(1) = 1_"XXX" + str1b(2) = 1_"YYY" + str1b(3) = 1_"ZZZ" + if (this_image() == num_images()) then + str1b(:)[1] = ustr2b + end if + sync all + if (this_image() == 1) then + if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"hij" & + .or. str1b(3) /= 1_"opq") call abort() + else + if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" & + .or. str1b(3) /= 1_"ZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 <- 1 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str2b(1) = 1_"abcdefg" + str2b(2) = 1_"hijklmn" + str2b(3) = 1_"opqrstu" + ustr1b(1) = 4_"XXX" + ustr1b(2) = 4_"YYY" + ustr1b(3) = 4_"ZZZ" + if (this_image() == num_images()) then + ustr1b(:)[1] = str2b + end if + sync all + if (this_image() == 1) then + if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"hij" & + .or. ustr1b(3) /= 4_"opq") call abort() + else + if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" & + .or. ustr1b(3) /= 4_"ZZZ") call abort() + end if + + ! - - - - - array = scalar + + ! contiguous ARRAY - kind 1 <- 4 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr1a = 4_"abc" + str2b(1) = 1_"XXXXXXX" + str2b(2) = 1_"YYYYYYY" + str2b(3) = 1_"ZZZZZZZ" + if (this_image() == num_images()) then + str2b(:)[1] = ustr1a + end if + sync all + if (this_image() == 1) then + if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"abc " & + .or. str2b(3) /= 1_"abc ") call abort() + else + if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" & + .or. str2b(3) /= 1_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 <- 1 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str1a = 1_"abc" + ustr2b(1) = 4_"XXXXXXX" + ustr2b(2) = 4_"YYYYYYY" + ustr2b(3) = 4_"ZZZZZZZ" + if (this_image() == num_images()) then + ustr2b(:)[1] = str1a + end if + sync all + if (this_image() == 1) then + if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"abc " & + .or. ustr2b(3) /= 4_"abc ") call abort() + else + if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" & + .or. ustr2b(3) /= 4_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 1 <- 4 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr2a = 4_"abcdefg" + str1b(1) = 1_"XXX" + str1b(2) = 1_"YYY" + str1b(3) = 1_"ZZZ" + if (this_image() == num_images()) then + str1b(:)[1] = ustr2a + end if + sync all + if (this_image() == 1) then + if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"abc" & + .or. str1b(3) /= 1_"abc") call abort() + else + if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" & + .or. str1b(3) /= 1_"ZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 <- 1 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str2a = 1_"abcdefg" + ustr1b(1) = 4_"XXX" + ustr1b(2) = 4_"YYY" + ustr1b(3) = 4_"ZZZ" + if (this_image() == num_images()) then + ustr1b(:)[1] = str2a + end if + sync all + if (this_image() == 1) then + if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"abc" & + .or. ustr1b(3) /= 4_"abc") call abort() + else + if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" & + .or. ustr1b(3) /= 4_"ZZZ") call abort() + end if + + ! ---------- Take from a coindexed variable ------------- + + ! - - - - - scalar = scalar + + ! SCALAR - kind 1 <- 4 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr1a = 4_"abc" + str2a = 1_"XXXXXXX" + if (this_image() == num_images()) then + str2a = ustr1a[1] + end if + sync all + if (this_image() == num_images()) then + if (str2a /= 1_"abc ") call abort() + else + if (str2a /= 1_"XXXXXXX") call abort() + end if + + ! SCALAR - kind 4 <- 1 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str1a = 1_"abc" + ustr2a = 4_"XXXXXXX" + if (this_image() == num_images()) then + ustr2a = str1a[1] + end if + sync all + if (this_image() == num_images()) then + if (ustr2a /= 4_"abc ") call abort() + else + if (ustr2a /= 4_"XXXXXXX") call abort() + end if + + ! SCALAR - kind 1 <- 4 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr2a = 4_"abcde" + str1a = 1_"XXX" + if (this_image() == num_images()) then + str1a = ustr2a[1] + end if + sync all + if (this_image() == num_images()) then + if (str1a /= 1_"abc") call abort() + else + if (str1a /= 1_"XXX") call abort() + end if + + ! SCALAR - kind 4 <- 1 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str2a = 1_"abcde" + ustr1a = 4_"XXX" + if (this_image() == num_images()) then + ustr1a = str2a[1] + end if + sync all + if (this_image() == num_images()) then + if (ustr1a /= 4_"abc") call abort() + else + if (ustr1a /= 4_"XXX") call abort() + end if + + ! - - - - - array = array + + ! contiguous ARRAY - kind 1 <- 4 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr1b(1) = 4_"abc" + ustr1b(2) = 4_"def" + ustr1b(3) = 4_"gjh" + str2b(1) = 1_"XXXXXXX" + str2b(2) = 1_"YYYYYYY" + str2b(3) = 1_"ZZZZZZZ" + if (this_image() == num_images()) then + str2b = ustr1b(:)[1] + end if + sync all + if (this_image() == num_images()) then + if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"def " & + .or. str2b(3) /= 1_"gjh ") call abort() + else + if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" & + .or. str2b(3) /= 1_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 <- 1 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str1b(1) = 1_"abc" + str1b(2) = 1_"def" + str1b(3) = 1_"gjh" + ustr2b(1) = 4_"XXXXXXX" + ustr2b(2) = 4_"YYYYYYY" + ustr2b(3) = 4_"ZZZZZZZ" + if (this_image() == num_images()) then + ustr2b = str1b(:)[1] + end if + sync all + if (this_image() == num_images()) then + if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"def " & + .or. ustr2b(3) /= 4_"gjh ") call abort() + else + if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" & + .or. ustr2b(3) /= 4_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 1 <- 4 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr2b(1) = 4_"abcdefg" + ustr2b(2) = 4_"hijklmn" + ustr2b(3) = 4_"opqrstu" + str1b(1) = 1_"XXX" + str1b(2) = 1_"YYY" + str1b(3) = 1_"ZZZ" + if (this_image() == num_images()) then + str1b = ustr2b(:)[1] + end if + sync all + if (this_image() == num_images()) then + if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"hij" & + .or. str1b(3) /= 1_"opq") call abort() + else + if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" & + .or. str1b(3) /= 1_"ZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 <- 1 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str2b(1) = 1_"abcdefg" + str2b(2) = 1_"hijklmn" + str2b(3) = 1_"opqrstu" + ustr1b(1) = 4_"XXX" + ustr1b(2) = 4_"YYY" + ustr1b(3) = 4_"ZZZ" + if (this_image() == num_images()) then + ustr1b = str2b(:)[1] + end if + sync all + if (this_image() == num_images()) then + if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"hij" & + .or. ustr1b(3) /= 4_"opq") call abort() + else + if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" & + .or. ustr1b(3) /= 4_"ZZZ") call abort() + end if + + ! - - - - - array = scalar + + ! contiguous ARRAY - kind 1 <- 4 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr1a = 4_"abc" + str2b(1) = 1_"XXXXXXX" + str2b(2) = 1_"YYYYYYY" + str2b(3) = 1_"ZZZZZZZ" + if (this_image() == num_images()) then + str2b = ustr1a[1] + end if + sync all + if (this_image() == num_images()) then + if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"abc " & + .or. str2b(3) /= 1_"abc ") call abort() + else + if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" & + .or. str2b(3) /= 1_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 <- 1 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str1a = 1_"abc" + ustr2b(1) = 4_"XXXXXXX" + ustr2b(2) = 4_"YYYYYYY" + ustr2b(3) = 4_"ZZZZZZZ" + if (this_image() == num_images()) then + ustr2b = str1a[1] + end if + sync all + if (this_image() == num_images()) then + if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"abc " & + .or. ustr2b(3) /= 4_"abc ") call abort() + else + if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" & + .or. ustr2b(3) /= 4_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 1 <- 4 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr2a = 4_"abcdefg" + str1b(1) = 1_"XXX" + str1b(2) = 1_"YYY" + str1b(3) = 1_"ZZZ" + if (this_image() == num_images()) then + str1b = ustr2a[1] + end if + sync all + if (this_image() == num_images()) then + if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"abc" & + .or. str1b(3) /= 1_"abc") call abort() + else + if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" & + .or. str1b(3) /= 1_"ZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 <- 1 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str2a = 1_"abcdefg" + ustr1b(1) = 4_"XXX" + ustr1b(2) = 4_"YYY" + ustr1b(3) = 4_"ZZZ" + if (this_image() == num_images()) then + ustr1b = str2a[1] + end if + sync all + if (this_image() == num_images()) then + if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"abc" & + .or. ustr1b(3) /= 4_"abc") call abort() + else + if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" & + .or. ustr1b(3) /= 4_"ZZZ") call abort() + end if + + + ! ---------- coindexed to coindexed variable ------------- + + ! - - - - - scalar = scalar + + ! SCALAR - kind 1 <- 4 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr1a = 4_"abc" + str2a = 1_"XXXXXXX" + if (this_image() == num_images()) then + str2a[1] = ustr1a[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (str2a /= 1_"abc ") call abort() + else + if (str2a /= 1_"XXXXXXX") call abort() + end if + + ! SCALAR - kind 4 <- 1 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str1a = 1_"abc" + ustr2a = 4_"XXXXXXX" + if (this_image() == num_images()) then + ustr2a[1] = str1a[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (ustr2a /= 4_"abc ") call abort() + else + if (ustr2a /= 4_"XXXXXXX") call abort() + end if + + ! SCALAR - kind 1 <- 4 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr2a = 4_"abcde" + str1a = 1_"XXX" + if (this_image() == num_images()) then + str1a[1] = ustr2a[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (str1a /= 1_"abc") call abort() + else + if (str1a /= 1_"XXX") call abort() + end if + + ! SCALAR - kind 4 <- 1 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str2a = 1_"abcde" + ustr1a = 4_"XXX" + if (this_image() == num_images()) then + ustr1a[1] = str2a[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (ustr1a /= 4_"abc") call abort() + else + if (ustr1a /= 4_"XXX") call abort() + end if + + ! - - - - - array = array + + ! contiguous ARRAY - kind 1 <- 4 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr1b(1) = 4_"abc" + ustr1b(2) = 4_"def" + ustr1b(3) = 4_"gjh" + str2b(1) = 1_"XXXXXXX" + str2b(2) = 1_"YYYYYYY" + str2b(3) = 1_"ZZZZZZZ" + if (this_image() == num_images()) then + str2b(:)[1] = ustr1b(:)[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"def " & + .or. str2b(3) /= 1_"gjh ") call abort() + else + if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" & + .or. str2b(3) /= 1_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 <- 1 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str1b(1) = 1_"abc" + str1b(2) = 1_"def" + str1b(3) = 1_"gjh" + ustr2b(1) = 4_"XXXXXXX" + ustr2b(2) = 4_"YYYYYYY" + ustr2b(3) = 4_"ZZZZZZZ" + if (this_image() == num_images()) then + ustr2b(:)[1] = str1b(:)[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"def " & + .or. ustr2b(3) /= 4_"gjh ") call abort() + else + if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" & + .or. ustr2b(3) /= 4_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 1 <- 4 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr2b(1) = 4_"abcdefg" + ustr2b(2) = 4_"hijklmn" + ustr2b(3) = 4_"opqrstu" + str1b(1) = 1_"XXX" + str1b(2) = 1_"YYY" + str1b(3) = 1_"ZZZ" + if (this_image() == num_images()) then + str1b(:)[1] = ustr2b(:)[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"hij" & + .or. str1b(3) /= 1_"opq") call abort() + else + if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" & + .or. str1b(3) /= 1_"ZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 <- 1 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str2b(1) = 1_"abcdefg" + str2b(2) = 1_"hijklmn" + str2b(3) = 1_"opqrstu" + ustr1b(1) = 4_"XXX" + ustr1b(2) = 4_"YYY" + ustr1b(3) = 4_"ZZZ" + if (this_image() == num_images()) then + ustr1b(:)[1] = str2b(:)[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"hij" & + .or. ustr1b(3) /= 4_"opq") call abort() + else + if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" & + .or. ustr1b(3) /= 4_"ZZZ") call abort() + end if + + ! - - - - - array = scalar + + ! contiguous ARRAY - kind 1 <- 4 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr1a = 4_"abc" + str2b(1) = 1_"XXXXXXX" + str2b(2) = 1_"YYYYYYY" + str2b(3) = 1_"ZZZZZZZ" + if (this_image() == num_images()) then + str2b(:)[1] = ustr1a[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (str2b(1) /= 1_"abc " .or. str2b(2) /= 1_"abc " & + .or. str2b(3) /= 1_"abc ") call abort() + else + if (str2b(1) /= 1_"XXXXXXX" .or. str2b(2) /= 1_"YYYYYYY" & + .or. str2b(3) /= 1_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 <- 1 - with padding + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str1a = 1_"abc" + ustr2b(1) = 4_"XXXXXXX" + ustr2b(2) = 4_"YYYYYYY" + ustr2b(3) = 4_"ZZZZZZZ" + if (this_image() == num_images()) then + ustr2b(:)[1] = str1a[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (ustr2b(1) /= 4_"abc " .or. ustr2b(2) /= 4_"abc " & + .or. ustr2b(3) /= 4_"abc ") call abort() + else + if (ustr2b(1) /= 4_"XXXXXXX" .or. ustr2b(2) /= 4_"YYYYYYY" & + .or. ustr2b(3) /= 4_"ZZZZZZZ") call abort() + end if + + ! contiguous ARRAY - kind 1 <- 4 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + ustr2a = 4_"abcdefg" + str1b(1) = 1_"XXX" + str1b(2) = 1_"YYY" + str1b(3) = 1_"ZZZ" + if (this_image() == num_images()) then + str1b(:)[1] = ustr2a[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (str1b(1) /= 1_"abc" .or. str1b(2) /= 1_"abc" & + .or. str1b(3) /= 1_"abc") call abort() + else + if (str1b(1) /= 1_"XXX" .or. str1b(2) /= 1_"YYY" & + .or. str1b(3) /= 1_"ZZZ") call abort() + end if + + ! contiguous ARRAY - kind 4 <- 1 - with trimming + str1a = 1_"zzz"; str1b = 1_"zzz"; ustr1a = 4_"zzz"; ustr1b = 4_"zzz" + str2a = 1_"zzzzzzzz"; str2b = 1_"zzzzzzzz" + ustr2a = 4_"zzzzzzzz"; ustr2b = 4_"zzzzzzzz" + str2a = 1_"abcdefg" + ustr1b(1) = 4_"XXX" + ustr1b(2) = 4_"YYY" + ustr1b(3) = 4_"ZZZ" + if (this_image() == num_images()) then + ustr1b(:)[1] = str2a[mod(1, num_images())+1] + end if + sync all + if (this_image() == 1) then + if (ustr1b(1) /= 4_"abc" .or. ustr1b(2) /= 4_"abc" & + .or. ustr1b(3) /= 4_"abc") call abort() + else + if (ustr1b(1) /= 4_"XXX" .or. ustr1b(2) /= 4_"YYY" & + .or. ustr1b(3) /= 4_"ZZZ") call abort() + end if + +end subroutine char_test +end program test |