source: CONFIG/trunk/LMDZ4OR_v2/LMDZOR/COMP/lmdz.driver @ 326

Last change on this file since 326 was 326, checked in by jgipsl, 14 years ago
  • Updated parameter files, *.card and *.driver as done for configuration IPSLCM4_v2.

Important differences, in orchidee.def : sechiba_qsint, rveg_pft

in gcm.def : cvl_corr, day_step, iphysiq

  • Updated variable list for timeseries
  • Removed config.card.OldName? : not useful for this config
File size: 4.7 KB
Line 
1# $Id$
2#
3#!/bin/ksh
4#-----------------------------------------------------------------
5function ATM_Initialize
6{
7    IGCM_debug_PushStack "ATM_Initialize"
8
9    ##- Create_etat0_limit version
10    IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/COMP/lmdz.card UserChoices CREATE
11    CREATE=${lmdz_UserChoices_CREATE}
12    echo create_etat0_limit version : ${CREATE}
13
14    ##- Default number of processor for lmdz
15    NUM_PROC_ATM=1
16    if [ X"${BATCH_NUM_PROC_TOT}" != X ] ; then
17        NUM_PROC_ATM=${BATCH_NUM_PROC_TOT}
18    fi
19 
20    RESOL_ATM=${RESOL}
21    case ${RESOL_ATM} in
22        LMD7245)   BandsResol=72x45x19   ;;
23        LMD9671)   BandsResol=96x71x19   ;;
24        LMD14496)  BandsResol=144x96x19  ;;
25        LMD144142) BandsResol=144x142x19 ;;
26    esac
27
28    ##--Frequency purpose ....
29    ##--  Initialisation  ....
30    OK_instan=n
31    OK_journe=n
32    OK_mensuel=n
33    ok_hf=n
34
35    case ${config_UserChoices_PeriodLength} in
36        1Y|1y|1M|1m) OK_mensuel=y ;;
37        5D|5d|1D|1d) OK_journe=y ;;
38    esac
39
40    for frequency in ${config_ATM_WriteFrequency} ; do
41        case ${frequency} in
42            5D|5d|1D|1d) OK_journe=y ;;
43        esac
44        case ${frequency} in
45            HF|hf) ok_hf=y ;;
46        esac
47    done
48
49    ##--Variables used by LMDZ in physiq.def --
50    PAT_INST=$(     grep -v ^# ${SUBMIT_DIR}/PARAM/physiq.def  | grep 'OK_instan'  )
51    PAT_JOUR=$(     grep -v ^# ${SUBMIT_DIR}/PARAM/physiq.def  | grep 'OK_journe'  )
52    PAT_MOIS=$(     grep -v ^# ${SUBMIT_DIR}/PARAM/physiq.def  | grep 'OK_mensuel' )
53    PAT_HFRE=$(     grep -v ^# ${SUBMIT_DIR}/PARAM/physiq.def  | grep 'ok_hf'      )
54
55    ##--Variables used by LMDZ in gcm.def --
56    PAT_iphysiq=$(  grep -v ^# ${SUBMIT_DIR}/PARAM/gcm.def_${RESOL_ATM} | grep iphysiq  )
57    PAT_iperiod=$(  grep -v ^# ${SUBMIT_DIR}/PARAM/gcm.def_${RESOL_ATM} | grep iperiod  )
58    PAT_day_step=$( grep -v ^# ${SUBMIT_DIR}/PARAM/gcm.def_${RESOL_ATM} | grep day_step )
59    PAT_ecritphy=$( grep -v ^# ${SUBMIT_DIR}/PARAM/gcm.def_${RESOL_ATM} | grep ecritphy )
60
61    ## Read LMDZ_adjust option in ${compname}.card --> put adjust=y and save Bands_*.dat in ${SUBMIT_DIR}/PARAM
62    IGCM_card_DefineVariableFromOption ${SUBMIT_DIR}/COMP/${compname}.card UserChoices LMDZ_adjust
63    eval LMDZ_adjust=\${${compname}_UserChoices_LMDZ_adjust} > /dev/null 2>&1
64
65    ##-- This could be define in lmdz.card, inside section [UserChoices]
66    ##-- Otherwise we get the value in *.def
67    iperiod=$( echo ${PAT_iperiod} | awk -F= '{print $2}' )
68    iphysiq=$( echo ${PAT_iphysiq} | awk -F= '{print $2}' )
69
70    # day_step : number of steps per day (multiple of iperiod)
71    (( day_step = 48 * iphysiq ))
72
73    IGCM_debug_PopStack "ATM_Initialize"
74}
75
76#-----------------------------------------------------------------
77function ATM_Update
78{
79    IGCM_debug_PushStack "ATM_Update"
80
81# Another solution to make start.nc/startphy.nc/limit.nc for a CLIM run :
82# if ( ${FirstInitialize} ) ; then
83#
84#    if ( [ "${config_Restarts_OverRule}" = "n" ] && [ "${config_ATM_Restart}" = "n" ] ); then
85#       if [ ${DRYRUN} -le 2 ] ; then
86#            IGCM_sys_Cp ${R_EXE}/create_etat0_limit.e ${RUN_DIR}/.
87#          if [ ${DRYRUN} -le 1 ] ; then
88#            ./create_etat0_limit.e
89#          fi
90#       else
91#          echo "EXECUTION of ./create_etat0_limit.e simulated"
92#          echo "EXECUTION of ./create_etat0_limit.e simulated for DRYRUN = " $DRYRUN >> stack
93#       fi
94#    fi
95#
96# fi
97
98    ecritphy=${PeriodLengthInDays}
99
100    ##-- Remise ou non a zero de la date initiale de LMDZ pour le fichier run.def
101    if [ ${CumulPeriod} -eq 1 ] ; then
102        RAZ_DATE=1
103    else
104        RAZ_DATE=0
105    fi
106
107    ## Mise en forme du fichier physiq.def
108    sed -e "s/${PAT_INST}/OK_instan=${OK_instan}/"    \
109        -e "s/${PAT_JOUR}/OK_journe=${OK_journe}/"    \
110        -e "s/${PAT_MOIS}/OK_mensuel=${OK_mensuel}/"  \
111        -e "s/${PAT_HFRE}/ok_hf=${ok_hf}/"            \
112        physiq.def > physiq.def.tmp
113    IGCM_sys_Mv physiq.def.tmp physiq.def
114
115    ## Mise en forme du fichier gcm.def
116    sed -e "s/${PAT_ecritphy}/ecritphy=${ecritphy}/"  \
117        -e "s/${PAT_day_step}/day_step=${day_step}/"  \
118        -e "s/${PAT_iperiod}/iperiod=${iperiod}/"     \
119        -e "s/${PAT_iphysiq}/iphysiq=${iphysiq}/"     \
120        gcm.def > gcm.def.tmp
121    IGCM_sys_Mv gcm.def.tmp gcm.def
122
123    ## Mise en forme du fichier run.def
124    sed -e "s/_dayref_/${InitDay}/"                    \
125        -e "s/_anneeref_/${InitYear}/"                 \
126        -e "s/_nday_/${PeriodLengthInDays}/"           \
127        -e "s/_raz_date_/${RAZ_DATE}/"                 \
128        -e "s/_adjust_/${LMDZ_adjust}/"                \
129        run.def > run.def.tmp
130    IGCM_sys_Mv run.def.tmp run.def
131
132    IGCM_debug_PopStack "ATM_Update"
133}
134
135#-----------------------------------
136function ATM_Finalize
137{
138    IGCM_debug_PushStack "ATM_Finalize"
139
140    [ ${LMDZ_adjust} = y ] && IGCM_sys_Cp Bands_${BandsResol}_${NUM_PROC_ATM}prc.dat ${SUBMIT_DIR}/PARAM
141
142    echo FINALIZE ATM !
143
144    IGCM_debug_PopStack "ATM_Finalize"
145}
Note: See TracBrowser for help on using the repository browser.