diff --git a/CHANGES.txt b/CHANGES.txt
index 685a5702b3fa5a2057b53a7b3dc473753cc9b5ca..c08e8568500f6bc129aa2ee3564d15923a31a64a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -17,6 +17,7 @@ Global
 * Added 'files2config' tool to extract input file info from logs and scripts
 * Added variable replacement beta options to the '...2config' tools
 * Added output of file name in -d mode of 'namelist2config'
+* Added file tags for 'output_nml' groups in 'namelist2config'
 
 Configuration
 -------------
diff --git a/namelist2config b/namelist2config
index 4c8c31ad31c0e3e4c4b589e83a0b10bebd5622d7..3385a128fa03f1906d987946c0eb094cbdc550f3 100755
--- a/namelist2config
+++ b/namelist2config
@@ -190,6 +190,17 @@ unless($direct) {
     for my $file (sort keys %namelists) {
         print("  [[$file]]\n");
         $namelist_file = $namelists{$file};
+
+        # Replace TODO markers for output_nml by output_filename info
+        for my $group (grep(/^output_nml/, keys %$namelist_file)) {
+            $namelist_group = $namelist_file->{$group};
+            my $key = subst_value($namelist_group->{output_filename}->[0]);
+            $key =~ s/^\$\{EXP_ID\}_//;
+            $key = 'output_nml '.$key;
+            $namelist_file->{$key} = $namelist_group;
+            delete $namelist_file->{$group};
+        }
+
         for my $group (sort keys %$namelist_file) {
             print("    [[[$group]]]\n");
             $namelist_group = $namelist_file->{$group};