Changeset 4199


Ignore:
Timestamp:
12/18/18 16:06:39 (6 years ago)
Author:
omamce
Message:

O.M. : MOASAIX, suppress generation of NetCDF3 files

Location:
TOOLS/MOSAIX
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/MOSAIX/CalvingWeights.py

    r4186 r4199  
    4242parser.add_argument ('--repartition_file', help='Data files with iceberg melting' , type=str, default='./runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc' ) 
    4343parser.add_argument ('--repartition_var' , help='Variable name for iceshelf'      , type=str, default=None) 
    44 parser.add_argument ('--output'  , help='output rmp file name', default='rmp_tlmd_to_torc_calving_64bit.nc' ) 
    45 parser.add_argument ('--fmt'     , help='NetCDF file format, using nco syntax', default='64bit', choices=['classic', 'netcdf3', '64bit', '64bit_data', '64bit_data', 'netcdf4', 'netcdf4_classsic'] ) 
     44parser.add_argument ('--output'  , help='output rmp file name', default='rmp_tlmd_to_torc_calving.nc' ) 
     45parser.add_argument ('--fmt'     , help='NetCDF file format, using nco syntax', default='netcdf4', choices=['classic', 'netcdf3', '64bit', '64bit_data', '64bit_data', 'netcdf4', 'netcdf4_classsic'] ) 
    4646 
    4747# Parse command line 
  • TOOLS/MOSAIX/CreateOasisGrids.bash

    r4186 r4199  
    123123echo ${Titre}"Format for OASIS-MCT files : should be NetCDF3 classic or NetCDF3 64 bits"${Norm} 
    124124# --------------------------------------------------------------------------- 
    125 FL_FMT3=64bit 
    126  
     125FL_FMT=netcdf4 
    127126# 
    128127echo ${Titre}"Cleaning"${Norm} 
     
    132131 
    133132# 
    134 echo ${Titre}"Creates NetCDF3 version of input files"${Norm} 
    135 # ---------------------------------------------------------------------------- 
    136 ncks --overwrite --fl_fmt=${FL_FMT} --history ${OCE}_coordinates_mask.nc      ${OCE}_coordinates_mask_${FL_FMT3}.nc 
    137 ncks --overwrite --fl_fmt=${FL_FMT} --history ${ATM}_grid_maskFrom_${OCE}.nc  ${ATM}_grid_maskFrom_${OCE}_${FL_FMT3}.nc 
    138  
    139  
    140133# 
    141134echo ${Titre}"Creates ocean fields"${Norm} 
    142135# ---------------------------------------------------------------------------- 
    143136for OCEGRID in T U V ; do 
    144     ncks --fl_fmt=${FL_FMT3} -C --history --append --variable nav_lon_grid_${OCEGRID},nav_lat_grid_${OCEGRID},bounds_lon_grid_${OCEGRID},bounds_lat_grid_${OCEGRID} ${OCE}_coordinates_mask_${FL_FMT3}.nc grids_${CplModel}.nc 
    145     ncks --fl_fmt=${FL_FMT3} -C --history --append --variable area_grid_${OCEGRID} ${OCE}_coordinates_mask_${FL_FMT3}.nc areas_${CplModel}.nc 
     137    ncks -C --history --append --variable nav_lon_grid_${OCEGRID},nav_lat_grid_${OCEGRID},bounds_lon_grid_${OCEGRID},bounds_lat_grid_${OCEGRID} ${OCE}_coordinates_mask.nc grids_${CplModel}.nc 
     138    ncks -C --history --append --variable area_grid_${OCEGRID} ${OCE}_coordinates_mask.nc areas_${CplModel}.nc 
    146139    # Inverts mask values and switch to integer 
    147     ncks --fl_fmt=${FL_FMT33} --history -C --variable mask_${OCEGRID} ${OCE}_coordinates_mask_${FL_FMT3}.nc mask_${OCEGRID}_tmp.nc 
     140    ncks --history -C --variable mask_${OCEGRID} ${OCE}_coordinates_mask.nc mask_${OCEGRID}_tmp.nc 
    148141    ncatted --history \ 
    149142            --attribute coordinates,mask_${OCEGRID},d,,         \ 
     
    152145    mask_${OCEGRID}_tmp.nc 
    153146     
    154     ncap2 --fl_fmt=${FL_FMT3} --history --append --script "mask_${OCEGRID}=int(1-mask_${OCEGRID});"    mask_${OCEGRID}_tmp.nc masks_${CplModel}.nc 
     147    ncap2 --history --append --script "mask_${OCEGRID}=int(1-mask_${OCEGRID});"    mask_${OCEGRID}_tmp.nc masks_${CplModel}.nc 
    155148    rm mask_${OCEGRID}_tmp.nc 
    156149    ncatted --history \ 
     
    163156done 
    164157 
    165 ncks --history --append --variable lon,lat ${ATM}_grid_maskFrom_${OCE}_${FL_FMT3}.nc grids_${CplModel}.nc 
     158ncks --history --append --variable lon,lat ${ATM}_grid_maskFrom_${OCE}.nc grids_${CplModel}.nc 
    166159  
    167160# 
     
    172165 
    173166if [[ ${ATM} = dynamico* || ${ATM} = ICO* ]] ; then  
    174     ncks --fl_fmt=${FL_FMT3} --history --append --variable bounds_lon,bounds_lat ${ATM}_grid_maskFrom_${OCE}_${FL_FMT3}.nc grids_${CplModel}.nc 
     167    ncks --history --append --variable bounds_lon,bounds_lat ${ATM}_grid_maskFrom_${OCE}.nc grids_${CplModel}.nc 
    175168fi 
    176169 
    177 ncks --fl_fmt=${FL_FMT3} --history -C --append --variable aire   ${ATM}_grid_maskFrom_${OCE}_${FL_FMT3}.nc areas_${CplModel}.nc 
     170ncks --history -C --append --variable aire   ${ATM}_grid_maskFrom_${OCE}.nc areas_${CplModel}.nc 
    178171ncatted --history --attribute coordinates,aire,d,,     \ 
    179172        --attribute _FillValue,aire,d,,                \ 
     
    184177        areas_${CplModel}.nc 
    185178 
    186 ncks --fl_fmt=${FL_FMT3} --history -C --variable OceMask         ${ATM}_grid_maskFrom_${OCE}_${FL_FMT3}.nc OceMask_tmp.nc 
     179ncks --history -C --variable OceMask         ${ATM}_grid_maskFrom_${OCE}.nc OceMask_tmp.nc 
    187180ncwa --history --overwrite --average time_counter OceMask_tmp.nc OceMask_tmp2.nc # Suppress time dimension 
    188181ncatted --history \ 
     
    193186        --attribute missing_value,OceMask,d,,       \ 
    194187        OceMask_tmp.nc 
    195 ncap2 --fl_fmt=${FL_FMT3} --history --append --script "OceMask=int(1-OceMask)" OceMask_tmp2.nc masks_${CplModel}.nc # For OASIS, ocean=0, land=1 
     188ncap2 --history --append --script "OceMask=int(1-OceMask)" OceMask_tmp2.nc masks_${CplModel}.nc # For OASIS, ocean=0, land=1 
    196189rm OceMask_tmp.nc 
    197190ncatted --history \ 
     
    235228EOF 
    236229    
    237     ncap2 --fl_fmt=${FL_FMT3} --history --append --script-file add_dim.nco  grids_${CplModel}_tmp.nc grids_${CplModel}.nc 
     230    ncap2 --history --append --script-file add_dim.nco  grids_${CplModel}_tmp.nc grids_${CplModel}.nc 
    238231     
    239232    mv masks_${CplModel}.nc masks_${CplModel}_tmp.nc 
    240     ncap2 --fl_fmt=${FL_FMT3} --history --append --script 'defdim("xcell",1) '   masks_${CplModel}_tmp.nc masks_${CplModel}.nc 
     233    ncap2 --history --append --script 'defdim("xcell",1) '   masks_${CplModel}_tmp.nc masks_${CplModel}.nc 
    241234    mv masks_${CplModel}.nc masks_${CplModel}_tmp.nc 
    242     ncap2 --fl_fmt=${FL_FMT3} --history --append --script 'OceMask[ycell,xcell]=OceMask'  masks_${CplModel}_tmp.nc masks_${CplModel}.nc 
     235    ncap2 --history --append --script 'OceMask[ycell,xcell]=OceMask'  masks_${CplModel}_tmp.nc masks_${CplModel}.nc 
    243236 
    244237    mv areas_${CplModel}.nc areas_${CplModel}_tmp.nc 
    245     ncap2 --fl_fmt=${FL_FMT3} --history --append --script 'defdim("xcell",1) ; aire[ycell,xcell]=aire ; ' areas_${CplModel}_tmp.nc areas_${CplModel}.nc 
     238    ncap2 --history --append --script 'defdim("xcell",1) ; aire[ycell,xcell]=aire ; ' areas_${CplModel}_tmp.nc areas_${CplModel}.nc 
    246239 
    247240    rm -f grids_${CplModel}_tmp.nc areas_${CplModel}_tmp.nc masks_${CplModel}_tmp.nc 
     
    255248    # ----------------------------------------------------------------------- 
    256249    mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc 
    257     ncap2 --fl_fmt=${FL_FMT3} --history --append --script "alon[lat,lon]=alon; alat[lat,lon]=alat"  grids_${CplModel}_tmp.nc grids_${CplModel}.nc 
     250    ncap2 --history --append --script "alon[lat,lon]=alon; alat[lat,lon]=alat"  grids_${CplModel}_tmp.nc grids_${CplModel}.nc 
    258251    rm -f grids_${CplModel}_tmp.nc 
    259252    ncatted --history \ 
     
    291284EOF 
    292285    mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc 
    293     ncap2 --fl_fmt=${FL_FMT3} --history --script-file add_bounds.nco -O grids_${CplModel}_tmp.nc grids_${CplModel}.nc 
     286    ncap2 --history --script-file add_bounds.nco -O grids_${CplModel}_tmp.nc grids_${CplModel}.nc 
    294287    rm grids_${CplModel}_tmp.nc 
    295288fi 
     
    303296# ---------------------------------------------------------------------------- 
    304297mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc 
    305 ncap2 --fl_fmt=${FL_FMT3} --history --script "o${atm}_lon=alon; o${atm}_lat=alat; bounds_o${atm}_lon=bounds_lon; bounds_o${atm}_lat=bounds_lat; " grids_${CplModel}_tmp.nc grids_${CplModel}.nc 
     298ncap2 --history --script "o${atm}_lon=alon ; o${atm}_lat=alat ; bounds_o${atm}_lon=bounds_lon; bounds_o${atm}_lat=bounds_lat ; " grids_${CplModel}_tmp.nc grids_${CplModel}.nc 
    306299 
    307300mv areas_${CplModel}.nc areas_${CplModel}_tmp.nc 
    308 ncap2 --fl_fmt=${FL_FMT3} --history --script "o${atm}_aire=aire*0.0d+1.0d; "   areas_${CplModel}_tmp.nc areas_${CplModel}.nc 
     301ncap2 --history --script "o${atm}_aire=aire*0.0d+1.0d ; "   areas_${CplModel}_tmp.nc areas_${CplModel}.nc 
    309302 
    310303mv masks_${CplModel}.nc masks_${CplModel}_tmp.nc 
    311 ncap2 --fl_fmt=${FL_FMT3} --history --script "o${atm}_mask=int(OceMask)*0+0; " masks_${CplModel}_tmp.nc masks_${CplModel}.nc 
     304ncap2 --history --script "o${atm}_mask=int(OceMask)*0+0 ; " masks_${CplModel}_tmp.nc masks_${CplModel}.nc 
    312305 
    313306rm grids_${CplModel}_tmp.nc areas_${CplModel}_tmp.nc masks_${CplModel}_tmp.nc 
    314307 
     308 
     309echo ${Titre}"Generates grid c${atm}, 'o' meaning 'one'"${Norm} 
     310# same as t${atm} grid, with surfaces set to grid area 
     311# and mask to 0 (ocean everywhere, to compute integral over the whole grid)) 
     312# ---------------------------------------------------------------------------- 
     313mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc 
     314ncap2 --history --script "c${atm}_lon=alon ; c${atm}_lat=alat ; bounds_c${atm}_lon=bounds_lon ; bounds_c${atm}_lat=bounds_lat ; " grids_${CplModel}_tmp.nc grids_${CplModel}.nc 
     315 
     316mv areas_${CplModel}.nc areas_${CplModel}_tmp.nc 
     317ncap2 --history --script "c${atm}_aire=aire"   areas_${CplModel}_tmp.nc areas_${CplModel}.nc 
     318 
     319mv masks_${CplModel}.nc masks_${CplModel}_tmp.nc 
     320ncap2 --history --script "c${atm}_mask=int(OceMask)*0+0 ; " masks_${CplModel}_tmp.nc masks_${CplModel}.nc 
     321 
     322rm grids_${CplModel}_tmp.nc areas_${CplModel}_tmp.nc masks_${CplModel}_tmp.nc 
    315323 
    316324echo ${Titre}"Generates grid o${oce}, 'o' meaning 'one'"${Norm} 
     
    320328# -------------------------------------------------------------------------------------------------------- 
    321329mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc 
    322 ncap2 --fl_fmt=${FL_FMT3} --history --script "nav_lon_grid_O=nav_lon_grid_T; nav_lat_grid_O=nav_lat_grid_T; bounds_lon_grid_O=bounds_lon_grid_T; bounds_lat_grid_O=bounds_o${oce}_lat=bounds_lat_grid_T; " grids_${CplModel}_tmp.nc grids_${CplModel}.nc 
     330ncap2 --history --script "nav_lon_grid_O=nav_lon_grid_T; nav_lat_grid_O=nav_lat_grid_T; bounds_lon_grid_O=bounds_lon_grid_T; bounds_lat_grid_O=bounds_o${oce}_lat=bounds_lat_grid_T; " grids_${CplModel}_tmp.nc grids_${CplModel}.nc 
    323331 
    324332mv areas_${CplModel}.nc areas_${CplModel}_tmp.nc 
    325 ncap2 --fl_fmt=${FL_FMT3} --history --script "area_grid_O=area_grid_T*0.0d+1.0d;"   areas_${CplModel}_tmp.nc areas_${CplModel}.nc 
    326  
    327 ncks -C --history --overwrite -v maskutil_T ${OCE}_coordinates_mask_${FL_FMT3}.nc maskutil_T_${FL_FMT3}.nc 
    328 ncap2 --fl_fmt=${FL_FMT3} --history --append --script "mask_O=maskutil_T; " maskutil_T_${FL_FMT3}.nc masks_${CplModel}.nc 
     333ncap2 --history --script "area_grid_O=area_grid_T*0.0d+1.0d;"   areas_${CplModel}_tmp.nc areas_${CplModel}.nc 
     334 
     335ncks -C --history --overwrite -v maskutil_T ${OCE}_coordinates_mask.nc maskutil_T.nc 
     336ncap2 --history --append --script "mask_O=maskutil_T; " maskutil_T.nc masks_${CplModel}.nc 
    329337 
    330338rm grids_${CplModel}_tmp.nc areas_${CplModel}_tmp.nc  
     
    335343 
    336344mv grids_${CplModel}.nc grids_${CplModel}_tmp.nc 
    337 ncap2 --fl_fmt=${FL_FMT3} --history --script "nav_lon_grid_C=nav_lon_grid_T; nav_lat_grid_C=nav_lat_grid_T; bounds_lon_grid_C=bounds_lon_grid_T; bounds_lat_grid_C=bounds_o${oce}_lat=bounds_lat_grid_T; " grids_${CplModel}_tmp.nc grids_${CplModel}.nc 
     345ncap2 --history --script "nav_lon_grid_C=nav_lon_grid_T; nav_lat_grid_C=nav_lat_grid_T; bounds_lon_grid_C=bounds_lon_grid_T; bounds_lat_grid_C=bounds_o${oce}_lat=bounds_lat_grid_T; " grids_${CplModel}_tmp.nc grids_${CplModel}.nc 
    338346 
    339347mv areas_${CplModel}.nc areas_${CplModel}_tmp.nc 
    340 ncap2 --fl_fmt=${FL_FMT3} --history --script "area_grid_C=area_grid_T ; "   areas_${CplModel}_tmp.nc areas_${CplModel}.nc 
    341  
    342 #mv masks_${CplModel}.nc masks_${CplModel}_tmp.nc 
    343 ncap2 --fl_fmt=${FL_FMT3} --history --append --script "mask_C=maskutil_T; " maskutil_T_${FL_FMT3}.nc masks_${CplModel}.nc 
    344  
    345 rm grids_${CplModel}_tmp.nc areas_${CplModel}_tmp.nc maskutil_T_${FL_FMT3}.nc 
     348ncap2 --history --script "area_grid_C=area_grid_T ; "   areas_${CplModel}_tmp.nc areas_${CplModel}.nc 
     349 
     350ncap2 --history --append --script "mask_C=maskutil_T; " maskutil_T.nc masks_${CplModel}.nc 
     351 
     352rm grids_${CplModel}_tmp.nc areas_${CplModel}_tmp.nc maskutil_T.nc 
    346353 
    347354# 
     
    367374ncrename --history --variable alon,t${atm}.lon                grids_${CplModel}.nc 
    368375ncrename --history --variable alat,t${atm}.lat                grids_${CplModel}.nc 
    369 ncrename --history --variable o${atm}_lon,o${atm}.lon         grids_${CplModel}.nc 
    370 ncrename --history --variable o${atm}_lat,o${atm}.lat         grids_${CplModel}.nc 
    371376ncrename --history --variable OceMask,t${atm}.msk             masks_${CplModel}.nc 
    372 ncrename --history --variable o${atm}_mask,o${atm}.msk        masks_${CplModel}.nc 
    373377ncrename --history --variable aire,t${atm}.srf                areas_${CplModel}.nc 
    374 ncrename --history --variable o${atm}_aire,o${atm}.srf        areas_${CplModel}.nc 
    375  
    376378ncrename --history --variable bounds_lon,t${atm}.clo          grids_${CplModel}.nc 
    377379ncrename --history --variable bounds_lat,t${atm}.cla          grids_${CplModel}.nc 
    378 ncrename --history --variable bounds_o${atm}_lon,o${atm}.clo  grids_${CplModel}.nc 
    379 ncrename --history --variable bounds_o${atm}_lat,o${atm}.cla  grids_${CplModel}.nc 
    380  
    381 for ATMGRID in T O ; do 
     380 
     381for ATMGRID in O C ; do 
     382    atmgrid=${ATMGRID~} # To lowercase 
     383    ncrename --history --variable ${atmgrid}${atm}_lon,${atmgrid}${atm}.lon         grids_${CplModel}.nc 
     384    ncrename --history --variable ${atmgrid}${atm}_lat,${atmgrid}${atm}.lat         grids_${CplModel}.nc 
     385    ncrename --history --variable ${atmgrid}${atm}_mask,${atmgrid}${atm}.msk        masks_${CplModel}.nc 
     386    ncrename --history --variable ${atmgrid}${atm}_aire,${atmgrid}${atm}.srf        areas_${CplModel}.nc 
     387    ncrename --history --variable bounds_${atmgrid}${atm}_lon,${atmgrid}${atm}.clo  grids_${CplModel}.nc 
     388    ncrename --history --variable bounds_${atmgrid}${atm}_lat,${atmgrid}${atm}.cla  grids_${CplModel}.nc 
     389done 
     390     
     391for ATMGRID in T O C ; do 
    382392    atmgrid=${ATMGRID~} # To lowercase 
    383393    ncatted --history \ 
     
    386396            --attribute units,${atmgrid}${atm}.clo,o,c,"degrees_east"            \ 
    387397            --attribute units,${atmgrid}${atm}.cla,o,c,"degrees_north"        grids_${CplModel}.nc 
    388 done 
    389  
    390 ## 
    391 echo ${Titre}"Change all NetCDF files to NetCDF 3 format"${Norm} 
    392 ## =========================================================================== 
    393 for InFile in areas_${CplModel}.nc grids_${CplModel}.nc masks_${CplModel}.nc ; do 
    394     if [[ $(ncdump -k ${InFile}) = *netCDF-4* ]] ; then 
    395         mv ${InFile} tmp_${InFile} 
    396         ncks --fl_fmt=${FL_FMT3} --history  tmp_${InFile} ${InFile} 
    397         rm tmp_${InFile} 
    398     fi 
    399398done 
    400399 
  • TOOLS/MOSAIX/CreateWeightsMask.bash

    r4195 r4199  
    5757# 
    5858echo ${Titre}"Defines models"${Norm} 
    59 # ============== 
     59# ================================== 
    6060OCE=ORCA2.3 
    6161#OCE=eORCA1.2 
     
    6868#ATM=LMD144142 
    6969#ATM=LMD256256 
     70 
     71 
     72Comment="Preliminary attempt - Do not trust !" 
     73Version="v0" 
    7074 
    7175CplModel=${OCE}x${ATM} 
     
    131135#CommandList=( Runoff ) 
    132136#CommandList=( ${AtmOceFluxes} ${OceAtmTemp} Runoff Calving Grids ) 
     137#CommandList=( ${AtmOceFluxes} Runoff Calving Grids ) 
     138CommandList=( ${AtmOceFluxes}  ) 
    133139#CommandList=( Calving ) 
    134140#CommandList=( Grids ) 
    135141 
    136142 
    137 Comment="Preliminary attempt - Do not trust !" 
    138 Version="_v0" 
    139143 
    140144## =========================================================================== 
     
    143147## 
    144148## =========================================================================== 
    145 Tag="_MOSAIX" 
     149Tag="MOSAIX" 
    146150SUBMIT_DIR=$(pwd) 
    147151 
     
    190194 
    191195    if [[ "${Name}" != "None" ]] ; then 
    192         Suffix=${Name} 
     196        FullName=${Name} 
    193197    else 
    194         Suffix=${Order}Order_${NormName}_${QuantName}_${AreaName} 
     198        FullName=${Order}Order_${NormName}_${QuantName}_${AreaName} 
    195199    fi 
    196200 
     
    206210    esac 
    207211    echo ${Green}"${SRC} ${SRCGRID} toward ${DST} ${DSTGRID} - ${Order} Order - Normalize: ${Renormalize} - Quantity: ${QuantName} - Area: ${AreaName}  "${Norm} 
    208     echo ${Green}"Suffix : ${Suffix}"${Norm} 
     212    echo ${Green}"FullName : ${FullName}"${Norm} 
    209213} 
    210214 
     
    282286cp ${R_IN}/ATM/GRID/${ATM}_grid.nc . 
    283287 
    284 ncks --overwrite --fl_fmt=${FMT_OASIS} --history ${OCE}_coordinates_mask.nc ${OCE}_coordinates_mask_${FMT_OASIS}.nc 
    285 ncks --overwrite --fl_fmt=${FMT_OASIS} --history ${ATM}_grid.nc             ${ATM}_grid_${FMT_OASIS}.nc 
    286288# 
    287289# echo ${Titre}"Creates OCEAN C grid : redundant points removed to compute proper integrals # A passer dans CreateWeights"${Norm} 
     
    309311# rm C_${OCE}_coordinates_mask.nc 
    310312 
    311 # ncks --history --overwrite --fl_fmt=${FMT_OASIS} ${OCE}_coordinates_mask.nc ${OCE}_coordinates_mask_${FMT_OASIS}.nc 
    312  
    313313# ls -al 
    314314 
     
    331331python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="file_src"]/field[@id="mask_source"]' -k name  -v maskutil_T 
    332332python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="file_src"]/field[@id="area_source"]' -k name  -v area_grid_T 
    333 python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]'                               -k name  -v dia_${srcGrid}${src}_to_${dstGrid}${dst}_${Suffix} 
     333python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]'                               -k name  -v dia_${srcGrid}${src}_to_${dstGrid}${dst}_${FullName} 
    334334python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="title"]'       -t "${SRC} mask interpolated to ${DST}" 
    335335python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="source_grid"]' -t ${srcDomainType} 
     
    338338python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_src"]'                    -k type  -v ${srcDomainType} 
    339339python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]'                    -k type  -v ${dstDomainType} 
    340 python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain' -k weight_filename -v rmp_${srcGrid}${src}_to_${dstGrid}${dst}_${Suffix}.nc 
     340python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain' -k weight_filename -v rmp_${srcGrid}${src}_to_${dstGrid}${dst}_${FullName}.nc 
    341341python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k order -v 1 
    342342python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="normalization"]' -t false 
     
    347347python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k use_area    -v false 
    348348 
    349 cp iodef.xml iodef_${srcGrid}${src}_to_${dstGrid}${dst}_${Suffix}.xml 
     349cp iodef.xml iodef_${srcGrid}${src}_to_${dstGrid}${dst}_${FullName}.xml 
    350350ln -fs ${OCE}_coordinates_mask.nc  oce_grid.nc 
    351351ln -fs ${ATM}_grid.nc              atm_grid.nc 
     
    364364where (OceFrac <  0.0 )  OceFrac=0.0 ;  
    365365EOF 
    366 ncap2 --history --overwrite --script-file correction_masque.nco dia_t${oce}_to_t${atm}_${Suffix}.nc tmp_dia_t${oce}_to_t${atm}_${Suffix}.nc ; mv tmp_dia_t${oce}_to_t${atm}_${Suffix}.nc dia_t${oce}_to_t${atm}_${Suffix}.nc 
    367 ncatted --history -a missing_value,OceFrac,d,,"" -a _FillValue,OceFrac,d,,"" dia_t${oce}_to_t${atm}_${Suffix}.nc 
     366ncap2 --history --overwrite --script-file correction_masque.nco dia_t${oce}_to_t${atm}_${FullName}.nc tmp_dia_t${oce}_to_t${atm}_${FullName}.nc ; mv tmp_dia_t${oce}_to_t${atm}_${FullName}.nc dia_t${oce}_to_t${atm}_${FullName}.nc 
     367ncatted --history -a missing_value,OceFrac,d,,"" -a _FillValue,OceFrac,d,,"" dia_t${oce}_to_t${atm}_${FullName}.nc 
    368368 
    369369## 
    370370echo ${Titre}"Creates ocean fractions on ATM grid"${Norm} 
    371371## =========================================================================== 
    372 cp dia_t${oce}_to_t${atm}_${Suffix}.nc  dia_t${oce}_to_t${atm}_${Suffix}_mask.nc 
    373 ncks --alphabetize --history --overwrite --variable OceFrac dia_t${oce}_to_t${atm}_${Suffix}_mask.nc  ${ATM}_grid_maskFrom_${OCE}.nc 
     372cp dia_t${oce}_to_t${atm}_${FullName}.nc  dia_t${oce}_to_t${atm}_${FullName}_mask.nc 
     373ncks --alphabetize --history --overwrite --variable OceFrac dia_t${oce}_to_t${atm}_${FullName}_mask.nc  ${ATM}_grid_maskFrom_${OCE}.nc 
    374374 
    375375cat <<EOF > creation_masque.nco 
     
    378378EOF 
    379379 
    380 ncap2 --history --overwrite --script-file creation_masque.nco dia_t${oce}_to_t${atm}_${Suffix}_mask.nc tmp_dia_t${oce}_to_t${atm}_${Suffix}_mask.nc ; mv tmp_dia_t${oce}_to_t${atm}_${Suffix}_mask.nc dia_t${oce}_to_t${atm}_${Suffix}_mask.nc 
    381 ncrename --history --variable OceFrac,OceMask dia_t${oce}_to_t${atm}_${Suffix}_mask.nc 
    382  
    383 ncks --overwrite --history --variable OceMask dia_t${oce}_to_t${atm}_${Suffix}_mask.nc tmp_OceMask.nc 
     380ncap2 --history --overwrite --script-file creation_masque.nco dia_t${oce}_to_t${atm}_${FullName}_mask.nc tmp_dia_t${oce}_to_t${atm}_${FullName}_mask.nc ; mv tmp_dia_t${oce}_to_t${atm}_${FullName}_mask.nc dia_t${oce}_to_t${atm}_${FullName}_mask.nc 
     381ncrename --history --variable OceFrac,OceMask dia_t${oce}_to_t${atm}_${FullName}_mask.nc 
     382 
     383ncks --overwrite --history --variable OceMask dia_t${oce}_to_t${atm}_${FullName}_mask.nc tmp_OceMask.nc 
    384384ncks --history --append tmp_OceMask.nc ${ATM}_grid_maskFrom_${OCE}.nc 
    385 rm dia_t${oce}_to_t${atm}_${Suffix}_mask.nc 
     385rm dia_t${oce}_to_t${atm}_${FullName}_mask.nc 
    386386 
    387387echo "Change dimension names, and some attributes accordingly" 
     
    412412 
    413413## 
    414 echo ${Titre}"Creates mask of coastal OCE points"${Norm} 
    415 ## =========================================================================== 
    416 ${PyRun} python3 -u ComputeNemoCoast.py -n ${OcePerio} -i ${OCE}_coordinates_mask.nc # Creates OceCoastal 
    417  
    418 ## 
    419 echo ${Titre}"Creates mask of coastal ATM points"${Norm} 
    420 ## =========================================================================== 
    421 cat <<EOF > coastal.nco 
    422 AtmCoastal = OceFrac * 0.0 ; 
    423 where (OceFrac > 0.0 && OceFrac < 1.0 )  AtmCoastal = 1.0 ; 
    424 EOF 
    425 ncap2 --history --overwrite --script-file coastal.nco ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_coastal_maskFrom_${OCE}.nc 
    426 ncks --history --append --variable AtmCoastal ${ATM}_coastal_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}.nc 
    427 rm ${ATM}_coastal_maskFrom_${OCE}.nc 
    428 ncks --alphabetize --history --overwrite --fl_fmt=${FMT_OASIS} ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_${FMT_OASIS}.nc 
    429  
     414#echo ${Titre}"Creates mask of coastal OCE points"${Norm} 
     415## =========================================================================== 
     416#${PyRun} python3 -u ComputeNemoCoast.py -n ${OcePerio} -i ${OCE}_coordinates_mask.nc # Creates OceCoastal 
     417 
     418## 
     419#echo ${Titre}"Creates mask of coastal ATM points"${Norm} 
     420## =========================================================================== 
     421#cat <<EOF > coastal.nco 
     422#AtmCoastal = OceFrac * 0.0 ; 
     423#where (OceFrac > 0.0 && OceFrac < 1.0 )  AtmCoastal = 1.0 ; 
     424#EOF 
     425#ncap2 --history --overwrite --script-file coastal.nco ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_coastal_maskFrom_${OCE}.nc 
     426#ncks --history --append --variable AtmCoastal ${ATM}_coastal_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}.nc 
     427#rm ${ATM}_coastal_maskFrom_${OCE}.nc 
    430428 
    431429## 
     
    475473    python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]'                      -k type  -v ${dstDomainType} 
    476474     
    477     python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k weight_filename -v rmp_${srcGrid}${src}_to_${dstGrid}${dst}_${Suffix}.nc 
     475    python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k weight_filename -v rmp_${srcGrid}${src}_to_${dstGrid}${dst}_${FullName}.nc 
    478476    python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k order       -v ${numOrder} 
    479477    python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k quantity    -v ${Quantity} 
     
    481479    python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k use_area    -v ${useArea} 
    482480     
    483     python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]'                                 -k name -v dia_${srcGrid}${src}_to_${dstGrid}${dst}_${Suffix} 
     481    python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]'                                 -k name -v dia_${srcGrid}${src}_to_${dstGrid}${dst}_${FullName} 
    484482    python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="title"]'         -t "${SRC} mask interpolated to ${DST}" 
    485483    python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="dest_grid"]'     -t ${dstDomainType} 
     
    490488    python3 update_xml.py -i iodef.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="use_area"]'      -t ${useArea} 
    491489     
    492     cp iodef.xml iodef_${srcGrid}${src}_to_${dstGrid}${dst}_${Suffix}.xml 
     490    cp iodef.xml iodef_${srcGrid}${src}_to_${dstGrid}${dst}_${FullName}.xml 
    493491    ${MpiRun} ./interpol.exe --mask_src=${maskSrc} --mask_dst=${maskDst} --use_area=${useArea} 
    494492done 
    495493 
    496 ## 
    497 echo ${Titre}"Copy all NetCDF files to NetCDF 3 format (needed for OASIS)"${Norm} 
    498 ## =========================================================================== 
    499 for InFile in *.nc ; do 
    500     OuFile=$(basename ${InFile} .nc)_${FMT_OASIS}.nc 
    501     [[ ! -f ${OuFile} ]] && ncks --alphabetize --history --fl_fmt=${FMT_OASIS} ${InFile} ${OuFile} 
    502 done 
    503  
    504 ## 
    505494echo ${Titre}"Add time axis and coordinates information"${Norm} 
    506495## (needed if files need to be read by XIOS) 
    507496## =========================================================================== 
    508 #ncatted --history -a coordinates,aire,m,c,"lat lon" ${ATM}_grid_maskFrom_${OCE}.nc 
    509497ncap2 --overwrite --history --script 'defdim("time_counter",1) ;' ${ATM}_grid_maskFrom_${OCE}.nc tmp_${ATM}_grid_maskFrom_${OCE}.nc ; mv tmp_${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}.nc 
    510  
    511 ncks --alphabetize --history --overwrite --fl_fmt=${FMT_OASIS} ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_${FMT_OASIS}.nc 
    512498 
    513499if [[ ${atm} = ico ]] ; then 
     
    515501OceFrac    [time_counter,cell] = OceFrac    [cell] ; 
    516502OceMask    [time_counter,cell] = OceMask    [cell] ; 
    517 AtmCoastal [time_counter,cell] = AtmCoastal [cell] ; 
    518503EOF 
    519504    ncap2 --overwrite --history --script-file add_time.nco ${ATM}_grid_maskFrom_${OCE}.nc tmp_${ATM}_grid_maskFrom_${OCE}.nc ; mv tmp_${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}.nc 
     
    521506            -a coordinates,OceFrac,m,c,"time_counter lat lon"    \ 
    522507            -a coordinates,OceMask,m,c,"time_counter lat lon"    \ 
    523             -a coordinates,AtmCoastal,m,c,"time_counter lat lon" \ 
    524508            -a coordinates,aire,c,c,"lat lon" \ 
    525509            ${ATM}_grid_maskFrom_${OCE}.nc 
    526510fi 
    527 ncks --alphabetize --history --overwrite --fl_fmt=${FMT_OASIS} ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_${FMT_OASIS}.nc 
    528511 
    529512if [[ ${atm} = lmd ]] ; then 
     
    531514OceFrac    [time_counter,lat,lon] = OceFrac    [lat,lon] ; 
    532515OceMask    [time_counter,lat,lon] = OceMask    [lat,lon]  ; 
    533 AtmCoastal [time_counter,lat,lon] = AtmCoastal [lat,lon]  ; 
    534516EOF 
    535517    ncap2 --overwrite --history --script-file add_time.nco ${ATM}_grid_maskFrom_${OCE}.nc tmp_${ATM}_grid_maskFrom_${OCE}.nc 
     
    540522            -a coordinates,OceFrac,m,c,"time_counter lat lon"    \ 
    541523            -a coordinates,OceMask,m,c,"time_counter lat lon"    \ 
    542             -a coordinates,AtmCoastal,m,c,"time_counter lat lon" \ 
    543524            -a coordinates,aire,m,c,"lat lon" \ 
    544525            ${ATM}_grid_maskFrom_${OCE}.nc 
    545526fi 
    546 ncks --alphabetize --history --overwrite --mk_rec time_counter   ${ATM}_grid_maskFrom_${OCE}.nc tmp_${ATM}_grid_maskFrom_${OCE}.nc ; mv tmp_${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}.nc 
    547 ncks --alphabetize --history --overwrite --fl_fmt=${FMT_OASIS} ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_${FMT_OASIS}.nc 
     527ncks --alphabetize --history --overwrite --mk_rec time_counter ${ATM}_grid_maskFrom_${OCE}.nc tmp_${ATM}_grid_maskFrom_${OCE}.nc ; mv tmp_${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}.nc 
    548528 
    549529## 
     
    554534NCO="$(ncks --version |& tail -1|sed 's/ncks //')" 
    555535PYTHON_VER=$( python3 -c "import sys ; print (sys.version.split(' ')[0])" ) 
    556 for InFile in $(ls *${oce}_to_*${atm}_*.nc *${atm}_to_*${oce}_*.nc ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_${FMT_OASIS}.nc 2>/dev/null) ; do 
     536for InFile in $(ls *${oce}_to_*${atm}_*.nc *${atm}_to_*${oce}_*.nc ${ATM}_grid_maskFrom_${OCE}.nc 2> /dev/null) ; do 
    557537    ncatted --history \ 
    558538            --attribute uuid,global,d,,                                           \ 
     
    597577 
    598578for rmpFile in rmp_*.nc ; do 
    599     mv ${rmpFile} xios_${rmpFile} 
    600     ncap2 --fl_fmt=${FMT_OASIS} --history --script-file add_dim.nco xios_${rmpFile} ${rmpFile} 
     579    mv ${rmpFile} tmp_${rmpFile} 
     580    ncap2 --history --script-file add_dim.nco tmp_${rmpFile} ${rmpFile} ; rm tmp_${rmpFile} 
    601581     
    602582    ncrename --history --dimension n_weight,num_links   ${rmpFile} 
     
    641621echo ${Titre}"Add missing variables in rmp files"${Norm} 
    642622## =========================================================================== 
    643 for rmpFile in $(ls rmp_?${atm}_to_[tuv]${oce}_*.nc rmp_[tuv]${oce}_to_t${atm}_*.nc 2>/dev/null) ; do 
     623for rmpFile in $(ls rmp_?${atm}_to_[tuv]${oce}_*.nc rmp_[tuv]${oce}_to_t${atm}_*.nc 2>& /dev/null ) ; do 
    644624    echo ${rmpFile} 
    645625    a_to_o=false ; o_to_a=false 
     
    684664 
    685665    cp add_varoce.nco add_varoce_$(basename ${rmpFile} .nc)_o_to_a.nco 
    686     [[ ${o_to_a} = true ]] && ncap2 --history --append --script-file add_varoce_$(basename ${rmpFile} .nc)_o_to_a.nco ${OCE}_coordinates_mask_${FMT_OASIS}.nc ${rmpFile} 
     666    [[ ${o_to_a} = true ]] && ncap2 --history --append --script-file add_varoce_$(basename ${rmpFile} .nc)_o_to_a.nco ${OCE}_coordinates_mask.nc ${rmpFile} 
    687667    sed --in-place "s/src_/dst_/g" add_varoce.nco 
    688668    cp add_varoce.nco add_varoce_$(basename ${rmpFile} .nc)_a_to_o.nco 
    689     [[ ${a_to_o} = true ]] && ncap2 --history --append --script-file add_varoce_$(basename ${rmpFile} .nc)_a_to_o.nco ${OCE}_coordinates_mask_${FMT_OASIS}.nc ${rmpFile} 
     669    [[ ${a_to_o} = true ]] && ncap2 --history --append --script-file add_varoce_$(basename ${rmpFile} .nc)_a_to_o.nco ${OCE}_coordinates_mask.nc ${rmpFile} 
    690670                 
    691671    if [[ ${atm} = ico ]] ; then 
     
    717697        cp add_varatm.nco add_varatm_$(basename ${rmpFile} .nc)_o_to_a.nco 
    718698        if [[ ${o_to_a} = true ]] ; then 
    719             ncap2 --history --append --script-file add_varatm_$(basename ${rmpFile} .nc)_o_to_a.nco ${ATM}_grid_maskFrom_${OCE}_${FMT_OASIS}.nc ${rmpFile} 
     699            ncap2 --history --append --script-file add_varatm_$(basename ${rmpFile} .nc)_o_to_a.nco ${ATM}_grid_maskFrom_${OCE}.nc ${rmpFile} 
    720700            ncks --alphabetize --history --overwrite --variable src_address,dst_address,remap_matrix,src_grid_dims,src_grid_center_lat,src_grid_center_lon,src_grid_corner_lon,src_grid_corner_lat,src_grid_area,src_grid_imask,dst_grid_dims,dst_grid_center_lat,dst_grid_center_lon,dst_grid_corner_lon,dst_grid_corner_lat,dst_grid_area,dst_grid_imask ${rmpFile} rmp_tmp.nc 
    721701            mv rmp_tmp.nc ${rmpFile} 
     
    725705        cp add_varatm.nco add_varatm_$(basename ${rmpFile} .nc)_a_to_o.nco 
    726706        if [[ ${a_to_o} = true ]] ; then 
    727             ncap2 --history --append --script-file add_varatm_$(basename ${rmpFile} .nc)_a_to_o.nco ${ATM}_grid_maskFrom_${OCE}_${FMT_OASIS}.nc ${rmpFile} 
     707            ncap2 --history --append --script-file add_varatm_$(basename ${rmpFile} .nc)_a_to_o.nco ${ATM}_grid_maskFrom_${OCE}.nc ${rmpFile} 
    728708            ncks --alphabetize --history --overwrite --variable src_address,dst_address,remap_matrix,src_grid_dims,src_grid_center_lat,src_grid_center_lon,src_grid_corner_lon,src_grid_corner_lat,src_grid_area,src_grid_imask,dst_grid_dims,dst_grid_center_lat,dst_grid_center_lon,dst_grid_corner_lon,dst_grid_corner_lat,dst_grid_area,dst_grid_imask ${rmpFile} rmp_tmp.nc 
    729709            mv rmp_tmp.nc ${rmpFile} 
     
    761741        cp add_varatm.nco add_varatm_$(basename ${rmpFile} .nc)_o_to_a.nco 
    762742        if [[ ${o_to_a} = true ]] ; then 
    763             ncap2 --history --append --script-file add_varatm_$(basename ${rmpFile} .nc)_o_to_a.nco ${ATM}_grid_maskFrom_${OCE}_${FMT_OASIS}.nc ${rmpFile} 
     743            ncap2 --history --append --script-file add_varatm_$(basename ${rmpFile} .nc)_o_to_a.nco ${ATM}_grid_maskFrom_${OCE}.nc ${rmpFile} 
    764744            ncks --alphabetize --history --overwrite --variable src_address,dst_address,remap_matrix,src_grid_dims,src_grid_center_lat,src_grid_center_lon,src_grid_corner_lon,src_grid_corner_lat,src_grid_area,src_grid_imask,dst_grid_dims,dst_grid_center_lat,dst_grid_center_lon,dst_grid_area,dst_grid_imask ${rmpFile} rmp_tmp.nc 
    765745            mv rmp_tmp.nc ${rmpFile} 
     
    769749        cp add_varatm.nco add_varatm_$(basename ${rmpFile} .nc)_a_to_o.nco 
    770750        if [[ ${a_to_o} = true ]] ; then 
    771             ncap2 --history --append --script-file add_varatm_$(basename ${rmpFile} .nc)_a_to_o.nco ${ATM}_grid_maskFrom_${OCE}_${FMT_OASIS}.nc ${rmpFile} 
     751            ncap2 --history --append --script-file add_varatm_$(basename ${rmpFile} .nc)_a_to_o.nco ${ATM}_grid_maskFrom_${OCE}.nc ${rmpFile} 
    772752            ncks --alphabetize --history --overwrite --variable src_address,dst_address,remap_matrix,src_grid_dims,src_grid_center_lat,src_grid_center_lon,src_grid_area,src_grid_imask,dst_grid_dims,dst_grid_center_lat,dst_grid_center_lon,dst_grid_corner_lon,dst_grid_corner_lat,dst_grid_area,dst_grid_imask ${rmpFile} rmp_tmp.nc 
    773753            mv rmp_tmp.nc ${rmpFile} 
     
    792772              --atmCoastWidth=${atmCoastWidth} --oceCoastWidth=${oceCoastWidth} --searchRadius=${searchRadius} \ 
    793773              --grids=grids_${CplModel}.nc --areas=areas_${CplModel}.nc --masks=masks_${CplModel}.nc \ 
    794               --o2a=${ATM}_grid_maskFrom_${OCE}.nc --output=rmp_t${atm}_to_t${oce}_runoff_${runOff_atmQuantity}_to_${runOff_oceQuantity}_${FMT_OASIS}.nc \ 
    795               --fmt=${FMT_OASIS} \ 
     774              --o2a=${ATM}_grid_maskFrom_${OCE}.nc --output=rmp_t${atm}_to_t${oce}_runoff_${runOff_atmQuantity}_to_${runOff_oceQuantity}.nc \ 
     775              --fmt=${FMT_XIOS} \ 
    796776              --atmQuantity=${runOff_atmQuantity} --oceQuantity=${runOff_oceQuantity} 
    797777fi 
     
    803783    case ${OCE} in 
    804784        ( eORCA025 ) 
    805         # cp ${R_IN}/OCE/NEMO/ORCA025_LIM3_PISCES/v3.6_stable/eORCA_R025_runoff_v1.1.nc . 
    806785        cp /ccc/work/cont003/gencmip6/deshayej/eORCA_R025_runoff_v1.2.nc . 
    807         ${PyRun} python3 -u CalvingWeights.py --output=rmp_t${atm}_to_t${oce}_calving_nosouth_${FMT_OASIS}.nc  --fmt=${FMT_OASIS} \ 
     786        ${PyRun} python3 -u CalvingWeights.py --output=rmp_t${atm}_to_t${oce}_calving_nosouth.nc  --fmt=${FMT_XIOS} \ 
    808787                  --oce=${OCE} --atm=${ATM} --type=nosouth  --dir=.  
    809         ${PyRun} python3 -u CalvingWeights.py --output=rmp_t${atm}_to_t${oce}_calving_iceberg_${FMT_OASIS}.nc  --fmt=${FMT_OASIS} \ 
     788        ${PyRun} python3 -u CalvingWeights.py --output=rmp_t${atm}_to_t${oce}_calving_iceberg.nc  --fmt=${FMT_XIOS} \ 
    810789                  --oce=${OCE} --atm=${ATM} --type=iceberg  --dir=.  --repartition_file=eORCA_R025_runoff_v1.2.nc --repartition_var=Icb_flux 
    811         ${PyRun} python3 -u CalvingWeights.py --output=rmp_t${atm}_to_t${oce}_calving_iceshelf_${FMT_OASIS}.nc --fmt=${FMT_OASIS} \ 
     790        ${PyRun} python3 -u CalvingWeights.py --output=rmp_t${atm}_to_t${oce}_calving_iceshelf.nc --fmt=${FMT_XIOS} \ 
    812791                  --oce=${OCE} --atm=${ATM} --type=iceshelf --dir=.  --repartition_file=eORCA_R025_runoff_v1.2.nc --repartition_var=sornfisf 
    813792        ;; 
     
    815794        ( eORCA1.2 ) 
    816795        cp ${R_IN}/OCE/NEMO/ORCA1_LIM3_PISCES/v3.6_stable/runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc . 
    817         ${PyRun} python3 -u CalvingWeights.py --output=rmp_t${atm}_to_t${oce}_calving_nosouth_${FMT_OASIS}.nc  --fmt=${FMT_OASIS}\ 
     796        ${PyRun} python3 -u CalvingWeights.py --output=rmp_t${atm}_to_t${oce}_calving_nosouth.nc  --fmt=${FMT_XIOS}\ 
    818797                  --oce=${OCE} --atm=${ATM} --type=nosouth  --dir=.  
    819         ${PyRun} python3 -u CalvingWeights.py --output=rmp_t${atm}_to_t${oce}_calving_iceberg_${FMT_OASIS}.nc  --fmt=${FMT_OASIS}\ 
     798        ${PyRun} python3 -u CalvingWeights.py --output=rmp_t${atm}_to_t${oce}_calving_iceberg.nc  --fmt=${FMT_XIOS}\ 
    820799                  --oce=${OCE} --atm=${ATM} --type=iceberg  --dir=. --repartition_file=runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc --repartition_var=Icb_flux 
    821         ${PyRun} python3 -u CalvingWeights.py --output=rmp_t${atm}_to_t${oce}_calving_iceshelf_${FMT_OASIS}.nc --fmt=${FMT_OASIS}\ 
     800        ${PyRun} python3 -u CalvingWeights.py --output=rmp_t${atm}_to_t${oce}_calving_iceshelf.nc --fmt=${FMT_XIOS}\ 
    822801                  --oce=${OCE} --atm=${ATM} --type=iceshelf --dir=. --repartition_file=runoff-icb_DaiTrenberth_Depoorter_eORCA1_JD.nc --repartition_var=sornfisf 
    823802        ;; 
    824803         
    825804        ( * ) 
    826         ${PyRun} python3 -u CalvingWeights.py --output=rmp_t${atm}_to_t${oce}_calving_full_${FMT_OASIS}.nc --fmt=${FMT_OASIS} \ 
     805        ${PyRun} python3 -u CalvingWeights.py --output=rmp_t${atm}_to_t${oce}_calving_full.nc --fmt=${FMT_XIOS} \ 
    827806                  --oce=${OCE} --atm=${ATM} --type=full     --dir=. 
    828807        ;; 
     
    832811 
    833812## 
    834 echo ${Titre}"Save results"${Norm} 
    835 ## =========================================================================== 
    836  
    837 cp ${ATM}_grid_maskFrom_${OCE}.nc ${SUBMIT_DIR} 
    838 for File in dia_*.nc rmp_*.nc  
    839 do 
     813echo ${Titre}"Simplifies headers, add version and comment"${Norm} 
     814## =========================================================================== 
     815for File in $(ls dia_*.nc rmp_*.nc ${ATM}_grid_maskFrom_${OCE}*.nc areas_${OCE}x${ATM}*.nc grids_${OCE}x${ATM}*.nc masks_${OCE}x${ATM}*.nc 2> /dev/null ) ; do 
    840816    ncatted --history --attribute history_of_appended_files,global,d,c,"" ${File} 
     817    ncatted --history --attribute history,global,d,c,"" ${File} 
    841818    [[ "X${Comment}" != "X" ]] && ncatted --history --attribute Comment,global,o,c,"${Comment}"  ${File} 
    842819    [[ "X${Version}" != "X" ]] && ncatted --history --attribute Version,global,o,c,"${Version}"  ${File} 
    843      
     820    [[ "X${Tag}" != "X"     ]] && ncatted --history --attribute Version,global,o,c,"${Tag}"      ${File} 
     821done 
     822 
     823## 
     824echo ${Titre}"Rename rmp and dia files"${Norm} 
     825## =========================================================================== 
     826for File in $(ls dia_*.nc rmp_*.nc  2>& /dev/null ); do 
    844827    NewFile=$(echo ${File} | sed -e "s/${atm}/${ATM}/" -e "s/${oce}/${OCE}/" ) 
    845     cp ${File} ${SUBMIT_DIR}/${NewFile} 
     828    mv ${File} ${SUBMIT_DIR}/${NewFile} 
    846829done 
    847830 
    848 if [[ "X${okGrids}" = "Xyes" ]] ; then 
    849     cp areas_${CplModel}.nc ${SUBMIT_DIR} 
    850     cp grids_${CplModel}.nc ${SUBMIT_DIR} 
    851     cp masks_${CplModel}.nc ${SUBMIT_DIR} 
     831## 
     832echo ${Titre}"Add Tag"${Norm} 
     833## =========================================================================== 
     834if [[ "X${Tag}" != "X" ]] ; then 
     835    for File in $(ls dia_*.nc rmp_*.nc ${ATM}_grid_maskFrom_${OCE}*.nc areas_${OCE}x${ATM}*.nc grids_${OCE}x${ATM}*.nc masks_${OCE}x${ATM}*.nc 2> /dev/null ) ; do 
     836        mv ${File} $(basename ${File} .nc)_${Tag}.nc 
     837    done 
    852838fi 
     839## 
     840echo ${Titre}"Add Version"${Norm} 
     841## =========================================================================== 
     842if [[ "X${Version}" != "X" ]] ; then 
     843    for File in $(ls dia_*.nc rmp_*.nc ${ATM}_grid_maskFrom_${OCE}*.nc areas_${OCE}x${ATM}*.nc grids_${OCE}x${ATM}*.nc masks_${OCE}x${ATM}*.nc 2> /dev/null ) ; do 
     844        mv ${File} $(basename ${File} .nc)_${Version}.nc 
     845    done 
     846fi 
     847     
     848## =========================================================================== 
     849echo ${Titre}"Save results"${Norm} 
     850## =========================================================================== 
     851for File in $(ls dia_*.nc rmp_*.nc ${ATM}_grid_maskFrom_${OCE}*.nc areas_${OCE}x${ATM}*.nc grids_${OCE}x${ATM}*.nc masks_${OCE}x${ATM}*.nc 2> /dev/null ) ; do 
     852    cp ${File} ${SUBMIT_DIR} 
     853done 
     854 
    853855 
    854856## 
     
    895897 
    896898echo ${Titre}"Compute checksums and add them to README"${Norm} 
    897 # ----------------------------------------- 
     899# ------------------------------------------------------------ 
    898900cat << EOF >> README.txt 
    899901UUID common to all files : ${UUID} 
     
    903905EOF 
    904906 
    905 for file in *.nc ; do 
     907for file in $(ls dia_*.nc rmp_*.nc ${ATM}_grid_maskFrom_${OCE}*.nc areas_${OCE}x${ATM}*.nc grids_${OCE}x${ATM}*.nc masks_${OCE}x${ATM}*.nc 2> /dev/null ) ; do 
    906908    echo "$(shasum ${file})" >> README.txt 
    907909done 
  • TOOLS/MOSAIX/RunoffWeights.py

    r4195 r4199  
    33### 
    44### Compute runoff weights. 
     5### For LMDZ only. Not suitable for DYNAMICO 
    56### 
    67### =========================================================================== 
     
    6566parser.add_argument ('--masks' , help='areas file name', default='masks.nc' ) 
    6667parser.add_argument ('--o2a'   , help='o2a file name'  , default='o2a.nc' ) 
    67 parser.add_argument ('--output', help='output rmp file name', default='rmp_tlmd_to_torc_runoff_64bit.nc' ) 
    68 parser.add_argument ('--fmt'   , help='NetCDF file format, using nco syntax', default='64bit', choices=['classic', 'netcdf3', '64bit', '64bit_data', '64bit_data', 'netcdf4', 'netcdf4_classsic'] ) 
     68parser.add_argument ('--output', help='output rmp file name', default='rmp_tlmd_to_torc_runoff.nc' ) 
     69parser.add_argument ('--fmt'   , help='NetCDF file format, using nco syntax', default='netcdf4', choices=['classic', 'netcdf3', '64bit', '64bit_data', '64bit_data', 'netcdf4', 'netcdf4_classsic'] ) 
    6970 
    7071# Parse command line 
     
    9798if atm_Name.find('LMD') >= 0 : atm_n = 'lmd' ; atmDomainType = 'rectilinear' 
    9899if atm_Name.find('ICO') >= 0 : atm_n = 'ico' ; atmDomainType = 'unstructured' 
    99 if oce_Name.find('ORC') >= 0 : oce_n = 'orc' ; oceDomainType = 'curvilinear' 
    100100 
    101101print ('atmQuantity : ' + str (myargs.atmQuantity) ) 
     
    152152oce_grid_imask = oce_grid_imask2D.ravel() 
    153153##  
    154 print ("Defines a coastal bands (on ocean) in the ocean") 
     154print ("Determination d'une bande cotiere ocean") 
    155155 
    156156oceLand2D  = np.reshape ( np.where (oce_grid_pmask[:] < 0.5, True, False), (oce_jpj, oce_jpi) ) 
     
    179179oceCoast_address         = oce_address        [oceCoast] 
    180180 
    181 print ("Defines a coastal bands (on land) in the atmosphere" ) 
     181print ("Determination d'une bande cotiere atmosphere " ) 
    182182atmLand      = np.where (o2aFrac[:] < epsfrac       , True, False) 
    183183atmLandFrac  = np.where (o2aFrac[:] < zone-epsfrac  , True, False) 
Note: See TracChangeset for help on using the changeset viewer.