source: trunk/libIGCM/AA_metrics_ORCHIDEE @ 1438

Last change on this file since 1438 was 1437, checked in by jgipsl, 6 years ago

For Irene:

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