Changes between Version 2 and Version 3 of IPSLCM6/calving


Ignore:
Timestamp:
01/05/21 23:21:22 (3 years ago)
Author:
oboucher
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • IPSLCM6/calving

    v2 v3  
    1 = Conservation du calving : où est l'erreur ? =  
     1= Conservation de l'évaporation : où est l'erreur ? =  
    22 
    3 == Exemple avec le MR025 ==  
     3== Exemple avec le VLR ==  
    44 
    5 Expérience : /ccc/cont003/home/gencmip6/oboucher/IPSLCM6.2/modipsl/config/IPSLCM6/CM61-MR025-pd-04 
     5Expérience : /ccc/work/cont003/ra5424/p25khod/IPSLCM6.5_work_15DEC/modipsl/config/IPSLCM6/CM65-VLR-pd-tn-01-test 
    66 
    7 Fichier poids utilisés : voir /ccc/cont003/home/gencmip6/oboucher/IPSLCM6.2/modipsl/config/IPSLCM6/CM61-MR025-pd-04/COMP/oasis.card  
     7Sorties : /ccc/store/cont003/gencmip6/p25khod/IGCM_OUT/IPSLCM6/DEVT/pdControl/CM65-VLR-pd-tn-01-test 
    88 
    9 Sorties : /ccc/scratch/cont003/gencmip6/oboucher/IGCM_OUT/IPSLCM6/TEST/pdControl/CM61-MR025-pd-04  
     9Détails : 12 mois de simu, 18500101_18501231, cpl_old_calving=no, bug fixé dans LMDZ pour le calcul du flux cumulé par bande de latitude  
    1010 
    11 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  
     11Problème : le flux de évap qui repart du coupleur diffère un peu trop du flux de évap qui arrive, alors que les flux de pluie et neige sont très bien conservés  
    1212 
    13 Problème : le flux de calving qui repart du coupleur diffère un peu trop du flux de calving qui arrive  
     13Fichier d'aires NEMO : ceux du fichier de sortie grid_T de NEMO  
    1414 
    15 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  
     15Fichier masque NEMO : /ccc/cont003/home/lmd/oboucher/BILAN_EAU/maskutil_T.nc 
    1616 
    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  
     17Diagnostic 1 - script python  
    10118 
    10219{{{ 
     
    10421import numpy as np 
    10522 
    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" 
     23exp="CM65-VLR-pd-tn-01-test" 
     24dir="/ccc/store/cont003/gencmip6/p25khod/IGCM_OUT/IPSLCM6/DEVT/pdControl/"+exp+"/" 
     25 
     26file_atm=dir+"ATM/Output/MO/"+exp+"_18500101_18501231_1M_histmth.nc" 
     27 
     28file_calving_1=dir+"CPL/Output/MO/"+exp+"_18500101_18501231_COCALVIN.nc" 
     29file_calving_2=dir+"CPL/Output/MO/"+exp+"_18500101_18501231_OCalving.nc" 
     30 
     31file_evap_1=dir+"CPL/Output/MO/"+exp+"_18500101_18501231_COTOTEVA.nc" 
     32file_evap_2=dir+"CPL/Output/MO/"+exp+"_18500101_18501231_OTotEvap.nc" 
     33 
     34file_rain_1=dir+"CPL/Output/MO/"+exp+"_18500101_18501231_COTOTRAI.nc" 
     35file_rain_2=dir+"CPL/Output/MO/"+exp+"_18500101_18501231_OTotRain.nc" 
     36 
     37file_snow_1=dir+"CPL/Output/MO/"+exp+"_18500101_18501231_COTOTSNO.nc" 
     38file_snow_2=dir+"CPL/Output/MO/"+exp+"_18500101_18501231_OTotSnow.nc" 
     39 
     40fileoce=dir+"OCE/Output/MO/"+exp+"_18500101_18501231_1M_grid_T.nc" 
     41maskoce="/ccc/cont003/home/lmd/oboucher/BILAN_EAU/maskutil_T.nc" 
    11442 
    11543#--ouverture des xarray 
    116 xr_calving=xr.open_dataset(filecp1out) 
    117 xr_iceberg=xr.open_dataset(filecp2out) 
    118 xr_icshelf=xr.open_dataset(filecp3out) 
    119 xr_ocean1=xr.open_dataset(fileoce1) 
    120 xr_ocean2=xr.open_dataset(fileoce2) 
     44xr_atm=xr.open_dataset(file_atm) 
     45xr_calving_1=xr.open_dataset(file_calving_1) 
     46xr_calving_2=xr.open_dataset(file_calving_2) 
     47xr_evap_1=xr.open_dataset(file_evap_1) 
     48xr_evap_2=xr.open_dataset(file_evap_2) 
     49xr_rain_1=xr.open_dataset(file_rain_1) 
     50xr_rain_2=xr.open_dataset(file_rain_2) 
     51xr_snow_1=xr.open_dataset(file_snow_1) 
     52xr_snow_2=xr.open_dataset(file_snow_2) 
     53xr_ocean=xr.open_dataset(fileoce) 
    12154xr_mask=xr.open_dataset(maskoce) 
    12255 
    12356#--extraction des array numpy - conversion en longdouble pour les sommes 
    124 calving=np.longdouble(xr_calving['OCalving'].values) 
    125 iceberg=np.longdouble(xr_iceberg['OIceberg'].values) 
    126 icshelf=np.longdouble(xr_icshelf['OIcshelf'].values) 
    127 area1=np.longdouble(xr_ocean1['area'].values) 
    128 area2=np.longdouble(xr_ocean2['torc.srf'].values) 
    129 mask=np.longdouble(xr_mask['tmaskutil'][0,:,:].values) 
     57atm_aire0=np.longdouble(xr_atm['aire'].values) 
     58atm_oce=np.longdouble(xr_atm['pourc_oce'].values) 
     59atm_sic=np.longdouble(xr_atm['pourc_sic'].values) 
    13060 
    131 #--moyenne sur le mois 
    132 timavg_calving=np.average(calving,axis=0) 
    133 timavg_iceberg=np.average(iceberg,axis=0) 
    134 timavg_icshelf=np.average(icshelf,axis=0) 
     61wbilo_oce=np.longdouble(xr_atm['wbilo_oce'].values) 
     62wbilo_sic=np.longdouble(xr_atm['wbilo_sic'].values) 
    13563 
    136 #--totaux sur la grille - conversion en mSv 
    137 tot_calving=np.sum(timavg_calving*area1*mask)/1.e9 
    138 tot_iceberg=np.sum(timavg_iceberg*area1*mask)/1.e9 
    139 tot_icshelf=np.sum(timavg_icshelf*area1*mask)/1.e9 
     64atm_aire=atm_aire0*(atm_oce+atm_sic)/100. 
    14065 
    141 print('using areas from grid_T output files') 
    142 print('calving=',tot_calving) 
    143 print('iceberg=',tot_iceberg) 
    144 print('icshelf=',tot_icshelf) 
    145 print('total  =',tot_calving+tot_iceberg+tot_icshelf) 
     66calving_1=np.longdouble(xr_calving_1['COCALVIN'].values) 
     67calving_2=np.longdouble(xr_calving_2['OCalving'].values) 
    14668 
    147 #--totaux sur la grille MOSAIX- conversion en mSv 
    148 tot_calving=np.sum(timavg_calving*area2*mask)/1.e9 
    149 tot_iceberg=np.sum(timavg_iceberg*area2*mask)/1.e9 
    150 tot_icshelf=np.sum(timavg_icshelf*area2*mask)/1.e9 
     69evap_1=np.longdouble(xr_evap_1['COTOTEVA'].values) 
     70evap_2=np.longdouble(xr_evap_2['OTotEvap'].values) 
    15171 
    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) 
     72rain_1=np.longdouble(xr_rain_1['COTOTRAI'].values) 
     73rain_2=np.longdouble(xr_rain_2['OTotRain'].values) 
     74 
     75snow_1=np.longdouble(xr_snow_1['COTOTSNO'].values) 
     76snow_2=np.longdouble(xr_snow_2['OTotSnow'].values) 
     77 
     78oce_area=np.longdouble(xr_ocean['area'].values) 
     79 
     80mask=np.longdouble(xr_mask['maskutil_T'][:,:].values) 
     81 
     82#--totaux sur la grille - conversion en Sv 
     83tot_calving_1=np.sum(calving_1,axis=(1,2))/1.e9 
     84tot_calving_2=np.sum(calving_2*oce_area*mask,axis=(1,2))/1.e9 
     85print('calving in  Sv =',tot_calving_1[0:10]) 
     86print('calving out Sv =',tot_calving_2[0:10]) 
     87 
     88}}} 
     89 
     90Ré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 
     100Tout va bien, c'est la même chose en input et en output  
     101 
     102{{{ 
     103tot_evap_1=np.sum(evap_1*atm_aire[0,:,:],axis=(1,2))/1.e9 
     104tot_evap_2=np.sum(evap_2*oce_area*mask,axis=(1,2))/1.e9 
     105tot_rain_1=np.sum(rain_1*atm_aire[0,:,:],axis=(1,2))/1.e9 
     106tot_rain_2=np.sum(rain_2*oce_area*mask,axis=(1,2))/1.e9 
     107tot_snow_1=np.sum(snow_1*atm_aire[0,:,:],axis=(1,2))/1.e9 
     108tot_snow_2=np.sum(snow_2*oce_area*mask,axis=(1,2))/1.e9 
     109 
     110print('oceanic area from grid_T file') 
     111print('rain in  Sv =',tot_rain_1[0:10]) 
     112print('rain out Sv =',tot_rain_2[0:10]) 
     113print('snow in  Sv =',tot_snow_1[0:10]) 
     114print('snow out Sv =',tot_snow_2[0:10]) 
     115print('evap in  Sv =',tot_evap_1[0:10]) 
     116print('evap out Sv =',tot_evap_2[0:10]) 
     117print('evap diff mSv=',(tot_evap_1[1:10]-tot_evap_2[1:10])*1000.) 
     118 
    157119}}} 
    158120 
    159121Résultats :  
    160122{{{ 
    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)) 
    171137}}} 
    172138 
    173 On retrouve les mêmes sommes, avec du longdouble pour faire les calculs.  
     139Rain et snow sont très bien conservés, mais ce n'est pas le cas de Evap avec des différences de 1 mSv.