[{"data":1,"prerenderedAt":954},["ShallowReactive",2],{"navigation_docs_en":3,"-en-gray-scott-school-jour-3":66,"-en-gray-scott-school-jour-3-surround":949},[4,50,60],{"title":5,"path":6,"stem":7,"children":8},"The Gray Scott School","/en/gray-scott-school","en/1.gray-scott-school/01.index",[9,10,14,18,22,26,30,34,38,42,46],{"title":5,"path":6,"stem":7},{"title":11,"path":12,"stem":13},"CINERI Presentation","/en/gray-scott-school/presentation-cineri","en/1.gray-scott-school/02.presentation-cineri",{"title":15,"path":16,"stem":17},"Day 1 — Foundations","/en/gray-scott-school/jour-1","en/1.gray-scott-school/03.jour-1",{"title":19,"path":20,"stem":21},"Day 2 — C++ on CPU","/en/gray-scott-school/jour-2","en/1.gray-scott-school/04.jour-2",{"title":23,"path":24,"stem":25},"Day 3 — Fortran on CPU","/en/gray-scott-school/jour-3","en/1.gray-scott-school/05.jour-3",{"title":27,"path":28,"stem":29},"Day 4 — Kokkos on CPU","/en/gray-scott-school/jour-4","en/1.gray-scott-school/06.jour-4",{"title":31,"path":32,"stem":33},"Day 5 — Python on CPU","/en/gray-scott-school/jour-5","en/1.gray-scott-school/07.jour-5",{"title":35,"path":36,"stem":37},"Day 6 — SIMD with EVE + GPU architecture","/en/gray-scott-school/jour-6","en/1.gray-scott-school/08.jour-6",{"title":39,"path":40,"stem":41},"Day 7 — Python on GPU","/en/gray-scott-school/jour-7","en/1.gray-scott-school/09.jour-7",{"title":43,"path":44,"stem":45},"Day 8 — Fortran on GPU","/en/gray-scott-school/jour-8","en/1.gray-scott-school/10.jour-8",{"title":47,"path":48,"stem":49},"Day 9 — Kokkos on GPU","/en/gray-scott-school/jour-9","en/1.gray-scott-school/11.jour-9",{"title":51,"path":52,"stem":53,"children":54},"Projects","/en/projets","en/2.projets/1.index",[55,56],{"title":51,"path":52,"stem":53},{"title":57,"path":58,"stem":59},"SenLand","/en/projets/senland","en/2.projets/2.senland",{"title":61,"path":62,"stem":63,"children":64},"About","/en/a-propos","en/3.a-propos/1.index",[65],{"title":61,"path":62,"stem":63},{"id":67,"title":23,"badge":68,"body":69,"category":68,"description":937,"extension":938,"links":939,"meta":944,"navigation":946,"path":24,"seo":947,"stem":25,"tags":68,"__hash__":948},"docs_en/en/1.gray-scott-school/05.jour-3.md",null,{"type":70,"value":71,"toc":919},"minimark",[72,108,113,118,149,153,156,159,171,175,182,254,257,320,326,330,364,368,372,375,404,419,422,426,433,487,490,494,501,562,598,612,616,622,707,768,772,797,801,828,832,838,843,847,915],[73,74,75],"blockquote",{},[76,77,78,82,83,86,87,90,91,95,96,99,100,103,104,107],"p",{},[79,80,81],"strong",{},"June 24, 2026"," · Speaker: ",[79,84,85],{},"Vincent Lafage"," (IJCLab) · Marcel Vivargent Auditorium +\nsatellite sites (including CINERI) · at lunch, ",[79,88,89],{},"visit of the LAPP Museum",". The hands-on\nlives in ",[92,93,94],"code",{},"GrayScott2026/day-3-a/"," — ",[79,97,98],{},"CPU only",": the repo's ",[92,101,102],{},"GPU/"," and ",[92,105,106],{},"CUDA/"," folders will\nserve on Day 8.",[109,110,112],"h2",{"id":111},"morning-session-modern-fortran-the-language-of-arrays","Morning session — Modern Fortran, the language of arrays",[114,115,117],"h3",{"id":116},"_1-fortran-is-alive-and-well","1. Fortran is alive and well",[76,119,120,121,124,125,128,129,132,133,136,137,140,141,144,145,148],{},"The course opens with a proof by example: the ",[92,122,123],{},"Annexe/"," folder holds the same program in\nFORTRAN 66 (",[92,126,127],{},"obact66.f",") and Fortran 95 (",[92,130,131],{},"obact95.f90","), plus a genuine historical spaghetti\ndish (",[92,134,135],{},"spaghetti.f",") with its untangled version (",[92,138,139],{},"unspaghetti.f","). The 1957 language has\nbecome a ",[79,142,143],{},"modern"," one — modules, generic interfaces, coarrays — without losing its\nspecialty: ",[79,146,147],{},"numerical arrays",".",[114,150,152],{"id":151},"_2-column-major-the-trap-coming-from-c","2. Column-major — the trap coming from C",[76,154,155],{},"The first structural difference with C/C++: memory order.",[157,158],"d3-col-major",{},[76,160,161,162,165,166,170],{},"Everything Day 2 taught about memory walks still holds — but ",[79,163,164],{},"reversed",": in Fortran the\ninner loop must walk the ",[167,168,169],"em",{},"first"," dimension. A C reflex copied as-is halves the throughput.",[114,172,174],{"id":173},"_3-the-solver-in-four-modules","3. The solver in four modules",[76,176,177,178,181],{},"The hands-on Gray-Scott is cleanly split (",[92,179,180],{},"src/","):",[183,184,185,198],"table",{},[186,187,188],"thead",{},[189,190,191,195],"tr",{},[192,193,194],"th",{},"Module",[192,196,197],{},"Role",[199,200,201,216,230,240],"tbody",{},[189,202,203,209],{},[204,205,206],"td",{},[92,207,208],{},"floating_point_precision.f90",[204,210,211,212,215],{},"the ",[92,213,214],{},"pr"," kind — the whole solver's precision in one line",[189,217,218,223],{},[204,219,220],{},[92,221,222],{},"gray_scott_settings.f90",[204,224,225,226,229],{},"physical parameters + ",[79,227,228],{},"namelist"," (config without recompiling)",[189,231,232,237],{},[204,233,234],{},[92,235,236],{},"hdf5_utils.f90",[204,238,239],{},"HDF5 image output",[189,241,242,247],{},[204,243,244],{},[92,245,246],{},"gray_scott.f90",[204,248,249,250,253],{},"the program: init → ",[92,251,252],{},"evolve"," → output",[76,255,256],{},"The Laplacian stencil is picked among four variants (isotropy vs accuracy):",[183,258,259,272],{},[186,260,261],{},[189,262,263,266,269],{},[192,264,265],{},"Stencil",[192,267,268],{},"Center",[192,270,271],{},"Note",[199,273,274,285,298,309],{},[189,275,276,279,282],{},[204,277,278],{},"Central difference",[204,280,281],{},"−4",[204,283,284],{},"the classic 5-point",[189,286,287,292,295],{},[204,288,289],{},[79,290,291],{},"Weights-pretty (default)",[204,293,294],{},"−8",[204,296,297],{},"isotropic, used here",[189,299,300,303,306],{},[204,301,302],{},"Oono-Puri (1988)",[204,304,305],{},"−12/4",[204,307,308],{},"better isotropy",[189,310,311,314,317],{},[204,312,313],{},"Patra-Karttunen",[204,315,316],{},"−20/6",[204,318,319],{},"4th-order accurate",[321,322],"gs-heatmap",{":matrix":323,"note":324,"title":325},"[[1,1,1],[1,-8,1],[1,1,1]]","The center weighs −8, its eight neighbors +1.","Laplacian stencil — Weights-pretty (default)",[114,327,329],{"id":328},"_4-telling-the-compiler-your-intent","4. Telling the compiler your intent",[76,331,332,333,336,337,340,341,344,345,348,349,352,353,356,357,360,361,148],{},"The modern keywords are ",[79,334,335],{},"promises"," the compiler can exploit: ",[92,338,339],{},"pure"," / ",[92,342,343],{},"elemental"," (no side\neffects), ",[92,346,347],{},"contiguous"," (dense memory), ",[92,350,351],{},"do concurrent"," (independent iterations — the key to\nDays 8-9), and whole-array operations (",[92,354,355],{},"sum(stencil * U(i-1:i+1, j-1:j+1))",") that state ",[167,358,359],{},"what","\nto compute, not ",[167,362,363],{},"how",[109,365,367],{"id":366},"afternoon-session-precision-flags-variants","Afternoon session — Precision, flags, variants",[114,369,371],{"id":370},"_5-precision-in-one-line","5. Precision in one line",[76,373,374],{},"The hands-on precision module is three lines long — on purpose:",[376,377,382],"pre",{"className":378,"code":379,"language":380,"meta":381,"style":381},"language-fortran shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","module floating_point_precision\n  use, intrinsic :: iso_fortran_env, only: pr => REAL32\nend module\n","fortran","",[92,383,384,392,398],{"__ignoreMap":381},[385,386,389],"span",{"class":387,"line":388},"line",1,[385,390,391],{},"module floating_point_precision\n",[385,393,395],{"class":387,"line":394},2,[385,396,397],{},"  use, intrinsic :: iso_fortran_env, only: pr => REAL32\n",[385,399,401],{"class":387,"line":400},3,[385,402,403],{},"end module\n",[76,405,406,407,410,411,414,415,418],{},"Changing ",[92,408,409],{},"REAL32"," to ",[92,412,413],{},"REAL64"," switches ",[79,416,417],{},"the whole solver",". What you trade:",[420,421],"d3-float",{},[114,423,425],{"id":424},"_6-compensated-summation","6. Compensated summation",[76,427,428,429,432],{},"Summation order changes the floating-point result. The hands-on implements the four classic\nremedies (",[92,430,431],{},"Solutions/compensated_summation.f90"," — generic 1D/2D interfaces):",[183,434,435,445],{},[186,436,437],{},[189,438,439,442],{},[192,440,441],{},"Method",[192,443,444],{},"Idea",[199,446,447,457,467,477],{},[189,448,449,454],{},[204,450,451],{},[92,452,453],{},"sum_pairwise",[204,455,456],{},"recursive divide-and-conquer summation",[189,458,459,464],{},[204,460,461],{},[92,462,463],{},"sum_Kahan",[204,465,466],{},"carry a compensation term",[189,468,469,474],{},[204,470,471],{},[92,472,473],{},"sum_Neumaier",[204,475,476],{},"robust when the next term is larger",[189,478,479,484],{},[204,480,481],{},[92,482,483],{},"sum_KBN",[204,485,486],{},"Kahan-Babuška-Neumaier, the practical default",[488,489],"d3-kahan",{},[114,491,493],{"id":492},"_7-the-flags-exercise-same-sources-6-to-8","7. The flags exercise — same sources, ×6 to ×8",[76,495,496,497,500],{},"The hands-on script ",[92,498,499],{},"run_flags_exo.sh"," runs the demonstration end to end, measurements\nincluded:",[502,503,504,515,545],"ol",{},[505,506,507,510,511,514],"li",{},[79,508,509],{},"Detect the CPU's SIMD"," (",[92,512,513],{},"/proc/cpuinfo",": AVX2? AVX-512?);",[505,516,517,520,521,524,525,528,529,532,533,536,537,540,541,544],{},[79,518,519],{},"C",": ",[92,522,523],{},"speedcbrtf.c"," compiled scalar (",[92,526,527],{},"-O2 -fno-tree-vectorize",") then native\n(",[92,530,531],{},"-Ofast -march=native -ftree-vectorize -mrecip …",") — counting ",[92,534,535],{},"ymm"," registers in the\nbinary (",[92,538,539],{},"objdump | grep -c ymm",") to ",[167,542,543],{},"prove"," vectorization;",[505,546,547,520,550,553,554,557,558,561],{},[79,548,549],{},"Fortran",[92,551,552],{},"gfortran -fopt-info-vec"," prints the vectorized loops, and\n",[92,555,556],{},"-fopt-info-vec-missed"," explains ",[79,559,560],{},"why"," a loop was refused.",[376,563,567],{"className":564,"code":565,"language":566,"meta":381,"style":381},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","cd GrayScott2026/day-3-a\npixi run bash run_flags_exo.sh    # \"same sources, ×6-8 depending on flags\"\n","bash",[92,568,569,579],{"__ignoreMap":381},[385,570,571,575],{"class":387,"line":388},[385,572,574],{"class":573},"s2Zo4","cd",[385,576,578],{"class":577},"sfazB"," GrayScott2026/day-3-a\n",[385,580,581,585,588,591,594],{"class":387,"line":394},[385,582,584],{"class":583},"sBMFI","pixi",[385,586,587],{"class":577}," run",[385,589,590],{"class":577}," bash",[385,592,593],{"class":577}," run_flags_exo.sh",[385,595,597],{"class":596},"sHwdD","    # \"same sources, ×6-8 depending on flags\"\n",[76,599,600,601,604,605,103,608,611],{},"This is act one of \"the cube-root story\" — whose final word comes at Day 9's closing. To go\nfurther: ",[92,602,603],{},"maqao cqa --fct-loops=loop_cbrt"," analyzes the loop at assembly level\n(",[92,606,607],{},"OptimisationCbrtC/",[92,609,610],{},"OptimisationCbrtFortran/"," folders).",[114,613,615],{"id":614},"_8-the-repo-variants-one-solver-ten-experiments","8. The repo variants — one solver, ten experiments",[76,617,618,621],{},[92,619,620],{},"Solutions/"," declines the same solver to isolate each idea:",[183,623,624,634],{},[186,625,626],{},[189,627,628,631],{},[192,629,630],{},"Variant",[192,632,633],{},"What it isolates",[199,635,636,661,671,688],{},[189,637,638,655],{},[204,639,640,643,644,643,647,650,651,654],{},[92,641,642],{},"preopenmp"," → ",[92,645,646],{},"openmp",[92,648,649],{},"openmp_bis"," (+ ",[92,652,653],{},"_ptr",")",[204,656,657,660],{},[92,658,659],{},"!$omp"," parallelization step by step",[189,662,663,668],{},[204,664,665],{},[92,666,667],{},"blocking_ptr",[204,669,670],{},"Day 2's blocking, in Fortran",[189,672,673,681],{},[204,674,675,340,678],{},[92,676,677],{},"RK",[92,679,680],{},"CK",[204,682,683,684,687],{},"Runge-Kutta / Cash-Karp integrators — ",[167,685,686],{},"temporal"," accuracy",[189,689,690,701],{},[204,691,692,340,695,340,698],{},[92,693,694],{},"stdpar",[92,696,697],{},"openacc",[92,699,700],{},"openmp_offload",[204,702,703,704],{},"the GPU back-ends — ",[79,705,706],{},"see you on Day 8",[183,708,709,721],{},[186,710,711],{},[189,712,713,715,718],{},[192,714,630],{},[192,716,717],{},"Mechanism",[192,719,720],{},"Target",[199,722,723,737,754],{},[189,724,725,729,734],{},[204,726,727],{},[92,728,646],{},[204,730,731,733],{},[92,732,659],{}," directives",[204,735,736],{},"CPU cores",[189,738,739,743,747],{},[204,740,741],{},[92,742,694],{},[204,744,745],{},[92,746,351],{},[204,748,749,750,753],{},"multicore CPU ",[79,751,752],{},"or"," GPU",[189,755,756,762,765],{},[204,757,758,340,760],{},[92,759,697],{},[92,761,700],{},[204,763,764],{},"directives",[204,766,767],{},"GPU (Day 8)",[114,769,771],{"id":770},"_9-tested-or-it-does-not-count","9. Tested, or it does not count",[76,773,774,777,778,781,782,784,785,788,789,792,793,796],{},[92,775,776],{},"Solutions/test_stencil.f90"," checks the stencil's ",[79,779,780],{},"invariants"," (Laplacian multiple,\nnormalization) with tolerance — Day 1's rules applied directly. And ",[92,783,123],{}," shows ",[79,786,787],{},"pFUnit","\ntests (",[92,790,791],{},"test_roman_numeral.pf",", ",[92,794,795],{},"test_divisor.pf","): the unit-testing framework of the Fortran\nworld.",[109,798,800],{"id":799},"the-annexe-the-cabinet-of-curiosities","The Annexe — the cabinet of curiosities",[76,802,803,804,807,808,811,812,815,816,792,819,822,823,340,825,827],{},"Vincent Lafage's pedagogical signature: ",[92,805,806],{},"santa_claus_problem_caf.f90"," (the Santa Claus\nproblem… in ",[79,809,810],{},"coarrays",", Fortran 2008's native parallelism), ",[92,813,814],{},"roman_numeral.F90"," (+ its\ntests), ",[92,817,818],{},"physconst.f90",[92,820,821],{},"decimal_interface.f90",", and the ",[92,824,135],{},[92,826,139],{}," duo\nthat sums up 60 years of the language.",[109,829,831],{"id":830},"on-video-the-official-replays","On video — the official replays",[833,834],"yt-embed",{"caption":835,"id":836,"title":837},"Replay — Fortran On CPU (Gray Scott Thursdays)","NytdgsWDqwY","Fortran On CPU",[833,839],{"caption":840,"id":841,"title":842},"Replay — Computing Precision: floating-point in practice (Gray Scott Thursdays)","uSscpDxrPek","Computing Precision",[109,844,846],{"id":845},"sources-official-material","Sources & official material",[848,849,850,863,874,884,894],"ul",{},[505,851,852,855,856],{},[79,853,854],{},"The course repository",":\n",[857,858,862],"a",{"href":859,"rel":860},"https://gitlab.in2p3.fr/lafage/GrayScottFortranTuto",[861],"nofollow","gitlab.in2p3.fr/lafage/GrayScottFortranTuto",[505,864,865,868,869],{},[79,866,867],{},"The day's slides"," (PDF, school GitLab wiki):\n",[857,870,873],{"href":871,"rel":872},"https://gitlab.in2p3.fr/CTA-LAPP/COURS/GRAY_SCOTT_REVOLUTIONS/GrayScott2026/-/wikis/uploads/GrayScottDay-3/FortranFurious_IJC_dual_GS_2026.pdf",[861],"FortranFurious — IJC dual GS 2026",[505,875,876,878,879],{},[79,877,787],{}," (Fortran unit tests):\n",[857,880,883],{"href":881,"rel":882},"https://github.com/Goddard-Fortran-Ecosystem/pFUnit_demos",[861],"github.com/Goddard-Fortran-Ecosystem/pFUnit_demos",[505,885,886,855,889],{},[79,887,888],{},"Video replays (YouTube)",[857,890,893],{"href":891,"rel":892},"https://www.youtube.com/playlist?list=PLiZttWgOMudb6PsUoWtxY3G4Gv8f2lurG",[861],"Gray Scott Thursdays",[505,895,896,899,900,903,904,909,910],{},[79,897,898],{},"Course containers"," (podman/apptainer, ",[92,901,902],{},"grayscott_fortran_*"," images):\n",[857,905,908],{"href":906,"rel":907},"https://cta-lapp.pages.in2p3.fr/COURS/GRAY_SCOTT_REVOLUTIONS/GrayScott2026/redirection.html?label=partContainerListTimeTable",[861],"container list"," ·\n",[857,911,914],{"href":912,"rel":913},"https://cta-lapp.pages.in2p3.fr/COURS/GRAY_SCOTT_REVOLUTIONS/GrayScott2026/index.html",[861],"school website",[916,917,918],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}",{"title":381,"searchDepth":394,"depth":394,"links":920},[921,927,934,935,936],{"id":111,"depth":394,"text":112,"children":922},[923,924,925,926],{"id":116,"depth":400,"text":117},{"id":151,"depth":400,"text":152},{"id":173,"depth":400,"text":174},{"id":328,"depth":400,"text":329},{"id":366,"depth":394,"text":367,"children":928},[929,930,931,932,933],{"id":370,"depth":400,"text":371},{"id":424,"depth":400,"text":425},{"id":492,"depth":400,"text":493},{"id":614,"depth":400,"text":615},{"id":770,"depth":400,"text":771},{"id":799,"depth":394,"text":800},{"id":830,"depth":394,"text":831},{"id":845,"depth":394,"text":846},"June 24, with Vincent Lafage: Fortran 2018 on CPU all day — the language of arrays, floating-point precision, the flags exercise, and the Gray-Scott solver in modern Fortran.","md",[940],{"label":941,"icon":942,"to":859,"target":943},"Course repository","i-lucide-git-branch","_blank",{"icon":945},"lucide:function-square",true,{"title":23,"description":937},"px3Je1ckoyX-4AcMbSKGkCLmNAwEYz8KNaI4VARaNGk",[950,952],{"title":19,"path":20,"stem":21,"description":951,"children":-1},"Two sessions on June 23: C++ 17/20/23 on CPU in the morning, advanced optimization (blocking & Pyramid) in the afternoon. Measure, understand the stencil, exploit the cache.",{"title":27,"path":28,"stem":29,"description":953,"children":-1},"June 25, with Paul Zehner, Juan-José Silva Cuevas and Thomas Padioleau: Kokkos on CPU — one C++ source, backends chosen at compile time, Views, parallel_for and SIMD.",1783172490753]