From 458ae7cc2a33d59342619989059064f7b186959f Mon Sep 17 00:00:00 2001
From: JorisP <pianezze.joris@gmail.com>
Date: Thu, 12 Oct 2023 21:34:29 +0200
Subject: [PATCH] Add make toy and modify some scripts names

---
 .../2_input_toy/TOYNAMELIST.nam               | 18 ++++++-------
 ..._and_restart_files_for_TOY_from_etopo2.py} | 26 +++++++++----------
 .../2_input_toy/run_prep_toy                  |  2 +-
 ...check_exchanges_between_mesonh_and_toy.py} |  0
 .../A_cpl_mnh_toy/run_mesonh_xyz              |  3 +--
 .../A_cpl_mnh_toy/run_plot                    |  2 +-
 src/Makefile                                  |  5 +++-
 src/Makefile.MESONH.mk                        |  4 +--
 8 files changed, 31 insertions(+), 29 deletions(-)
 rename MY_RUN/KTEST/013_Iroise_OASIS_coupling/2_input_toy/{create_grid_and_restart_files_for_TOY.py => create_grid_and_restart_files_for_TOY_from_etopo2.py} (89%)
 rename MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/{plot_coupling_model_toy.py => plot_check_exchanges_between_mesonh_and_toy.py} (100%)

diff --git a/MY_RUN/KTEST/013_Iroise_OASIS_coupling/2_input_toy/TOYNAMELIST.nam b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/2_input_toy/TOYNAMELIST.nam
index 7306d0b86..c36fbfd75 100644
--- a/MY_RUN/KTEST/013_Iroise_OASIS_coupling/2_input_toy/TOYNAMELIST.nam
+++ b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/2_input_toy/TOYNAMELIST.nam
@@ -1,12 +1,12 @@
-&NAM_OASIS IL_NB_TIME_STEPS=6,
-           DELTA_T=60,
-           DATA_FILENAME='grid_toy_model.nc' /
+&nam_grid ntime_steps    = 6,
+           time_step      = 60,
+           grid_file_name = 'grid_toy_model.nc' /
 
-&NAM_FCT_SEND CTYPE_FCT='SINUS',
-              VALUE=0.011 /
+&nam_fct_send type_send='sinus',
+              value_send=0.011 /
 
-&NAM_RECV_FIELDS NB_RECV_FIELDS=1,
-                 CRCVFIELDS(1)='VARRCV01' /
+&nam_recv_fields nrecv_fields=1,
+                 name_recv_fields(1)='VARRCV01' /
 
-&NAM_SEND_FIELDS NB_SEND_FIELDS=1, 
-                 CSNDFIELDS(1)='VARSIN01' / 
+&nam_send_fields nsend_fields=1, 
+                 name_send_fields(1)='VARSIN01' / 
diff --git a/MY_RUN/KTEST/013_Iroise_OASIS_coupling/2_input_toy/create_grid_and_restart_files_for_TOY.py b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/2_input_toy/create_grid_and_restart_files_for_TOY_from_etopo2.py
similarity index 89%
rename from MY_RUN/KTEST/013_Iroise_OASIS_coupling/2_input_toy/create_grid_and_restart_files_for_TOY.py
rename to MY_RUN/KTEST/013_Iroise_OASIS_coupling/2_input_toy/create_grid_and_restart_files_for_TOY_from_etopo2.py
index 03f6f66f9..2f73d36fb 100755
--- a/MY_RUN/KTEST/013_Iroise_OASIS_coupling/2_input_toy/create_grid_and_restart_files_for_TOY.py
+++ b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/2_input_toy/create_grid_and_restart_files_for_TOY_from_etopo2.py
@@ -144,22 +144,22 @@ grid_file.createDimension ('ncorner',   4)
 # ----------------------------------
 #   Create the variables of the files
 # ----------------------------------
-varout=grid_file.createVariable('lon',  'd',(          'nlat','nlon'))
-varout=grid_file.createVariable('lat',  'd',(          'nlat','nlon'))
-varout=grid_file.createVariable('clo',  'd',('ncorner','nlat','nlon'))
-varout=grid_file.createVariable('cla',  'd',('ncorner','nlat','nlon'))
-varout=grid_file.createVariable('srf',  'd',(          'nlat','nlon'))
-varout=grid_file.createVariable('imask','d',(          'nlat','nlon'))
+varout=grid_file.createVariable('lon', 'd',(          'nlat','nlon'))
+varout=grid_file.createVariable('lat', 'd',(          'nlat','nlon'))
+varout=grid_file.createVariable('clo', 'd',('ncorner','nlat','nlon'))
+varout=grid_file.createVariable('cla', 'd',('ncorner','nlat','nlon'))
+varout=grid_file.createVariable('srf', 'd',(          'nlat','nlon'))
+varout=grid_file.createVariable('mask','d',(          'nlat','nlon'))
 
 # ---------------------------------------
 #   Write out the data arrays into the file
 # ---------------------------------------
-grid_file.variables['lon']  [  :,:] = lon    [  :,:]
-grid_file.variables['lat']  [  :,:] = lat    [  :,:]
-grid_file.variables['clo']  [:,:,:] = clo    [:,:,:]
-grid_file.variables['cla']  [:,:,:] = cla    [:,:,:]
-grid_file.variables['srf']  [  :,:] = surface[  :,:]
-grid_file.variables['imask'][  :,:] = mask   [  :,:]
+grid_file.variables['lon'] [  :,:] = lon    [  :,:]
+grid_file.variables['lat'] [  :,:] = lat    [  :,:]
+grid_file.variables['clo'] [:,:,:] = clo    [:,:,:]
+grid_file.variables['cla'] [:,:,:] = cla    [:,:,:]
+grid_file.variables['srf'] [  :,:] = surface[  :,:]
+grid_file.variables['mask'][  :,:] = mask   [  :,:]
 
 # ---------------------------------------
 #   Close the file
@@ -198,4 +198,4 @@ rstrt_file.variables['VARSIN02'][:,:] = toyvarsinus[:,:]
 # ---------------------------------------
 #   Close the file
 # ---------------------------------------
-rstrt_file.close()
\ No newline at end of file
+rstrt_file.close()
diff --git a/MY_RUN/KTEST/013_Iroise_OASIS_coupling/2_input_toy/run_prep_toy b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/2_input_toy/run_prep_toy
index e0214e226..795a43ae1 100755
--- a/MY_RUN/KTEST/013_Iroise_OASIS_coupling/2_input_toy/run_prep_toy
+++ b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/2_input_toy/run_prep_toy
@@ -17,6 +17,6 @@ else
    echo '--------------------------------------'
 
    ln -sf $PREP_PGD_FILES/etopo2.nc topo.nc
-   python3 create_grid_and_restart_files_for_TOY.py
+   python3 create_grid_and_restart_files_for_TOY_from_etopo2.py
 
 fi
diff --git a/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/plot_coupling_model_toy.py b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/plot_check_exchanges_between_mesonh_and_toy.py
similarity index 100%
rename from MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/plot_coupling_model_toy.py
rename to MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/plot_check_exchanges_between_mesonh_and_toy.py
diff --git a/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/run_mesonh_xyz b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/run_mesonh_xyz
index dbc2c14b4..3c1d5cfcd 100755
--- a/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/run_mesonh_xyz
+++ b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/run_mesonh_xyz
@@ -7,8 +7,7 @@ echo '--------------------------------------'
 export PATH_EXETOY=${SRC_MESONH}/src/LIB/toy_1.0/
 
 #~~~~~ MESONH
-ln -sf ../1_input_mnh/IROISE_5KM.* .
-ln -sf ../1_input_mnh/IROISE_5KM_201109_0?_??.* .
+ln -sf ../1_input_mnh/IROISE_5KM* .
 ln -sf ../1_input_mnh/EXSEG1.nam .
 cp     ../1_input_mnh/rstrt_MNH.nc rst_A.nc
 
diff --git a/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/run_plot b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/run_plot
index 2c669619d..fd117c240 100755
--- a/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/run_plot
+++ b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/run_plot
@@ -1,3 +1,3 @@
 #!/bin/bash 
 
-python3 plot_coupling_model_toy.py
+python3 plot_check_exchanges_between_mesonh_and_toy.py
diff --git a/src/Makefile b/src/Makefile
index 3ae75868a..b13e1975e 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -386,11 +386,14 @@ ifeq "$(VER_OASIS)" "OASISAUTO"
 #
 oasis : $(OASIS_KEY)
 $(OASIS_KEY): 
-	cd ${SRC_MESONH}/src/LIB/oasis3-mct_${VERSION_OASIS}/util/make_dir && make realclean -f TopMakefileOasis3 && make -f TopMakefileOasis3 && cd ${SRC_MESONH}/src/LIB/toy_${VERSION_TOY} && make clean && make
+	cd ${SRC_MESONH}/src/LIB/oasis3-mct_${VERSION_OASIS}/util/make_dir && make realclean -f TopMakefileOasis3 && make -f TopMakefileOasis3 && cd ${SRC_MESONH}/src/LIB/toy_${VERSION_TOY} && make clean -f Makefile_OASISMNH && make -f Makefile_OASISMNH
 
 cleanmaster : cleanoasis
 cleanoasis :
 	- [ -d ${OASIS_PATH} ] && rm -fr  ${OASIS_PATH}
+
+toy:
+	cd ${SRC_MESONH}/src/LIB/toy_${VERSION_TOY} && make clean -f Makefile_OASISMNH && make -f Makefile_OASISMNH
 endif
 ##########################################################
 #                                                        #
diff --git a/src/Makefile.MESONH.mk b/src/Makefile.MESONH.mk
index 592b47ae0..791ff37ea 100644
--- a/src/Makefile.MESONH.mk
+++ b/src/Makefile.MESONH.mk
@@ -509,7 +509,7 @@ endif
 # OASIS installed manually, need to defined OASISDIR environment variable
 ifeq "$(VER_OASIS)" "OASISPERSO"
 ifndef OASISDIR
-$(error You chose VER_OASIS=OASISPERSO, please set OASISDIR environment variable)
+$(error You have chosen VER_OASIS=OASISPERSO, please set OASISDIR environment variable)
 endif
 OASIS_PATH ?= ${OASISDIR}
 OASIS_KEY ?= ${OASIS_PATH}/build/lib/psmile.MPI1/mod_oasis.mod
@@ -559,7 +559,7 @@ endif
 ifeq "$(VER_CDF)" "CDFPERSO"
 #
 ifndef NETCDF_CONFIG
-$(error You chose VER_CDF=CDFPERSO, please set NETCDF_CONFIG environment variable)
+$(error You have chosen VER_CDF=CDFPERSO, please set NETCDF_CONFIG environment variable)
 endif
 #
 INC_NETCDF     ?= $(shell $(NETCDF_CONFIG) --fflags)
-- 
GitLab