source: CONFIG/IPSLCM/IPSLCM5/trunk/EXP00/COMP/oasis.driver @ 483

Last change on this file since 483 was 483, checked in by aclsce, 14 years ago
  • Added possibility to choose "nemo" as parameter in physiq.def
  • Added possibility to have coupling variables in output files (output_mode=y/n) in oasis.card
File size: 1.9 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    IGCM_sys_build_run_file ${LIBMPI}
15
16    IGCM_debug_PopStack "CPL_Initialize"
17
18}
19
20#-----------------------------------
21CPL_Update ()
22{
23    IGCM_debug_PushStack "CPL_Update"
24
25############ Update Time and Counters ##############
26##-- Calcul de la duree du job (en secondes)
27(( D_JOB_SEC = 3600 * 24 * PeriodLengthInDays ))
28
29############ Update Other Parameters  ##############
30## Read Output_mode option in ${compname}.card --> Put "y" to have coupling variables in ouptut files
31IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/COMP/${compname}.card UserChoices Output_mode
32eval Output_mode=\${${compname}_UserChoices_Output_mode} > /dev/null 2>&1
33echo ${Output_mode}
34Output_var='EXPORTED'
35if [ ${Output_mode} = y ] ; then
36    Output_var='EXPOUT'
37fi
38
39############ Update Parameter Files   ##############
40sed -e "s/<initial_date>/${PeriodDateBegin}/" \
41    -e "s/<total_time>/${D_JOB_SEC}/" \
42    -e "s/<lib_mpi>/${LIBMPI}/" \
43    -e "s/<nproc_atm>/${NUM_PROC_ATM}/g" \
44    -e "s/<nproc_oce>/${NUM_PROC_OCE}/g" \
45    -e "s/<output_mode>/${Output_var}/g" \
46        namcouple > namcouple.tmp
47
48    IGCM_sys_Mv namcouple.tmp namcouple
49    # Unused files we want to remove
50    eval FileToBeDeleted[${#FileToBeDeleted[@]}]=trace
51    eval FileToBeDeleted[${#FileToBeDeleted[@]}]=gweights
52    eval FileToBeDeleted[${#FileToBeDeleted[@]}]=mweights
53    eval FileToBeDeleted[${#FileToBeDeleted[@]}]=anaisout
54
55    IGCM_debug_PopStack "CPL_Update"
56}
57
58#-----------------------------------
59CPL_Finalize ()
60{
61    IGCM_debug_PushStack "CPL_Finalize"
62
63    DATE_OASIS=$(echo ${PeriodDateBegin} | sed -e "{ s/^\(.\{4\}\)/\1-/;s/\(-.\{2\}\)/\1-/; }");
64    DATE_OASIS=${DATE_OASIS}"T00:00:00"
65
66    echo FINALIZE CPL !!!
67
68    IGCM_debug_PopStack "CPL_Finalize"
69
70}
Note: See TracBrowser for help on using the repository browser.