Changeset 3047
- Timestamp:
- 12/02/16 16:23:58 (8 years ago)
- Location:
- CONFIG/UNIFORM/v6
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/DRIVER/orchidee.driver
r2907 r3047 1 1 #!/bin/ksh 2 # D- Driver du script pourORCHIDEE2 ## Driver for the component SRF corresponding to the sechiba part of ORCHIDEE 3 3 #----------------------------------------------------------------- 4 4 function SRF_Initialize … … 63 63 ## 2. Mangement of output and modifications of related xml files 64 64 65 # Set default values for sechiba1_enabled, sechiba1_freq and sechiba2_enabled. 65 # Set default values for sechiba1_enabled and sechiba1_freq. 66 # These variables are used only to modify file_def_orchidee.xml 66 67 sechiba1_enabled=.FALSE. 67 68 sechiba2_enabled=.FALSE. 68 69 sechiba1_freq=0s 70 sechiba2_freq=0s 69 71 70 # Get WriteFrenquecies from config.card for SECHIBA 71 # Note that it is only possible to have one HF and one other option. 72 # If more options are set in config.card only the latest will be used. 72 73 # Get WriteFrenquecy for SRF (SECHIBA) from config.card 74 # 1 or 2 frequencies can be set in WriteFrenquecy for SRF 75 # The first frequency will always be used for the sechiba_history file and the 76 # second frequency will be used for the sechiba_out_2.nc file. 77 # The files are activated only if its corresponding frequency is set in WriteFrequency 78 ifreq=0 73 79 for frequency in ${config_SRF_WriteFrequency} ; do 74 80 case ${frequency} in … … 76 82 NbYears=$( echo ${frequency} | awk -F '[yY]' '{print $1}' ) 77 83 NbDaysYear=$( IGCM_date_DaysInYear ${year} ) 78 sechiba1_enabled=.TRUE.79 sechiba1_freq=${NbYears}y ;;84 file_enabled=.TRUE. 85 file_freq=${NbYears}y ;; 80 86 *M|*m) 81 87 NbMonths=$( echo ${frequency} | awk -F '[mM]' '{print $1}' ) 82 sechiba1_enabled=.TRUE.83 sechiba1_freq=${NbMonths}mo ;;88 file_enabled=.TRUE. 89 file_freq=${NbMonths}mo ;; 84 90 *D|*d) 85 91 NbDays=$( echo ${frequency} | awk -F '[dD]' '{print $1}' ) 86 sechiba1_enabled=.TRUE.87 sechiba1_freq=${NbDays}d ;;92 file_enabled=.TRUE. 93 file_freq=${NbDays}d ;; 88 94 *s) 89 95 WriteInSeconds=$( echo ${frequency} | awk -F '[s]' '{print $1}' ) 90 sechiba1_enabled=.TRUE.91 sechiba1_freq=${WriteInSeconds}s ;;96 file_enabled=.TRUE. 97 file_freq=${WriteInSeconds}s ;; 92 98 HF|hf) 93 sechiba2_enabled=.TRUE. ;; 99 file_enabled=.TRUE. 100 file_freq=10800s ;; 94 101 *) 95 IGCM_debug_Exit "SRF WriteFrequency=${frequency} is invalid. Choose between xY, xM, xD, xs and HF for Sechiba." ;; 102 IGCM_debug_Exit "SRF_Update " ${frequency} " invalid WriteFrequency : choose in xY, xM, xD, xs and HF" 103 IGCM_debug_Verif_Exit ;; 104 esac 105 106 (( ifreq = ifreq + 1 )) 107 case ${ifreq} in 108 1) 109 sechiba1_enabled=${file_enabled} 110 sechiba1_freq=${file_freq} ;; 111 2) 112 sechiba2_enabled=${file_enabled} 113 sechiba2_freq=${file_freq} ;; 114 *) 115 IGCM_debug_Exit "SRF_Update: It is not possible to set more than 2 output files for sechiba from config.card" 116 IGCM_debug_Exit "You must correct WriteFrequancy in SRF secion in config.card." 117 IGCM_debug_Exit "Adapt file_def_orchidee.xml directly if you want more output files" 118 IGCM_debug_Verif_Exit ;; 96 119 esac 97 120 done 98 121 99 # Do the modifications in file_def_orchidee.xml 122 123 # Modify file_def_orchidee.xml file 100 124 IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba1 enabled ${sechiba1_enabled} 101 125 IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba1 output_freq ${sechiba1_freq} 102 126 IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba2 enabled ${sechiba2_enabled} 127 IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba2 output_freq ${sechiba2_freq} 128 103 129 104 130 # Add include of orchidee context in iodef.xml … … 110 136 rm iodef.xml.tmp add.tmp 111 137 112 #Long Name as global attribute (if LongName is not empty) 113 if [ ! "X${config_UserChoices_LongName}" = "X" ] ; then 114 listfile=$(ls file_def*orchidee.xml) 115 echo "<variable id=\"LongName\" type=\"string\">${config_UserChoices_LongName}</variable>" > add.tmp 116 for file in ${listfile} 117 do 118 cp ${file} ${file}.tmp 119 sed -e "/<file id/r add.tmp" \ 120 ${file}.tmp > ${file} 121 rm ${file}.tmp 122 done 123 rm add.tmp 124 fi 138 # Add LongName as global attribute in XIOS output files (if LongName is not empty) 139 if [ ! "X${config_UserChoices_LongName}" = "X" ] ; then 140 listfile=$(ls file_def*orchidee.xml) 141 echo "<variable id=\"LongName\" type=\"string\">${config_UserChoices_LongName}</variable>" > add.tmp 142 for file in ${listfile} 143 do 144 cp ${file} ${file}.tmp 145 sed -e "/<file id/r add.tmp" \ 146 ${file}.tmp > ${file} 147 rm ${file}.tmp 148 done 149 rm add.tmp 150 fi 151 125 152 126 153 IGCM_debug_PopStack "SRF_Update" -
CONFIG/UNIFORM/v6/LMDZOR_v6/GENERAL/DRIVER/orchidee.driver
r2907 r3047 1 1 #!/bin/ksh 2 # D- Driver du script pourORCHIDEE2 ## Driver for the component SRF corresponding to the sechiba part of ORCHIDEE 3 3 #----------------------------------------------------------------- 4 4 function SRF_Initialize … … 63 63 ## 2. Mangement of output and modifications of related xml files 64 64 65 # Set default values for sechiba1_enabled, sechiba1_freq and sechiba2_enabled. 65 # Set default values for sechiba1_enabled and sechiba1_freq. 66 # These variables are used only to modify file_def_orchidee.xml 66 67 sechiba1_enabled=.FALSE. 67 68 sechiba2_enabled=.FALSE. 68 69 sechiba1_freq=0s 70 sechiba2_freq=0s 69 71 70 # Get WriteFrenquecies from config.card for SECHIBA 71 # Note that it is only possible to have one HF and one other option. 72 # If more options are set in config.card only the latest will be used. 72 73 # Get WriteFrenquecy for SRF (SECHIBA) from config.card 74 # 1 or 2 frequencies can be set in WriteFrenquecy for SRF 75 # The first frequency will always be used for the sechiba_history file and the 76 # second frequency will be used for the sechiba_out_2.nc file. 77 # The files are activated only if its corresponding frequency is set in WriteFrequency 78 ifreq=0 73 79 for frequency in ${config_SRF_WriteFrequency} ; do 74 80 case ${frequency} in … … 76 82 NbYears=$( echo ${frequency} | awk -F '[yY]' '{print $1}' ) 77 83 NbDaysYear=$( IGCM_date_DaysInYear ${year} ) 78 sechiba1_enabled=.TRUE.79 sechiba1_freq=${NbYears}y ;;84 file_enabled=.TRUE. 85 file_freq=${NbYears}y ;; 80 86 *M|*m) 81 87 NbMonths=$( echo ${frequency} | awk -F '[mM]' '{print $1}' ) 82 sechiba1_enabled=.TRUE.83 sechiba1_freq=${NbMonths}mo ;;88 file_enabled=.TRUE. 89 file_freq=${NbMonths}mo ;; 84 90 *D|*d) 85 91 NbDays=$( echo ${frequency} | awk -F '[dD]' '{print $1}' ) 86 sechiba1_enabled=.TRUE.87 sechiba1_freq=${NbDays}d ;;92 file_enabled=.TRUE. 93 file_freq=${NbDays}d ;; 88 94 *s) 89 95 WriteInSeconds=$( echo ${frequency} | awk -F '[s]' '{print $1}' ) 90 sechiba1_enabled=.TRUE.91 sechiba1_freq=${WriteInSeconds}s ;;96 file_enabled=.TRUE. 97 file_freq=${WriteInSeconds}s ;; 92 98 HF|hf) 93 sechiba2_enabled=.TRUE. ;; 99 file_enabled=.TRUE. 100 file_freq=10800s ;; 94 101 *) 95 IGCM_debug_Exit "SRF WriteFrequency=${frequency} is invalid. Choose between xY, xM, xD, xs and HF for Sechiba." ;; 102 IGCM_debug_Exit "SRF_Update " ${frequency} " invalid WriteFrequency : choose in xY, xM, xD, xs and HF" 103 IGCM_debug_Verif_Exit ;; 104 esac 105 106 (( ifreq = ifreq + 1 )) 107 case ${ifreq} in 108 1) 109 sechiba1_enabled=${file_enabled} 110 sechiba1_freq=${file_freq} ;; 111 2) 112 sechiba2_enabled=${file_enabled} 113 sechiba2_freq=${file_freq} ;; 114 *) 115 IGCM_debug_Exit "SRF_Update: It is not possible to set more than 2 output files for sechiba from config.card" 116 IGCM_debug_Exit "You must correct WriteFrequancy in SRF secion in config.card." 117 IGCM_debug_Exit "Adapt file_def_orchidee.xml directly if you want more output files" 118 IGCM_debug_Verif_Exit ;; 96 119 esac 97 120 done 98 121 99 # Do the modifications in file_def_orchidee.xml 122 123 # Modify file_def_orchidee.xml file 100 124 IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba1 enabled ${sechiba1_enabled} 101 125 IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba1 output_freq ${sechiba1_freq} 102 126 IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba2 enabled ${sechiba2_enabled} 127 IGCM_comp_modifyXmlFile nonblocker file_def_orchidee.xml sechiba2 output_freq ${sechiba2_freq} 128 103 129 104 130 # Add include of orchidee context in iodef.xml … … 110 136 rm iodef.xml.tmp add.tmp 111 137 112 #Long Name as global attribute (if LongName is not empty) 113 if [ ! "X${config_UserChoices_LongName}" = "X" ] ; then 114 listfile=$(ls file_def*orchidee.xml) 115 echo "<variable id=\"LongName\" type=\"string\">${config_UserChoices_LongName}</variable>" > add.tmp 116 for file in ${listfile} 117 do 118 cp ${file} ${file}.tmp 119 sed -e "/<file id/r add.tmp" \ 120 ${file}.tmp > ${file} 121 rm ${file}.tmp 122 done 123 rm add.tmp 124 fi 138 # Add LongName as global attribute in XIOS output files (if LongName is not empty) 139 if [ ! "X${config_UserChoices_LongName}" = "X" ] ; then 140 listfile=$(ls file_def*orchidee.xml) 141 echo "<variable id=\"LongName\" type=\"string\">${config_UserChoices_LongName}</variable>" > add.tmp 142 for file in ${listfile} 143 do 144 cp ${file} ${file}.tmp 145 sed -e "/<file id/r add.tmp" \ 146 ${file}.tmp > ${file} 147 rm ${file}.tmp 148 done 149 rm add.tmp 150 fi 151 125 152 126 153 IGCM_debug_PopStack "SRF_Update"
Note: See TracChangeset
for help on using the changeset viewer.