source: branches/ORCHIDEE_EXT/ORCHIDEE_OL/TESTSTOMATE/COMP/sechiba.driver @ 263

Last change on this file since 263 was 263, checked in by didier.solyga, 13 years ago

Update the jobs FORCESOIL,OOL_SEC, OOL_SEC_STO, SPINUP and TESTSTOMATE. They match now with the corresponding ones from the trunk

  • Property svn:executable set to *
File size: 3.7 KB
Line 
1#!/bin/ksh
2
3#D- Driver du script pour SECHIBA
4
5function SECHIBA_sed
6{
7    IGCM_debug_PushStack "SECHIBA_sed"
8   
9    sed -e "s/^${1}\ *=.*/${1}= ${2}/" \
10        sechiba.def > sechiba.def.tmp
11    RET=$?
12    echo "SECHIBA_sed : ${1} ${2}"
13    \mv sechiba.def.tmp sechiba.def
14   
15    IGCM_debug_PopStack "SECHIBA_sed"
16    return $RET
17}
18
19function DRIVER_sed
20{
21    IGCM_debug_PushStack "DRIVER_sed"
22   
23    sed -e "s/^${1}\ *=.*/${1}= ${2}/" \
24        driver.def > driver.def.tmp
25    RET=$?
26    echo "DRIVER_sed : ${1} ${2}"
27    \mv driver.def.tmp driver.def
28   
29    IGCM_debug_PopStack "DRIVER_sed"
30    return $RET
31}
32
33#-----------------------------------------------------------------
34function SRF_Initialize
35{
36    IGCM_debug_PushStack "SRF_Initialize"
37
38    echo "ORCHIDEE Tag : " ${config_UserChoices_TagName}
39
40    RESOL_SRF=ALL
41   
42    for frequency in ${config_SRF_WriteFrequency} ; do
43        case ${frequency} in
44            HF|hf) SRF_ok_hf=y ;;
45        esac
46    done
47
48    if [ X${sechiba_UserChoices_LAND_USE} = Xy ] ; then
49      sed -e 's&#List=\(.*\)PFTmap\(.*\)year_p1\(.*\)&List=\1PFTmap\2year_p1\3&' ${SUBMIT_DIR}/COMP/sechiba.card > sechiba.card.tmp
50      IGCM_sys_Mv sechiba.card.tmp ${SUBMIT_DIR}/COMP/sechiba.card
51    fi
52
53    if [ X${sechiba_UserChoices_IMPOSE_VEG} = Xy ] ; then
54      sed -e 's&\(List.*=\)*\([[:space:]]*(*\).*PFTmap.*\${year}.*.nc,.*)&\1\2)&' ${SUBMIT_DIR}/COMP/sechiba.card > sechiba.card.tmp
55      IGCM_sys_Mv sechiba.card.tmp ${SUBMIT_DIR}/COMP/sechiba.card
56    fi
57
58    IGCM_debug_PopStack "SRF_Initialize"
59}
60
61#-----------------------------------------------------------------
62# Optionnal function executed at the beginning of the main loop,
63# after IGCM_config_PeriodStart see libIGCM/AA_job.
64# It may be used to set special variables used in forward lists
65function SRF_PeriodStart
66{
67    IGCM_debug_PushStack "SRF_PeriodStart"
68    IGCM_debug_PopStack "SRF_PeriodStart"
69}
70
71#-----------------------------------------------------------------
72function SRF_Update
73{
74    IGCM_debug_PushStack "SRF_Update"
75
76    SECHIBA_sed LAND_USE ${sechiba_UserChoices_LAND_USE}
77    if [ X${sechiba_UserChoices_LAND_USE} = Xy ] ; then
78
79      ##MM : cutting PFTmaps of ORCHIDEE : for first year without restart, we must use this year map
80      ##     WARNING : the next year map must be avaible and the december month, then this device will
81      ##               only work with PeriodLength scrictly less than 1Y.
82      # If you want to come back to old BIG LAND USE file
83      # (to run on multipple years, just one time with LAND USE activated),
84      # you must
85      # comment all next 8 lines and check correct parameters in sechiba.def file
86      # for your LAND USE specific file.
87        SECHIBA_sed VEGET_REINIT y
88        if ( [ ${CumulPeriod} -eq 1 ] && [ "${config_SRF_Restart}" = "n" ] ) ; then
89            SECHIBA_sed VEGET_YEAR 1
90            IGCM_sys_Mv PFTmap_IPCC_${year}.nc PFTmap.nc
91        else
92            SECHIBA_sed VEGET_YEAR 0
93            IGCM_sys_Mv -f PFTmap_IPCC_${year_p1}.nc PFTmap.nc
94        fi
95    fi
96
97    SECHIBA_sed IMPOSE_VEG ${sechiba_UserChoices_IMPOSE_VEG}
98   
99    if ( [ ${CumulPeriod} -eq 1 ] && [ "${config_SRF_Restart}" = "n" ] ) ; then
100        echo "Error in teststomate !"
101        echo "You must use some old restarts with this job." 
102        echo "We will stop here."
103        IGCM_debug_Exit "YOU MUST USE SOME OLD RESTARTS WITH THE JOB TESTSTOMATE." 
104        IGCM_debug_Verif_Exit
105    else
106        SECHIBA_sed SECHIBA_restart_in sechiba_rest_in.nc
107    fi
108
109    DRIVER_sed TIME_LENGTH ${PeriodLengthInDays}D
110#    DRIVER_sed TIME_SKIP ${OldSimulationLengthInDays}D
111
112    IGCM_debug_PopStack "SRF_Update"
113}
114
115#-----------------------------------------------------------------
116function SRF_Finalize
117{
118    IGCM_debug_PushStack "SRF_Finalize"
119
120    echo FINALIZE SRF !!!
121
122    IGCM_debug_PopStack "SRF_Finalize"
123}
Note: See TracBrowser for help on using the repository browser.