source: tags/libIGCM_v2.5/AA_metrics_LMDZ @ 1456

Last change on this file since 1456 was 1166, checked in by sdipsl, 9 years ago

the metrics template need more information
create IGCM_comp_modifyFile function to simply replace pattern in files
code cleanup

  • Property svn:keywords set to Revision Author Date
File size: 6.5 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 -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_LMDZ
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
29#-Q- ada # @ queue
30#-Q- lxiv8 ######################
31#-Q- lxiv8 ## OBELIX      LSCE ##
32#-Q- lxiv8 ######################
33#-Q- lxiv8 #PBS -N METRICS_LMDZ
34#-Q- lxiv8 #PBS -m a
35#-Q- lxiv8 #PBS -j oe
36#-Q- lxiv8 #PBS -q test
37#-Q- lxiv8 #PBS -o METRICS_LMDZ.$$
38#-Q- lxiv8 #PBS -S /bin/ksh
39#-Q- default #!/bin/ksh
40#-Q- default ##################
41#-Q- default ## DEFAULT HOST ##
42#-Q- default ##################
43
44#**************************************************************
45# Author: Sebastien Denvil
46# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
47# $Revision::                                          $ Revision of last commit
48# $Author::                                            $ Author of last commit
49# $Date::                                              $ Date of last commit
50# IPSL (2006)
51#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
52#
53#**************************************************************
54
55#set -eu
56#set -vx
57
58date
59
60#-Q- ada export OMP_NUM_THREADS=1
61
62#D- Task type (computing or post-processing)
63TaskType=post-processing
64
65######################################################################
66
67. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
68. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
69. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
70#-------
71. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
72. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
73. ${libIGCM}/libIGCM_comp/libIGCM_comp.ksh
74#-------
75( ${DEBUG_debug} ) && IGCM_debug_Check
76( ${DEBUG_debug} ) && IGCM_card_Check
77( ${DEBUG_debug} ) && IGCM_date_Check
78
79######################################################################
80
81#set -vx
82
83IGCM_sys_MkdirWork ${RUN_DIR_PATH}
84IGCM_sys_Cd ${RUN_DIR_PATH}
85
86# ------------------------------------------------------------------
87# Test if all was right before proceeding further
88# ------------------------------------------------------------------
89IGCM_debug_Verif_Exit_Post
90
91if [ ${StandAlone} = true ] ; then
92    CARD_DIR=${SUBMIT_DIR}
93else
94    CARD_DIR=${RUN_DIR_PATH}
95    IGCM_sys_Get_Master ${SUBMIT_DIR}/config.card ${RUN_DIR_PATH}
96    IGCM_sys_Get_Master ${SUBMIT_DIR}/run.card    ${RUN_DIR_PATH}
97    IGCM_sys_Get_Master ${SUBMIT_DIR}/COMP        ${RUN_DIR_PATH}
98    IGCM_sys_Get_Master ${SUBMIT_DIR}/POST        ${RUN_DIR_PATH}
99fi
100
101#==================================
102# First of all
103#
104# Read libIGCM compatibility version in config.card
105# Read UserChoices section
106# Read Ensemble section
107# Read Post section
108# Define all netcdf output directories
109#==================================
110IGCM_config_CommonConfiguration ${CARD_DIR}/config.card
111
112#==================================
113# Then set up several directories
114#==================================
115R_METRICS=METRICS/SE_${YEARS}
116R_OUT_ATM=${R_SAVE}/ATM
117DIR_OUT=${DIR_OUT:=SE}
118RUN_DIR=${RUN_DIR_PATH}/METRICS_LMDZ_${YEARS}
119IGCM_sys_MkdirArchive ${R_FIGR}
120IGCM_sys_MkdirWork ${RUN_DIR}
121IGCM_sys_Cd ${RUN_DIR}
122IGCM_sys_MkdirWork METRICS
123
124#==================================
125# Get the file
126#==================================
127IGCM_sys_Get ${R_OUT_ATM}/Analyse/${DIR_OUT}/${config_UserChoices_JobName}_SE_${YEARS}_1M_histmth.nc ${RUN_DIR}
128
129#==================================
130# SET UP THE PATH (will be done in libIGCM_sys later)
131#==================================
132export PATH=${PCMDI_MP}/work_install_v1/PCMDI_METRICS/bin:${PATH}
133
134#==================================
135# Appropriate configuration
136#==================================
137IGCM_sys_Cp ${PCMDI_MP}/work_install_v1/PCMDI_METRICS/doc/input_parameters_sample_for_libIGCM_template.py template.py
138
139#==================================
140# Configure template
141#==================================
142IGCM_comp_modifyFile template.py path_and_filename \'${config_UserChoices_JobName}_SE_${YEARS}_1M_histmth.nc\'
143IGCM_comp_modifyFile template.py filename \'${config_UserChoices_JobName}_SE_${YEARS}_1M_histmth.nc\'
144IGCM_comp_modifyFile template.py attributes_provided \'IPSL_Extended\'
145IGCM_comp_modifyFile template.py Center ${CENTER}
146IGCM_comp_modifyFile template.py Login  ${LOGIN}
147IGCM_comp_modifyFile template.py model_versions ${config_UserChoices_TagName}
148IGCM_comp_modifyFile template.py experiment  ${config_UserChoices_ExperimentName}
149IGCM_comp_modifyFile template.py realization ${config_UserChoices_JobName}
150IGCM_comp_modifyFile template.py project_id \'IPSL-${config_UserChoices_SpaceName}\'
151IGCM_comp_modifyFile template.py case_id \'SE_${YEARS}\'
152IGCM_comp_modifyFile template.py obs_data_path  \'${PCMDI_MP}/references-for-metrics/obs\'
153IGCM_comp_modifyFile template.py metrics_output_path \'${RUN_DIR}/METRICS\'
154IGCM_comp_modifyFile template.py model_clims_interpolated_output \'${RUN_DIR}\'
155
156#==================================
157# Compute metrics
158#==================================
159python ${PCMDI_MP}/work_install_v1/PCMDI_METRICS/bin/pcmdi_metrics_driver.py -p template.py
160
161#==================================
162# Export metrics to prodiguer system
163#==================================
164IGCM_debug_sendAMQP_Metrics METRICS/SE_${YEARS}
165
166#==================================
167# Save files
168#==================================
169IGCM_sys_Put_Dir METRICS ${R_FIGR}
170IGCM_sys_Rm -Rf METRICS
171IGCM_sys_Rm ${config_UserChoices_JobName}_SE_${YEARS}_1M_histmth.nc
172
173# Clean RUN_DIR_PATH (necessary for cesium and titane only)
174IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
Note: See TracBrowser for help on using the repository browser.