Skip to content

Commit 93b830f

Browse files
committed
edits on PDAF manual
1 parent 8fe76ce commit 93b830f

1 file changed

Lines changed: 95 additions & 62 deletions

File tree

docs/modules/pdaf.md

Lines changed: 95 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ unset ESMF_ABI
5656
PDAF version 3.0 is not compatible with previous version (2.3.1 and older), so if you have previous version, please update it to the latest one.
5757

5858
Get PDAF 3.0 from github
59-
59+
```
6060
git clone https://github.com/PDAF/PDAF.git
61+
```
6162

6263
Choose build option from folder make.arch or make one and put into it.
6364

@@ -67,146 +68,178 @@ Change compiling option if necessary. PDAF requires BLAS and LAPACK library. If
6768

6869
Here we use linux_ifort_impi.h as example, define marco as following then build the lib
6970

71+
```
7072
export ARCH=linux_ifort_impi
71-
7273
export PDAF_ARCH=$ARCH
73-
7474
make
75+
```
7576

7677
If successful, libraries & module files are located in lib and include respectively.
77-
7878

7979

80-
1.3 Build SCHISM
80+
##Build SCHISM
8181

82-
Follow https://schism-dev.github.io/schism/stable/getting-started/getting-sourcecode.html and https://schism-dev.github.io/schism/stable/getting-started/compilation.html#cmake to build schism libs.
83-
84-
Note: schism_pdaf only support scribe-IO under fully parallel mode (all ensembles run concurrently), and OLDIO (schout output nc files) under flexible mode (ensembles members run in batches, for under-resourced platform).
85-
86-
If users wish to use scribe-IO, build schism with OLDIO=OFF. If OLDIO is preferred, set OLDIO=ON.
87-
88-
schism_pdaf also supports static domain decomposition without ParMetis (requires partition.prop as input). If this feature is used, set NO_PARMETIS=ON.
82+
Follow [cmake instructions on this web](../getting-started/typical-workflow.md) to build schism libs.
8983

84+
!!!Note
85+
1. schism_pdaf only support scribe-IO under fully parallel mode (all ensembles run concurrently), and OLDIO (schout output nc files) under flexible mode (ensembles members run in batches, for under-resourced platform).
86+
2. If users wish to use scribe-IO, build schism with OLDIO=OFF. If OLDIO is preferred, set OLDIO=ON.
87+
3. schism_pdaf also supports static domain decomposition without ParMetis (requires partition.prop as input). If this feature is used, set NO_PARMETIS=ON.
9088

9189

92-
1.4 Build schism_pdaf
90+
##Build final executable: schism_pdaf
9391

9492
Get schism_pdaf code with the following:
9593

94+
```
9695
git clone https://github.com/schism-dev/schism-esmf.git
96+
```
9797

9898
Define macros for the following:
9999

100+
```
100101
export ESMFMKFILE= where ESMF lib is located
101-
102102
export SCHISM_BUILD_DIR= where schism build is located
103-
104103
export PDAF_LIB_DIR=where PDAF lib is located
105-
106104
export SCHISM_NO_PARMETIS=off (If you wish to use static decomposition, then set it on)
105+
```
107106

108107
If any library like Intel-MKL, OpenBLAS, AOCL (AMD)… is used when compiling PDAF, remember to check LDFLAGS within corresponding compiler section in the beginning of Makefile, make sure linking path & compile options are correct.
109108

110109
Then we can build schism_pdaf with the following:
111110

111+
```
112112
make distclean
113-
114113
make pdaf
114+
```
115115

116116
If successful, an executable schism_pdaf will be there.
117-
118117

119118

120-
2. Prepare the inputs
119+
#Prepare the inputs
121120

122121
The input files include:
123122

124-
i. standard schism inputs, these files depend on user case setups
125-
126-
ii. schism_pdaf control files
127-
128-
schism_pdaf.cfg: control ensemble size, # of concurrent members, scribe cores (if used), ics_set (same as ics in param.nml: coordinate system)
129-
130-
131-
132-
global.nml: control parameters for ESMF & PDAF coupling info, set starting date and run hours and DA steps. Note that the time origin info, duration and SCHISM time step need to be consistent with param.nml (under any ihot setting). Specify the DA interval with ‘num_schism_dt_in_couple’ (# of SCHISM steps when calling PDAF), and this value should always be identical as delt_obs in pdaf.nml.
123+
1. standard schism inputs, these files depend on user case setups
124+
2. schism_pdaf control files
125+
- schism_pdaf.cfg: control ensemble size, # of concurrent members, scribe cores (if used), ics_set (same as ics in param.nml: coordinate system)
126+
```
127+
# This ESMF resource file is read by the program `multi_schism`. Its only
128+
# configuration label is the number of schism instances to launch.
133129
134-
135130
136-
pdaf.nml: control pdaf parameters such as filter type, localization range…etc.
131+
# count: integer(ESMF_KIND_I4), must be in the range 1..999
132+
schism_count: 8
133+
concurrent_count: 4
134+
# scribe counter for fully parallel mode
135+
scribe_count: 6
136+
# ics_set for scribe cores
137+
ics_set: 2
138+
```
139+
- global.nml: control parameters for ESMF & PDAF coupling info, set starting date and run hours and DA steps. Note that the time origin info, duration and SCHISM time step need to be consistent with param.nml (under any ihot setting). Specify the DA interval with `num_schism_dt_in_couple` (# of SCHISM steps when calling PDAF), and this value should always be identical as delt_obs in `pdaf.nml`.
140+
```
141+
&sim_time
142+
start_year=2000
143+
start_month=1
144+
start_day=1
145+
start_hour=0
146+
runhours=24 !total run time in hours
147+
schism_dt=120 !SCHISM dt in sec (must be int)
148+
num_schism_dt_in_couple=1 !# of SCHISM steps used in the ESMF main stepping
149+
/
150+
```
137151

138-
152+
- pdaf.nml: control pdaf parameters such as filter type, localization range…etc.
153+
```
154+
!Namelist file for PDAF configuration
155+
&pdaf_nml
156+
screen = 3, ! 0 is default, use 3 to debug
157+
filtertype = 7, ! only accept 4(ETKF),5(LETKF),6(ESTKF),7(LESTKF)
158+
subtype = 0, ! subtype of filter, check details in http://pdaf.awi.de/trac/wiki/AvailableOptionsforInitPDAF
159+
delt_obs = 36, ! how many steps to do DA
160+
rms_obs = 0.5, ! observation error, will be vector later
161+
forget = 1.0, ! forgetting factor
162+
locweight = 4, ! localization weight type, 0:uniform, 1:Exponential, 2/3/4:5th-order polynomial, check details in init_pdaf
163+
local_range = 500.0, ! localization range, use lat/lon if ics=2
164+
varscale = 1.00, ! Init Ensemble Variance
165+
ihfskip_PDAF = 108, ! ihfskip for DA output, has to be multiple of delt_obs
166+
nspool_PDAF = 36, ! nspool for DA output, has to be multiple of delt_obs
167+
outf = 1, ! output handle, 0: no output, 1: ens-mean, 2: members (in schism_001...), 3: both ens-mean & members (has netcdf issues, don't use currently)
168+
nhot_PDAF = 0, ! switch to output analysis hotstart rank files
169+
nhot_write_PDAF = 36, ! nhot_write for DA hotstart output, must be a multiple of ihfskip_PDAF if nhot_PDAF=1
170+
rms_type = 1, ! obs error handle, 1: uniform error from rms_obs; 2: specify error from rms_obs2; 3: specify error from obs files with extra column
171+
rms_obs2 = 0.02, 0.1, 0.1, 0.2, 0.2, ! specified error with different type obs, z/t/s/u/v
172+
ens_init = 1, ! ens state init option, 1: use eofs & hotstart.nc, 2: same as 1 but use meanstate, 3: restart from ens.bin
173+
use_global_obs = 0, ! Option to turn on global observation searching, 0=local, 1=global
174+
Zdepth_limit = 200., ! Control SSH/SSH-A data depth limiter, default: 200m
175+
min_MSL_acDay = 10., ! Control minimum accumalation MSL day to derived SSH-A, unit: Days
176+
/
177+
```
139178

140179

141180

142-
iii. schism_pdaf ensemble inputs
181+
3. schism_pdaf ensemble inputs
143182

144-
We follow suggestions from PDAF and use Pham’s method (2001) to generate ensemble information. More details can be found from https://pdaf.awi.de/trac/wiki/EnsembleGeneration .
183+
We follow suggestions from PDAF and use Pham’s method (2001) to generate ensemble information. More details can be found [here](https://pdaf.awi.de/trac/wiki/EnsembleGeneration).
145184

146185
In summary, users can do a freerun (no DA) and extract its snapshots for EOFs analysis. Snapshots can be extracted with ncl scripts (extract2bin.ncl or extract2bin_scrio.ncl), and use generate_covar.F90 to generate required inputs as follows:
147-
186+
```
148187
eofs.dat: number of EOFs
149-
150188
eofs.bin: EOFs matrix
151-
152189
svd.bin: svd values from analysis
153-
154190
meanstate.bin (optional): usually only used for twin experiments.
191+
```
155192

156-
Note: generate_covar.F90 is serial program. If any large case needs to be analyzed, large memory is required for analysis and long execution time should be expected. These utility scripts are located at src/PDAF_bindings/utility/gen_cov/
193+
!!!Note
194+
generate_covar.F90 is serial program. If any large case needs to be analyzed, large memory is required for analysis and long execution time should be expected. These utility scripts are located at src/PDAF_bindings/utility/gen_cov/
157195

158-
159196

160-
iv. DA_data: observation inputs, file naming is data_????????.dat (?s with i8.8 format with padding 0s, representing the SCHISM time steps). If the file does not exist, the code still runs with no DA done at that DA step.
197+
4. DA_data: observation inputs, file naming is `data_????????.dat` (`?`s with i8.8 format with padding 0s, representing the SCHISM time steps). If the file does not exist, the code still runs with no DA done at that DA step.
161198

162-
Currently, it supports 6 types of observation including: elevation(z), sea-level anomaly(a), temperature (t), salinity(s), u-velocity(u), and v-velocity(v).
199+
Currently, we support 6 types of observation including: elevation(z), sea-level anomaly(a), temperature (t), salinity(s), u-velocity(u), and v-velocity(v).
163200

164201
These are ascii files and their format are as follows:
165-
202+
[here](../assets/pdaf_data_format.png)
166203

167204

168-
1st row is total number of observations, then followed by
169-
170-
obs-type, X, Y, Z, obs-values,
205+
First row is total number of observations, then followed by obs-type, X, Y, Z, obs-values.
171206

172207
If rms_type=3, one extra column is needed for observation errors. Users can also specify uniform observation error with rms_type=1,2 in pdaf.nml.
173208

174-
175-
176-
Fig: Working folder structures
209+
[Working folder structures](../assets/pdaf_folder_structures.png)
177210

178-
3. How to run it
211+
#How to run it
179212

180213
When inputs are ready, users need to create each ensemble folder with naming schism_??? (i3.3 format), and link schism input file inside. makedir.pl (under src/PDAF_bindings/utility) can be used to create each member outputs dir and link input files in each dir.
181214

182215
Users also need to create folder DA_output with two subfolder a and f for storing DA outputs after/before the DA step, respectively.
183-
216+
```
184217
DA_output/a : Analysis (After DA)
185-
186218
DA_output/f : Forecast (Before DA)
219+
```
187220

188-
To launch the run, users may need to add esmf lib path into LD_LIBRARY_PATH in the job script or environment, like the following:
221+
To launch the run, users may need to add esmf lib path into `LD_LIBRARY_PATH` in the job script or environment, like the following:
189222

223+
```
190224
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH: /where_esmf_installed/lib/libO/Linux.intel.64.openmpi.default/
191-
192-
225+
```
193226

194227
The following configs are mandatory!
195228

196-
For scribe-IO: set nc_out=1 in param.nml
197229

230+
```
231+
For scribe-IO: set nc_out=1 in param.nml
198232
For OLDIO: set nc_out=0 in param.nml
233+
```
199234

200-
201-
202-
4.Check the outputs
235+
#Check the outputs
203236

204237
During the run, users can check job screen output which will show PDAF config information and DA status, as well as timing information.
205238

206-
If users choose scribe-IO, scribe output will be located in each schism_???/outputs.
239+
If users choose scribe-IO, scribe output will be located in each `schism_???/outputs`.
207240

208-
DA_output/ will store ensemble-mean files in OLDIO format, and users need to combine them, and link local_to_global* from schism_001/outputs/ to perform the combine task.
241+
DA_output/ will store ensemble-mean files in OLDIO format, and users need to combine them, and link `local_to_global*` from `schism_001/outputs/` to perform the combine task.
209242

210-
DA effects in schism_???/output/*.nc (either scribe or schout format) only can be seen after 2nd DA (if DA frequency = output frequency), since model state update always happens at the beginning of next DA cycle. If users need to check instantaneous DA result, it will be only under DA_output/a
243+
DA effects in `schism_???/output/*.nc` (either scribe or schout format) only can be seen after 2nd DA (if DA frequency = output frequency), since model state update always happens at the beginning of next DA cycle. If users need to check instantaneous DA result, it will be only under `DA_output/a`.
211244

212-
If DA frequency > output frequency, DA effects will be seen after 1st DA + 1 output step.
245+
If DA frequency > output frequency, DA effects will be seen after 1st DA + 1 output step.

0 commit comments

Comments
 (0)