source: trunk/libIGCM/AA_metrics_LMDZ @ 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 Revision Author Date
File size: 9.0 KB
Line 
1#-Q- curie ######################
2#-Q- curie ## CURIE   TGCC/CEA ##
3#-Q- curie ######################
4#-Q- curie #MSUB -r METRICS_LMDZ       # 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 -c ::default_core::
10#-Q- curie #MSUB -Q normal
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_LMDZ   # Job name
17#-Q- irene #MSUB -eo
18#-Q- irene #MSUB -n 1
19#-Q- irene #MSUB -T 14400          # 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_LMDZ
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_LMDZ
48#-Q- lxiv8 #PBS -m a
49#-Q- lxiv8 #PBS -j oe
50#-Q- lxiv8 #PBS -q test
51#-Q- lxiv8 #PBS -o METRICS_LMDZ.$$
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_LMDZ
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_ATM=${R_SAVE}/ATM
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_ATM}/Analyse/${DIR_OUT}/${config_UserChoices_JobName}_SE_${YEARS}_1M_histmth.nc ${RUN_DIR}
154IGCM_sys_Get ${R_OUT_ATM}/Analyse/${DIR_OUT}/${config_UserChoices_JobName}_SE_${YEARS}_1M_histmthNMC.nc ${RUN_DIR}
155
156#==================================
157# Group of metrics we will compute
158#==================================
159GroupsOfMetrics='LMDZ_PCMDI LMDZ_JetLat LMDZ_OverOceanRegions'
160MP_Version=v3
161
162#==================================
163# SET UP THE PATH (wont be done in libIGCM_sys because setup_runtime.sh is way too intrusive)
164#==================================
165. ${PCMDI_MP}/work_install_${MP_Version}/PCMDI_METRICS/bin/setup_runtime.sh
166
167for metricsGroupName in ${GroupsOfMetrics} ; do
168
169  #==================================
170  # Appropriate configuration template
171  #==================================
172  IGCM_sys_Cp ${PCMDI_MP}/work_install_${MP_Version}/PCMDI_METRICS/doc/parameter_files/input_parameters_${metricsGroupName}_template.py template.py
173
174  #==================================
175  # Configure template for histmth.nc
176  #==================================
177  IGCM_comp_modifyFile template.py path_and_filename \'./${config_UserChoices_JobName}_SE_${YEARS}_1M_histmth.nc\'
178  IGCM_comp_modifyFile template.py filename \'${config_UserChoices_JobName}_SE_${YEARS}_1M_histmth.nc\'
179  IGCM_comp_modifyFile template.py attributes_provided \'IPSL_Extended\'
180  IGCM_comp_modifyFile template.py Login  \'${LOGIN}\'
181  IGCM_comp_modifyFile template.py model_versions \[\'${config_UserChoices_TagName}\'\]
182  IGCM_comp_modifyFile template.py experiment  \'${config_UserChoices_ExperimentName}\'
183  IGCM_comp_modifyFile template.py realization \'${config_UserChoices_JobName}\'
184  IGCM_comp_modifyFile template.py project_id \'IPSL\-${config_UserChoices_SpaceName}\'
185  IGCM_comp_modifyFile template.py ModelFreeSpace "\"${config_UserChoices_LongName}\""
186  IGCM_comp_modifyFile template.py case_id \'${metricsGroupName}\'
187  IGCM_comp_modifyFile template.py obs_data_path  \'${R_IN}/ReferenceDatasets/climatos\'
188  IGCM_comp_modifyFile template.py metrics_output_path \'${RUN_DIR}/METRICS/SE_${YEARS}\'
189  IGCM_comp_modifyFile template.py model_clims_interpolated_output \'${RUN_DIR}\'
190
191  #==================================
192  # Compute metrics
193  #==================================
194  python ${PCMDI_MP}/work_install_${MP_Version}/PCMDI_METRICS/bin/pcmdi_metrics_driver.py -p template.py
195
196  if [ ${metricsGroupName} != "LMDZ_OverOceanRegions" ] ; then
197    #==================================
198    # (Re)Configure template for histmthNMC.nc
199    #==================================
200    IGCM_comp_modifyFile template.py path_and_filename \'./${config_UserChoices_JobName}_SE_${YEARS}_1M_histmthNMC.nc\'
201    IGCM_comp_modifyFile template.py filename \'${config_UserChoices_JobName}_SE_${YEARS}_1M_histmthNMC.nc\'
202
203    #==================================
204    # Compute metrics for histmthNMC.nc
205    #==================================
206    python ${PCMDI_MP}/work_install_${MP_Version}/PCMDI_METRICS/bin/pcmdi_metrics_driver.py -p template.py
207  fi
208
209  #==================================
210  # Export metrics to mongoDB system
211  #==================================
212  IGCM_debug_sendAMQP_Metrics METRICS/SE_${YEARS}/${metricsGroupName} ${metricsGroupName}
213
214done
215
216#==================================
217# Save files
218#==================================
219IGCM_sys_Put_Dir METRICS ${R_FIGR}
220IGCM_sys_Rm -Rf METRICS
221IGCM_sys_Rm ${config_UserChoices_JobName}_SE_${YEARS}_1M_histmth.nc
222
223# Clean RUN_DIR_PATH (necessary for cesium and titane only)
224IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
225
226# ------------------------------------------------------------------
227# Finalize BigBrother to inform that the jobs end
228# ------------------------------------------------------------------
229IGCM_debug_BigBro_Finalize
Note: See TracBrowser for help on using the repository browser.