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 13899 for NEMO/branches/2020/tickets_icb_1900/tests/STATION_ASF/EXPREF/plot_station_asf.py – NEMO

Ignore:
Timestamp:
2020-11-27T17:26:33+01:00 (4 years ago)
Author:
mathiot
Message:

ticket #1900: update branch to trunk and add ICB test case

Location:
NEMO/branches/2020/tickets_icb_1900
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/tickets_icb_1900

    • Property svn:externals
      •  

        old new  
        22^/utils/build/makenemo@HEAD   makenemo 
        33^/utils/build/mk@HEAD         mk 
        4 ^/utils/tools/@HEAD           tools 
         4^/utils/tools@HEAD            tools 
        55^/vendors/AGRIF/dev_r12970_AGRIF_CMEMS      ext/AGRIF 
        66^/vendors/FCM@HEAD            ext/FCM 
         
        88 
        99# SETTE 
        10 ^/utils/CI/sette@12931        sette 
         10^/utils/CI/sette@13559        sette 
  • NEMO/branches/2020/tickets_icb_1900/tests/STATION_ASF/EXPREF/plot_station_asf.py

    r12629 r13899  
    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') 
    27  
    28 cy1     = '2016' ; # First year 
     15 
     16cy1     = '2018' ; # First year 
    2917cy2     = '2018' ; # Last year 
    30  
    31 jt0 = 0 
    32 jt0 = 17519 
    33  
    3418 
    3519dir_figs='.' 
     
    7256narg = len(sys.argv) 
    7357if narg != 2: 
    74     print 'Usage: '+sys.argv[0]+' <DIR_OUT_SASF>'; sys.exit(0) 
     58    print('Usage: '+sys.argv[0]+' <DIR_OUT_SASF>'); sys.exit(0) 
    7559cdir_data = sys.argv[1] 
    7660 
     
    8266def chck4f(cf): 
    8367    cmesg = 'ERROR: File '+cf+' does not exist !!!' 
    84     if not path.exists(cf): print cmesg ; sys.exit(0) 
     68    if not path.exists(cf): print(cmesg); sys.exit(0) 
    8569 
    8670###cf_in = nmp.empty((), dtype="S10") 
     
    10488# Getting time array from the first file: 
    10589id_in = Dataset(cf_in[0]) 
    106 vt = id_in.variables['time_counter'][jt0:] 
     90vt = id_in.variables['time_counter'][:] 
    10791cunit_t = id_in.variables['time_counter'].units ; print(' "time_counter" is in "'+cunit_t+'"') 
    10892id_in.close() 
     
    138122            if ctest == 'skin':   id_in = Dataset(cf_in[ja]) 
    139123            if ctest == 'noskin': id_in = Dataset(cf_in_ns[ja]) 
    140             xF[:,ja] = id_in.variables[L_VNEM[jv]][jt0:,1,1] # only the center point of the 3x3 spatial domain! 
     124            xF[:,ja] = id_in.variables[L_VNEM[jv]][:,1,1] # only the center point of the 3x3 spatial domain! 
    141125            if ja == 0: cvar_lnm = id_in.variables[L_VNEM[jv]].long_name 
    142126            id_in.close() 
     
    180164                rmlt = 10.**(int(romagn)) / 2. 
    181165                yrng = math.copysign( math.ceil(abs(rmax)/rmlt)*rmlt , rmax) 
    182                 #print 'yrng = ', yrng ;  #sys.exit(0) 
    183166 
    184167                fig = plt.figure(num = 10+jv, figsize=size_fig, facecolor='w', edgecolor='k') 
     
    211194    for ja in range(nb_algos-1): 
    212195        id_in = Dataset(cf_in[ja]) 
    213         xF[:,ja]   = id_in.variables[L_VNEM[jv]][jt0:,1,1] # only the center point of the 3x3 spatial domain! 
     196        xF[:,ja]   = id_in.variables[L_VNEM[jv]][:,1,1] # only the center point of the 3x3 spatial domain! 
    214197        if ja == 0: cvar_lnm = id_in.variables[L_VNEM[jv]].long_name 
    215198        id_in.close() 
    216199        # 
    217200        id_in = Dataset(cf_in_ns[ja]) 
    218         xFns[:,ja] = id_in.variables[L_VNEM[jv]][jt0:,1,1] # only the center point of the 3x3 spatial domain! 
     201        xFns[:,ja] = id_in.variables[L_VNEM[jv]][:,1,1] # only the center point of the 3x3 spatial domain! 
    219202        if ja == 0: cvar_lnm = id_in.variables[L_VNEM[jv]].long_name 
    220203        id_in.close() 
     
    229212    rmlt = 10.**(int(romagn)) / 2. 
    230213    yrng = math.copysign( math.ceil(abs(rmax)/rmlt)*rmlt , rmax) 
    231     print 'yrng = ', yrng ;  #sys.exit(0) 
    232  
    233  
    234  
    235  
     214 
     215     
    236216    for ja in range(nb_algos-1): 
    237217 
Note: See TracChangeset for help on using the changeset viewer.