11# Usage: code-scribe update ERF_NOAHMP.cpp \
2- # -p prompts/noahmpio_update.toml -m <openai|argo|..>
2+ # -p prompts/noahmpio_update.toml \
3+ # -p "Write a natural language prompt with variable name dimension etc." \
4+ # -m <openai|argo|..>
35
46[[chat .user ]]
57content = '''
@@ -36,16 +38,16 @@ patterns used for existing variables such as `U_PHY`, `V_PHY`, `T_PHY`, `QV_CURR
36382. Task Details
3739
3840Update Advance_With_State() to include and correctly link new NoahmpIO
39- variables RAINLSM and any other surface fields needed for the ERF side.
41+ variables and any other surface fields needed for the ERF side.
4042
4143Changes Required
4244
4345- Host buffers
4446Add new temporary FArrayBox allocations for each new variable:
45- FArrayBox tmp_rainlsm (bx, 1, The_Pinned_Arena());
47+ FArrayBox tmp_variable (bx, 1, The_Pinned_Arena());
4648
4749and retrieve their array handles:
48- auto const& tmp_rainlsm_arr = tmp_rainlsm.array();
50+ auto const& tmp_variable_arr = tmp_rainlsm.array();
4951
5052- Device->Host copy (ParallelFor)
5153If the new field originates on the ERF side (e.g., forcing input), copy it from
@@ -57,19 +59,19 @@ copy-back section.
5759- Host->NoahMP copy (LoopOnCpu)
5860After GPU synchronization (Gpu::streamSynchronize()), extend the LoopOnCpu
5961block that writes to noahmpio fields:
60- noahmpio->RAINLSM (i,j) = tmp_rainlsm_arr (i,j,0);
62+ noahmpio->variable (i,j) = tmp_variable_arr (i,j,0);
6163
6264- Post-DriverMain copy (LoopOnCpu)
63- Add the reverse direction: copying noahmpio->RAINLSM values back into the
65+ Add the reverse direction: copying noahmpio->variable values back into the
6466temporary FArrayBox before GPU upload:
65- h_rainlsm_arr (i,j,0) = noahmpio->RAINLSM (i,j);
67+ h_variable_arr (i,j,0) = noahmpio->variable (i,j);
6668
6769- Host->Device copy-back (ParallelFor)
6870Finally, assign results into the correct ERF field:
69- RAINLSM (i,j,0) = tmp_rainlsm_arr (i,j,0);
71+ variable (i,j,0) = tmp_variable_arr (i,j,0);
7072
7173Follow the same block and comment style used for variables like TSK, EMISS,
72- and HFX.
74+ and HFX, and maintain case sensitivity as it is implemented for other variables .
7375
74763. Validation
7577
@@ -81,10 +83,7 @@ and HFX.
8183
82844. Actual Task
8385
84- Modify and link the following variable declared in NoahmpIOVarType.F90 and
85- allocated in NoahmpIOVarInitMod.F90:
86-
87- - RAINLSM, 2D array of type real(kind=kind_noahmp), with bounds (XSTART:XEND, YSTART:YEND)
86+ Modify and link the requested variables
8887
8988Ensure the field is fully integrated into the ERF-NoahMP coupling sequence
9089inside Advance_With_State() following the memory flow used for TSK.
0 commit comments