source: CONFIG/LMDZOR/branches/LMDZOR_v4/CREATE/COMP/lmdz.driver @ 6898

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

Small clean up in lmdz.driver.
Write file grilles_gcm.nc only at first cumul period.

File size: 2.1 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
42    IGCM_debug_PopStack "ATM_Initialize"
43}
44
45#-----------------------------------------------------------------
46function ATM_Update
47{
48    IGCM_debug_PushStack "ATM_Update"
49
50    ##-- Activate creation of file grilles_gcm.nc only at first period
51    if [ ${CumulPeriod} -eq 1 ] ; then
52        LMDZ_sed run.def grilles_gcm_netcdf y
53    else
54        LMDZ_sed run.def grilles_gcm_netcdf n
55    fi
56
57    ## run.def parameters
58    LMDZ_sed run.def dayref   ${InitDay}
59    LMDZ_sed run.def anneeref ${year}
60    LMDZ_sed run.def calend   ${CalendarTypeForLmdz}
61    LMDZ_sed run.def use_filtre_fft n
62
63    ## Parameters not used for create_etat0_limit
64    LMDZ_sed run.def raz_date 9
65    LMDZ_sed run.def nday     9
66    LMDZ_sed run.def periodav 9
67    LMDZ_sed run.def adjust   n
68    LMDZ_sed physiq.def ecrit_mth 9.
69    LMDZ_sed physiq.def ecrit_ISCCP 9.
70
71    IGCM_debug_PopStack "ATM_Update"
72}
73
74#-----------------------------------
75function ATM_Finalize
76{
77    IGCM_debug_PushStack "ATM_Finalize"
78
79    echo FINALIZE ATM !
80
81    IGCM_debug_PopStack "ATM_Finalize"
82}
Note: See TracBrowser for help on using the repository browser.