source: CONFIG/IPSLCM/IPSLCM5/branches/IPSLCM5_WORK/EXP00/COMP/oasis.driver @ 649

Last change on this file since 649 was 648, checked in by mafoipsl, 15 years ago

SD : add MPISUSPEND=ON in oasis driver

File size: 2.0 KB
Line 
1#!/bin/ksh
2#-----------------------------------
3CPL_Initialize ()
4{
5
6    IGCM_debug_PushStack "CPL_Initialize"
7 
8    echo INITIALIZE CPL !!!
9
10#D- MPI context used to launch the coupled model
11LIBMPI=$(cat ${SUBMIT_DIR}/../.libmpi)
12echo LIBMPI=${LIBMPI}
13
14#D- MPISUSPEND=ON required for MPMD mode used by oasis
15    export MPISUSPEND=ON
16
17    IGCM_sys_build_run_file ${LIBMPI}
18
19    IGCM_debug_PopStack "CPL_Initialize"
20
21}
22
23#-----------------------------------
24CPL_Update ()
25{
26    IGCM_debug_PushStack "CPL_Update"
27
28############ Update Time and Counters ##############
29##-- Calcul de la duree du job (en secondes)
30(( D_JOB_SEC = 3600 * 24 * PeriodLengthInDays ))
31
32############ Update Other Parameters  ##############
33## Read Output_mode option in ${compname}.card --> Put "y" to have coupling variables in ouptut files
34IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/COMP/${compname}.card UserChoices Output_mode
35eval Output_mode=\${${compname}_UserChoices_Output_mode} > /dev/null 2>&1
36echo ${Output_mode}
37Output_var='EXPORTED'
38if [ ${Output_mode} = y ] ; then
39    Output_var='EXPOUT'
40fi
41
42############ Update Parameter Files   ##############
43sed -e "s/<initial_date>/${PeriodDateBegin}/" \
44    -e "s/<total_time>/${D_JOB_SEC}/" \
45    -e "s/<lib_mpi>/${LIBMPI}/" \
46    -e "s/<nproc_atm>/${NUM_PROC_ATM}/g" \
47    -e "s/<nproc_oce>/${NUM_PROC_OCE}/g" \
48    -e "s/<output_mode>/${Output_var}/g" \
49        namcouple > namcouple.tmp
50
51    IGCM_sys_Mv namcouple.tmp namcouple
52    # Unused files we want to remove
53    eval FileToBeDeleted[${#FileToBeDeleted[@]}]=trace
54    eval FileToBeDeleted[${#FileToBeDeleted[@]}]=gweights
55    eval FileToBeDeleted[${#FileToBeDeleted[@]}]=mweights
56    eval FileToBeDeleted[${#FileToBeDeleted[@]}]=anaisout
57
58    IGCM_debug_PopStack "CPL_Update"
59}
60
61#-----------------------------------
62CPL_Finalize ()
63{
64    IGCM_debug_PushStack "CPL_Finalize"
65
66    DATE_OASIS=$(echo ${PeriodDateBegin} | sed -e "{ s/^\(.\{4\}\)/\1-/;s/\(-.\{2\}\)/\1-/; }");
67    DATE_OASIS=${DATE_OASIS}"T00:00:00"
68
69    echo FINALIZE CPL !!!
70
71    IGCM_debug_PopStack "CPL_Finalize"
72
73}
Note: See TracBrowser for help on using the repository browser.