From 4070de0f520082d93f010b20265849cb0d7c7e48 Mon Sep 17 00:00:00 2001
From: Dethinne Thomas <tdethinne@uliege.be>
Date: Wed, 27 Nov 2024 09:22:31 +0000
Subject: [PATCH] correct some issues in the python scripts

---
 couplage/code python/CAR2MAR_co2_tprev.py      |  4 ++--
 couplage/code python/CAR2MAR_fire.py           |  2 +-
 couplage/code python/MAR2CAR_landuse.py        |  1 -
 couplage/code python/create_necessary_files.py | 14 +++++++-------
 4 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/couplage/code python/CAR2MAR_co2_tprev.py b/couplage/code python/CAR2MAR_co2_tprev.py
index d51a7ab..710c78e 100644
--- a/couplage/code python/CAR2MAR_co2_tprev.py	
+++ b/couplage/code python/CAR2MAR_co2_tprev.py	
@@ -53,7 +53,7 @@ def open_mar(path):
 
 def main_tprev(ys):
 	# Copy the file
-	shutil.copy('./temyyyy.dat', f'./tem{ys}.dat')
+	shutil.copy('./temyyyy.dat', f'./tem{ys}.res')
 
 
 """##############################################################################################################"""
@@ -338,7 +338,7 @@ if __name__ == '__main__':
     t0=ti()
     
     ys = 2009 #starting year -1
-    ye = 2015 #end year
+    ye = 2024 #end year
    
     # main_tprev(ys)
     main_co2(ys,ye)
diff --git a/couplage/code python/CAR2MAR_fire.py b/couplage/code python/CAR2MAR_fire.py
index 435e6f5..d6bd142 100644
--- a/couplage/code python/CAR2MAR_fire.py	
+++ b/couplage/code python/CAR2MAR_fire.py	
@@ -126,7 +126,7 @@ def interpol(lon_m, lat_m, lon_e, lat_e, data_e):
 def write_file(lon_m, lat_m, data):
     var_values = data
     
-    print("Start writing the file")
+    print("Start writing the lightning file")
     for i in np.arange(0,np.shape(lon_m)[1]):
         for j in np.arange(0,np.shape(lat_m)[0]):
             
diff --git a/couplage/code python/MAR2CAR_landuse.py b/couplage/code python/MAR2CAR_landuse.py
index f1998e2..769614d 100644
--- a/couplage/code python/MAR2CAR_landuse.py	
+++ b/couplage/code python/MAR2CAR_landuse.py	
@@ -76,7 +76,6 @@ def main_landuse(path_to_mar):
 
     f = open('./land_use_caraib.dat', "w")
     
-    print(range(len(mar.x.values)))
     for i in range(len(mar.x.values)):
         for j in range(len(mar.y.values)):
             
diff --git a/couplage/code python/create_necessary_files.py b/couplage/code python/create_necessary_files.py
index e7f07c8..4ee0714 100644
--- a/couplage/code python/create_necessary_files.py	
+++ b/couplage/code python/create_necessary_files.py	
@@ -25,7 +25,7 @@ from MAR2CAR_clim import main_climatology
 
 from MAR2CAR_landuse import main_landuse
 
-#from CAR2MAR_sowing import main_sowing
+#from CAR2MAR_sowing import main_sowing   TODO
 
 from CAR2MAR_fire import main_fire
 
@@ -55,10 +55,10 @@ def ti():
 if __name__ == '__main__':
     t0=ti()
     
-    path_to_MAR_ICE = "D:/MAR_data_raw_BE/MERRA/"
+    path_to_MAR_ICE = "E:/MAR_data_raw_BE/MERRA/"
     
-    path_to_sowing = "D:/MAR_data_raw_BE/MERRA/"
-    path_to_fire = "D:/Car_files/data.ascii" #data.ascii input file
+    path_to_sowing = "E:/MAR_data_raw_BE/MERRA/"
+    path_to_fire = "E:/Car_files/data.ascii" #data.ascii input file
     path_to_manage = "./man/" #manageYYYY.dat file output
     
     do_sowing = 0
@@ -72,8 +72,8 @@ if __name__ == '__main__':
     ys = 2009 #starting year -1
     ye = 2024 #end year
     
-    print("Creating the climatology files")
-    main_climatology(path_to_MAR_ICE)
+    # print("Creating the climatology files")
+    # main_climatology(path_to_MAR_ICE)
 
     print("Creating the Landuse files")
     main_landuse(path_to_MAR_ICE)
@@ -84,7 +84,7 @@ if __name__ == '__main__':
     print("Creating the Temprev")
     main_tprev(ys)
     
-    # print("Creating the sowing files")
+    # print("Creating the sowing files")  TODO
     # if do_sowing : main_sowing(path_to_sowing, path_to_MAR_ICE)
     
     print("Creating the fire files")
-- 
GitLab