source: CONFIG/trunk/LMDZORINCA/EXP00/COMP/lmdz.driver @ 345

Last change on this file since 345 was 345, checked in by acosce, 16 years ago

Update LMDZORINCA config

File size: 3.0 KB
Line 
1#!/bin/ksh
2
3#-----------------------------------------------------------------
4function ATM_Initialize
5{
6    IGCM_debug_PushStack "ATM_Initialize"
7
8    RESOL_ATM=${RESOL}
9
10    ##- Create_etat0_limit version
11    IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/COMP/lmdz.card UserChoices CREATE
12    CREATE=${lmdz_UserChoices_CREATE}
13    echo create_etat0_limit version : ${CREATE}
14
15    ##--Frequency purpose ....
16    ##--  Initialisation  ....
17    OK_instan=n
18    ##--
19    OK_journe=n
20    OK_mensuel=y
21
22    case ${config_UserChoices_PeriodLength} in
23        1Y|1y|1M|1m) OK_mensuel=y ;;
24        5D|5d|1D|1d) OK_journe=n ;;
25    esac
26
27    for frequency in ${config_ATM_WriteFrequency} ; do
28        case ${frequency} in
29            5D|5d|1D|1d) OK_journe=n ;;
30        esac
31    done
32
33    ##--Variables used by LMDZ --
34    PAT_INST=$(     grep 'OK_instan'   ${SUBMIT_DIR}/PARAM/physiq.def )
35    PAT_JOUR=$(     grep 'OK_journe'   ${SUBMIT_DIR}/PARAM/physiq.def )
36    PAT_MOIS=$(     grep 'OK_mensuel'  ${SUBMIT_DIR}/PARAM/physiq.def )
37
38    PAT_iphysiq=$(  grep 'iphysiq'     ${SUBMIT_DIR}/PARAM/gcm.def_${RESOL} )
39    PAT_iperiod=$(  grep 'iperiod'     ${SUBMIT_DIR}/PARAM/gcm.def_${RESOL} | tail -1)
40    PAT_day_step=$( grep 'day_step'    ${SUBMIT_DIR}/PARAM/gcm.def_${RESOL} )
41    PAT_ecritphy=$( grep 'ecritphy'    ${SUBMIT_DIR}/PARAM/gcm.def_${RESOL} )
42
43    ##-- This could be define in lmdz.card, inside section [UserChoices]
44    ##-- Otherwise we get the value in *.def
45    iperiod=$(grep iperiod ${SUBMIT_DIR}/PARAM/gcm.def_${RESOL} | awk -F= '{print $2}' | tail -1)
46    iphysiq=$(grep iphysiq ${SUBMIT_DIR}/PARAM/gcm.def_${RESOL} | awk -F= '{print $2}')
47    # day_step : number of steps per day (multiple of iperiod)
48    (( day_step = 48 * iphysiq ))
49
50    IGCM_debug_PopStack "ATM_Initialize"
51}
52
53#-----------------------------------------------------------------
54function ATM_Update
55{
56    IGCM_debug_PushStack "ATM_Update"
57
58    ecritphy=${PeriodLengthInDays}
59
60    ##-- Remise ou non a zero de la date initiale de LMDZ pour le fichier run.def
61    if [ ${CumulPeriod} -eq 1 ] ; then
62        RAZ_DATE=1
63    else
64        RAZ_DATE=0
65    fi
66
67    ## Mise en forme du fichier physiq.def
68    sed -e "s/OK_instan=.*/OK_instan=${OK_instan}/"   \
69        -e "s/OK_journe=.*/OK_journe=${OK_journe}/"   \
70        -e "s/OK_mensuel=.*/OK_mensuel=${OK_mensuel}/" \
71        physiq.def > physiq.def.tmp
72    IGCM_sys_Mv physiq.def.tmp physiq.def
73
74    ## Mise en forme du fichier gcm.def
75    sed  -e "s/${PAT_ecritphy}/ecritphy=${ecritphy}/" \
76        -e "s/${PAT_day_step}/day_step=${day_step}/" \
77        -e "s/${PAT_iperiod}/iperiod=${iperiod}/" \
78        -e "s/${PAT_iphysiq}/iphysiq=${iphysiq}/" \
79        gcm.def > gcm.def.tmp
80    IGCM_sys_Mv gcm.def.tmp gcm.def
81
82    ## Mise en forme du fichier run.def
83    sed -e "s/_dayref_/${InitDay}/" \
84        -e "s/_anneeref_/${InitYear}/" \
85        -e "s/_nday_/${PeriodLengthInDays}/" \
86        -e "s/_raz_date_/${RAZ_DATE}/" \
87        run.def > run.def.tmp
88    IGCM_sys_Mv run.def.tmp run.def
89
90
91    IGCM_debug_PopStack "ATM_Update"
92}
93
94#-----------------------------------
95function ATM_Finalize
96{
97    IGCM_debug_PushStack "ATM_Finalize"
98
99    echo FINALIZE ATM !
100
101    IGCM_debug_PopStack "ATM_Finalize"
102}
Note: See TracBrowser for help on using the repository browser.