Skip to content
Snippets Groups Projects
Commit f8960447 authored by JorisP's avatar JorisP Committed by RODIER Quentin
Browse files

Update of ktest 013_Ideal_OASIS_coupling

parent c66ea1a4
No related branches found
No related tags found
No related merge requests found
Showing
with 532 additions and 20 deletions
&NAM_CONFIO LCDF4=.TRUE.,
LLFIOUT=.FALSE.,
LLFIREAD=.FALSE. /
&NAM_OASIS LOASIS = .TRUE.,
LOASIS_GRID = .TRUE.,
CMODEL_NAME = 'mesonh' /
&NAM_SFX_WAVE_CPL XTSTEP_CPL_WAVE = 60.0,
CWAVE_U10 = 'MNH__U10',
......@@ -27,109 +27,46 @@
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,
&NAM_CONF CCONF = 'START',
NVERB = 0,
NMODEL = 1,
CEXP = "IROIS",
CSEG = "00-01",
CSPLIT='BSPLITTING' /
CEXP = 'IROIS',
CSEG = '00-01',
CSPLIT = 'BSPLITTING' /
&NAM_DYN XSEGLEN = 360.,
LCORIO = .TRUE.,
LNUMDIFU = .TRUE.,
&NAM_DYN XSEGLEN = 360.,
LCORIO = .TRUE.,
LNUMDIFU = .TRUE.,
LNUMDIFTH = .FALSE.,
XALKTOP = 0.001,
XALZBOT = 1200. /
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_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_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_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_PARAMn CCLOUD = 'ICE3',
CTURB = 'TKEL',
CRAD = 'ECMW',
CDCONV = 'NONE',
CSCONV = 'EDKF' /
&NAM_PARAM_RADn XDTRAD = 600.,
&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_LBCn CLBCX = 2*'OPEN',
CLBCY = 2*'OPEN' /
&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_DIAG_SURFn N2M=2 /
&NAM_NEBn LSUBG_COND =.FALSE. /
&NAM_SEAFLUXn CSEA_FLUX='COARE3' /
&NAM_CONFIO LCDF4=.TRUE.,
LLFIOUT=.FALSE.,
LLFIREAD=.FALSE. /
&NAM_VER_GRID NKMAX=48,
YZGRID_TYPE='FUNCTN',
ZDZGRD=10.,
......
&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. /
......@@ -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'
# ----------------------------------
......
#!/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
#!/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
......@@ -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)
......
*.nam
*.txt
U10_CHA/
debug.*
*timers*
namcouple
nout.000000
#!/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
#!/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}
# ------------------------------------------
#!/bin/bash
python3 plot_coupling_model_toy.py
=====================================================
===== Readme for 013_Iroise_ideal_case_coupling
===== Readme for 013_Iroise_OASIS_coupling
=====================================================
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~ To compile Meso-NH with the coupling stuff
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The automatic compilation of Meso-NH works with
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. Define the environnment variables for Meso-NH
1. Configure Meso-NH
-----------------------------------------------------
export VER_MPI=MPIAUTO
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
2. Compile Meso-NH
-----------------------------------------------------
make
make installmaster
-----------------------------------------------------
4. To launch the coupling run
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
......@@ -41,7 +36,7 @@ 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:
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.
......@@ -49,34 +44,7 @@ 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
cd MY_RUN/KTEST/013_Iroise_OASIS_coupling/
and launch the coupling KTEST:
./run_013_Iroise_OASIS_coupling
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment