source: trunk/libIGCM/AA_metrics_ORCHIDEE @ 1227

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