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.
launch_sasf.sh in NEMO/trunk/tests/STATION_ASF/EXPREF – NEMO

source: NEMO/trunk/tests/STATION_ASF/EXPREF/launch_sasf.sh @ 13373

Last change on this file since 13373 was 13264, checked in by laurent, 4 years ago

Slight improvements in STATION_ASF test-case

  • Property svn:executable set to *
File size: 3.3 KB
RevLine 
[11930]1#!/bin/bash
2
[13264]3################################################################
4#
5# Script to launch a set of STATION_ASF simulations
6#
7# L. Brodeau, 2020
8#
9################################################################
[11930]10
[13264]11# What directory inside "tests" actually contains the compiled "nemo.exe" for STATION_ASF ?
[12615]12TC_DIR="STATION_ASF2"
13
[13264]14expdir=`basename ${PWD}`; # we expect "EXPREF" or "EXP00" normally...
[13214]15
[13264]16# NEMOGCM root directory:
17NEMO_ROOT_DIR=`pwd | sed -e "s|/tests/STATION_ASF/${expdir}||g"`
[13214]18
[13264]19# NEMOGCM root directory where to fetch compiled STATION_ASF nemo.exe:
20SASF_WRK_DIR="${NEMO_ROOT_DIR}/tests/${TC_DIR}"
[11930]21
[13226]22# Directory where to run the simulation:
23PROD_DIR="${HOME}/tmp/STATION_ASF"
24
25
26####### End of normal user configurable section #######
27
28#================================================================================
29
[13264]30SASF_REF_DIR="${NEMO_ROOT_DIR}/tests/STATION_ASF"
31if [ ! -d ${SASF_REF_DIR} ]; then echo " Mhhh, no EXPREF directory ${SASF_REF_DIR} !"; exit; fi
32
[13226]33# NEMO executable to use is:
[13264]34NEMO_EXE="${SASF_WRK_DIR}/BLD/bin/nemo.exe"
35if [ ! -f ${NEMO_EXE} ]; then echo " Mhhh, no compiled 'nemo.exe' found into `dirname ${NEMO_EXE}` !"; exit; fi
[13226]36
[13264]37DATA_IN_DIR="${SASF_REF_DIR}/input_data" ; # Directory containing sea-surface + atmospheric input data
38if [ ! -d ${DATA_IN_DIR} ]; then echo "PROBLEM!!! => did not find directory 'input_data' with input forcing..."; exit; fi
[13226]39
[13264]40SASF_EXPREF=${SASF_REF_DIR}/${expdir}  ; # STATION_ASF EXPREF directory from which to use namelists and XIOS xml files...
41if [ ! -d ${SASF_EXPREF} ]; then echo " Mhhh, no ${expdir} directory ${SASF_EXPREF} !"; exit; fi
42
43
[13226]44echo "###########################################################"
45echo "#        S T A T I O N   A i r  -  S e a   F l u x        #"
46echo "###########################################################"
47echo
[13264]48echo "  * NEMO reference root directory is: ${NEMO_ROOT_DIR}"
49echo "  * STATION_ASF work directory is: ${SASF_WRK_DIR}"
50echo "       ==> NEMO EXE to use: ${NEMO_EXE}"
[13226]51echo
[13264]52echo "  * Input forcing data into: ${DATA_IN_DIR}"
53echo "  * Production will be done into: ${PROD_DIR}"
54echo "  * Directory in which namelists and xml files are fetched:"
55echo "       ==> ${SASF_EXPREF}"
56echo
[13226]57
58mkdir -p ${PROD_DIR}
59
60rsync -avP ${NEMO_EXE}          ${PROD_DIR}/
[11930]61
62for ff in "context_nemo.xml" "domain_def_nemo.xml" "field_def_nemo-oce.xml" "file_def_nemo-oce.xml" "grid_def_nemo.xml" "iodef.xml" "namelist_ref"; do
[13264]63    if [ ! -f ${SASF_EXPREF}/${ff} ]; then echo " Mhhh, ${ff} not found into ${SASF_EXPREF} !"; exit; fi
64    rsync -avPL ${SASF_EXPREF}/${ff} ${PROD_DIR}/
[11930]65done
66
67# Copy forcing to work directory:
[13226]68rsync -avP ${DATA_IN_DIR}/Station_PAPA_50N-145W*.nc ${PROD_DIR}/
[11930]69
[12615]70for CASE in "ECMWF" "COARE3p6" "NCAR" "ECMWF-noskin" "COARE3p6-noskin"; do
[11930]71
72    echo ; echo
73    echo "============================="
74    echo " Going for ${CASE} experiment"
75    echo "============================="
76    echo
77
78    scase=`echo "${CASE}" | tr '[:upper:]' '[:lower:]'`
79
[13226]80    rm -f ${PROD_DIR}/namelist_cfg
[13264]81    rsync -avPL ${SASF_EXPREF}/namelist_${scase}_cfg ${PROD_DIR}/namelist_cfg
[11930]82
[13226]83    cd ${PROD_DIR}/
[11930]84    echo
85    echo "Launching NEMO !"
[12615]86    ./nemo.exe 1>out_nemo.out 2>err_nemo.err
[11930]87    echo "Done!"
88    echo
89
90    # Moving output files:
91    mkdir -p output
92    mv -f STATION_ASF-${CASE}_*_grid*.nc output/
93   
94    # Saving logs:
95    mkdir -p ${CASE}_log
96    mv -f *.out *.err ocean.output output.namelist.dyn ${CASE}_log/
97
98done
Note: See TracBrowser for help on using the repository browser.