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