source: CONFIG/trunk/LMDZINCA_v2/EXP_AER/COMP/lmdz.driver @ 184

Last change on this file since 184 was 184, checked in by acosce, 17 years ago

ACo : take into account resolution for asking the compilation

ex : CH4xLMD9671 in place of CH4
change AA_make and all the card

  • Property svn:keywords set to Id
File size: 2.9 KB
Line 
1#- $Id$
2#!/bin/ksh
3
4# MPI Variables
5ATM_PARA=0
6
7#-----------------------------------------------------------------
8function ATM_Initialize
9{
10    IGCM_debug_PushStack "ATM_Initialize"
11
12    RESOL_ATM=$( echo $RESOL | awk "-Fx" '{print $2}' )
13
14
15    ##--Frequency purpose ....
16    ##--  Initialisation  ....
17    OK_instan=n
18    ##--
19    OK_journe=n
20    OK_mensuel=n
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 )
39    PAT_iperiod=$(  grep 'iperiod'     ${SUBMIT_DIR}/PARAM/gcm.def | tail -1)
40    PAT_day_step=$( grep 'day_step'    ${SUBMIT_DIR}/PARAM/gcm.def )
41    PAT_ecritphy=$( grep 'ecritphy'    ${SUBMIT_DIR}/PARAM/gcm.def )
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 | awk -F= '{print $2}' | tail -1)
46    iphysiq=$(grep iphysiq ${SUBMIT_DIR}/PARAM/gcm.def | 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    set -ex
57    IGCM_debug_PushStack "ATM_Update"
58
59    ecritphy=${PeriodLengthInDays}
60
61    ##-- Remise ou non a zero de la date initiale de LMDZ pour le fichier run.def
62    if [ ${CumulPeriod} -eq 1 ] ; then
63        RAZ_DATE=1
64    else
65        RAZ_DATE=0
66    fi
67
68    ## Mise en forme du fichier physiq.def
69    sed -e "s/OK_instan=.*/OK_instan=${OK_instan}/"   \
70        -e "s/OK_journe=.*/OK_journe=${OK_journe}/"   \
71        -e "s/OK_mensuel=.*/OK_mensuel=${OK_mensuel}/" \
72        physiq.def > physiq.def.tmp
73    IGCM_sys_Mv physiq.def.tmp physiq.def
74
75    ## Mise en forme du fichier gcm.def
76    sed  -e "s/${PAT_ecritphy}/ecritphy=${ecritphy}/" \
77        -e "s/${PAT_day_step}/day_step=${day_step}/" \
78        -e "s/${PAT_iperiod}/iperiod=${iperiod}/" \
79        -e "s/${PAT_iphysiq}/iphysiq=${iphysiq}/" \
80        gcm.def > gcm.def.tmp
81    IGCM_sys_Mv gcm.def.tmp gcm.def
82
83    ## Mise en forme du fichier run.def
84    sed -e "s/_dayref_/${InitDay}/" \
85        -e "s/_anneeref_/${InitYear}/" \
86        -e "s/_nday_/${PeriodLengthInDays}/" \
87        -e "s/_raz_date_/${RAZ_DATE}/" \
88        run.def > run.def.tmp
89    IGCM_sys_Mv run.def.tmp run.def
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.