Changeset 4090


Ignore:
Timestamp:
10/25/18 10:40:34 (4 years ago)
Author:
omamce
Message:

O.M. : add creation of a REAM file wiht checksum of all NetCDF files produced

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/MOSAIX/CreateWeightsMask.bash

    r4088 r4090  
    3737#  $Id$ 
    3838#  $HeadURL$ 
     39# 
    3940export Bold=$(tput bold)   
    4041export Unde=$(tput smul) ; export OffUnde=$(tput rmul) 
     
    6566# Defines OCE grids to handle 
    6667# =========================== 
    67 ListOCEGRID="T U V" 
    68 ListOrder="1st 2nd" 
    69 ListNormalize="false true" 
    70 ListQuantity="true false" 
     68ListOCEGRID="T" # U V 
     69ListOrder="1st" # 2nd 
     70ListNormalize="false" # true 
     71ListQuantity="false" # true 
    7172 
    7273## =========================================================================== 
     
    403404EOF 
    404405ncap2 --history --overwrite --script-file coastal.nco ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_coastal_maskFrom_${OCE}.nc 
    405 cp ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_n07.nc 
    406406ncks --history --append --variable AtmCoastal ${ATM}_coastal_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}.nc 
    407 cp ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_n08.nc 
    408407rm ${ATM}_coastal_maskFrom_${OCE}.nc 
    409408ncks --alphabetize --history --overwrite --fl_fmt=${FMT_OASIS} ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_${FMT_OASIS}.nc 
    410 cp ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_n09.nc 
    411409 
    412410## 
     
    471469#ncatted --history -a coordinates,aire,m,c,"lat lon" ${ATM}_grid_maskFrom_${OCE}.nc 
    472470ncap2 --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 
    473 cp ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_n10.nc 
    474471 
    475472ncks --alphabetize --history --overwrite --fl_fmt=${FMT_OASIS} ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_${FMT_OASIS}.nc 
     
    482479EOF 
    483480    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 
    484     cp ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_n11.nc 
    485481    ncatted --history \ 
    486482            -a coordinates,OceFrac,m,c,"time_counter lat lon"    \ 
     
    489485            -a coordinates,aire,c,c,"lat lon" \ 
    490486            ${ATM}_grid_maskFrom_${OCE}.nc 
    491     cp ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_n12.nc 
    492487fi 
    493488ncks --alphabetize --history --overwrite --fl_fmt=${FMT_OASIS} ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_${FMT_OASIS}.nc 
     
    502497    ncdump -h tmp_${ATM}_grid_maskFrom_${OCE}.nc 
    503498    mv tmp_${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}.nc 
    504     cp ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_n13.nc 
    505499     
    506500    ncatted --history \ 
     
    510504            -a coordinates,aire,m,c,"lat lon" \ 
    511505            ${ATM}_grid_maskFrom_${OCE}.nc 
    512     cp ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_n14.nc 
    513506fi 
    514507ncks --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 
    515 cp ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_n15.nc 
    516508ncks --alphabetize --history --overwrite --fl_fmt=${FMT_OASIS} ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_${FMT_OASIS}.nc 
    517 cp ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_n16.nc 
    518509 
    519510## 
     
    523514UUID=$(uuid) 
    524515NCO="$(ncks --version |& tail -1|sed 's/ncks //')" 
    525 PYTHON_VER=$( python -i -c "import sys ; print (sys.version.split(' ')[0])" ) 
     516PYTHON_VER=$( python -c "import sys ; print (sys.version.split(' ')[0])" ) 
    526517for InFile in *${oce}_to_*${atm}_*.nc *${atm}_to_*${oce}_*.nc ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_${FMT_OASIS}.nc; do 
    527518    ncatted --history \ 
     
    550541            --attribute OS,global,o,c,"$(uname -o)"                               \ 
    551542            --attribute release,global,o,c,"$(uname -r)"                          \ 
    552             --attribute hardware,global,o,c,"$(uname -i)"                         \ 
    553543            --attribute directory,global,o,c,"$(pwd)"                             \ 
    554544            --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" \ 
    555545            --attribute Comment,global,o,c,"Preliminary attempt - Do not trust !" \ 
    556             --attribute SVN_Author,global,o,c,"$Author$"                 \ 
    557             --attribute SVN_Date,global,o,c,"$Date$"                            \ 
    558             --attribute SVN_Revision,global,o,c,"$Revision$"               \ 
    559             --attribute SVN_Id,global,o,c,"$Id$"                                \ 
     546            --attribute SVN_Author,global,o,c,'$Author$'                 \ 
     547            --attribute SVN_Date,global,o,c,'$Date$'                            \ 
     548            --attribute SVN_Revision,global,o,c,'$Revision$'               \ 
     549            --attribute SVN_Id,global,o,c,'$Id$'                                \ 
    560550            ${InFile} 
    561551done 
    562 cp ${ATM}_grid_maskFrom_${OCE}.nc ${ATM}_grid_maskFrom_${OCE}_n20.nc 
    563552## 
    564553## Update and complete weights file to fit OASIS requested format 
     
    762751cp masks_${OCE}x${ATM}.nc ${SUBMIT_DIR} 
    763752 
     753## 
     754## Creates a README.txt file 
     755## =========================================================================== 
     756[[ -f README.txt ]] && rm README.txt 
     757 
     758cat <<EOF > README.txt 
     759Files produced by CreateWeightsMask.bash and CreateOasisGrids.bash 
     760 
     761rmp_* are weights files 
     762dia_* are diagnostic files not needed for the coupler 
     763grids_${OCE}x${ATM}.nc areas_${OCE}x${ATM}.nc masks_${OCE}x${ATM}.nc are auxiliary file needed by OASIS-MCT 
     764All files have the same uuid in the global attributes 
     765 
     766Description     : Weigths and auxiliary files for coupling ${OCE} and ${ATM} needed by OASIS-MCT 
     767Conventions     : CF-1.6 
     768source          : IPSL Earth system model 
     769group           : ICMC IPSL Climate Modelling Center 
     770Institution     : IPSL https://www.ipsl.fr 
     771Ocean           : ${OCE} https://www.nemo-ocean.eu 
     772Atmosphere      : ${ATM} http://lmdz.lmd.jussieu.fr 
     773production      : $(finger ${LOGNAME} | head -1 | awk '{print $4, $5}')  
     774originalFiles   : ${OCE}_coordinates_mask.nc ${ATM}_grid_mask.nc 
     775associatedFiles : grids_${OCE}x${ATM}.nc areas_${OCE}x${ATM}.nc masks_${OCE}x${ATM}.nc 
     776directory       : $(pwd) 
     777timeStamp       : $(date) 
     778uuid            : ${UUID} 
     779HOSTNAME        : $(hostname) 
     780LOGNAME         : $(whoami) 
     781NCO             : NCO netCDF Operator ${NCO} http://nco.sourceforge.net 
     782Python version  : ${PYTHON_VER} 
     783OS              : $(uname -o) 
     784release         : $(uname -r) 
     785hardware        : $(uname -i) 
     786 
     787SVN Information : 
     788\$Author: omamce \$ 
     789\$Date: 2018-03-20 16:05:56 +0100 (Tue, 20 Mar 2018) \$ 
     790\$Revision: 3671 \$ 
     791\$Id: update_xml.py 3671 2018-03-20 15:05:56Z omamce \$ 
     792\$HeadURL: https://forge.ipsl.jussieu.fr/igcmg/svn/TOOLS/MOSAIX/update_xml.py \$ 
     793 
     794UUID common to all files : ${UUID} 
     795 
     796Files produced, with checksum produce by Unix command shasum (version $(shasum --version)) with default algorithm 
     797 
     798EOF 
     799 
     800for file in *.nc ; do 
     801    echo "$(shasum ${file})" >> README.txt 
     802done 
     803 
     804cat <<EOF >> README.txt 
     805 
     806================= That's all folk's ! ======================== 
     807EOF 
     808 
     809cp README.txt ${SUBMIT_DIR}/README_${OCE}x${ATM}.txt 
    764810 
    765811## =========================================================================== 
Note: See TracChangeset for help on using the changeset viewer.