Skip to content

Commit ea48d61

Browse files
Merge pull request #18 from CMCC-Foundation/debug_prints
Debug_prints_1
2 parents 44fc779 + f99c214 commit ea48d61

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,13 @@ def run_medslik_sim(self, simdir, simname, separate_slicks=False):
367367
# Compile and start running (replacing `cd` with `cwd`)
368368
compile_script_path = os.path.abspath(os.path.join(model_dir, "RUN", "MODEL_SRC", "compile.sh"))
369369
run_script_path = os.path.abspath(os.path.join(model_dir, "RUN", "RUN.sh"))
370+
print("DEBUG: Starting Fortran compilation")
370371
subprocess.run([compile_script_path], check=True, cwd=os.path.join(model_dir, "RUN")) # nosec
372+
print("DEBUG: Fortran compilation finished")
373+
print("DEBUG: Starting Medslik-II simulation")
371374
subprocess.run([run_script_path], check=True, cwd=os.path.join(model_dir, "RUN")) # nosec
375+
print("DEBUG: Medslik-II simulation finished")
376+
372377

373378
else:
374379
# Handle separate slicks

src/preprocessing/preprocessing_mdk3.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def process_currents(self, oce_path: str = None):
7070
concat = concat.resample(time="1h").interpolate("linear")
7171
Utils.write_mrc(concat, exp_folder=self.exp_folder)
7272
self._copy_nc_files(oce_path, f"{self.exp_folder}/oce_files/")
73+
print("DEBUG: process_currents() completed")
7374

7475
def process_winds(self, met_path: str = None):
7576

@@ -95,6 +96,7 @@ def process_winds(self, met_path: str = None):
9596
# Call write eri function located in medslik.utils file
9697
Utils.write_eri(concat, date, exp_folder=self.exp_folder)
9798
self._copy_nc_files(met_path, f"{self.exp_folder}/met_files/")
99+
print("DEBUG: process_winds() completed")
98100

99101
def _copy_nc_files(self, src_files: str, dst_dir: str) -> None:
100102
# Use glob to find all .nc files in the source directory
@@ -231,6 +233,7 @@ def process_medslik_memmory_array(self):
231233

232234
# Replacing NMAX in medslik Fortran with a Python function
233235
Utils.search_and_replace(med_for, 'NMAX', str(nmax))
236+
print("DEBUG: medslik_II.for ready")
234237

235238
def configuration_parameters(self):
236239

@@ -339,6 +342,7 @@ def write_config_files(self,
339342
slik = "NO"
340343
# Writing that will use slick countor
341344
Utils.search_and_replace(config_file, "SSLICK", f"{slik}")
345+
print("DEBUG: config1.txt written")
342346

343347
if __name__ == "__main__":
344348

src/utils/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ def write_mrc(ds, exp_folder=None):
246246
f"{row['lat']:<10.4f} {row['lon']:<10.4f} {row['SST']:<10.4f} {row['u_srf']:<10.4f} {row['v_srf']:<10.4f} {row['u_10m']:<10.4f} {row['v_10m']:<10.4f} {row['u_30m']:<10.4f} {row['v_30m']:<10.4f} {row['u_120m']:<10.4f} {row['v_120m']:<10.4f}\n"
247247
)
248248
print("Sea State variables written")
249+
print("DEBUG: Finished writing all .mrc files")
250+
249251

250252
@staticmethod
251253
def write_eri(ds, date, exp_folder=None):

0 commit comments

Comments
 (0)