source: trunk/libIGCM/AA_metrics_ORCHIDEE @ 1451

Last change on this file since 1451 was 1448, checked in by jgipsl, 6 years ago

Change in headers at irene : temporary remove option -m and use a workaround given by the TGCC. This change is done to avoid problems with resubmitting from job when submitting the main job from workdir.

  • Property svn:keywords set to Author Revision Date
File size: 8.7 KB
Line 
1#-Q- curie ######################
2#-Q- curie ## CURIE   TGCC/CEA ##
3#-Q- curie ######################
4#-Q- curie #MSUB -r METRICS_ORCHIDEE       # Nom du job
5#-Q- curie #MSUB -eo
6#-Q- curie #MSUB -n 1              # Reservation du processus
7#-Q- curie #MSUB -T 14400          # Limite de temps elapsed du job
8#-Q- curie #MSUB -q ::default_node::
9#-Q- curie #MSUB -Q normal
10#-Q- curie #MSUB -c ::default_core::
11#-Q- curie #MSUB -A ::default_project::
12#-Q- curie set +x
13#-Q- irene ######################
14#-Q- irene ## IRENE   TGCC/CEA ##
15#-Q- irene ######################
16#-Q- irene #MSUB -r METRICS_ORCHIDEE # Job name
17#-Q- irene #MSUB -eo
18#-Q- irene #MSUB -n 1
19#-Q- irene #MSUB -T 714400           # Maximum elapsed time
20#-Q- irene #MSUB -q skylake
21#-Q- irene #MSUB -c 4
22#-Q- irene #MSUB -Q normal
23#-Q- irene #MSUB -A ::default_project::
24#-Q- irene ###MSUB -m store,work,scratch
25#-Q- irene #MSUB -E '--licenses=fs_unshare,fs_work,fs_store,fs_scratch'
26#-Q- irene set +x
27#-Q- ada #!/bin/ksh
28#-Q- ada #######################
29#-Q- ada ## ADA         IDRIS ##
30#-Q- ada #######################
31#-Q- ada # @ job_type = mpich
32#-Q- ada # @ requirements = (Feature == "prepost")
33#-Q- ada # Temps Elapsed max. d'une requete hh:mm:ss
34#-Q- ada # @ wall_clock_limit = 4:00:00
35#-Q- ada # Nom du travail LoadLeveler
36#-Q- ada # @ job_name   = METRICS_ORCHIDEE
37#-Q- ada # Fichier de sortie standard du travail
38#-Q- ada # @ output     = $(job_name).$(jobid)
39#-Q- ada # Fichier de sortie d'erreur du travail
40#-Q- ada # @ error      =  $(job_name).$(jobid)
41#-Q- ada # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
42#-Q- ada # @ notification = error
43#-Q- ada # @ environment  = $POST_DIR ; $Script_Post_Output ; $SUBMIT_DIR ; $libIGCM ; $DEBUG_debug ; $BigBrother ; $postProcessingStopLevel ; $R_INIT ; $R_BC ; $StandAlone ; $RESOL_ATM ; $RESOL_OCE ; $RESOL_ICE ; $RESOL_MBG ; $RESOL_SRF ; $RESOL_SBG ; $YEARS ; $DIR_OUT ; $MASTER ; $libIGCM_SX ; wall_clock_limit=$(wall_clock_limit)
44#-Q- ada # @ queue
45#-Q- lxiv8 ######################
46#-Q- lxiv8 ## OBELIX      LSCE ##
47#-Q- lxiv8 ######################
48#-Q- lxiv8 #PBS -N METRICS_ORCHIDEE
49#-Q- lxiv8 #PBS -m a
50#-Q- lxiv8 #PBS -j oe
51#-Q- lxiv8 #PBS -q test
52#-Q- lxiv8 #PBS -o METRICS_ORCHIDEE.$$
53#-Q- lxiv8 #PBS -S /bin/ksh
54#-Q- ifort_CICLAD ######################
55#-Q- ifort_CICLAD ##   CICLAD    IPSL ##
56#-Q- ifort_CICLAD ######################
57#-Q- ifort_CICLAD #PBS -N METRICS_ORCHIDEE
58#-Q- ifort_CICLAD #PBS -m a
59#-Q- ifort_CICLAD #PBS -j oe
60#-Q- ifort_CICLAD #PBS -q std
61#-Q- ifort_CICLAD #PBS -S /bin/ksh
62#-Q- default #!/bin/ksh
63#-Q- default ##################
64#-Q- default ## DEFAULT HOST ##
65#-Q- default ##################
66
67#**************************************************************
68# Author: Sebastien Denvil
69# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
70# $Revision::                                          $ Revision of last commit
71# $Author::                                            $ Author of last commit
72# $Date::                                              $ Date of last commit
73# IPSL (2006)
74#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
75#
76#**************************************************************
77
78#set -eu
79#set -vx
80
81date
82
83#-Q- ada export OMP_NUM_THREADS=1
84
85#D- Task type DO NOT CHANGE (computing, post-processing or checking)
86TaskType=post-processing
87
88######################################################################
89
90. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
91. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
92. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
93#-------
94. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
95. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
96. ${libIGCM}/libIGCM_comp/libIGCM_comp.ksh
97#-------
98IGCM_sys_MkdirWork ${RUN_DIR_PATH}
99IGCM_sys_Cd ${RUN_DIR_PATH}
100#-------
101( ${DEBUG_debug} ) && IGCM_debug_Check
102( ${DEBUG_debug} ) && IGCM_card_Check
103( ${DEBUG_debug} ) && IGCM_date_Check
104
105######################################################################
106
107#set -vx
108
109# ------------------------------------------------------------------
110# Test if all was right before proceeding further
111# ------------------------------------------------------------------
112IGCM_debug_Verif_Exit
113
114if [ ${StandAlone} = true ] ; then
115    CARD_DIR=${SUBMIT_DIR}
116else
117    CARD_DIR=${RUN_DIR_PATH}
118    IGCM_sys_Get_Master ${SUBMIT_DIR}/config.card ${RUN_DIR_PATH}
119    IGCM_sys_Get_Master ${SUBMIT_DIR}/run.card    ${RUN_DIR_PATH}
120    IGCM_sys_Get_Master ${SUBMIT_DIR}/COMP        ${RUN_DIR_PATH}
121    IGCM_sys_Get_Master ${SUBMIT_DIR}/POST        ${RUN_DIR_PATH}
122fi
123
124#==================================
125# First of all
126#
127# Read libIGCM compatibility version in config.card
128# Read UserChoices section
129# Read Ensemble section
130# Read Post section
131# Define all netcdf output directories
132#==================================
133IGCM_config_CommonConfiguration ${CARD_DIR}/config.card
134
135# ------------------------------------------------------------------
136# Activate BigBrother so as to supervise this job
137# ------------------------------------------------------------------
138IGCM_debug_BigBro_Initialize
139
140#==================================
141# Then set up several directories
142#==================================
143R_OUT_SRF=${R_SAVE}/SRF
144DIR_OUT=${DIR_OUT:=SE}
145RUN_DIR=${RUN_DIR_PATH}
146IGCM_sys_MkdirArchive ${R_FIGR}
147IGCM_sys_MkdirWork ${RUN_DIR}
148IGCM_sys_Cd ${RUN_DIR}
149IGCM_sys_MkdirWork METRICS/SE_${YEARS}
150
151#==================================
152# Get the file
153#==================================
154IGCM_sys_Get ${R_OUT_SRF}/Analyse/${DIR_OUT}/${config_UserChoices_JobName}_SE_${YEARS}_1M_sechiba_history.nc ${RUN_DIR}
155
156#==================================
157# Get the fileCompute gpptot
158#==================================
159IGCM_sys_ncap2 -s 'gpptot = gpp.total($veget)/1000' ${config_UserChoices_JobName}_SE_${YEARS}_1M_sechiba_history.nc tmpout.nc
160IGCM_sys_ncatted -O -a units,gpptot,o,c,"kg m-2 s-1" tmpout.nc
161IGCM_sys_Mv tmpout.nc ${config_UserChoices_JobName}_SE_${YEARS}_1M_sechiba_history.nc
162
163#==================================
164# Group of metrics we will compute
165#==================================
166GroupsOfMetrics='ORCHIDEE_PCMDI'
167MP_Version=v3
168
169#==================================
170# SET UP THE PATH (wont be done in libIGCM_sys because setup_runtime.sh is way too intrusive)
171#==================================
172. ${PCMDI_MP}/work_install_${MP_Version}/PCMDI_METRICS/bin/setup_runtime.sh
173
174for metricsGroupName in ${GroupsOfMetrics} ; do
175
176  #==================================
177  # Appropriate configuration template
178  #==================================
179  IGCM_sys_Cp ${PCMDI_MP}/work_install_${MP_Version}/PCMDI_METRICS/doc/parameter_files/input_parameters_${metricsGroupName}_template.py template.py
180
181  #==================================
182  # Configure template for histmth.nc
183  #==================================
184  IGCM_comp_modifyFile template.py path_and_filename \'./${config_UserChoices_JobName}_SE_${YEARS}_1M_sechiba_history.nc\'
185  IGCM_comp_modifyFile template.py filename \'${config_UserChoices_JobName}_SE_${YEARS}_1M_sechiba_history.nc\'
186  IGCM_comp_modifyFile template.py attributes_provided \'IPSL_Extended\'
187  IGCM_comp_modifyFile template.py Login  \'${LOGIN}\'
188  IGCM_comp_modifyFile template.py model_versions \[\'${config_UserChoices_TagName}\'\]
189  IGCM_comp_modifyFile template.py experiment  \'${config_UserChoices_ExperimentName}\'
190  IGCM_comp_modifyFile template.py realization \'${config_UserChoices_JobName}\'
191  IGCM_comp_modifyFile template.py project_id \'IPSL\-${config_UserChoices_SpaceName}\'
192  IGCM_comp_modifyFile template.py ModelFreeSpace "\"${config_UserChoices_LongName}\""
193  IGCM_comp_modifyFile template.py case_id \'${metricsGroupName}\'
194  IGCM_comp_modifyFile template.py obs_data_path  \'${R_IN}/ReferenceDatasets/climatos\'
195  IGCM_comp_modifyFile template.py metrics_output_path \'${RUN_DIR}/METRICS/SE_${YEARS}\'
196  IGCM_comp_modifyFile template.py model_clims_interpolated_output \'${RUN_DIR}\'
197
198  #==================================
199  # Compute metrics
200  #==================================
201  python ${PCMDI_MP}/work_install_${MP_Version}/PCMDI_METRICS/bin/pcmdi_metrics_driver.py -p template.py
202
203  #==================================
204  # Export metrics to mongoDB system
205  #==================================
206  IGCM_debug_sendAMQP_Metrics METRICS/SE_${YEARS}/${metricsGroupName} ${metricsGroupName}
207
208done
209
210#==================================
211# Save files
212#==================================
213IGCM_sys_Put_Dir METRICS ${R_FIGR}
214IGCM_sys_Rm -Rf METRICS
215IGCM_sys_Rm ${config_UserChoices_JobName}_SE_${YEARS}_1M_histmth.nc
216
217# Clean RUN_DIR_PATH (necessary for cesium and titane only)
218IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
219
220# ------------------------------------------------------------------
221# Finalize BigBrother to inform that the jobs end
222# ------------------------------------------------------------------
223IGCM_debug_BigBro_Finalize
Note: See TracBrowser for help on using the repository browser.