17 | | Fichier masque NEMO : /ccc/work/cont003/igcmg/igcmg/IGCM/OCE/NEMO/eORCA025.4/GRIDS/eORCA025_mesh_mask.nc |
18 | | |
19 | | Diagnostic 1 - script cdo |
20 | | |
21 | | {{{ |
22 | | exp=CM61-MR025-pd-04 |
23 | | dir=/ccc/store/cont003/gencmip6/oboucher/IGCM_OUT/IPSLCM6/DEVT/pdControl/${exp} |
24 | | dir=/ccc/scratch/cont003/gencmip6/oboucher/IGCM_OUT/IPSLCM6/TEST/pdControl/${exp} |
25 | | fileatm=${dir}/ATM/Output/MO/${exp}_18500101_18500131_1M_histmth.nc |
26 | | filecp1in=${dir}/CPL/Output/MO/${exp}_18500101_18500131_COCALVIN.nc |
27 | | filecp2in=${dir}/CPL/Output/MO/${exp}_18500101_18500131_COWINDSP.nc |
28 | | filecp1out=${dir}/CPL/Output/MO/${exp}_18500101_18500131_OCalving.nc |
29 | | filecp2out=${dir}/CPL/Output/MO/${exp}_18500101_18500131_OIceberg.nc |
30 | | filecp3out=${dir}/CPL/Output/MO/${exp}_18500101_18500131_OIcshelf.nc |
31 | | fileoce=${dir}/OCE/Output/MO/${exp}_18500101_18500131_1M_grid_T.nc |
32 | | maskoce=/ccc/work/cont003/igcmg/igcmg/IGCM/OCE/NEMO/eORCA025.4/GRIDS/eORCA025_mesh_mask.nc |
33 | | echo $fileatm |
34 | | echo $filecp1in |
35 | | echo $filecp2in |
36 | | echo $filecp2 |
37 | | echo $fileoce |
38 | | echo $maskoce |
39 | | |
40 | | #-file cp1in have 32 timesteps, remove timestep 1 |
41 | | |
42 | | #--intermediate diagnstics in LMDZ |
43 | | sum_fqfonte=`cdo outputf,%12.10g,10 -divc,1.e9 -fldsum -yearmonmean -expr,'toto=fqfonte*aire' ${fileatm}` |
44 | | sum_fqcalving=`cdo outputf,%12.10g,10 -divc,1.e9 -fldsum -yearmonmean -expr,'toto=fqcalving*aire' ${fileatm}` |
45 | | |
46 | | #--calving diagnostic in LMDZ before integration - robust |
47 | | sum_wei_atm=`cdo outputf,%12.10g,10 -divc,1.e9 -fldsum -yearmonmean -expr,'toto=runofflic*pourc_lic/100.*aire' ${fileatm}` |
48 | | |
49 | | #--CALVIN That reaches coupler after integration in LMDZ |
50 | | #--first timestep is 0 and is not included in average |
51 | | sum_wei_cp1in=`cdo outputf,%12.10g,10 -divc,1.e9 -fldsum -timavg -seltimestep,2/32 -selname,COCALVIN ${filecp1in}` |
52 | | |
53 | | #--1st term out of the coupler |
54 | | sum_wei_cp1out=`cdo outputf,%12.10g,10 -divc,1.e9 -fldsum -mul -mul -timavg -selname,OCalving ${filecp1out} -selvar,tmaskutil ${maskoce} -gridarea ${fileoce}` |
55 | | #--2nd term out of the coupler |
56 | | sum_wei_cp2out=`cdo outputf,%12.10g,10 -divc,1.e9 -fldsum -mul -mul -timavg -selname,OIceberg ${filecp2out} -selvar,tmaskutil ${maskoce} -gridarea ${fileoce}` |
57 | | #--3rd term out of the coupler |
58 | | sum_wei_cp3out=`cdo outputf,%12.10g,10 -divc,1.e9 -fldsum -mul -mul -timavg -selname,OIcshelf ${filecp3out} -selvar,tmaskutil ${maskoce} -gridarea ${fileoce}` |
59 | | |
60 | | #--1st term as diagnosed in NEMO |
61 | | sum_wei_oce1=`cdo outputf,%12.10g,10 -divc,1.e9 -fldsum -mul -mul -timavg -selname,calving ${fileoce} -selvar,tmaskutil ${maskoce} -gridarea ${fileoce}` |
62 | | #--2nd term as diagnosed in NEMO |
63 | | sum_wei_oce2=`cdo outputf,%12.10g,10 -divc,1.e9 -fldsum -mul -mul -timavg -selname,iceberg ${fileoce} -selvar,tmaskutil ${maskoce} -gridarea ${fileoce}` |
64 | | #--3rd term as diagnosed in NEMO |
65 | | sum_wei_oce3=`cdo outputf,%12.10g,10 -divc,1.e9 -fldsum -mul -mul -timavg -selname,iceshelf ${fileoce} -selvar,tmaskutil ${maskoce} -gridarea ${fileoce}` |
66 | | |
67 | | echo 'weighted sum FQFONTE =' $sum_fqfonte |
68 | | echo 'weighted sum FQCALVING=' $sum_fqcalving |
69 | | |
70 | | echo 'weighted sum ATM=' $sum_wei_atm |
71 | | |
72 | | echo 'weighted sum CP new in=' $sum_wei_cp1in |
73 | | |
74 | | echo 'weighted sum CP1 calving out=' $sum_wei_cp1out |
75 | | echo 'weighted sum CP2 iceberg out=' $sum_wei_cp2out |
76 | | echo 'weighted sum CP3 iceshelf out=' $sum_wei_cp3out |
77 | | echo 'weighted sum CP total out =' `echo $sum_wei_cp1out + $sum_wei_cp2out + $sum_wei_cp3out | bc` |
78 | | |
79 | | echo 'weighted sum OCE1 calving =' $sum_wei_oce1 |
80 | | echo 'weighted sum OCE2 iceberg =' $sum_wei_oce2 |
81 | | echo 'weighted sum OCE3 iceshelf=' $sum_wei_oce3 |
82 | | echo 'weighted sum OCE total =' `echo $sum_wei_oce1 + $sum_wei_oce2 + $sum_wei_oce3 | bc` |
83 | | }}} |
84 | | |
85 | | Résultats : |
86 | | {{{ |
87 | | weighted sum ATM= 0.2182236825 |
88 | | weighted sum CP new in= 0.2182726731 |
89 | | weighted sum CP1 calving out= 0.009143283797 |
90 | | weighted sum CP2 iceberg out= 0.1059081852 |
91 | | weighted sum CP3 iceshelf out= 0.105908185 |
92 | | weighted sum CP total out = .220959653997 |
93 | | weighted sum OCE1 calving = 0.009143283772 |
94 | | weighted sum OCE2 iceberg = 0.1059081852 |
95 | | weighted sum OCE3 iceshelf= 0.1059081849 |
96 | | weighted sum OCE total = .220959653872 |
97 | | }}} |
98 | | 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. |
99 | | |
100 | | Diagnostic 2 - script python |
| 17 | Diagnostic 1 - script python |
106 | | exp="CM61-MR025-pd-04" |
107 | | dir="/ccc/scratch/cont003/gencmip6/oboucher/IGCM_OUT/IPSLCM6/TEST/pdControl/"+exp+"/" |
108 | | filecp1out=dir+"CPL/Output/MO/"+exp+"_18500101_18500131_OCalving.nc" |
109 | | filecp2out=dir+"CPL/Output/MO/"+exp+"_18500101_18500131_OIceberg.nc" |
110 | | filecp3out=dir+"CPL/Output/MO/"+exp+"_18500101_18500131_OIcshelf.nc" |
111 | | fileoce1=dir+"OCE/Output/MO/"+exp+"_18500101_18500131_1M_grid_T.nc" |
112 | | fileoce2="/ccc/work/cont003/igcmg/igcmg/IGCM/CPL/IPSLCM6/eORCA025.1xLMD256256/areas_eORCA025.1xLMD256256_MOSAIX_v0.nc" |
113 | | maskoce="/ccc/work/cont003/igcmg/igcmg/IGCM/OCE/NEMO/eORCA025.4/GRIDS/eORCA025_mesh_mask.nc" |
| 23 | exp="CM65-VLR-pd-tn-01-test" |
| 24 | dir="/ccc/store/cont003/gencmip6/p25khod/IGCM_OUT/IPSLCM6/DEVT/pdControl/"+exp+"/" |
| 25 | |
| 26 | file_atm=dir+"ATM/Output/MO/"+exp+"_18500101_18501231_1M_histmth.nc" |
| 27 | |
| 28 | file_calving_1=dir+"CPL/Output/MO/"+exp+"_18500101_18501231_COCALVIN.nc" |
| 29 | file_calving_2=dir+"CPL/Output/MO/"+exp+"_18500101_18501231_OCalving.nc" |
| 30 | |
| 31 | file_evap_1=dir+"CPL/Output/MO/"+exp+"_18500101_18501231_COTOTEVA.nc" |
| 32 | file_evap_2=dir+"CPL/Output/MO/"+exp+"_18500101_18501231_OTotEvap.nc" |
| 33 | |
| 34 | file_rain_1=dir+"CPL/Output/MO/"+exp+"_18500101_18501231_COTOTRAI.nc" |
| 35 | file_rain_2=dir+"CPL/Output/MO/"+exp+"_18500101_18501231_OTotRain.nc" |
| 36 | |
| 37 | file_snow_1=dir+"CPL/Output/MO/"+exp+"_18500101_18501231_COTOTSNO.nc" |
| 38 | file_snow_2=dir+"CPL/Output/MO/"+exp+"_18500101_18501231_OTotSnow.nc" |
| 39 | |
| 40 | fileoce=dir+"OCE/Output/MO/"+exp+"_18500101_18501231_1M_grid_T.nc" |
| 41 | maskoce="/ccc/cont003/home/lmd/oboucher/BILAN_EAU/maskutil_T.nc" |
152 | | print('using areas from MOSAIX input files') |
153 | | print('calving=',tot_calving) |
154 | | print('iceberg=',tot_iceberg) |
155 | | print('icshelf=',tot_icshelf) |
156 | | print('total =',tot_calving+tot_iceberg+tot_icshelf) |
| 72 | rain_1=np.longdouble(xr_rain_1['COTOTRAI'].values) |
| 73 | rain_2=np.longdouble(xr_rain_2['OTotRain'].values) |
| 74 | |
| 75 | snow_1=np.longdouble(xr_snow_1['COTOTSNO'].values) |
| 76 | snow_2=np.longdouble(xr_snow_2['OTotSnow'].values) |
| 77 | |
| 78 | oce_area=np.longdouble(xr_ocean['area'].values) |
| 79 | |
| 80 | mask=np.longdouble(xr_mask['maskutil_T'][:,:].values) |
| 81 | |
| 82 | #--totaux sur la grille - conversion en Sv |
| 83 | tot_calving_1=np.sum(calving_1,axis=(1,2))/1.e9 |
| 84 | tot_calving_2=np.sum(calving_2*oce_area*mask,axis=(1,2))/1.e9 |
| 85 | print('calving in Sv =',tot_calving_1[0:10]) |
| 86 | print('calving out Sv =',tot_calving_2[0:10]) |
| 87 | |
| 88 | }}} |
| 89 | |
| 90 | Résultats pour le calving : |
| 91 | {{{ |
| 92 | |
| 93 | ('calving in Sv =', array([ 0.0, 0.025110938, 0.07871894, 0.060956317, 0.066686016, |
| 94 | 0.032709929, 0.049833877, 0.033137503, 0.032376687, 0.059238586], dtype=float128)) |
| 95 | ('calving out Sv =', array([ 0.0, 0.025110938, 0.07871894, 0.060956317, 0.066686016, |
| 96 | 0.032709929, 0.049833878, 0.033137503, 0.032376687, 0.059238586], dtype=float128)) |
| 97 | |
| 98 | }}} |
| 99 | |
| 100 | Tout va bien, c'est la même chose en input et en output |
| 101 | |
| 102 | {{{ |
| 103 | tot_evap_1=np.sum(evap_1*atm_aire[0,:,:],axis=(1,2))/1.e9 |
| 104 | tot_evap_2=np.sum(evap_2*oce_area*mask,axis=(1,2))/1.e9 |
| 105 | tot_rain_1=np.sum(rain_1*atm_aire[0,:,:],axis=(1,2))/1.e9 |
| 106 | tot_rain_2=np.sum(rain_2*oce_area*mask,axis=(1,2))/1.e9 |
| 107 | tot_snow_1=np.sum(snow_1*atm_aire[0,:,:],axis=(1,2))/1.e9 |
| 108 | tot_snow_2=np.sum(snow_2*oce_area*mask,axis=(1,2))/1.e9 |
| 109 | |
| 110 | print('oceanic area from grid_T file') |
| 111 | print('rain in Sv =',tot_rain_1[0:10]) |
| 112 | print('rain out Sv =',tot_rain_2[0:10]) |
| 113 | print('snow in Sv =',tot_snow_1[0:10]) |
| 114 | print('snow out Sv =',tot_snow_2[0:10]) |
| 115 | print('evap in Sv =',tot_evap_1[0:10]) |
| 116 | print('evap out Sv =',tot_evap_2[0:10]) |
| 117 | print('evap diff mSv=',(tot_evap_1[1:10]-tot_evap_2[1:10])*1000.) |
| 118 | |
161 | | using areas from grid_T output files |
162 | | ('calving=', 0.0091432837965132036953) |
163 | | ('iceberg=', 0.10590818521245772696) |
164 | | ('icshelf=', 0.10590818497418567355) |
165 | | ('total =', 0.2209596539831566042) |
166 | | using areas from MOSAIX input files |
167 | | ('calving=', 0.0091432837958004664394) |
168 | | ('iceberg=', 0.10590818484285999668) |
169 | | ('icshelf=', 0.10590818484286002445) |
170 | | ('total =', 0.22095965348152048758) |
| 123 | ('rain in Sv =', array([ 0.0, 3.4585411, 8.8186534, 11.318086, 11.570535, 11.836867, |
| 124 | 11.357751, 11.295551, 11.242278, 11.49349], dtype=float128)) |
| 125 | ('rain out Sv =', array([ 0.0, 3.4585411, 8.8186534, 11.317966, 11.570457, 11.836863, |
| 126 | 11.35775, 11.295479, 11.242256, 11.493486], dtype=float128)) |
| 127 | ('snow in Sv =', array([ 0.0, 0.43405517, 0.48368972, 0.41251261, 0.36736733, |
| 128 | 0.39909007, 0.46146092, 0.3871201, 0.33174664, 0.45059974], dtype=float128)) |
| 129 | ('snow out Sv =', array([ 0.0, 0.43405517, 0.48368972, 0.41251261, 0.36736733, |
| 130 | 0.39909007, 0.46146092, 0.38712011, 0.33174664, 0.45059974], dtype=float128)) |
| 131 | ('evap in Sv =', array([ 0.0, 12.638699, 12.227281, 13.689618, 14.567473, 14.940661, |
| 132 | 14.904491, 14.177904, 13.691065, 13.653616], dtype=float128)) |
| 133 | ('evap out Sv =', array([ 0.0, 12.638585, 12.226845, 13.689247, 14.566987, 14.940099, |
| 134 | 14.903804, 14.177131, 13.690155, 13.652478], dtype=float128)) |
| 135 | ('evap diff mSv=', array([ 0.11373978, 0.43656301, 0.37129745, 0.48537692, 0.5611987, |
| 136 | 0.68672948, 0.77286054, 0.91008484, 1.1375948], dtype=float128)) |