New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 13468 – NEMO

Changeset 13468


Ignore:
Timestamp:
2020-09-15T11:48:27+02:00 (4 years ago)
Author:
laurent
Message:

Python2.7 to Python3!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/tests/STATION_ASF/EXPREF/plot_station_asf.py

    r13264 r13468  
    1 #!/usr/bin/env python 
     1#!/usr/bin/env python3 
    22# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- 
    33 
    4 # Post-diagnostic of STATION_ASF /  L. Brodeau, 2019 
     4# Post-diagnostic of STATION_ASF /  L. Brodeau, 2020 
    55 
    66import sys 
    77from os import path as path 
    8 #from string import replace 
    98import math 
    109import numpy as nmp 
    11 #import scipy.signal as signal 
    1210from netCDF4 import Dataset 
    1311import matplotlib as mpl 
     
    1513import matplotlib.pyplot as plt 
    1614import matplotlib.dates as mdates 
    17 #from string import find 
    18 #import warnings 
    19 #warnings.filterwarnings("ignore") 
    20 #import time 
    21  
    22 #import barakuda_plot as bp 
    23 #import barakuda_tool as bt 
    24  
    25 reload(sys) 
    26 sys.setdefaultencoding('utf8') 
    2715 
    2816cy1     = '2018' ; # First year 
     
    6856narg = len(sys.argv) 
    6957if narg != 2: 
    70     print 'Usage: '+sys.argv[0]+' <DIR_OUT_SASF>'; sys.exit(0) 
     58    print('Usage: '+sys.argv[0]+' <DIR_OUT_SASF>'); sys.exit(0) 
    7159cdir_data = sys.argv[1] 
    7260 
     
    7866def chck4f(cf): 
    7967    cmesg = 'ERROR: File '+cf+' does not exist !!!' 
    80     if not path.exists(cf): print cmesg ; sys.exit(0) 
     68    if not path.exists(cf): print(cmesg); sys.exit(0) 
    8169 
    8270###cf_in = nmp.empty((), dtype="S10") 
     
    176164                rmlt = 10.**(int(romagn)) / 2. 
    177165                yrng = math.copysign( math.ceil(abs(rmax)/rmlt)*rmlt , rmax) 
    178                 #print 'yrng = ', yrng ;  #sys.exit(0) 
    179166 
    180167                fig = plt.figure(num = 10+jv, figsize=size_fig, facecolor='w', edgecolor='k') 
     
    225212    rmlt = 10.**(int(romagn)) / 2. 
    226213    yrng = math.copysign( math.ceil(abs(rmax)/rmlt)*rmlt , rmax) 
    227     print 'yrng = ', yrng ;  #sys.exit(0) 
    228  
    229  
    230  
    231  
     214 
     215     
    232216    for ja in range(nb_algos-1): 
    233217 
Note: See TracChangeset for help on using the changeset viewer.