Skip to content
Snippets Groups Projects
Commit 0b2c88f3 authored by WAUTELET Philippe's avatar WAUTELET Philippe
Browse files

Philippe 09/07/2024: bugfix: do not overwrite freshly allocated CCPLFILE pointer

parent b919d2b1
No related branches found
No related tags found
No related merge requests found
...@@ -83,22 +83,21 @@ USE MODD_IO, ONLY : TFILE_OUTPUTLISTING ...@@ -83,22 +83,21 @@ USE MODD_IO, ONLY : TFILE_OUTPUTLISTING
! !
INTEGER, INTENT(IN) :: KFROM, KTO INTEGER, INTENT(IN) :: KFROM, KTO
! !
!JUAN ! Save current state for allocated arrays
LUNIT_MODEL(KFROM)%CCPLFILE => CCPLFILE
LUNIT_MODEL(KFROM)%TCPLFILE => TCPLFILE
!
IF (LUNIT_FIRST_CALL(KTO)) THEN IF (LUNIT_FIRST_CALL(KTO)) THEN
ALLOCATE (LUNIT_MODEL(KTO)%CCPLFILE(NPCPLFILEMAX)) !Do this AFTER saving current state to prevent loss of the correct allocated pointers if KFROM==KTO
LUNIT_MODEL(KTO)%CCPLFILE(:) = '' ALLOCATE ( LUNIT_MODEL(KTO)%CCPLFILE(NPCPLFILEMAX) )
! TCPLFILE allocation is done in ini_cpl directly at the right size => commented here LUNIT_MODEL(KTO)%CCPLFILE(:) = ''
! ALLOCATE (LUNIT_MODEL(KTO)%TCPLFILE(NPCPLFILEMAX)) ! TCPLFILE allocation is done in ini_cpl directly at the right size => commented here
LUNIT_FIRST_CALL(KTO) = .FALSE. ! ALLOCATE (LUNIT_MODEL(KTO)%TCPLFILE(NPCPLFILEMAX))
LUNIT_FIRST_CALL(KTO) = .FALSE.
ENDIF ENDIF
!JUAN
! !
TFILE_OUTPUTLISTING => LUNIT_MODEL(KTO)%TLUOUT TFILE_OUTPUTLISTING => LUNIT_MODEL(KTO)%TLUOUT
! !
! Save current state for allocated arrays
LUNIT_MODEL(KFROM)%CCPLFILE => CCPLFILE
LUNIT_MODEL(KFROM)%TCPLFILE => TCPLFILE
!
! Current model is set to model KTO ! Current model is set to model KTO
CINIFILE=>LUNIT_MODEL(KTO)%CINIFILE CINIFILE=>LUNIT_MODEL(KTO)%CINIFILE
TINIFILE=>LUNIT_MODEL(KTO)%TINIFILE TINIFILE=>LUNIT_MODEL(KTO)%TINIFILE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment