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

Changeset 13682


Ignore:
Timestamp:
2020-10-27T17:12:39+01:00 (3 years ago)
Author:
laurent
Message:

Still improving the oce+ice capable STATION_ASF...

Location:
NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF
Files:
1 added
6 deleted
4 edited

Legend:

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

    r13676 r13682  
    1717import math 
    1818import numpy as nmp 
    19 from netCDF4 import Dataset,num2date 
    20 import matplotlib as mpl 
    21 mpl.use('Agg') 
    22 import matplotlib.pyplot as plt 
    23 import matplotlib.dates as mdates 
     19from netCDF4 import Dataset 
    2420 
    2521l_t_shift = False  ; # because time interp. is set to FALSE into "&namsbc_blk" of NEMO... 
     
    5955if narg==4: 
    6056    l_more = ( sys.argv[3] in ['m','M'] ) 
     57    import matplotlib as mpl 
     58    mpl.use('Agg') 
     59    import matplotlib.pyplot as plt 
     60 
    6161 
    6262 
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/launch_sasf.sh

    r13676 r13682  
    1515 
    1616# Root directory NEMOGCM reference depository where to fetch compiled STATION_ASF nemo.exe + default namelists: 
    17 NEMO_REF_DIR="/home/laurent/DEV/NEMO/NEMOGCM_dev_r13648_ASINTER-04_laurent_bulk_ice" 
     17NEMO_REF_DIR="`dirname ${PWD} | sed -e 's|/tests/STATION_ASF||g'`" ; # that should normally do the trick! 
    1818 
    1919# NEMOGCM root directory where to fetch compiled STATION_ASF nemo.exe: 
     
    3232i_sea_ice=0 ; # default does not compute fluxes over sea-ice 
    3333# 
    34 #NFORC="ERA5_arctic" ; i_sea_ice=1 ; FORC="ERA5_arctic_surface_81N_36p75E_1h" ; # string sufficient to copy relevant files as in "*${FORC}*.nc" 
    35 NFORC="PAPA" ; FORC="Station_PAPA_50N-145W" ; # string sufficient to copy relevant files as in "*${FORC}*.nc" 
     34NFORC="ERA5_arctic" ; i_sea_ice=1 ; FORC="ERA5_arctic_surface_81N_36p75E_1h" ; # string sufficient to copy relevant files as in "*${FORC}*.nc" 
     35#NFORC="PAPA" ; FORC="Station_PAPA_50N-145W" ; # string sufficient to copy relevant files as in "*${FORC}*.nc" 
    3636 
    3737 
     
    5757i_si3=0 
    5858FCPP="${SASF_WRK_DIR}/cpp_${CONFIG_BLD}.fcm" 
    59 if [ ! -f ${FCPP} ]; then echo " Mhhh, we did not find 'cpp_STATION_ASF.fcm' into `dirname ${FCPP}` !"; exit; fi 
     59if [ ! -f ${FCPP} ]; then echo " Mhhh, we could not find 'cpp_STATION_ASF.fcm' into `dirname ${FCPP}` !"; exit; fi 
    6060ca=`cat ${FCPP} | grep 'key_si3'` 
    6161 
     
    7878    LIST_OA_ALGOS="ECMWF" ;          # list of air-sea algorithms to test 
    7979    LIST_IA_ALGOS="LG15 LU12 CSTC" ; # list of air-ice algorithms to test 
    80     DIR_NL=${NFORC}/ice ; # where to fetch the namelists from... 
     80    DIR_NL=${NFORC}/oce+ice ; # where to fetch the namelists from... 
    8181else 
    8282    # Only OPEN-OCEAN/AIR flux computation 
     
    9696 
    9797 
    98 if [ ! -d ${DATA_IN_DIR} ]; then echo "PROBLEM!!! => did not find directory 'input_data' with input forcing..."; exit; fi 
     98CFGS_SHARED="${NEMO_REF_DIR}/cfgs/SHARED" 
     99if [ ! -d ${CFGS_SHARED} ]; then echo "PROBLEM!!! => could not find directory ${CFGS_SHARED} !"; exit; fi 
     100 
     101if [ ! -d ${DATA_IN_DIR} ]; then echo "PROBLEM!!! => could not find directory 'input_data' with input forcing..."; exit; fi 
    99102 
    100103cdt_cmpl="`\ls -l ${NEMO_EXE} | cut -d' ' -f 6,7,8`" 
     
    125128################ 
    126129 
    127 list_xml="iodef.xml file_def_nemo-oce.xml field_def_nemo-oce.xml" 
     130list_xml_ref="field_def_nemo-oce.xml domain_def_nemo.xml grid_def_nemo.xml" 
     131list_xml_cfg="iodef.xml file_def_nemo-oce.xml" 
    128132fcntxt="context_nemo_OCE.xml" 
    129133if [ ${i_sea_ice} -eq 1 ]; then 
    130     list_xml+=" file_def_nemo-ice.xml field_def_nemo-ice.xml" 
     134    list_xml_ref+=" field_def_nemo-ice.xml" 
     135    list_xml_cfg+=" file_def_nemo-ice.xml" 
    131136    fcntxt="context_nemo_OCE+ICE.xml" 
    132137fi 
     
    137142 
    138143# All remaining "*.xml" files: 
    139 for ff in ${list_xml} ; do 
     144for ff in ${list_xml_cfg} ; do 
    140145    if [ ! -f ${SASF_EXPREF}/${ff} ]; then echo " Mhhh, ${ff} not found into ${SASF_EXPREF} !"; exit; fi 
    141146    rsync -avPL ${SASF_EXPREF}/${ff} ${PROD_DIR}/ 
    142147done 
    143  
    144  
    145 # Getting reference/defaults files from reference NEMO distro: 
    146 rdir="${NEMO_REF_DIR}/cfgs/SHARED" 
    147 for ff in "domain_def_nemo.xml" "grid_def_nemo.xml"; do 
    148     if [ ! -f ${rdir}/${ff} ]; then echo " Mhhh, ${ff} not found into ${rdir} !"; exit; fi 
    149     ln -sf ${rdir}/${ff} ${PROD_DIR}/. 
     148for ff in ${list_xml_ref} ; do 
     149    if [ ! -f ${CFGS_SHARED}/${ff} ]; then echo " Mhhh, ${ff} not found into ${CFGS_SHARED} !"; exit; fi 
     150    rsync -avPL ${CFGS_SHARED}/${ff} ${PROD_DIR}/ 
    150151done 
    151152 
     
    186187        # The namelists: 
    187188        rsync -avPL ${SASF_EXPREF}/${DIR_NL}/namelist_${scase}_cfg ${PROD_DIR}/namelist_cfg 
    188         rsync -avPL ${SASF_EXPREF}/namelist_ref                   ${PROD_DIR}/namelist_ref 
     189        rsync -avPL ${CFGS_SHARED}/namelist_ref                    ${PROD_DIR}/namelist_ref 
    189190        if [ ${i_sea_ice} -eq 1 ]; then 
    190             rsync -avPL ${SASF_EXPREF}/namelist_ice_ref ${PROD_DIR}/namelist_ice_ref 
    191191            rsync -avPL ${SASF_EXPREF}/namelist_ice_cfg ${PROD_DIR}/namelist_ice_cfg 
     192            rsync -avPL ${CFGS_SHARED}/namelist_ice_ref ${PROD_DIR}/namelist_ice_ref 
    192193        fi 
    193194         
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/EXPREF/sbcblk_sanity_check.sh

    r13676 r13682  
    2525 
    2626# Root directory NEMOGCM reference depository where to fetch compiled STATION_ASF nemo.exe + default namelists: 
    27 NEMO_REF_DIR="/home/laurent/DEV/NEMO/NEMOGCM_dev_r13648_ASINTER-04_laurent_bulk_ice" 
     27NEMO_REF_DIR="`dirname ${PWD} | sed -e 's|/tests/STATION_ASF||g'`" ; # that should normally do the trick! 
    2828 
    2929# NEMOGCM root directory where to fetch compiled STATION_ASF nemo.exe: 
     
    4141############################################################################################# 
    4242i_sea_ice=0 ; # default does not compute fluxes over sea-ice 
    43 NFORC="IDEALIZED" ; i_sea_ice=0 ; FORC="input_output_VALIDATION_IDEALIZED.nc" 
     43NFORC="IDEALIZED" ; i_sea_ice=0 ; FORC="input_output_VALIDATION_IDEALIZED.nc" ; # for now the sanity test does not test ice-atmo bulk parameterizations 
    4444 
    4545 
     
    4747 
    4848#================================================================================ 
     49 
     50# Should the `analyze_output.py` script provide more output ??? 
     51cmore="" 
     52if [ "$1" != "" ]; then 
     53    if [ "$1" = "more" ]; then 
     54        cmore="m" 
     55    else 
     56        echo "Only 'more' is accepted as argument for script `basename $0` !" 
     57        exit 
     58    fi 
     59fi 
     60 
     61 
    4962 
    5063rm -f SBCBLK.success SBCBLK.fail 
     
    191204 
    192205cd ${HERE} 
    193 python3 ./analyze_output.py ${DATA_IN_DIR}/${FORC} ${PROD_DIR}/output 
    194  
    195  
     206python3 ./analyze_output.py ${DATA_IN_DIR}/${FORC} ${PROD_DIR}/output ${cmore} 
     207 
     208 
  • NEMO/branches/2020/dev_r13648_ASINTER-04_laurent_bulk_ice/tests/STATION_ASF/README.md

    r13267 r13682  
    8080 
    8181 
     82## Testing the sanity of the SBCBLK (bulk atmospheric forcing) interface of NEMO 
     83 
     84`STATION_ASF` can be used to perform a sanity test of the SBCBLK interface of 
     85NEMO.  It will test all the bulk-parameterization algorithms using an idealized 
     86forcing that includes a wide range of *SSX / surface atmospheric state* 
     87conditions to detect potential error / inconsitencies.  Both a short report and 
     88boolean output: *passed* or *failed* is provided as an output. 
     89 
     90First compile the `STATION_ASF` test-case as follows (compile with xios-2.5 support → check your ARCH file): 
     91     
     92```./makenemo -a STATION_ASF -m <your_arch> -n STATION_ASF2 -j 4``` 
     93 
     94(successfull compilation generates ```tests/STATION_ASF2/BLD/bin/nemo.exe``` 
     95 
     96Move to: ```tests/STATION_ASF/EXPREF/``` 
     97 
     98There, in script ``sbcblk_sanity_check.sh``, double check that the variables given a value in the first lines are consistent with your setup (it should). 
     99 
     100Launch the script: 
     101 
     102    $ ./sbcblk_sanity_check.sh 
     103 
     104 
     105The report is both interactively shown in the standard output and spwaned in the report file: 
     106 
     107- `SBCBLK.success` the test passed :) 
     108- `SBCBLK.fail` the test failed :( 
     109 
     110In case of failure, read the rapport to know which algorithm/computed variables did not pass the test... You should also re-run the script ``sbcblk_sanity_check.sh`` with the "more" argument:  
     111 
     112    $ ./sbcblk_sanity_check.sh more 
     113 
     114 This will generate more output such as figure of time series for the tested variables. 
     115 
     116### Dependencies 
     117 
     118In order for the python script `analyze_output.py` to work, you need `Python 3` with the following modules: 
     119- numpy 
     120- netCDF4 
     121- (matplotlib) 
     122 
     123 
     124 
     125 
     126 
     127 
    82128## Playing with STATION_ASF 
    83129 
    84130First compile the test-case as follows (compile with xios-2.5 support → check your ARCH file): 
    85  
     131     
    86132```./makenemo -a STATION_ASF -m <your_arch> -n STATION_ASF2 -j 4``` 
    87133 
    88 Then you can use the script ``launch_sasf.sh`` found in  ```EXPREF/``` to launch 3 simulations (one for each bulk parameterization available). You need to adapt the following variable to your environment in the script: 
     134Move to: ```tests/STATION_ASF/EXPREF/``` 
     135 
     136 
     137 
     138 
     139to launch 3 simulations (one for each bulk parameterization available). You need to adapt the following variable to your environment in the script: 
    89140 
    90141- ```NEMO_ROOT_DIR``` : NEMO root directory where to fetch compiled STATION_ASF ```nemo.exe``` + setup (such as ```${NEMO_ROOT_DIR}/tests/STATION_ASF```) 
Note: See TracChangeset for help on using the changeset viewer.