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 13843 – NEMO

Changeset 13843


Ignore:
Timestamp:
2020-11-20T16:00:36+01:00 (3 years ago)
Author:
laurent
Message:

Improving plots over ice in STATION_ASF...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/plot_station_asf_ICE.py

    r13835 r13843  
    2828rDPI=100. 
    2929 
    30 l_color = [ '0.85'    ,  '#ffed00' , '#008ab8' , '0.4'  ] ; # colors to differentiate algos on the plot 
    31 l_width = [  4        ,     3      ,    2      ,  1     ] ; # line-width to differentiate algos on the plot 
    32 l_style = [ '-'       ,    '-'     ,   '-'     , '--'   ] ; # line-style 
     30#ffed00: yellow ON 
     31#E8A727: ornage 
     32 
     33l_color = [ '0.3' , '#E8A727', '0.1'  , '#008ab8'  ] ; # colors to differentiate algos on the plot 
     34l_width = [   2   ,    2     ,  1.5   ,    2       ] ; # line-width to differentiate algos on the plot 
     35l_style = [  '-'  ,    '-'   , '--'   ,   '-'      ] ; # line-style 
    3336 
    3437 
     
    4346L_PREC = [     3     ,     3     ,      0     ,      0        ,      0      ,      0        ,     0       ,     2       ] 
    4447L_ANOM = [   False   ,   False   ,   True      ,    True       ,    True      ,    True     ,    True     ,   True      ] 
     48L_MAXT = [  10000.   ,     10000.,  10000.   ,  10000.      ,  10000.    ,  10000.      , 10000.     ,      1.5    ] 
     49L_MINT = [    0.001  ,     0.001 , -10000.   , -10000.      , -10000.    , -10000.      ,-10000.     ,   -10000.   ] 
     50 
    4551 
    4652# About STATION_ASF output files to read: 
     
    9298cf_in    = [] 
    9399list_exp = [] 
     100list_ext = [] ; # for title 
    94101list_frc = [] 
    95102for fn in ldir: 
     
    100107            clab = fn[np:-nc-ns] 
    101108            [ cexp, cfrc ] = str.split(clab, '_', 1) 
    102             print('  ===> Experiment = '+cexp+', Forcing = '+cfrc) 
     109            cexp = cexp.split('-')[1] ; # removing air-sea algo name... 
     110            cext = cexp 
     111            if   cexp == "LG15": 
     112                cext ="Lüpkes & Gryanik, 2015" 
     113            elif cexp == "LU12": 
     114                cext ="Lüpkes et al., 2012" 
     115            elif cexp == "AN05": 
     116                cext ="Andreas et al., 2005" 
     117            elif cexp == "CSTC": 
     118                cext ="Constant coefficients" 
     119            print('  ===> Experiment = '+cexp+' ('+cext+'), Forcing = '+cfrc) 
    103120            list_exp.append(cexp) 
     121            list_ext.append(cext) 
    104122            list_frc.append(cfrc) 
    105123            cf_in.append(fpn) 
    106124nbf = len( set(list_frc) ) 
     125 
     126 
    107127 
    108128if nbf == 0: 
     
    175195        # 
    176196        id_in = Dataset(cf_in[ja]) 
    177         xF[:,ja] = id_in.variables[L_VNEM[jv]][:,1,1] # only the center point of the 3x3 spatial domain! 
     197        xF[:,ja] = id_in.variables[L_VNEM[jv]][:,1,1]  ; # only the center point of the 3x3 spatial domain!         
    178198        if ja == 0: cvar_lnm = id_in.variables[L_VNEM[jv]].long_name 
    179199        id_in.close() 
     200        # 
     201        id_toolarge, = nmp.where( xF[:,ja] > L_MAXT[jv] ) #  
     202        xF[id_toolarge,ja] = L_MAXT[jv] 
     203        id_toosmall, = nmp.where( xF[:,ja] < L_MINT[jv] ) ; print("id_toosmall =", id_toosmall) 
     204        xF[id_toosmall,ja] = L_MINT[jv] 
    180205 
    181206    idx_okay = nmp.where( nmp.abs(xF) < 1.e+10 ) 
     
    191216        fplot = nmp.ma.masked_where( xF[:,ja]==0., xF[:,ja] ) 
    192217        plt.plot(vtime, fplot, '-', color=l_color[ja], \ 
    193                  linestyle=l_style[ja], linewidth=l_width[ja], label=list_exp[ja], zorder=10+ja) 
     218                 linestyle=l_style[ja], linewidth=l_width[ja], label=list_ext[ja], alpha=0.6 ) #zorder=10+ja) 
    194219 
    195220    fmin, fmax = round_bounds( nmp.min(xF[idx_okay]) , nmp.max(xF[idx_okay]), base=L_BASE[jv], prec=L_PREC[jv]) 
Note: See TracChangeset for help on using the changeset viewer.