source: trunk/libIGCM/AA_metrics_NEMO @ 1572

Last change on this file since 1572 was 1568, checked in by jgipsl, 17 months ago

Change the variable SYSTEM=lxiv8 into SYSTEM=obelix. This is done to make the connexion easier between the variable SYSTEM and the file libIGCM_sys_XXXX.ksh which now always should be libIGCM_sys_${SYSTEM}.ksh

  • Property svn:keywords set to Author Revision Date
File size: 11.0 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 -o METRICS_NEMO.out_%I
6#-Q- curie #MSUB -e METRICS_NEMO.out_%I
7#-Q- curie #MSUB -n 1              # Reservation du processus
8#-Q- curie #MSUB -T 14400          # Limite de temps elapsed du job
9#-Q- curie #MSUB -q ::default_node::
10#-Q- curie #MSUB -c ::default_core::
11#-Q- curie #MSUB -Q normal
12#-Q- curie #MSUB -A ::default_project::
13#-Q- curie set +x
14#-Q- irene ######################
15#-Q- irene ## IRENE   TGCC/CEA ##
16#-Q- irene ######################
17#-Q- irene #MSUB -r METRICS_NEMO # Job name
18#-Q- irene #MSUB -o METRICS_NEMO.out_%I
19#-Q- irene #MSUB -e METRICS_NEMO.out_%I
20#-Q- irene #MSUB -n 1
21#-Q- irene #MSUB -T 14400        # Maximum elapsed time
22#-Q- irene #MSUB -q ::default_node::
23#-Q- irene #MSUB -c ::default_core::
24#-Q- irene #MSUB -Q normal
25#-Q- irene #MSUB -A ::default_post_project::
26#-Q- irene #MSUB -m store,work,scratch
27#-Q- irene set +x
28#-Q- irene-amd ######################
29#-Q- irene-amd ## IRENE   TGCC/CEA ##
30#-Q- irene-amd ######################
31#-Q- irene-amd #MSUB -r METRICS_NEMO # Job name
32#-Q- irene-amd #MSUB -o METRICS_NEMO.out_%I
33#-Q- irene-amd #MSUB -e METRICS_NEMO.out_%I
34#-Q- irene-amd #MSUB -n 1
35#-Q- irene-amd #MSUB -T 14400        # Maximum elapsed time
36#-Q- irene-amd #MSUB -q ::default_node::
37#-Q- irene-amd #MSUB -c ::default_core::
38#-Q- irene-amd #MSUB -Q normal
39#-Q- irene-amd #MSUB -A ::default_post_project::
40#-Q- irene-amd #MSUB -m store,work,scratch
41#-Q- irene-amd set +x
42#-Q- ada #!/bin/ksh
43#-Q- ada #######################
44#-Q- ada ## ADA         IDRIS ##
45#-Q- ada #######################
46#-Q- ada # @ job_type = mpich
47#-Q- ada # @ requirements = (Feature == "prepost")
48#-Q- ada # Temps Elapsed max. d'une requete hh:mm:ss
49#-Q- ada # @ wall_clock_limit = 4:00:00
50#-Q- ada # Nom du travail LoadLeveler
51#-Q- ada # @ job_name   = METRICS_NEMO
52#-Q- ada # Fichier de sortie standard du travail
53#-Q- ada # @ output     = $(job_name).$(jobid)
54#-Q- ada # Fichier de sortie d'erreur du travail
55#-Q- ada # @ error      =  $(job_name).$(jobid)
56#-Q- ada # pour recevoir un mail en cas de depassement du temps Elapsed (ou autre pb.)
57#-Q- ada # @ notification = error
58#-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)
59#-Q- ada # @ queue
60#-Q- obelix ######################
61#-Q- obelix ## OBELIX      LSCE ##
62#-Q- obelix ######################
63#-Q- obelix #PBS -N METRICS_NEMO
64#-Q- obelix #PBS -m a
65#-Q- obelix #PBS -j oe
66#-Q- obelix #PBS -q test
67#-Q- obelix #PBS -o METRICS_NEMO.$$
68#-Q- obelix #PBS -S /bin/ksh
69#-Q- ifort_CICLAD ######################
70#-Q- ifort_CICLAD ##   CICLAD    IPSL ##
71#-Q- ifort_CICLAD ######################
72#-Q- ifort_CICLAD #PBS -N METRICS_NEMO
73#-Q- ifort_CICLAD #PBS -m a
74#-Q- ifort_CICLAD #PBS -j oe
75#-Q- ifort_CICLAD #PBS -q std
76#-Q- ifort_CICLAD #PBS -S /bin/ksh
77#-Q- default #!/bin/ksh
78#-Q- default ##################
79#-Q- default ## DEFAULT HOST ##
80#-Q- default ##################
81
82#**************************************************************
83# Author: Sebastien Denvil
84# Contact: Sebastien.Denvil__at__ipsl.jussieu.fr
85# $Revision::                                          $ Revision of last commit
86# $Author::                                            $ Author of last commit
87# $Date::                                              $ Date of last commit
88# IPSL (2006)
89#  This software is governed by the CeCILL licence see libIGCM/libIGCM_CeCILL.LIC
90#
91#**************************************************************
92
93#set -eu
94#set -vx
95
96date
97
98#-Q- ada export OMP_NUM_THREADS=1
99
100#D- Task type DO NOT CHANGE (computing, post-processing or checking)
101TaskType=post-processing
102
103######################################################################
104
105. ${libIGCM}/libIGCM_debug/libIGCM_debug.ksh
106. ${libIGCM}/libIGCM_card/libIGCM_card.ksh
107. ${libIGCM}/libIGCM_date/libIGCM_date.ksh
108#-------
109. ${libIGCM}/libIGCM_sys/libIGCM_sys.ksh
110. ${libIGCM}/libIGCM_config/libIGCM_config.ksh
111. ${libIGCM}/libIGCM_comp/libIGCM_comp.ksh
112#-------
113IGCM_sys_MkdirWork ${RUN_DIR_PATH}
114IGCM_sys_Cd ${RUN_DIR_PATH}
115#-------
116( ${DEBUG_debug} ) && IGCM_debug_Check
117( ${DEBUG_debug} ) && IGCM_card_Check
118( ${DEBUG_debug} ) && IGCM_date_Check
119
120######################################################################
121
122#set -vx
123
124# ------------------------------------------------------------------
125# Test if all was right before proceeding further
126# ------------------------------------------------------------------
127IGCM_debug_Verif_Exit
128
129if [ ${StandAlone} = true ] ; then
130    CARD_DIR=${SUBMIT_DIR}
131else
132    CARD_DIR=${RUN_DIR_PATH}
133    IGCM_sys_Get_Master ${SUBMIT_DIR}/config.card ${RUN_DIR_PATH}
134    IGCM_sys_Get_Master ${SUBMIT_DIR}/run.card    ${RUN_DIR_PATH}
135    IGCM_sys_Get_Master ${SUBMIT_DIR}/COMP        ${RUN_DIR_PATH}
136    IGCM_sys_Get_Master ${SUBMIT_DIR}/POST        ${RUN_DIR_PATH}
137fi
138
139#==================================
140# First of all
141#
142# Read libIGCM compatibility version in config.card
143# Read UserChoices section
144# Read Ensemble section
145# Read Post section
146# Define all netcdf output directories
147#==================================
148IGCM_config_CommonConfiguration ${CARD_DIR}/config.card
149
150# ------------------------------------------------------------------
151# Activate BigBrother so as to supervise this job
152# ------------------------------------------------------------------
153IGCM_debug_BigBro_Initialize
154
155#==================================
156# Then set up several directories
157#==================================
158R_OUT_OCE=${R_SAVE}/OCE
159DIR_OUT=${DIR_OUT:=SE}
160RUN_DIR=${RUN_DIR_PATH}
161IGCM_sys_MkdirArchive ${R_FIGR}
162IGCM_sys_MkdirWork ${RUN_DIR}
163IGCM_sys_Cd ${RUN_DIR}
164IGCM_sys_MkdirWork METRICS/SE_${YEARS}
165
166#==================================
167# Get the file
168#==================================
169IGCM_sys_Get ${R_OUT_OCE}/Analyse/${DIR_OUT}/${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc ${RUN_DIR}
170
171#==================================
172# Rename variables
173#==================================
174IGCM_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
175
176#==================================
177# Interpolate vertical levels
178#==================================
179IGCM_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
180
181#==================================
182# Identify grid label from opa9.card
183#==================================
184IGCM_card_DefineVariableFromOption ${CARD_DIR}/COMP/opa9.card UserChoices ORCA_version
185IGCM_debug_Print 3 "ORCA_VERSION=${opa9_UserChoices_ORCA_version}"
186
187#==================================
188# To be found soon from the synchronized igcmg repository instead
189#==================================
190orca_grid=${DB}/grids/${opa9_UserChoices_ORCA_version}_grid.nc
191
192## IGCM_sys_ncks --append -v bounds_lat,bounds_lon ${orca_grid} ${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc
193## IGCM_sys_ncatted -O -a bounds,nav_lat,o,c,bounds_lat ${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc
194## IGCM_sys_ncatted -O -a bounds,nav_lon,o,c,bounds_lon ${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc
195
196## IGCM_sys_ncks --append -v bounds_lat,bounds_lon ${orca_grid} ${config_UserChoices_JobName}_SE_${YEARS}_1MVertLevels_grid_T.nc
197## IGCM_sys_ncatted -O -a bounds,nav_lat,o,c,bounds_lat ${config_UserChoices_JobName}_SE_${YEARS}_1MVertLevels_grid_T.nc
198## IGCM_sys_ncatted -O -a bounds,nav_lon,o,c,bounds_lon ${config_UserChoices_JobName}_SE_${YEARS}_1MVertLevels_grid_T.nc
199
200#==================================
201# Group of metrics we will compute
202#==================================
203GroupsOfMetrics='NEMO_PCMDI NEMO_LatBandsAndRegions NEMO_VertLevels'
204MP_Version=v3
205
206#==================================
207# SET UP THE PATH (wont be done in libIGCM_sys because setup_runtime.sh is way too intrusive)
208#==================================
209. ${PCMDI_MP}/work_install_${MP_Version}/PCMDI_METRICS/bin/setup_runtime.sh
210
211for metricsGroupName in ${GroupsOfMetrics} ; do
212
213  #==================================
214  # Appropriate configuration template
215  #==================================
216  IGCM_sys_Cp ${PCMDI_MP}/work_install_${MP_Version}/PCMDI_METRICS/doc/parameter_files/input_parameters_${metricsGroupName}_template.py template.py
217
218  #==================================
219  # Configure template for grid_T.nc
220  #==================================
221
222  if [ ${metricsGroupName} != "NEMO_VertLevels" ] ; then
223    IGCM_comp_modifyFile template.py path_and_filename \'./${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc\'
224    IGCM_comp_modifyFile template.py filename \'${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc\'
225  else
226    IGCM_comp_modifyFile template.py path_and_filename \'./${config_UserChoices_JobName}_SE_${YEARS}_1MVertLevels_grid_T.nc\'
227    IGCM_comp_modifyFile template.py filename \'${config_UserChoices_JobName}_SE_${YEARS}_1MVertLevels_grid_T.nc\'
228  fi
229  IGCM_comp_modifyFile template.py attributes_provided \'IPSL_Extended\'
230  IGCM_comp_modifyFile template.py Login  \'${LOGIN}\'
231  IGCM_comp_modifyFile template.py model_versions \[\'${config_UserChoices_TagName}\'\]
232  IGCM_comp_modifyFile template.py experiment  \'${config_UserChoices_ExperimentName}\'
233  IGCM_comp_modifyFile template.py realization \'${config_UserChoices_JobName}\'
234  IGCM_comp_modifyFile template.py project_id \'IPSL\-${config_UserChoices_SpaceName}\'
235  IGCM_comp_modifyFile template.py ModelFreeSpace "\"${config_UserChoices_LongName}\""
236  IGCM_comp_modifyFile template.py case_id \'${metricsGroupName}\'
237  IGCM_comp_modifyFile template.py obs_data_path  \'${R_IN}/ReferenceDatasets/climatos\'
238  IGCM_comp_modifyFile template.py metrics_output_path \'${RUN_DIR}/METRICS/SE_${YEARS}\'
239  IGCM_comp_modifyFile template.py model_clims_interpolated_output \'${RUN_DIR}\'
240
241  #==================================
242  # Compute metrics
243  #==================================
244  python ${PCMDI_MP}/work_install_${MP_Version}/PCMDI_METRICS/bin/pcmdi_metrics_driver.py -p template.py
245
246  #==================================
247  # Export metrics to mongoDB system
248  #==================================
249  IGCM_debug_sendAMQP_Metrics METRICS/SE_${YEARS}/${metricsGroupName} ${metricsGroupName}
250
251done 
252
253#==================================
254# Save files
255#==================================
256IGCM_sys_Put_Dir METRICS ${R_FIGR}
257IGCM_sys_Rm -Rf METRICS
258IGCM_sys_Rm ${config_UserChoices_JobName}_SE_${YEARS}_1M_grid_T.nc
259
260# Clean RUN_DIR_PATH (necessary for cesium and titane only)
261IGCM_sys_RmRunDir -Rf ${RUN_DIR_PATH}
262
263# ------------------------------------------------------------------
264# Finalize BigBrother to inform that the jobs end
265# ------------------------------------------------------------------
266IGCM_debug_BigBro_Finalize
Note: See TracBrowser for help on using the repository browser.