diff --git a/templates/real-from-dwd-ana/prepare_namelist.py b/templates/real-from-dwd-ana/prepare_namelist.py
index 4816f66516f439672a740921a6670f5beb0539f6..a9be67bc20e08d94b6a08fbc1430e632221ed184 100644
--- a/templates/real-from-dwd-ana/prepare_namelist.py
+++ b/templates/real-from-dwd-ana/prepare_namelist.py
@@ -120,6 +120,8 @@ def main():
     """
     # Process atmosphere namelist
     atmosphere_namelist = f90nml.read(ATMOSPHERE_NAMELIST_PATH.as_posix())
+    # Convert output_nml to a cogroup.
+    atmosphere_namelist.create_cogroup("output_nml")
     print("Original atmosphere namelist:")
     print(atmosphere_namelist)
     atmosphere_namelist.patch(atmosphere_namelist_replacements)