- Timestamp:
- 09/15/11 11:01:06 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
CONFIG/LMDZORINCA/tags/LMDZORINCA_v2/EXP_NMHC_AER/COMP/lmdz.driver
r1297 r1557 3 3 4 4 #----------------------------------------------------------------- 5 function LMDZ_sed 6 { 7 IGCM_debug_PushStack "LMDZ_sed" 8 9 sed -e "s/^${2}\ *=.*/${2}= ${3}/" ${1} > ${1}.tmp 10 RET=$? 11 echo "LMDZ_sed : ${1} ${2} ${3}" 12 \mv ${1}.tmp ${1} 13 14 IGCM_debug_PopStack "LMDZ_sed" 15 return $RET 16 } 17 18 #----------------------------------------------------------------- 19 5 20 function ATM_Initialize 6 21 { … … 36 51 fi 37 52 38 ##--Frequency purpose .... 53 54 ##-- Output frequency purpose .... 39 55 ##-- Initialisation .... 40 OK_instan=n 41 ##-- 42 OK_journe=n 43 OK_mensuel=y 56 ok_mensuel=y 57 ok_journe=n 58 ok_hf=n 59 ok_hf3h=n 60 ok_hf3hm=n 61 ok_stn=n 44 62 45 case ${config_UserChoices_PeriodLength} in46 1Y|1y|1M|1m) OK_mensuel=y ;;47 5D|5d|1D|1d) OK_journe=n ;;48 esac49 50 for frequency in ${config_ATM_WriteFrequency} ; do51 case ${frequency} in52 5D|5d|1D|1d) OK_journe=n ;;53 esac54 done55 56 ##--Variables used by LMDZ --57 PAT_INST=$( grep 'OK_instan' ${SUBMIT_DIR}/PARAM/physiq.def )58 PAT_JOUR=$( grep 'OK_journe' ${SUBMIT_DIR}/PARAM/physiq.def )59 PAT_MOIS=$( grep 'OK_mensuel' ${SUBMIT_DIR}/PARAM/physiq.def )60 61 PAT_iphysiq=$( grep 'iphysiq' ${SUBMIT_DIR}/PARAM/gcm.def )62 PAT_iperiod=$( grep 'iperiod' ${SUBMIT_DIR}/PARAM/gcm.def | tail -1)63 PAT_day_step=$( grep 'day_step' ${SUBMIT_DIR}/PARAM/gcm.def )64 PAT_ecritphy=$( grep 'ecritphy' ${SUBMIT_DIR}/PARAM/gcm.def )65 63 66 64 … … 75 73 76 74 77 ##-- This could be define in lmdz.card, inside section [UserChoices]78 ##-- Otherwise we get the value in *.def79 iperiod=$(grep iperiod ${SUBMIT_DIR}/PARAM/gcm.def | awk -F= '{print $2}' | tail -1)80 iphysiq=$(grep iphysiq ${SUBMIT_DIR}/PARAM/gcm.def | awk -F= '{print $2}')81 # day_step : number of steps per day (multiple of iperiod)82 (( day_step = 48 * iphysiq ))83 84 75 IGCM_debug_PopStack "ATM_Initialize" 85 76 } … … 91 82 92 83 ecritphy=${PeriodLengthInDays} 84 LMDZ_ecrit_ISCCP=${PeriodLengthInDays}. 85 LMDZ_periodav=${PeriodLengthInDays}. 93 86 94 87 ##-- Remise ou non a zero de la date initiale de LMDZ pour le fichier run.def … … 116 109 [ ${CumulPeriod} -gt 1 ] && ( IGCM_sys_Get ${R_OUT_ATM_D}/${config_UserChoices_JobName}_Bands_${BandsResol}_${NUM_PROC_ATM}prc.dat_${RefPeriod} Bands_${BandsResol}_${NUM_PROC_ATM}prc.dat; IGCM_sys_Chmod u+w Bands_${BandsResol}_${NUM_PROC_ATM}prc.dat ) 117 110 118 ## Mise en forme du fichier physiq.def119 sed -e "s/OK_instan=.*/OK_instan=${OK_instan}/" \120 -e "s/OK_journe=.*/OK_journe=${OK_journe}/" \121 -e "s/OK_mensuel=.*/OK_mensuel=${OK_mensuel}/" \122 physiq.def > physiq.def.tmp123 IGCM_sys_Mv physiq.def.tmp physiq.def124 111 125 ## Mise en forme du fichier gcm.def 126 sed -e "s/${PAT_ecritphy}/ecritphy=${ecritphy}/" \ 127 -e "s/${PAT_day_step}/day_step=${day_step}/" \ 128 -e "s/${PAT_iperiod}/iperiod=${iperiod}/" \ 129 -e "s/${PAT_iphysiq}/iphysiq=${iphysiq}/" \ 130 gcm.def > gcm.def.tmp 131 IGCM_sys_Mv gcm.def.tmp gcm.def 112 ## physiq.def parameters modified from initial physiq.def 113 # columns in phys_output_filekeys refer to the filenames given in phys_out_filenames in output.def : 114 # histmth histday histhf histfh3h histhf3hm histstn 115 LMDZ_sed physiq.def phys_out_filekeys "${ok_mensuel} ${ok_journe} ${ok_hf} ${ok_hf3h} ${ok_hf3hm} ${ok_stn}" 116 LMDZ_sed physiq.def ecrit_ISCCP ${LMDZ_ecrit_ISCCP} 132 117 133 greg_dat=$( IGCM_date_ConvertFormatToGregorian $PeriodDateBegin )134 jul_dat=$( IGCM_date_ConvertGregorianDateToJulian $greg_dat )135 nbjour=$( expr \( $jul_dat \% 1000 \) )136 yractu=$( expr $greg_dat / 10000 )137 echo "dayref = " $nbjour "year actu = " $yractu138 118 139 ## Mise en forme du fichier run.def 140 sed -e "s/_dayref_/${nbjour}/" \ 141 -e "s/_anneeref_/${yractu}/" \ 142 -e "s/_calend_/${CalendarTypeForLmdz}/" \ 143 -e "s/_nday_/${PeriodLengthInDays}/" \ 144 -e "s/_raz_date_/${RAZ_DATE}/" \ 145 -e "s/_adjust_/${LMDZ_adjust}/" \ 146 run.def > run.def.tmp 147 IGCM_sys_Mv run.def.tmp run.def 119 ## run.def parameters 120 LMDZ_sed run.def dayref ${InitDay} 121 LMDZ_sed run.def anneeref ${InitYear} 122 LMDZ_sed run.def calend ${CalendarTypeForLmdz} 123 LMDZ_sed run.def nday ${PeriodLengthInDays} 124 LMDZ_sed run.def raz_date ${RAZ_DATE} 125 LMDZ_sed run.def periodav ${LMDZ_periodav} 126 LMDZ_sed run.def adjust ${LMDZ_adjust} 127 128 ## Other specific parameters to this experience 129 if [ ! X${lmdz_UserChoices_aer_type} = X ] ; then 130 LMDZ_sed physiq.def aer_type ${lmdz_UserChoices_aer_type} 131 fi 132 if [ ! X${lmdz_UserChoices_pmagic} = X ] ; then 133 LMDZ_sed physiq.def pmagic ${lmdz_UserChoices_pmagic} 134 fi 148 135 149 136 IGCM_debug_PopStack "ATM_Update"
Note: See TracChangeset
for help on using the changeset viewer.