source: trunk/libIGCM/AA_metrics_NEMO @ 1460

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

Change in headers at irene : removed temporary settings -E '--licenses=fs_unshare,fs_work,fs_store,fs_scratch' and now use option -m store,work,scratch. The temporary settings were needed because a bug with resubmitting jobs at workdir/irene. This has been fixed by TGCC.

  • Property svn:keywords set to Author Revision Date
File size: 10.3 KB
Line 
1#-Q- curie ######################
2#-Q- curie ## CURIE   TGCC/CEA ##
3#-Q- curie ######################
4#-Q- curie #MSUB -r METRICS_NEMO       # 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_NEMO # 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_NEMO
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_NEMO
48#-Q- lxiv8 #PBS -m a
49#-Q- lxiv8 #PBS -j oe
50#-Q- lxiv8 #PBS -q test
51#-Q- lxiv8 #PBS -o METRICS_NEMO.$$
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_NEMO
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_OCE=${R_SAVE}/OCE
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_OCE}/Analyse/${DIR_OUT}/${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc ${RUN_DIR}
154
155#==================================
156# Rename variables
157#==================================
158IGCM_sys_ncrename -v .votemper,t -v .thetao,to -v .vosaline,so -v .somxl010,mldpt -v .mldr10_1,mldpt -v .sosstsst,tos -v .sossheig,zos -v .sosaline,sos -v .sowaflup,wfo ${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc
159
160#==================================
161# Interpolate vertical levels
162#==================================
163IGCM_sys_cdo intlevel,50,100,250,500,1000 -selvar,to,so ${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc ${config_UserChoices_JobName}_SE_${YEARS}_1MVertLevels_grid_T.nc
164
165#==================================
166# Identify grid label from opa9.card
167#==================================
168IGCM_card_DefineVariableFromOption ${CARD_DIR}/COMP/opa9.card UserChoices ORCA_version
169IGCM_debug_Print 3 "ORCA_VERSION=${opa9_UserChoices_ORCA_version}"
170
171#==================================
172# To be found soon from the synchronized igcmg repository instead
173#==================================
174orca_grid=${DB}/grids/${opa9_UserChoices_ORCA_version}_grid.nc
175
176## IGCM_sys_ncks --append -v bounds_lat,bounds_lon ${orca_grid} ${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc
177## IGCM_sys_ncatted -O -a bounds,nav_lat,o,c,bounds_lat ${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc
178## IGCM_sys_ncatted -O -a bounds,nav_lon,o,c,bounds_lon ${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc
179
180## IGCM_sys_ncks --append -v bounds_lat,bounds_lon ${orca_grid} ${config_UserChoices_JobName}_SE_${YEARS}_1MVertLevels_grid_T.nc
181## IGCM_sys_ncatted -O -a bounds,nav_lat,o,c,bounds_lat ${config_UserChoices_JobName}_SE_${YEARS}_1MVertLevels_grid_T.nc
182## IGCM_sys_ncatted -O -a bounds,nav_lon,o,c,bounds_lon ${config_UserChoices_JobName}_SE_${YEARS}_1MVertLevels_grid_T.nc
183
184#==================================
185# Group of metrics we will compute
186#==================================
187GroupsOfMetrics='NEMO_PCMDI NEMO_LatBandsAndRegions NEMO_VertLevels'
188MP_Version=v3
189
190#==================================
191# SET UP THE PATH (wont be done in libIGCM_sys because setup_runtime.sh is way too intrusive)
192#==================================
193. ${PCMDI_MP}/work_install_${MP_Version}/PCMDI_METRICS/bin/setup_runtime.sh
194
195for metricsGroupName in ${GroupsOfMetrics} ; do
196
197  #==================================
198  # Appropriate configuration template
199  #==================================
200  IGCM_sys_Cp ${PCMDI_MP}/work_install_${MP_Version}/PCMDI_METRICS/doc/parameter_files/input_parameters_${metricsGroupName}_template.py template.py
201
202  #==================================
203  # Configure template for grid_T.nc
204  #==================================
205
206  if [ ${metricsGroupName} != "NEMO_VertLevels" ] ; then
207    IGCM_comp_modifyFile template.py path_and_filename \'./${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc\'
208    IGCM_comp_modifyFile template.py filename \'${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc\'
209  else
210    IGCM_comp_modifyFile template.py path_and_filename \'./${config_UserChoices_JobName}_SE_${YEARS}_1MVertLevels_grid_T.nc\'
211    IGCM_comp_modifyFile template.py filename \'${config_UserChoices_JobName}_SE_${YEARS}_1MVertLevels_grid_T.nc\'
212  fi
213  IGCM_comp_modifyFile template.py attributes_provided \'IPSL_Extended\'
214  IGCM_comp_modifyFile template.py Login  \'${LOGIN}\'
215  IGCM_comp_modifyFile template.py model_versions \[\'${config_UserChoices_TagName}\'\]
216  IGCM_comp_modifyFile template.py experiment  \'${config_UserChoices_ExperimentName}\'
217  IGCM_comp_modifyFile template.py realization \'${config_UserChoices_JobName}\'
218  IGCM_comp_modifyFile template.py project_id \'IPSL\-${config_UserChoices_SpaceName}\'
219  IGCM_comp_modifyFile template.py ModelFreeSpace "\"${config_UserChoices_LongName}\""
220  IGCM_comp_modifyFile template.py case_id \'${metricsGroupName}\'
221  IGCM_comp_modifyFile template.py obs_data_path  \'${R_IN}/ReferenceDatasets/climatos\'
222  IGCM_comp_modifyFile template.py metrics_output_path \'${RUN_DIR}/METRICS/SE_${YEARS}\'
223  IGCM_comp_modifyFile template.py model_clims_interpolated_output \'${RUN_DIR}\'
224
225  #==================================
226  # Compute metrics
227  #==================================
228  python ${PCMDI_MP}/work_install_${MP_Version}/PCMDI_METRICS/bin/pcmdi_metrics_driver.py -p template.py
229
230  #==================================
231  # Export metrics to mongoDB system
232  #==================================
233  IGCM_debug_sendAMQP_Metrics METRICS/SE_${YEARS}/${metricsGroupName} ${metricsGroupName}
234
235done 
236
237#==================================
238# Save files
239#==================================
240IGCM_sys_Put_Dir METRICS ${R_FIGR}
241IGCM_sys_Rm -Rf METRICS
242IGCM_sys_Rm ${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc
243
244# Clean RUN_DIR_PATH (necessary for cesium and titane only)
245IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
246
247# ------------------------------------------------------------------
248# Finalize BigBrother to inform that the jobs end
249# ------------------------------------------------------------------
250IGCM_debug_BigBro_Finalize
Note: See TracBrowser for help on using the repository browser.