source: CONFIG/LMDZOR/branches/LMDZOR_v4/LMDZOR/COMP/orchidee.driver @ 1203

Last change on this file since 1203 was 1203, checked in by jgipsl, 13 years ago

Dev config LMDZOR_v4 :

Towards possibility to run LMDZOR experience as climate or AMIP
interannuel experience. All PARAM/*def and COMP/*driver are the same. To
switch change lmdz.card and orchidee.card.

  • Modified following parameters from lmdz.card and orchidee.card : VEGET_UPDATE, LAND_COVER_CHANGE, ok_guide, pmagic, aer_type
  • Added orchidee.card_AMIP, lmdz.card_AMIP : copied from AMIP/COMP
  • Uniformized lmdz.driver and orchidee.driver with functionality from AMIP experience
  • orchidee.driver : added function SRF_PeriodStart, desactaivate river routing for high resolution (280x280x39)
  • lmdz.driver : added lecture of GHG forcing files if they exist (if added in lmdz.card), desactivated fft filter in case of resolution

280x280x39 which contains zoom, added test if Bands file exist
(LMDZ_Bands_file_name)

  • lmdz.card : take climoz_LMDZ.nc file from CREATE run instead of AR5/HISTORIQUE/climoz_LMDZ_1995.nc
File size: 4.9 KB
Line 
1#!/bin/ksh
2
3#D- Driver du script pour ORCHIDEE
4
5function ORCHIDEE_sed
6{
7    IGCM_debug_PushStack "ORCHIDEE_sed"
8   
9    sed -e "s/^${1}\ *=.*/${1}= ${2}/" \
10        orchidee.def > orchidee.def.tmp
11    RET=$?
12    echo "ORCHIDEE_sed : ${1} ${2}"
13    \mv orchidee.def.tmp orchidee.def
14   
15    IGCM_debug_PopStack "ORCHIDEE_sed"
16    return $RET
17}
18
19#-----------------------------------------------------------------
20function SRF_Initialize
21{
22    IGCM_debug_PushStack "SRF_Initialize"
23
24    RESOL_SRF=ALL
25
26    for frequency in ${config_SRF_WriteFrequency} ; do
27        case ${frequency} in
28            HF|hf) SRF_ok_hf=y ;;
29        esac
30    done
31
32    IGCM_debug_PopStack "SRF_Initialize"
33}
34
35#-----------------------------------------------------------------
36function SRF_PeriodStart
37{
38
39    IGCM_debug_PushStack "SRF_PeriodStart"
40    if [ ${year} -gt 2004 ] ; then
41
42        PFTmap="${R_BC}/SRF/${config_UserChoices_TagName}/ORCHIDEE_PFTmap_2006to2100_AR5_RCP8.5_MESSAGE.nc"
43        if [ ${year} -eq 2005 ] ; then
44            IGCM_sys_Rm -f PFTmap.nc
45        fi
46
47    else
48        PFTmap="${R_BC}/SRF/${config_UserChoices_TagName}/PFTmap_1850to2005_AR5_LUHa.rc2.nc"
49    fi
50
51    BC_SRF_PFTmap=${PFTmap}
52
53    IGCM_debug_PopStack "SRF_PeriodStart"
54
55}
56
57#-----------------------------------------------------------------
58function SRF_Update
59{
60    IGCM_debug_PushStack "SRF_Update"
61
62    typeset SECHIBA_WRITE_STEP
63
64    SRF_WriteFrequency=$( echo ${config_SRF_WriteFrequency} | sed -e 's/\([0-9]*[yYmMdDs]\).*/\1/' ) 
65    case ${SRF_WriteFrequency} in
66        *Y|*y) 
67            WriteInYears=$( echo ${SRF_WriteFrequency} | awk -F '[yY]' '{print $1}' )
68            PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | awk -F '[yY]' '{print $1}' )
69            (( SECHIBA_WRITE_STEP = PeriodLengthInDays * WriteInYears / PeriodLengthInYears * 86400 )) ;;
70        1M)
71            case ${config_UserChoices_PeriodLength} in
72            *Y|*y)
73                SECHIBA_WRITE_STEP=-1.
74                ;;
75            *M|*m)
76                SECHIBA_WRITE_STEP=-1.
77                ;;
78            *)
79                (( SECHIBA_WRITE_STEP = $( IGCM_date_DaysInMonth $year $month ) * 86400 ))
80                ;;
81            esac
82            ;;
83        *M|*m) 
84            WriteInMonths=$( echo ${SRF_WriteFrequency} | awk -F '[mM]' '{print $1}' )
85            case ${config_UserChoices_PeriodLength} in
86            *Y|*y)
87                PeriodLengthInYears=$( echo ${config_UserChoices_PeriodLength} | awk -F '[yY]' '{print $1}' )
88                (( SECHIBA_WRITE_STEP = PeriodLengthInDays * 86400 / PeriodLengthInYears / 12  ))
89                ;;
90            *M|*m)
91                PeriodLengthInMonths=$( echo ${config_UserChoices_PeriodLength} | awk -F '[mM]' '{print $1}' )
92                (( SECHIBA_WRITE_STEP = PeriodLengthInDays * WriteInMonths  * 86400 / PeriodLengthInMonths  ))
93                ;;
94            *)
95                (( SECHIBA_WRITE_STEP = $( IGCM_date_DaysInMonth $year $month ) * 86400 ))
96                ;;
97            esac
98            ;;
99        5D|5d) 
100            (( SECHIBA_WRITE_STEP = 5 * 86400 )) ;;
101        1D|1d) 
102            (( SECHIBA_WRITE_STEP = 86400 )) ;;
103        *s)
104            WriteInSeconds=$( echo ${SRF_WriteFrequency} | awk -F '[s]' '{print $1}' )
105            (( SECHIBA_WRITE_STEP = WriteInSeconds )) ;;
106        *) 
107            IGCM_debug_Exit "SRF_Update " ${SRF_WriteFrequency} " invalid WriteFrequency : choose in 1Y, 1M, 5D, 1D." 
108            IGCM_debug_Verif_Exit ;;
109    esac
110
111    # Dans le cas de test :
112#    if [ ${year} -eq 1979 ] ; then
113#       ORCHIDEE_sed VEGET_REINIT y
114#       ORCHIDEE_sed VEGET_YEAR 131
115#    fi
116#   
117#    # Dans le cas historique :
118#    if [ ${year} -eq 2005 ] ; then
119#       ORCHIDEE_sed VEGET_REINIT y
120#       ORCHIDEE_sed VEGET_YEAR 1
121##      ORCHIDEE_sed VEGET_UPDATE '0Y'
122#    fi
123
124#     # Dans le cas sans changement de carte aprÚs 2005
125#     if [ ${year} -gt 2005 ] ; then
126#       ORCHIDEE_sed VEGET_UPDATE '0Y'
127#     fi
128 
129    ORCHIDEE_sed HYDROL_CWRR ${orchidee_UserChoices_NEWHYDROL}
130
131    ORCHIDEE_sed WRITE_STEP ${SECHIBA_WRITE_STEP}
132    ORCHIDEE_sed SECHIBA_HISTLEVEL ${orchidee_UserChoices_sechiba_LEVEL}
133
134    # Outputs HF in HISTFILE2 if required
135    [ X${SRF_ok_hf} = Xy ] && ORCHIDEE_sed SECHIBA_HISTFILE2 y
136    ORCHIDEE_sed SECHIBA_HISTLEVEL2 1
137    ORCHIDEE_sed WRITE_STEP2 10800.0
138
139    if ( [ ${CumulPeriod} -ne 1 ] || [ "${config_SRF_Restart}" != "n" ] ) ; then
140        ORCHIDEE_sed SECHIBA_restart_in sechiba_rest_in.nc
141    fi
142
143# Desactaivate river routing for high resolution
144    if ( [ ${RESOL_ATM_3D} = "280x280x39" ] ) ; then
145        ORCHIDEE_sed  RIVER_ROUTING n
146    fi
147
148# Parameters set in orchidee.card
149    if [ ! X${orchidee_UserChoices_VEGET_UPDATE} = X ] ; then
150        ORCHIDEE_sed VEGET_UPDATE   ${orchidee_UserChoices_VEGET_UPDATE}
151    fi
152    if [ ! X${orchidee_UserChoices_LAND_COVER_CHANGE} = X ] ; then
153        ORCHIDEE_sed LAND_COVER_CHANGE ${orchidee_UserChoices_LAND_COVER_CHANGE}
154    fi
155
156    #IGCM_sys_Cp ${RUN_DIR}/orchidee.def ${RUN_DIR}/run.def
157    #IGCM_sys_Put_Out ${RUN_DIR}/run.def ${R_SAVE}/${PREFIX}_run.def
158
159    IGCM_debug_PopStack "SRF_Update"
160}
161
162#-----------------------------------------------------------------
163function SRF_Finalize
164{
165    IGCM_debug_PushStack "SRF_Finalize"
166
167    #IGCM_sys_Put_Out ${RUN_DIR}/used_run.def ${R_SAVE}/${PREFIX}_used_run.def
168
169    echo FINALIZE SRF !!!
170
171    IGCM_debug_PopStack "SRF_Finalize"
172}
Note: See TracBrowser for help on using the repository browser.