Changeset 6093 for TOOLS


Ignore:
Timestamp:
03/07/22 12:17:05 (2 years ago)
Author:
omamce
Message:

MOSAIX

  • Change update_xml syntax
  • Merge nco commands
  • Add some comments and metadata
Location:
TOOLS/MOSAIX
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/MOSAIX/CreateWeightsMask.bash

    r6091 r6093  
    3737#  $HeadURL$ 
    3838# 
     39## Tested with :  
    3940# CplModel=eORCA1.2xLMD144142 ; qsub -r ${CplModel} -o Out_${CplModel} -e Out_${CplModel} CreateWeightsMask.bash 
    4041# CplModel=ORCA2.3xLMD9695 
     
    4950 
    5051set +vx 
     52# Prefixes for pretty print in color 
    5153export Bold=$(tput bold)   
    5254export Unde=$(tput smul) ; export OffUnde=$(tput rmul) 
     
    6870echo ${Titre}"Defines model"${Norm} 
    6971# ================================= 
    70 CplModel=ORCA2.3xLMD9695 
     72#CplModel=ORCA2.3xLMD9695 
    7173#CplModel=ORCA2.3xICO30 
    72 #CplModel=ORCA2.3xICO40 
     74CplModel=ORCA2.3xICO40 
    7375#CplModel=eORCA1.2xLMD144142 
    7476#CplModel=eORCA1.2xLMD256256 
     
    8082#Version="v1" ; Comment="Fully tested in IPSLCM6 eORCA1.2 x LMD 144x142" 
    8183#Version="NoSearchRadius" ; Comment="For testing new routing" 
    82 Version="v2" ;  Comment="Correction of ORCA masks to have a perfect conservation of run-off" 
     84Version="v2" ; Comment="Correction of ORCA masks to have a perfect conservation of run-off" 
    8385 
    8486# If available, get model name from job name 
     
    8890OCE=${CplModel//x*} ; ATM=${CplModel##*x} 
    8991 
    90 echo ${Titre}"ATM model : ${ATM}"${Norm} 
    91 echo ${Titre}"OCE model : ${OCE}"${Norm} 
    92 echo ${Titre}"Cpl model : ${CplModel}"${Norm} 
    93 echo ${Titre}"Version   : ${Version}"${Norm} 
     92ModelName="IPSL CM6" 
     93[[ ${ATM} = ICO*      ]] && ModelName="IPSL CM7" 
     94 
     95echo ${Titre}"ATM model  : ${ATM}"      ${Norm} 
     96echo ${Titre}"OCE model  : ${OCE}"      ${Norm} 
     97echo ${Titre}"Cpl model  : ${CplModel}" ${Norm} 
     98echo ${Titre}"Version    : ${Version}"  ${Norm} 
     99echo ${Titre}"Model Name : ${ModelName}"${Norm} 
    94100 
    95101# Runoff parameter. atmCoastWidth and oceCoastWidth in grid points, searchRadius in km 
     
    118124# 
    119125# Each item in CommandList describes the properties of interpolation weights to generate.  
    120 # White spaces separate analysis. No spaces in any analysis. 
     126# White spaces separate analysis. 
     127# \!/ No spaces in any analysis \!/ 
    121128# 
    122129# Specific commands : 'Runoff', 'Calving' 
     
    125132#   Direction   : o2a for ocean to atmosphere, a2o for atmosphere to ocean. 
    126133#   Order       : 1st or 2nd. 
    127 #   Quantity    : true if integrated quantity over a grid box, false for flux (quantity / m^2) 
    128 #                 or intensive value (temperature, salinity, sea-ice fraction, ...). 
     134#   Quantity    : true if integrated quantity over a grid box (i.e runoff on atmosphere side), 
     135#                 false for flux (quantity / m^2) or intensive value (temperature, salinity, sea-ice fraction, ...). 
    129136#   Renormalize : used when source grid is masked, to use values on non masked points only. 
    130137#   oceGrid     : t, u or v point for NEMO C grid. 
     
    185192# Functions to handle command parameters 
    186193# ====================================== 
    187 function read_Command { 
     194function readCommand { 
    188195    # Decipher the command line to set bash variables  
    189196    local l_Debug="no" l_Element 
     
    202209 
    203210function setValues { 
     211    ## Read a command line to define shell variables 
    204212    # Set default values 
    205     read_Command "Direction=None,Order=None,Quantity=None,Renormalize=None,atmGrid=None,oceGrid=None,useArea=None,maskSrc=None,maskDst=None" 
     213    readCommand "Direction=None,Order=None,Quantity=None,Renormalize=None,atmGrid=None,oceGrid=None,useArea=None,maskSrc=None,maskDst=None" 
    206214    # Read command line 
    207     read_Command ${1} 
     215    readCommand ${1} 
    208216    # 
    209217    oceGrid=${oceGrid,,} ; atmGrid=${atmGrid,,} # Model names to lower case 
     
    329337fi 
    330338 
    331  
    332339## 
    333340echo ${Titre}"NEMO T point towards ATM - 1st order"${Norm} 
     
    341348 
    342349cat << EOF > command_file_${OutFileName}.txt 
    343 -n 'context[@id="interpol_read"]/file_definition/file[@id="file_src"]/field[@id="mask_src"]'     -k name  -v maskutil_T 
    344 -n 'context[@id="interpol_read"]/file_definition/file[@id="file_src"]/field[@id="area_src"]'     -k name  -v area_grid_T 
    345 -n 'context[@id="interpol_read"]/domain_definition/domain[@id="domain_src"]'                     -k type  -v ${srcDomainType} 
    346 -n 'context[@id="interpol_read"]/domain_definition/domain[@id="domain_dst"]'                     -k type  -v ${dstDomainType} 
    347 -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k order -v 1 
    348 -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k quantity    -v false 
    349 -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k renormalize -v false 
    350 -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k use_area -v false 
    351 -n 'context[@id="interpol_run"]/file_definition/file[@id="file_src"]/field[@id="mask_source"]'   -k name  -v maskutil_T 
    352 -n 'context[@id="interpol_run"]/file_definition/file[@id="file_src"]/field[@id="area_source"]'   -k name  -v area_grid_T 
    353 -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]'                                 -k name  -v dia_${OutFileName} 
    354 -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="title"]'         -t "${SRC} mask interpolated to ${DST}" 
    355 -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="source_grid"]'   -t ${srcDomainType} 
    356 -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="dest_grid"]'     -t ${dstDomainType} 
    357 -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="order"]'         -t 1 
    358 -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_src"]'                      -k type  -v ${srcDomainType} 
    359 -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]'                      -k type  -v ${dstDomainType} 
    360 -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k weight_filename -v rmp_${OutFileName}.nc 
    361 -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k order -v 1 
    362 -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="normalization"]' -t false 
    363 -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="quantity"]'      -t false 
    364 -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="use_area"]'      -t false 
    365 -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k renormalize -v false 
    366 -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k quantity    -v false 
    367 -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k use_area    -v false 
     350-n 'context[@id="interpol_read"]/file_definition/file[@id="file_src"]/field[@id="mask_src"]'     --key name=maskutil_T 
     351-n 'context[@id="interpol_read"]/file_definition/file[@id="file_src"]/field[@id="area_src"]'     --key name=area_grid_T 
     352-n 'context[@id="interpol_read"]/domain_definition/domain[@id="domain_src"]'                     --key type=${srcDomainType} 
     353-n 'context[@id="interpol_read"]/domain_definition/domain[@id="domain_dst"]'                     --key type=${dstDomainType} 
     354-n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   --key order=1 
     355-n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   --key quantity=false 
     356-n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   --key renormalize=false 
     357-n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   --key use_area=false 
     358-n 'context[@id="interpol_run"]/file_definition/file[@id="file_src"]/field[@id="mask_source"]'   --key name=maskutil_T 
     359-n 'context[@id="interpol_run"]/file_definition/file[@id="file_src"]/field[@id="area_source"]'   --key name=area_grid_T 
     360-n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]'                                 --key name=dia_${OutFileName} 
     361-n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="title"]'         --text "${SRC} mask interpolated to ${DST}" 
     362-n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="source_grid"]'   --text ${srcDomainType} 
     363-n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="dest_grid"]'     --text ${dstDomainType} 
     364-n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="order"]'         --text 1 
     365-n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_src"]'                      --key type=${srcDomainType} 
     366-n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]'                      --key type=${dstDomainType} 
     367-n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   --key weight_filename=rmp_${OutFileName}.nc 
     368-n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   --key order=1 
     369-n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="normalization"]' --text false 
     370-n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="quantity"]'      --text false 
     371-n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="use_area"]'      --text false 
     372-n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   --key renormalize=false 
     373-n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   --key quantity=false 
     374-n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   --key use_area=false 
     375-n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="Model"]'         --text "${ModelName}" 
    368376EOF 
    369377 
     
    376384${MpiRun} ./interpol.exe --mask_src=${maskSrc} --mask_dst=${maskDst} --use_area=${useArea} 
    377385 
    378 ncatted --history --attribute map_method,global,o,c,"Conservative Remapping - 1st order"  rmp_${OutFileName}.nc 
    379 ncatted --history --attribute map_method,global,o,c,"Conservative Remapping - 1st order"  dia_${OutFileName}.nc 
    380  
    381 ncatted --history --attribute normalization,global,o,c,"false"  rmp_${OutFileName}.nc 
    382 ncatted --history --attribute normalization,global,o,c,"false"  dia_${OutFileName}.nc 
    383  
    384 ncatted --history --attribute Quantity,global,o,c,"false"  rmp_${OutFileName}.nc 
    385 ncatted --history --attribute Quantity,global,o,c,"false"  dia_${OutFileName}.nc 
    386  
    387 ncatted --history --attribute UseArea,global,o,c,"false"  rmp_${OutFileName}.nc 
    388 ncatted --history --attribute UseArea,global,o,c,"false"  dia_${OutFileName}.nc 
    389  
     386for File in rmp_${OutFileName}.nc dia_${OutFileName}.nc ; do 
     387    ncatted --history \ 
     388            --attribute map_method,global,o,c,"Conservative Remapping - 1st order"  \ 
     389            --attribute normalization,global,o,c,"false"  \ 
     390            --attribute Quantity,global,o,c,"false"  \ 
     391            --attribute UseArea,global,o,c,"false"  rmp_${OutFileName}.nc  
     392done 
    390393## 
    391394echo ${Titre}"Correct spurious values (extremes)"${Norm} 
    392395## =========================================================================== 
    393396cat <<EOF > correction_masque.nco 
    394 where (OceFrac <   0.00001 ) OceFrac=OceFrac.get_miss() ; 
    395 where (OceFrac >   0.99999 ) OceFrac=1.0 ; 
     397where (OceFrac < 0.00001) OceFrac=OceFrac.get_miss() ; 
     398where (OceFrac > 0.99999) OceFrac=1.0 ; 
    396399OceFrac.delete_miss() ; 
    397400// Fill masked values to land values 
    398 where (OceFrac >  1.0 ) OceFrac=0.0 ; 
    399 where (OceFrac <  0.0 ) OceFrac=0.0 ;  
     401where (OceFrac >  1.0) OceFrac=0.0 ; 
     402where (OceFrac <  0.0) OceFrac=0.0 ;  
    400403OceMask = OceFrac ; 
    401404EOF 
    402405ncap2 --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 
    403 ncatted --history -a missing_value,OceFrac,d,,"" -a _FillValue,OceFrac,d,,"" dia_t${oce}_to_t${atm}_${FullName}.nc 
    404 ncatted --history -a missing_value,OceMask,d,,"" -a _FillValue,OceMask,d,,"" dia_t${oce}_to_t${atm}_${FullName}.nc 
     406ncatted --history -a missing_value,OceFrac,d,,"" -a _FillValue,OceFrac,d,,"" -a missing_value,OceMask,d,,"" -a _FillValue,OceMask,d,,"" dia_t${oce}_to_t${atm}_${FullName}.nc 
    405407  
    406408## 
     
    413415cat <<EOF > creation_masque.nco 
    414416Oce2AtmMask = OceMask ;  
    415 where (OceMask >  0.0 ) Oce2AtmMask=1 ; 
    416 where (OceMask <= 0.0 ) Oce2AtmMask=0 ; 
     417where (OceMask >  0.0) Oce2AtmMask=1 ; 
     418where (OceMask <= 0.0) Oce2AtmMask=0 ; 
    417419EOF 
    418420 
     
    425427    case ${atm} in 
    426428        ( *ico* )  
    427         ncrename --history --dimension cell_domain_dst,cell              ${ATM}_grid_maskFrom_${OCE}.nc 
    428         ncrename --history --dimension nvertex_domain_dst,nvertex        ${ATM}_grid_maskFrom_${OCE}.nc 
    429         ncrename --history --variable  lat_domain_dst,lat                ${ATM}_grid_maskFrom_${OCE}.nc 
    430         ncrename --history --variable  lon_domain_dst,lon                ${ATM}_grid_maskFrom_${OCE}.nc 
    431         ncrename --history --variable  bounds_lat_domain_dst,bounds_lat  ${ATM}_grid_maskFrom_${OCE}.nc 
    432         ncrename --history --variable  bounds_lon_domain_dst,bounds_lon  ${ATM}_grid_maskFrom_${OCE}.nc 
    433         ncatted  --history --attribute bounds,lat,m,c,"bounds_lat"       ${ATM}_grid_maskFrom_${OCE}.nc 
    434         ncatted  --history --attribute bounds,lon,m,c,"bounds_lon"       ${ATM}_grid_maskFrom_${OCE}.nc 
     429        ncrename --history \ 
     430                 --dimension cell_domain_dst,cell \ 
     431                 --dimension nvertex_domain_dst,nvertex \ 
     432                 --variable lat_domain_dst,lat               --variable lon_domain_dst,lon  \ 
     433                 --variable bounds_lat_domain_dst,bounds_lat --variable bounds_lon_domain_dst,bounds_lon ${ATM}_grid_maskFrom_${OCE}.nc 
     434        ncatted  --history --attribute bounds,lat,m,c,"bounds_lat" --attribute bounds,lon,m,c,"bounds_lon" ${ATM}_grid_maskFrom_${OCE}.nc 
    435435        ;; 
    436436        ( *lmd* ) 
    437         ncrename --history --variable  lon_domain_dst,lon                ${ATM}_grid_maskFrom_${OCE}.nc 
    438         ncrename --history --variable  lat_domain_dst,lat                ${ATM}_grid_maskFrom_${OCE}.nc 
    439         ncrename --history --dimension lon_domain_dst,lon                ${ATM}_grid_maskFrom_${OCE}.nc 
    440         ncrename --history --dimension lat_domain_dst,lat                ${ATM}_grid_maskFrom_${OCE}.nc 
     437        ncrename --history \ 
     438                 --variable  lon_domain_dst,lon --variable  lat_domain_dst,lat \ 
     439                 --dimension lon_domain_dst,lon --dimension lat_domain_dst,lat ${ATM}_grid_maskFrom_${OCE}.nc 
    441440        ;; 
    442441    esac 
    443     ncatted  --history --attribute coordinates,OceFrac,m,c,"lat lon" ${ATM}_grid_maskFrom_${OCE}.nc 
    444     ncatted  --history --attribute coordinates,OceMask,m,c,"lat lon" ${ATM}_grid_maskFrom_${OCE}.nc 
    445     ncatted  --history --attribute coordinates,Oce2AtmMask,m,c,"lat lon" ${ATM}_grid_maskFrom_${OCE}.nc 
    446  
    447     ncatted  --history --attribute long_name,OceFrac,c,c,"fraction of ocean in a grid cell" ${ATM}_grid_maskFrom_${OCE}.nc 
    448     ncatted  --history --attribute units,OceFrac,c,c,"[0,1]" ${ATM}_grid_maskFrom_${OCE}.nc 
    449     ncatted  --history --attribute long_name,OceMask,c,c,"fraction of ocean in a grid cell" ${ATM}_grid_maskFrom_${OCE}.nc 
    450     ncatted  --history --attribute units,OceMask,c,c,"[0,1]" ${ATM}_grid_maskFrom_${OCE}.nc 
    451     ncatted  --history --attribute long_name,Oce2AtmMask,c,c,"land mask" ${ATM}_grid_maskFrom_${OCE}.nc 
    452     ncatted  --history --attribute units,Oce2AtmMask,c,c,"Land:0, Ocean:1" ${ATM}_grid_maskFrom_${OCE}.nc 
    453   
     442     
     443    ncatted  --history \ 
     444             --attribute coordinates,OceFrac,m,c,"lat lon"\ 
     445             --attribute coordinates,OceMask,m,c,"lat lon" \ 
     446             --attribute coordinates,Oce2AtmMask,m,c,"lat lon" \ 
     447             --attribute long_name,OceFrac,c,c,"fraction of ocean in a grid cell" \ 
     448             --attribute units,OceFrac,c,c,"[0,1]" \ 
     449             --attribute long_name,OceMask,c,c,"fraction of ocean in a grid cell" \ 
     450             --attribute units,OceMask,c,c,"[0,1]" \ 
     451             --attribute long_name,Oce2AtmMask,c,c,"land mask" \ 
     452             --attribute units,Oce2AtmMask,c,c,"Land:0, Ocean:1" ${ATM}_grid_maskFrom_${OCE}.nc 
    454453fi 
    455454 
     
    458457 
    459458[[ ${atm} = *ico* ]] && ncks --alphabetize --history --append --variable bounds_lon,bounds_lat atm_grid.nc ${ATM}_grid_maskFrom_${OCE}.nc 
    460  
    461  
    462459 
    463460## 
     
    489486    if [[ ${Command} = "Grids"   ]] ; then okGrids=yes   ; continue ; fi 
    490487     
    491     ln -fs ${OCE}_coordinates_mask.nc  oce_grid.nc 
    492     #ln -fs ${ATM}_grid.nc              atm_grid.nc 
     488    ln -fs ${OCE}_coordinates_mask.nc     oce_grid.nc 
    493489    ln -fs ${ATM}_grid_maskFrom_${OCE}.nc atm_grid.nc 
    494490 
     
    499495        cp iodef_oce_to_atm.xml iodef.xml 
    500496        cat << EOF > command_file_${OutFileName}.txt 
    501 -n 'context[@id="interpol_read"]/file_definition/file[@id="file_src"]/field[@id="mask_src"]'   -k name -v maskutil_${DSTGRID}  
    502 -n 'context[@id="interpol_read"]/file_definition/file[@id="file_dst"]/field[@id="mask_dst"]'   -k name -v Oce2AtmMask 
    503 -n 'context[@id="interpol_run"]/file_definition/file[@id="file_src"]/field[@id="mask_source"]' -k name -v maskutil_${SRCGRID} 
    504 -n 'context[@id="interpol_run"]/file_definition/file[@id="file_src"]/field[@id="area_source"]' -k name -v area_grid_${SRCGRID} 
    505 -n 'context[@id="interpol_run"]/file_definition/file[@id="file_dst"]/field[@id="mask_dest"]'   -k name -v Oce2AtmMask 
    506 -n 'context[@id="interpol_run"]/file_definition/file[@id="file_dst"]/field[@id="area_dest"]'   -k name -v aire 
     497-n 'context[@id="interpol_read"]/file_definition/file[@id="file_src"]/field[@id="mask_src"]'   --key name=maskutil_${DSTGRID}  
     498-n 'context[@id="interpol_read"]/file_definition/file[@id="file_dst"]/field[@id="mask_dst"]'   --key name=Oce2AtmMask 
     499-n 'context[@id="interpol_run"]/file_definition/file[@id="file_src"]/field[@id="mask_source"]' --key name=maskutil_${SRCGRID} 
     500-n 'context[@id="interpol_run"]/file_definition/file[@id="file_src"]/field[@id="area_source"]' --key name=area_grid_${SRCGRID} 
     501-n 'context[@id="interpol_run"]/file_definition/file[@id="file_dst"]/field[@id="mask_dest"]'   --key name=Oce2AtmMask 
     502-n 'context[@id="interpol_run"]/file_definition/file[@id="file_dst"]/field[@id="area_dest"]'   --key name=aire 
    507503EOF 
    508504        ;; 
     
    510506        cp iodef_atm_to_oce.xml iodef.xml 
    511507        cat << EOF > command_file_${OutFileName}.txt 
    512 -n 'context[@id="interpol_read"]/file_definition/file[@id="file_src"]/field[@id="mask_src"]'   -k name -v Oce2AtmMask 
    513 -n 'context[@id="interpol_read"]/file_definition/file[@id="file_dst"]/field[@id="mask_dst"]'   -k name -v mask_${DSTGRID} 
    514 -n 'context[@id="interpol_run"]/file_definition/file[@id="file_src"]/field[@id="mask_source"]' -k name -v Oce2AtmMask 
    515 -n 'context[@id="interpol_run"]/file_definition/file[@id="file_src"]/field[@id="area_source"]' -k name -v aire 
    516 -n 'context[@id="interpol_run"]/file_definition/file[@id="file_dst"]/field[@id="mask_dest"]'   -k name -v mask_${DSTGRID} 
    517 -n 'context[@id="interpol_run"]/file_definition/file[@id="file_dst"]/field[@id="area_dest"]'   -k name -v area_grid_${DSTGRID} 
     508-n 'context[@id="interpol_read"]/file_definition/file[@id="file_src"]/field[@id="mask_src"]'   --key name=Oce2AtmMask 
     509-n 'context[@id="interpol_read"]/file_definition/file[@id="file_dst"]/field[@id="mask_dst"]'   --key name=mask_${DSTGRID} 
     510-n 'context[@id="interpol_run"]/file_definition/file[@id="file_src"]/field[@id="mask_source"]' --key name=Oce2AtmMask 
     511-n 'context[@id="interpol_run"]/file_definition/file[@id="file_src"]/field[@id="area_source"]' --key name=aire 
     512-n 'context[@id="interpol_run"]/file_definition/file[@id="file_dst"]/field[@id="mask_dest"]'   --key name=mask_${DSTGRID} 
     513-n 'context[@id="interpol_run"]/file_definition/file[@id="file_dst"]/field[@id="area_dest"]'   --key name=area_grid_${DSTGRID} 
    518514EOF 
    519515        ;; 
     
    521517 
    522518    cat << EOF >> command_file_${OutFileName}.txt 
    523 -n 'context[@id="interpol_read"]/domain_definition/domain[@id="domain_dst"]'                     -k type  -v ${dstDomainType} 
    524 -n 'context[@id="interpol_read"]/domain_definition/domain[@id="domain_src"]'                     -k type  -v ${srcDomainType} 
    525 -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_src"]'                      -k type  -v ${srcDomainType} 
    526 -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]'                      -k type  -v ${dstDomainType} 
    527 -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k weight_filename -v rmp_${OutFileName}.nc 
    528 -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k order       -v ${numOrder} 
    529 -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k quantity    -v ${Quantity} 
    530 -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k renormalize -v ${Renormalize} 
    531 -n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   -k use_area    -v ${useArea} 
    532 -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]'                                 -k name -v dia_${OutFileName} 
    533 -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="title"]'         -t "${SRC} mask interpolated to ${DST}" 
    534 -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="dest_grid"]'     -t ${dstDomainType} 
    535 -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="source_grid"]'   -t ${srcDomainType} 
    536 -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="normalization"]' -t ${Renormalize} 
    537 -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="order"]'         -t ${numOrder}    
    538 -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="quantity"]'      -t ${Quantity} 
    539 -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="use_area"]'      -t ${useArea} 
     519-n 'context[@id="interpol_read"]/domain_definition/domain[@id="domain_dst"]'                     --key type=${dstDomainType} 
     520-n 'context[@id="interpol_read"]/domain_definition/domain[@id="domain_src"]'                     --key type=${srcDomainType} 
     521-n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_src"]'                      --key type=${srcDomainType} 
     522-n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]'                      --key type=${dstDomainType} 
     523-n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   --key weight_filename=rmp_${OutFileName}.nc 
     524-n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   --key order=${numOrder} 
     525-n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   --key quantity=${Quantity} 
     526-n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   --key renormalize=${Renormalize} 
     527-n 'context[@id="interpol_run"]/domain_definition/domain[@id="domain_dst"]/interpolate_domain'   --key use_area=${useArea} 
     528-n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]'                                 --key name=dia_${OutFileName} 
     529-n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="title"]'         --text "${SRC} mask interpolated to ${DST}" 
     530-n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="dest_grid"]'     --text ${dstDomainType} 
     531-n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="source_grid"]'   --text ${srcDomainType} 
     532-n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="normalization"]' --text ${Renormalize} 
     533-n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="order"]'         --text ${numOrder}    
     534-n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="quantity"]'      --text ${Quantity} 
     535-n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="use_area"]'      --text ${useArea} 
     536-n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="Model"]'         --text "${ModelName}" 
    540537EOF 
    541538 
     
    546543 
    547544    case ${numOrder} in 
    548         ( 1 ) 
    549         ncatted --history --attribute map_method,global,o,c,"Conservative Remapping - 1st order"  rmp_${OutFileName}.nc 
    550         ncatted --history --attribute map_method,global,o,c,"Conservative Remapping - 1st order"  dia_${OutFileName}.nc 
    551         ;; 
    552         ( 2 ) 
    553         ncatted --history --attribute map_method,global,o,c,"Conservative Remapping - 2nd order"  rmp_${OutFileName}.nc 
    554         ncatted --history --attribute map_method,global,o,c,"Conservative Remapping - 2nd order"  dia_${OutFileName}.nc 
    555         ;; 
    556     esac 
    557  
    558     ncatted --history --attribute normalization,global,o,c,"${Renormalize}"  rmp_${OutFileName}.nc 
    559     ncatted --history --attribute normalization,global,o,c,"${Renormalize}"  dia_${OutFileName}.nc 
    560  
    561     ncatted --history --attribute Quantity,global,o,c,"${Quantity}"  rmp_${OutFileName}.nc 
    562     ncatted --history --attribute Quantity,global,o,c,"${Quantity}"  dia_${OutFileName}.nc 
    563  
    564     ncatted --history --attribute UseArea,global,o,c,"${useArea}"  rmp_${OutFileName}.nc 
    565     ncatted --history --attribute UseArea,global,o,c,"${useArea}"  dia_${OutFileName}.nc 
    566      
     545        ( 1 ) Text="Conservative Remapping - 1st order" ;; 
     546        ( 2 ) Text="Conservative Remapping - 2nd order" ;; 
     547    esac 
     548    for File in rmp_${OutFileName}.nc   dia_${OutFileName}.nc ; do 
     549        ncatted --history \ 
     550                --attribute map_method,global,o,c,"${Text}" \ 
     551                --attribute normalization,global,o,c,"${Renormalize}" \ 
     552                --attribute Quantity,global,o,c,"${Quantity}" \ 
     553                --attribute UseArea,global,o,c,"${useArea}" ${File} 
     554    done 
    567555done 
    568556 
     
    571559## =========================================================================== 
    572560 
    573 NCO="$(ncks --version |& tail -1|sed 's/ncks //')" 
     561NCO="$(ncks --version |& tail -1 | sed 's/ncks //')" 
    574562PYTHON_VER=$( python3 -c "import sys ; print (sys.version.split(' ')[0])" ) 
    575563for InFile in $(ls *${oce}_to_*${atm}_*.nc *${atm}_to_*${oce}_*.nc ${ATM}_grid_maskFrom_${OCE}.nc 2> /dev/null) ; do 
     
    579567            --attribute Conventions,global,o,c,"CF-1.6"                           \ 
    580568            --attribute source,global,o,c,"IPSL Earth system model"               \ 
     569            --attribute model,global,o,c,"${ModelName}"                           \ 
    581570            --attribute group,global,o,c,"ICMC IPSL Climate Modelling Center"     \ 
    582571            --attribute Institution,global,o,c,"IPSL https://www.ipsl.fr"         \ 
    583572            --attribute Ocean,global,o,c,"${OCE} https://www.nemo-ocean.eu"       \ 
    584573            --attribute Atmosphere,global,o,c,"${ATM} http://lmdz.lmd.jussieu.fr" \ 
    585             --attribute production,global,o,c,"$(finger ${LOGNAME} | head -1 | awk '{print $4, $5}') " \ 
     574            --attribute production,global,o,c,"$(finger ${LOGNAME} | head -1 | awk '{print $4}')" \ 
    586575            --attribute originalFiles,global,o,c,"${OCE}_coordinates_mask.nc ${ATM}_grid_mask.nc"      \ 
    587576            --attribute associatedFiles,global,o,c,"grids_${CplModel}.nc areas_${CplModel}.nc masks_${CplModel}.nc" \ 
     
    594583            --attribute LOGNAME,global,o,c,"$(whoami)"                            \ 
    595584            --attribute NCO,global,o,c,"NCO netCDF Operator ${NCO} http://nco.sourceforge.net" \ 
    596             --attribute Python,global,o,c,"Python3 version ${PYTHON_VER}"          \ 
    597             --attribute release,global,o,c,"$(uname -r)"                          \ 
     585            --attribute Python,global,o,c,"Python3 version ${PYTHON_VER}"         \ 
     586            --attribute machine,global,o,c,"$(uname -a)"                          \ 
    598587            --attribute directory,global,o,c,"$(pwd)"                             \ 
    599588            --attribute description,global,o,c,"Generated with XIOS http://forge.ipsl.jussieu.fr/ioserver and MOSAIX https://forge.ipsl.jussieu.fr/igcmg/browser/TOOLS/MOSAIX" \ 
    600589            --attribute SVN_Author,global,o,c,'$Author$'                 \ 
    601             --attribute SVN_Date,global,o,c,'$Date$'                            \ 
     590            --attribute SVN_Date,global,o,c,'$Date$' \ 
    602591            --attribute SVN_Revision,global,o,c,'$Revision$'               \ 
    603             --attribute SVN_Id,global,o,c,'$Id$'                                \ 
     592            --attribute SVN_Id,global,o,c,'$Id$' \ 
    604593            ${InFile} 
    605594done 
     
    607596# Duplicate with no global attribute to avoid erasing attributes in other files 
    608597cp ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_noglobal.nc 
    609 ncatted --history --attribute ,global,d,c, ${ATM}_grid_maskFrom_${OCE}_noglobal.nc 
     598ncatted --history --attribute,global,d,c, ${ATM}_grid_maskFrom_${OCE}_noglobal.nc 
    610599 
    611600## 
     
    621610    ncap2 --history --script-file add_dim.nco tmp_${rmpFile} ${rmpFile} ; rm tmp_${rmpFile} 
    622611     
    623     ncrename --history --dimension n_weight,num_links   ${rmpFile} 
    624     ncrename --history --variable  src_idx,src_address  ${rmpFile} 
    625     ncrename --history --variable  dst_idx,dst_address  ${rmpFile} 
    626     ncrename --history --variable  weight,remap_matrix  ${rmpFile} 
    627  
     612    ncrename --history \ 
     613             --dimension n_weight,num_links   \ 
     614             --variable  src_idx,src_address  \ 
     615             --variable  dst_idx,dst_address  \ 
     616             --variable  weight,remap_matrix  ${rmpFile} 
    628617   
    629     ncatted --history --attribute conventions,global,o,c,"SCRIP"   ${rmpFile} 
    630     ncatted --history --attribute normalization,global,o,c,"none"  ${rmpFile} 
     618    ncatted --history --attribute conventions,global,o,c,"SCRIP" --attribute normalization,global,o,c,"none" ${rmpFile} 
    631619     
    632620    case ${rmpFile} in 
     
    648636done 
    649637 
    650 ls 
    651638## 
    652639echo ${Titre}"Add missing variables in rmp files"${Norm} 
     
    849836                 --o2a=${ATM}_grid_maskFrom_${OCE}.nc 
    850837        ;; 
    851  
    852838    esac 
    853839fi 
     
    911897All files have the same uuid in the global attributes 
    912898 
    913 Description     : Weigths and auxiliary files for coupling ${OCE} and ${ATM} needed by OASIS-MCT 
    914 Conventions     : CF-1.6 
    915 source          : IPSL Earth system model 
    916 group           : ICMC IPSL Climate Modelling Center 
    917 Institution     : IPSL https://www.ipsl.fr 
    918 Ocean           : ${OCE} https://www.nemo-ocean.eu 
    919 Atmosphere      : ${ATM} http://lmdz.lmd.jussieu.fr 
    920 production      : $(finger ${LOGNAME} | head -1 | awk '{print $4, $5}')  
    921 originalFiles   : ${OCE}_coordinates_mask.nc ${ATM}_grid_mask.nc 
    922 associatedFiles : grids_${CplModel}.nc areas_${CplModel}.nc masks_${CplModel}.nc 
    923 directory       : $(pwd) 
    924 timeStamp       : $(date) 
    925 uuid            : ${UUID} 
    926 HOSTNAME        : $(hostname) 
    927 LOGNAME         : $(whoami) 
    928 NCO             : NCO netCDF Operator ${NCO} http://nco.sourceforge.net 
    929 Python version  : ${PYTHON_VER} 
    930 release         : $(uname -r) 
    931 EOF 
    932  
    933 echo 'SVN Information : ' >> README.txt 
    934 echo '$Author$ ' >> README.txt 
    935 echo '$Date$ ' >> README.txt 
    936 echo '$Revision$ ' >> README.txt 
     899Description      : Weigths and auxiliary files for coupling ${OCE} and ${ATM} needed by OASIS-MCT 
     900Conventions      : CF-1.6 
     901Source           : IPSL Earth system model 
     902Model            : ${ModelName} 
     903Group            : ICMC IPSL Climate Modelling Center 
     904Institution      : IPSL https://www.ipsl.fr 
     905Ocean            : ${OCE} https://www.nemo-ocean.eu 
     906Atmosphere       : ${ATM} http://lmdz.lmd.jussieu.fr 
     907Production       : $(finger ${LOGNAME} | head -1 | awk '{print $4}')  
     908Original files   : ${OCE}_coordinates_mask.nc ${ATM}_grid_mask.nc 
     909Associated files : grids_${CplModel}.nc areas_${CplModel}.nc masks_${CplModel}.nc 
     910Description      : Generated with XIOS http://forge.ipsl.jussieu.fr/ioserver and MOSAIX https://forge.ipsl.jussieu.fr/igcmg/browser/TOOLS/MOSAIX" 
     911directory        : $(pwd) 
     912timeStamp        : $(date) 
     913Machine info     : $(uname -a) 
     914uuid             : ${UUID} 
     915HOSTNAME         : $(hostname) 
     916LOGNAME          : $(whoami) 
     917NCO              : NCO netCDF Operator ${NCO} http://nco.sourceforge.net 
     918Python version   : ${PYTHON_VER} 
     919 
     920EOF 
     921 
     922echo 'SVN Information : '                                              >> README.txt 
     923echo '$Author$ '                                              >> README.txt 
     924echo '$Date$ '          >> README.txt 
     925echo '$Revision$ '                                              >> README.txt 
    937926echo '$Id$ ' >> README.txt 
    938927echo '$HeadURL$ ' >> README.txt 
     
    944933Files produced, with checksum produced by Unix command shasum (version $(shasum --version)) with default algorithm 
    945934 
     935Checksum                                  File 
     936======================================================================================================== 
    946937EOF 
    947938 
  • TOOLS/MOSAIX/update_xml.py

    r6091 r6093  
    2222__HeadURL    = "$HeadURL$" 
    2323 
    24 # python update_xml.py -i ~/Unix/TOOLS/MOSAIX/iodef_atm_to_oce.xml -o essai.xml -n 'context[@id="interpol_read"]/file_definition/file[@id="file_src"]/field[@id="mask_src"]' -k name -v Bidon 
     24# python update_xml.py -i ~/Unix/TOOLS/MOSAIX/iodef_atm_to_oce.xml -o essai.xml -n 'context[@id="interpol_read"]/file_definition/file[@id="file_src"]/field[@id="mask_src"]' -k name=Bidon 
    2525# python update_xml.py -i ~/Unix/TOOLS/MOSAIX/iodef_atm_to_oce.xml -d -o essai.xml -n 'context[@id="interpol_run"]/file_definition/file[@id="dia"]/variable[@name="title"]' -t "SRC mask interpolated to DST" 
    2626# python update_xml.py -i ~/Unix/TOOLS/MOSAIX/iodef_atm_to_oce.xml -o essai.xml -c InFile.txt 
     
    2929# 
    3030import xml.etree.ElementTree 
    31 import argparse, sys, textwrap 
     31import argparse, sys, textwrap, shlex 
    3232     
    3333# Check version of Python 
     
    5555    return list_new 
    5656   
    57 def UpdateNode (iodef, Node, Text, Key, Value) : 
     57def UpdateNode (iodef, Node, Text=None, Key=None) : 
    5858    '''Update an xml node''' 
    5959    # Remove whitespaces at both ends 
     
    7070     
    7171    if len (nodeList) > 1 : 
    72         print ( "Error : " + len (nodeList)+" occurences of node found" ) 
     72        print ( "Error : " + len (nodeList)+" occurences of node found in file" ) 
    7373        print ( "Node  : ", Node ) 
    7474        sys.exit (2) 
     
    7777    elem = nodeList[0] 
    7878 
    79     if Debug : 
    80         print ( 'Node:', Node, ' -- Key:', Key, ' -- Value:', Value , ' -- Text:', Text  ) 
    81  
    8279    if Text != None : 
     80        if Verbose : print ( 'Node:', Node, ' -- Text:', Text  ) 
    8381        if Debug : 
    8482            print ( 'Attributes of node: ' + str (elem.attrib) ) 
     
    8785 
    8886    if Key != None : 
    89         # To do : check that Key exist (it is added if not : do we want that ?) 
    90         if Debug : 
    91             print ( 'Attributes of node: ' + str (elem.attrib) ) 
    92         elem.attrib.update ( { Key:Value } ) 
     87       
     88        # Check the syntax 
     89        if not '=' in Key : 
     90            print ( 'Key syntax error. Correct syntax is -k Key=Value' ) 
     91            sys.exit (-1) 
     92        else : 
     93            KeyName, Value = Key.split ('=') 
     94            if Verbose : print ( 'Node:', Node, ' -- Key:', Key ) 
     95            # To do : check that KeyName exist (it is added if not : do we want that ?) 
     96            if Debug : 
     97                print ( 'Attributes of node: ' + str (elem.attrib) ) 
     98            elem.attrib.update ( { KeyName:Value } ) 
    9399 
    94100    return iodef 
     
    115121group1 = parser.add_mutually_exclusive_group (required=False) 
    116122 
    117 parser.add_argument ( '-i', '--input'  , help="XML input file"              , default='iodef.xml', type=str, metavar='<input_file>'  ) 
    118 parser.add_argument ( '-o', '--output' , help="XML output file"             , default=None       , type=str, metavar='<output_file>' ) 
     123parser.add_argument ( '-i', '--input'  , help="XML input file"          , default='iodef.xml', type=str, metavar='<input_file>'  ) 
     124parser.add_argument ( '-o', '--output' , help="XML output file"         , default=None       , type=str, metavar='<output_file>' ) 
    119125parser.add_argument ( '-n', '--node'   , help="XML node in Xpath syntax", default=None, type=str, metavar='<xml_node>') 
    120 group1.add_argument ( '-k', '--key'    , help="XML key to update"       , default=None , type=str , metavar='<xml_key>' ) 
     126group1.add_argument ( '-k', '--key'    , help="XML key to update and new value (-k <name>=<value>)", default=None, type=str, metavar='<xml_key>' ) 
    121127group1.add_argument ( '-t', '--text'   , help="Will replace the 'text' part of the Xpath by <text>", default=None, type=str, metavar='<text>' ) 
    122 parser.add_argument ( '-v', '--value'  , help="New value for xml key  ", default=None, type=str, metavar='<value>' ) 
    123 parser.add_argument ( '-d', '--debug'  , action="store_true", default=False ) 
    124 parser.add_argument ( '-V', '--verbose', action="store_true", default=False ) 
     128parser.add_argument ( '-d', '--debug'  , help="Extensive debug prints", action="store_true", default=False ) 
     129parser.add_argument ( '-v', '--verbose', help="Some verbosity"        , action="store_true", default=False ) 
    125130parser.add_argument ( '-c', '--commandfile', help="file with list of command", default=None, type=str ) 
    126131 
     
    138143Key         = myargs.key 
    139144Text        = myargs.text 
    140 Value       = myargs.value 
    141145     
    142146if FileCommand != None :  
    143     if ( Node != None or Key != None or Text != None or Value != None ) : 
    144         print ('Error : when a command file is specified, options -k|--key, -n|--node and -v|--value a unused' ) 
     147    if ( Node != None or Key != None or Text != None ) : 
     148        print ('Error : when a command file is specified, options -k|--key, -n|--node are unused' ) 
    145149        exit (-2) 
    146150     
     
    152156if FileCommand == None : 
    153157    ## Only one node to modify 
    154      
    155     # Error handling not dealed by argparse 
    156     if Key != None and Value == None : 
    157         print ( "Error. When -k|--key=<key> is specified, you must specify -v|--value=<xml_value>" ) 
    158         sys.exit (-1) 
    159  
    160     iodef = UpdateNode ( iodef, Node, Text, Key, Value) 
     158    iodef = UpdateNode (iodef, Node, Key, Text) 
    161159 
    162160else : 
     
    166164 
    167165    for nn, ligne in enumerate (lignes) : 
     166        ligne = ligne.strip ().split ('#')[0] # Remove leading and trailing blanks, and trailing comments 
     167        if Debug : print (nn+1, ':', type (ligne) , ':', len (ligne) , ':', ligne, ':') 
     168        if ligne == '' or ligne == None or len(ligne) == 0 or ligne[0] == '#' : 
     169            if Debug : print ('Skips blank or comment line') 
     170        else :  
     171            list_args = shlex.split (ligne) 
     172         
     173            if Debug : 
     174                print ( '{:3d} : '.format(nn+1), end='') 
     175                print ( list_args ) 
     176            # Parse args line 
     177            myargs_ligne = parser.parse_args (list_args) 
    168178 
    169         ligne = ligne.strip() 
    170         if ligne    == ''  : break # Skips blank lines 
    171         if ligne[0] == '#' : break # Skips comment lines 
     179            Node     = myargs_ligne.node 
     180            Key      = myargs_ligne.key 
     181            Text     = myargs_ligne.text 
    172182 
    173         ligne = ligne.split('#')[0] # Remove trailing comments 
    174          
    175         list_args = ligne.split() 
    176         list_args = simplify_string_list ( list_args ) 
    177          
    178         if Debug : 
    179             print ( '{:3d} : '.format(nn+1), end='') 
    180             print ( list_args ) 
    181         myargs_ligne = parser.parse_args ( list_args ) 
    182  
    183         Node     = myargs_ligne.node 
    184         Key      = myargs_ligne.key 
    185         Text     = myargs_ligne.text 
    186         Value    = myargs_ligne.value 
    187          
    188         if Key != None and Value == None : 
    189             print ( "Error. When -k|--key=<key> is specified, you must specify -v|--value=<xml_value>" ) 
    190             sys.exit (-1) 
    191         UpdateNode ( iodef, Node, Text, Key, Value) 
     183            UpdateNode (iodef, Node, Text, Key) 
    192184     
    193185## Writes XML tree to file 
     
    195187 
    196188## This is the end 
    197 sys.exit (0) 
     189if Debug : print ('This is the end') 
     190#sys.exit (0) 
    198191     
    199192### =========================================================================== 
Note: See TracChangeset for help on using the changeset viewer.