diff --git a/MY_RUN/KTEST/013_Iroise_OASIS_coupling/1_input_mnh/EXSEG1.nam b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/1_input_mnh/EXSEG1.nam new file mode 100644 index 0000000000000000000000000000000000000000..752548352bfe3d7ea9286484252327bad44f249d --- /dev/null +++ b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/1_input_mnh/EXSEG1.nam @@ -0,0 +1,72 @@ +&NAM_OASIS LOASIS = .TRUE., + LOASIS_GRID = .TRUE., + CMODEL_NAME = 'mesonh' / + +&NAM_SFX_WAVE_CPL XTSTEP_CPL_WAVE = 60.0, + CWAVE_U10 = 'MNH__U10', + CWAVE_V10 = ' ', + CWAVE_CHA = 'MNH__CHA', + CWAVE_UCU = ' ', + CWAVE_VCU = ' ', + CWAVE_HS = ' ', + CWAVE_TP = ' ' / + +&NAM_SFX_SEA_CPL XTSTEP_CPL_SEA = -1.0, + CSEA_FWSU = ' ', + CSEA_FWSV = ' ', + CSEA_HEAT = ' ', + CSEA_SNET = ' ', + CSEA_WIND = ' ', + CSEA_FWSM = ' ', + CSEA_EVAP = ' ', + CSEA_RAIN = ' ', + CSEA_SNOW = ' ', + CSEA_WATF = ' ', + CSEA_PRES = ' ', + CSEA_SST = ' ', + CSEA_UCU = ' ', + CSEA_VCU = ' ' / + +&NAM_CONF CCONF = 'START', + NVERB = 0, + NMODEL = 1, + CEXP = 'IROIS', + CSEG = '00-01', + CSPLIT = 'BSPLITTING' / + +&NAM_DYN XSEGLEN = 360., + LCORIO = .TRUE., + LNUMDIFU = .TRUE., + LNUMDIFTH = .FALSE., + XALKTOP = 0.001, + XALZBOT = 1200. / + +&NAM_BACKUP XBAK_TIME(1,1)=360. / + +&NAM_LUNITn CINIFILE = 'IROISE_5KM_201109_02_00', + CINIFILEPGD = 'IROISE_5KM' / + +&NAM_DYNn XTSTEP = 10., + CPRESOPT = 'ZRESI', + LVE_RELAX = .TRUE. / + +&NAM_ADVn CUVW_ADV_SCHEME = 'CEN4TH', + CTEMP_SCHEME = 'LEFR' , + CMET_ADV_SCHEME = 'PPM_01', + CSV_ADV_SCHEME = 'PPM_01' / + +&NAM_PARAMn CCLOUD = 'ICE3', + CTURB = 'TKEL', + CRAD = 'ECMW', + CDCONV = 'NONE', + CSCONV = 'EDKF' / + +&NAM_PARAM_RADn XDTRAD = 600., + XDTRAD_CLONLY = 600. / + +&NAM_LBCn CLBCX = 2*'OPEN', + CLBCY = 2*'OPEN' / + +&NAM_DIAG_SURFn N2M=2 / + +&NAM_SEAFLUXn CSEA_FLUX='COARE3' / diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/1_input_mnh/PRE_IDEA1.nam b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/1_input_mnh/PRE_IDEA1.nam similarity index 93% rename from MY_RUN/KTEST/013_Iroise_ideal_case_coupling/1_input_mnh/PRE_IDEA1.nam rename to MY_RUN/KTEST/013_Iroise_OASIS_coupling/1_input_mnh/PRE_IDEA1.nam index 5a13fe988fb47bb26556a610f38a3d631f92a1cd..8c22b30bf7ecff733d2a12d37a49f256601686df 100644 --- a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/1_input_mnh/PRE_IDEA1.nam +++ b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/1_input_mnh/PRE_IDEA1.nam @@ -1,7 +1,3 @@ -&NAM_CONFIO LCDF4=.TRUE., - LLFIOUT=.FALSE., - LLFIREAD=.FALSE. / - &NAM_VER_GRID NKMAX=48, YZGRID_TYPE='FUNCTN', ZDZGRD=10., diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/1_input_mnh/PRE_PGD1.nam b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/1_input_mnh/PRE_PGD1.nam similarity index 80% rename from MY_RUN/KTEST/013_Iroise_ideal_case_coupling/1_input_mnh/PRE_PGD1.nam rename to MY_RUN/KTEST/013_Iroise_OASIS_coupling/1_input_mnh/PRE_PGD1.nam index 6a231a4f463f93190f61eb80ccf91e7d906f45ce..f94c2fd7f36fced576b57b93516eaff5150a09ec 100644 --- a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/1_input_mnh/PRE_PGD1.nam +++ b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/1_input_mnh/PRE_PGD1.nam @@ -1,7 +1,3 @@ -&NAM_CONFIO LCDF4=.TRUE., - LLFIOUT=.FALSE., - LLFIREAD=.FALSE. / - &NAM_PGDFILE CPGDFILE='IROISE_5KM', NHALO=15 / @@ -35,13 +31,6 @@ YSAND='SAND_HWSD_MOY', YSANDFILETYPE='DIRECT' / -&NAM_DIAG_SURF_ATMn LFRAC=.TRUE., - LDIAG_GRID=.TRUE. / - -&NAM_DIAG_SURFn N2M=2, - LSURF_BUDGET=.TRUE., - LCOEF=.TRUE. / - &NAM_SEABATHY YSEABATHY='etopo2.nc', YSEABATHYFILETYPE='NETCDF', YNCVARNAME='topo' / @@ -51,4 +40,3 @@ CTOWN='TEB', CWATER='WATFLX', LGARDEN=.FALSE. / - diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/1_input_mnh/clean_prep_mesonh_xyz b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/1_input_mnh/clean_prep_mesonh_xyz similarity index 100% rename from MY_RUN/KTEST/013_Iroise_ideal_case_coupling/1_input_mnh/clean_prep_mesonh_xyz rename to MY_RUN/KTEST/013_Iroise_OASIS_coupling/1_input_mnh/clean_prep_mesonh_xyz diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/1_input_mnh/create_restart_file_from_PREP_IDEAL_CASE.py b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/1_input_mnh/create_restart_file_from_PREP_IDEAL_CASE.py similarity index 84% rename from MY_RUN/KTEST/013_Iroise_ideal_case_coupling/1_input_mnh/create_restart_file_from_PREP_IDEAL_CASE.py rename to MY_RUN/KTEST/013_Iroise_OASIS_coupling/1_input_mnh/create_restart_file_from_PREP_IDEAL_CASE.py index fcc4c0cb40d914e7aa2e849c02d085fea51c84ad..738b6f99637c33ac692f38e405be2853272e1ab3 100755 --- a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/1_input_mnh/create_restart_file_from_PREP_IDEAL_CASE.py +++ b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/1_input_mnh/create_restart_file_from_PREP_IDEAL_CASE.py @@ -20,15 +20,29 @@ import numpy as np curdir_path = os.getcwd()+'/' # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# ######################################################### +# ### To be defined by user ### +# ######################################################### + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# - - Add debug informations - - +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - cfg_debug = False +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# - - Name of PREP_IDEAL_CASE file - - +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +name_PREP_IDEAL_CASE_file = 'IROISE_5KM_201109_02_00.nc' + +# ######################################################### + if cfg_debug : print('++++++++++++++++++++++++++++++++++++++++++++++') if cfg_debug : print('+++ ') if cfg_debug : print('+++ 0. Read variables from PREP_IDEAL_CASE ') if cfg_debug : print('+++ ') if cfg_debug : print('++++++++++++++++++++++++++++++++++++++++++++++') -file_RSTRT = netCDF4.Dataset(curdir_path+'IROISE_5KM_201109_02_00.nc') +file_RSTRT = netCDF4.Dataset(curdir_path+name_PREP_IDEAL_CASE_file) LON_MNH = file_RSTRT.variables['LON'] [ 1:-1,1:-1] ; nlon_MNH=len(LON_MNH[0,:]) LAT_MNH = file_RSTRT.variables['LAT'] [ 1:-1,1:-1] ; nlat_MNH=len(LAT_MNH[:,0]) @@ -70,7 +84,7 @@ if cfg_debug : print('++++++++++++++++++++++++++++++++++++++++++++++') # --------------------------------------- # Open the file # --------------------------------------- -fout=netCDF4.Dataset(curdir_path+'rstrt_MNH.nc','w',format='NETCDF3_64BIT') +fout=netCDF4.Dataset(curdir_path+'rstrt_MNH.nc','w') fout.Description='Restart file for MNH coupling' # ---------------------------------- diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/1_input_mnh/get_pgd_files b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/1_input_mnh/get_pgd_files similarity index 100% rename from MY_RUN/KTEST/013_Iroise_ideal_case_coupling/1_input_mnh/get_pgd_files rename to MY_RUN/KTEST/013_Iroise_OASIS_coupling/1_input_mnh/get_pgd_files diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/1_input_mnh/run_prep_mesonh_xyz b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/1_input_mnh/run_prep_mesonh_xyz similarity index 100% rename from MY_RUN/KTEST/013_Iroise_ideal_case_coupling/1_input_mnh/run_prep_mesonh_xyz rename to MY_RUN/KTEST/013_Iroise_OASIS_coupling/1_input_mnh/run_prep_mesonh_xyz diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/2_INPUT_TOY/TOYNAMELIST.nam_WAVE b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/2_input_toy/TOYNAMELIST.nam similarity index 100% rename from MY_RUN/KTEST/013_Iroise_ideal_case_coupling/2_INPUT_TOY/TOYNAMELIST.nam_WAVE rename to MY_RUN/KTEST/013_Iroise_OASIS_coupling/2_input_toy/TOYNAMELIST.nam diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/2_INPUT_TOY/clean_prep_toy b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/2_input_toy/clean_prep_toy similarity index 100% rename from MY_RUN/KTEST/013_Iroise_ideal_case_coupling/2_INPUT_TOY/clean_prep_toy rename to MY_RUN/KTEST/013_Iroise_OASIS_coupling/2_input_toy/clean_prep_toy 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.py new file mode 100755 index 0000000000000000000000000000000000000000..03f6f66f9d2966ba8a25fe78d7856c030e86a3f4 --- /dev/null +++ b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/2_input_toy/create_grid_and_restart_files_for_TOY.py @@ -0,0 +1,201 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- +# +# --------------------------------------------------------- +# +# Author ( date ) : +# J. Pianezze ( 03.10.2023 ) +# +# ~~~~~~~~~~~~~~~ +# Script used to create grids from etopo2.nc +# and restart file for TOY model +# ~~~~~~~~~~~~~~~ +# +# --------------------------------------------------------- + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +import os +import netCDF4 +import numpy as np +import math +curdir_path = os.getcwd()+'/' +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# ######################################################### +# ### To be defined by user ### +# ######################################################### + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# - - Add debug informations - - +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +cfg_debug = False + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# - - Extension of the TOY grid - - +# - - (from etopo2) - - +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +lon_domain = [-6.2, -4.0] +lat_domain = [47.0, 49.5] + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# - - Type of send fields in TOYNAMELIST.nam - - +# - - &NAM_FCT_SEND CTYPE_FCT = 'CNSTE' or 'SINUS' - - +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +# if CTYPE_FCT='CNSTE' +value_CNSTE = 290.0 + +# if CTYPE_FCT='SINUS' +value_SINUS_COEF = 0.011 +value_SINUS_LENGTH = 1000. + +# ######################################################### + +if cfg_debug : print('++++++++++++++++++++++++++++++++++++++++++++++') +if cfg_debug : print('+++ ') +if cfg_debug : print('+++ 0. Read variables from etopo2.nc ') +if cfg_debug : print('+++ ') +if cfg_debug : print('++++++++++++++++++++++++++++++++++++++++++++++') + +# --------------------------------------- +# Get full etopo2 data +# --------------------------------------- +file_topo = netCDF4.Dataset('topo.nc') + +lon_full = file_topo.variables['lon'] [:] +lat_full = file_topo.variables['lat'] [:] +topo_full = file_topo.variables['topo'][:,:] + +# --------------------------------------- +# Reduce etopo2 data +# --------------------------------------- +ind_min_lon = np.where(lon_full[:]>lon_domain[0])[0][0] +ind_max_lon = np.where(lon_full[:]>lon_domain[1])[0][0] +ind_min_lat = np.where(lat_full[:]>lat_domain[0])[0][0] +ind_max_lat = np.where(lat_full[:]>lat_domain[1])[0][0] + +lon = lon_full [ind_min_lon:ind_max_lon] +lat = lat_full [ind_min_lat:ind_max_lat] +topo = topo_full[ind_min_lat:ind_max_lat,ind_min_lon:ind_max_lon] +lon, lat = np.meshgrid(lon, lat) + +# --------------------------------------- +# Compute corners +# --------------------------------------- +nlon = np.shape(lon)[1] +nlat = np.shape(lon)[0] +ncorn = 4 + +clo=np.zeros((ncorn,nlat,nlon)) +cla=np.zeros((ncorn,nlat,nlon)) + +deltax=lon[0,1]-lon[0,0] +clo[0,:,:]=lon[:,:]+deltax/2.0 +clo[1,:,:]=lon[:,:]-deltax/2.0 +clo[2,:,:]=lon[:,:]-deltax/2.0 +clo[3,:,:]=lon[:,:]+deltax/2.0 + +deltay=lat[1,0]-lat[0,0] +cla[0,:,:]=lat[:,:]+deltay/2.0 +cla[1,:,:]=lat[:,:]+deltay/2.0 +cla[2,:,:]=lat[:,:]-deltay/2.0 +cla[3,:,:]=lat[:,:]-deltay/2.0 + +# --------------------------------------- +# Compute surface +# --------------------------------------- +surface=np.zeros((nlat,nlon)) +surface[:,:]=deltax*deltay + +# --------------------------------------- +# Compute mask and var send by toy +# --------------------------------------- +mask=np.zeros((nlat,nlon)) +toyvarcnste=np.zeros((nlat,nlon)) +toyvarsinus=np.zeros((nlat,nlon)) + +for ind_lon in range(nlon): + for ind_lat in range(nlat): + if topo[ind_lat,ind_lon] > 0.0 : + mask[ind_lat,ind_lon]=0 + toyvarcnste[ind_lat,ind_lon] = value_CNSTE + toyvarsinus[ind_lat,ind_lon] = value_SINUS_COEF*math.sin(lat[ind_lat,0]*math.pi/180.0*value_SINUS_LENGTH) + else: + mask[ind_lat,ind_lon]=1 + toyvarcnste[ind_lat,ind_lon]=value_CNSTE + toyvarsinus[ind_lat,ind_lon]= value_SINUS_COEF*math.sin(lat[ind_lat,0]*math.pi/180.0*value_SINUS_LENGTH) + +if cfg_debug : print('++++++++++++++++++++++++++++++++++++++++++++++') +if cfg_debug : print('+++ ') +if cfg_debug : print('+++ 1. Create grid_toy_model.nc ') +if cfg_debug : print('+++ ') +if cfg_debug : print('++++++++++++++++++++++++++++++++++++++++++++++') + +grid_file=netCDF4.Dataset(curdir_path+'grid_toy_model.nc','w') +grid_file.Description='Grid file for TOY model' + +# ---------------------------------- +# Create the dimensions of the files +# ---------------------------------- +grid_file.createDimension ('nlon', nlon) +grid_file.createDimension ('nlat', nlat) +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')) + +# --------------------------------------- +# 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 [ :,:] + +# --------------------------------------- +# Close the file +# --------------------------------------- +grid_file.close() + +if cfg_debug : print('++++++++++++++++++++++++++++++++++++++++++++++') +if cfg_debug : print('+++ ') +if cfg_debug : print('+++ 2. Create rstrt_TOY.nc ') +if cfg_debug : print('+++ ') +if cfg_debug : print('++++++++++++++++++++++++++++++++++++++++++++++') + +rstrt_file=netCDF4.Dataset(curdir_path+'rstrt_TOY.nc','w') +rstrt_file.Description='OASIS restart file for TOY model' + +# ---------------------------------- +# Create the dimensions of the files +# ---------------------------------- +rstrt_file.createDimension ('nlon', nlon) +rstrt_file.createDimension ('nlat', nlat) + +# ---------------------------------- +# Create the variables of the files +# ---------------------------------- +varout=rstrt_file.createVariable('VARCNSTE','d',('nlat','nlon')) +varout=rstrt_file.createVariable('VARSIN01','d',('nlat','nlon')) +varout=rstrt_file.createVariable('VARSIN02','d',('nlat','nlon')) + +# --------------------------------------- +# Write out the data arrays into the file +# --------------------------------------- +rstrt_file.variables['VARCNSTE'][:,:] = toyvarcnste[:,:] +rstrt_file.variables['VARSIN01'][:,:] = toyvarsinus[:,:] +rstrt_file.variables['VARSIN02'][:,:] = toyvarsinus[:,:] + +# --------------------------------------- +# Close the file +# --------------------------------------- +rstrt_file.close() \ No newline at end of file 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 new file mode 100755 index 0000000000000000000000000000000000000000..e0214e226f9054ab49c792798f00687f873d9326 --- /dev/null +++ b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/2_input_toy/run_prep_toy @@ -0,0 +1,22 @@ +#!/bin/bash + +export PREP_PGD_FILES=${PREP_PGD_FILES:-"$HOME/PREP_PGD_FILES_WWW"} + +if [ ! -d ${PREP_PGD_FILES} ] +then + + echo 'Your directory PREP_PGD_FILES=$PREP_PGD_FILES doesnt exist.' + echo 'Please define the location of your PREP_PGD_FILES through' + echo 'the environment variable PREP_PGD_FILES.' + exit + +else + + echo '--------------------------------------' + echo ' Create input for TOY ' + echo '--------------------------------------' + + ln -sf $PREP_PGD_FILES/etopo2.nc topo.nc + python3 create_grid_and_restart_files_for_TOY.py + +fi diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/3_INPUT_OASIS/namcouple_WAVE b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/3_input_oasis/namcouple similarity index 98% rename from MY_RUN/KTEST/013_Iroise_ideal_case_coupling/3_INPUT_OASIS/namcouple_WAVE rename to MY_RUN/KTEST/013_Iroise_OASIS_coupling/3_input_oasis/namcouple index 7efe75749c4b843eb81f53df554cf4ed4cb49356..2c5daee92482267d126a0e110c72341c7d012c7c 100755 --- a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/3_INPUT_OASIS/namcouple_WAVE +++ b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/3_input_oasis/namcouple @@ -47,7 +47,7 @@ MNH__U10 VARRCV01 1 60 1 rst_A.nc EXPOUT 20 20 66 75 ssea toyt LAG=+10 R 0 R 0 SCRIPR -DISTWGT LR SCALAR LATLON 1 4 +BILINEAR LR SCALAR LATLON 1 # # ------------------------------------------ # TOY (toyexe) ==> MESONH (mesonh) diff --git a/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/.gitignore b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..b6de864bb464ac96b254008a9f9884b374f102af --- /dev/null +++ b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/.gitignore @@ -0,0 +1,7 @@ +*.nam +*.txt +U10_CHA/ +debug.* +*timers* +namcouple +nout.000000 diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/A_RUN_MNH_TOY/clean_mesonh_xyz b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/clean_mesonh_xyz similarity index 100% rename from MY_RUN/KTEST/013_Iroise_ideal_case_coupling/A_RUN_MNH_TOY/clean_mesonh_xyz rename to MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/clean_mesonh_xyz diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/A_RUN_MNH_TOY/clean_plot b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/clean_plot similarity index 65% rename from MY_RUN/KTEST/013_Iroise_ideal_case_coupling/A_RUN_MNH_TOY/clean_plot rename to MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/clean_plot index 658660d3c9078b47a0e8490fa6f51912f2e61bf2..ebf32dc746e0aab6c110256f1dff9916645e4b90 100755 --- a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/A_RUN_MNH_TOY/clean_plot +++ b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/clean_plot @@ -1,4 +1,3 @@ #!/bin/bash -rm -Rf MSU_MSV/ rm -Rf U10_CHA/ 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_coupling_model_toy.py new file mode 100755 index 0000000000000000000000000000000000000000..25f860c80ecd884fa84c64ee40419a781e48802f --- /dev/null +++ b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/plot_coupling_model_toy.py @@ -0,0 +1,135 @@ +#!/bin/python3 +# -------------------------------------------------------- +# +# Author ( date ) : +# J. Pianezze ( 29.09.2023 ) +# +# ~~~~~~~~~~~~~~~ +# Script used to verify OASIS exchanges between +# Meso-NH and toy models +# ~~~~~~~~~~~~~~~ +# +# -------------------------------------------------------- + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +import os, glob +import netCDF4 +import numpy as np +import matplotlib.pyplot as plt +from matplotlib.colors import BoundaryNorm +curdir_path = os.getcwd()+'/' +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +# ######################################################### +# ### To be defined by user ### +# ######################################################### + +name_file_send_mnh = glob.glob('*mesonh_01.nc')[0] +name_file_recv_mnh = glob.glob('*mesonh_02.nc')[0] +name_file_send_toy = glob.glob('*toyexe_02.nc')[0] +name_file_recv_toy = glob.glob('*toyexe_01.nc')[0] +name_var01 = name_file_send_mnh[5:8] +name_var02 = name_file_recv_mnh[5:8] + +# ######################################################### + +# --------------------------------------- +# Create directory to store figures +# --------------------------------------- +try : + os.mkdir(curdir_path+name_var01+'_'+name_var02+'/') +except OSError: + print('Directory already created') +else: + print('Making directory') + +# --------------------------------------- +# Open files +# --------------------------------------- +file_send_toy = netCDF4.Dataset(name_file_send_toy) +file_recv_mnh = netCDF4.Dataset(name_file_recv_mnh) +file_recv_toy = netCDF4.Dataset(name_file_recv_toy) +file_send_mnh = netCDF4.Dataset(name_file_send_mnh) +file_grids = netCDF4.Dataset('grids.nc') + +# --------------------------------------- +# Read lon/lat +# --------------------------------------- +lon_toy = file_grids.variables['toyt.lon'] ; nlon_toy = np.shape(lon_toy)[1] +lat_toy = file_grids.variables['toyt.lat'] ; nlat_toy = np.shape(lat_toy)[0] +lon_mnh = file_grids.variables['ssea.lon'] ; nlon_mnh = np.shape(lon_mnh)[1] +lat_mnh = file_grids.variables['ssea.lat'] ; nlat_mnh = np.shape(lat_mnh)[0] + +# --------------------------------------- +# Read variables +# --------------------------------------- +var_send_toy = file_send_toy.variables[name_file_send_toy[0:8]][-2,:,:]*1000.0 +var_recv_toy = file_recv_toy.variables[name_file_recv_toy[0:8]][-1,:,:] +var_send_mnh = file_send_mnh.variables[name_file_send_mnh[0:8]][-2,:,:] +var_recv_mnh = file_recv_mnh.variables[name_file_recv_mnh[0:8]][-1,:,:]*1000.0 + +mask_mnh = (var_send_mnh[:,:] > 1E10) +var_send_mnh = np.ma.MaskedArray(var_send_mnh, mask=mask_mnh) +var_recv_mnh = np.ma.MaskedArray(var_recv_mnh, mask=mask_mnh) + +mask_toy = (var_recv_toy[:,:] == 0.0) +var_send_toy = np.ma.MaskedArray(var_send_toy, mask=mask_toy) +var_recv_toy = np.ma.MaskedArray(var_recv_toy, mask=mask_toy) + +# ----------------------------------------------------------- +# Create figure +# ----------------------------------------------------------- +fig = plt.figure() + +# ----------------------------------------------------------- +# Define colormap and norm +# ----------------------------------------------------------- +cmap_wnd = plt.cm.RdBu_r +cmap_toy = plt.cm.RdBu_r + +levels_wnd = np.arange( 0.0, 0.26, 0.01) +levels_toy = np.arange(-10.0, 10.1, 0.1) + +norm_wnd = BoundaryNorm(levels_wnd, ncolors=cmap_wnd.N, clip=True) +norm_toy = BoundaryNorm(levels_toy, ncolors=cmap_toy.N, clip=True) + +#---------------------- +ax = fig.add_subplot(221) +plt.title('(a) Send by MNH') +cs = plt.pcolormesh(lon_mnh[:,:],lat_mnh[:,:],var_send_mnh[:,:],cmap=cmap_wnd,norm=norm_wnd) +cbar = plt.colorbar(cs,orientation='vertical',format='%.2f') +plt.tick_params(axis='x',which='both',labelbottom=False) +ax.set_xlim(( max(np.min(lon_mnh[1:-1,1:-1]),np.min(lon_toy[1:-1,1:-1])), min(np.max(lon_mnh[1:-1,1:-1]),np.max(lon_toy[1:-1,1:-1])) )) +ax.set_ylim(( max(np.min(lat_mnh[1:-1,1:-1]),np.min(lat_toy[1:-1,1:-1])), min(np.max(lat_mnh[1:-1,1:-1]),np.max(lat_toy[1:-1,1:-1])) )) + +#---------------------- +ax = fig.add_subplot(222) +plt.title('(b) Received by TOY') +cs = plt.pcolormesh(lon_toy[:,:],lat_toy[:,:],var_recv_toy[:,:],cmap=cmap_wnd,norm=norm_wnd) +cbar = plt.colorbar(cs,orientation='vertical',format='%.2f') +plt.tick_params(axis='x',which='both',labelbottom=False) +plt.tick_params(axis='y',which='both',labelleft =False) +ax.set_xlim(( max(np.min(lon_mnh[1:-1,1:-1]),np.min(lon_toy[1:-1,1:-1])), min(np.max(lon_mnh[1:-1,1:-1]),np.max(lon_toy[1:-1,1:-1])) )) +ax.set_ylim(( max(np.min(lat_mnh[1:-1,1:-1]),np.min(lat_toy[1:-1,1:-1])), min(np.max(lat_mnh[1:-1,1:-1]),np.max(lat_toy[1:-1,1:-1])) )) + +#---------------------- +ax = fig.add_subplot(223) +plt.title('(c) Send by TOY') +cs = plt.pcolormesh(lon_toy[:,:],lat_toy[:,:],var_send_toy[:,:],cmap=plt.cm.RdBu_r,vmin=np.min(var_send_toy), vmax=np.max(var_send_toy)) +cbar = plt.colorbar(cs,orientation='vertical',format='%.1f') +ax.set_xlim(( max(np.min(lon_mnh[1:-1,1:-1]),np.min(lon_toy[1:-1,1:-1])), min(np.max(lon_mnh[1:-1,1:-1]),np.max(lon_toy[1:-1,1:-1])) )) +ax.set_ylim(( max(np.min(lat_mnh[1:-1,1:-1]),np.min(lat_toy[1:-1,1:-1])), min(np.max(lat_mnh[1:-1,1:-1]),np.max(lat_toy[1:-1,1:-1])) )) + +#---------------------- +ax = fig.add_subplot(224) +plt.title('(d) Received by MNH') +cs = plt.pcolormesh(lon_mnh[:,:],lat_mnh[:,:],var_recv_mnh[:,:],cmap=plt.cm.RdBu_r,vmin=np.min(var_send_toy), vmax=np.max(var_send_toy)) +cbar = plt.colorbar(cs,orientation='vertical',format='%.1f') +plt.tick_params(axis='y',which='both',labelleft=False) +ax.set_xlim(( max(np.min(lon_mnh[1:-1,1:-1]),np.min(lon_toy[1:-1,1:-1])), min(np.max(lon_mnh[1:-1,1:-1]),np.max(lon_toy[1:-1,1:-1])) )) +ax.set_ylim(( max(np.min(lat_mnh[1:-1,1:-1]),np.min(lat_toy[1:-1,1:-1])), min(np.max(lat_mnh[1:-1,1:-1]),np.max(lat_toy[1:-1,1:-1])) )) + +#------------------------ +plt.savefig(curdir_path+name_var01+"_"+name_var02+"/"+name_var01+"_"+name_var02+".png", bbox_inches='tight', dpi=400) +plt.close() +#------------------------ \ No newline at end of file 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 new file mode 100755 index 0000000000000000000000000000000000000000..dbc2c14b402fa38620b2a87fc20c03318d2cfbc4 --- /dev/null +++ b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/run_mesonh_xyz @@ -0,0 +1,25 @@ +#!/bin/bash + +echo '--------------------------------------' +echo ' Run Meso-NH coupling ' +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/EXSEG1.nam . +cp ../1_input_mnh/rstrt_MNH.nc rst_A.nc + +#~~~~~ TOY +ln -sf ../2_input_toy/grid_toy_model.nc . +ln -sf ../2_input_toy/TOYNAMELIST.nam . +cp ../2_input_toy/rstrt_TOY.nc rst_T.nc + +#~~~~~ OASIS +ln -fs ../3_input_oasis/namcouple . + +# ------------------------------------------ +time mpirun -np 1 $PATH_EXETOY/toy_model : -np 1 MESONH${XYZ} +# ------------------------------------------ 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 new file mode 100755 index 0000000000000000000000000000000000000000..2c669619dabfcb7560213417ad1ca36afffaa670 --- /dev/null +++ b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/A_cpl_mnh_toy/run_plot @@ -0,0 +1,3 @@ +#!/bin/bash + +python3 plot_coupling_model_toy.py diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/Makefile b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/Makefile similarity index 100% rename from MY_RUN/KTEST/013_Iroise_ideal_case_coupling/Makefile rename to MY_RUN/KTEST/013_Iroise_OASIS_coupling/Makefile diff --git a/MY_RUN/KTEST/013_Iroise_OASIS_coupling/Readme b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/Readme new file mode 100644 index 0000000000000000000000000000000000000000..94f134f04397ff2699bb4fe4c0c4af65f6b13cf3 --- /dev/null +++ b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/Readme @@ -0,0 +1,50 @@ +===================================================== +===== Readme for 013_Iroise_OASIS_coupling +===================================================== + +The automatic compilation of Meso-NH was developed with +gfortran/openMPI. + +Adaptation of the Makefile for OASIS is required +if you want to use another compiler. + +----------------------------------------------------- +1. Configure Meso-NH +----------------------------------------------------- + +export VER_MPI=MPIAUTO +export VER_CDF=CDFAUTO +export VER_OASIS=OASISAUTO +./configure +. ../conf/profile_mesonh + +----------------------------------------------------- +2. Compile Meso-NH +----------------------------------------------------- + +make +make installmaster + +----------------------------------------------------- +3. Launch the coupling run +----------------------------------------------------- + +Before launching the coupling run, you have to define +the environnment variable PREP_PGD_FILES. +It corresponds to the directory where the files +needed by the PGD program (ECOCLIMAP, gtopo30, SAND*, CLAY*) +are stored. You can download these files at this location: +http://mesonh.aero.obs-mip.fr/mesonh52/Download + +The toy model need the etopo2.nc file, you can download it there: +http://mesonh.aero.obs-mip.fr/mesonh49/Download +You have to put this file at the same location as the pgd files. + +Define the PREP_PGD_FILES environnment variable: +export PREP_PGD_FILES=/full/path/of/your/files/directory + +Then go to the coupling ktest: +cd MY_RUN/KTEST/013_Iroise_OASIS_coupling/ + +and launch the coupling KTEST: +./run_013_Iroise_OASIS_coupling diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/run_013_Iroise_coupling b/MY_RUN/KTEST/013_Iroise_OASIS_coupling/run_013_Iroise_OASIS_coupling similarity index 100% rename from MY_RUN/KTEST/013_Iroise_ideal_case_coupling/run_013_Iroise_coupling rename to MY_RUN/KTEST/013_Iroise_OASIS_coupling/run_013_Iroise_OASIS_coupling diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/1_input_mnh/EXSEG1.nam_OCEAN b/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/1_input_mnh/EXSEG1.nam_OCEAN deleted file mode 100644 index 2f9cd6896c5188805be49f82ea6e39a278bb95b5..0000000000000000000000000000000000000000 --- a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/1_input_mnh/EXSEG1.nam_OCEAN +++ /dev/null @@ -1,135 +0,0 @@ -&NAM_CONFIO LCDF4=.TRUE., - LLFIOUT=.FALSE., - LLFIREAD=.FALSE. / - -&NAM_SFX_WAVE_CPL XTSTEP_CPL_WAVE = -1.0, - CWAVE_U10 = 'MNH__U10', - CWAVE_V10 = ' ', - CWAVE_CHA = 'MNH__CHA', - CWAVE_UCU = ' ', - CWAVE_VCU = ' ', - CWAVE_HS = ' ', - CWAVE_TP = ' ' / - -&NAM_SFX_SEA_CPL XTSTEP_CPL_SEA = 60., - CSEA_FWSU = 'MNH_FMSU', - CSEA_FWSV = 'MNH_FMSV', - CSEA_HEAT = 'MNH_HEAT', - CSEA_SNET = 'MNH_SNET', - CSEA_WIND = ' ', - CSEA_FWSM = ' ', - CSEA_EVAP = 'MNH_EVAP', - CSEA_RAIN = 'MNH_RAIN', - CSEA_SNOW = ' ', - CSEA_WATF = ' ', - CSEA_PRES = 'MNH_PRES', - CSEA_SST = 'MNH__SST', - CSEA_UCU = 'MNH__UCU', - CSEA_VCU = 'MNH__VCU' / - -&NAM_OASIS LOASIS=.TRUE., - LOASIS_GRID=.TRUE., - CMODEL_NAME='mesonh' / - -&NAM_CONFZ MPI_BUFFER_SIZE=200 / - -&NAM_CONF CCONF = "START", - NVERB=5, - NMODEL = 1, - CEXP = "IROIS", - CSEG = "00-01", - CSPLIT='BSPLITTING' / - -&NAM_DYN XSEGLEN = 360., - LCORIO = .TRUE., - LNUMDIFU = .TRUE., - LNUMDIFTH = .FALSE., - XALKTOP = 0.001, - XALZBOT = 1200. / - -&NAM_BACKUP XBAK_TIME(1,1)=360. / - -&NAM_CONFn LUSERV=.TRUE., - LUSECI=.TRUE., - LUSERC=.TRUE., - LUSERR=.TRUE., - LUSERI=.TRUE., - LUSERS=.TRUE., - LUSERG=.TRUE., - LUSERH=.FALSE., - NSV_USER=0 / - -&NAM_LUNITn CINIFILE = "IROISE_5KM_201109_02_00", - CINIFILEPGD="IROISE_5KM" / - -&NAM_DYNn XTSTEP = 10., - CPRESOPT = "ZRESI", - LITRADJ=.TRUE., - NITR = 8, - LHORELAX_UVWTH = .FALSE., - LHORELAX_RV = .FALSE., - LVE_RELAX = .TRUE., - NRIMX = 5, - NRIMY = 5, - XRIMKMAX = 0.01, - XT4DIFU = 300., - XT4DIFTH = 300. / - -&NAM_ADVn CUVW_ADV_SCHEME = "CEN4TH",CTEMP_SCHEME='LEFR', - CMET_ADV_SCHEME = "PPM_01", - CSV_ADV_SCHEME = "PPM_01" / - -&NAM_PARAMn CCLOUD = "ICE3", - CTURB = "TKEL", - CRAD = "ECMW", - CDCONV = "NONE", - CSCONV="EDKF" / - -&NAM_PARAM_RADn XDTRAD = 600., - XDTRAD_CLONLY = 600. / - -&NAM_LBCn CLBCX = 2*"OPEN", - CLBCY = 2*"OPEN", - XCPHASE = 20., - XCPHASE_PBL = 0. / - -&NAM_LES / - -&NAM_TURBn CTURBLEN = "BL89", - CTURBDIM = "1DIM", - LRMC01 = .FALSE., - LTURB_FLX=.TRUE., - LTURB_DIAG=.TRUE., - XTKEMIN=0.0000001 / - -&NAM_CH_MNHCn LUSECHEM = F / - -&NAM_DIAG_SURFn N2M=2, - LSURF_BUDGET=.TRUE., - LCOEF=.TRUE. / - -&NAM_DIAG_SURF_ATMn LFRAC=.TRUE., - LDIAG_GRID=.TRUE. / - -&NAM_ISBA CALBEDO="DRY"/ -&NAM_ISBAn CSCOND="NP89", - CC1DRY='DEF', - CSOILFRZ='DEF', - CDIFSFCOND='DEF', - CSNOWRES='DEF' / - -&NAM_SSOn CROUGH='BE04' / - -&NAM_DIAG_ISBAn / - -&NAM_SEAFLUXn CSEA_FLUX='COARE3', - CSEA_ALB='TA96', - LPWG=.FALSE., - LPRECIP=.FALSE., - LPWEBB=.FALSE., - LPROGSST=.FALSE., - NGRVWAVES=0, - CINTERPOL_SST='NONE', - XICHCE=0.0 / - -&NAM_NEBn LSUBG_COND =.FALSE. / diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/1_input_mnh/EXSEG1.nam_WAVE b/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/1_input_mnh/EXSEG1.nam_WAVE deleted file mode 100644 index 1799bb80e0e6a30d84e192cab9d19b864cb5f15d..0000000000000000000000000000000000000000 --- a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/1_input_mnh/EXSEG1.nam_WAVE +++ /dev/null @@ -1,135 +0,0 @@ -&NAM_CONFIO LCDF4=.TRUE., - LLFIOUT=.FALSE., - LLFIREAD=.FALSE. / - -&NAM_SFX_WAVE_CPL XTSTEP_CPL_WAVE = 60.0, - CWAVE_U10 = 'MNH__U10', - CWAVE_V10 = ' ', - CWAVE_CHA = 'MNH__CHA', - CWAVE_UCU = ' ', - CWAVE_VCU = ' ', - CWAVE_HS = ' ', - CWAVE_TP = ' ' / - -&NAM_SFX_SEA_CPL XTSTEP_CPL_SEA = -1.0, - CSEA_FWSU = ' ', - CSEA_FWSV = ' ', - CSEA_HEAT = ' ', - CSEA_SNET = ' ', - CSEA_WIND = ' ', - CSEA_FWSM = ' ', - CSEA_EVAP = ' ', - CSEA_RAIN = ' ', - CSEA_SNOW = ' ', - CSEA_WATF = ' ', - CSEA_PRES = ' ', - CSEA_SST = ' ', - CSEA_UCU = ' ', - CSEA_VCU = ' ' / - -&NAM_OASIS LOASIS=.TRUE., - LOASIS_GRID=.TRUE., - CMODEL_NAME='mesonh' / - -&NAM_CONFZ MPI_BUFFER_SIZE=200 / - -&NAM_CONF CCONF = "START", - NVERB =0, - NMODEL = 1, - CEXP = "IROIS", - CSEG = "00-01", - CSPLIT='BSPLITTING' / - -&NAM_DYN XSEGLEN = 360., - LCORIO = .TRUE., - LNUMDIFU = .TRUE., - LNUMDIFTH = .FALSE., - XALKTOP = 0.001, - XALZBOT = 1200. / - -&NAM_BACKUP XBAK_TIME(1,1)=360. / - -&NAM_CONFn LUSERV=.TRUE., - LUSECI=.TRUE., - LUSERC=.TRUE., - LUSERR=.TRUE., - LUSERI=.TRUE., - LUSERS=.TRUE., - LUSERG=.TRUE., - LUSERH=.FALSE., - NSV_USER=0 / - -&NAM_LUNITn CINIFILE = "IROISE_5KM_201109_02_00", - CINIFILEPGD="IROISE_5KM" / - -&NAM_DYNn XTSTEP = 10., - CPRESOPT = "ZRESI", - LITRADJ=.TRUE., - NITR = 8, - LHORELAX_UVWTH = .FALSE., - LHORELAX_RV = .FALSE., - LVE_RELAX = .TRUE., - NRIMX = 5, - NRIMY = 5, - XRIMKMAX = 0.01, - XT4DIFU = 300., - XT4DIFTH = 300. / - -&NAM_ADVn CUVW_ADV_SCHEME = "CEN4TH",CTEMP_SCHEME='LEFR', - CMET_ADV_SCHEME = "PPM_01", - CSV_ADV_SCHEME = "PPM_01" / - -&NAM_PARAMn CCLOUD = "ICE3", - CTURB = "TKEL", - CRAD = "ECMW", - CDCONV = "NONE", - CSCONV="EDKF" / - -&NAM_PARAM_RADn XDTRAD = 600., - XDTRAD_CLONLY = 600. / - -&NAM_LBCn CLBCX = 2*"OPEN", - CLBCY = 2*"OPEN", - XCPHASE = 20., - XCPHASE_PBL = 0. / - -&NAM_LES / - -&NAM_TURBn CTURBLEN = "BL89", - CTURBDIM = "1DIM", - LRMC01 = .FALSE., - LTURB_FLX=.TRUE., - LTURB_DIAG=.TRUE., - XTKEMIN=0.0000001 / - -&NAM_CH_MNHCn LUSECHEM = F / - -&NAM_DIAG_SURFn N2M=2, - LSURF_BUDGET=.TRUE., - LCOEF=.TRUE. / - -&NAM_DIAG_SURF_ATMn LFRAC=.TRUE., - LDIAG_GRID=.TRUE. / - -&NAM_ISBA CALBEDO="DRY" / -&NAM_ISBAn CSCOND="NP89", - CC1DRY='DEF', - CSOILFRZ='DEF', - CDIFSFCOND='DEF', - CSNOWRES='DEF' / - -&NAM_SSOn CROUGH='BE04' / - -&NAM_DIAG_ISBAn / - -&NAM_SEAFLUXn CSEA_FLUX='COARE3', - CSEA_ALB='TA96', - LPWG=.FALSE., - LPRECIP=.FALSE., - LPWEBB=.FALSE., - LPROGSST=.FALSE., - NGRVWAVES=0, - CINTERPOL_SST='NONE', - XICHCE=0.0 / - -&NAM_NEBn LSUBG_COND =.FALSE. / diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/2_INPUT_TOY/Create_grid_and_restart_files_for_TOY.ncl b/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/2_INPUT_TOY/Create_grid_and_restart_files_for_TOY.ncl deleted file mode 100755 index 2403b03d55ea14a9b1d04c645dfc2c4f14b2c74a..0000000000000000000000000000000000000000 --- a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/2_INPUT_TOY/Create_grid_and_restart_files_for_TOY.ncl +++ /dev/null @@ -1,192 +0,0 @@ -;================================================; -load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" -load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" -load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" -;================================================; -;################################################### -;=================================================# -; Creating grid and restart file for toy model -; Adaptation From Create_grid_and_restart_files_for_TOY.py -; Author : S. Bielli -; Date : 2016 -;=================================================# -;################################################## - -begin - -curdir_path=systemfunc("pwd")+"/" - -;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -; To be defined by the user -;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ - -;-- Limit of the grid (from etopo) -lat_domain=(/47.0, 49.5/) -lon_domain=(/-6.2, -4.0/) - -;-- Type of forcing to create the restart file -; for the toy : CNSTE or SINUS - -; CNSTE -value_CNSTE=290.0 - -; SINUS -value_SINUS_COEF=0.011 -value_SINUS_LENGTH=1000. - -;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ - -file_topo = "topo.nc" -a=addfile(file_topo,"r") - -;------ Read variables -lon_full=a->lon -lat_full=a->lat -topo_full=a->topo - -ind_min_lon=ind(lon_full.gt.lon_domain(0)) -print(ind_min_lon(0)) -ind_max_lon=ind(lon_full.gt.lon_domain(1))-1 -print(ind_max_lon(0)) -ind_min_lat=ind(lat_full.gt.lat_domain(0)) -print(ind_min_lat(0)) -ind_max_lat=ind(lat_full.gt.lat_domain(1))-1 -print(ind_max_lat(0)) - - -lon=lon_full(ind_min_lon(0):ind_max_lon(0)) -print(dimsizes(lon)) -lat=lat_full(ind_min_lat(0):ind_max_lat(0)) -topo=topo_full(ind_min_lat(0):ind_max_lat(0),ind_min_lon(0):ind_max_lon(0)) - -dims=dimsizes(topo) -nlon=dims(1) -print("nlon="+nlon) -nlat=dims(0) -print("nlat="+nlat) -ncorn=4 ; print 'ncorn=', ncorn - -print("---- longitude/latitude") - -printVarSummary(lat) -printVarSummary(lon) -print(nlat) -print(nlon) -lat2d=conform_dims((/nlat,nlon/),lat,0) -lon2d=conform_dims((/nlat,nlon/),lon,1) -printVarSummary(lon2d) - -print("---- corners longitude/latitude") -clo=new((/ncorn,nlat,nlon/),typeof(lon)) -cla=new((/ncorn,nlat,nlon/),typeof(lon)) -; -deltax=lon(1)-lon(0) -print("deltax="+deltax) -clo(0,:,:)=lon2d(:,:)+deltax/2.0 -clo(1,:,:)=lon2d(:,:)-deltax/2.0 -clo(2,:,:)=lon2d(:,:)-deltax/2.0 -clo(3,:,:)=lon2d(:,:)+deltax/2.0 -; -deltay=lat(1)-lat(0) -print("deltay="+deltay) -cla(0,:,:)=lat2d(:,:)+deltay/2.0 -cla(1,:,:)=lat2d(:,:)+deltay/2.0 -cla(2,:,:)=lat2d(:,:)-deltay/2.0 -cla(3,:,:)=lat2d(:,:)-deltay/2.0 -; -print("---- surface") -surface=new((/nlat,nlon/),typeof(lon)) -surface=deltax*deltay - -; -print("---- mask and var send by toy") -maskt=new((/nlat,nlon/),typeof(lon)) -toyvarcnste=new((/nlat,nlon/),typeof(lon)) -toyvarsinus=new((/nlat,nlon/),typeof(lon)) - -maskt= where(topo.gt.0.,0,1) -toyvarcnste = value_CNSTE - -pi=3.141592653589793 -do ind_lat=0,dimsizes(lat)-1 - toyvarsinus(ind_lat,:) = value_SINUS_COEF*sin(lat(ind_lat)*pi/180.0*value_SINUS_LENGTH) -end do - -;################################################## -print("------------------------------------------") -print(" Creating netcdf file : grid_toy_model.nc") - -grid_file=curdir_path+"grid_toy_model.nc" -c=addfile(grid_file,"c") -c@Description="Grid file for OASIS coupling" - -; ---------------------------------- -; Create the variables of the files -; ---------------------------------- - -lon2d!0="nlat" -lon2d!1="nlon" - -lat2d!0="nlat" -lat2d!1="nlon" - -clo!0="ncorner" -clo!1="nlat" -clo!2="nlon" - -cla!0="ncorner" -cla!1="nlat" -cla!2="nlon" - -surface!0="nlat" -surface!1="nlon" - -maskt!0="nlat" -maskt!1="nlon" - -;# --------------------------------------- -;# Write out the data arrays into the file -;# --------------------------------------- -c->lon=lon2d -c->lat=lat2d -c->clo=clo -c->cla=cla -c->srf=surface -c->imask=maskt - -print(" Closing netcdf file : grid_toy_model.nc") -print("------------------------------------------") -;################################################## - -;################################################## -print("------------------------------------------") -print(" Creating netcdf file : rstrt_TOY.nc") - -rstrt_file=curdir_path+"rstrt_TOY.nc" -d=addfile(rstrt_file,"c") -d@Description="Restart file for OASIS coupling" - -; ---------------------------------- -; Create the variables of the files -; ---------------------------------- - -toyvarcnste!0="nlat" -toyvarcnste!1="nlon" - -toyvarsinus!0="nlat" -toyvarsinus!1="nlon" - -; --------------------------------------- -; Write out the data arrays into the file -; --------------------------------------- - -d->VARCNSTE=toyvarcnste -d->VARSIN01=toyvarsinus -d->VARSIN02=toyvarsinus - -print(" Closing netcdf file : rstrt_TOY.nc") -print("-----------------------------------------") -;##################################################### - -end diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/2_INPUT_TOY/Create_grid_and_restart_files_for_TOY.py b/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/2_INPUT_TOY/Create_grid_and_restart_files_for_TOY.py deleted file mode 100755 index 169f4630b41f87185e86b3e946699fd26b0e1ea1..0000000000000000000000000000000000000000 --- a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/2_INPUT_TOY/Create_grid_and_restart_files_for_TOY.py +++ /dev/null @@ -1,194 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -################################################### -#=================================================# -# Creating grid and restart file for toy model -# Author : J. Pianezze -# Date : 2015 -# Modification :Avril 2022 Joris Pianezze et Françoise Orain pour python3 -#fichier etopo2 dispo sur site SURFEX -#=================================================# -################################################### -# -import netCDF4 -import numpy as np -import scipy -import matplotlib.pyplot as plt -import math -from pylab import * -import os -# -curdir_path=os.path.abspath(os.curdir)+'/' -# -#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -# To be defined by the user -#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -# -#-- Limit of the grid (from etopo) -lat_domain=[47.0, 49.5] -lon_domain=[-6.2, -4.0] -print ('londomaine[0]',lon_domain[0]) -print ('londomaine[1]',lon_domain[1]) - -#-- Type of forcing to create the restart file -# for the toy : CNSTE or SINUS - -# CNSTE -value_CNSTE=290.0 - -# SINUS -value_SINUS_COEF=0.011 -value_SINUS_LENGTH=1000. -# -#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ - -file_topo = netCDF4.Dataset('topo.nc') - -#------ Read variables -lon_full = file_topo.variables['lon'] [:] -lat_full = file_topo.variables['lat'] [:] -topo_full = file_topo.variables['topo'][:,:] - -ind_min_lon = np.where(lon_full[:]>lon_domain[0])[0][0] ; print ("ind_min_lon = ",ind_min_lon) -ind_max_lon = np.where(lon_full[:]>lon_domain[1])[0][0] ; print ("ind_max_lon = ",ind_max_lon) -ind_min_lat = np.where(lat_full[:]>lat_domain[0])[0][0] ; print ("ind_min_lat = ",ind_min_lat) -ind_max_lat = np.where(lat_full[:]>lat_domain[1])[0][0] ; print ("ind_max_lat = ",ind_max_lat) - -lon = lon_full [ind_min_lon:ind_max_lon] -lat = lat_full [ind_min_lat:ind_max_lat] -topo = topo_full[ind_min_lat:ind_max_lat,ind_min_lon:ind_max_lon] - -#plt.contourf(topo) -#plt.show() - -nlon=np.size(lon) ; print ('nlon =', nlon) -nlat=np.size(lat) ; print ('nlat =', nlat) -ncorn=4 ; print ('ncorn=', ncorn) - -print ('---- longitude/latitude') -lon2D=np.zeros((nlat,nlon)) -lat2D=np.zeros((nlat,nlon)) - -for ind_lon in range(nlon): - lat2D[:,ind_lon]=lat[:] -for ind_lat in range(nlat): - lon2D[ind_lat,:]=lon[:] - -print ('---- corners longitude/latitude') -clo=np.zeros((ncorn,nlat,nlon)) -cla=np.zeros((ncorn,nlat,nlon)) - -deltax=lon[1]-lon[0] ; print ('deltax=', deltax) -clo[0,:,:]=lon2D[:,:]+deltax/2.0 -clo[1,:,:]=lon2D[:,:]-deltax/2.0 -clo[2,:,:]=lon2D[:,:]-deltax/2.0 -clo[3,:,:]=lon2D[:,:]+deltax/2.0 - -deltay=lat[1]-lat[0] ; print ('deltay=', deltay) -cla[0,:,:]=lat2D[:,:]+deltay/2.0 -cla[1,:,:]=lat2D[:,:]+deltay/2.0 -cla[2,:,:]=lat2D[:,:]-deltay/2.0 -cla[3,:,:]=lat2D[:,:]-deltay/2.0 - -print ('---- surface') -surface=np.zeros((nlat,nlon)) -surface[:,:]=deltax*deltay - - -print ('---- mask and var send by toy') -mask=np.zeros((nlat,nlon)) -toyvarcnste=np.zeros((nlat,nlon)) -toyvarsinus=np.zeros((nlat,nlon)) - -for ind_lon in range(nlon): - for ind_lat in range(nlat): - if topo[ind_lat,ind_lon] > 0.0 : - mask[ind_lat,ind_lon]=0 - toyvarcnste[ind_lat,ind_lon] = value_CNSTE - toyvarsinus[ind_lat,ind_lon] = value_SINUS_COEF*math.sin(lat[ind_lat]*math.pi/180.0*value_SINUS_LENGTH) - else: - mask[ind_lat,ind_lon]=1 - toyvarcnste[ind_lat,ind_lon]=value_CNSTE - toyvarsinus[ind_lat,ind_lon]= value_SINUS_COEF*math.sin(lat[ind_lat]*math.pi/180.0*value_SINUS_LENGTH) - - -################################################## -print ('------------------------------------------') -print (' Creating netcdf file : grid_toy_model.nc ') - -grid_file=netCDF4.Dataset(curdir_path+'grid_toy_model.nc','w',format='NETCDF3_64BIT') -grid_file.Description='Grid file for OASIS coupling' - -# ---------------------------------- -# Create the dimensions of the files -# ---------------------------------- -grid_file.createDimension ('nlon', nlon) -grid_file.createDimension ('nlat', nlat) -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')) - -# --------------------------------------- -# Write out the data arrays into the file -# --------------------------------------- -grid_file.variables['lon'][:,:] = lon2D[:,:] -grid_file.variables['lat'][:,:] = lat2D[:,:] -grid_file.variables['clo'][:,:] = clo[:,:,:] -grid_file.variables['cla'][:,:] = cla[:,:,:] -grid_file.variables['srf'][:,:] = surface[:,:] -grid_file.variables['imask'][:,:] = mask[:,:] - -# --------------------------------------- -# close the file -# --------------------------------------- -grid_file.close() - -print (' Closing netcdf file : grid_toy_model.nc ') -print ('------------------------------------------') -################################################## - -################################################## -print ('------------------------------------------') -print (' Creating netcdf file : rstrt_TOY.nc ') - -rstrt_file=netCDF4.Dataset(curdir_path+'rstrt_TOY.nc','w',format='NETCDF3_64BIT') -rstrt_file.Description='Restart file for OASIS coupling' - -# ---------------------------------- -# Create the dimensions of the files -# ---------------------------------- -rstrt_file.createDimension ('nlon', nlon) -rstrt_file.createDimension ('nlat', nlat) - -# ---------------------------------- -# Create the variables of the files -# ---------------------------------- -varout=rstrt_file.createVariable('VARCNSTE','d',('nlat','nlon')) -varout=rstrt_file.createVariable('VARSIN01','d',('nlat','nlon')) -varout=rstrt_file.createVariable('VARSIN02','d',('nlat','nlon')) - -# --------------------------------------- -# Write out the data arrays into the file -# --------------------------------------- -rstrt_file.variables['VARCNSTE'][:,:] = toyvarcnste[:,:] -rstrt_file.variables['VARSIN01'][:,:] = toyvarsinus[:,:] -rstrt_file.variables['VARSIN02'][:,:] = toyvarsinus[:,:] - -# --------------------------------------- -# close the file -# --------------------------------------- -rstrt_file.close() - -print (' Closing netcdf file : rstrt_TOY.nc ') -print ('-----------------------------------------') -##################################################### diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/2_INPUT_TOY/Create_grid_and_restart_files_for_TOYFOJP_from_MARS.py b/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/2_INPUT_TOY/Create_grid_and_restart_files_for_TOYFOJP_from_MARS.py deleted file mode 100644 index 708ab094c3336a2ec766bac64f5fb5e416a26407..0000000000000000000000000000000000000000 --- a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/2_INPUT_TOY/Create_grid_and_restart_files_for_TOYFOJP_from_MARS.py +++ /dev/null @@ -1,191 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# -################################################### -#=================================================# -# Creating grid and restart file for toy model -# Author : J. Pianezze -# Date : 2015 -# Modification Avril 2022 :Françoise Orain et Joris Pianezze pour python3 et utiliser H0(bathy de MARC) -#=================================================# -################################################### -# -import netCDF4 -import numpy as np -import scipy -import matplotlib.pyplot as plt -import math -from pylab import * -import os -# -curdir_path=os.path.abspath(os.curdir)+'/' -# -#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -# To be defined by the user -#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -# -#-- Limit of the grid (from etopo) -lat_domain=[ 46.681, 50.092] -lon_domain=[-6.6348, -1.3652] -print ('londomaine[0]',lon_domain[0]) -print ('londomaine[1]',lon_domain[1]) - -#-- Type of forcing to create the restart file -# for the toy : CNSTE or SINUS - -# CNSTE -value_CNSTE=290.0 - -# SINUS -value_SINUS_COEF=0.011 -value_SINUS_LENGTH=1000. -# -#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ - -file_topo = netCDF4.Dataset('bathy_MARC.nc') - -#------ Read variables -lon_full = file_topo.variables['longitude'][:,:] -lat_full = file_topo.variables['latitude'][:,:] -topo_full = file_topo.variables['H0'][:,:] - -ind_min_lon=np.where(lon_full[0,:]>lon_domain[0])[0][0] ; print ("ind_min_lon = ",ind_min_lon) -ind_max_lon=-1 # np.where(lon_full[0,:]>lon_domain[1])[0][0] ; print ("ind_max_lon = ",ind_max_lon) -ind_min_lat=np.where(lat_full[:,0]>lat_domain[0])[0][0] ; print ("ind_min_lat = ",ind_min_lat) -ind_max_lat=np.where(lat_full[:,0]>lat_domain[1])[0][0] ; print ("ind_max_lat = ",ind_max_lat) - -print ('---- topo') -topo = topo_full[ind_min_lat:ind_max_lat,ind_min_lon:ind_max_lon] - -print ('---- longitude/latitude') -lon = lon_full[ind_min_lat:ind_max_lat,ind_min_lon:ind_max_lon] -lat = lat_full[ind_min_lat:ind_max_lat,ind_min_lon:ind_max_lon] - -nlon=np.size(lon[0,:]) ; print ('nlon =', nlon) -nlat=np.size(lat[:,0]) ; print ('nlat =', nlat) -ncorn=4 ; print ('ncorn=', ncorn) - -print ('---- corners longitude/latitude') -clo=np.zeros((ncorn,nlat,nlon)) -cla=np.zeros((ncorn,nlat,nlon)) - -deltax=lon[0,1]-lon[0,0] ; print ('deltax=', deltax) -clo[0,:,:]=lon[:,:]+deltax/2.0 -clo[1,:,:]=lon[:,:]-deltax/2.0 -clo[2,:,:]=lon[:,:]-deltax/2.0 -clo[3,:,:]=lon[:,:]+deltax/2.0 - -deltay=lat[1]-lat[0] ; print ('deltay=', deltay) -cla[0,:,:]=lat[:,:]+deltay/2.0 -cla[1,:,:]=lat[:,:]+deltay/2.0 -cla[2,:,:]=lat[:,:]-deltay/2.0 -cla[3,:,:]=lat[:,:]-deltay/2.0 - -print ('---- surface') -surface=np.zeros((nlat,nlon)) -surface[:,:]=deltax*deltay - - -print ('---- mask and var send by toy') -mask=np.zeros((nlat,nlon)) -toyvarcnste=np.zeros((nlat,nlon)) -toyvarsinus=np.zeros((nlat,nlon)) - -for ind_lon in range(nlon): - for ind_lat in range(nlat): - if topo[ind_lat,ind_lon] > 0.0 : - if ind_lon >= 132 and ind_lat >= 23 and ind_lat <= 25: - mask [ind_lat,ind_lon] = 1 - else: - mask[ind_lat,ind_lon]=0 - toyvarcnste[ind_lat,ind_lon] = value_CNSTE - toyvarsinus[ind_lat,ind_lon] = value_SINUS_COEF*math.sin(lat[ind_lat,0]*math.pi/180.0*value_SINUS_LENGTH) - else: - mask [ind_lat,ind_lon] = 1 - toyvarcnste[ind_lat,ind_lon] = value_CNSTE - toyvarsinus[ind_lat,ind_lon] = value_SINUS_COEF*math.sin(lat[ind_lat,0]*math.pi/180.0*value_SINUS_LENGTH) - -# ----------------------------------------------------------------------- -# Inverse du mask car la bathy est positive en mer et negative sur terre -# ----------------------------------------------------------------------- -mask = 1 - mask - -################################################## -print ('------------------------------------------') -print (' Creating netcdf file : grid_toy_modelMARC.nc') - -grid_file=netCDF4.Dataset(curdir_path+'grid_toy_modelMARC.nc','w',format='NETCDF3_64BIT') -grid_file.Description='Grid file for OASIS coupling' - -# ---------------------------------- -# Create the dimensions of the files -# ---------------------------------- -grid_file.createDimension ('nlon', nlon) -grid_file.createDimension ('nlat', nlat) -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')) - -# --------------------------------------- -# 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[:,:] - -# --------------------------------------- -# close the file -# --------------------------------------- -grid_file.close() - -print (' Closing netcdf file : grid_toy_modelMARC.nc') -print ('------------------------------------------') -################################################## - -################################################## -print ('------------------------------------------') -print (' Creating netcdf file : rstrt_TOYMARC.nc') - -rstrt_file=netCDF4.Dataset(curdir_path+'rstrt_TOYMARC.nc','w',format='NETCDF3_64BIT') -rstrt_file.Description='Restart file for OASIS coupling' - -# ---------------------------------- -# Create the dimensions of the files -# ---------------------------------- -rstrt_file.createDimension ('nlon', nlon) -rstrt_file.createDimension ('nlat', nlat) - -# ---------------------------------- -# Create the variables of the files -# ---------------------------------- -varout=rstrt_file.createVariable('VARCNSTE','d',('nlat','nlon')) -varout=rstrt_file.createVariable('VARSIN01','d',('nlat','nlon')) -varout=rstrt_file.createVariable('VARSIN02','d',('nlat','nlon')) - -# --------------------------------------- -# Write out the data arrays into the file -# --------------------------------------- -rstrt_file.variables['VARCNSTE'][:,:] = toyvarcnste[:,:] -rstrt_file.variables['VARSIN01'][:,:] = toyvarsinus[:,:] -rstrt_file.variables['VARSIN02'][:,:] = toyvarsinus[:,:] - -# --------------------------------------- -# close the file -# --------------------------------------- -rstrt_file.close() - -print (' Closing netcdf file : rstrt_TOYMARC.nc ') -print ('-----------------------------------------') -##################################################### diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/2_INPUT_TOY/TOYNAMELIST.nam_OCEAN b/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/2_INPUT_TOY/TOYNAMELIST.nam_OCEAN deleted file mode 100644 index 55123e9e7f5b596e5870986d40610b628e7bf2a4..0000000000000000000000000000000000000000 --- a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/2_INPUT_TOY/TOYNAMELIST.nam_OCEAN +++ /dev/null @@ -1,20 +0,0 @@ -&NAM_OASIS IL_NB_TIME_STEPS=6, - DELTA_T=60, - DATA_FILENAME='grid_toy_model.nc' / - -&NAM_FCT_SEND CTYPE_FCT='CNSTE', - VALUE=290.0 / - -&NAM_RECV_FIELDS NB_RECV_FIELDS=7, - CRCVFIELDS(1)='VARRCV01', - CRCVFIELDS(2)='VARRCV02', - CRCVFIELDS(3)='VARRCV03', - CRCVFIELDS(4)='VARRCV04', - CRCVFIELDS(5)='VARRCV05', - CRCVFIELDS(6)='VARRCV06', - CRCVFIELDS(7)='VARRCV07' / - -&NAM_SEND_FIELDS NB_SEND_FIELDS=3, - CSNDFIELDS(1)='VARCNSTE', - CSNDFIELDS(2)='VARSIN01', - CSNDFIELDS(3)='VARSIN02' / diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/2_INPUT_TOY/run_prep_toy b/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/2_INPUT_TOY/run_prep_toy deleted file mode 100755 index 3bdb22cbc3a0c2df0881853548369e2ccbfa1c69..0000000000000000000000000000000000000000 --- a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/2_INPUT_TOY/run_prep_toy +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -echo '--------------------------------------' -echo '-- input for TOY ' -echo '--------------------------------------' -PREP_PGD_FILES=${PREP_PGD_FILES:-"$HOME/PREP_PGD_FILES_WWW"} ; export PREP_PGD_FILES -if [ "$PREP_PGD_FILES" = "" ] -then - -echo 'Your directory PREP_PGD_FILES=$PREP_PGD_FILES doesnt exist.' -echo 'Please define the location of your PREP_PGD_FILES through' -echo 'the environment variable PREP_PGD_FILES' -exit - -else - -ln -sf $PREP_PGD_FILES/etopo2.nc topo.nc - -rm -f grid_toy_model.nc -rm -f rstrt_TOY.nc -#ncl Create_grid_and_restart_files_for_TOY.ncl -python3 Create_grid_and_restart_files_for_TOY.py - -fi diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/3_INPUT_OASIS/namcouple_OCEAN b/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/3_INPUT_OASIS/namcouple_OCEAN deleted file mode 100755 index bcfbff4902dad0f01c456b71b0a8ab4ee05d0f77..0000000000000000000000000000000000000000 --- a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/3_INPUT_OASIS/namcouple_OCEAN +++ /dev/null @@ -1,137 +0,0 @@ -# This is a typical input file for OASIS3-MCT. -# Keywords used in previous versions of OASIS3 -# but now obsolete are marked "Not used" -# Don't hesitate to ask precisions or make suggestions (oasishelp@cerfacs.fr). -# -# Any line beginning with # is ignored. Blank lines are not allowed. -# -######################################################################### - $NFIELDS -# The number of fields described in the second part of the namcouple. -# - 10 - $END -######################################################################### - $NBMODEL -# The number of models in this experiment + their names (6 characters) -# - 2 mesonh toyexe - $END -########################################################################### - $RUNTIME -# The total simulated time for this run in seconds -# - 360 - $END -########################################################################### - $NLOGPRT -# Amount of information written to OASIS3-MCT log files (see User Guide) -# Premier nombre: quantite d'information pour debugger -# Second nombre: statistics des processeurs - 30 3 - $END -########################################################################### - $STRINGS -# -# The above variables are the general parameters for the experiment. -# Everything below has to do with the fields being exchanged. -# -# ----------------------------------------- -# MESONH (mesonh) ==> TOY (toyexe) -# ----------------------------------------- -# -#~~~~~~~~~~~ -# Field 1 : -#~~~~~~~~~~~ -MNH_FMSU VARRCV01 1 60 1 rst_A.nc EXPOUT -20 20 66 75 ssea toyt LAG=+10 -R 0 R 0 -SCRIPR -DISTWGT LR SCALAR LATLON 1 4 -# -#~~~~~~~~~~~ -# Field 2 : -#~~~~~~~~~~~ -MNH_FMSV VARRCV02 1 60 1 rst_A.nc EXPOUT -20 20 66 75 ssea toyt LAG=+10 -R 0 R 0 -SCRIPR -DISTWGT LR SCALAR LATLON 1 4 -# -#~~~~~~~~~~~ -# Field 3 : -#~~~~~~~~~~~ -MNH_HEAT VARRCV03 1 60 1 rst_A.nc EXPOUT -20 20 66 75 ssea toyt LAG=+10 -R 0 R 0 -SCRIPR -DISTWGT LR SCALAR LATLON 1 4 -# -#~~~~~~~~~~~ -# Field 4 : -#~~~~~~~~~~~ -MNH_SNET VARRCV04 1 60 1 rst_A.nc EXPOUT -20 20 66 75 ssea toyt LAG=+10 -R 0 R 0 -SCRIPR -DISTWGT LR SCALAR LATLON 1 4 -# -#~~~~~~~~~~~ -# Field 5 : -#~~~~~~~~~~~ -MNH_EVAP VARRCV05 1 60 1 rst_A.nc EXPOUT -20 20 66 75 ssea toyt LAG=+10 -R 0 R 0 -SCRIPR -DISTWGT LR SCALAR LATLON 1 4 -# -#~~~~~~~~~~~ -# Field 6 : -#~~~~~~~~~~~ -MNH_RAIN VARRCV06 1 60 1 rst_A.nc EXPOUT -20 20 66 75 ssea toyt LAG=+10 -R 0 R 0 -SCRIPR -DISTWGT LR SCALAR LATLON 1 4 -# -#~~~~~~~~~~~ -# Field 7 : -#~~~~~~~~~~~ -MNH_PRES VARRCV07 1 180 1 rst_A.nc EXPOUT -20 20 66 75 ssea toyt LAG=+10 -R 0 R 0 -SCRIPR -DISTWGT LR SCALAR LATLON 1 4 -# -# ------------------------------------------ -# TOY (toyexe) ==> MESONH (mesonh) -# ------------------------------------------ -# -#~~~~~~~~~~~ -# Field 8 : -#~~~~~~~~~~~ -VARCNSTE MNH__SST 1 60 1 rst_T.nc EXPOUT -66 75 20 20 toyt ssea LAG=+60 -R 0 R 0 -SCRIPR -DISTWGT LR SCALAR LATLON 1 4 -# -#~~~~~~~~~~~ -# Field 9 : -#~~~~~~~~~~~ -VARSIN01 MNH__UCU 1 60 1 rst_T.nc EXPOUT -66 75 20 20 toyt ssea LAG=+60 -R 0 R 0 -SCRIPR -DISTWGT LR SCALAR LATLON 1 4 -# -#~~~~~~~~~~~ -# Field 10 : -#~~~~~~~~~~~ -VARSIN02 MNH__VCU 1 60 1 rst_T.nc EXPOUT -66 75 20 20 toyt ssea LAG=+60 -R 0 R 0 -SCRIPR -DISTWGT LR SCALAR LATLON 1 4 -# - $END diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/A_RUN_MNH_TOY/plot_coupling_model_toy.ncl b/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/A_RUN_MNH_TOY/plot_coupling_model_toy.ncl deleted file mode 100755 index e1160270bfed1dca343fbc3a0bb612b6f1bb16f2..0000000000000000000000000000000000000000 --- a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/A_RUN_MNH_TOY/plot_coupling_model_toy.ncl +++ /dev/null @@ -1,217 +0,0 @@ -;================================================; -load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" -load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" -load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl" -;================================================; -;################################################### -;==================================================# -; Visualization of the coupling outputs -; Adaptation from plot_coupling_model_toy.py -; Author : S. Bielli -; Date : 2016 -;==================================================# -;################################################### - -begin - -;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -; To be defined by the user -;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -; -print("===========================================") - -curdir_path=systemfunc("pwd")+"/" -print(curdir_path) - -name_file_VAR1_TOY=systemfunc("ls *toyexe_01.nc") -a1=addfile(name_file_VAR1_TOY,"r") -VAR1_T=getfilevarnames(a1) -name_file_VAR1_MOD=systemfunc("ls *mesonh_01.nc") -b1=addfile(name_file_VAR1_MOD,"r") -VAR1_M=getfilevarnames(b1) -VAR1_all=stringtochar(name_file_VAR1_MOD) -VAR1=VAR1_all(5:7) - -name_file_VAR2_TOY=systemfunc("ls *toyexe_02.nc") -a2=addfile(name_file_VAR2_TOY,"r") -VAR2_T=getfilevarnames(a2) -name_file_VAR2_MOD=systemfunc("ls *mesonh_02.nc") -b2=addfile(name_file_VAR2_MOD,"r") -VAR2_M=getfilevarnames(b2) -VAR2_all=stringtochar(name_file_VAR2_MOD) -VAR2=VAR2_all(5:7) - -name_file_GRIDS="grids.nc" -g=addfile(name_file_GRIDS,"r") - -;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -;$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ - -print("=============================================") -system("mkdir -p " +curdir_path+VAR1+"_"+VAR2) -print("Making directory") - -print("=============================================") -print("~~~~ Plot these variables : "+ VAR1+" "+ VAR2) - -;~~~~~ TOY -LAT_TOY=g->$"toyt.lat"$ -LON_TOY=g->$"toyt.lon"$ -dims_toy=dimsizes(LAT_TOY) -DIM_LAT_TOY=dims_toy(0) -DIM_LON_TOY=dims_toy(1) -print("DIM_LAT_TOY="+ DIM_LON_TOY+ " DIM_LAT_TOY="+DIM_LON_TOY) - -;~~~~~ MOD -LAT_MOD=g->$"ssea.lat"$ -LON_MOD=g->$"ssea.lon"$ -dims_mod=dimsizes(LAT_MOD) -DIM_LAT_MOD=dims_mod(0) -DIM_LON_MOD=dims_mod(1) -print("DIM_LAT_MOD = "+ DIM_LON_MOD+ " DIM_LAT_MOD="+ DIM_LON_MOD) - -;~~~~~ VAR1/VAR2 -if (VAR1_T(0).eq."time") then -VAR1_TOY=a1->$VAR1_T(1)$ -VAR1_MOD=b1->$VAR1_M(1)$ -else -VAR1_TOY=a1->$VAR1_T(0)$ -VAR1_MOD=b1->$VAR1_M(0)$ -end if - -VAR1_MOD@_FillValue = 999. -VAR1_TOY@_FillValue = 999. -VAR1_MOD = where (VAR1_MOD.gt.1000000 , VAR1_MOD@_FillValue, VAR1_MOD) -VAR1_TOY = where (VAR1_TOY.gt.1000000 , VAR1_TOY@_FillValue, VAR1_TOY) - -if (VAR2_T(0).eq."time") then -VAR2_TOY=a2->$VAR2_T(1)$ -VAR2_MOD=b2->$VAR2_M(1)$ -else -VAR2_TOY=a2->$VAR2_T(0)$ -VAR2_MOD=b2->$VAR2_M(0)$ -end if - -VAR1_MOD@lat2d=LAT_MOD -VAR1_MOD@lon2d=LON_MOD -VAR2_MOD@lat2d=LAT_MOD -VAR2_MOD@lon2d=LON_MOD -VAR1_TOY@lat2d=LAT_TOY -VAR1_TOY@lon2d=LON_TOY -VAR2_TOY@lat2d=LAT_TOY -VAR2_TOY@lon2d=LON_TOY - -;~~~~~ TIME TOY -TIME_TOY=a1->time - -;~~~~~ CONVERT VARIABLES -if (VAR2.eq."CHA") then - print("Multiply Charnock coefficient by 1000") - printVarSummary(VAR2_TOY) - VAR2_TOY=VAR2_TOY*1000.0 - VAR2_MOD=VAR2_MOD*1000.0 - OPVAR2="*1000.0" -else - OPVAR2="" -end if - -OPVAR1="" - -;===================================================== -;===================================================== - -lev_min_VAR1 = stringtofloat(sprintf("%5.2f",min(VAR1_TOY))) -lev_max_VAR1 = stringtofloat(sprintf("%5.2f",max(VAR1_TOY))) -lev_int_VAR1 = stringtofloat(sprintf("%4.2f",(lev_max_VAR1-lev_min_VAR1 ) / 30.)) - -lev_min_VAR2 = stringtofloat(sprintf("%5.2f",min(VAR2_MOD))) -lev_max_VAR2 = stringtofloat(sprintf("%5.2f",max(VAR2_MOD))) -lev_int_VAR2 = stringtofloat(sprintf("%4.2f",(lev_max_VAR2-lev_min_VAR2 ) / 30.)) - -;----------------------------------------------------- -print("~~~~ Temporal loop") -;----------------------------------------------------- -; Open workstation and define colormap -; ------------------------------------- - - type = "png" ; open a x11 window - ; change type to png, ps or pdf to get the plot into a file - wks = gsn_open_wks(type,"plt_BasicMap") ; - gsn_define_colormap(wks,"BlueDarkRed18") - - - res = True - res@gsnFrame = False - res@gsnDraw = False - - res@lbLabelAutoStride = True - - res@tiXAxisString = "longitude" ; x-axis label - res@tiYAxisString = "latitude" - - res@tmXBTickSpacingF= 2 - res@tmYLTickSpacingF= 1 - - res@lbOrientation = "vertical" - - res@cnFillOn = True - res@cnFillMode = "RasterFill" - res@cnLinesOn = False - - res@mpMaxLatF = min((/max(LAT_MOD),max(LAT_TOY)/)) ; choose subregion - res@mpMinLatF = max((/min(LAT_MOD),min(LAT_TOY)/)) - res@mpMaxLonF = min((/max(LON_TOY),max(LON_MOD)/)) - res@mpMinLonF = max((/min(LON_TOY),min(LON_MOD)/)) - - res@mpOutlineOn = False - - res@cnLevelSelectionMode = "ManualLevels" - - res@gsnSpreadColors = True - - resP = True -; gsn_define_colormap(wks,"topo_15lev") ; Choose colormap - -do ind_time=0,dimsizes(TIME_TOY)-2 - plot = new(4,graphic) - print(" ~~~~ Current time :"+ TIME_TOY(ind_time)) - - resP@txString = "Cumulated time " + TIME_TOY(ind_time)+"s" - resP@tiMainFontHeightF = 0.04 - - ;---------------------- - res@tiMainString = "SND MNH " + VAR1+OPVAR1 - res@cnMinLevelValF = lev_min_VAR1 - res@cnMaxLevelValF = lev_max_VAR1 - res@cnLevelSpacingF = lev_int_VAR1 - plot(0) =gsn_csm_contour_map(wks,VAR1_MOD(ind_time,:,:),res) - - ;---------------------- - res@tiMainString = "RCV TOY " + VAR1+OPVAR1 - plot(1) =gsn_csm_contour_map(wks,VAR1_TOY(ind_time,:,:),res) - - ;---------------------- - res@tiMainString = "SND TOY " + VAR2+OPVAR2 - res@cnMinLevelValF = lev_min_VAR2 - res@cnMaxLevelValF = lev_max_VAR2 - res@cnLevelSpacingF = lev_int_VAR2 - plot(2) =gsn_csm_contour_map(wks,VAR2_TOY(ind_time,:,:),res) - - ;---------------------- - res@tiMainString = "RCV MNH " + VAR2+OPVAR2 - plot(3) =gsn_csm_contour_map(wks,VAR2_MOD(ind_time,:,:),res) - - ;------------------------ - - gsn_panel(wks,plot,(/2,2/),resP) - -end do -print("=============================================") - -do ind_time=0,dimsizes(TIME_TOY)-2 -system("mv plt_BasicMap.00000"+(ind_time+1)+".png " + curdir_path+VAR1+"_"+VAR2+"/"+VAR1+"_"+VAR2+"_MOD_TOY_T"+ind_time+".png") -end do - -end diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/A_RUN_MNH_TOY/plot_coupling_model_toy.py b/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/A_RUN_MNH_TOY/plot_coupling_model_toy.py deleted file mode 100755 index 585fce81b94276abbac8489592ab9dda6ff0c552..0000000000000000000000000000000000000000 --- a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/A_RUN_MNH_TOY/plot_coupling_model_toy.py +++ /dev/null @@ -1,159 +0,0 @@ -##!/usr/bin/python3 -# -*- coding: utf-8 -*- -# -#################################################### -#==================================================# -# Visualization of the coupling outputs -# Author : J. Pianezze -# Date : 2015 -#==================================================# -#################################################### - -import netCDF4 -import numpy as np -import scipy -import matplotlib.pyplot as plt -from pylab import * -import os -import glob - -#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -# To be defined by the user -#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -# -print('==============================================') -curdir_path=os.path.abspath(os.curdir)+'/' -print(curdir_path) -# -name_file_VAR1_TOY=glob.glob('*toyexe_01.nc')[0] -name_file_VAR1_MOD=glob.glob('*mesonh_01.nc')[0] -VAR1=name_file_VAR1_MOD[5:8] -# -name_file_VAR2_TOY=glob.glob('*toyexe_02.nc')[0] -name_file_VAR2_MOD=glob.glob('*mesonh_02.nc')[0] -VAR2=name_file_VAR2_MOD[5:8] -# -name_file_GRIDS='grids.nc' -# -#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ - -print('==============================================') -try : - os.mkdir(curdir_path+VAR1+'_'+VAR2+'/') -except OSError: - print('Directory already created') -else: - print('Making directory') - -print('==============================================') -print('~~~~ Plot these variables :', VAR1, VAR2) - -file_VAR1_TOY = netCDF4.Dataset(name_file_VAR1_TOY) -file_VAR1_MOD = netCDF4.Dataset(name_file_VAR1_MOD) - -file_VAR2_TOY = netCDF4.Dataset(name_file_VAR2_TOY) -file_VAR2_MOD = netCDF4.Dataset(name_file_VAR2_MOD) - -file_GRIDS = netCDF4.Dataset(name_file_GRIDS) - -#~~~~~ TOY -LAT_TOY=file_GRIDS.variables['toyt.lat'] -LON_TOY=file_GRIDS.variables['toyt.lon'] -DIM_LAT_TOY=np.shape(LAT_TOY)[0] -DIM_LON_TOY=np.shape(LON_TOY)[1] -print('DIM_LAT_TOY, DIM_LON_TOY', DIM_LAT_TOY, DIM_LON_TOY) - -#~~~~~ MOD -LAT_MOD=file_GRIDS.variables['ssea.lat'] -LON_MOD=file_GRIDS.variables['ssea.lon'] -DIM_LAT_MOD=np.shape(LAT_MOD)[0] -DIM_LON_MOD=np.shape(LON_MOD)[1] -print('DIM_LAT_MOD, DIM_LON_MOD', DIM_LAT_MOD, DIM_LON_MOD) - -#~~~~~ VAR1/VAR2 -VAR1_TOY=file_VAR1_TOY.variables[name_file_VAR1_TOY[0:8]][:,:,:] -VAR1_MOD=file_VAR1_MOD.variables[name_file_VAR1_MOD[0:8]][:,:,:] -MASK_VAR1_MOD = (VAR1_MOD[:,:,:] == 1E20) -VAR1_MOD = np.ma.MaskedArray(VAR1_MOD, mask=MASK_VAR1_MOD) - -VAR2_TOY=file_VAR2_TOY.variables[name_file_VAR2_TOY[0:8]][:,:,:] -VAR2_MOD=file_VAR2_MOD.variables[name_file_VAR2_MOD[0:8]][:,:,:] - -OPVAR1='' -OPVAR2='' - -#~~~~~ TIME TOY -TIME_TOY=file_VAR1_TOY.variables['time'][:] - -#~~~~~ CONVERT VARIABLES -if VAR2=='CHA': - print('Multiply Charnock coefficient by 1000') - VAR2_TOY[:,:,:]=VAR2_TOY[:,:,:]*1000.0 - VAR2_MOD[:,:,:]=VAR2_MOD[:,:,:]*1000.0 - OPVAR2='*1000.0' - -#===================================================== -#===================================================== - -#----------------------------------------------------- -print('~~~~ Temporal loop') -#----------------------------------------------------- -for ind_time in range(np.size(TIME_TOY)-1): - print(' ~~~~ Current time :', TIME_TOY[ind_time]) - - fig = plt.figure() - fig.suptitle('Cumulated time : '+str(TIME_TOY[ind_time])+'s', fontsize=18) - - #---------------------- - ax = fig.add_subplot(221) - plt.title('SND MNH '+VAR1+OPVAR1,fontsize=18) - CS=plt.pcolormesh(LON_MOD[:,:],LAT_MOD[:,:],VAR1_MOD[ind_time,:,:],cmap=plt.cm.RdBu_r,\ - vmin=np.min(VAR1_TOY), vmax=np.max(VAR1_TOY)) - cbar = plt.colorbar(CS,orientation='vertical',format='%.3f') - plt.ylabel(r'latitude [-]',fontsize=18) - plt.tick_params(axis='x',which='both',bottom='on',top='on',labelbottom='off') - xlim(( max(np.min(LON_MOD[:,:]),np.min(LON_TOY[:,:])), min(np.max(LON_MOD[:,:]),np.max(LON_TOY[:,:])) )) - ylim(( max(np.min(LAT_MOD[:,:]),np.min(LAT_TOY[:,:])), min(np.max(LAT_MOD[:,:]),np.max(LAT_TOY[:,:])) )) - - #---------------------- - ax = fig.add_subplot(222) - plt.title('RCV TOY '+VAR1+OPVAR1,fontsize=18) - CS=plt.pcolormesh(LON_TOY[:,:],LAT_TOY[:,:],VAR1_TOY[ind_time,:,:],cmap=plt.cm.RdBu_r,\ - vmin=np.min(VAR1_TOY), vmax=np.max(VAR1_TOY)) - cbar = plt.colorbar(CS,orientation='vertical',format='%.3f') - plt.tick_params(axis='x',which='both',bottom='on',top='on',labelbottom='off') - plt.tick_params(axis='y',which='both',bottom='on',top='on',labelleft='off') - xlim(( max(np.min(LON_MOD[:,:]),np.min(LON_TOY[:,:])), min(np.max(LON_MOD[:,:]),np.max(LON_TOY[:,:])) )) - ylim(( max(np.min(LAT_MOD[:,:]),np.min(LAT_TOY[:,:])), min(np.max(LAT_MOD[:,:]),np.max(LAT_TOY[:,:])) )) - - #---------------------- - ax = fig.add_subplot(223) - plt.title('SND TOY '+VAR2+OPVAR2,fontsize=18) - CS=plt.pcolormesh(LON_TOY[:,:],LAT_TOY[:,:],VAR2_TOY[ind_time,:,:],cmap=plt.cm.RdBu_r,\ - vmin=np.min(VAR2_MOD), vmax=np.max(VAR2_MOD)) - cbar = plt.colorbar(CS,orientation='vertical',format='%.3f') - plt.ylabel(r'latitude [-]',fontsize=18) - plt.xlabel(r'longitude [-]',fontsize=18) - xlim(( max(np.min(LON_MOD[:,:]),np.min(LON_TOY[:,:])), min(np.max(LON_MOD[:,:]),np.max(LON_TOY[:,:])) )) - ylim(( max(np.min(LAT_MOD[:,:]),np.min(LAT_TOY[:,:])), min(np.max(LAT_MOD[:,:]),np.max(LAT_TOY[:,:])) )) - - #---------------------- - ax = fig.add_subplot(224) - plt.title('RCV MNH '+VAR2+OPVAR2,fontsize=18) - CS=plt.pcolormesh(LON_MOD[:,:],LAT_MOD[:,:],VAR2_MOD[ind_time,:,:],cmap=plt.cm.RdBu_r,\ - vmin=np.min(VAR2_MOD), vmax=np.max(VAR2_MOD)) - cbar = plt.colorbar(CS,orientation='vertical',format='%.3f') - plt.xlabel(r'longitude [-]',fontsize=18) - plt.tick_params(axis='y',which='both',bottom='on',top='on',labelleft='off') - xlim(( max(np.min(LON_MOD[:,:]),np.min(LON_TOY[:,:])), min(np.max(LON_MOD[:,:]),np.max(LON_TOY[:,:])) )) - ylim(( max(np.min(LAT_MOD[:,:]),np.min(LAT_TOY[:,:])), min(np.max(LAT_MOD[:,:]),np.max(LAT_TOY[:,:])) )) - - #------------------------ - plt.savefig(curdir_path+VAR1+"_"+VAR2+"/"+VAR1+"_"+VAR2+"_MOD_TOY_T"+str(ind_time)+".pdf") - plt.savefig(curdir_path+VAR1+"_"+VAR2+"/"+VAR1+"_"+VAR2+"_MOD_TOY_T"+str(ind_time)+".png") - plt.show() - plt.close() -print('==============================================') diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/A_RUN_MNH_TOY/run_mesonh_xyz b/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/A_RUN_MNH_TOY/run_mesonh_xyz deleted file mode 100755 index 83d1d77a446d3119898c90fc9fc8530e6b394ea6..0000000000000000000000000000000000000000 --- a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/A_RUN_MNH_TOY/run_mesonh_xyz +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash - -echo '--------------------------------------' -echo '-- run Meso-NH coupling ' -echo '--------------------------------------' - -export PATH_EXETOY=${SRC_MESONH}/src/LIB/toy_1.0/ - -#~~~~~ OCEAN OR WAVE -export TYPE_TOY='WAVE' - -#~~~~~ MESONH -ln -sf ../1_INPUT_MNH/IROISE_5KM.* . -ln -sf ../1_INPUT_MNH/IROISE_5KM_201109_0?_??.* . -cp ../1_INPUT_MNH/rstrt_MNH.nc rst_A.nc -ln -sf ../1_INPUT_MNH/EXSEG1.nam_${TYPE_TOY} EXSEG1.nam - -rm -fr IROIS.1.00-01.* - -#~~~~~ TOY -ln -sf ../2_INPUT_TOY/grid_toy_model.nc . -cp ../2_INPUT_TOY/rstrt_TOY.nc rst_T.nc -ln -sf ../2_INPUT_TOY/TOYNAMELIST.nam_${TYPE_TOY} TOYNAMELIST.nam - -#~~~~~ OASIS -ln -fs ../3_INPUT_OASIS/namcouple_${TYPE_TOY} namcouple - -#time Mpirun -np 1 MESONH${XYZ} : -np 1 $PATH_EXETOY/toy_model -time Mpirun -np 1 $PATH_EXETOY/toy_model : -np 1 MESONH${XYZ} diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/A_RUN_MNH_TOY/run_plot b/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/A_RUN_MNH_TOY/run_plot deleted file mode 100755 index 821c5b35b699cfa1d72202355df13599a00a3ac7..0000000000000000000000000000000000000000 --- a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/A_RUN_MNH_TOY/run_plot +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -#ncl plot_coupling_model_toy.ncl -python3 plot_coupling_model_toy.py - -${POSTRUN} display */*0.png -${POSTRUN} display */*1.png -${POSTRUN} display */*2.png -${POSTRUN} display */*3.png -${POSTRUN} display */*4.png - diff --git a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/Readme b/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/Readme deleted file mode 100644 index 338fae24290a3d2edb39b8f2fdf4dba5c8443142..0000000000000000000000000000000000000000 --- a/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/Readme +++ /dev/null @@ -1,82 +0,0 @@ -===================================================== -===== Readme for 013_Iroise_ideal_case_coupling -===================================================== - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -~~~~ To compile Meso-NH with the coupling stuff -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -The automatic compilation of Meso-NH works with -gfortran/openMPI. - -Adaptation of the Makefile for OASIS is required -if you want to use another compiler. - ------------------------------------------------------ -1. Define the environnment variables for Meso-NH ------------------------------------------------------ -export VER_CDF=CDFAUTO -export VER_OASIS=OASISAUTO -#Juan , no needed anymore export CPLOASIS=1 -./configure -. ../conf/profile_mesonh - - -CDFAUTO and OASISAUTO means you want to use OASIS and -NETCDF librairies compiled with the Meso-NH package. - ------------------------------------------------------ -2. Compile the MASTER branch of Meso-NH ------------------------------------------------------ -make -make installmaster - ------------------------------------------------------ -4. To launch the coupling run ------------------------------------------------------ -Before launching the coupling run, you have to define -the environnment variable PREP_PGD_FILES. -It corresponds to the directory where the files -needed by the PGD program (ECOCLIMAP, gtopo30, SAND*, CLAY*) -are stored. You can download these files at this location: -http://mesonh.aero.obs-mip.fr/mesonh52/Download - -The toy model need the etopo2.nc file, you can dowload it there: -http://mesonh.aero.obs-mip.fr/mesonh49/Download -You have to put this file at the same location as the pgd files. - -Define the PREP_PGD_FILES environnment variable: -export PREP_PGD_FILES=/full/path/of/your/files/directory - -Then go to the coupling ktest: -cd mnh_v5-3-0/MY_RUN/KTEST/013_Iroise_ideal_case_coupling/ - - -Launch the coupling run: -./run_013_Iroise_real_case_coupling - -NB: ---- - -~~ By default the toy represent a wave model, to change the toy - for an oceanic model, you have to modify the file: - A_RUN_MNH_TOY/run_mesonh_xyz - and put - export TYPE_TOY='OCEAN' - -~~ By default the scripts are in NCL (version installed with - the Meso-NH package). To use the python scripts, you have to change - the scripts run* where python can be used. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -~~~~ Tree of the KTEST 013 for the coupling -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -013_Iroise_real_case_coupling/ -~~~~ 1_INPUT_MNH/ -~~~~ 2_INPUT_TOY/ -~~~~ 3_INPUT_OASIS/ -~~~~ A_RUN_MNH_TOY/ -~~~~ Readme -~~~~ Makefile -~~~~ run_013_Iroise_real_case_coupling -