source: CONFIG/LMDZORINCA/tags/LMDZORINCA_v1/CREATE/COMP/lmdz.driver @ 1329

Last change on this file since 1329 was 1329, checked in by acosce, 14 years ago

ACo : update ce0l for LMDZORINCA

  • Property svn:executable set to *
File size: 3.6 KB
Line 
1#!/bin/ksh
2#-----------------------------------------------------------------
3function LMDZ_sed
4{
5    IGCM_debug_PushStack "LMDZ_sed"
6
7    sed -e "s/^${2}\ *=.*/${2}= ${3}/" ${1} > ${1}.tmp
8    RET=$?
9    echo "LMDZ_sed : ${1} ${2} ${3}"
10    \mv ${1}.tmp ${1}
11
12    IGCM_debug_PopStack "LMDZ_sed"
13    return $RET
14}
15
16function ATM_Initialize
17{
18    IGCM_debug_PushStack "ATM_Initialize"
19
20    [ -f ${SUBMIT_DIR}/../.resol ] && eval $(grep RESOL_ATM_3D ${SUBMIT_DIR}/../.resol) || RESOL_ATM_3D=96x95x19
21
22    RESOL_ATM_Z=$( echo ${RESOL_ATM_3D} | awk "-Fx" '{print $3}' | awk "-F-" '{print $1}' )
23
24    ##-- Calendar type for LMDZ
25    case ${config_UserChoices_CalendarType} in
26        leap|gregorian)
27            CalendarTypeForLmdz=gregorian;;
28        noleap)
29            CalendarTypeForLmdz=earth_365d;;
30        360d)
31            CalendarTypeForLmdz=earth_360d;;
32        *)
33            CalendarTypeForLmdz=earth_360d
34    esac
35
36    ##- PARAM directory
37    IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/COMP/lmdz.card UserChoices PARAM_DIR
38    PARAM_DIR=${lmdz_UserChoices_PARAM_DIR}
39    echo parameter file directory : ${PARAM_DIR}
40
41    ##--Frequency purpose ....
42    ##--  Initialisation  ....
43    OK_instan=n
44    OK_journe=n
45    OK_mensuel=n
46    ok_hf=n
47
48    case ${config_UserChoices_PeriodLength} in
49        1Y|1y|1M|1m) OK_mensuel=y ;;
50        5D|5d|1D|1d) OK_journe=y ;;
51    esac
52
53    for frequency in ${config_ATM_WriteFrequency} ; do
54        case ${frequency} in
55            5D|5d|1D|1d) OK_journe=y ;;
56        esac
57        case ${frequency} in
58            HF|hf) ok_hf=y ;;
59        esac
60    done
61
62    IGCM_debug_PopStack "ATM_Initialize"
63}
64
65#-----------------------------------------------------------------
66function ATM_Update
67{
68    IGCM_debug_PushStack "ATM_Update"
69
70    case ${config_UserChoices_PeriodLength} in
71        *Y|*y) 
72               LMDZ_ecrit_mth=30.
73               LMDZ_ecrit_ISCCP=30.
74               LMDZ_periodav=30.
75               ;;
76        *)
77               LMDZ_ecrit_mth=${PeriodLengthInDays}.
78               LMDZ_ecrit_ISCCP=${PeriodLengthInDays}.
79               LMDZ_periodav=${PeriodLengthInDays}.
80               ;;
81    esac
82
83    ##-- Remise ou non a zero de la date initiale de LMDZ pour le fichier run.def
84    if [ ${CumulPeriod} -eq 1 ] ; then
85        RAZ_DATE=1
86    else
87        RAZ_DATE=0
88    fi
89
90    LMDZ_adjust=n
91
92    ## physiq.def parameters modified from initial physiq_L${RESOL_ATM_Z}
93    LMDZ_sed physiq.def OK_instan   ${OK_instan}
94    LMDZ_sed physiq.def OK_journe   ${OK_journe}
95    LMDZ_sed physiq.def OK_mensuel  ${OK_mensuel}
96    LMDZ_sed physiq.def ok_hf       ${ok_hf}
97    LMDZ_sed physiq.def ecrit_mth   ${LMDZ_ecrit_mth}
98    LMDZ_sed physiq.def ecrit_ISCCP ${LMDZ_ecrit_ISCCP}
99#    LMDZ_sed physiq.def ok_mensuelCOSP  ${LMDZ_COSP_monthly}
100#    LMDZ_sed physiq.def ok_journeCOSP   ${LMDZ_COSP_daily}
101#    LMDZ_sed physiq.def ok_hfCOSP   ${LMDZ_COSP_hf}
102#    LMDZ_sed physiq.def ok_histNMC  "${LMDZ_NMC_monthly}, ${LMDZ_NMC_daily}, ${LMDZ_NMC_hf}"
103
104    ## gcm.def parameters : no change since gcm.def_${RESOL_ATM_3D} is used and already modified
105
106    ## run.def parameters
107    LMDZ_sed run.def dayref   ${InitDay}
108    LMDZ_sed run.def anneeref ${year}
109    LMDZ_sed run.def calend   ${CalendarTypeForLmdz}
110    LMDZ_sed run.def nday     ${PeriodLengthInDays}
111    LMDZ_sed run.def raz_date ${RAZ_DATE}
112    LMDZ_sed run.def periodav ${LMDZ_periodav}
113    LMDZ_sed run.def adjust   ${LMDZ_adjust}
114    LMDZ_sed run.def use_filtre_fft n
115    if ( ${FirstInitialize} ) ; then
116
117    echo cat run
118    cat run.def
119
120    fi
121
122    IGCM_debug_PopStack "ATM_Update"
123}
124
125#-----------------------------------
126function ATM_Finalize
127{
128    IGCM_debug_PushStack "ATM_Finalize"
129
130    echo FINALIZE ATM !
131
132    IGCM_debug_PopStack "ATM_Finalize"
133}
Note: See TracBrowser for help on using the repository browser.