From dc63a5b2db47c30b128d4de6da2a386161ecb20f Mon Sep 17 00:00:00 2001
From: Dethinne Thomas <tdethinne@uliege.be>
Date: Tue, 3 Dec 2024 12:15:34 +0000
Subject: [PATCH] Update caraib_main_01_Iv_couplage.F

---
 .../caraib_main_01_Iv_couplage.F                 | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/couplage/CARAIB/ver01_Iv_couplage/caraib_main_01_Iv_couplage.F b/couplage/CARAIB/ver01_Iv_couplage/caraib_main_01_Iv_couplage.F
index 2a1182a..c6f8f5e 100644
--- a/couplage/CARAIB/ver01_Iv_couplage/caraib_main_01_Iv_couplage.F
+++ b/couplage/CARAIB/ver01_Iv_couplage/caraib_main_01_Iv_couplage.F
@@ -135,6 +135,15 @@ c     time step for hydrological module (IBM) integration (day)
       call open_input5(nyrmax,itmt,stept,iread)
       write(*,*) 'open input file finish'
       
+      ! If this is not the first iteration, then you can read the spinup data
+      if (first_iter.eq.0) then
+        ifrac = 0
+        ifrac_rd = 1
+        ilai_rd = 1
+        iread = 1
+
+      endif
+
       if (ifull.eq.1) open(99924,file=filres)
       write(*,*) 'ifull file finish'
 c=======================================================================
@@ -474,14 +483,7 @@ c    - pixel area
 c=======================================================================	
         if (first_iter.eq.1) call pixel_corners(ngt)
         
-        ! If this is not the first iteration, then you can read the spinup data
-        if (first_iter.eq.0) then
-          ifrac = 0
-          ifrac_rd = 1
-          ilai_rd = 1
-          iread = 1
 
-        endif
 c=======================================================================
 c   reads land use file and 
 c   initialization of variables for all pixels
-- 
GitLab