source: trunk/LMDZ.MARS/deftank/pem/run_pem1 @ 3023

Last change on this file since 3023 was 2963, checked in by romain.vande, 20 months ago

Mars PEM :

Adapt PEM to the subslope PCM configuration, it is now fully compatible.

Create a PEM folder in deftank that contains:

run_pem1: a bash file that runs chained simulation of PEM as well as running a parameterizable number of PCM simulation in between.

It also takes care of reshaping XIOS output as well as renaming outputs etc… in the spirit of run_month1.

It is written for Irene machine and the header needs to be adapted for other machines.

run_PEM.def: A text file that shows the possible parameters to choose before a PEM simulation.

It should be included at the end of run.def just like callphys.def

ob_ex_lsp.asc: An ascii file containing the obliquity, eccentricity, ls_peri data from Laskar in Martian year.
README: A txt file explaining the content of the folder

Adapt field_def_physics_mars.xml to consider the case with 7 subslopes in the PCM.
Change context_lmdz_physics.xml to be able to output the file needed by the PEM.

Correct a few other minor bugs.

RV

File size: 3.5 KB
Line 
1#!/bin/bash
2# Partition to run on:
3#MSUB -q rome
4# project to run on
5#MSUB -A  gen10391
6# disks to use
7#MSUB -m  scratch,work,store
8# Job name
9#MSUB -r run_PEM
10# Job standard output:
11#MSUB -o run_PEM.%I
12# Job standard error:
13#MSUB -e run_PEM.%I
14# number of OpenMP threads c
15#MSUB -c 5
16# number of MPI tasks n
17#MSUB -n 24
18# number of nodes to use N
19#MSUB -N 1
20# max job run time T (in seconds)
21#MSUB -T 86000
22# request exclusive use of the node (128 cores)
23#MSUB -x
24
25# A few parameters that might need be changed depending on your setup:
26# Path to the arch.env to source
27source ../trunk/LMDZ.COMMON/arch.env
28# Number of threads to use (must be the same as "#MSUB -c" above)
29export OMP_NUM_THREADS=5
30export OMP_STACKSIZE=400M
31
32set -xv
33ls -al
34
35#------------------Modify here the number of PEM call----------------------
36
37## set starting PEM first and last number call:
38num_PEM_now=1
39num_PEM_end=10
40(( num_PEM_previous = $num_PEM_now - 1 ))
41
42#-----------------Modify here the number of GCM call between each PEM ---------
43
44## set number of GCM call between each PEM call:
45nb_GCM_call=2
46
47#----------------Here we launch GCM call year by year ---------
48
49(( num_GCM_now = ($num_PEM_now - 1)* $nb_GCM_call + 1 ))
50(( num_GCM_previous = $num_GCM_now - 1 ))
51(( num_GCM_end = $num_GCM_previous + $nb_GCM_call ))
52echo "$num_GCM_previous" > num_run
53
54while [ $num_GCM_now -le $num_GCM_end ]
55do
56  sed s/9999/669/ run.def.ref > run.def
57  ./run0 >> error
58  ((num_GCM_now++))
59  (( num_GCM_previous = $num_GCM_now - 1 ))
60  echo "$num_GCM_previous" > num_run
61done
62
63#--------------- We reshape the GCM data from XIOS-------------------
64
65(( num_GCM_previous_previous = $num_GCM_previous - 1 ))
66
67cp Xdiurnalave${num_GCM_previous_previous}.nc data2reshape1.nc
68echo "y"
69cp Xdiurnalave${num_GCM_previous}.nc data2reshape2.nc
70echo "y"
71
72rm -rf datareshaped1.nc
73rm -rf datareshaped2.nc
74
75./reshape_XIOS_output_64x48x54_phymars_seq.e
76
77#---------------- We rename files for the PEM call----------------
78
79cp startfi${num_GCM_previous}.nc startfi_evol.nc
80echo "y"
81cp startfi${num_GCM_previous}.nc startfi${num_GCM_previous}_GCM.nc
82
83cp start${num_GCM_previous}.nc start_evol.nc
84echo "y"
85cp start${num_GCM_previous}.nc start${num_GCM_previous}_GCM.nc
86
87mv datareshaped1.nc data_GCM_Y1.nc
88echo "y"
89mv datareshaped2.nc data_GCM_Y2.nc
90echo "y"
91
92#--------------- We run the PEM ------------------
93
94if [[ -r run.def_PEM ]] ; then
95  cp run.def_PEM run.def
96  echo "y"
97fi
98if [[ -r diagfi.def_PEM ]] ; then
99  cp diagfi.def_PEM diagfi.def
100  echo "y"
101fi
102
103./pem_64x48x54_phymars_seq.e > PEMrun${num_PEM_now} 2>&1
104
105if [[ -r run.def_GCM ]] ; then
106  cp run.def_GCM run.def
107  echo "y"
108fi
109if [[ -r diagfi.def_GCM ]] ; then
110  cp diagfi.def_GCM diagfi.def
111  echo "y"
112fi
113
114#--------------- We rename PEM output ------------------
115
116cp restartfi_evol.nc startfi${num_GCM_previous}_post_PEM.nc
117cp restartfi_evol.nc startfi${num_GCM_previous}.nc
118echo "y"
119
120cp restart_evol.nc start${num_GCM_previous}_post_PEM.nc
121cp restart_evol.nc start${num_GCM_previous}.nc
122echo "y"
123
124(( num_PEM_next = $num_PEM_now + 1 ))
125
126cp restartfi_PEM.nc startfi_PEM${num_PEM_now}.nc
127cp restartfi_PEM.nc startfi_PEM.nc
128echo "y"
129
130if [[ -r diagfi.nc ]] ; then
131  \mv -f diagfi.nc diagfi${num_PEM_now}_PEM.nc
132fi
133
134#------------------- Launch the next PEM call------------------
135
136# launch job for next month
137if (( $num_PEM_next <= $num_PEM_end )) ; then
138  cp -f run_pem$num_PEM_now tmp
139  sed -e "s@run_pem${num_PEM_now}@run_pem${num_PEM_next}@" \
140      -e "s@num_PEM_now=${num_PEM_now}@num_PEM_now=${num_PEM_next}@" tmp > run_pem$num_PEM_next
141  rm tmp
142 
143  ccc_msub run_pem$num_PEM_next
144fi
Note: See TracBrowser for help on using the repository browser.