= Conservation du calving : où est l'erreur = == Exemple avec le MR025 == Expérience : /ccc/cont003/home/gencmip6/oboucher/IPSLCM6.2/modipsl/config/IPSLCM6/CM61-MR025-pd-04 Fichier poids utilisés : voir /ccc/cont003/home/gencmip6/oboucher/IPSLCM6.2/modipsl/config/IPSLCM6/CM61-MR025-pd-04/COMP/oasis.card Sorties : /ccc/scratch/cont003/gencmip6/oboucher/IGCM_OUT/IPSLCM6/TEST/pdControl/CM61-MR025-pd-04 Détails : 1 mois de simu, 18500101_18500131, cpl_old_calving=no, bug fixé dans LMDZ pour le calcul du flux cumulé par bande de latitude Problème : le flux de calving qui repart du coupleur diffère un peu trop du flux de calving qui arrive Fichier d'aires NEMO : ceux du fichier de sortie grid_T de NEMO ou /ccc/work/cont003/igcmg/igcmg/IGCM/CPL/IPSLCM6/eORCA025.1xLMD256256/areas_eORCA025.1xLMD256256_MOSAIX_v0.nc ==> pas d'impact sur le problème Fichier masque NEMO : /ccc/work/cont003/igcmg/igcmg/IGCM/OCE/NEMO/eORCA025.4/GRIDS/eORCA025_mesh_mask.nc Diagnostic 1 - script cdo {{{ exp=CM61-MR025-pd-04 dir=/ccc/store/cont003/gencmip6/oboucher/IGCM_OUT/IPSLCM6/DEVT/pdControl/${exp} dir=/ccc/scratch/cont003/gencmip6/oboucher/IGCM_OUT/IPSLCM6/TEST/pdControl/${exp} fileatm=${dir}/ATM/Output/MO/${exp}_18500101_18500131_1M_histmth.nc filecp1in=${dir}/CPL/Output/MO/${exp}_18500101_18500131_COCALVIN.nc filecp2in=${dir}/CPL/Output/MO/${exp}_18500101_18500131_COWINDSP.nc filecp1out=${dir}/CPL/Output/MO/${exp}_18500101_18500131_OCalving.nc filecp2out=${dir}/CPL/Output/MO/${exp}_18500101_18500131_OIceberg.nc filecp3out=${dir}/CPL/Output/MO/${exp}_18500101_18500131_OIcshelf.nc fileoce=${dir}/OCE/Output/MO/${exp}_18500101_18500131_1M_grid_T.nc maskoce=/ccc/work/cont003/igcmg/igcmg/IGCM/OCE/NEMO/eORCA025.4/GRIDS/eORCA025_mesh_mask.nc echo $fileatm echo $filecp1in echo $filecp2in echo $filecp2 echo $fileoce echo $maskoce #-file cp1in have 32 timesteps, remove timestep 1 #--intermediate diagnstics in LMDZ sum_fqfonte=`cdo outputf,%12.10g,10 -divc,1.e9 -fldsum -yearmonmean -expr,'toto=fqfonte*aire' ${fileatm}` sum_fqcalving=`cdo outputf,%12.10g,10 -divc,1.e9 -fldsum -yearmonmean -expr,'toto=fqcalving*aire' ${fileatm}` #--calving diagnostic in LMDZ before integration - robust sum_wei_atm=`cdo outputf,%12.10g,10 -divc,1.e9 -fldsum -yearmonmean -expr,'toto=runofflic*pourc_lic/100.*aire' ${fileatm}` #--CALVIN That reaches coupler after integration in LMDZ #--first timestep is 0 and is not included in average sum_wei_cp1in=`cdo outputf,%12.10g,10 -divc,1.e9 -fldsum -timavg -seltimestep,2/32 -selname,COCALVIN ${filecp1in}` #--1st term out of the coupler sum_wei_cp1out=`cdo outputf,%12.10g,10 -divc,1.e9 -fldsum -mul -mul -timavg -selname,OCalving ${filecp1out} -selvar,tmaskutil ${maskoce} -gridarea ${fileoce}` #--2nd term out of the coupler sum_wei_cp2out=`cdo outputf,%12.10g,10 -divc,1.e9 -fldsum -mul -mul -timavg -selname,OIceberg ${filecp2out} -selvar,tmaskutil ${maskoce} -gridarea ${fileoce}` #--3rd term out of the coupler sum_wei_cp3out=`cdo outputf,%12.10g,10 -divc,1.e9 -fldsum -mul -mul -timavg -selname,OIcshelf ${filecp3out} -selvar,tmaskutil ${maskoce} -gridarea ${fileoce}` #--1st term as diagnosed in NEMO sum_wei_oce1=`cdo outputf,%12.10g,10 -divc,1.e9 -fldsum -mul -mul -timavg -selname,calving ${fileoce} -selvar,tmaskutil ${maskoce} -gridarea ${fileoce}` #--2nd term as diagnosed in NEMO sum_wei_oce2=`cdo outputf,%12.10g,10 -divc,1.e9 -fldsum -mul -mul -timavg -selname,iceberg ${fileoce} -selvar,tmaskutil ${maskoce} -gridarea ${fileoce}` #--3rd term as diagnosed in NEMO sum_wei_oce3=`cdo outputf,%12.10g,10 -divc,1.e9 -fldsum -mul -mul -timavg -selname,iceshelf ${fileoce} -selvar,tmaskutil ${maskoce} -gridarea ${fileoce}` echo 'weighted sum FQFONTE =' $sum_fqfonte echo 'weighted sum FQCALVING=' $sum_fqcalving echo 'weighted sum ATM=' $sum_wei_atm echo 'weighted sum CP new in=' $sum_wei_cp1in echo 'weighted sum CP1 calving out=' $sum_wei_cp1out echo 'weighted sum CP2 iceberg out=' $sum_wei_cp2out echo 'weighted sum CP3 iceshelf out=' $sum_wei_cp3out echo 'weighted sum CP total out =' `echo $sum_wei_cp1out + $sum_wei_cp2out + $sum_wei_cp3out | bc` echo 'weighted sum OCE1 calving =' $sum_wei_oce1 echo 'weighted sum OCE2 iceberg =' $sum_wei_oce2 echo 'weighted sum OCE3 iceshelf=' $sum_wei_oce3 echo 'weighted sum OCE total =' `echo $sum_wei_oce1 + $sum_wei_oce2 + $sum_wei_oce3 | bc` }}} Résultats : {{{ weighted sum ATM= 0.2182236825 weighted sum CP new in= 0.2182726731 weighted sum CP1 calving out= 0.009143283797 weighted sum CP2 iceberg out= 0.1059081852 weighted sum CP3 iceshelf out= 0.105908185 weighted sum CP total out = .220959653997 weighted sum OCE1 calving = 0.009143283772 weighted sum OCE2 iceberg = 0.1059081852 weighted sum OCE3 iceshelf= 0.1059081849 weighted sum OCE total = .220959653872 }}} On voit que le que flux dans le coupleur de 0.2182726731 mSv diffère du flux de sortie du coupleur 0.220959653997. Ces flux sont confirmés par des dignostics indépendants dans LMDZ et NEMO. Diagnostic 2 - script python {{{ import xarray as xr import numpy as np exp="CM61-MR025-pd-04" dir="/ccc/scratch/cont003/gencmip6/oboucher/IGCM_OUT/IPSLCM6/TEST/pdControl/"+exp+"/" filecp1out=dir+"CPL/Output/MO/"+exp+"_18500101_18500131_OCalving.nc" filecp2out=dir+"CPL/Output/MO/"+exp+"_18500101_18500131_OIceberg.nc" filecp3out=dir+"CPL/Output/MO/"+exp+"_18500101_18500131_OIcshelf.nc" fileoce1=dir+"OCE/Output/MO/"+exp+"_18500101_18500131_1M_grid_T.nc" fileoce2="/ccc/work/cont003/igcmg/igcmg/IGCM/CPL/IPSLCM6/eORCA025.1xLMD256256/areas_eORCA025.1xLMD256256_MOSAIX_v0.nc" maskoce="/ccc/work/cont003/igcmg/igcmg/IGCM/OCE/NEMO/eORCA025.4/GRIDS/eORCA025_mesh_mask.nc" #--ouverture des xarray xr_calving=xr.open_dataset(filecp1out) xr_iceberg=xr.open_dataset(filecp2out) xr_icshelf=xr.open_dataset(filecp3out) xr_ocean1=xr.open_dataset(fileoce1) xr_ocean2=xr.open_dataset(fileoce2) xr_mask=xr.open_dataset(maskoce) #--extraction des array numpy - conversion en longdouble pour les sommes calving=np.longdouble(xr_calving['OCalving'].values) iceberg=np.longdouble(xr_iceberg['OIceberg'].values) icshelf=np.longdouble(xr_icshelf['OIcshelf'].values) area1=np.longdouble(xr_ocean1['area'].values) area2=np.longdouble(xr_ocean2['torc.srf'].values) mask=np.longdouble(xr_mask['tmaskutil'][0,:,:].values) #--moyenne sur le mois timavg_calving=np.average(calving,axis=0) timavg_iceberg=np.average(iceberg,axis=0) timavg_icshelf=np.average(icshelf,axis=0) #--totaux sur la grille - conversion en mSv tot_calving=np.sum(timavg_calving*area1*mask)/1.e9 tot_iceberg=np.sum(timavg_iceberg*area1*mask)/1.e9 tot_icshelf=np.sum(timavg_icshelf*area1*mask)/1.e9 print('using areas from grid_T output files') print('calving=',tot_calving) print('iceberg=',tot_iceberg) print('icshelf=',tot_icshelf) print('total =',tot_calving+tot_iceberg+tot_icshelf) #--totaux sur la grille MOSAIX- conversion en mSv tot_calving=np.sum(timavg_calving*area2*mask)/1.e9 tot_iceberg=np.sum(timavg_iceberg*area2*mask)/1.e9 tot_icshelf=np.sum(timavg_icshelf*area2*mask)/1.e9 print('using areas from MOSAIX input files') print('calving=',tot_calving) print('iceberg=',tot_iceberg) print('icshelf=',tot_icshelf) print('total =',tot_calving+tot_iceberg+tot_icshelf) }}} Résultats : {{{ using areas from grid_T output files ('calving=', 0.0091432837965132036953) ('iceberg=', 0.10590818521245772696) ('icshelf=', 0.10590818497418567355) ('total =', 0.2209596539831566042) using areas from MOSAIX input files ('calving=', 0.0091432837958004664394) ('iceberg=', 0.10590818484285999668) ('icshelf=', 0.10590818484286002445) ('total =', 0.22095965348152048758) }}} On retrouve les mêmes sommes, avec du longdouble pour faire les calculs.