1 | >>>> install spectra tool and spherepack 3.2 library with pgf90 or ifort |
---|
2 | (g95,gfortran... not possible yet) |
---|
3 | |
---|
4 | wget -c https://www2.cisl.ucar.edu/sites/default/files/spherepack3.2.tar |
---|
5 | tar -xvf spherepack3.2.tar |
---|
6 | cd spherepack3.2 |
---|
7 | |
---|
8 | >>>> install spherepack 3.2 library |
---|
9 | >for pgf90, after discussion with Richard A. Valent (valent@ucar.edu), change line 12 of make.inc in spherepack3.2 folder: |
---|
10 | F90 := pgf90 -module ../lib -I../lib |
---|
11 | and replace by |
---|
12 | F90 := pgf90 -r8 -module ../lib -I../lib |
---|
13 | to run in double precision (better). |
---|
14 | |
---|
15 | >for ifort: |
---|
16 | change line 10 to 20 of make.inc |
---|
17 | ifeq ($(PGI),pgf90-Warning-No files to process) |
---|
18 | |
---|
19 | F90 := pgf90 -module ../lib -I../lib |
---|
20 | CPP := pgf90 -E |
---|
21 | |
---|
22 | else |
---|
23 | |
---|
24 | F90 := g95 -DG95 -g -fmod=../lib -I../lib |
---|
25 | CPP := g95 -E -DG95 |
---|
26 | |
---|
27 | endif |
---|
28 | and replace by |
---|
29 | F90 := ifort -r8 -module ../lib -I../lib |
---|
30 | CPP := ifort -fpp |
---|
31 | change line 16 of test/Makefile |
---|
32 | $(F90) $< -o $@ -L../lib -l spherepack |
---|
33 | and replace by |
---|
34 | $(F90) $< -o $@ -L../lib -lspherepack |
---|
35 | |
---|
36 | |
---|
37 | > make all > log_install 2>&1 |
---|
38 | |
---|
39 | > OK 'lib' ,... are in /planeto/milmd/library/spherepack/spherepack3.2_levan_pgf90 |
---|
40 | |
---|
41 | |
---|
42 | >>>> compile spectra_analysis program with pgf90 or ifort |
---|
43 | |
---|
44 | cd .. |
---|
45 | |
---|
46 | change the first 3 lines of the makefile: path of spherepack library you have just installed, path of netcdf libray, compiler |
---|
47 | netcdfpath=/planeto/milmd/library/netcdf/netcdf-4.0.1_levan_pgf90 (on levan) |
---|
48 | netcdfpath=/smplocal/pub/NetCDF/4.1.3/seq (on ada) |
---|
49 | netcdfpath=/usr/local (on gnome) |
---|
50 | spherepackpath=/path/to/spherepack3.2 |
---|
51 | FC=pgf90 or ifort |
---|
52 | |
---|
53 | for some machine, may load netcdf module: |
---|
54 | module load netcdf |
---|
55 | |
---|
56 | for ciclad machine, if using netcdf4: |
---|
57 | in makefile change line 7 |
---|
58 | LDFLAGS=-L${netcdfpath}/lib -lnetcdf -L${spherepackpath}/lib -lspherepack |
---|
59 | and replace by |
---|
60 | LDFLAGS=-L${netcdfpath}/lib -lnetcdf -lnetcdff -L${spherepackpath}/lib -lspherepack |
---|
61 | |
---|
62 | make spectra_analysis |
---|
63 | |
---|
64 | >>>>> test on some harmonic cases |
---|
65 | |
---|
66 | > compile test program |
---|
67 | make test_harmonic |
---|
68 | |
---|
69 | > create harmonic winds |
---|
70 | ./test_harmonic |
---|
71 | |
---|
72 | >>>>> some examples |
---|
73 | |
---|
74 | > compute kinetic energy spectrum for one harmonic test file |
---|
75 | |
---|
76 | ./spectra_analysis harmonic_64x48_lmdz_22.nc -alt none -time none -o harmonic_64x48_lmdz_22_spectra |
---|
77 | |
---|
78 | output file harmonic_64x48_lmdz_22_spectra contains: |
---|
79 | first column -> harmonic numbers |
---|
80 | second column -> amplitude of harmonic component, here only component 22 is non zero. |
---|
81 | |
---|
82 | |
---|
83 | > compute kinetic energy spectrum with temporal and vertical mean |
---|
84 | |
---|
85 | ./spectra_analysis diagfi.nc -t 5 -mt 10 -z 15 -mz 2 -o spectra |
---|
86 | |
---|
87 | compute kinetic energy spectrum for t=5,6,...,15 and z=15,16,17 and average all spectra obtained. |
---|
88 | |
---|
89 | |
---|
90 | > compute divergence and rotational part of kinetic energy spectrum |
---|
91 | |
---|
92 | ./spectra_analysis diagfi.nc -t 5 -z 15 -o spectra -divrot |
---|
93 | |
---|
94 | in spectra file, will find the rotationnal and divergent part of the decomposition of the velocity on the vectorial spherical harmonic basis: |
---|
95 | #Spherical diagfi.nc |
---|
96 | #wavenumber t= 150 z= 1 |
---|
97 | # spec_tot spec_div spec_rot |
---|
98 | 0 0.000000E+00 0.000000E+00 0.000000E+00 |
---|
99 | 1 0.119347E+01 0.101938E+01 0.174095E+00 |
---|
100 | 2 0.530388E+00 0.250037E+00 0.280350E+00 |
---|
101 | 3 0.106973E+01 0.589848E+00 0.479880E+00 |
---|
102 | ... |
---|
103 | |
---|
104 | |
---|
105 | >>>>> output interpretation |
---|
106 | |
---|
107 | One can plot velocity projection against spherical wavenumber with gnuplot for instance. |
---|
108 | In geostrophic turbulence, a n^-3 slope must appear for wavenumber n=1..100(?) and a n^-(5/3) slope for higher n. |
---|
109 | |
---|
110 | |
---|
111 | >>>>> reference |
---|
112 | J. N. Koshyk, 2001, The Horizontal Kinetic Energy Spectrum and Spectral Budget Simulated by a High-Resolution Troposphere–Stratosphere–Mesosphere GCM |
---|
113 | |
---|
114 | |
---|
115 | |
---|
116 | |
---|
117 | |
---|
118 | |
---|