diff --git a/dartwrf/assimilate.py b/dartwrf/assimilate.py
index 33b3264fb7693089d2be9cd894fe14080f398946..cd8d96b2d08eb2526c44adf4cdd6b2b347a77390 100755
--- a/dartwrf/assimilate.py
+++ b/dartwrf/assimilate.py
@@ -399,6 +399,13 @@ def archive_filter_diagnostics(time, f_out_pattern):
     copy(cluster.dart_rundir + "/obs_seq.final", f_archive)
     print(f_archive, "saved.")
 
+def txtlink_to_prior(time, prior_init_time, prior_path_exp):
+    """For documentation: Which prior was used? -> write into txt file"""
+    os.makedirs(cluster.archivedir + time.strftime('/%Y-%m-%d_%H:%M/'), exist_ok=True)
+    os.system('echo "'+prior_path_exp+'\n'+prior_init_time.strftime('/%Y-%m-%d_%H:%M/')
+                +'\n'+time.strftime('/wrfrst_d01_%Y-%m-%d_%H:%M:%S')+'" > '
+                +cluster.archivedir + time.strftime('/%Y-%m-%d_%H:%M/')+'link_to_prior.txt')
+
 def get_obsseq_out(time):
     """Prepares an obs_seq.out file in the run_DART folder
     If `exp.use_existing_obsseq` points to an existing file, then this is used.
@@ -584,6 +591,7 @@ def main(time, prior_init_time, prior_valid_time, prior_path_exp):
     filter()
     archive_filteroutput(time)
     archive_filter_diagnostics(time, pattern_obs_seq_final)
+    txtlink_to_prior(time, prior_init_time, prior_path_exp)
 
     if prior_inflation_type == '2':
         archive_inflation_2(time)
diff --git a/dartwrf/prep_IC_prior.py b/dartwrf/prep_IC_prior.py
index 8ad84de5b782a8a1afcc492361fe2e6301f10d8b..95efb7f7f62bf5f0e99773dd93114857aa368f34 100755
--- a/dartwrf/prep_IC_prior.py
+++ b/dartwrf/prep_IC_prior.py
@@ -22,11 +22,6 @@ Ad 2: copies wrfrst to run_WRF directory
 def create_wrfrst_in_WRF_rundir(time, prior_init_time, prior_path_exp):
     """copies wrfrst to run_WRF directory (for next WRF run)
     """
-    # for documentation: Which prior was used? -> write into txt file
-    os.makedirs(cluster.archivedir + time.strftime('/%Y-%m-%d_%H:%M/'), exist_ok=True)
-    os.system('echo "'+prior_path_exp+'\n'+prior_init_time.strftime('/%Y-%m-%d_%H:%M/')
-                +'\n'+time.strftime('/wrfrst_d01_%Y-%m-%d_%H:%M:%S')+'" > '
-                +cluster.archivedir + time.strftime('/%Y-%m-%d_%H:%M/')+'link_to_prior.txt')
 
     for iens in range(1, exp.n_ens+1):
         clean_wrfdir(cluster.wrf_rundir(iens))