- Timestamp:
- 2020-11-03T12:02:23+01:00 (4 years ago)
- Location:
- NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF
- Files:
-
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/launch_sasf.sh
r13690 r13719 15 15 16 16 # Atmo + SSX forcing to use and sea-ice support? 17 # => NFORC: name of forcing17 # => FORCING: name of forcing 18 18 # => i_sea_ice: whether to compute fluxes over sea-ice as well 19 19 # => SFORC: string sufficient to copy relevant files as in "*${SFORC}*.nc" 20 # NFORC="PAPA" ; i_sea_ice=0 ; SFORC="Station_PAPA_50N-145W"21 #NFORC="ERA5_arctic" ; i_sea_ice=1 ; SFORC="ERA5_arctic_surface_81N_36p75E_1h" ; # "ERA5_arctic" WITH ice/air flux computation22 NFORC="ERA5_arctic" ; i_sea_ice=0 ; SFORC="ERA5_arctic_surface_81N_36p75E_1h" ; # "ERA5_arctic" WITHOUT ice/air flux computation20 #FORCING="PAPA" ; i_sea_ice=0 ; SFORC="Station_PAPA_50N-145W" 21 FORCING="ERA5_arctic" ; i_sea_ice=1 ; SFORC="ERA5_arctic_surface_81N_36p75E_1h" ; # "ERA5_arctic" WITH ice/air flux computation 22 #FORCING="ERA5_arctic" ; i_sea_ice=0 ; SFORC="ERA5_arctic_surface_81N_36p75E_1h" ; # "ERA5_arctic" WITHOUT ice/air flux computation 23 23 24 24 … … 81 81 LIST_OA_ALGOS="ECMWF" ; # list of air-sea algorithms to test 82 82 LIST_IA_ALGOS="LG15 LU12 CSTC" ; # list of air-ice algorithms to test 83 DIR_NL=${ NFORC}/oce+ice ; # where to fetch the namelists from...83 DIR_NL=${FORCING}/oce+ice ; # where to fetch the namelists from... 84 84 else 85 85 # Only OPEN-OCEAN/AIR flux computation 86 86 LIST_OA_ALGOS="NCAR ECMWF COARE3p6 ANDREAS"; # list of air-sea algorithms to test 87 87 LIST_IA_ALGOS="" 88 DIR_NL=${ NFORC}/oce ; # where to fetch the namelists from...89 fi 90 if [ ! -d ${DIR_NL} ]; then echo " Mhhh, seems like forcing ${ NFORC} is not meant to be used with sea-ice/air flux computation !"; exit; fi88 DIR_NL=${FORCING}/oce ; # where to fetch the namelists from... 89 fi 90 if [ ! -d ${DIR_NL} ]; then echo " Mhhh, seems like forcing ${FORCING} is not meant to be used with sea-ice/air flux computation !"; exit; fi 91 91 92 92 … … 176 176 echo ; echo 177 177 echo "=======================================================================" 178 echo " Going for experiment: ${CASE} bulk param. with ${ NFORC} forcing "178 echo " Going for experiment: ${CASE} bulk param. with ${FORCING} forcing " 179 179 echo "=======================================================================" 180 180 echo … … 205 205 # Moving output files: 206 206 mkdir -p output 207 mv -f ${CONFIG}-${CASE}_${ NFORC}_*_grid*.nc output/208 if [ ${i_sea_ice} -eq 1 ]; then mv -f ${CONFIG}-${CASE}_${ NFORC}_*_icemod.nc output/; fi207 mv -f ${CONFIG}-${CASE}_${FORCING}_*_grid*.nc output/ 208 if [ ${i_sea_ice} -eq 1 ]; then mv -f ${CONFIG}-${CASE}_${FORCING}_*_icemod.nc output/; fi 209 209 210 210 # Saving logs: 211 mkdir -p ${CASE}_${ NFORC}_log212 mv -f *.out *.err ocean.output output.namelist.dyn ${CASE}_${ NFORC}_log/211 mkdir -p ${CASE}_${FORCING}_log 212 mv -f *.out *.err ocean.output output.namelist.dyn ${CASE}_${FORCING}_log/ 213 213 214 214 # Making 3x3 to 1 ! 215 215 cd output/ 216 list=`\ls ${CONFIG}*${CASE}_${ NFORC}_*.nc | grep -v '_restart_'| grep -v '_1p.nc'`216 list=`\ls ${CONFIG}*${CASE}_${FORCING}_*.nc | grep -v '_restart_'| grep -v '_1p.nc'` 217 217 for ff in ${list}; do 218 218 echo -
NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/plot_station_asf_ICE.py
r13718 r13719 10 10 import sys 11 11 from os import path as path 12 import math 12 import argparse as ap 13 from math import floor, ceil, copysign, log 13 14 import numpy as nmp 14 15 from netCDF4 import Dataset,num2date … … 18 19 import matplotlib.dates as mdates 19 20 20 CONFIG='STATION_ASF'21 22 cforcing = 'PAPA' ; # name of forcing ('PAPA', 'ERA5_arctic', etc...)23 24 # (files are: output/3x3/'+CONFIG+'-'+algo+'_1h_'+year+'0101_'+year+'1231_gridT_'+cforcing+'.nc' )25 cstation = 'ERA5 81N, 36.75E'26 27 cy1 = '2018' ; # First year28 cy2 = '2018' ; # Last year29 30 jt0 = 031 32 21 dir_figs='.' 33 size_fig=(13,8 )22 size_fig=(13,8.5) 34 23 size_fig0=(12,10) 35 fig_ext='png'36 24 37 25 clr_red = '#AD0000' 38 clr_sat = '#ffed00'39 26 clr_mod = '#008ab8' 40 27 41 28 rDPI=100. 42 29 43 L_ALGOS = [ 'ECMWF-LG15', 'ECMWF-LU12', 'ECMWF-CSTC' ] 44 l_color = [ '#ffed00' , '#008ab8' , '0.4' ] ; # colors to differentiate algos on the plot 45 l_width = [ 3 , 2 , 1 ] ; # line-width to differentiate algos on the plot 46 l_style = [ '-' , '-' , '--' ] ; # line-style 47 48 49 # Variables to compare for A GIVEN algorithm 50 ############################################### 51 #L_VNEM0 = [ 52 53 30 L_ALGOS = [ 'ECMWF-CSTC', 'ECMWF-LG15', 'ECMWF-LU12' ] 31 l_color = [ '0.4' , '#ffed00' , '#008ab8' ] ; # colors to differentiate algos on the plot 32 l_width = [ 3 , 3 , 2 ] ; # line-width to differentiate algos on the plot 33 l_style = [ '--' , '-' , '-' ] ; # line-style 34 35 nb_algos = len(L_ALGOS) ; print(nb_algos) 54 36 55 37 # Variables to compare between algorithms … … 59 41 L_VARL = [ r'$C_{D}$', r'$C_{E}$', r'$Q_{lat}$', r'$Q_{sens}$' , r'$Q_{net}$' , r'$Q_{lw}$' , r'$Q_{sw}$' , r'$|\tau|$' ] 60 42 L_VUNT = [ '' , '' , r'$W/m^2$' , r'$W/m^2$' , r'$W/m^2$' , r'$W/m^2$' , r'$W/m^2$' , r'$N/m^2$' ] 61 L_ VMAX = [ 0.003 , 0.003 , 75. , 75. , 800. , 200. , 200. , 1.2]62 L_ VMIN = [ 0. , 0. , -250. , -125. , -400. , -200. , 0. , 0.]43 L_BASE = [ 0.0005 , 0.0005 , 5. , 5. , 5. , 5. , 5. , 0.05 ] 44 L_PREC = [ 3 , 3 , 0 , 0 , 0 , 0 , 0 , 2 ] 63 45 L_ANOM = [ False , False , True , True , True , True , True , True ] 64 46 65 47 66 nb_algos = len(L_ALGOS) 67 68 # Getting arguments: 69 narg = len(sys.argv) 70 if narg != 2: 71 print('Usage: '+sys.argv[0]+' <DIR_OUT_SASF>'); sys.exit(0) 72 cdir_data = sys.argv[1] 48 49 ################## ARGUMENT PARSING / USAGE ################################################################################################ 50 parser = ap.ArgumentParser(description='Generate pixel maps of a given scalar.') 51 # 52 requiredNamed = parser.add_argument_group('required arguments') 53 requiredNamed.add_argument('-d', '--dirout' , required=True, help='Path to (production) directory where STATION_ASF was run') 54 requiredNamed.add_argument('-f', '--forcing', required=True, default="PAPA", help='Name of forcing (ex: PAPA, ERA5_arctic') 55 # 56 parser.add_argument('-C', '--conf', default="STATION_ASF", help='specify NEMO config (ex: STATION_ASF)') 57 parser.add_argument('-s', '--ystart', default="2018", help='specify first year of experiment (ex: 2018)') 58 parser.add_argument('-e', '--yend', default="2018", help='specify last year of experiment (ex: 2018)') 59 # 60 parser.add_argument('-t', '--itype', default="png", help='specify the type of image you want to create (ex: png, svg, etc.)') 61 #parser.add_argument('-l', '--lev' , type=int, default=0, help='specify the level to use if 3D field (default: 0 => 2D)') 62 #parser.add_argument('-I', '--ice' , action='store_true', help='draw sea-ice concentration layer onto the field') 63 # 64 args = parser.parse_args() 65 # 66 cdir_data = args.dirout 67 cforcing = args.forcing 68 # 69 CONF = args.conf 70 cy1 = args.ystart 71 cy2 = args.yend 72 # 73 fig_ext = args.itype 74 #jk = args.lev 75 #lshow_ice = args.ice 76 # 77 #print(''); print(' *** cdir_data = ', cdir_data); print(' *** cforcing = ', cforcing) 78 #print(' *** CONF = ', CONF); print(' *** cy1 = ', cy1); print(' *** cy2 = ', cy2) 79 ############################################################################################################################################### 73 80 74 81 … … 83 90 cf_in = [] 84 91 for ja in range(nb_algos): 85 cfi = cdir_data+'/output/ 3x3/'+CONFIG+'-'+L_ALGOS[ja]+'_1h_'+cy1+'0101_'+cy2+'1231_icemod_'+cforcing+'.nc'92 cfi = cdir_data+'/output/'+CONF+'-'+L_ALGOS[ja]+'_'+cforcing+'_1h_'+cy1+'0101_'+cy2+'1231_icemod.nc' 86 93 chck4f(cfi) 87 94 cf_in.append(cfi) … … 90 97 #----------------------------------------------------------------- 91 98 99 100 def round_bounds( x1, x2, base=5, prec=3 ): 101 rmin = base * round( floor(float(x1)/base), prec ) 102 rmax = base * round( ceil(float(x2)/base), prec ) 103 return rmin, rmax 104 105 92 106 # Getting time array from the first file: 93 107 id_in = Dataset(cf_in[0]) 94 vt = id_in.variables['time_counter'][ jt0:]108 vt = id_in.variables['time_counter'][:] 95 109 cunit_t = id_in.variables['time_counter'].units ; print(' "time_counter" is in "'+cunit_t+'"') 96 110 id_in.close() 97 111 Nt = len(vt) 98 112 99 vtime = num2date(vt, units=cunit_t) ; # something understandable!113 vtime = num2date(vt, units=cunit_t) ; # something human! 100 114 vtime = vtime.astype(dtype='datetime64[D]') 101 115 … … 131 145 # 132 146 id_in = Dataset(cf_in[ja]) 133 xF[:,ja] = id_in.variables[L_VNEM[jv]][ jt0:,1,1] # only the center point of the 3x3 spatial domain!147 xF[:,ja] = id_in.variables[L_VNEM[jv]][:,1,1] # only the center point of the 3x3 spatial domain! 134 148 if ja == 0: cvar_lnm = id_in.variables[L_VNEM[jv]].long_name 135 149 id_in.close() 136 150 151 idx_okay = nmp.where( nmp.abs(xF) < 1.e+10 ) 152 137 153 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 138 154 fig = plt.figure(num = jv, figsize=size_fig, facecolor='w', edgecolor='k') 139 ax1 = plt.axes([0.08 , 0.25, 0.9, 0.7])155 ax1 = plt.axes([0.083, 0.23, 0.9, 0.7]) 140 156 ax1.set_xticks(vtime[::xticks_d]) 141 157 ax1.xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d %H:%M:%S')) … … 143 159 144 160 for ja in range(nb_algos): 145 plt.plot(vtime, xF[:,ja], '-', color=l_color[ja], linestyle=l_style[ja], linewidth=l_width[ja], label=L_ALGOS[ja], zorder=10+ja) 146 147 ax1.set_ylim(L_VMIN[jv], L_VMAX[jv]) ; ax1.set_xlim(vtime[0],vtime[Nt-1]) 161 fplot = nmp.ma.masked_where( xF[:,ja]==0., xF[:,ja] ) 162 plt.plot(vtime, fplot, '-', color=l_color[ja], \ 163 linestyle=l_style[ja], linewidth=l_width[ja], label=L_ALGOS[ja], zorder=10+ja) 164 165 fmin, fmax = round_bounds( nmp.min(xF[idx_okay]) , nmp.max(xF[idx_okay]), base=L_BASE[jv], prec=L_PREC[jv]) 166 ax1.set_ylim(fmin, fmax) ; ax1.set_xlim(vtime[0],vtime[Nt-1]) 148 167 plt.ylabel(L_VARL[jv]+' ['+L_VUNT[jv]+']') 149 168 150 169 ax1.grid(color='k', linestyle='-', linewidth=0.3) 151 170 plt.legend(loc='best', ncol=1, shadow=True, fancybox=True) 152 ax1.annotate(cvar_lnm+', station: '+cstation, xy=(0.3, 1.), xycoords='axes fraction', bbox={'facecolor':'w', 'alpha':1., 'pad':10}, zorder=50, **font_inf) 153 plt.savefig(L_VARO[jv]+'.'+fig_ext, dpi=int(rDPI), transparent=False) 171 ax1.annotate(cvar_lnm+', station: '+cforcing, xy=(0.5, 1.04), xycoords='axes fraction', \ 172 ha='center', bbox={'facecolor':'w', 'alpha':1., 'pad':10}, \ 173 zorder=50, **font_inf) 174 plt.savefig(L_VARO[jv]+'_'+cforcing+'.'+fig_ext, dpi=int(rDPI), transparent=False) 154 175 plt.close(jv) 155 176 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 177 178 179 156 180 157 181 def symetric_range( pmin, pmax ): … … 164 188 return frng 165 189 166 167 190 168 191 if L_ANOM[jv]: … … 180 203 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 181 204 fig = plt.figure(num = 10+jv, figsize=size_fig, facecolor='w', edgecolor='k') 182 ax1 = plt.axes([0.08 , 0.25, 0.9, 0.7])205 ax1 = plt.axes([0.083, 0.23, 0.9, 0.7]) 183 206 ax1.set_xticks(vtime[::xticks_d]) 184 207 ax1.xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d %H:%M:%S')) … … 186 209 187 210 for ja in range(nb_algos): 188 plt.plot(vtime, xFa[:,ja], '-', color=l_color[ja], linewidth=l_width[ja], label=L_ALGOS[ja], zorder=10+ja) 211 fplot = nmp.ma.masked_where( xF[:,ja]==0., xF[:,ja] ) 212 plt.plot(vtime, fplot, '-', color=l_color[ja], linewidth=l_width[ja], \ 213 label=L_ALGOS[ja], zorder=10+ja) 189 214 190 215 ax1.set_ylim(-yrng,yrng) ; ax1.set_xlim(vtime[0],vtime[Nt-1]) … … 192 217 ax1.grid(color='k', linestyle='-', linewidth=0.3) 193 218 plt.legend(bbox_to_anchor=(0.45, 0.2), ncol=1, shadow=True, fancybox=True) 194 ax1.annotate('Anomaly of '+cvar_lnm, xy=(0.3, 0.97), xycoords='axes fraction', bbox={'facecolor':'w', 'alpha':1., 'pad':10}, zorder=50, **font_inf) 219 ax1.annotate('Anomaly of '+cvar_lnm+', station: '+cforcing, xy=(0.5, 1.04), xycoords='axes fraction', \ 220 ha='center', bbox={'facecolor':'w', 'alpha':1., 'pad':10}, \ 221 zorder=50, **font_inf) 195 222 plt.savefig(L_VARO[jv]+'_anomaly.'+fig_ext, dpi=int(rDPI), transparent=False) 196 223 plt.close(10+jv) 197 224 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 198 199 200 201 -
NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/plot_station_asf_OCE.py
r13691 r13719 33 33 l_style = [ '-' , '-' , '-' , '--' ] ; # line-style 34 34 35 nb_algos = len(L_ALGOS) ; print(nb_algos) 35 36 36 37 # Variables to compare between algorithms 37 38 ############################################ 38 L_VNEM = [ 'Cd_oce' , 'Ce_oce' , 'qla_oce' , 'qsb_oce' , 'qt_oce' , 'qlw_oce' , 'taum' , 'dt_skin' ] 39 L_VARO = [ 'Cd' , 'Ce' , 'Qlat' , 'Qsen' , 'Qnet' , 'Qlw' , 'Tau' , 'dT_skin' ] ; # name of variable on figure 40 L_VARL = [ r'$C_{D}$' , r'$C_{E}$' , r'$Q_{lat}$', r'$Q_{sens}$' , r'$Q_{net}$' , r'$Q_{lw}$' , r'$|\tau|$' , r'$\Delta T_{skin}$' ] ; # name of variable in latex mode 41 L_VUNT = [ '' , '' , r'$W/m^2$' , r'$W/m^2$' , r'$W/m^2$' , r'$W/m^2$' , r'$N/m^2$' , 'K' ] 42 L_BASE = [ 0.005 , 0.005 , 5. , 5. , 5 , 5. , 0.05 , 0.05 ] 43 L_PREC = [ 3 , 3 , 0 , 0 , 0 , 0 , 2 , 3 ] 44 L_ANOM = [ False , False , True , True , True , True , True , False ] 45 46 47 nb_algos = len(L_ALGOS) ; print(nb_algos) 48 39 L_VNEM = [ 'Cd_oce' , 'Ce_oce' , 'qla_oce' , 'qsb_oce' , 'qt_oce' , 'qlw_oce' , 'taum' , 'dt_skin' ] 40 L_VARO = [ 'Cd' , 'Ce' , 'Qlat' , 'Qsen' , 'Qnet' , 'Qlw' , 'Tau' , 'dT_skin' ] ; # name of variable on figure 41 L_VARL = [ r'$C_{D}$' , r'$C_{E}$' , r'$Q_{lat}$', r'$Q_{sens}$' , r'$Q_{net}$' , r'$Q_{lw}$' , r'$|\tau|$' , r'$\Delta T_{skin}$' ] ; # name of variable in latex mode 42 L_VUNT = [ '' , '' , r'$W/m^2$' , r'$W/m^2$' , r'$W/m^2$' , r'$W/m^2$' , r'$N/m^2$' , 'K' ] 43 L_BASE = [ 0.005 , 0.005 , 5. , 5. , 5 , 5. , 0.05 , 0.05 ] 44 L_PREC = [ 3 , 3 , 0 , 0 , 0 , 0 , 2 , 3 ] 45 L_ANOM = [ False , False , True , True , True , True , True , False ] 49 46 50 47 … … 91 88 if not path.exists(cf): print(cmesg) ; sys.exit(0) 92 89 93 ###cf_in = nmp.empty((), dtype="S10")94 90 cf_in = [] 95 91 for ja in range(nb_algos): … … 108 104 109 105 110 111 106 # Getting time array from the first file: 112 107 id_in = Dataset(cf_in[0]) … … 114 109 cunit_t = id_in.variables['time_counter'].units ; print(' "time_counter" is in "'+cunit_t+'"') 115 110 id_in.close() 116 nbr= len(vt)117 118 vtime = num2date(vt, units=cunit_t) ; # something understandable!111 Nt = len(vt) 112 113 vtime = num2date(vt, units=cunit_t) ; # something human! 119 114 vtime = vtime.astype(dtype='datetime64[D]') 120 115 121 ii= nbr/300116 ii=Nt/300 122 117 ib=max(ii-ii%10,1) 123 118 xticks_d=int(30*ib) 124 125 119 126 120 rat = 100./float(rDPI) … … 140 134 141 135 142 # First for each algorithm we compare some input vs out put variables: 136 # First for each algorithm we compare some input vs out put variables: 143 137 144 138 # t_skin … … 150 144 ntemp = len(vtemp_in) 151 145 152 xxx = nmp.zeros(( nbr,ntemp))146 xxx = nmp.zeros((Nt,ntemp)) 153 147 154 148 for ja in range(nb_algos): … … 171 165 idx_okay = nmp.where( nmp.abs(xxx) < 1.e+10 ) 172 166 fmin, fmax = round_bounds( nmp.min(xxx[idx_okay]) , nmp.max(xxx[idx_okay]), base=5, prec=0 ) 173 ax1.set_ylim(fmin, fmax) ; ax1.set_xlim(vtime[0],vtime[ nbr-1])167 ax1.set_ylim(fmin, fmax) ; ax1.set_xlim(vtime[0],vtime[Nt-1]) 174 168 plt.ylabel(r'Temperature [$^{\circ}$C]') 175 169 … … 189 183 nb_var = len(L_VNEM) 190 184 191 xF = nmp.zeros(( nbr,nb_algos))192 xFa = nmp.zeros(( nbr,nb_algos))185 xF = nmp.zeros((Nt,nb_algos)) 186 xFa = nmp.zeros((Nt,nb_algos)) 193 187 194 188 … … 204 198 205 199 idx_okay = nmp.where( nmp.abs(xF) < 1.e+10 ) 206 200 201 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 207 202 fig = plt.figure(num = jv, figsize=size_fig, facecolor='w', edgecolor='k') 208 ax1 = plt.axes([0.08 , 0.23, 0.9, 0.7])203 ax1 = plt.axes([0.083, 0.23, 0.9, 0.7]) 209 204 ax1.set_xticks(vtime[::xticks_d]) 210 205 ax1.xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d %H:%M:%S')) … … 212 207 213 208 for ja in range(nb_algos): 214 plt.plot(vtime, xF[:,ja], '-', color=l_color[ja], linestyle=l_style[ja], linewidth=l_width[ja], label=L_ALGOS[ja], zorder=10+ja) 215 209 fplot = nmp.ma.masked_where( xF[:,ja]==0., xF[:,ja] ) 210 plt.plot(vtime, fplot, '-', color=l_color[ja], \ 211 linestyle=l_style[ja], linewidth=l_width[ja], label=L_ALGOS[ja], zorder=10+ja) 212 216 213 fmin, fmax = round_bounds( nmp.min(xF[idx_okay]) , nmp.max(xF[idx_okay]), base=L_BASE[jv], prec=L_PREC[jv]) 217 #print("LOLO: fmin, fmax =",nmp.min(xF[idx_okay]), nmp.max(xF[idx_okay]) ); print("LOLO: fmin, fmax =",fmin, fmax) ; #sys.exit(0) 218 219 ax1.set_ylim(fmin, fmax) ; ax1.set_xlim(vtime[0],vtime[nbr-1]) 214 ax1.set_ylim(fmin, fmax) ; ax1.set_xlim(vtime[0],vtime[Nt-1]) 220 215 plt.ylabel(L_VARL[jv]+' ['+L_VUNT[jv]+']') 221 216 222 217 ax1.grid(color='k', linestyle='-', linewidth=0.3) 223 218 plt.legend(loc='best', ncol=1, shadow=True, fancybox=True) 224 ax1.annotate(cvar_lnm+', station: '+cforcing, xy=(0.5, 1.04), xycoords='axes fraction', ha='center', bbox={'facecolor':'w', 'alpha':1., 'pad':10}, \ 219 ax1.annotate(cvar_lnm+', station: '+cforcing, xy=(0.5, 1.04), xycoords='axes fraction', \ 220 ha='center', bbox={'facecolor':'w', 'alpha':1., 'pad':10}, \ 225 221 zorder=50, **font_inf) 226 222 plt.savefig(L_VARO[jv]+'_'+cforcing+'.'+fig_ext, dpi=int(rDPI), transparent=False) 227 223 plt.close(jv) 224 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 225 226 227 228 229 def symetric_range( pmin, pmax ): 230 # Returns a symetric f-range that makes sense for the anomaly of "f" we're looking at... 231 from math import floor, copysign, log, ceil 232 zmax = max( abs(pmax) , abs(pmin) ) 233 romagn = floor(log(zmax, 10)) ; # order of magnitude of the anomaly we're dealing with 234 rmlt = 10.**(int(romagn)) / 2. 235 frng = copysign( ceil(abs(zmax)/rmlt)*rmlt , zmax) 236 return frng 237 228 238 229 239 if L_ANOM[jv]: … … 231 241 for ja in range(nb_algos): xFa[:,ja] = xF[:,ja] - nmp.mean(xF,axis=1) 232 242 233 if nmp.sum( xFa[:,:]) == 0.0:243 if nmp.sum(nmp.abs(xFa[:,:])) == 0.0: 234 244 print(' Well! Seems that for variable '+L_VARO[jv]+', choice of algo has no impact a all!') 235 245 print(' ==> skipping anomaly plot...') … … 237 247 else: 238 248 239 # Want a symetric y-range that makes sense for the anomaly we're looking at: 240 rmax = nmp.max(xFa) ; rmin = nmp.min(xFa) 241 rmax = max( abs(rmax) , abs(rmin) ) 242 romagn = floor(log(rmax, 10)) ; # order of magnitude of the anomaly we're dealing with 243 rmlt = 10.**(int(romagn)) / 2. 244 yrng = copysign( ceil(abs(rmax)/rmlt)*rmlt , rmax) 245 249 yrng = symetric_range( nmp.min(xFa) , nmp.max(xFa) ) 250 251 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 246 252 fig = plt.figure(num = 10+jv, figsize=size_fig, facecolor='w', edgecolor='k') 247 ax1 = plt.axes([0.0 8, 0.25, 0.9, 0.7])253 ax1 = plt.axes([0.09, 0.25, 0.9, 0.7]) 248 254 ax1.set_xticks(vtime[::xticks_d]) 249 255 ax1.xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d %H:%M:%S')) … … 253 259 plt.plot(vtime, xFa[:,ja], '-', color=l_color[ja], linewidth=l_width[ja], label=L_ALGOS[ja], zorder=10+ja) 254 260 255 ax1.set_ylim(-yrng,yrng) ; ax1.set_xlim(vtime[0],vtime[ nbr-1])261 ax1.set_ylim(-yrng,yrng) ; ax1.set_xlim(vtime[0],vtime[Nt-1]) 256 262 plt.ylabel(L_VARL[jv]+' ['+L_VUNT[jv]+']') 257 263 ax1.grid(color='k', linestyle='-', linewidth=0.3) … … 260 266 plt.savefig(L_VARO[jv]+'_'+cforcing+'.'+fig_ext, dpi=int(rDPI), transparent=False) 261 267 plt.close(10+jv) 262 263 264 265 -
NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/sbcblk_sanity_check.sh
r13690 r13719 25 25 26 26 # Atmo + SSX forcing to use and sea-ice support? 27 NFORC="IDEALIZED" ; i_sea_ice=0 ; SFORC="input_output_VALIDATION_IDEALIZED.nc"27 FORCING="IDEALIZED" ; i_sea_ice=0 ; SFORC="input_output_VALIDATION_IDEALIZED.nc" 28 28 29 29 … … 86 86 87 87 88 DIR_NL=${ NFORC}/oce ; # directory where to find the namelists...88 DIR_NL=${FORCING}/oce ; # directory where to find the namelists... 89 89 90 90 # NEMO executable to use is: … … 162 162 echo ; echo 163 163 echo "=======================================================================" 164 echo " Going for experiment: ${CASE} bulk param. with ${ NFORC} forcing "164 echo " Going for experiment: ${CASE} bulk param. with ${FORCING} forcing " 165 165 echo "=======================================================================" 166 166 echo … … 187 187 # Moving output files: 188 188 mkdir -p output 189 mv -f ${CONFIG}-${CASE}_${ NFORC}_*_grid*.nc output/189 mv -f ${CONFIG}-${CASE}_${FORCING}_*_grid*.nc output/ 190 190 191 191 # Saving logs: 192 mkdir -p ${CASE}_${ NFORC}_log193 mv -f *.out *.err ocean.output output.namelist.dyn ${CASE}_${ NFORC}_log/192 mkdir -p ${CASE}_${FORCING}_log 193 mv -f *.out *.err ocean.output output.namelist.dyn ${CASE}_${FORCING}_log/ 194 194 195 195 done
Note: See TracChangeset
for help on using the changeset viewer.