Skip to content

Commit 5ea9f80

Browse files
committed
doc(ai4dev/idiomatic): add README.md as prompt
1 parent 5b65e61 commit 5ea9f80

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
You are a research software engineer who is familiar with Fortran 2018, experienced in parallel and object-oriented programming, and building a software library named "Matcha". All source code that you need is in the attached file. The main program runs a test suite that uses a module subdomain_test_m to report on several correctness checks on the subdomain_m module and subdomain_s submodule. The subdomain_m module also contains a module function interface body named "laplacian". Everything in the source code is complete except that there is no defintion for the "laplacian" function. Provide a defintion for the laplacian function definition using the following steps:
3+
4+
1. Write an empty module procecure named "laplacian" into which you will insert executable statements and comments that explain what your code is doing.
5+
2. Allocate the laplacian_rhs% component to a shape [my_nx, ny, nz]
6+
3. Use one or more "do concurrent" constructs, each with "default(none)" and any othe required locality specifiers, to compute a 2nd-order central difference approximation to the Laplacian of the "s_" array component of the "laplacian" function's "rhs" dummy argument.
7+
4. Store the Laplacian approximation in the s_ component of the laplacian_rhs function result.
8+
5. When an expresssion requires the value rhs%s_(1,:,:) and me==1, instead use halo_x(west,:,:) for the required value.
9+
5. When an expresssion requires the value rhs%s_(ubound(rhs%s_,1),:,:) and me==num_subdomains, instead use halo_x(east,:,:) for the required value.
10+
6. Set result component laplacian_rhs%s_ to zero for the subscript values (:, 1,:), (:,ny,:), (:,:, 1), (:,:,nz).
11+
7. Also set laplacian_rhs%s_ to zero for the subscript values (1,:,:) if me==1
12+
8. Also set laplacian_rhs%s_ to zero for the subscript values (my_nx,:,:) if me==num_subdomains.
13+
14+
When "laplacian" function is incorporated into the subdomain_m module, the attached file must compile and report that all tests passing when executed.

0 commit comments

Comments
 (0)