Ignore:
Timestamp:
02/22/19 14:16:18 (5 years ago)
Author:
omamce
Message:

O.M. : CPLRESTART

  • Add filling of ocean variable on continents
  • Add more parameters to increase versability
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TOOLS/CPLRESTART/FillOceRestart.py

    r4249 r4289  
    5050 -o <file>    | --output=<file>        : output file (default : build a name form input file) 
    5151 -r           | --replace              : replace input file by new file with filled variables 
    52  -v <varlist> | --variable=<variables> : list of variable to fill (defautlt: all variable in file) 
     52 -v <varlist> | --variable=<variables> : list of variable to fill (default: all variable in file) 
    5353 -x           | --exclude              : fills all variable in files, except those given in -v|--variable 
    5454 -n <perio>   | --perio=<perio> : periodicity type (default: try to guess) 
     
    9292            sys.exit(1) 
    9393        else : 
    94             if Debug : print ("Out file set to "+OuFile) 
    9594            OuFile   = myval ; 
     95            if Debug : print ("Out file set to " + OuFile) 
    9696    elif myopt in [ '-r', '--replace' ] : 
    9797        if OuFile != None : 
     
    111111            ListExclude = ListVarName 
    112112            ListVarName  = None 
    113   
     113 
    114114if OuFile == None : 
     115    print ( 'Definition OuFile' ) 
    115116    OuFile = InFile.replace ( ".nc", "_filled.nc" ) 
    116     print ("Creates output file name: "+OuFile) 
     117    print ("Creates output file name: " + OuFile) 
    117118 
    118119# Copy the input file if needed 
     
    131132    print ("Grid dimensions: ("+str(jpoj)+", "+str(jpoi)+")") 
    132133    if   'ORCA2' in InFile : 
     134        nperio=4 
    133135        print ("ORCA 2 grid found from file name: nperio may vary for this configuration") 
    134         print ("Choosen nperio=4") 
     136        print ("Choosen nperio=" + str(nperio) ) 
    135137    elif 'ORCA1' in InFile : 
    136         if 'eORCA1' in InFile :  
    137             print ("eORCA 1 grid found from file name, nperio=6") 
     138        if 'eORCA1' in InFile : 
     139            nperio=6 
     140            print ("eORCA 1 grid found from file name, nperio=" + str(nperio)) 
    138141        else : 
    139             print ("ORCA 1 grid found from file name, nperio=6") 
     142            nperio=6 
     143            print ("ORCA 1 grid found from file name, nperio=" + str(nperio)) 
    140144    elif (jpoj, jpoi) == (149, 182) : 
     145        nperio = 4 
    141146        print ("ORCA 2 grid found from dimension: nperio may vary for this configuration") 
    142         print ("Choosen nperio=4") 
    143         nperio = 4 
     147        print ("Choosen nperio=" + str(nperio)) 
    144148    elif (jpoj, jpoi) == (332, 292) : 
    145149        nperio = 6 
    146         print ("ORCA1 grid found from dimensions, nperio=6" ) 
     150        print ("ORCA1 grid found from dimensions, nperio" + str(nperio) ) 
    147151    elif (jpoj, jpoi) == (332, 362) : 
    148152        nperio = 6 
    149         print ("eORCA1 grid found from dimensions, nperio=6" ) 
     153        print ("eORCA1 grid found from dimensions, nperio" + str(nperio) ) 
    150154    elif (jpoj, jpoi) == (1021, 1442) : 
    151         nperio = 4 
    152         print ("ORCA025 grid found from dimensions, nperio=6" ) 
     155        nperio = 6 
     156        print ("ORCA025 grid found from dimensions, nperio" + str(nperio) ) 
    153157    elif (jpoj, jpoi) == (1207, 1442) : 
    154         nperio = 4 
    155         print ("eORCA025 grid found from dimensions, nperio=6" ) 
     158        nperio = 6 
     159        print ("eORCA025 grid found from dimensions, nperio=" + str(nperio) ) 
    156160         
    157161if nperio == None : 
Note: See TracChangeset for help on using the changeset viewer.