Changeset 6366 for TOOLS


Ignore:
Timestamp:
04/07/23 15:40:03 (13 months ago)
Author:
omamce
Message:

O.M.

CPLRESTART

Remove most nco commands : all is handled by the python script
Adapt to be more tolerant when inout variables are missing

Location:
TOOLS/CPLRESTART
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/CPLRESTART/CreateRestartAtm4Oasis.bash

    r6327 r6366  
    2727 
    2828# Usage exemples : 
    29 # CreateRestartAtm4Oasis.bash --oce ORCA2.3 /ccc/store/cont003/dsm/p25sepul/IGCM_OUT/IPSLCM5A2/PROD/piControl/CM5A2.1.pi.00/ATM/Output/MO/CM5A2.1.pi.00_40100101_40191231_1M_histmth.nc 
    30 # CreateRestartAtm4Oasis.bash --oce eORCA1.2 /ccc/store/cont003/gencmip6/p86maf/IGCM_OUT/IPSLCM6/PROD/piControl/CM61-LR-pi-03/ATM/Output/MO/CM61-LR-pi-03_23400101_23491231_1M_histmth.nc 
    31 # CreateRestartAtm4Oasis.bash --oce ORCA2.3 /ccc/work/cont003/gencmip6/bedidil/SAVE8_ORCA2/STORE1/dynamico_grid.nc 
    32 # CreateRestartAtm4Oasis.bash --oce ORCA2.3 /ccc/work/cont003/gencmip6/bedidil/SAVE9_ORCA2_DYN30_1MO/STORE1/histmth.nc 
     29# CreateRestartAtm4Oasis.bash --oce ORCA2.3    /ccc/store/cont003/dsm/p25sepul/IGCM_OUT/IPSLCM5A2/PROD/piControl/CM5A2.1.pi.00/ATM/Output/MO/CM5A2.1.pi.00_40100101_40191231_1M_histmth.nc 
     30# CreateRestartAtm4Oasis.bash --oce eORCA1.2   /ccc/store/cont003/gencmip6/p86maf/IGCM_OUT/IPSLCM6/PROD/piControl/CM61-LR-pi-03/ATM/Output/MO/CM61-LR-pi-03_23400101_23491231_1M_histmth.nc 
     31# CreateRestartAtm4Oasis.bash --oce ORCA2.3    /ccc/work/cont003/gencmip6/bedidil/SAVE8_ORCA2/STORE1/dynamico_grid.nc 
     32# CreateRestartAtm4Oasis.bash --oce ORCA2.3    /ccc/work/cont003/gencmip6/bedidil/SAVE9_ORCA2_DYN30_1MO/STORE1/histmth.nc 
     33# CreateRestartAtm4Oasis.bash --oce eORCA1.4.2 /ccc/scratch/cont003/gencmip6/p86caub/RUN_DIR/9114048_89294/ICOLOR-SROUT.11.NBP80.HISTMTH.89294/histday.nc 
    3334 
    3435## =========================================================================== 
     
    5657    set +e 
    5758    R_IN=$(ccc_home -u igcmg --cccwork)/IGCM 
    58     TMPDIR=${CCCWORKDIR}/TMP 
    59     SUBMIT_DIR=${BRIDGE_MSUB_PWD:-${SUBMIT_DIR}} 
     59    TMPDIR=${CCCSCRATCHDIR}/TMP/CPLRESTART 
     60    SUBMIT_DIR=${BRIDGE_MSUB_PWD:-${SUBMIT_DIR:-$(pwd)}} 
    6061    MpiRun="time ccc_mprun" 
    6162    PyRun="time ccc_mprun -n 1" # Needed to force python to run on one process only 
     
    6364    module load hdf5 
    6465    module load netcdf-c 
    65     module load nco/4.9.1 
    66     module load cdo/1.9.5 
    67     module load python3/3.7.2 
     66    module load nco # /4.9.1 
     67    module load cdo # /1.9.5 
     68    module load python3 # /3.7.2 
    6869    module load datadir/igcmg 
    6970    module list 
     
    8485set -o xtrace 
    8586set -e 
     87 
     88mkdir -p ${TMPDIR}  
     89 
     90cd ${TMPDIR} 
    8691 
    8792while [[ ${1} = -* ]] ; do 
     
    108113#AtmFile=${1:-/ccc/store/cont003/dsm/p25sepul/IGCM_OUT/IPSLCM5A2/PROD/piControl/CM5A2.1.pi.00/ATM/Output/MO/CM5A2.1.pi.00_40100101_40191231_1M_histmth.nc} 
    109114#AtmFile=${1:-/ccc/work/cont003/gencmip6/bedidil/SAVE8_ORCA2/STORE1/dynamico_grid.nc} 
    110 AtmFile=${1:-/ccc/work/cont003/gencmip6/bedidil/SAVE9_ORCA2_DYN30_1MO/STORE1/histmth.nc} 
     115AtmFile=${1:-/ccc/scratch/cont003/gencmip6/p86caub/RUN_DIR/9114048_89294/ICOLOR-SROUT.11.NBP80.HISTMTH.89294/histday.nc} 
    111116 
    112117# 
     
    115120FL_FMT=64bit 
    116121 
    117 ## 
    118 ## Extract variables 
    119 ## =========================================================================== 
    120 ncks --overwrite --fl_fmt=${FL_FMT} --history --dimension time_counter,0,0 --variable lon,lat,sols,soll,fract_oce,fract_sic,precip,snow,evap_sic,evap_oce,wind10m,taux_oce,tauy_oce,taux_sic,tauy_sic ${AtmFile} flxat_fields.nc 
    121 ncwa --overwrite --fl_fmt=${FL_FMT} --history --average time_counter flxat_fields.nc flxat_fields_notime.nc # remove time dimension  
    122 ncatted --history --attribute history,global,d,c,""  flxat_fields_notime.nc          # cleaning of history attributes 
    123122 
    124 ## 
    125 ## Determines if the file is unstructured (Dynamico) or lon/lat (LMDZ) 
    126 ## Set atmosphere name 
    127 ## =========================================================================== 
    128 Count=$(ncdump -h flxat_fields_notime.nc | grep nvertex | wc -l) 
     123Count=$(ncdump -h  ${AtmFile} | grep nvertex | wc -l) 
    129124if [[ ${Count} -gt 0 ]] ; then 
    130     IsUnstructured=yes 
    131     dim_cell=$(ncdump -h flxat_fields_notime.nc |& grep "cell *=" | awk '{print $3}' ) # Get nominal DYNAMICO resolution (nbp parameter) 
     125    IsUnstructured=True 
     126    dim_cell=$(ncdump -h  ${AtmFile} |& grep "cell *=" | awk '{print $3}' ) # Get nominal DYNAMICO resolution (nbp parameter) 
    132127    ico_nbp=$( echo "sqrt(($dim_cell-2)/10)" | bc -l | sed 's/\..*//' ) 
    133128    ATM=ICO${ico_nbp} 
    134     ncrename --history --dimension cell,y flxat_fields_notime.nc 
    135 cat <<EOF > add_dim.nco 
    136 defdim("x",1) ; 
    137 lon      [y,x] = lon       ; 
    138 lat      [y,x] = lat       ; 
    139 sols     [y,x] = sols      ; 
    140 soll     [y,x] = soll      ; 
    141 fract_oce[y,x] = fract_oce ; 
    142 fract_sic[y,x] = fract_sic ; 
    143 precip   [y,x] = precip    ; 
    144 snow     [y,x] = snow      ; 
    145 evap_sic [y,x] = evap_sic  ; 
    146 evap_oce [y,x] = evap_oce  ; 
    147 wind10m  [y,x] = wind10m   ; 
    148 taux_oce [y,x] = taux_oce  ; 
    149 tauy_oce [y,x] = tauy_oce  ; 
    150 taux_sic [y,x] = taux_sic  ; 
    151 tauy_sic [y,x] = tauy_sic  ; 
    152 EOF 
    153     ncap2 --history --overwrite --fl_fmt=${FL_FMT} --script-file add_dim.nco flxat_fields_notime.nc tmp_flxat_fields_notime.nc 
    154     mv tmp_flxat_fields_notime.nc flxat_fields_notime.nc 
     129     
    155130else 
    156131    # lat/lon 
    157     IsUnstructured=no 
    158     dim_lat=$(ncdump -h flxat_fields_notime.nc | grep "lat *=" | awk '{print $3}' ) 
    159     dim_lon=$(ncdump -h flxat_fields_notime.nc | grep "lon *=" | awk '{print $3}' ) 
    160     ncrename --history --dimension lon,x flxat_fields_notime.nc 
    161     ncrename --history --dimension lat,y flxat_fields_notime.nc 
    162 cat <<EOF > add_dim.nco 
    163 lon[y,x] = lon ; 
    164 lat[y,x] = lat ; 
    165 EOF 
    166     ncap2 --history --overwrite --fl_fmt=${FL_FMT} --script-file add_dim.nco flxat_fields_notime.nc tmp_flxat_fields_notime.nc 
    167     mv tmp_flxat_fields_notime.nc flxat_fields_notime.nc 
     132    IsUnstructured=False 
     133    dim_lat=$(ncdump -h ${AtmFile} | grep "lat *=" | awk '{print $3}' ) 
     134    dim_lon=$(ncdump -h ${AtmFile} | grep "lon *=" | awk '{print $3}' ) 
     135    #ncrename --history --dimension lon,x flxat_fields_notime.nc 
     136    #ncrename --history --dimension lat,y flxat_fields_notime.nc 
    168137    (( dim_lat = dim_lat - 1 )) 
    169138    ATM=LMD${dim_lon}${dim_lat} 
    170139    (( n_lat = dim_lat - 1 )) 
    171  
    172  
    173140fi 
    174141 
    175142echo "Version atmosphere : " ${ATM} 
    176  
    177143 
    178144## 
     
    180146## =========================================================================== 
    181147 
    182 python3 create_flxat.py --IsUnstructured=${IsUnstructured} --input flxat_fields_notime.nc --output tmp_flxat.nc 
     148python3 ${SUBMIT_DIR}/create_flxat.py --IsUnstructured=${IsUnstructured} --input ${AtmFile} --output flxat.nc 
    183149 
    184 #this is not needed anymore since bounds are included in flxat.py if they exist 
    185 #[[ ${IsUnstructured} = yes ]] && ncks --fl_fmt=${FL_FMT} --history --append --variable bounds_lon,bounds_lat tmp_flxat.nc 
    186 ncks --fl_fmt=${FL_FMT} --append --history --variable COTAUXXU,COTAUYYU,COTAUZZU,COTAUXXV,COTAUYYV,COTAUZZV,COTOTRAI,COTOTSNO,COTOTEVA,COICEVAP,COQSRMIX,COQNSMIX,COSHFICE,CONSFICE,CODFLXDT,COCALVIN,COLIQRUN,COWINDSP,COTAUMOD tmp_flxat.nc flxat.nc 
     150#ncks --fl_fmt=${FL_FMT} --append --history --variable COTAUXXU,COTAUYYU,COTAUZZU,COTAUXXV,COTAUYYV,COTAUZZV,COTOTRAI,COTOTSNO,COTOTEVA,COICEVAP,COQSRMIX,COQNSMIX,COSHFICE,CONSFICE,CODFLXDT,COCALVIN,COLIQRUN,COWINDSP,COTAUMOD tmp_flxat.nc flxat.nc 
    187151 
    188152## 
     
    191155 
    192156UUID=$(uuid) 
    193 NCO="$(ncks --version |& tail -1|sed 's/ncks //')" 
     157NCO="$(ncks --version |& tail -1 | sed 's/ncks //')" 
    194158ncatted --history \ 
    195159        --attribute nco_openmp_thread_number,global,d,,                       \ 
    196         --attribute source,global,o,c,"IPSL Earth system model"               \ 
    197         --attribute group,global,o,c,"ICMC IPSL Climate Modelling Center"     \ 
    198         --attribute Institution,global,o,c,"IPSL https://www.ipsl.fr"         \ 
    199         --attribute Model,global,o,c,"${ATM} http://lmdz.lmd.jussieu.fr"      \ 
    200         --attribute Ocean,global,o,c,"${OCE} https://www.nemo-ocean.eu"       \ 
    201160        --attribute production,global,o,c,"$(finger ${LOGNAME} | head -1 | awk '{print $4, $5}')" \ 
    202         --attribute originalFiles,global,o,c,"${AtmFile}"                     \ 
    203         --attribute directory,global,o,c,"$(pwd)"                             \ 
    204         --attribute description,global,o,c,"Fields needed by OASIS-MCT"       \ 
    205         --attribute timeStamp,global,o,c,"$(date)"                            \ 
    206         --attribute Program,global,o,c,"Generated by ${0}"                    \ 
     161        --attribute Program,global,o,c,"Generated by ${0}"      \ 
     162        --attribute originalFiles,global,o,c,"${AtmFile}"       \ 
    207163        --attribute uuid,global,o,c,"${UUID}"                                 \ 
    208         --attribute HOSTNAME,global,o,c,"$(hostname)"                         \ 
    209         --attribute LOGNAME,global,o,c,"$(whoami)"                            \ 
    210164        --attribute NCO,global,o,c,"NCO netCDF Operator ${NCO} http://nco.sourceforge.net" \ 
    211         --attribute OS,global,o,c,"$(uname -o)"                               \ 
    212         --attribute release,global,o,c,"$(uname -r)"                          \ 
    213         --attribute hardware,global,o,c,"$(uname -i)"                         \ 
    214         --attribute directory,global,o,c,"$(pwd)"                             \ 
    215165        --attribute Comment,global,o,c,"${Comment}"                           \ 
    216         --attribute Comment,global,o,c,"Preliminary attempt - Do not trust !" \ 
    217         --attribute SVN_Author,global,o,c,"$Author$"                 \ 
    218         --attribute SVN_Date,global,o,c,"$Date$" \ 
    219         --attribute SVN_Revision,global,o,c,"$Revision$"               \ 
    220         --attribute SVN_Id,global,o,c,"$Id$" \ 
    221166        flxat.nc 
    222  
    223167 
    224168## 
     
    229173ncks --history --variable COCALVIN flxat_${ATM}_maskFrom_${OCE}.nc icshf_${ATM}_maskFrom_${OCE}.nc 
    230174 
    231 ## 
    232 ## Cleaning 
    233 ## =========================================================================== 
    234 rm -f flxat_fields.nc flxat_fields_notime.nc tmp_flxat.nc 
    235  
    236175## =========================================================================== 
    237176## 
  • TOOLS/CPLRESTART/create_flxat.py

    r6327 r6366  
    2525 
    2626import numpy as np, xarray as xr 
    27 import sys, argparse, textwrap 
    28  
     27import sys, argparse, textwrap, time, os, platform 
    2928 
    3029## Reading the command line arguments 
     
    4342parser.add_argument ('-f', '--format' , metavar='NetCDF_Format', help="NetCDF format", nargs='?', default="NETCDF4", 
    4443                         choices=["NETCDF4","NETCDF4_CLASSIC", "NETCDF3_64BIT", "NETCDF3_CLASSIC", "64bits"]) 
    45 parser.add_argument ('--IsUnstructured', default='no', choices=['yes', 'no'] ) 
     44parser.add_argument ('--IsUnstructured',  choices=['True', 'False'], required=True ) 
    4645 
    4746# Parse command line 
    4847myargs = parser.parse_args () 
    4948 
     49IsUnstructured = myargs.IsUnstructured 
     50if IsUnstructured == 'True' : IsUnstructured = True 
     51else :  IsUnstructured = False 
     52 
    5053NcFormat = myargs.format 
    5154if NcFormat == '64bit' : NcFormat = NETCDF4 
     
    5659lon       = d_In.lon.astype(np.float64).values 
    5760lat       = d_In.lat.astype(np.float64).values 
    58 evap_oce  = d_In.evap_oce.astype(np.float64).values 
    59 evap_sic  = d_In.evap_sic.astype(np.float64).values 
    60 fract_oce = d_In.fract_oce.astype(np.float64).values 
    61 fract_sic = d_In.fract_sic.astype(np.float64).values 
    62 precip    = d_In.precip.astype(np.float64).values 
    63 snow      = d_In.snow.astype(np.float64).values 
    64 soll      = d_In.soll.astype(np.float64).values 
    65 sols      = d_In.sols.astype(np.float64).values 
    66 taux_oce  = d_In.taux_oce.astype(np.float64).values 
    67 taux_sic  = d_In.taux_sic.astype(np.float64).values 
    68 tauy_oce  = d_In.tauy_oce.astype(np.float64).values 
    69 tauy_sic  = d_In.tauy_sic.astype(np.float64).values 
    70 wind10m   = d_In.wind10m.astype(np.float64).values 
    71  
     61 
     62if IsUnstructured : 
     63    dims = lon.shape 
     64else : 
     65    dims = ( lat.shape[0], lon.shape[0] ) 
     66 
     67# Try to read variables 
     68# Set them to zero if not possible 
     69try    : evap_oce  = d_In.evap_oce[0].squeeze().astype(np.float64).values 
     70except : evap_oce  = np.zeros ( dims ) 
     71try    : evap_sic  = d_In.evap_sic[0].squeeze().astype(np.float64).values 
     72except : evap_sic  = np.zeros ( dims ) 
     73try    : fract_oce = d_In.fract_oce[0].squeeze().astype(np.float64).values 
     74except : fract_oce = np.ones ( dims ) 
     75try    : fract_sic = d_In.fract_sic[0].squeeze().astype(np.float64).values 
     76except : fract_sic = np.zeros ( dims ) 
     77try    : precip    = d_In.precip[0].squeeze().astype(np.float64).values 
     78except : evap_oce  = np.zeros ( dims ) 
     79try    : snow      = d_In.snow[0].squeeze().astype(np.float64).values 
     80except : snow      = np.zeros ( dims ) 
     81try    : soll      = d_In.soll[0].squeeze().astype(np.float64).values 
     82except : soll      = np.zeros ( dims ) 
     83try    : sols      = d_In.sols[0].squeeze().astype(np.float64).values 
     84except : sols      = np.zeros ( dims ) 
     85try    : taux_oce  = d_In.taux_oce[0].squeeze().astype(np.float64).values 
     86except : taux_oce  = np.zeros ( dims ) 
     87try    : taux_sic  = d_In.taux_sic[0].squeeze().astype(np.float64).values 
     88except : taux_sic  = np.zeros ( dims ) 
     89try    : tauy_oce  = d_In.tauy_oce[0].squeeze().astype(np.float64).values 
     90except : tauy_oce  = np.zeros ( dims ) 
     91try    : tauy_sic  = d_In.tauy_sic[0].squeeze().astype(np.float64).values 
     92except : tauy_sic  = np.zeros ( dims ) 
     93try    : wind10m   = d_In.wind10m[0].squeeze().astype(np.float64).values 
     94except : wind10m   = np.zeros ( dims ) 
     95 
     96if IsUnstructured : 
     97    lon       = np.expand_dims ( lon       , axis=1 ) 
     98    lat       = np.expand_dims ( lat       , axis=1 ) 
     99    evap_oce  = np.expand_dims ( evap_oce  , axis=1 ) 
     100    evap_sic  = np.expand_dims ( evap_sic  , axis=1 ) 
     101    fract_oce = np.expand_dims ( fract_oce , axis=1 ) 
     102    fract_sic = np.expand_dims ( fract_sic , axis=1 ) 
     103    precip    = np.expand_dims ( precip    , axis=1 ) 
     104    snow      = np.expand_dims ( snow      , axis=1 ) 
     105    soll      = np.expand_dims ( soll      , axis=1 ) 
     106    sols      = np.expand_dims ( sols      , axis=1 ) 
     107    taux_oce  = np.expand_dims ( taux_oce  , axis=1 ) 
     108    taux_sic  = np.expand_dims ( taux_sic  , axis=1 ) 
     109    tauy_oce  = np.expand_dims ( tauy_oce  , axis=1 ) 
     110    tauy_sic  = np.expand_dims ( tauy_sic  , axis=1 ) 
     111    wind10m   = np.expand_dims ( wind10m   , axis=1 ) 
     112else : 
     113    #lon       = np.expand_dims ( lon       , axis=1 ) 
     114    #lat       = np.expand_dims ( lat       , axis=0 ) 
     115    lon2 = lat [:, np.newaxis]*0 + lon [np.newaxis, :] 
     116    lat2 = lat [:, np.newaxis]   + lon [np.newaxis, :]*0 
     117    lon = lon2 ; lat = lat2 
     118     
    72119## 
    73120yxshape = lat.shape 
     
    76123## Computations 
    77124np.seterr (divide='ignore', invalid='ignore') 
     125 
    78126fract_oce_plus_sic  = (fract_oce + fract_sic) ; ## ocean fraction 
    79127fract_oce_norm = np.where (fract_oce_plus_sic >  0.0, fract_oce/fract_oce_plus_sic, 0.0) # free ocean vs. total ocen fraction 
     
    147195COTAUZZU = xr.DataArray ( tau_y * np.cos(rad * lat)                                                 , dims=('y', 'x')) 
    148196 
    149  
    150197## Value at North Pole 
    151 if myargs.IsUnstructured == 'yes' : 
     198if IsUnstructured : 
    152199    ## Value at North Pole for DYNAMICO grid  
    153200    COTAUXXU = xr.where ( lat >= 89.999, -tau_y, COTAUXXU) 
     
    200247    nvertex = bounds_lon.shape[-1] 
    201248 
    202     bounds_lon = xr.DataArray ( np.reshape (bounds_lon, (ny,nx,nvertex)), dims=('y', 'x', 'nvertex')) 
    203     bounds_lat = xr.DataArray ( np.reshape (bounds_lat, (ny,nx,nvertex)), dims=('y', 'x', 'nvertex')) 
     249    bounds_lon = xr.DataArray ( np.reshape (bounds_lon, (ny, nx, nvertex)), dims=('y', 'x', 'nvertex')) 
     250    bounds_lat = xr.DataArray ( np.reshape (bounds_lat, (ny, nx, nvertex)), dims=('y', 'x', 'nvertex')) 
    204251 
    205252    bounds_lon.attrs['units'] = 'degrees_east' 
     
    208255# prepare dictionnary to export dataset to netcdf file with or without bounds 
    209256dictdataset = {'lat':lat, 'lon':lon } 
    210 if ifbnds: dictdataset.update({'bounds_lon':bounds_lon, 'bounds_lat':bounds_lat}) 
    211 dictdataset.update({'COTOTRAI':COTOTRAI, 
    212     'COTOTSNO':COTOTSNO, 
    213     'COTOTEVA':COTOTEVA, 
    214     'COICEVAP':COICEVAP, 
    215     'COQSRMIX':COQSRMIX, 
    216     'COQNSMIX':COQNSMIX, 
    217     'COSHFICE':COSHFICE, 
    218     'CONSFICE':CONSFICE, 
    219     'CODFLXDT':CODFLXDT, 
    220     'COCALVIN':COCALVIN, 
    221     'COLIQRUN':COLIQRUN, 
    222     'COWINDSP':COWINDSP, 
    223     'COTAUMOD':COTAUMOD, 
    224     'COTAUXXU':COTAUXXU, 
    225     'COTAUYYU':COTAUYYU, 
    226     'COTAUZZU':COTAUZZU, 
    227     'COTAUXXV':COTAUXXV, 
    228     'COTAUYYV':COTAUYYV, 
     257if ifbnds: dictdataset.update ( {'bounds_lon':bounds_lon, 'bounds_lat':bounds_lat} ) 
     258dictdataset.update ( { 
     259    'COTOTRAI':COTOTRAI, 'COTOTSNO':COTOTSNO, 'COTOTEVA':COTOTEVA, 
     260    'COICEVAP':COICEVAP, 'COQSRMIX':COQSRMIX, 'COQNSMIX':COQNSMIX, 
     261    'COSHFICE':COSHFICE, 'CONSFICE':CONSFICE, 'CODFLXDT':CODFLXDT, 
     262    'COCALVIN':COCALVIN, 'COLIQRUN':COLIQRUN, 'COWINDSP':COWINDSP, 
     263    'COTAUMOD':COTAUMOD, 'COTAUXXU':COTAUXXU, 'COTAUYYU':COTAUYYU, 
     264    'COTAUZZU':COTAUZZU, 'COTAUXXV':COTAUXXV, 'COTAUYYV':COTAUYYV, 
    229265    'COTAUZZV':COTAUZZV } ) 
    230266 
    231267d_Out = xr.Dataset (dictdataset) 
    232268 
    233 d_Out.attrs['Associated files'] = myargs.input 
    234 d_Out.attrs['Conventions']     = "CF-1.6" 
    235 d_Out.attrs['source']          = "IPSL Earth system model" 
    236 d_Out.attrs['group']           = "ICMC IPSL Climate Modelling Center" 
    237 d_Out.attrs['Institution']     = "IPSL https.//www.ipsl.fr" 
     269d_Out.attrs ['AssociatedFiles']   = myargs.input 
     270d_Out.attrs ['Conventions']       = "CF-1.6" 
     271d_Out.attrs ['source']            = "IPSL Earth system model" 
     272d_Out.attrs ['group']             = "ICMC IPSL Climate Modelling Center" 
     273d_Out.attrs ['Institution']       = "IPSL https.//www.ipsl.fr" 
     274d_Out.attrs ['Model']             = "IPSL CM6" 
     275d_Out.attrs ['source']            = "IPSL Earth system model" 
     276d_Out.attrs ['group']             = "ICMC IPSL Climate Modelling Center" 
     277d_Out.attrs ['Institution']       = "IPSL https://www.ipsl.fr" 
     278d_Out.attrs ['description']       = "Fields needed by OASIS-MCT"  
     279d_Out.attrs ['timeStamp']         = time.asctime () 
    238280try    : d_Out.attrs['directory'] = os.getcwd () 
    239281except : pass 
    240 try    : d_Out.attrs['HOSTNAME'] = platform.node () 
    241 except : pass 
    242 try    : d_Out.attrs['LOGNAME']  = os.getlogin () 
    243 except : pass 
    244 try    : d_Out.attrs['Python']   = "Python version " +  platform.python_version () 
    245 except : pass 
    246 try    : d_Out.attrs['OS']       = platform.system () 
    247 except : pass 
    248 try    : d_Out.attrs['release']  = platform.release () 
    249 except : pass 
    250 try    : d_Out.attrs['hardware'] = platform.machine () 
    251 except : pass 
    252 d_Out.attrs['conventions']     = "SCRIP" 
    253 d_Out.attrs['dest_grid']       = "curvilinear" 
    254 d_Out.attrs['Model']           = "IPSL CM6" 
    255 d_Out.attrs['SVN_Author']      = "$Author: omamce $" 
    256 d_Out.attrs['SVN_Date']        = "$Date: 2022-07-06 11:06:07 +0200 (Wed, 06 Jul 2022) $" 
    257 d_Out.attrs['SVN_Revision']    = "$Revision: 6190 $" 
    258 d_Out.attrs['SVN_Id']          = "$Id: CalvingWeights.py 6190 2022-07-06 09:06:07Z omamce $" 
    259 d_Out.attrs['SVN_HeadURL']     = "$HeadURL: svn+ssh://omamce@forge.ipsl.jussieu.fr/ipsl/forge/projets/igcmg/svn/TOOLS/MOSAIX/CalvingWeights.py $" 
    260  
     282try    : d_Out.attrs['HOSTNAME']  = platform.node () 
     283except : pass 
     284try    : d_Out.attrs['LOGNAME']   = os.getlogin () 
     285except : pass 
     286try    : d_Out.attrs['Python']    = "Python version " +  platform.python_version () 
     287except : pass 
     288try    : d_Out.attrs['OS']        = platform.system () 
     289except : pass 
     290try    : d_Out.attrs['release']   = platform.release () 
     291except : pass 
     292try    : d_Out.attrs['hardware']  = platform.machine () 
     293except : pass 
     294d_Out.attrs ['SVN_Author']        = "$Author: omamce $" 
     295d_Out.attrs ['SVN_Date']          = "$Date: 2022-07-06 11:06:07 +0200 (Wed, 06 Jul 2022) $" 
     296d_Out.attrs ['SVN_Revision']      = "$Revision: 6190 $" 
     297d_Out.attrs ['SVN_Id']            = "$Id: CalvingWeights.py 6190 2022-07-06 09:06:07Z omamce $" 
     298d_Out.attrs ['SVN_HeadURL']       = "$HeadURL: svn+ssh://omamce@forge.ipsl.jussieu.fr/ipsl/forge/projets/igcmg/svn/TOOLS/MOSAIX/CalvingWeights.py $" 
    261299 
    262300d_Out.to_netcdf ( myargs.output, format=NcFormat ) 
    263 d_Out.close() 
     301d_Out.close () 
    264302## =========================================================================== 
    265303## 
Note: See TracChangeset for help on using the changeset viewer.