From 564b7fc0ada3a1a2a025f73de345266ffb7a7eeb Mon Sep 17 00:00:00 2001
From: Thomas Hayward-Schneider <thomas.hayward@ipp.mpg.de>
Date: Wed, 2 Nov 2022 15:10:24 +0100
Subject: [PATCH] Allocate and set output_message when returning with error

---
 src-f90/chease_imas_vDD3_5.3PUAL3_3.8.f90 | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src-f90/chease_imas_vDD3_5.3PUAL3_3.8.f90 b/src-f90/chease_imas_vDD3_5.3PUAL3_3.8.f90
index 300d29fc..23eafcb9 100644
--- a/src-f90/chease_imas_vDD3_5.3PUAL3_3.8.f90
+++ b/src-f90/chease_imas_vDD3_5.3PUAL3_3.8.f90
@@ -697,6 +697,8 @@ subroutine chease(equil_in_ids,equil_out_ids,param_input_ids,flag_status,output_
       allocate(eqchease_out(index_out)%codeparam%output_diag(1))
       eqchease_out(index_out)%codeparam%output_diag(1) = 'ERROR in chease_new.f90: Could not assign some code parameters.'
       eqchease_out(index_out)%codeparam%output_flag = -10
+      allocate(character(len=40)::output_message)
+      output_message = "chease_new error: assigning params"
       equil_out => eqchease_out
       return
     end if
@@ -828,6 +830,8 @@ subroutine chease(equil_in_ids,equil_out_ids,param_input_ids,flag_status,output_
       if (nverbose .ge. 0) write(0,*) 'for time: eqchease_out(index_out)%time= ',eqchease_out(index_out)%time
       if (nverbose .ge. 0) write(0,*) 'there were problems in stepon, quit chease'
       call flush(0)
+      allocate(character(len=20)::output_message)
+      output_message = "stepon error"
       equil_out => eqchease_out
       call copy_itm_to_ids_equilibrium(equil_out,equil_out_ids,flag_status,extra_data_itm_to_ids,iextra_option)
       print *,'equil_out_ids%time= ',equil_out_ids%time
-- 
GitLab