Skip to content

Commit 7862963

Browse files
committed
doc(ai4dev/README): add AI prompt instructions
1 parent 5ea9f80 commit 7862963

2 files changed

Lines changed: 35 additions & 1 deletion

File tree

doc/ai4dev/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Set Up
2+
-----------
3+
With your present working directory set to `doc/ai4dev`, execute
4+
```bash
5+
cd ../../scripts/
6+
./create-single-source-file-programs.sh
7+
cd ../build/single-file-programs
8+
```
9+
10+
Vibe Coding
11+
-----------
12+
1. Compile and execute `diffusion-app.F90` to ensure that the program
13+
terminates normally. For example, with the `gfortran` compiler,
14+
run `gfortran -fcoarray=single -o diffusion-app diffusion-app.F90`
15+
followed by `./diffusion-app`.
16+
2. Edit `diffusion-app.F90` to remove the lines beginning and ending with
17+
`module procedure laplacian` and `end procedure laplacian`, respectively.
18+
3. Enter the file `doc/ai4dev/vibe-coding/README.md` as your prompt and
19+
attach the edited `diffusion-app.F90` file.
20+
4. Insert the resulting function into the `subdomain_s` submodule and
21+
try compiling and executing again to check the result.
22+
23+
Idiomtic Vibe Coding
24+
--------------------
25+
1. Compile and execute `test-suite.F90` to and check that the output
26+
reports that all tests pass. For example, with the `gfortran` compiler,
27+
run `gfortran -fcoarray=single -o test-suite test-suite.F90` followed
28+
by `./test-suite`.
29+
2. Edit `test-suite.F90` to remove the lines beginning and ending with
30+
`module procedure laplacian` and `end procedure laplacian`, respectively.
31+
3. Enter the file `doc/ai4dev/idiomaic-vibe-coding/README.md` as your prompt
32+
and attach the edited `tgest-sutie.F90` file.
33+
4. Insert the resulting function into the `subdomain_s` submodule and
34+
try compiling and executing again to check the result.

src/matcha/subdomain_s.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142

143143
if (me==1) laplacian_rhs%s_(1,:,:) = 0. ! low-x boundary
144144
if (me==num_subdomains) laplacian_rhs%s_(my_nx,:,:) = 0. ! high-x boundary
145-
end procedure
145+
end procedure laplacian
146146

147147
module procedure multiply
148148
call_assert(allocated(rhs%s_))

0 commit comments

Comments
 (0)