#!/bin/ksh #----------------------------------------------------------------- function LMDZ_sed { IGCM_debug_PushStack "LMDZ_sed" sed -e "s/^${2}\ *=.*/${2}= ${3}/" ${1} > ${1}.tmp RET=$? echo "LMDZ_sed : ${1} ${2} ${3}" \mv ${1}.tmp ${1} IGCM_debug_PopStack "LMDZ_sed" return $RET } function ATM_Initialize { IGCM_debug_PushStack "ATM_Initialize" RESOL_ATM=$( echo $RESOL | awk "-Fx" '{print $2}' | awk "-F-" '{print $1}') [ -f ${SUBMIT_DIR}/../.resol ] && eval $(grep RESOL_ATM_3D ${SUBMIT_DIR}/../.resol) || RESOL_ATM_3D=96x95x19 RESOL_ATM_Z=$( echo ${RESOL_ATM_3D} | awk "-Fx" '{print $3}' ) ##-- Calendar type for LMDZ case ${config_UserChoices_CalendarType} in leap|gregorian) CalendarTypeForLmdz=earth_366d;; noleap) CalendarTypeForLmdz=earth_365d;; 360d) CalendarTypeForLmdz=earth_360d;; *) CalendarTypeForLmdz=earth_360d esac ##--Frequency purpose .... ##-- Initialisation .... OK_instan=n OK_journe=n OK_mensuel=n ok_hf=n case ${config_UserChoices_PeriodLength} in 1Y|1y|1M|1m) OK_mensuel=y ;; 5D|5d|1D|1d) OK_journe=y ;; esac for frequency in ${config_ATM_WriteFrequency} ; do case ${frequency} in 5D|5d|1D|1d) OK_journe=y ;; esac case ${frequency} in HF|hf) ok_hf=y ;; esac done IGCM_debug_PopStack "ATM_Initialize" } #----------------------------------------------------------------- function ATM_Update { IGCM_debug_PushStack "ATM_Update" case ${config_UserChoices_PeriodLength} in *Y|*y) LMDZ_ecrit_mth=30. LMDZ_ecrit_ISCCP=30. LMDZ_periodav=30. ;; *) LMDZ_ecrit_mth=${PeriodLengthInDays}. LMDZ_ecrit_ISCCP=${PeriodLengthInDays}. LMDZ_periodav=${PeriodLengthInDays}. ;; esac ##-- Remise ou non a zero de la date initiale de LMDZ pour le fichier run.def if [ ${CumulPeriod} -eq 1 ] ; then RAZ_DATE=1 else RAZ_DATE=0 fi LMDZ_adjust=n ## physiq.def parameters modified from initial physiq_L${RESOL_ATM_Z} LMDZ_sed physiq.def OK_instan ${OK_instan} LMDZ_sed physiq.def OK_journe ${OK_journe} LMDZ_sed physiq.def OK_mensuel ${OK_mensuel} LMDZ_sed physiq.def ok_hf ${ok_hf} LMDZ_sed physiq.def ecrit_mth ${LMDZ_ecrit_mth} LMDZ_sed physiq.def ecrit_ISCCP ${LMDZ_ecrit_ISCCP} # LMDZ_sed physiq.def ok_mensuelCOSP ${LMDZ_COSP_monthly} # LMDZ_sed physiq.def ok_journeCOSP ${LMDZ_COSP_daily} # LMDZ_sed physiq.def ok_hfCOSP ${LMDZ_COSP_hf} # LMDZ_sed physiq.def ok_histNMC "${LMDZ_NMC_monthly}, ${LMDZ_NMC_daily}, ${LMDZ_NMC_hf}" ## gcm.def parameters : no change since gcm.def_${RESOL_ATM_3D} is used and already modified ## run.def parameters LMDZ_sed run.def dayref ${InitDay} LMDZ_sed run.def anneeref ${InitYear} LMDZ_sed run.def calend ${CalendarTypeForLmdz} LMDZ_sed run.def nday ${PeriodLengthInDays} LMDZ_sed run.def raz_date ${RAZ_DATE} LMDZ_sed run.def periodav ${LMDZ_periodav} LMDZ_sed run.def adjust ${LMDZ_adjust} if ( ${FirstInitialize} ) ; then echo cat run cat run.def fi IGCM_debug_PopStack "ATM_Update" } #----------------------------------- function ATM_Finalize { IGCM_debug_PushStack "ATM_Finalize" echo FINALIZE ATM ! IGCM_debug_PopStack "ATM_Finalize" }