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

Changeset 13719


Ignore:
Timestamp:
2020-11-03T12:02:23+01:00 (3 years ago)
Author:
laurent
Message:

Keep up with trunk r13718 + figure generation for STATION_ASF (ocean & ice).

Location:
NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice
Files:
18 edited
1 moved

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/ABL/ablmod.F90

    r13655 r13719  
    1919   USE sbc_oce, ONLY  : ght_abl, ghw_abl, e3t_abl, e3w_abl, jpka, jpkam1, rhoa 
    2020   USE sbcblk         ! use rn_efac, cdn_oce 
    21    USE sbc_phy        ! use some physical constants for flux computation 
     21   USE sbc_phy        ! Catalog of functions for physical/meteorological parameters in the marine boundary layer 
    2222   ! 
    2323   USE prtctl         ! Print control                    (prt_ctl routine) 
     
    252252                  &                     + rDt_abl * fft_abl(ji, jj) * v_abl( ji, jj, jk, nt_n ) )  & 
    253253                  &                               / (1._wp + gamma_Cor*gamma_Cor*zcff) 
    254     
     254 
    255255               v_abl( ji, jj, jk, nt_a ) =  e3t_abl(jk) *(                                         & 
    256256                  &        (1._wp-gamma_Cor*(1._wp-gamma_Cor)*zcff) * v_abl( ji, jj, jk, nt_n )    & 
     
    590590 
    591591      DO_2D( 0, 1, 0, 1 ) 
    592          zwnd_i(ji,jj) = u_abl(ji  ,jj,2,nt_a) - 0.5_wp * ( pssu(ji  ,jj) + pssu(ji-1,jj) )   
    593          zwnd_j(ji,jj) = v_abl(ji,jj  ,2,nt_a) - 0.5_wp * ( pssv(ji,jj  ) + pssv(ji,jj-1) )  
     592         zwnd_i(ji,jj) = u_abl(ji  ,jj,2,nt_a) - 0.5_wp * ( pssu(ji  ,jj) + pssu(ji-1,jj) ) 
     593         zwnd_j(ji,jj) = v_abl(ji,jj  ,2,nt_a) - 0.5_wp * ( pssv(ji,jj  ) + pssv(ji,jj-1) ) 
    594594      END_2D 
    595595      ! 
     
    633633      !    Wind stress relative to the moving ice ( U10m - U_ice )   ! 
    634634      ! ------------------------------------------------------------ ! 
    635       DO_2D( 0, 0, 0, 0 )            
     635      DO_2D( 0, 0, 0, 0 ) 
    636636         ptaui_ice(ji,jj) = 0.5_wp * ( rhoa(ji+1,jj) * pCd_du_ice(ji+1,jj) + rhoa(ji,jj) * pCd_du_ice(ji,jj)      )   & 
    637637            &                      * ( 0.5_wp * ( u_abl(ji+1,jj,2,nt_a) + u_abl(ji,jj,2,nt_a) ) - pssu_ice(ji,jj) ) 
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/ABL/sbcabl.F90

    r13655 r13719  
    2222   USE sbc_oce        ! Surface boundary condition: ocean fields 
    2323   USE sbcblk         ! Surface boundary condition: bulk formulae 
    24    USE sbc_phy        ! Surface boundary condition: bulk formulae 
     24   USE sbc_phy        ! Catalog of functions for physical/meteorological parameters in the marine boundary layer 
    2525   USE dom_oce, ONLY  : tmask 
    2626   ! 
     
    175175         IF(nn_amxl==0) WRITE(numout,*) 'Deardorff 80 length-scale ' 
    176176         IF(nn_amxl==1) WRITE(numout,*) 'Modified Deardorff 80 length-scale ' 
    177          IF(nn_amxl==2) WRITE(numout,*) 'Bougeault and Lacarrere length-scale '       
    178          IF(nn_amxl==3) WRITE(numout,*) 'Rodier et al. length-scale '    
     177         IF(nn_amxl==2) WRITE(numout,*) 'Bougeault and Lacarrere length-scale ' 
     178         IF(nn_amxl==3) WRITE(numout,*) 'Rodier et al. length-scale ' 
    179179         WRITE(numout,*) ' Minimum value of atmospheric TKE           = ',tke_min,' m^2 s^-2' 
    180180         WRITE(numout,*) ' Minimum value of atmospheric mixing length = ',mxl_min,' m' 
     
    356356         !! 3 - Advance ABL variables from now (n) to after (n+1) 
    357357         !!------------------------------------------------------------------------------------------- 
    358     
     358 
    359359         CALL abl_stp( kt, tsk_m, ssu_m, ssv_m, zssq,                          &   !   <<= in 
    360360            &              sf(jp_wndi)%fnow(:,:,:), sf(jp_wndj)%fnow(:,:,:),   &   !   <<= in 
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/ICE/icesbc.F90

    r13655 r13719  
    7171      ! 
    7272      SELECT CASE( ksbc ) 
    73          ! 
    74       CASE( jp_usr     ) 
    75          CALL usrdef_sbc_ice_tau( kt )                 ! user defined formulation 
    76          ! 
     73         CASE( jp_usr     )   ;    CALL usrdef_sbc_ice_tau( kt )                 ! user defined formulation 
    7774      CASE( jp_blk     ) 
    7875         CALL blk_ice_1( sf(jp_wndi)%fnow(:,:,1), sf(jp_wndj)%fnow(:,:,1),   & 
     
    8077            &                                      sf(jp_slp )%fnow(:,:,1), u_ice, v_ice, tm_su    ,   &   ! inputs 
    8178            &                                      putaui = utau_ice, pvtaui = vtau_ice            )       ! outputs 
    82          !        CASE( jp_abl     )    utau_ice & vtau_ice are computed in ablmod 
    83       CASE( jp_purecpl ) 
    84          CALL sbc_cpl_ice_tau( utau_ice , vtau_ice )   ! Coupled      formulation 
     79 !        CASE( jp_abl     )    utau_ice & vtau_ice are computed in ablmod 
     80         CASE( jp_purecpl )   ;    CALL sbc_cpl_ice_tau( utau_ice , vtau_ice )   ! Coupled      formulation 
    8581      END SELECT 
    8682      ! 
    8783      IF( ln_mixcpl) THEN                                                        ! Case of a mixed Bulk/Coupled formulation 
    88          CALL sbc_cpl_ice_tau( zutau_ice , zvtau_ice ) 
     84                                   CALL sbc_cpl_ice_tau( zutau_ice , zvtau_ice ) 
    8985         DO_2D( 0, 0, 0, 0 ) 
    90          utau_ice(ji,jj) = utau_ice(ji,jj) * xcplmask(ji,jj,0) + zutau_ice(ji,jj) * ( 1. - xcplmask(ji,jj,0) ) 
    91          vtau_ice(ji,jj) = vtau_ice(ji,jj) * xcplmask(ji,jj,0) + zvtau_ice(ji,jj) * ( 1. - xcplmask(ji,jj,0) ) 
     86            utau_ice(ji,jj) = utau_ice(ji,jj) * xcplmask(ji,jj,0) + zutau_ice(ji,jj) * ( 1. - xcplmask(ji,jj,0) ) 
     87            vtau_ice(ji,jj) = vtau_ice(ji,jj) * xcplmask(ji,jj,0) + zvtau_ice(ji,jj) * ( 1. - xcplmask(ji,jj,0) ) 
    9288         END_2D 
    9389         CALL lbc_lnk_multi( 'icesbc', utau_ice, 'U', -1.0_wp, vtau_ice, 'V', -1.0_wp ) 
     
    143139      ! 
    144140      SELECT CASE( ksbc )   !== fluxes over sea ice ==! 
    145          ! 
     141      ! 
    146142      CASE( jp_usr )              !--- user defined formulation 
    147          CALL usrdef_sbc_ice_flx( kt, h_s, h_i ) 
    148          ! 
     143                                  CALL usrdef_sbc_ice_flx( kt, h_s, h_i ) 
    149144      CASE( jp_blk, jp_abl )  !--- bulk formulation & ABL formulation 
    150          CALL blk_ice_2    ( t_su, h_s, h_i, alb_ice, & 
    151             &                theta_air_zt(:,:), q_air_zt(:,:),    &   ! #LB: known from "sbc_oce" module... 
    152             &                sf(jp_slp)%fnow(:,:,1), sf(jp_qlw)%fnow(:,:,1), & 
    153             &                sf(jp_prec)%fnow(:,:,1), sf(jp_snow)%fnow(:,:,1) ) 
    154          ! 
     145                                  CALL blk_ice_2    ( t_su, h_s, h_i, alb_ice, & 
     146            &                                         theta_air_zt(:,:), q_air_zt(:,:),    &   ! #LB: known from "sbc_oce" module... 
     147            &                                         sf(jp_slp)%fnow(:,:,1), sf(jp_qlw)%fnow(:,:,1), & 
     148            &                                         sf(jp_prec)%fnow(:,:,1), sf(jp_snow)%fnow(:,:,1) ) 
    155149         IF( ln_mixcpl        )   CALL sbc_cpl_ice_flx( picefr=at_i_b, palbi=alb_ice, psst=sst_m, pist=t_su, phs=h_s, phi=h_i ) 
    156150         IF( nn_flxdist /= -1 )   CALL ice_flx_dist   ( t_su, alb_ice, qns_ice, qsr_ice, dqns_ice, evap_ice, devap_ice, nn_flxdist ) 
     
    159153            &                     CALL blk_ice_qcn    ( ln_virtual_itd, t_su, t_bo, h_s, h_i ) 
    160154      CASE ( jp_purecpl )         !--- coupled formulation 
    161          CALL sbc_cpl_ice_flx( picefr=at_i_b, palbi=alb_ice, psst=sst_m, pist=t_su, phs=h_s, phi=h_i ) 
     155                                  CALL sbc_cpl_ice_flx( picefr=at_i_b, palbi=alb_ice, psst=sst_m, pist=t_su, phs=h_s, phi=h_i ) 
    162156         IF( nn_flxdist /= -1 )   CALL ice_flx_dist   ( t_su, alb_ice, qns_ice, qsr_ice, dqns_ice, evap_ice, devap_ice, nn_flxdist ) 
    163157      END SELECT 
     
    228222      !!---------------------------------------------------------------------- 
    229223      ! 
    230       WHERE ( at_i (:,:) > 0._wp ) 
    231          z1_at_i(:,:) = 1._wp / at_i (:,:) 
    232       ELSEWHERE 
    233          z1_at_i(:,:) = 0._wp 
     224      WHERE ( at_i (:,:) > 0._wp )   ; z1_at_i(:,:) = 1._wp / at_i (:,:) 
     225      ELSEWHERE                      ; z1_at_i(:,:) = 0._wp 
    234226      END WHERE 
    235227 
    236228      SELECT CASE( k_flxdist )       !==  averaged on all ice categories  ==! 
    237          ! 
     229      ! 
    238230      CASE( 0 , 1 ) 
    239231         ! 
     
    258250      ! 
    259251      SELECT CASE( k_flxdist )       !==  redistribution on all ice categories  ==! 
    260          ! 
     252      ! 
    261253      CASE( 1 , 2 ) 
    262254         ! 
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/ICE/icetab.F90

    r10069 r13719  
    1717   USE par_oce 
    1818   USE ice, ONLY : jpl 
    19     
     19 
    2020   IMPLICIT NONE 
    2121   PRIVATE 
     
    4040      INTEGER , DIMENSION(ndim1d)     , INTENT(in   ) ::   tab_ind  ! input index 
    4141      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(in   ) ::   tab2d    ! input 2D field 
    42       REAL(wp), DIMENSION(ndim1d,jpl) , INTENT(  out) ::   tab1d    ! output 1D field 
     42      REAL(wp), DIMENSION(ndim1d,jpl) , INTENT(inout) ::   tab1d    ! output 1D field 
    4343      ! 
    4444      INTEGER ::   jl, jn, jid, jjd 
     
    6161      INTEGER , DIMENSION(ndim1d) , INTENT(in   ) ::   tab_ind  ! input index 
    6262      REAL(wp), DIMENSION(jpi,jpj), INTENT(in   ) ::   tab2d    ! input 2D field 
    63       REAL(wp), DIMENSION(ndim1d) , INTENT(  out) ::   tab1d    ! output 1D field 
     63      REAL(wp), DIMENSION(ndim1d) , INTENT(inout) ::   tab1d    ! output 1D field 
    6464      ! 
    6565      INTEGER ::   jn , jid, jjd 
     
    8080      INTEGER , DIMENSION(ndim1d)     , INTENT(in   ) ::   tab_ind   ! input index 
    8181      REAL(wp), DIMENSION(ndim1d,jpl) , INTENT(in   ) ::   tab1d     ! input 1D field 
    82       REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(  out) ::   tab2d     ! output 2D field 
     82      REAL(wp), DIMENSION(jpi,jpj,jpl), INTENT(inout) ::   tab2d     ! output 2D field 
    8383      ! 
    8484      INTEGER ::   jl, jn, jid, jjd 
     
    101101      INTEGER , DIMENSION(ndim1d) , INTENT(in   ) ::   tab_ind   ! input index 
    102102      REAL(wp), DIMENSION(ndim1d) , INTENT(in   ) ::   tab1d     ! input 1D field 
    103       REAL(wp), DIMENSION(jpi,jpj), INTENT(  out) ::   tab2d     ! output 2D field 
     103      REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) ::   tab2d     ! output 2D field 
    104104      ! 
    105105      INTEGER ::   jn , jid, jjd 
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbcblk.F90

    r13655 r13719  
    6262   USE prtctl         ! Print control 
    6363 
    64    USE sbc_phy        ! a catalog of functions for physical/meteorological parameters in the marine boundary layer, rho_air, q_sat, etc... 
     64   USE sbc_phy        ! Catalog of functions for physical/meteorological parameters in the marine boundary layer 
    6565 
    6666 
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbcblk_algo_andreas.F90

    r13655 r13719  
    3535   USE dom_oce         ! ocean space and time domain 
    3636   USE phycst          ! physical constants 
    37    USE sbc_phy         ! all thermodynamics functions, rho_air, q_sat, etc... !LB 
     37   USE sbc_phy         ! Catalog of functions for physical/meteorological parameters in the marine boundary layer 
    3838 
    3939   IMPLICIT NONE 
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbcblk_algo_coare3p0.F90

    r13655 r13719  
    3737 
    3838   USE sbc_oce         ! Surface boundary condition: ocean fields 
    39    USE sbc_phy         ! all thermodynamics functions, rho_air, q_sat, etc... !LB 
     39   USE sbc_phy         ! Catalog of functions for physical/meteorological parameters in the marine boundary layer 
    4040   USE sbcblk_skin_coare ! cool-skin/warm layer scheme (CSWL_ECMWF) !LB 
    4141 
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbcblk_algo_coare3p6.F90

    r13655 r13719  
    2727   USE lib_mpp,        ONLY: ctl_stop         ! distribued memory computing library 
    2828   USE in_out_manager, ONLY: nit000  ! I/O manager 
    29    USE sbc_phy         ! all thermodynamics functions, rho_air, q_sat, etc... !LB 
     29   USE sbc_phy         ! Catalog of functions for physical/meteorological parameters in the marine boundary layer 
    3030   USE sbcblk_skin_coare ! cool-skin/warm layer scheme (CSWL_ECMWF) !LB 
    3131 
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbcblk_algo_ecmwf.F90

    r13655 r13719  
    2828   USE lib_mpp,        ONLY: ctl_stop         ! distribued memory computing library 
    2929   USE in_out_manager, ONLY: nit000  ! I/O manager 
    30    USE sbc_phy         ! all thermodynamics functions, rho_air, q_sat, etc... !LB 
     30   USE sbc_phy         ! Catalog of functions for physical/meteorological parameters in the marine boundary layer 
    3131   USE sbcblk_skin_ecmwf ! cool-skin/warm layer scheme !LB 
    3232 
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbcblk_algo_ice_cdn.F90

    r13655 r13719  
    1515   USE par_oce, ONLY: jpi, jpj, Nis0, Nie0, Njs0, Nje0, nn_hls 
    1616   USE phycst          ! physical constants 
    17    USE sbc_phy         ! all thermodynamics functions, rho_air, q_sat, etc... !LB 
     17   USE sbc_phy         ! Catalog of functions for physical/meteorological parameters in the marine boundary layer 
    1818 
    1919   IMPLICIT NONE 
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbcblk_algo_ice_lg15.F90

    r13655 r13719  
    2323   USE par_oce,  ONLY: jpi, jpj 
    2424   USE phycst          ! physical constants 
    25    USE sbc_phy         ! all thermodynamics functions, rho_air, q_sat, etc... !LB 
     25   USE sbc_phy         ! Catalog of functions for physical/meteorological parameters in the marine boundary layer 
    2626   USE sbcblk_algo_ice_cdn 
    2727 
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbcblk_algo_ice_lu12.F90

    r13655 r13719  
    2222   USE par_oce,  ONLY: jpi, jpj 
    2323   USE phycst          ! physical constants 
    24    USE sbc_phy         ! all thermodynamics functions, rho_air, q_sat, etc... !LB 
     24   USE sbc_phy         ! Catalog of functions for physical/meteorological parameters in the marine boundary layer 
    2525   USE sbcblk_algo_ice_cdn 
    2626 
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbcblk_algo_ncar.F90

    r13655 r13719  
    2727   USE sbcwave, ONLY: cdn_wave ! wave module 
    2828   USE phycst          ! physical constants 
    29    USE sbc_phy         ! all thermodynamics functions, rho_air, q_sat, etc... !LB 
     29   USE sbc_phy         ! Catalog of functions for physical/meteorological parameters in the marine boundary layer 
    3030 
    3131   IMPLICIT NONE 
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbcblk_skin_coare.F90

    r13655 r13719  
    2020   USE sbc_oce         ! Surface boundary condition: ocean fields 
    2121 
    22    USE sbc_phy         ! misc. functions for marine ABL physics (rho_air, q_sat, bulk_formula, etc) 
     22   USE sbc_phy         ! Catalog of functions for physical/meteorological parameters in the marine boundary layer 
    2323 
    2424   USE sbcdcy          !#LB: to know hour of dawn and dusk: rdawn_dcy and rdusk_dcy (needed in WL_COARE) 
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/src/OCE/SBC/sbcblk_skin_ecmwf.F90

    r13655 r13719  
    3535   USE sbc_oce         ! Surface boundary condition: ocean fields 
    3636 
    37    USE sbc_phy         ! misc. functions for marine ABL physics (rho_air, q_sat, bulk_formula, etc) 
     37   USE sbc_phy         ! Catalog of functions for physical/meteorological parameters in the marine boundary layer 
    3838 
    3939   USE lib_mpp         ! distribued memory computing library 
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/launch_sasf.sh

    r13690 r13719  
    1515 
    1616# Atmo + SSX forcing to use and sea-ice support? 
    17 #     => NFORC: name of forcing 
     17#     => FORCING: name of forcing 
    1818#     => i_sea_ice: whether to compute fluxes over sea-ice as well 
    1919#     => 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 computation 
    22 NFORC="ERA5_arctic" ; i_sea_ice=0 ; SFORC="ERA5_arctic_surface_81N_36p75E_1h" ; # "ERA5_arctic" WITHOUT ice/air flux computation 
     20#FORCING="PAPA"         ; i_sea_ice=0 ; SFORC="Station_PAPA_50N-145W" 
     21FORCING="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 
    2323 
    2424 
     
    8181    LIST_OA_ALGOS="ECMWF" ;          # list of air-sea algorithms to test 
    8282    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... 
    8484else 
    8585    # Only OPEN-OCEAN/AIR flux computation 
    8686    LIST_OA_ALGOS="NCAR ECMWF COARE3p6 ANDREAS"; # list of air-sea algorithms to test 
    8787    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; fi 
     88    DIR_NL=${FORCING}/oce ; # where to fetch the namelists from... 
     89fi 
     90if [ ! -d ${DIR_NL} ]; then echo " Mhhh, seems like forcing ${FORCING} is not meant to be used with sea-ice/air flux computation !"; exit; fi 
    9191 
    9292 
     
    176176        echo ; echo 
    177177        echo "=======================================================================" 
    178         echo " Going for experiment: ${CASE} bulk param. with ${NFORC} forcing " 
     178        echo " Going for experiment: ${CASE} bulk param. with ${FORCING} forcing " 
    179179        echo "=======================================================================" 
    180180        echo 
     
    205205        # Moving output files: 
    206206        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/; fi 
     207        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 
    209209 
    210210        # Saving logs: 
    211         mkdir -p ${CASE}_${NFORC}_log 
    212         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/ 
    213213 
    214214        # Making 3x3 to 1 ! 
    215215        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'` 
    217217        for ff in ${list}; do 
    218218            echo 
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/plot_station_asf_ICE.py

    r13718 r13719  
    1010import sys 
    1111from os import path as path 
    12 import math 
     12import argparse as ap 
     13from math import floor, ceil, copysign, log 
    1314import numpy as nmp 
    1415from netCDF4 import Dataset,num2date 
     
    1819import matplotlib.dates as mdates 
    1920 
    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 year 
    28 cy2     = '2018' ; # Last year 
    29  
    30 jt0 = 0 
    31  
    3221dir_figs='.' 
    33 size_fig=(13,8) 
     22size_fig=(13,8.5) 
    3423size_fig0=(12,10) 
    35 fig_ext='png' 
    3624 
    3725clr_red = '#AD0000' 
    38 clr_sat = '#ffed00' 
    3926clr_mod = '#008ab8' 
    4027 
    4128rDPI=100. 
    4229 
    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  
     30L_ALGOS = [ 'ECMWF-CSTC', 'ECMWF-LG15', 'ECMWF-LU12' ] 
     31l_color = [     '0.4'   ,  '#ffed00'  , '#008ab8'    ] ; # colors to differentiate algos on the plot 
     32l_width = [       3     ,     3       ,      2       ] ; # line-width to differentiate algos on the plot 
     33l_style = [      '--'   ,    '-'      ,     '-'      ] ; # line-style 
     34 
     35nb_algos = len(L_ALGOS) ; print(nb_algos) 
    5436 
    5537# Variables to compare between algorithms 
     
    5941L_VARL = [ r'$C_{D}$', r'$C_{E}$', r'$Q_{lat}$', r'$Q_{sens}$' , r'$Q_{net}$' , r'$Q_{lw}$' , r'$Q_{sw}$' , r'$|\tau|$' ] 
    6042L_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.       ] 
     43L_BASE = [    0.0005 ,    0.0005 ,      5.     ,     5.        ,     5.       ,    5.       ,     5.      ,    0.05     ] 
     44L_PREC = [     3     ,     3     ,      0     ,      0        ,      0      ,      0        ,     0       ,     2       ] 
    6345L_ANOM = [   False   ,   False   ,   True      ,    True       ,    True      ,    True     ,    True     ,   True      ] 
    6446 
    6547 
    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 ################################################################################################ 
     50parser = ap.ArgumentParser(description='Generate pixel maps of a given scalar.') 
     51# 
     52requiredNamed = parser.add_argument_group('required arguments') 
     53requiredNamed.add_argument('-d', '--dirout' , required=True,                 help='Path to (production) directory where STATION_ASF was run') 
     54requiredNamed.add_argument('-f', '--forcing', required=True, default="PAPA", help='Name of forcing (ex: PAPA, ERA5_arctic') 
     55# 
     56parser.add_argument('-C', '--conf',   default="STATION_ASF",  help='specify NEMO config (ex: STATION_ASF)') 
     57parser.add_argument('-s', '--ystart', default="2018",         help='specify first year of experiment (ex: 2018)') 
     58parser.add_argument('-e', '--yend',   default="2018",         help='specify last  year of experiment (ex: 2018)') 
     59# 
     60parser.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# 
     64args = parser.parse_args() 
     65# 
     66cdir_data = args.dirout 
     67cforcing  = args.forcing 
     68# 
     69CONF      = args.conf 
     70cy1       = args.ystart 
     71cy2       = args.yend 
     72# 
     73fig_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############################################################################################################################################### 
    7380 
    7481 
     
    8390cf_in = [] 
    8491for 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' 
    8693    chck4f(cfi) 
    8794    cf_in.append(cfi) 
     
    9097#----------------------------------------------------------------- 
    9198 
     99 
     100def 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 
    92106# Getting time array from the first file: 
    93107id_in = Dataset(cf_in[0]) 
    94 vt = id_in.variables['time_counter'][jt0:] 
     108vt = id_in.variables['time_counter'][:] 
    95109cunit_t = id_in.variables['time_counter'].units ; print(' "time_counter" is in "'+cunit_t+'"') 
    96110id_in.close() 
    97111Nt = len(vt) 
    98112 
    99 vtime = num2date(vt, units=cunit_t) ; # something understandable! 
     113vtime = num2date(vt, units=cunit_t) ; # something human! 
    100114vtime = vtime.astype(dtype='datetime64[D]') 
    101115 
     
    131145        # 
    132146        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! 
    134148        if ja == 0: cvar_lnm = id_in.variables[L_VNEM[jv]].long_name 
    135149        id_in.close() 
    136150 
     151    idx_okay = nmp.where( nmp.abs(xF) < 1.e+10 ) 
     152 
    137153    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    138154    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]) 
    140156    ax1.set_xticks(vtime[::xticks_d]) 
    141157    ax1.xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d %H:%M:%S')) 
     
    143159 
    144160    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]) 
    148167    plt.ylabel(L_VARL[jv]+' ['+L_VUNT[jv]+']') 
    149168 
    150169    ax1.grid(color='k', linestyle='-', linewidth=0.3) 
    151170    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) 
    154175    plt.close(jv) 
    155176    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     177 
     178 
     179 
    156180 
    157181    def symetric_range( pmin, pmax ): 
     
    164188        return frng 
    165189 
    166      
    167190 
    168191    if L_ANOM[jv]: 
     
    180203            #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    181204            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]) 
    183206            ax1.set_xticks(vtime[::xticks_d]) 
    184207            ax1.xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d %H:%M:%S')) 
     
    186209 
    187210            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) 
    189214 
    190215            ax1.set_ylim(-yrng,yrng) ; ax1.set_xlim(vtime[0],vtime[Nt-1]) 
     
    192217            ax1.grid(color='k', linestyle='-', linewidth=0.3) 
    193218            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) 
    195222            plt.savefig(L_VARO[jv]+'_anomaly.'+fig_ext, dpi=int(rDPI), transparent=False) 
    196223            plt.close(10+jv) 
    197224            #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    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  
    3333l_style = [ '-'       ,    '-'     ,   '-'     , '--'   ] ; # line-style 
    3434 
     35nb_algos = len(L_ALGOS) ; print(nb_algos) 
    3536 
    3637# Variables to compare between algorithms 
    3738############################################ 
    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  
     39L_VNEM = [   'Cd_oce'  ,   'Ce_oce'  ,   'qla_oce' , 'qsb_oce'     ,     'qt_oce' ,   'qlw_oce' ,  'taum'     ,    'dt_skin'         ] 
     40L_VARO = [     'Cd'    ,     'Ce'    ,   'Qlat'    ,    'Qsen'     ,     'Qnet'   ,   'Qlw'     ,  'Tau'      ,    'dT_skin'         ] ; # name of variable on figure 
     41L_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 
     42L_VUNT = [     ''      ,     ''      , r'$W/m^2$'  , r'$W/m^2$'    , r'$W/m^2$'   , r'$W/m^2$'  , r'$N/m^2$'  ,      'K'             ] 
     43L_BASE = [    0.005    ,    0.005    ,      5.     ,      5.       ,       5      ,      5.     ,    0.05      ,       0.05           ] 
     44L_PREC = [      3      ,      3      ,      0      ,      0        ,       0      ,      0      ,     2       ,        3             ] 
     45L_ANOM = [   False     ,   False     ,   True      ,    True       ,    True      ,    True     ,   True      ,      False           ] 
    4946 
    5047 
     
    9188    if not path.exists(cf): print(cmesg) ; sys.exit(0) 
    9289 
    93 ###cf_in = nmp.empty((), dtype="S10") 
    9490cf_in = [] 
    9591for ja in range(nb_algos): 
     
    108104 
    109105 
    110  
    111106# Getting time array from the first file: 
    112107id_in = Dataset(cf_in[0]) 
     
    114109cunit_t = id_in.variables['time_counter'].units ; print(' "time_counter" is in "'+cunit_t+'"') 
    115110id_in.close() 
    116 nbr = len(vt) 
    117  
    118 vtime = num2date(vt, units=cunit_t) ; # something understandable!                                                                  
     111Nt = len(vt) 
     112 
     113vtime = num2date(vt, units=cunit_t) ; # something human! 
    119114vtime = vtime.astype(dtype='datetime64[D]') 
    120115 
    121 ii=nbr/300 
     116ii=Nt/300 
    122117ib=max(ii-ii%10,1) 
    123118xticks_d=int(30*ib) 
    124  
    125119 
    126120rat = 100./float(rDPI) 
     
    140134 
    141135 
    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: 
    143137 
    144138# t_skin 
     
    150144ntemp = len(vtemp_in) 
    151145 
    152 xxx = nmp.zeros((nbr,ntemp)) 
     146xxx = nmp.zeros((Nt,ntemp)) 
    153147 
    154148for ja in range(nb_algos): 
     
    171165    idx_okay = nmp.where( nmp.abs(xxx) < 1.e+10 ) 
    172166    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]) 
    174168    plt.ylabel(r'Temperature [$^{\circ}$C]') 
    175169 
     
    189183nb_var = len(L_VNEM) 
    190184 
    191 xF  = nmp.zeros((nbr,nb_algos)) 
    192 xFa = nmp.zeros((nbr,nb_algos)) 
     185xF  = nmp.zeros((Nt,nb_algos)) 
     186xFa = nmp.zeros((Nt,nb_algos)) 
    193187 
    194188 
     
    204198 
    205199    idx_okay = nmp.where( nmp.abs(xF) < 1.e+10 ) 
    206          
     200 
     201    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    207202    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]) 
    209204    ax1.set_xticks(vtime[::xticks_d]) 
    210205    ax1.xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d %H:%M:%S')) 
     
    212207 
    213208    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 
    216213    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]) 
    220215    plt.ylabel(L_VARL[jv]+' ['+L_VUNT[jv]+']') 
    221216 
    222217    ax1.grid(color='k', linestyle='-', linewidth=0.3) 
    223218    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}, \ 
    225221                 zorder=50, **font_inf) 
    226222    plt.savefig(L_VARO[jv]+'_'+cforcing+'.'+fig_ext, dpi=int(rDPI), transparent=False) 
    227223    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 
    228238 
    229239    if L_ANOM[jv]: 
     
    231241        for ja in range(nb_algos): xFa[:,ja] = xF[:,ja] - nmp.mean(xF,axis=1) 
    232242 
    233         if nmp.sum(xFa[:,:]) == 0.0: 
     243        if nmp.sum(nmp.abs(xFa[:,:])) == 0.0: 
    234244            print('     Well! Seems that for variable '+L_VARO[jv]+', choice of algo has no impact a all!') 
    235245            print('          ==> skipping anomaly plot...') 
     
    237247        else: 
    238248 
    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            #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    246252            fig = plt.figure(num = 10+jv, figsize=size_fig, facecolor='w', edgecolor='k') 
    247             ax1 = plt.axes([0.08, 0.25, 0.9, 0.7]) 
     253            ax1 = plt.axes([0.09, 0.25, 0.9, 0.7]) 
    248254            ax1.set_xticks(vtime[::xticks_d]) 
    249255            ax1.xaxis.set_major_formatter(mdates.DateFormatter('%Y-%m-%d %H:%M:%S')) 
     
    253259                plt.plot(vtime, xFa[:,ja], '-', color=l_color[ja], linewidth=l_width[ja], label=L_ALGOS[ja], zorder=10+ja) 
    254260 
    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]) 
    256262            plt.ylabel(L_VARL[jv]+' ['+L_VUNT[jv]+']') 
    257263            ax1.grid(color='k', linestyle='-', linewidth=0.3) 
     
    260266            plt.savefig(L_VARO[jv]+'_'+cforcing+'.'+fig_ext, dpi=int(rDPI), transparent=False) 
    261267            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  
    2525 
    2626# Atmo + SSX forcing to use and sea-ice support? 
    27 NFORC="IDEALIZED" ; i_sea_ice=0 ; SFORC="input_output_VALIDATION_IDEALIZED.nc" 
     27FORCING="IDEALIZED" ; i_sea_ice=0 ; SFORC="input_output_VALIDATION_IDEALIZED.nc" 
    2828 
    2929 
     
    8686 
    8787 
    88 DIR_NL=${NFORC}/oce ; # directory where to find the namelists... 
     88DIR_NL=${FORCING}/oce ; # directory where to find the namelists... 
    8989 
    9090# NEMO executable to use is: 
     
    162162        echo ; echo 
    163163        echo "=======================================================================" 
    164         echo " Going for experiment: ${CASE} bulk param. with ${NFORC} forcing " 
     164        echo " Going for experiment: ${CASE} bulk param. with ${FORCING} forcing " 
    165165        echo "=======================================================================" 
    166166        echo 
     
    187187        # Moving output files: 
    188188        mkdir -p output 
    189         mv -f ${CONFIG}-${CASE}_${NFORC}_*_grid*.nc output/ 
     189        mv -f ${CONFIG}-${CASE}_${FORCING}_*_grid*.nc output/ 
    190190 
    191191        # Saving logs: 
    192         mkdir -p ${CASE}_${NFORC}_log 
    193         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/ 
    194194 
    195195done 
Note: See TracChangeset for help on using the changeset viewer.